@feathersjs/configuration 5.0.0-pre.3 → 5.0.0-pre.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,405 +3,355 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21)
7
-
6
+ # [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07)
8
7
 
9
- ### Bug Fixes
8
+ ### Features
10
9
 
11
- * **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897))
10
+ - **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa))
11
+ - **schema:** Make schemas validation library independent and add TypeBox support ([#2772](https://github.com/feathersjs/feathers/issues/2772)) ([44172d9](https://github.com/feathersjs/feathers/commit/44172d99b566d11d9ceda04f1d0bf72b6d05ce76))
12
12
 
13
+ # [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16)
13
14
 
14
- ### Features
15
+ **Note:** Version bump only for package @feathersjs/configuration
15
16
 
16
- * **dependencies:** Remove direct debug dependency ([#2296](https://github.com/feathersjs/feathers/issues/2296)) ([501d416](https://github.com/feathersjs/feathers/commit/501d4164d30c6a126906dc640cdfdc82207ba34a))
17
+ # [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03)
17
18
 
19
+ ### Bug Fixes
18
20
 
21
+ - **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f))
19
22
 
23
+ # [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13)
20
24
 
25
+ **Note:** Version bump only for package @feathersjs/configuration
21
26
 
22
- # [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06)
27
+ # [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22)
23
28
 
24
29
  **Note:** Version bump only for package @feathersjs/configuration
25
30
 
31
+ # [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22)
26
32
 
33
+ **Note:** Version bump only for package @feathersjs/configuration
27
34
 
35
+ # [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21)
28
36
 
37
+ **Note:** Version bump only for package @feathersjs/configuration
29
38
 
30
- # [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03)
39
+ # [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06)
31
40
 
32
41
  **Note:** Version bump only for package @feathersjs/configuration
33
42
 
43
+ # [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24)
34
44
 
45
+ **Note:** Version bump only for package @feathersjs/configuration
35
46
 
47
+ # [5.0.0-pre.21](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.20...v5.0.0-pre.21) (2022-05-23)
36
48
 
49
+ **Note:** Version bump only for package @feathersjs/configuration
37
50
 
38
- # [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28)
39
-
51
+ # [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04)
40
52
 
41
53
  ### Bug Fixes
42
54
 
43
- * Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60))
55
+ - **configuration:** Only validate the initial configuration against the schema ([#2622](https://github.com/feathersjs/feathers/issues/2622)) ([386c5e2](https://github.com/feathersjs/feathers/commit/386c5e2e67bfad4fb4333f2e3e17f7d7e09ac27e))
56
+ - **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507))
44
57
 
58
+ # [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01)
45
59
 
46
- ### Features
60
+ **Note:** Version bump only for package @feathersjs/configuration
47
61
 
