@intlayer/config 9.0.0-canary.1 → 9.0.0-canary.10
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/bundle/index.cjs +1 -1
- package/dist/cjs/configFile/buildBrowserConfiguration.cjs +23 -3
- package/dist/cjs/configFile/buildBrowserConfiguration.cjs.map +1 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs +8 -3
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/configFile/configurationSchema.cjs +1 -0
- package/dist/cjs/configFile/configurationSchema.cjs.map +1 -1
- package/dist/cjs/configFile/getConfiguration.cjs +10 -2
- package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
- package/dist/cjs/defaultValues/compiler.cjs +1 -1
- package/dist/cjs/defaultValues/compiler.cjs.map +1 -1
- package/dist/cjs/defaultValues/index.cjs +1 -0
- package/dist/cjs/defaultValues/routing.cjs +2 -0
- package/dist/cjs/defaultValues/routing.cjs.map +1 -1
- package/dist/cjs/envVars/envVars.cjs +21 -0
- package/dist/cjs/envVars/envVars.cjs.map +1 -1
- package/dist/cjs/envVars/index.cjs +1 -0
- package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs +28 -13
- package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs.map +1 -1
- package/dist/cjs/logger.cjs +1 -1
- package/dist/cjs/logger.cjs.map +1 -1
- package/dist/cjs/utils/getDictionarySelectorUsage.cjs +28 -0
- package/dist/cjs/utils/getDictionarySelectorUsage.cjs.map +1 -0
- package/dist/cjs/utils/index.cjs +2 -0
- package/dist/esm/bundle/index.mjs +1 -1
- package/dist/esm/configFile/buildBrowserConfiguration.mjs +24 -4
- package/dist/esm/configFile/buildBrowserConfiguration.mjs.map +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs +8 -3
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/configFile/configurationSchema.mjs +1 -0
- package/dist/esm/configFile/configurationSchema.mjs.map +1 -1
- package/dist/esm/configFile/getConfiguration.mjs +10 -2
- package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
- package/dist/esm/defaultValues/compiler.mjs +1 -1
- package/dist/esm/defaultValues/compiler.mjs.map +1 -1
- package/dist/esm/defaultValues/index.mjs +2 -2
- package/dist/esm/defaultValues/routing.mjs +2 -1
- package/dist/esm/defaultValues/routing.mjs.map +1 -1
- package/dist/esm/envVars/envVars.mjs +21 -1
- package/dist/esm/envVars/envVars.mjs.map +1 -1
- package/dist/esm/envVars/index.mjs +2 -2
- package/dist/esm/loadExternalFile/transpileTSToCJS.mjs +28 -13
- package/dist/esm/loadExternalFile/transpileTSToCJS.mjs.map +1 -1
- package/dist/esm/logger.mjs +1 -1
- package/dist/esm/logger.mjs.map +1 -1
- package/dist/esm/utils/getDictionarySelectorUsage.mjs +26 -0
- package/dist/esm/utils/getDictionarySelectorUsage.mjs.map +1 -0
- package/dist/esm/utils/index.mjs +2 -1
- package/dist/types/configFile/buildBrowserConfiguration.d.ts +10 -1
- package/dist/types/configFile/buildBrowserConfiguration.d.ts.map +1 -1
- package/dist/types/configFile/buildConfigurationFields.d.ts +6 -1
- package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
- package/dist/types/configFile/configurationSchema.d.ts +2 -0
- package/dist/types/configFile/configurationSchema.d.ts.map +1 -1
- package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
- package/dist/types/defaultValues/compiler.d.ts +1 -1
- package/dist/types/defaultValues/index.d.ts +2 -2
- package/dist/types/defaultValues/routing.d.ts +2 -1
- package/dist/types/defaultValues/routing.d.ts.map +1 -1
- package/dist/types/envVars/envVars.d.ts +20 -1
- package/dist/types/envVars/envVars.d.ts.map +1 -1
- package/dist/types/envVars/index.d.ts +2 -2
- package/dist/types/loadExternalFile/transpileTSToCJS.d.ts.map +1 -1
- package/dist/types/utils/getDictionarySelectorUsage.d.ts +23 -0
- package/dist/types/utils/getDictionarySelectorUsage.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +2 -1
- package/package.json +4 -4
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/utils/getDictionarySelectorUsage.ts
|
|
2
|
+
/**
|
|
3
|
+
* Detects whether any built dictionary declares qualifier dimensions
|
|
4
|
+
* (collections or variants).
|
|
5
|
+
*
|
|
6
|
+
* The merge step emits a {@link QualifiedDictionaryGroup} — carrying a
|
|
7
|
+
* non-empty `qualifierTypes` array — for every key whose declarations use a
|
|
8
|
+
* selector. When no group is present, the selector-object resolution path in
|
|
9
|
+
* `getIntlayer` / `useIntlayer` is dead code, and bundlers can eliminate it via
|
|
10
|
+
* the `INTLAYER_DICTIONARY_SELECTOR` env var.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* getHasDictionarySelector(getDictionaries(config));
|
|
14
|
+
* // true → at least one collection / variant / meta dictionary
|
|
15
|
+
* // false → only plain dictionaries (selector logic can be stripped)
|
|
16
|
+
*/
|
|
17
|
+
const getHasDictionarySelector = (dictionaries) => {
|
|
18
|
+
return (Array.isArray(dictionaries) ? dictionaries : Object.values(dictionaries)).some((dictionary) => {
|
|
19
|
+
const { qualifierTypes } = dictionary;
|
|
20
|
+
return Array.isArray(qualifierTypes) && qualifierTypes.length > 0;
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { getHasDictionarySelector };
|
|
26
|
+
//# sourceMappingURL=getDictionarySelectorUsage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDictionarySelectorUsage.mjs","names":[],"sources":["../../../src/utils/getDictionarySelectorUsage.ts"],"sourcesContent":["import type {\n Dictionary,\n QualifiedDictionaryGroup,\n} from '@intlayer/types/dictionary';\n\ntype DictionaryOrGroup = Dictionary | QualifiedDictionaryGroup;\n\n/**\n * Detects whether any built dictionary declares qualifier dimensions\n * (collections or variants).\n *\n * The merge step emits a {@link QualifiedDictionaryGroup} — carrying a\n * non-empty `qualifierTypes` array — for every key whose declarations use a\n * selector. When no group is present, the selector-object resolution path in\n * `getIntlayer` / `useIntlayer` is dead code, and bundlers can eliminate it via\n * the `INTLAYER_DICTIONARY_SELECTOR` env var.\n *\n * @example\n * getHasDictionarySelector(getDictionaries(config));\n * // true → at least one collection / variant / meta dictionary\n * // false → only plain dictionaries (selector logic can be stripped)\n */\nexport const getHasDictionarySelector = (\n dictionaries: Record<string, DictionaryOrGroup> | DictionaryOrGroup[]\n): boolean => {\n const dictionariesArray = Array.isArray(dictionaries)\n ? dictionaries\n : Object.values(dictionaries);\n\n return dictionariesArray.some((dictionary) => {\n const { qualifierTypes } = dictionary as QualifiedDictionaryGroup;\n\n return Array.isArray(qualifierTypes) && qualifierTypes.length > 0;\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,MAAa,4BACX,iBACY;AAKZ,SAJ0B,MAAM,QAAQ,aAAa,GACjD,eACA,OAAO,OAAO,aAAa,EAEN,MAAM,eAAe;EAC5C,MAAM,EAAE,mBAAmB;AAE3B,SAAO,MAAM,QAAQ,eAAe,IAAI,eAAe,SAAS;GAChE"}
|
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { configESMxCJSRequire, getProjectRequire, isESModule } from "./ESMxCJSHe
|
|
|
8
8
|
import { clearModuleCache } from "./clearModuleCache.mjs";
|
|
9
9
|
import { compareVersions } from "./compareVersions.mjs";
|
|
10
10
|
import { extractErrorMessage } from "./extractErrorMessage.mjs";
|
|
11
|
+
import { getHasDictionarySelector } from "./getDictionarySelectorUsage.mjs";
|
|
11
12
|
import { getStorageAttributes } from "./getStorageAttributes.mjs";
|
|
12
13
|
import { getUnusedNodeTypes, getUnusedNodeTypesAsync, getUsedNodeTypes, getUsedNodeTypesAsync } from "./getUsedNodeTypes.mjs";
|
|
13
14
|
import { logStack } from "./logStack.mjs";
|
|
@@ -20,4 +21,4 @@ import { camelCaseToSentence } from "./stringFormatter/camelCaseToSentence.mjs";
|
|
|
20
21
|
import { kebabCaseToCamelCase } from "./stringFormatter/kebabCaseToCamelCase.mjs";
|
|
21
22
|
import { toLowerCamelCase } from "./stringFormatter/toLowerCamelCase.mjs";
|
|
22
23
|
|
|
23
|
-
export { assertPathWithin, cacheDisk, cacheMemory, camelCaseToKebabCase, camelCaseToSentence, clearAllCache, clearCache, clearDiskCacheMemory, clearModuleCache, compareVersions, computeKeyId, configESMxCJSRequire, extractErrorMessage, getAlias, getCache, getExtension, getPackageJsonPath, getProjectRequire, getStorageAttributes, getUnusedNodeTypes, getUnusedNodeTypesAsync, getUsedNodeTypes, getUsedNodeTypesAsync, isESModule, kebabCaseToCamelCase, logStack, normalizePath, parseFilePathPattern, parseStringPattern, retryManager, setCache, setIntlayerIdentifier, stableStringify, toLowerCamelCase };
|
|
24
|
+
export { assertPathWithin, cacheDisk, cacheMemory, camelCaseToKebabCase, camelCaseToSentence, clearAllCache, clearCache, clearDiskCacheMemory, clearModuleCache, compareVersions, computeKeyId, configESMxCJSRequire, extractErrorMessage, getAlias, getCache, getExtension, getHasDictionarySelector, getPackageJsonPath, getProjectRequire, getStorageAttributes, getUnusedNodeTypes, getUnusedNodeTypesAsync, getUsedNodeTypes, getUsedNodeTypesAsync, isESModule, kebabCaseToCamelCase, logStack, normalizePath, parseFilePathPattern, parseStringPattern, retryManager, setCache, setIntlayerIdentifier, stableStringify, toLowerCamelCase };
|
|
@@ -41,10 +41,19 @@ declare const buildRoutingFields: (customConfiguration?: Partial<CustomRoutingCo
|
|
|
41
41
|
* (`clientId`, `clientSecret`). The browser-safe {@link BrowserIntlayerConfig}
|
|
42
42
|
* omits those fields when exposing config to the client.
|
|
43
43
|
*
|
|
44
|
+
* When the user does not explicitly set `clientId` / `clientSecret` in the
|
|
45
|
+
* configuration file, they fall back to the `INTLAYER_CLIENT_ID` /
|
|
46
|
+
* `INTLAYER_CLIENT_SECRET` environment variables read from `env`. This lets
|
|
47
|
+
* users authenticate purely through their `.env` file (including files passed
|
|
48
|
+
* via the CLI `--env-file` flag) without having to wire `process.env` into the
|
|
49
|
+
* configuration manually.
|
|
50
|
+
*
|
|
44
51
|
* @param customConfiguration - Partial user-supplied editor config.
|
|
52
|
+
* @param env - Environment variables used to resolve credential fallbacks.
|
|
53
|
+
* Defaults to `process.env`.
|
|
45
54
|
* @returns A fully-defaulted {@link EditorConfig}.
|
|
46
55
|
*/
|
|
47
|
-
declare const buildEditorFields: (customConfiguration?: Partial<EditorConfig
|
|
56
|
+
declare const buildEditorFields: (customConfiguration?: Partial<EditorConfig>, env?: NodeJS.ProcessEnv) => EditorConfig;
|
|
48
57
|
/**
|
|
49
58
|
* Build the log section of the Intlayer configuration.
|
|
50
59
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildBrowserConfiguration.d.ts","names":[],"sources":["../../../src/configFile/buildBrowserConfiguration.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"buildBrowserConfiguration.d.ts","names":[],"sources":["../../../src/configFile/buildBrowserConfiguration.ts"],"mappings":";;;;;AA+CA;;;;;KAAY,qBAAA;EACV,oBAAA,EAAsB,IAAA,CACpB,0BAAA;EAGF,OAAA,EAAS,aAAA;EACT,MAAA,EAAQ,IAAA,CAAK,YAAA;EACb,GAAA,EAAK,IAAA,CAAK,SAAA;AAAA;AAAA,QAGJ,MAAA;EAAA,UACI,MAAA;IAVY;IAYpB,eAAA,GAAkB,qBAAA;EAAA;AAAA;;;;;;;cAiBT,+BAAA,GACX,mBAAA,GAAsB,OAAA,CAAQ,0BAAA,MAC7B,0BAAA;;AAxBD;;;;;cAuEW,kBAAA,GACX,mBAAA,GAAsB,OAAA,CAAQ,mBAAA,MAC7B,aAAA;;;;;;AAnDH;;;;;;;;;;;;;;cA2Ka,iBAAA,GACX,mBAAA,GAAsB,OAAA,CAAQ,YAAA,GAC9B,GAAA,GAAK,MAAA,CAAO,UAAA,KACX,YAAA;;;;;;;;cAoIU,cAAA,GACX,mBAAA,GAAsB,OAAA,CAAQ,SAAA,GAC9B,YAAA,GAAe,YAAA,KACd,SAAA;;;;;;AA1IH;;;;;;;;;;;;;;;;;cAkMa,yBAAA,GACX,YAAA,GAAe,oBAAA,KACd,qBAAA;AA7DH;;;;;;;;;;;AAAA,cA4Fa,2BAAA,GACX,MAAA,EAAQ,cAAA,KACP,qBAAA"}
|
|
@@ -18,9 +18,14 @@ import { CustomIntlayerConfig, IntlayerConfig, LogFunctions } from "@intlayer/ty
|
|
|
18
18
|
* @param customConfiguration - Optional user-supplied configuration object.
|
|
19
19
|
* @param baseDir - Project root directory. Defaults to `process.cwd()`.
|
|
20
20
|
* @param logFunctions - Optional custom logging functions.
|
|
21
|
+
* @param env - Environment variables used to resolve credential fallbacks
|
|
22
|
+
* (e.g. `INTLAYER_CLIENT_ID` / `INTLAYER_CLIENT_SECRET`). Defaults to
|
|
23
|
+
* `process.env`. Callers loading a custom env file (such as the CLI
|
|
24
|
+
* `--env-file` flag) should pass the merged env so credentials defined there
|
|
25
|
+
* are picked up without polluting `process.env`.
|
|
21
26
|
* @returns A fully-built {@link IntlayerConfig}.
|
|
22
27
|
*/
|
|
23
|
-
declare const buildConfigurationFields: (customConfiguration?: CustomIntlayerConfig, baseDir?: string, logFunctions?: LogFunctions) => IntlayerConfig;
|
|
28
|
+
declare const buildConfigurationFields: (customConfiguration?: CustomIntlayerConfig, baseDir?: string, logFunctions?: LogFunctions, env?: NodeJS.ProcessEnv) => IntlayerConfig;
|
|
24
29
|
//#endregion
|
|
25
30
|
export { type BrowserIntlayerConfig, buildBrowserConfiguration, buildConfigurationFields, buildEditorFields, buildInternationalizationFields, buildLogFields, buildRoutingFields, extractBrowserConfiguration };
|
|
26
31
|
//# sourceMappingURL=buildConfigurationFields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildConfigurationFields.d.ts","names":[],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"buildConfigurationFields.d.ts","names":[],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"mappings":";;;;;;AA+uBA;;;;;;;;;;;;;;;;;;;;;cAAa,wBAAA,GACX,mBAAA,GAAsB,oBAAA,EACtB,OAAA,WACA,YAAA,GAAe,YAAA,EACf,GAAA,GAAK,MAAA,CAAO,UAAA,KACX,cAAA"}
|
|
@@ -145,6 +145,7 @@ declare const routingSchema: z.ZodObject<{
|
|
|
145
145
|
"no-prefix": "no-prefix";
|
|
146
146
|
"search-params": "search-params";
|
|
147
147
|
}>>;
|
|
148
|
+
enableProxy: z.ZodOptional<z.ZodBoolean>;
|
|
148
149
|
storage: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodEnum<{
|
|
149
150
|
cookie: "cookie";
|
|
150
151
|
localStorage: "localStorage";
|
|
@@ -342,6 +343,7 @@ declare const intlayerConfigSchema: z.ZodObject<{
|
|
|
342
343
|
"no-prefix": "no-prefix";
|
|
343
344
|
"search-params": "search-params";
|
|
344
345
|
}>>;
|
|
346
|
+
enableProxy: z.ZodOptional<z.ZodBoolean>;
|
|
345
347
|
storage: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodEnum<{
|
|
346
348
|
cookie: "cookie";
|
|
347
349
|
localStorage: "localStorage";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurationSchema.d.ts","names":[],"sources":["../../../src/configFile/configurationSchema.ts"],"mappings":";;;;cAGa,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;;;;cA+B1B,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;cAYvB,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;cAKvB,aAAA,EAAa,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,UAAA,SAAA,CAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAcb,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;cAKjB,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;cAIlB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAMnB,aAAA,EAAa,CAAA,CAAA,SAAA
|
|
1
|
+
{"version":3,"file":"configurationSchema.d.ts","names":[],"sources":["../../../src/configFile/configurationSchema.ts"],"mappings":";;;;cAGa,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;;;;cA+B1B,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;cAYvB,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;cAKvB,aAAA,EAAa,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,UAAA,SAAA,CAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAcb,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;cAKjB,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;cAIlB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAMnB,aAAA,EAAa,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgBb,YAAA,EAAY,CAAA,CAAA,SAAA;;;;;;;;;;;;;;cAeZ,aAAA,EAAa,CAAA,CAAA,SAAA;;;;;;;;cASb,YAAA,EAAY,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;cAiBZ,SAAA,EAAS,CAAA,CAAA,SAAA;;;;;;;;;;;;cAST,QAAA,EAAQ,CAAA,CAAA,SAAA;;;;;;;;;;;;cAUR,WAAA,EAAW,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAWX,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;;cAUd,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;;;;;;;;cAiBhB,oBAAA,EAAoB,CAAA,CAAA,SAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfiguration.d.ts","names":[],"sources":["../../../src/configFile/getConfiguration.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"getConfiguration.d.ts","names":[],"sources":["../../../src/configFile/getConfiguration.ts"],"mappings":";;;;;KAeY,uBAAA;EACV,OAAA;EACA,QAAA,GAAW,oBAAA;EAEX,GAAA;EACA,OAAA;EAEA,YAAA,GAAe,YAAA;EAEf,OAAA,GAAU,MAAA,CAAO,OAAA;EAEjB,KAAA;EAEA,YAAA,GAAe,uBAAA;AAAA,IACb,IAAA,CAAK,qBAAA;AAAA,KAEG,iCAAA;EACV,aAAA,EAAe,cAAA;EACf,mBAAA,EAAqB,oBAAA;EACrB,sBAAA;EACA,qBAAA;AAAA;;;;cAMW,2BAAA,GACX,OAAA,GAAU,uBAAA,KACT,iCAAA;;;;cAiHU,gBAAA,GACX,OAAA,GAAU,uBAAA,KACT,cAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/defaultValues/compiler.d.ts
|
|
2
|
-
declare const COMPILER_ENABLED =
|
|
2
|
+
declare const COMPILER_ENABLED = false;
|
|
3
3
|
declare const COMPILER_DICTIONARY_KEY_PREFIX = "";
|
|
4
4
|
declare const COMPILER_NO_METADATA = false;
|
|
5
5
|
declare const COMPILER_SAVE_COMPONENTS = false;
|
|
@@ -5,6 +5,6 @@ import { CONTENT_AUTO_TRANSFORMATION, FILL, IMPORT_MODE, LOCATION } from "./dict
|
|
|
5
5
|
import { APPLICATION_URL, BACKEND_URL, CMS_URL, DICTIONARY_PRIORITY_STRATEGY, EDITOR_URL, IS_ENABLED, LIVE_SYNC, LIVE_SYNC_PORT, PORT } from "./editor.js";
|
|
6
6
|
import { DEFAULT_LOCALE, LOCALES, REQUIRED_LOCALES, STRICT_MODE } from "./internationalization.js";
|
|
7
7
|
import { MODE, PREFIX } from "./log.js";
|
|
8
|
-
import { BASE_PATH, COOKIE_NAME, HEADER_NAME, LOCALE_STORAGE_NAME, ROUTING_MODE, SERVER_SET_COOKIE, STORAGE } from "./routing.js";
|
|
8
|
+
import { BASE_PATH, COOKIE_NAME, ENABLE_PROXY, HEADER_NAME, LOCALE_STORAGE_NAME, ROUTING_MODE, SERVER_SET_COOKIE, STORAGE } from "./routing.js";
|
|
9
9
|
import { CACHE_DIR, CONFIG_DIR, DICTIONARIES_DIR, DYNAMIC_DICTIONARIES_DIR, FETCH_DICTIONARIES_DIR, MAIN_DIR, MASKS_DIR, MODULE_AUGMENTATION_DIR, REMOTE_DICTIONARIES_DIR, TEMP_DIR, TYPES_DIR, UNMERGED_DICTIONARIES_DIR } from "./system.js";
|
|
10
|
-
export { APPLICATION_URL, BACKEND_URL, BASE_PATH, BUILD_MODE, CACHE, CACHE_DIR, CMS_URL, CODE_DIR, COMPILER_DICTIONARY_KEY_PREFIX, COMPILER_ENABLED, COMPILER_NO_METADATA, COMPILER_SAVE_COMPONENTS, CONFIG_DIR, CONTENT_AUTO_TRANSFORMATION, CONTENT_DIR, COOKIE_NAME, DEFAULT_LOCALE, DICTIONARIES_DIR, DICTIONARY_PRIORITY_STRATEGY, DYNAMIC_DICTIONARIES_DIR, EDITOR_URL, EXCLUDED_PATHS, FETCH_DICTIONARIES_DIR, FILE_EXTENSIONS, FILL, HEADER_NAME, I18NEXT_DICTIONARIES_DIR, IMPORT_MODE, IS_ENABLED, LIVE_SYNC, LIVE_SYNC_PORT, LOCALES, LOCALE_STORAGE_NAME, LOCATION, MAIN_DIR, MASKS_DIR, MINIFY, MODE, MODULE_AUGMENTATION_DIR, OPTIMIZE, OUTPUT_FORMAT, PORT, PREFIX, PURGE, REACT_INTL_MESSAGES_DIR, REMOTE_DICTIONARIES_DIR, REQUIRED_LOCALES, ROUTING_MODE, SERVER_SET_COOKIE, STORAGE, STRICT_MODE, TEMP_DIR, TRAVERSE_PATTERN, TYPES_DIR, TYPE_CHECKING, UNMERGED_DICTIONARIES_DIR, WATCH };
|
|
10
|
+
export { APPLICATION_URL, BACKEND_URL, BASE_PATH, BUILD_MODE, CACHE, CACHE_DIR, CMS_URL, CODE_DIR, COMPILER_DICTIONARY_KEY_PREFIX, COMPILER_ENABLED, COMPILER_NO_METADATA, COMPILER_SAVE_COMPONENTS, CONFIG_DIR, CONTENT_AUTO_TRANSFORMATION, CONTENT_DIR, COOKIE_NAME, DEFAULT_LOCALE, DICTIONARIES_DIR, DICTIONARY_PRIORITY_STRATEGY, DYNAMIC_DICTIONARIES_DIR, EDITOR_URL, ENABLE_PROXY, EXCLUDED_PATHS, FETCH_DICTIONARIES_DIR, FILE_EXTENSIONS, FILL, HEADER_NAME, I18NEXT_DICTIONARIES_DIR, IMPORT_MODE, IS_ENABLED, LIVE_SYNC, LIVE_SYNC_PORT, LOCALES, LOCALE_STORAGE_NAME, LOCATION, MAIN_DIR, MASKS_DIR, MINIFY, MODE, MODULE_AUGMENTATION_DIR, OPTIMIZE, OUTPUT_FORMAT, PORT, PREFIX, PURGE, REACT_INTL_MESSAGES_DIR, REMOTE_DICTIONARIES_DIR, REQUIRED_LOCALES, ROUTING_MODE, SERVER_SET_COOKIE, STORAGE, STRICT_MODE, TEMP_DIR, TRAVERSE_PATTERN, TYPES_DIR, TYPE_CHECKING, UNMERGED_DICTIONARIES_DIR, WATCH };
|
|
@@ -7,7 +7,8 @@ declare const LOCALE_STORAGE_NAME = "INTLAYER_LOCALE";
|
|
|
7
7
|
declare const BASE_PATH = "";
|
|
8
8
|
declare const SERVER_SET_COOKIE = "always";
|
|
9
9
|
declare const ROUTING_MODE = "prefix-no-default";
|
|
10
|
+
declare const ENABLE_PROXY = true;
|
|
10
11
|
declare const STORAGE: RoutingStorageInput;
|
|
11
12
|
//#endregion
|
|
12
|
-
export { BASE_PATH, COOKIE_NAME, HEADER_NAME, LOCALE_STORAGE_NAME, ROUTING_MODE, SERVER_SET_COOKIE, STORAGE };
|
|
13
|
+
export { BASE_PATH, COOKIE_NAME, ENABLE_PROXY, HEADER_NAME, LOCALE_STORAGE_NAME, ROUTING_MODE, SERVER_SET_COOKIE, STORAGE };
|
|
13
14
|
//# sourceMappingURL=routing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","names":[],"sources":["../../../src/defaultValues/routing.ts"],"mappings":";;;cAEa,WAAA;AAAA,cAEA,WAAA;AAAA,cACA,mBAAA;AAAA,cAEA,SAAA;AAAA,cAEA,iBAAA;AAAA,cAEA,YAAA;AAAA,cAEA,OAAA,EAAS,mBAAA"}
|
|
1
|
+
{"version":3,"file":"routing.d.ts","names":[],"sources":["../../../src/defaultValues/routing.ts"],"mappings":";;;cAEa,WAAA;AAAA,cAEA,WAAA;AAAA,cACA,mBAAA;AAAA,cAEA,SAAA;AAAA,cAEA,iBAAA;AAAA,cAEA,YAAA;AAAA,cAEA,YAAA;AAAA,cAEA,OAAA,EAAS,mBAAA"}
|
|
@@ -13,6 +13,25 @@ import { IntlayerConfig } from "@intlayer/types/config";
|
|
|
13
13
|
* // { 'process.env.INTLAYER_NODE_TYPE_REACT_NODE': '"false"' }
|
|
14
14
|
*/
|
|
15
15
|
declare const formatNodeTypeToEnvVar: (nodeTypes: string[], wrapKey?: (key: string) => string, wrapValue?: (value: string) => string) => Record<string, string>;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the env-var definition disabling the dictionary-selector resolution
|
|
18
|
+
* path (collections, variants) when no built dictionary declares
|
|
19
|
+
* a qualifier. Set to `"false"` so bundlers can dead-code-eliminate the
|
|
20
|
+
* selector branch in `getIntlayer` / `useIntlayer`.
|
|
21
|
+
*
|
|
22
|
+
* Emits nothing when selectors are used, leaving the runtime default in place.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* formatDictionarySelectorEnvVar(false)
|
|
26
|
+
* // { INTLAYER_DICTIONARY_SELECTOR: '"false"' }
|
|
27
|
+
*
|
|
28
|
+
* formatDictionarySelectorEnvVar(true)
|
|
29
|
+
* // {}
|
|
30
|
+
*
|
|
31
|
+
* formatDictionarySelectorEnvVar(false, (k) => `process.env.${k}`, (v) => `"${v}"`)
|
|
32
|
+
* // { 'process.env.INTLAYER_DICTIONARY_SELECTOR': '"false"' }
|
|
33
|
+
*/
|
|
34
|
+
declare const formatDictionarySelectorEnvVar: (hasDictionarySelector: boolean, wrapKey?: (key: string) => string, wrapValue?: (value: string) => string) => Record<string, string>;
|
|
16
35
|
/**
|
|
17
36
|
* Returns env-var definitions for the full Intlayer config to be injected at
|
|
18
37
|
* build time. Allows bundlers to dead-code-eliminate unused routing modes,
|
|
@@ -27,5 +46,5 @@ declare const formatNodeTypeToEnvVar: (nodeTypes: string[], wrapKey?: (key: stri
|
|
|
27
46
|
*/
|
|
28
47
|
declare const getConfigEnvVars: (config: IntlayerConfig, wrapKey?: (key: string) => string, wrapValue?: (value: string) => string) => Record<string, string>;
|
|
29
48
|
//#endregion
|
|
30
|
-
export { formatNodeTypeToEnvVar, getConfigEnvVars };
|
|
49
|
+
export { formatDictionarySelectorEnvVar, formatNodeTypeToEnvVar, getConfigEnvVars };
|
|
31
50
|
//# sourceMappingURL=envVars.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envVars.d.ts","names":[],"sources":["../../../src/envVars/envVars.ts"],"mappings":";;;;;AA2BA;;;;;;;;;cAAa,sBAAA,GACX,SAAA,YACA,OAAA,IAAW,GAAA,qBACX,SAAA,IAAa,KAAA,wBACZ,MAAA;;;
|
|
1
|
+
{"version":3,"file":"envVars.d.ts","names":[],"sources":["../../../src/envVars/envVars.ts"],"mappings":";;;;;AA2BA;;;;;;;;;cAAa,sBAAA,GACX,SAAA,YACA,OAAA,IAAW,GAAA,qBACX,SAAA,IAAa,KAAA,wBACZ,MAAA;;;AA4BH;;;;;;;;;;;;AAqBA;;;;cArBa,8BAAA,GACX,qBAAA,WACA,OAAA,IAAW,GAAA,qBACX,SAAA,IAAa,KAAA,wBACZ,MAAA;;;;;;;;;;;;;cAiBU,gBAAA,GACX,MAAA,EAAQ,cAAA,EACR,OAAA,IAAW,GAAA,qBACX,SAAA,IAAa,KAAA,wBACZ,MAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { formatNodeTypeToEnvVar, getConfigEnvVars } from "./envVars.js";
|
|
2
|
-
export { formatNodeTypeToEnvVar, getConfigEnvVars };
|
|
1
|
+
import { formatDictionarySelectorEnvVar, formatNodeTypeToEnvVar, getConfigEnvVars } from "./envVars.js";
|
|
2
|
+
export { formatDictionarySelectorEnvVar, formatNodeTypeToEnvVar, getConfigEnvVars };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transpileTSToCJS.d.ts","names":[],"sources":["../../../src/loadExternalFile/transpileTSToCJS.ts"],"mappings":";;;;KAaY,gBAAA,GAAmB,YAAA;;;AAA/B;;;;;EAQE,eAAA,UARyC,SAAA;AAAA;AAAA,cA8C9B,oBAAA,GACX,IAAA,UACA,QAAA,UACA,OAAA,GAAU,gBAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"transpileTSToCJS.d.ts","names":[],"sources":["../../../src/loadExternalFile/transpileTSToCJS.ts"],"mappings":";;;;KAaY,gBAAA,GAAmB,YAAA;;;AAA/B;;;;;EAQE,eAAA,UARyC,SAAA;AAAA;AAAA,cA8C9B,oBAAA,GACX,IAAA,UACA,QAAA,UACA,OAAA,GAAU,gBAAA;AAAA,cAmEC,gBAAA,GACX,IAAA,UACA,QAAA,UACA,OAAA,GAAU,gBAAA,KACT,OAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Dictionary, QualifiedDictionaryGroup } from "@intlayer/types/dictionary";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/getDictionarySelectorUsage.d.ts
|
|
4
|
+
type DictionaryOrGroup = Dictionary | QualifiedDictionaryGroup;
|
|
5
|
+
/**
|
|
6
|
+
* Detects whether any built dictionary declares qualifier dimensions
|
|
7
|
+
* (collections or variants).
|
|
8
|
+
*
|
|
9
|
+
* The merge step emits a {@link QualifiedDictionaryGroup} — carrying a
|
|
10
|
+
* non-empty `qualifierTypes` array — for every key whose declarations use a
|
|
11
|
+
* selector. When no group is present, the selector-object resolution path in
|
|
12
|
+
* `getIntlayer` / `useIntlayer` is dead code, and bundlers can eliminate it via
|
|
13
|
+
* the `INTLAYER_DICTIONARY_SELECTOR` env var.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* getHasDictionarySelector(getDictionaries(config));
|
|
17
|
+
* // true → at least one collection / variant / meta dictionary
|
|
18
|
+
* // false → only plain dictionaries (selector logic can be stripped)
|
|
19
|
+
*/
|
|
20
|
+
declare const getHasDictionarySelector: (dictionaries: Record<string, DictionaryOrGroup> | DictionaryOrGroup[]) => boolean;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { getHasDictionarySelector };
|
|
23
|
+
//# sourceMappingURL=getDictionarySelectorUsage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDictionarySelectorUsage.d.ts","names":[],"sources":["../../../src/utils/getDictionarySelectorUsage.ts"],"mappings":";;;KAKK,iBAAA,GAAoB,UAAA,GAAa,wBAAA;;AAFF;;;;;AAmBpC;;;;;;;;;cAAa,wBAAA,GACX,YAAA,EAAc,MAAA,SAAe,iBAAA,IAAqB,iBAAA"}
|
|
@@ -12,6 +12,7 @@ import { CacheKey, cacheMemory, clearAllCache, clearCache, computeKeyId, getCach
|
|
|
12
12
|
import { cacheDisk, clearDiskCacheMemory } from "./cacheDisk.js";
|
|
13
13
|
import { clearModuleCache } from "./clearModuleCache.js";
|
|
14
14
|
import { compareVersions } from "./compareVersions.js";
|
|
15
|
+
import { getHasDictionarySelector } from "./getDictionarySelectorUsage.js";
|
|
15
16
|
import { getExtension } from "./getExtension.js";
|
|
16
17
|
import { getPackageJsonPath } from "./getPackageJsonPath.js";
|
|
17
18
|
import { getStorageAttributes } from "./getStorageAttributes.js";
|
|
@@ -19,4 +20,4 @@ import { PluginNodeType, getUnusedNodeTypes, getUnusedNodeTypesAsync, getUsedNod
|
|
|
19
20
|
import { parseFilePathPattern, parseStringPattern } from "./parseFilePathPattern.js";
|
|
20
21
|
import { assertPathWithin } from "./pathSecurity.js";
|
|
21
22
|
import { RetryManagerOptions, retryManager } from "./retryManager.js";
|
|
22
|
-
export { CacheKey, GetAliasOptions, PluginNodeType, RetryManagerOptions, WindowsWithIntlayer, assertPathWithin, cacheDisk, cacheMemory, camelCaseToKebabCase, camelCaseToSentence, clearAllCache, clearCache, clearDiskCacheMemory, clearModuleCache, compareVersions, computeKeyId, configESMxCJSRequire, extractErrorMessage, getAlias, getCache, getExtension, getPackageJsonPath, getProjectRequire, getStorageAttributes, getUnusedNodeTypes, getUnusedNodeTypesAsync, getUsedNodeTypes, getUsedNodeTypesAsync, isESModule, kebabCaseToCamelCase, logStack, normalizePath, parseFilePathPattern, parseStringPattern, retryManager, setCache, setIntlayerIdentifier, stableStringify, toLowerCamelCase };
|
|
23
|
+
export { CacheKey, GetAliasOptions, PluginNodeType, RetryManagerOptions, WindowsWithIntlayer, assertPathWithin, cacheDisk, cacheMemory, camelCaseToKebabCase, camelCaseToSentence, clearAllCache, clearCache, clearDiskCacheMemory, clearModuleCache, compareVersions, computeKeyId, configESMxCJSRequire, extractErrorMessage, getAlias, getCache, getExtension, getHasDictionarySelector, getPackageJsonPath, getProjectRequire, getStorageAttributes, getUnusedNodeTypes, getUnusedNodeTypesAsync, getUsedNodeTypes, getUsedNodeTypesAsync, isESModule, kebabCaseToCamelCase, logStack, normalizePath, parseFilePathPattern, parseStringPattern, retryManager, setCache, setIntlayerIdentifier, stableStringify, toLowerCamelCase };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/config",
|
|
3
|
-
"version": "9.0.0-canary.
|
|
3
|
+
"version": "9.0.0-canary.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.",
|
|
6
6
|
"keywords": [
|
|
@@ -160,15 +160,15 @@
|
|
|
160
160
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
161
161
|
},
|
|
162
162
|
"dependencies": {
|
|
163
|
-
"@intlayer/types": "9.0.0-canary.
|
|
163
|
+
"@intlayer/types": "9.0.0-canary.10",
|
|
164
164
|
"defu": "6.1.7",
|
|
165
165
|
"dotenv": "17.4.2",
|
|
166
|
-
"esbuild": "0.28.
|
|
166
|
+
"esbuild": "0.28.1",
|
|
167
167
|
"json5": "2.2.3",
|
|
168
168
|
"zod": "4.4.3"
|
|
169
169
|
},
|
|
170
170
|
"devDependencies": {
|
|
171
|
-
"@types/node": "25.9.
|
|
171
|
+
"@types/node": "25.9.4",
|
|
172
172
|
"@utils/ts-config": "1.0.4",
|
|
173
173
|
"@utils/ts-config-types": "1.0.4",
|
|
174
174
|
"@utils/tsdown-config": "1.0.4",
|