@intlayer/config 1.0.2 → 1.2.1
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/dist/cjs/client.cjs +2 -10
- package/dist/cjs/client.cjs.map +1 -1
- package/dist/cjs/client.d.ts +1 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs +295 -39
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/configFile/buildConfigurationFields.d.ts +3 -0
- package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
- package/dist/cjs/configFile/getConfiguration.d.ts +3 -0
- package/dist/cjs/configFile/index.cjs +3 -1
- package/dist/cjs/configFile/index.cjs.map +1 -1
- package/dist/cjs/configFile/index.d.ts +1 -0
- package/dist/cjs/configFile/loadConfigurationFile.cjs +8 -1
- package/dist/cjs/configFile/loadConfigurationFile.cjs.map +1 -1
- package/dist/cjs/configFile/loadConfigurationFile.d.ts +6 -0
- package/dist/cjs/configFile/searchConfigurationFile.cjs.map +1 -1
- package/dist/cjs/configFile/searchConfigurationFile.d.ts +11 -0
- package/dist/cjs/defaultValues/internationalization.cjs +1 -5
- package/dist/cjs/defaultValues/internationalization.cjs.map +1 -1
- package/dist/cjs/defaultValues/internationalization.d.ts +1 -1
- package/dist/cjs/defaultValues/server.cjs +15 -7
- package/dist/cjs/defaultValues/server.cjs.map +1 -1
- package/dist/cjs/defaultValues/server.d.ts +6 -3
- package/dist/cjs/envVariables/detectPlatform.cjs +56 -0
- package/dist/cjs/envVariables/detectPlatform.cjs.map +1 -0
- package/dist/cjs/envVariables/detectPlatform.d.ts +8 -0
- package/dist/cjs/envVariables/extractEnvVariable/index.cjs +44 -0
- package/dist/cjs/envVariables/extractEnvVariable/index.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/index.d.ts +7 -0
- package/dist/cjs/envVariables/extractEnvVariable/next.cjs +70 -0
- package/dist/cjs/envVariables/extractEnvVariable/next.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/next.d.ts +7 -0
- package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs +70 -0
- package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/react_app.d.ts +7 -0
- package/dist/cjs/envVariables/extractEnvVariable/types.cjs +17 -0
- package/dist/cjs/envVariables/extractEnvVariable/types.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/types.d.ts +11 -0
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs +70 -0
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.d.ts +7 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite.cjs +78 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite.d.ts +7 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.cjs +2 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.d.ts +2 -0
- package/dist/cjs/envVariables/formatEnvVariable.cjs +6 -4
- package/dist/cjs/envVariables/formatEnvVariable.cjs.map +1 -1
- package/dist/cjs/envVariables/formatEnvVariable.d.ts +6 -1
- package/dist/cjs/envVariables/getConfiguration.cjs +79 -116
- package/dist/cjs/envVariables/getConfiguration.cjs.map +1 -1
- package/dist/cjs/envVariables/getConfiguration.d.ts +7 -6
- package/dist/cjs/envVariables/index.cjs +2 -10
- package/dist/cjs/envVariables/index.cjs.map +1 -1
- package/dist/cjs/envVariables/index.d.ts +2 -1
- package/dist/cjs/envVariables/utils.cjs +7 -6
- package/dist/cjs/envVariables/utils.cjs.map +1 -1
- package/dist/cjs/envVariables/utils.d.ts +5 -5
- package/dist/cjs/index.cjs +2 -10
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/types/config.cjs.map +1 -1
- package/dist/cjs/types/config.d.ts +253 -7
- package/dist/cjs/types/locales.cjs.map +1 -1
- package/dist/cjs/types/locales.d.ts +233 -0
- package/dist/esm/client.d.mts +1 -1
- package/dist/esm/client.mjs +2 -12
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/configFile/buildConfigurationFields.d.mts +3 -0
- package/dist/esm/configFile/buildConfigurationFields.mjs +298 -42
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/configFile/getConfiguration.d.mts +3 -0
- package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
- package/dist/esm/configFile/index.d.mts +1 -0
- package/dist/esm/configFile/index.mjs +1 -0
- package/dist/esm/configFile/index.mjs.map +1 -1
- package/dist/esm/configFile/loadConfigurationFile.d.mts +6 -0
- package/dist/esm/configFile/loadConfigurationFile.mjs +8 -1
- package/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -1
- package/dist/esm/configFile/searchConfigurationFile.d.mts +11 -0
- package/dist/esm/configFile/searchConfigurationFile.mjs.map +1 -1
- package/dist/esm/defaultValues/internationalization.d.mts +1 -1
- package/dist/esm/defaultValues/internationalization.mjs +1 -5
- package/dist/esm/defaultValues/internationalization.mjs.map +1 -1
- package/dist/esm/defaultValues/server.d.mts +6 -3
- package/dist/esm/defaultValues/server.mjs +13 -5
- package/dist/esm/defaultValues/server.mjs.map +1 -1
- package/dist/esm/envVariables/detectPlatform.d.mts +8 -0
- package/dist/esm/envVariables/detectPlatform.mjs +30 -0
- package/dist/esm/envVariables/detectPlatform.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/index.d.mts +7 -0
- package/dist/esm/envVariables/extractEnvVariable/index.mjs +20 -0
- package/dist/esm/envVariables/extractEnvVariable/index.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/next.d.mts +7 -0
- package/dist/esm/envVariables/extractEnvVariable/next.mjs +46 -0
- package/dist/esm/envVariables/extractEnvVariable/next.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/react_app.d.mts +7 -0
- package/dist/esm/envVariables/extractEnvVariable/react_app.mjs +46 -0
- package/dist/esm/envVariables/extractEnvVariable/react_app.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/types.d.mts +11 -0
- package/dist/esm/envVariables/extractEnvVariable/types.mjs +1 -0
- package/dist/esm/envVariables/extractEnvVariable/types.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.d.mts +7 -0
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs +46 -0
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/vite.d.mts +7 -0
- package/dist/esm/envVariables/extractEnvVariable/vite.mjs +53 -0
- package/dist/esm/envVariables/extractEnvVariable/vite.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/vite_env.d.d.mts +2 -0
- package/dist/esm/envVariables/extractEnvVariable/vite_env.d.mjs +1 -0
- package/dist/esm/envVariables/extractEnvVariable/vite_env.d.mjs.map +1 -0
- package/dist/esm/envVariables/formatEnvVariable.d.mts +6 -1
- package/dist/esm/envVariables/formatEnvVariable.mjs +6 -4
- package/dist/esm/envVariables/formatEnvVariable.mjs.map +1 -1
- package/dist/esm/envVariables/getConfiguration.d.mts +7 -6
- package/dist/esm/envVariables/getConfiguration.mjs +78 -111
- package/dist/esm/envVariables/getConfiguration.mjs.map +1 -1
- package/dist/esm/envVariables/index.d.mts +2 -1
- package/dist/esm/envVariables/index.mjs +2 -12
- package/dist/esm/envVariables/index.mjs.map +1 -1
- package/dist/esm/envVariables/utils.d.mts +5 -5
- package/dist/esm/envVariables/utils.mjs +7 -6
- package/dist/esm/envVariables/utils.mjs.map +1 -1
- package/dist/esm/index.d.mts +2 -1
- package/dist/esm/index.mjs +1 -9
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/types/config.d.mts +253 -7
- package/dist/esm/types/locales.d.mts +233 -0
- package/dist/esm/types/locales.mjs.map +1 -1
- package/package.json +7 -7
- package/src/client.ts +1 -7
- package/src/configFile/buildConfigurationFields.ts +306 -46
- package/src/configFile/getConfiguration.ts +3 -0
- package/src/configFile/index.ts +1 -0
- package/src/configFile/loadConfigurationFile.ts +19 -1
- package/src/configFile/searchConfigurationFile.ts +11 -0
- package/src/defaultValues/server.ts +14 -4
- package/src/envVariables/detectPlatform.ts +41 -0
- package/src/envVariables/extractEnvVariable/index.ts +20 -0
- package/src/envVariables/extractEnvVariable/next.ts +57 -0
- package/src/envVariables/extractEnvVariable/react_app.ts +57 -0
- package/src/envVariables/extractEnvVariable/types.ts +10 -0
- package/src/envVariables/extractEnvVariable/undefined_platform.ts +52 -0
- package/src/envVariables/extractEnvVariable/vite.ts +65 -0
- package/src/envVariables/extractEnvVariable/vite_env.d.ts +9 -0
- package/src/envVariables/formatEnvVariable.ts +17 -11
- package/src/envVariables/getConfiguration.ts +85 -113
- package/src/envVariables/index.ts +1 -7
- package/src/envVariables/utils.ts +30 -14
- package/src/index.ts +0 -4
- package/src/types/config.ts +279 -63
- package/src/types/locales.ts +233 -233
package/src/types/config.ts
CHANGED
|
@@ -1,64 +1,121 @@
|
|
|
1
1
|
import type { Locales } from './locales';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for internationalization settings
|
|
5
|
+
*/
|
|
3
6
|
export type InternationalizationConfig = {
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Locales available in the application
|
|
9
|
+
*
|
|
10
|
+
* Default: [Locales.ENGLISH]
|
|
11
|
+
*
|
|
12
|
+
* You can define a list of available locales to support in the application.
|
|
13
|
+
*/
|
|
14
|
+
locales: Locales[];
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Default locale of the application for fallback
|
|
18
|
+
*
|
|
19
|
+
* Default: Locales.ENGLISH
|
|
20
|
+
*
|
|
21
|
+
* Used to specify a fallback locale in case no other locale is set.
|
|
22
|
+
*/
|
|
23
|
+
defaultLocale: Locales;
|
|
9
24
|
};
|
|
10
25
|
|
|
11
26
|
export type ServerSetCookieRule = 'always' | 'never';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Configuration for middleware behaviors
|
|
30
|
+
*/
|
|
12
31
|
export type MiddlewareConfig = {
|
|
13
|
-
|
|
14
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Header name to get the locale from the request
|
|
34
|
+
*
|
|
35
|
+
* Default: 'x-intlayer-locale'
|
|
36
|
+
*
|
|
37
|
+
* The HTTP header key used to determine the current locale.
|
|
38
|
+
*/
|
|
39
|
+
headerName: string;
|
|
15
40
|
|
|
16
|
-
|
|
17
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Cookie name to store the locale information
|
|
43
|
+
*
|
|
44
|
+
* Default: 'NEXT_LOCALE'
|
|
45
|
+
*
|
|
46
|
+
* The cookie key where the locale information is stored.
|
|
47
|
+
*/
|
|
48
|
+
cookieName: string;
|
|
18
49
|
|
|
19
|
-
|
|
20
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Whether to prefix the default locale in the URL
|
|
52
|
+
*
|
|
53
|
+
* Default: false
|
|
54
|
+
*
|
|
55
|
+
* When set to true, the default locale is prefixed in the URL for localization purposes.
|
|
56
|
+
*/
|
|
57
|
+
prefixDefault: boolean;
|
|
21
58
|
|
|
22
|
-
|
|
23
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Base path for application URLs
|
|
61
|
+
*
|
|
62
|
+
* Default: ''
|
|
63
|
+
*
|
|
64
|
+
* Defines the base path where the application is accessible from.
|
|
65
|
+
*/
|
|
66
|
+
basePath: string;
|
|
24
67
|
|
|
25
|
-
|
|
26
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Strategy for setting the locale cookie on the server
|
|
70
|
+
*
|
|
71
|
+
* Default: 'always'
|
|
72
|
+
*
|
|
73
|
+
* This setting controls when the server sets the locale cookie. It can either set the cookie on every request or never set it.
|
|
74
|
+
*/
|
|
75
|
+
serverSetCookie: ServerSetCookieRule;
|
|
27
76
|
|
|
28
|
-
|
|
29
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Indicates if no prefix should be used in the URL for locale
|
|
79
|
+
*
|
|
80
|
+
* Default: false
|
|
81
|
+
*
|
|
82
|
+
* If true, no locale-based prefix is used in the URL.
|
|
83
|
+
*/
|
|
84
|
+
noPrefix: boolean;
|
|
30
85
|
};
|
|
31
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Custom configuration that can be provided to override default settings
|
|
89
|
+
*/
|
|
32
90
|
export type CustomIntlayerConfig = {
|
|
33
91
|
/**
|
|
34
|
-
*
|
|
92
|
+
* Custom internationalization configuration
|
|
35
93
|
*/
|
|
36
|
-
|
|
37
94
|
internationalization?: Partial<InternationalizationConfig>;
|
|
38
95
|
|
|
39
96
|
/**
|
|
40
|
-
*
|
|
97
|
+
* Custom middleware configuration
|
|
41
98
|
*/
|
|
42
|
-
|
|
43
99
|
middleware?: Partial<MiddlewareConfig>;
|
|
44
100
|
|
|
45
101
|
/**
|
|
46
|
-
*
|
|
102
|
+
* Custom content configuration
|
|
47
103
|
*/
|
|
48
104
|
content?: Partial<ContentConfig>;
|
|
49
105
|
};
|
|
50
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Combined configuration for internationalization, middleware, and content
|
|
109
|
+
*/
|
|
51
110
|
export type IntlayerConfig = {
|
|
52
111
|
/**
|
|
53
112
|
* Internationalization configuration
|
|
54
113
|
*/
|
|
55
|
-
|
|
56
114
|
internationalization: InternationalizationConfig;
|
|
57
115
|
|
|
58
116
|
/**
|
|
59
117
|
* Middleware configuration
|
|
60
118
|
*/
|
|
61
|
-
|
|
62
119
|
middleware: MiddlewareConfig;
|
|
63
120
|
|
|
64
121
|
/**
|
|
@@ -67,77 +124,236 @@ export type IntlayerConfig = {
|
|
|
67
124
|
content: ContentConfig;
|
|
68
125
|
};
|
|
69
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Base configuration for content handling
|
|
129
|
+
*/
|
|
70
130
|
export type BaseContentConfig = {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
131
|
+
/**
|
|
132
|
+
* File extensions of content to look for
|
|
133
|
+
*
|
|
134
|
+
* Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']
|
|
135
|
+
*
|
|
136
|
+
* List of file extensions to scan for content.
|
|
137
|
+
*/
|
|
138
|
+
fileExtensions: string[];
|
|
76
139
|
|
|
77
|
-
|
|
78
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Absolute path of the project's base directory
|
|
142
|
+
*
|
|
143
|
+
* Default: process.cwd()
|
|
144
|
+
*
|
|
145
|
+
* The root directory of the project, typically used for resolving other paths.
|
|
146
|
+
*/
|
|
147
|
+
baseDir: string;
|
|
79
148
|
|
|
80
|
-
|
|
81
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Name of the directory where the content is stored
|
|
151
|
+
*
|
|
152
|
+
* Default: 'src'
|
|
153
|
+
*
|
|
154
|
+
* Specifies the directory where the primary content is stored.
|
|
155
|
+
*/
|
|
156
|
+
contentDirName: string;
|
|
82
157
|
|
|
83
|
-
|
|
84
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Directories to be excluded from content processing
|
|
160
|
+
*
|
|
161
|
+
* Default: ['node_modules']
|
|
162
|
+
*
|
|
163
|
+
* A list of directories to exclude from content processing.
|
|
164
|
+
*/
|
|
165
|
+
excludedPath: string[];
|
|
85
166
|
|
|
86
|
-
|
|
87
|
-
|
|
167
|
+
/**
|
|
168
|
+
* Name of the directory where results are stored
|
|
169
|
+
*
|
|
170
|
+
* Default: '.intlayer'
|
|
171
|
+
*
|
|
172
|
+
* The directory for storing intermediate or output results.
|
|
173
|
+
*/
|
|
174
|
+
resultDirName: string;
|
|
88
175
|
|
|
89
|
-
|
|
90
|
-
|
|
176
|
+
/**
|
|
177
|
+
* Name of the directory for module augmentation
|
|
178
|
+
*
|
|
179
|
+
* Default: 'types'
|
|
180
|
+
*
|
|
181
|
+
* Defines the directory for additional module types.
|
|
182
|
+
*/
|
|
183
|
+
moduleAugmentationDirName: string;
|
|
91
184
|
|
|
92
|
-
|
|
93
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Name of the directory where dictionaries are stored
|
|
187
|
+
*
|
|
188
|
+
* Default: 'dictionary'
|
|
189
|
+
*
|
|
190
|
+
* The directory for storing localization dictionaries.
|
|
191
|
+
*
|
|
192
|
+
* Note:
|
|
193
|
+
* - Ensure the dictionaries output includes intlayer to build the dictionaries for intlayer
|
|
194
|
+
*/
|
|
195
|
+
dictionariesDirName: string;
|
|
94
196
|
|
|
95
|
-
|
|
96
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Name of the directory where dictionaries are stored
|
|
199
|
+
*
|
|
200
|
+
* Default: 'i18n_dictionary'
|
|
201
|
+
*
|
|
202
|
+
* The directory for storing localization dictionaries.
|
|
203
|
+
*
|
|
204
|
+
* Note:
|
|
205
|
+
* - Ensure the dictionaries output includes 'i18next' to build the dictionaries for i18next
|
|
206
|
+
*/
|
|
207
|
+
i18nDictionariesDirName: string;
|
|
97
208
|
|
|
98
|
-
|
|
99
|
-
|
|
209
|
+
/**
|
|
210
|
+
* Name of the directory where dictionary types are stored
|
|
211
|
+
*
|
|
212
|
+
* Default: 'types'
|
|
213
|
+
*
|
|
214
|
+
* The directory for storing dictionary type definitions.
|
|
215
|
+
*/
|
|
216
|
+
typeDirName: string;
|
|
100
217
|
|
|
101
|
-
|
|
102
|
-
|
|
218
|
+
/**
|
|
219
|
+
* Name of the directory where the main files are stored
|
|
220
|
+
*
|
|
221
|
+
* Default: 'main'
|
|
222
|
+
*
|
|
223
|
+
* Specifies the directory for storing main application files.
|
|
224
|
+
*/
|
|
225
|
+
mainDirName: string;
|
|
103
226
|
};
|
|
104
227
|
|
|
228
|
+
export type DictionaryOutput = 'intlayer' | 'i18next';
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Configuration derived based on the base content configuration
|
|
232
|
+
*/
|
|
105
233
|
export type BaseDerivedConfig = {
|
|
106
|
-
|
|
107
|
-
|
|
234
|
+
/**
|
|
235
|
+
* Directory where the content is stored, relative to the base directory
|
|
236
|
+
*
|
|
237
|
+
* Default: {{baseDir}} / {{contentDirName}}
|
|
238
|
+
*
|
|
239
|
+
* Derived content directory based on the base configuration.
|
|
240
|
+
*/
|
|
241
|
+
contentDir: string;
|
|
108
242
|
|
|
109
|
-
|
|
110
|
-
|
|
243
|
+
/**
|
|
244
|
+
* Directory where the results are stored, relative to the base directory
|
|
245
|
+
*
|
|
246
|
+
* Default: {{baseDir}} / {{resultDirName}}
|
|
247
|
+
*
|
|
248
|
+
* Derived results directory based on the base configuration.
|
|
249
|
+
*/
|
|
250
|
+
resultDir: string;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Directory for module augmentation, relative to the base directory
|
|
254
|
+
*
|
|
255
|
+
* Default: {{baseDir}} / {{moduleAugmentationDirName}}
|
|
256
|
+
*
|
|
257
|
+
* Defines the derived path for module augmentation.
|
|
258
|
+
*/
|
|
259
|
+
moduleAugmentationDir: string;
|
|
111
260
|
|
|
112
|
-
|
|
113
|
-
|
|
261
|
+
/**
|
|
262
|
+
* Type of dictionary to use as an output
|
|
263
|
+
*
|
|
264
|
+
* Default: ['intlayer']
|
|
265
|
+
*
|
|
266
|
+
* The type of dictionary to use as an output. It can be either 'intlayer' or 'i18next'.
|
|
267
|
+
*
|
|
268
|
+
* Note:
|
|
269
|
+
* - 'i18next' is not yet ensure a 1:1 mapping with the i18next library.
|
|
270
|
+
* - Removing 'intlayer' will break the compatibility with react-intlayer or next-intlayer
|
|
271
|
+
*
|
|
272
|
+
*/
|
|
273
|
+
dictionaryOutput: DictionaryOutput[];
|
|
114
274
|
};
|
|
115
275
|
|
|
276
|
+
/**
|
|
277
|
+
* Configuration derived based on the result directory
|
|
278
|
+
*/
|
|
116
279
|
export type ResultDirDerivedConfig = {
|
|
117
|
-
|
|
118
|
-
|
|
280
|
+
/**
|
|
281
|
+
* Directory where dictionaries are stored, relative to the result directory
|
|
282
|
+
*
|
|
283
|
+
* Default: {{resultDir}} / {{dictionariesDirName}}
|
|
284
|
+
*
|
|
285
|
+
* Specifies the derived path for dictionaries relative to the result directory.
|
|
286
|
+
*/
|
|
287
|
+
dictionariesDir: string;
|
|
119
288
|
|
|
120
|
-
|
|
121
|
-
|
|
289
|
+
/**
|
|
290
|
+
*
|
|
291
|
+
* Directory where dictionaries are stored, relative to the result directory
|
|
292
|
+
*
|
|
293
|
+
* Default: {{resultDir}} / {{i18nDictionariesDirName}}
|
|
294
|
+
*
|
|
295
|
+
* Specifies the derived path for dictionaries relative to the result directory.
|
|
296
|
+
*
|
|
297
|
+
* Note:
|
|
298
|
+
* - Ensure the i18n dictionaries output includes i18next to build the dictionaries for i18next
|
|
299
|
+
*/
|
|
300
|
+
i18nDictionariesDir: string;
|
|
122
301
|
|
|
123
|
-
|
|
124
|
-
|
|
302
|
+
/**
|
|
303
|
+
* Directory where dictionary types are stored, relative to the result directory
|
|
304
|
+
*
|
|
305
|
+
* Default: {{resultDir}} / {{typeDirName}}
|
|
306
|
+
*
|
|
307
|
+
* Specifies the derived path for dictionary types relative to the result directory.
|
|
308
|
+
*/
|
|
309
|
+
typesDir: string;
|
|
125
310
|
|
|
126
|
-
|
|
127
|
-
|
|
311
|
+
/**
|
|
312
|
+
* Directory where the main files are stored, relative to the result directory
|
|
313
|
+
*
|
|
314
|
+
* Default: {{resultDir}} / {{mainDirName}}
|
|
315
|
+
*
|
|
316
|
+
* Specifies the derived path for the main files relative to the result directory.
|
|
317
|
+
*/
|
|
318
|
+
mainDir: string;
|
|
128
319
|
};
|
|
129
320
|
|
|
321
|
+
/**
|
|
322
|
+
* Configuration for content patterns
|
|
323
|
+
*/
|
|
130
324
|
export type PatternsContentConfig = {
|
|
131
|
-
|
|
325
|
+
/**
|
|
326
|
+
* Patterns of files to watch for changes
|
|
327
|
+
*
|
|
328
|
+
* Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json', '/**\/*.content.cjs', '/**\/*.content.mjs', '/**\/*.content.tsx', '/**\/*.content.jsx']
|
|
329
|
+
*
|
|
330
|
+
* Defines file patterns for content to watch for changes.
|
|
331
|
+
*/
|
|
132
332
|
watchedFilesPattern: string[];
|
|
133
333
|
|
|
134
|
-
|
|
334
|
+
/**
|
|
335
|
+
* Patterns of files to watch for changes including the relative path
|
|
336
|
+
*
|
|
337
|
+
* Default: ['{{contentDir}}/**\/*.content.ts', '{{contentDir}}/**\/*.content.js', '{{contentDir}}/**\/*.content.json', '{{contentDir}}/**\/*.content.cjs', '{{contentDir}}/**\/*.content.mjs', '{{contentDir}}/**\/*.content.tsx', '{{contentDir}}/**\/*.content.jsx']
|
|
338
|
+
*
|
|
339
|
+
* Specifies the file patterns for content to watch, including relative paths.
|
|
340
|
+
*/
|
|
135
341
|
watchedFilesPatternWithPath: string[];
|
|
136
342
|
|
|
137
|
-
|
|
343
|
+
/**
|
|
344
|
+
* Pattern for output files including the relative path
|
|
345
|
+
*
|
|
346
|
+
* Default: '{{dictionariesDir}}/**\/*.json'
|
|
347
|
+
*
|
|
348
|
+
* Defines the pattern for output files, including the relative path.
|
|
349
|
+
*/
|
|
138
350
|
outputFilesPatternWithPath: string;
|
|
139
351
|
};
|
|
140
352
|
|
|
353
|
+
// @TODO: Implement exclusion of non configurable fields, to not allow them to be set in the config
|
|
354
|
+
/**
|
|
355
|
+
* General configuration derived from the config file
|
|
356
|
+
*/
|
|
141
357
|
export type ContentConfig = BaseContentConfig &
|
|
142
358
|
BaseDerivedConfig &
|
|
143
359
|
ResultDirDerivedConfig &
|