8000 chore: remove helper imports · formidablejs/formidablejs@e75819e · GitHub
[go: up one dir, main page]

Skip to content

Commit e75819e

Browse files
committed
chore: remove helper imports
1 parent 4805287 commit e75819e

File tree

9 files changed

+75
-93
lines changed

9 files changed

+75
-93
lines changed

config/app.imba

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { helpers } from '@formidablejs/framework'
2-
31
export default {
42

53
# --------------------------------------------------------------------------
@@ -10,7 +8,7 @@ export default {
108
# framework needs to place the application's name in a notification or
119
# any other location as required by the application or its packages.
1210

13-
name: helpers.env 'APP_NAME', 'Formidable'
11+
name: env 'APP_NAME', 'Formidable'
1412

1513
# --------------------------------------------------------------------------
1614
# Application Environment
@@ -20,7 +18,7 @@ export default {
2018
# running in. This may determine how you prefer to configure various
2119
# services the application utilizes. Set this in your ".env" file.
2220

23-
env: helpers.env 'APP_ENV', 'production'
21+
env: env 'APP_ENV', 'production'
2422

2523
# --------------------------------------------------------------------------
2624
# Application Debug Mode
@@ -30,7 +28,7 @@ export default {
3028
# stack traces will be shown on every error that occurs within your
3129
# application. If disabled, a simple generic error page is shown.
3230

33-
debug: helpers.toBoolean(helpers.env 'APP_DEBUG', false)
31+
debug: toBoolean(env 'APP_DEBUG', false)
3432

3533
# --------------------------------------------------------------------------
3634
# Application URL
@@ -40,9 +38,9 @@ export default {
4038
# the `app.url` helper method. Please set this to the root of your
4139
# application.
4240

43-
url: helpers.env 'APP_URL', 'http://localhost:3000'
41+
url: env 'APP_URL', 'http://localhost:3000'
4442

45-
client_url: helpers.env 'CLIENT_URL', 'http://localhost:8000'
43+
client_url: env 'CLIENT_URL', 'http://localhost:8000'
4644

4745
# --------------------------------------------------------------------------
4846
# Application Locale Configuration
@@ -71,7 +69,7 @@ export default {
7169
# This key is used to encrypt and decrypt various values. Out of the box
7270
# Formidable uses this key to encrypt or decrypt cookies and the cache.
7371

74-
key: helpers.env 'APP_KEY'
72+
key: env 'APP_KEY'
7573

7674
cipher: 'AES-256-CBC'
7775

config/bugsnag.imba

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { helpers } from '@formidablejs/framework'
2-
31
export default {
42

53
# --------------------------------------------------------------------------
@@ -11,23 +9,23 @@ export default {
119
# This api key points the Bugsnag notifier to the project in your account
1210
# which should receive your application's uncaught exceptions.
1311

14-
api_key: helpers.env('BUGSNAG_API_KEY', '')
12+
api_key: env('BUGSNAG_API_KEY', '')
1513

1614
# --------------------------------------------------------------------------
1715
# App Type
1816
# --------------------------------------------------------------------------
1917
#
2018
# Set the type of application executing the current code.
2119

22-
app_type: helpers.env('BUGSNAG_APP_TYPE')
20+
app_type: env('BUGSNAG_APP_TYPE')
2321

2422
# --------------------------------------------------------------------------
2523
# App Version
2624
# --------------------------------------------------------------------------
2725
#
2826
# Set the version of application executing the current code.
2927

30-
app_version: helpers.env('BUGSNAG_APP_VERSION')
28+
app_version: env('BUGSNAG_APP_VERSION')
3129

3230
# --------------------------------------------------------------------------
3331
# Notify Endpoint
@@ -37,7 +35,7 @@ export default {
3735
# this is set to 'https://notify.bugsnag.com', but for Bugsnag Enterprise
3836
# this should be the URL to your Bugsnag instance.
3937

40-
endpoint: helpers.env('BUGSNAG_ENDPOINT')
38+
endpoint: env('BUGSNAG_ENDPOINT')
4139

4240
# --------------------------------------------------------------------------
4341
# Hostname
@@ -46,7 +44,7 @@ export default {
4644
# You can set the hostname of your server to something specific for you to
4745
# identify it by if needed.
4846

49-
hostname: helpers.env('BUGSNAG_HOSTNAME')
47+
hostname: env('BUGSNAG_HOSTNAME')
5048

5149
# --------------------------------------------------------------------------
5250
# Project Root
@@ -57,7 +55,7 @@ export default {
5755
#
5856
# If this is not set, we will automatically try to detect it.
5957

60-
project_root: helpers.env('BUGSNAG_PROJECT_ROOT')
58+
project_root: env('BUGSNAG_PROJECT_ROOT')
6159

6260
# --------------------------------------------------------------------------
6361
# Query
@@ -66,7 +64,7 @@ export default {
6664
# Enable this if you'd like us to automatically record all queries executed
6765
# under the "QUERY" tab.
6866

69-
query: helpers.env('BUGSNAG_QUERY', true)
67+
query: env('BUGSNAG_QUERY', true)
7068

7169
# --------------------------------------------------------------------------
7270
# Bindings
@@ -75,7 +73,7 @@ export default {
7573
# Enable this if you'd like us to include the query bindings in our "QUERY"
7674
# tab.
7775

78-
bindings: helpers.env('BUGSNAG_QUERY_BINDINGS', false)
76+
bindings: env('BUGSNAG_QUERY_BINDINGS', false)
7977

8078
# --------------------------------------------------------------------------
8179
# Send Code
@@ -85,7 +83,7 @@ export default {
8583
# help you diagnose even faster from within your dashboard. If you don’t
8684
# want to send this snippet, then set this to false.
8785

88-
send_code: helpers.env('BUGSNAG_SEND_CODE', true)
86+
send_code: env('BUGSNAG_SEND_CODE', true)
8987

9088
# --------------------------------------------------------------------------
9189
# Send Code
@@ -99,7 +97,7 @@ export default {
9997
# Bugsnag.registerCallback method from the boot method of your app
10098
# service resolver.
10199

102-
callbacks: helpers.env('BUGSNAG_CALLBACKS', true)
100+
callbacks: env('BUGSNAG_CALLBACKS', true)
103101

104102
# --------------------------------------------------------------------------
105103
# Release Stage
@@ -109,15 +107,15 @@ export default {
109107
#
110108
# Leaving this unset will default to using the application environment.
111109

112-
release_stage: helpers.env('BUGSNAG_RELEASE_STAGE')
110+
release_stage: env('BUGSNAG_RELEASE_STAGE')
113111

114112
# --------------------------------------------------------------------------
115113
# Notify Release Stages
116114
# --------------------------------------------------------------------------
117115
#
118116
# Set which release stages should send notifications to Bugsnag.
119117

120-
notify_release_stages: helpers.isEmpty(helpers.env('BUGSNAG_NOTIFY_RELEASE_STAGES')) ? null : helpers.env('BUGSNAG_NOTIFY_RELEASE_STAGES').replace(/\s/g, '').split(',')
118+
notify_release_stages: isEmpty(env('BUGSNAG_NOTIFY_RELEASE_STAGES')) ? null : env('BUGSNAG_NOTIFY_RELEASE_STAGES').replace(/\s/g, '').split(',')
121119

122120
# --------------------------------------------------------------------------
123121
# User
@@ -126,14 +124,14 @@ export default {
126124
# Enable this if you'd like us to set the current user logged in via
127125
# Formidable's authentication system.
128126

129-
user: helpers.env('BUGSNAG_USER', true)
127+
user: env('BUGSNAG_USER', true)
130128

131129
# --------------------------------------------------------------------------
132130
# Redacted Keys
133131
# --------------------------------------------------------------------------
134132
#
135133
# An array of metadata keys that should be redacted.
136134

137-
redacted_keys: helpers.isEmpty(helpers.env('BUGSNAG_REDACTED_KEYS')) ? null : helpers.env('BUGSNAG_REDACTED_KEYS').split(',')
135+
redacted_keys: isEmpty(env('BUGSNAG_REDACTED_KEYS')) ? null : env('BUGSNAG_REDACTED_KEYS').split(',')
138136

139137
}

config/cors.imba

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { helpers } from '@formidablejs/framework'
2-
31
export default {
42

53
# --------------------------------------------------------------------------
@@ -19,7 +17,7 @@ export default {
1917
allowed_methods: ['*']
2018

2119
# Matches the request origin. '['*']' allows all origins. Wildcards can be used, eg `*.mydomain.com`
22-
allowed_origins: [ helpers.env('CLIENT_URL', '*') ]
20+
allowed_origins: [ env('CLIENT_URL', '*') ]
2321

2422
# Sets the Access-Control-Allow-Headers response header. `['*']` allows all headers.
2523
allowed_headers: ['*']

config/database.imba

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { helpers } from '@formidablejs/framework'
2-
31
export default {
42

53
# --------------------------------------------------------------------------
@@ -10,7 +8,7 @@ export default {
108
# to use as your default connection for all database work. Of course
119
# you may use many connections at once using the Database library.
1210

13-
default: helpers.env 'DB_CONNECTION', 'mysql'
11+
default: env 'DB_CONNECTION', 'mysql'
1412

1513
# --------------------------------------------------------------------------
1614
# Database Connections
@@ -22,39 +20,39 @@ export default {
2220
connections: {
2321
sqlite: {
2422
driver: 'sqlite3'
25-
filename: helpers.env 'DATABASE_URL'
23+
filename: env 'DATABASE_URL'
2624
}
2725

2826
mysql: {
2927
driver: 'mysql2'
30-
url: helpers.env 'DATABASE_URL'
31-
host: helpers.env 'DB_HOST', '127.0.0.1'
32-
port: helpers.env 'DB_PORT', '3306'
33-
user: helpers.env 'DB_USER', ''
34-
database: helpers.env 'DB_DATABASE', ''
35-
password: helpers.env 'DB_PASSWORD', ''
28+
url: env 'DATABASE_URL'
29+
host: env 'DB_HOST', '127.0.0.1'
30+
port: env 'DB_PORT', '3306'
31+
user: env 'DB_USER', ''
32+
database: env 'DB_DATABASE', ''
33+
password: env 'DB_PASSWORD', ''
3634
charset: 'utf8mb4'
3735
}
3836

3937
pgsql: {
4038
driver: 'pg'
41-
url: helpers.env 'DATABASE_URL'
42-
host: helpers.env 'DB_HOST', '127.0.0.1'
43-
port: helpers.env 'DB_PORT', '5432'
44-
user: helpers.env 'DB_USER', ''
45-
database: helpers.env 'DB_DATABASE', ''
46-
password: helpers.env 'DB_PASSWORD', ''
39+
url: env 'DATABASE_URL'
40+
host: env 'DB_HOST', '127.0.0.1'
41+
port: env 'DB_PORT', '5432'
42+
user: env 'DB_USER', ''
43+
database: env 'DB_DATABASE', ''
44+
password: env 'DB_PASSWORD', ''
4745
charset: 'utf8'
4846
}
4947

5048
mssql: {
5149
driver: 'tedious'
52-
url: helpers.env 'DATABASE_URL'
53-
host: helpers.env 'DB_HOST', '127.0.0.1'
54-
port: helpers.env 'DB_PORT', '5432'
55-
user: helpers.env 'DB_USER', ''
56-
database: helpers.env 'DB_DATABASE', ''
57-
password: helpers.env 'DB_PASSWORD', ''
50+
url: env 'DATABASE_URL'
51+
host: env 'DB_HOST', '127.0.0.1'
52+
port: env 'DB_PORT', '5432'
53+
user: env 'DB_USER', ''
54+
database: env 'DB_DATABASE', ''
55+
password: env 'DB_PASSWORD', ''
5856
charset: 'utf8'
5957
}
6058
}
@@ -93,31 +91,31 @@ export default {
9391

9492
redis: {
9593
options: {
96-
prefix: helpers.env 'REDIS_PREFIX', helpers.slug(helpers.env('APP_NAME', 'formidable'), '_') + '_database_'
94+
prefix: env 'REDIS_PREFIX', slug(env('APP_NAME', 'formidable'), '_') + '_database_'
9795
}
9896

9997
default: {
100-
url: helpers.env 'REDIS_URL'
101-
host: helpers.env 'REDIS_HOST', '127.0.0.1'
102-
password: helpers.env 'REDIS_PASSWORD', null
103-
port: helpers.env 'REDIS_PORT', '6379'
104-
database: helpers.env 'REDIS_DB', '0'
98+
url: env 'REDIS_URL'
99+
host: env 'REDIS_HOST', '127.0.0.1'
100+
password: env 'REDIS_PASSWORD', null
101+
port: env 'REDIS_PORT', '6379'
102+
database: env 'REDIS_DB', '0'
105103
}
106104

107105
cache: {
108-
url: helpers.env 'REDIS_URL'
109-
host: helpers.env 'REDIS_HOST', '127.0.0.1'
110-
password: helpers.env 'REDIS_PASSWORD', null
111-
port: helpers.env 'REDIS_PORT', '6379'
112-
database: helpers.env 'REDIS_CACHE_DB', '1'
106+
url: env 'REDIS_URL'
107+
host: env 'REDIS_HOST', '127.0.0.1'
108+
password: env 'REDIS_PASSWORD', null
109+
port: env 'REDIS_PORT', '6379'
110+
database: env 'REDIS_CACHE_DB', '1'
113111
}
114112

115113
queue: {
116-
url: helpers.env 'REDIS_URL'
117-
host: helpers.env 'REDIS_HOST', '127.0.0.1'
118-
password: helpers.env 'REDIS_PASSWORD', null
119-
port: helpers.env 'REDIS_PORT', '6379'
120-
database: helpers.env 'REDIS_CACHE_DB', '2'
114+
url: env 'REDIS_URL'
115+
host: env 'REDIS_HOST', '127.0.0.1'
116+
password: env 'REDIS_PASSWORD', null
117+
port: env 'REDIS_PORT', '6379'
118+
database: env 'REDIS_CACHE_DB', '2'
121119
}
122120
}
123121

config/hashing.imba

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { helpers } from '@formidablejs/framework'
2-
31
export default {
42

53
# --------------------------------------------------------------------------
@@ -21,7 +19,7 @@ export default {
2119
# control the amount of time it takes to hash the given password.
2220

2321
bcrypt: {
24-
rounds: helpers.env 'BCRYPT_ROUNDS', 10
22+
rounds: env 'BCRYPT_ROUNDS', 10
2523
}
2624

2725
# --------------------------------------------------------------------------
@@ -33,9 +31,9 @@ export default {
3331
# control the amount of time it takes to hash the given password.
3432

3533
argon2: {
36-
memoryCost: helpers.env 'ARGON2_MEMORY', 1024
37-
parallelism: helpers.env 'ARGON2_THREADS', 1
38-
timeCost: helpers.env 'ARGON2_TIME', 2
34+
memoryCost: env 'ARGON2_MEMORY', 1024
35+
parallelism: env 'ARGON2_THREADS', 1
36+
timeCost: env 'ARGON2_TIME', 2
3937
}
4038

4139
}

config/logging.imba

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { env } from '@formidablejs/framework'
2-
31
export default {
42
# --------------------------------------------------------------------------
53
# Default Log Channel

config/mail.imba

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { helpers } from '@formidablejs/framework'
2-
31
export default {
42
# --------------------------------------------------------------------------
53
# Default Mailer
@@ -20,11 +18,11 @@ export default {
2018
mailers: {
2119
smtp: {
2220
transport: 'smtp'
23-
host: helpers.env 'MAIL_HOST', 'smtp.mailgun.org'
24-
port: helpers.env 'MAIL_PORT', 587
25-
secure: helpers.env 'MAIL_SECURE', true
26-
username: helpers.env 'MAIL_USERNAME'
27-
password: helpers.env 'MAIL_PASSWORD'
21+
host: env 'MAIL_HOST', 'smtp.mailgun.org'
22+
port: env 'MAIL_PORT', 587
23+
secure: env 'MAIL_SECURE', true
24+
username: env 'MAIL_USERNAME'
25+
password: env 'MAIL_PASSWORD'
2826
}
2927

3028
sendmail: {
@@ -41,7 +39,7 @@ export default {
4139
# The email address that will be used in the "From" field of all emails.
4240

4341
from: {
44-
address: helpers.env 'MAIL_FROM_ADDRESS', 'hello@example.com'
45-
name: helpers.env 'MAIL_FROM_NAME', 'Example'
42+
address: env 'MAIL_FROM_ADDRESS', 'hello@example.com'
43+
name: env 'MAIL_FROM_NAME', 'Example'
4644
}
4745
}

config/queue.imba

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { env } from '@formidablejs/framework'
2-
31
export default {
42

53
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)
0