48
- * Feathers v5 core refactoring and features ([#2255](https://github.com/feathersjs/feathers/issues/2255)) ([2dafb7c](https://github.com/feathersjs/feathers/commit/2dafb7ce14ba57406aeec13d10ca45b1e709bee9))
62
+ # [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11)
49
63
 
64
+ ### Features
50
65
 
66
+ - **configuration:** Allow app configuration to be validated against a schema ([#2590](https://github.com/feathersjs/feathers/issues/2590)) ([a268f86](https://github.com/feathersjs/feathers/commit/a268f86da92a8ada14ed11ab456aac0a4bba5bb0))
51
67
 
68
+ # [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15)
52
69
 
70
+ **Note:** Version bump only for package @feathersjs/configuration
53
71
 
54
- # [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17)
72
+ # [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12)
55
73
 
74
+ **Note:** Version bump only for package @feathersjs/configuration
56
75
 
76
+ # [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27)
57
77
 
58
- # [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19)
78
+ **Note:** Version bump only for package @feathersjs/configuration
59
79
 
80
+ # [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13)
60
81
 
61
- ### chore
82
+ **Note:** Version bump only for package @feathersjs/configuration
62
83
 
63
- * **configuration:** Remove environment variable substitution ([#1942](https://github.com/feathersjs/feathers/issues/1942)) ([caaa21f](https://github.com/feathersjs/feathers/commit/caaa21ffdc6a8dcac82fb403c91d9d4b781a6c0a))
84
+ # [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13)
64
85
 
86
+ **Note:** Version bump only for package @feathersjs/configuration
65
87
 
66
- ### BREAKING CHANGES
88
+ # [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12)
67
89
 
68
- * **configuration:** Falls back to node-config instead of adding additional
69
- functionality like path replacements and automatic environment variable insertion.
90
+ **Note:** Version bump only for package @feathersjs/configuration
70
91
 
92
+ # [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06)
71
93
 
94
+ **Note:** Version bump only for package @feathersjs/configuration
72
95
 
96
+ # [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19)
73
97
 
98
+ **Note:** Version bump only for package @feathersjs/configuration
74
99
 
75
- # [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19)
100
+ # [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09)
76
101
 
102
+ **Note:** Version bump only for package @feathersjs/configuration
77
103
 
78
- ### chore
104
+ # [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09)
79
105
 
80
- * **configuration:** Remove environment variable substitution ([#1942](https://github.com/feathersjs/feathers/issues/1942)) ([caaa21f](https://github.com/feathersjs/feathers/commit/caaa21ffdc6a8dcac82fb403c91d9d4b781a6c0a))
106
+ **Note:** Version bump only for package @feathersjs/configuration
81
107
 
108
+ # [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09)
82
109
 
83
- ### BREAKING CHANGES
110
+ **Note:** Version bump only for package @feathersjs/configuration
84
111
 
85
- * **configuration:** Falls back to node-config instead of adding additional
86
- functionality like path replacements and automatic environment variable insertion.
112
+ # [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08)
87
113
 
114
+ **Note:** Version bump only for package @feathersjs/configuration
88
115
 
116
+ # [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23)
89
117
 
118
+ ### Bug Fixes
90
119
 
91
- ## [4.5.9](https://github.com/feathersjs/feathers/compare/v4.5.8...v4.5.9) (2020-10-09)
120
+ - **koa:** Use extended query parser for compatibility ([#2397](https://github.com/feathersjs/feathers/issues/2397)) ([b2944ba](https://github.com/feathersjs/feathers/commit/b2944bac3ec6d5ecc80dc518cd4e58093692db74))
92
121
 
122
+ # [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13)
93
123
 
94
- ### Bug Fixes
124
+ **Note:** Version bump only for package @feathersjs/configuration
95
125
 
96
- * **configuration:** Fix handling of config values that start with . or .. but are not actually relative paths; e.g. ".foo" or "..bar" ([#2065](https://github.com/feathersjs/feathers/issues/2065)) ([d07bf59](https://github.com/feathersjs/feathers/commit/d07bf5902e9c8c606f16b9523472972d3d2e9b49))
126
+ # [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21)
97
127
 
128
+ ### Bug Fixes
98
129
 
130
+ - **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897))
99
131
 
132
+ ### Features
100
133
 
134
+ - **dependencies:** Remove direct debug dependency ([#2296](https://github.com/feathersjs/feathers/issues/2296)) ([501d416](https://github.com/feathersjs/feathers/commit/501d4164d30c6a126906dc640cdfdc82207ba34a))
101
135
 
102
- ## [4.5.8](https://github.com/feathersjs/feathers/compare/v4.5.7...v4.5.8) (2020-08-12)
136
+ # [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06)
103
137
 
104
138
  **Note:** Version bump only for package @feathersjs/configuration
105
139
 
140
+ # [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03)
106
141
 
142
+ **Note:** Version bump only for package @feathersjs/configuration
107
143
 
144
+ # [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28)
108
145
 
146
+ ### Bug Fixes
109
147
 
110
- ## [4.5.7](https://github.com/feathersjs/feathers/compare/v4.5.6...v4.5.7) (2020-07-24)
111
-
112
- **Note:** Version bump only for package @feathersjs/configuration
148
+ - Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60))
113
149
 
150
+ ### Features
114
151
 
152
+ - Feathers v5 core refactoring and features ([#2255](https://github.com/feathersjs/feathers/issues/2255)) ([2dafb7c](https://github.com/feathersjs/feathers/commit/2dafb7ce14ba57406aeec13d10ca45b1e709bee9))
115
153
 
154
+ # [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17)
116
155
 
156
+ # [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19)
117
157
 
118
- ## [4.5.5](https://github.com/feathersjs/feathers/compare/v4.5.4...v4.5.5) (2020-07-11)
158
+ ### chore
119
159
 
120
- **Note:** Version bump only for package @feathersjs/configuration
160
+ - **configuration:** Remove environment variable substitution ([#1942](https://github.com/feathersjs/feathers/issues/1942)) ([caaa21f](https://github.com/feathersjs/feathers/commit/caaa21ffdc6a8dcac82fb403c91d9d4b781a6c0a))
121
161
 
162
+ ### BREAKING CHANGES
122
163
 
164
+ - **configuration:** Falls back to node-config instead of adding additional
165
+ functionality like path replacements and automatic environment variable insertion.
123
166
 
167
+ # [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19)
124
168
 
169
+ ### chore
125
170
 
126
- ## [4.5.3](https://github.com/feathersjs/feathers/compare/v4.5.2...v4.5.3) (2020-04-17)
171
+ - **configuration:** Remove environment variable substitution ([#1942](https://github.com/feathersjs/feathers/issues/1942)) ([caaa21f](https://github.com/feathersjs/feathers/commit/caaa21ffdc6a8dcac82fb403c91d9d4b781a6c0a))
127
172
 
128
- **Note:** Version bump only for package @feathersjs/configuration
173
+ ### BREAKING CHANGES
129
174
 
175
+ - **configuration:** Falls back to node-config instead of adding additional
176
+ functionality like path replacements and automatic environment variable insertion.
130
177
 
178
+ ## [4.5.9](https://github.com/feathersjs/feathers/compare/v4.5.8...v4.5.9) (2020-10-09)
131
179
 
180
+ ### Bug Fixes
132
181
 
182
+ - **configuration:** Fix handling of config values that start with . or .. but are not actually relative paths; e.g. ".foo" or "..bar" ([#2065](https://github.com/feathersjs/feathers/issues/2065)) ([d07bf59](https://github.com/feathersjs/feathers/commit/d07bf5902e9c8c606f16b9523472972d3d2e9b49))
133
183
 
134
- ## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04)
184
+ ## [4.5.8](https://github.com/feathersjs/feathers/compare/v4.5.7...v4.5.8) (2020-08-12)
135
185
 
136
186
  **Note:** Version bump only for package @feathersjs/configuration
137
187
 
188
+ ## [4.5.7](https://github.com/feathersjs/feathers/compare/v4.5.6...v4.5.7) (2020-07-24)
138
189
 
190
+ **Note:** Version bump only for package @feathersjs/configuration
139
191
 
192
+ ## [4.5.5](https://github.com/feathersjs/feathers/compare/v4.5.4...v4.5.5) (2020-07-11)
140
193
 
194
+ **Note:** Version bump only for package @feathersjs/configuration
141
195
 
142
- ## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24)
196
+ ## [4.5.3](https://github.com/feathersjs/feathers/compare/v4.5.2...v4.5.3) (2020-04-17)
143
197
 
144
198
  **Note:** Version bump only for package @feathersjs/configuration
145
199
 
200
+ ## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04)
146
201
 
202
+ **Note:** Version bump only for package @feathersjs/configuration
147
203
 
204
+ ## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24)
148
205
 
206
+ **Note:** Version bump only for package @feathersjs/configuration
149
207
 
150
208
  # [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18)
151
209
 
152
210
  **Note:** Version bump only for package @feathersjs/configuration
153
211
 
154
-
155
-
156
-
157
-
158
212
  ## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06)
159
213
 
160
214
  **Note:** Version bump only for package @feathersjs/configuration
161
215
 
162
-
163
-
164
-
165
-
166
216
  ## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27)
167
217
 
168
218
  **Note:** Version bump only for package @feathersjs/configuration
169
219
 
170
-
171
-
172
-
173
-
174
220
  # [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27)
175
221
 
176
222
  **Note:** Version bump only for package @feathersjs/configuration
177
223
 
178
-
179
-
180
-
181
-
182
224
  ## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11)
183
225
 
184
226
  **Note:** Version bump only for package @feathersjs/configuration
185
227
 
186
-
187
-
188
-
189
-
190
228
  ## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26)
191
229
 
192
230
  **Note:** Version bump only for package @feathersjs/configuration
193
231
 
194
-
195
-
196
-
197
-
198
232
  ## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26)
199
233
 
200
234
  **Note:** Version bump only for package @feathersjs/configuration
201
235
 
202
-
203
-
204
-
205
-
206
236
  ## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14)
207
237
 
208
238
  **Note:** Version bump only for package @feathersjs/configuration
209
239
 
210
-
211
-
212
-
213
-
214
240
  ## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03)
215
241
 
216
242
  **Note:** Version bump only for package @feathersjs/configuration
217
243
 
218
-
219
-
220
-
221
-
222
244
  ## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21)
223
245
 
224
-
225
246
  ### Bug Fixes
226
247
 
227
- * Small improvements in dependencies and code sturcture ([#1562](https://github.com/feathersjs/feathers/issues/1562)) ([42c13e2](https://github.com/feathersjs/feathers/commit/42c13e2))
228
-
229
-
230
-
231
-
248
+ - Small improvements in dependencies and code sturcture ([#1562](https://github.com/feathersjs/feathers/issues/1562)) ([42c13e2](https://github.com/feathersjs/feathers/commit/42c13e2))
232
249
 
233
250
  ## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16)
234
251
 
235
252
  **Note:** Version bump only for package @feathersjs/configuration
236
253
 
237
-
238
-
239
-
240
-
241
254
  ## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09)
242
255
 
243
256
  **Note:** Version bump only for package @feathersjs/configuration
244
257
 
245
-
246
-
247
-
248
-
249
258
  # [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27)
250
259
 
251
260
  **Note:** Version bump only for package @feathersjs/configuration
252
261
 
253
-
254
-
255
-
256
-
257
262
  # [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22)
258
263
 
259
264
  **Note:** Version bump only for package @feathersjs/configuration
260
265
 
261
-
262
-
263
-
264
-
265
266
  # [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19)
266
267
 
267
-
268
268
  ### Bug Fixes
269
269
 
270
- * Update all dependencies ([7d53a00](https://github.com/feathersjs/feathers/commit/7d53a00))
271
-
272
-
273
-
274
-
270
+ - Update all dependencies ([7d53a00](https://github.com/feathersjs/feathers/commit/7d53a00))
275
271
 
276
272
  # [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02)
277
273
 
278
274
  **Note:** Version bump only for package @feathersjs/configuration
279
275
 
280
-
281
-
282
-
283
-
284
276
  # [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11)
285
277
 
286
278
  **Note:** Version bump only for package @feathersjs/configuration
287
279
 
288
-
289
-
290
-
291
-
292
280
  # [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10)
293
281
 
294
282
  **Note:** Version bump only for package @feathersjs/configuration
295
283
 
296
-
297
-
298
-
299
-
300
284
  # [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05)
301
285
 
302
286
  **Note:** Version bump only for package @feathersjs/configuration
303
287
 
304
-
305
-
306
-
307
-
308
288
  # [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01)
309
289
 
310
-
311
290
  ### Bug Fixes
312
291
 
313
- * Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f))
314
-
315
-
316
-
317
-
292
+ - Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f))
318
293
 
319
294
  # [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15)
320
295
 
321
296
  **Note:** Version bump only for package @feathersjs/configuration
322
297
 
323
-
324
-
325
-
326
-
327
298
  # [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08)
328
299
 
329
300
  **Note:** Version bump only for package @feathersjs/configuration
330
301
 
331
-
332
-
333
-
334
-
335
302
  # [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21)
336
303
 
337
-
338
304
  ### Bug Fixes
339
305
 
340
- * Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6))
341
- * **package:** update config to version 3.0.0 ([#1100](https://github.com/feathersjs/feathers/issues/1100)) ([c9f4b42](https://github.com/feathersjs/feathers/commit/c9f4b42))
342
- * Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803))
343
- * **package:** update debug to version 3.0.0 ([#45](https://github.com/feathersjs/feathers/issues/45)) ([2391434](https://github.com/feathersjs/feathers/commit/2391434))
344
- * **package:** update debug to version 3.0.1 ([#46](https://github.com/feathersjs/feathers/issues/46)) ([f8ada69](https://github.com/feathersjs/feathers/commit/f8ada69))
345
-
306
+ - Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6))
307
+ - **package:** update config to version 3.0.0 ([#1100](https://github.com/feathersjs/feathers/issues/1100)) ([c9f4b42](https://github.com/feathersjs/feathers/commit/c9f4b42))
308
+ - Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803))
309
+ - **package:** update debug to version 3.0.0 ([#45](https://github.com/feathersjs/feathers/issues/45)) ([2391434](https://github.com/feathersjs/feathers/commit/2391434))
310
+ - **package:** update debug to version 3.0.1 ([#46](https://github.com/feathersjs/feathers/issues/46)) ([f8ada69](https://github.com/feathersjs/feathers/commit/f8ada69))
346
311
 
347
312
  ### Features
348
313
 
349
- * Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713))
350
-
351
-
352
-
353
-
314
+ - Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713))
354
315
 
355
316
  ## [2.0.6](https://github.com/feathersjs/feathers/compare/@feathersjs/configuration@2.0.5...@feathersjs/configuration@2.0.6) (2019-01-02)
356
317
 
357
318
  **Note:** Version bump only for package @feathersjs/configuration
358
319
 
359
-
360
-
361
-
362
-
363
320
  <a name="2.0.5"></a>
364
- ## [2.0.5](https://github.com/feathersjs/feathers/compare/@feathersjs/configuration@2.0.4...@feathersjs/configuration@2.0.5) (2018-12-16)
365
321
 
322
+ ## [2.0.5](https://github.com/feathersjs/feathers/compare/@feathersjs/configuration@2.0.4...@feathersjs/configuration@2.0.5) (2018-12-16)
366
323
 
367
324
  ### Bug Fixes
368
325
 
369
- * Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803))
370
- * **package:** update config to version 3.0.0 ([#1100](https://github.com/feathersjs/feathers/issues/1100)) ([c9f4b42](https://github.com/feathersjs/feathers/commit/c9f4b42))
371
-
372
-
373
-
374
-
326
+ - Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803))
327
+ - **package:** update config to version 3.0.0 ([#1100](https://github.com/feathersjs/feathers/issues/1100)) ([c9f4b42](https://github.com/feathersjs/feathers/commit/c9f4b42))
375
328
 
376
329
  <a name="2.0.4"></a>
330
+
377
331
  ## [2.0.4](https://github.com/feathersjs/feathers/compare/@feathersjs/configuration@2.0.3...@feathersjs/configuration@2.0.4) (2018-09-21)
378
332
 
379
333
  **Note:** Version bump only for package @feathersjs/configuration
380
334
 
381
-
382
-
383
-
384
-
385
335
  <a name="2.0.3"></a>
336
+
386
337
  ## [2.0.3](https://github.com/feathersjs/feathers/compare/@feathersjs/configuration@2.0.2...@feathersjs/configuration@2.0.3) (2018-09-17)
387
338
 
388
339
  **Note:** Version bump only for package @feathersjs/configuration
389
340
 
390
-
391
-
392
-
393
-
394
341
  <a name="2.0.2"></a>
342
+
395
343
  ## [2.0.2](https://github.com/feathersjs/feathers/compare/@feathersjs/configuration@2.0.1...@feathersjs/configuration@2.0.2) (2018-09-02)
396
344
 
397
345
  **Note:** Version bump only for package @feathersjs/configuration
398
346
 
399
347
  <a name="2.0.1"></a>
348
+
400
349
  ## 2.0.1
401
350
 
402
351
  - Migrate to Monorepo ([feathers#462](https://github.com/feathersjs/feathers/issues/462))
403
352
 
404
353
  ## [v2.0.0](https://github.com/feathersjs/configuration/tree/v2.0.0) (2018-07-30)
354
+
405
355
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v1.0.2...v2.0.0)
406
356
 
407
357
  **Closed issues:**
@@ -416,13 +366,15 @@ functionality like path replacements and automatic environment variable insertio
416
366
  - Update mocha to the latest version 🚀 [\#56](https://github.com/feathersjs/configuration/pull/56) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
417
367
 
418
368
  ## [v1.0.2](https://github.com/feathersjs/configuration/tree/v1.0.2) (2018-01-02)
369
+
419
370
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v1.0.1...v1.0.2)
420
371
 
421
372
  **Merged pull requests:**
422
373
 
423
- - Remove example and update Readme to point directly to the Feathers docs [\#55](https://github.com/feathersjs/configuration/pull/55) ([daffl](https://github.com/daffl))
374
+ - Remove example and update Readme to point directly to the Feathers docs [\#55](https://github.com/feathersjs/configuration/pull/55) ([daffl](https://github.com/daffl))
424
375
 
425
376
  ## [v1.0.1](https://github.com/feathersjs/configuration/tree/v1.0.1) (2017-11-16)
377
+
426
378
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v1.0.0...v1.0.1)
427
379
 
428
380
  **Merged pull requests:**
@@ -431,9 +383,11 @@ functionality like path replacements and automatic environment variable insertio
431
383
  - Update nsp to the latest version 🚀 [\#52](https://github.com/feathersjs/configuration/pull/52) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
432
384
 
433
385
  ## [v1.0.0](https://github.com/feathersjs/configuration/tree/v1.0.0) (2017-11-01)
386
+
434
387
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v1.0.0-pre.1...v1.0.0)
435
388
 
436
389
  ## [v1.0.0-pre.1](https://github.com/feathersjs/configuration/tree/v1.0.0-pre.1) (2017-10-23)
390
+
437
391
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.4.2...v1.0.0-pre.1)
438
392
 
439
393
  **Closed issues:**
@@ -445,6 +399,7 @@ functionality like path replacements and automatic environment variable insertio
445
399
  - Update to new plugin infrastructure and npm scopes [\#51](https://github.com/feathersjs/configuration/pull/51) ([daffl](https://github.com/daffl))
446
400
 
447
401
  ## [v0.4.2](https://github.com/feathersjs/configuration/tree/v0.4.2) (2017-10-15)
402
+
448
403
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.4.1...v0.4.2)
449
404
 
450
405
  **Closed issues:**
@@ -456,7 +411,7 @@ functionality like path replacements and automatic environment variable insertio
456
411
  - Nested configuration [\#38](https://github.com/feathersjs/configuration/issues/38)
457
412
  - Stuck in configuration loophole... [\#37](https://github.com/feathersjs/configuration/issues/37)
458
413
  - Docs are wrong [\#36](https://github.com/feathersjs/configuration/issues/36)
459
- - Why use "NODE\_ENV=development" with default.json? [\#33](https://github.com/feathersjs/configuration/issues/33)
414
+ - Why use "NODE_ENV=development" with default.json? [\#33](https://github.com/feathersjs/configuration/issues/33)
460
415
 
461
416
  **Merged pull requests:**
462
417
 
@@ -472,6 +427,7 @@ functionality like path replacements and automatic environment variable insertio
472
427
  - 👻😱 Node.js 0.10 is unmaintained 😱👻 [\#30](https://github.com/feathersjs/configuration/pull/30) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
473
428
 
474
429
  ## [v0.4.1](https://github.com/feathersjs/configuration/tree/v0.4.1) (2016-10-24)
430
+
475
431
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.4.0...v0.4.1)
476
432
 
477
433
  **Closed issues:**
@@ -484,6 +440,7 @@ functionality like path replacements and automatic environment variable insertio
484
440
  - jshint —\> semistandard [\#28](https://github.com/feathersjs/configuration/pull/28) ([corymsmith](https://github.com/corymsmith))
485
441
 
486
442
  ## [v0.4.0](https://github.com/feathersjs/configuration/tree/v0.4.0) (2016-10-22)
443
+
487
444
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.3.3...v0.4.0)
488
445
 
489
446
  **Implemented enhancements:**
@@ -496,9 +453,11 @@ functionality like path replacements and automatic environment variable insertio
496
453
  - Make this repo more about managing configuration [\#24](https://github.com/feathersjs/configuration/issues/24)
497
454
 
498
455
  ## [v0.3.3](https://github.com/feathersjs/configuration/tree/v0.3.3) (2016-09-12)
456
+
499
457
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.3.2...v0.3.3)
500
458
 
501
459
  ## [v0.3.2](https://github.com/feathersjs/configuration/tree/v0.3.2) (2016-09-12)
460
+
502
461
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.3.1...v0.3.2)
503
462
 
504
463
  **Closed issues:**
@@ -510,6 +469,7 @@ functionality like path replacements and automatic environment variable insertio
510
469
  - Remove check for development mode [\#21](https://github.com/feathersjs/configuration/pull/21) ([daffl](https://github.com/daffl))
511
470
 
512
471
  ## [v0.3.1](https://github.com/feathersjs/configuration/tree/v0.3.1) (2016-08-15)
472
+
513
473
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.3.0...v0.3.1)
514
474
 
515
475
  **Merged pull requests:**
@@ -518,17 +478,19 @@ functionality like path replacements and automatic environment variable insertio
518
478
  - Update mocha to version 3.0.0 🚀 [\#18](https://github.com/feathersjs/configuration/pull/18) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
519
479
 
520
480
  ## [v0.3.0](https://github.com/feathersjs/configuration/tree/v0.3.0) (2016-05-22)
481
+
521
482
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.2.3...v0.3.0)
522
483
 
523
484
  **Closed issues:**
524
485
 
525
- - \<NODE\_ENV\>.json config need deep merge options [\#16](https://github.com/feathersjs/configuration/issues/16)
486
+ - \<NODE_ENV\>.json config need deep merge options [\#16](https://github.com/feathersjs/configuration/issues/16)
526
487
 
527
488
  **Merged pull requests:**
528
489
 
529
490
  - Add functionality for deeply extending configuration [\#17](https://github.com/feathersjs/configuration/pull/17) ([daffl](https://github.com/daffl))
530
491
 
531
492
  ## [v0.2.3](https://github.com/feathersjs/configuration/tree/v0.2.3) (2016-04-24)
493
+
532
494
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.2.2...v0.2.3)
533
495
 
534
496
  **Closed issues:**
@@ -541,6 +503,7 @@ functionality like path replacements and automatic environment variable insertio
541
503
  - Update all dependencies 🌴 [\#10](https://github.com/feathersjs/configuration/pull/10) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
542
504
 
543
505
  ## [v0.2.2](https://github.com/feathersjs/configuration/tree/v0.2.2) (2016-03-27)
506
+
544
507
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.2.1...v0.2.2)
545
508
 
546
509
  **Merged pull requests:**
@@ -548,6 +511,7 @@ functionality like path replacements and automatic environment variable insertio
548
511
  - Expanding environment variables in \<env\>.json [\#9](https://github.com/feathersjs/configuration/pull/9) ([derek-watson](https://github.com/derek-watson))
549
512
 
550
513
  ## [v0.2.1](https://github.com/feathersjs/configuration/tree/v0.2.1) (2016-03-12)
514
+
551
515
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.2.0...v0.2.1)
552
516
 
553
517
  **Merged pull requests:**
@@ -555,6 +519,7 @@ functionality like path replacements and automatic environment variable insertio
555
519
  - Makes sure that arrays get converted properly [\#7](https://github.com/feathersjs/configuration/pull/7) ([daffl](https://github.com/daffl))
556
520
 
557
521
  ## [v0.2.0](https://github.com/feathersjs/configuration/tree/v0.2.0) (2016-03-09)
522
+
558
523
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.1.1...v0.2.0)
559
524
 
560
525
  **Closed issues:**
@@ -566,11 +531,12 @@ functionality like path replacements and automatic environment variable insertio
566
531
  - Implement an escape character [\#6](https://github.com/feathersjs/configuration/pull/6) ([daffl](https://github.com/daffl))
567
532
 
568
533
  ## [v0.1.1](https://github.com/feathersjs/configuration/tree/v0.1.1) (2016-03-09)
534
+
569
535
  [Full Changelog](https://github.com/feathersjs/configuration/compare/v0.1.0...v0.1.1)
570
536
 
571
537
  **Closed issues:**
572
538
 
573
- - Configuration should recursively go through the values [\#2](https://github.com/feathersjs/configuration/issues/2)
539
+ - Configuration should recursively go through the values [\#2](https://github.com/feathersjs/configuration/issues/2)
574
540
 
575
541
  **Merged pull requests:**
576
542
 
@@ -580,5 +546,4 @@ functionality like path replacements and automatic environment variable insertio
580
546
 
581
547
  ## [v0.1.0](https://github.com/feathersjs/configuration/tree/v0.1.0) (2015-11-14)
582
548
 
583
-
584
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
549
+ \* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)_
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Feathers
3
+ Copyright (c) 2022 Feathers
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @feathersjs/configuration
2
2
 
3
3
  [![CI](https://github.com/feathersjs/feathers/workflows/CI/badge.svg)](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI)
4
- [![Dependency Status](https://img.shields.io/david/feathersjs/feathers.svg?style=flat-square&path=packages/configuration)](https://david-dm.org/feathersjs/feathers?path=packages/configuration)
5
4
  [![Download Status](https://img.shields.io/npm/dm/@feathersjs/configuration.svg?style=flat-square)](https://www.npmjs.com/package/@feathersjs/configuration)
5
+ [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/qa8kez8QBx)
6
6
 
7
7
  > A small configuration module for your Feathers application.
8
8
 
@@ -18,6 +18,6 @@ Refer to the [Feathers configuration API documentation](https://docs.feathersjs.
18
18
 
19
19
  ## License
20
20
 
21
- Copyright (c) 2021 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
21
+ Copyright (c) 2022 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
22
22
 
23
23
  Licensed under the [MIT license](LICENSE).
package/lib/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Application } from '@feathersjs/feathers';
2
+ import { Schema, Validator } from '@feathersjs/schema';
2
3
  import config from 'config';
3
- declare const _default: () => (app?: Application) => config.IConfig;
4
+ declare const _default: (schema?: Schema<any> | Validator) => (app?: Application) => config.IConfig;
4
5
  export = _default;
package/lib/index.js CHANGED
@@ -4,18 +4,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  const commons_1 = require("@feathersjs/commons");
6
6
  const config_1 = __importDefault(require("config"));
7
- const debug = commons_1.createDebug('@feathersjs/configuration');
8
- module.exports = function init() {
7
+ const debug = (0, commons_1.createDebug)('@feathersjs/configuration');
8
+ module.exports = function init(schema) {
9
+ const validator = typeof schema === 'function' ? schema : schema === null || schema === void 0 ? void 0 : schema.validate.bind(schema);
9
10
  return (app) => {
10
11
  if (!app) {
11
12
  return config_1.default;
12
13
  }
14
+ const configuration = { ...config_1.default };
13
15
  debug(`Initializing configuration for ${config_1.default.util.getEnv('NODE_ENV')} environment`);
14
- Object.keys(config_1.default).forEach(name => {
15
- const value = config_1.default[name];
16
+ Object.keys(configuration).forEach((name) => {
17
+ const value = configuration[name];
16
18
  debug(`Setting ${name} configuration value to`, value);
17
19
  app.set(name, value);
18
20
  });
21
+ if (validator) {
22
+ app.hooks({
23
+ setup: [
24
+ async (_context, next) => {
25
+ await validator(configuration);
26
+ await next();
27
+ }
28
+ ]
29
+ });
30
+ }
19
31
  return config_1.default;
20
32
  };
21
33
  };
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AACA,iDAAkD;AAClD,oDAA4B;AAE5B,MAAM,KAAK,GAAG,qBAAW,CAAC,2BAA2B,CAAC,CAAC;AAEvD,iBAAS,SAAS,IAAI;IACpB,OAAO,CAAC,GAAiB,EAAE,EAAE;QAC3B,IAAI,CAAC,GAAG,EAAE;YACR,OAAO,gBAAM,CAAC;SACf;QAED,KAAK,CAAC,kCAAkC,gBAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QAEtF,MAAM,CAAC,IAAI,CAAC,gBAAM,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACjC,MAAM,KAAK,GAAI,gBAAc,CAAC,IAAI,CAAC,CAAC;YACpC,KAAK,CAAC,WAAW,IAAI,yBAAyB,EAAE,KAAK,CAAC,CAAC;YACvD,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,OAAO,gBAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AACA,iDAAiD;AAEjD,oDAA2B;AAE3B,MAAM,KAAK,GAAG,IAAA,qBAAW,EAAC,2BAA2B,CAAC,CAAA;AAEtD,iBAAS,SAAS,IAAI,CAAC,MAAgC;IACrD,MAAM,SAAS,GAAc,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAElG,OAAO,CAAC,GAAiB,EAAE,EAAE;QAC3B,IAAI,CAAC,GAAG,EAAE;YACR,OAAO,gBAAM,CAAA;SACd;QAED,MAAM,aAAa,GAA+B,EAAE,GAAG,gBAAM,EAAE,CAAA;QAE/D,KAAK,CAAC,kCAAkC,gBAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,CAAA;QAErF,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC1C,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;YACjC,KAAK,CAAC,WAAW,IAAI,yBAAyB,EAAE,KAAK,CAAC,CAAA;YACtD,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACtB,CAAC,CAAC,CAAA;QAEF,IAAI,SAAS,EAAE;YACb,GAAG,CAAC,KAAK,CAAC;gBACR,KAAK,EAAE;oBACL,KAAK,EAAE,QAAgC,EAAE,IAAkB,EAAE,EAAE;wBAC7D,MAAM,SAAS,CAAC,aAAa,CAAC,CAAA;wBAC9B,MAAM,IAAI,EAAE,CAAA;oBACd,CAAC;iBACF;aACF,CAAC,CAAA;SACH;QAED,OAAO,gBAAM,CAAA;IACf,CAAC,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@feathersjs/configuration",
3
3
  "description": "A small configuration module for your Feathers application.",
4
- "version": "5.0.0-pre.3",
4
+ "version": "5.0.0-pre.30",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "main": "lib/",
7
7
  "types": "lib/",
@@ -16,7 +16,8 @@
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git://github.com/feathersjs/feathers.git"
19
+ "url": "git://github.com/feathersjs/feathers.git",
20
+ "directory": "packages/configuration"
20
21
  },
21
22
  "author": {
22
23
  "name": "Feathers contributors",
@@ -41,9 +42,9 @@
41
42
  ],
42
43
  "scripts": {
43
44
  "prepublish": "npm run compile",
44
- "compile": "shx rm -rf lib/ && tsc",
45
- "test": "npm run compile && npm run mocha",
46
- "mocha": "NODE_CONFIG_DIR=./test/config mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
45
+ "pack": "npm pack --pack-destination ../cli/test/build",
46
+ "compile": "shx rm -rf lib/ && tsc && npm run pack",
47
+ "test": "NODE_CONFIG_DIR=./test/config mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
47
48
  },
48
49
  "semistandard": {
49
50
  "env": [
@@ -57,19 +58,19 @@
57
58
  "access": "public"
58
59
  },
59
60
  "dependencies": {
60
- "@feathersjs/commons": "^5.0.0-pre.3",
61
- "@feathersjs/feathers": "^5.0.0-pre.3",
62
- "@types/config": "^0.0.38",
63
- "config": "^3.3.6"
61
+ "@feathersjs/commons": "^5.0.0-pre.30",
62
+ "@feathersjs/feathers": "^5.0.0-pre.30",
63
+ "@feathersjs/schema": "^5.0.0-pre.30",
64
+ "@types/config": "^3.3.0",
65
+ "config": "^3.3.8"
64
66
  },
65
67
  "devDependencies": {
66
- "@types/debug": "^4.1.5",
67
- "@types/mocha": "^8.2.2",
68
- "@types/node": "^14.14.41",
69
- "mocha": "^8.3.2",
70
- "shx": "^0.3.3",
71
- "ts-node": "^9.1.1",
72
- "typescript": "^4.2.4"
68
+ "@types/mocha": "^10.0.0",
69
+ "@types/node": "^18.8.2",
70
+ "mocha": "^10.0.0",
71
+ "shx": "^0.3.4",
72
+ "ts-node": "^10.9.1",
73
+ "typescript": "^4.8.4"
73
74
  },
74
- "gitHead": "d332eaca9945aab0c222413a7e46cec1c0601648"
75
+ "gitHead": "b535c91197f4b997520e0a0e608793eeba791931"
75
76
  }
package/src/index.ts CHANGED
@@ -1,23 +1,39 @@
1
- import { Application } from '@feathersjs/feathers';
2
- import { createDebug } from '@feathersjs/commons';
3
- import config from 'config';
1
+ import { Application, ApplicationHookContext, NextFunction } from '@feathersjs/feathers'
2
+ import { createDebug } from '@feathersjs/commons'
3
+ import { Schema, Validator } from '@feathersjs/schema'
4
+ import config from 'config'
4
5
 
5
- const debug = createDebug('@feathersjs/configuration');
6
+ const debug = createDebug('@feathersjs/configuration')
7
+
8
+ export = function init(schema?: Schema<any> | Validator) {
9
+ const validator: Validator = typeof schema === 'function' ? schema : schema?.validate.bind(schema)
6
10
 
7
- export = function init () {
8
11
  return (app?: Application) => {
9
12
  if (!app) {
10
- return config;
13
+ return config
11
14
  }
12
15
 
13
- debug(`Initializing configuration for ${config.util.getEnv('NODE_ENV')} environment`);
16
+ const configuration: { [key: string]: unknown } = { ...config }
17
+
18
+ debug(`Initializing configuration for ${config.util.getEnv('NODE_ENV')} environment`)
14
19
 
15
- Object.keys(config).forEach(name => {
16
- const value = (config as any)[name];
17
- debug(`Setting ${name} configuration value to`, value);
18
- app.set(name, value);
19
- });
20
+ Object.keys(configuration).forEach((name) => {
21
+ const value = configuration[name]
22
+ debug(`Setting ${name} configuration value to`, value)
23
+ app.set(name, value)
24
+ })
25
+
26
+ if (validator) {
27
+ app.hooks({
28
+ setup: [
29
+ async (_context: ApplicationHookContext, next: NextFunction) => {
30
+ await validator(configuration)
31
+ await next()
32
+ }
33
+ ]
34
+ })
35
+ }
20
36
 
21
- return config;
22
- };
37
+ return config
38
+ }
23
39
  }