vike 0.4.146-commit-701e2e5 → 0.4.147-commit-2fa53b2

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.
Files changed (80) hide show
  1. package/dist/cjs/node/plugin/index.js +6 -4
  2. package/dist/cjs/node/plugin/plugins/devConfig/determineOptimizeDeps.js +3 -4
  3. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigValuesSerialized.js +76 -0
  4. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +61 -40
  5. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js +104 -0
  6. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +62 -75
  7. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +43 -17
  8. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.js +12 -70
  9. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/isRuntimeEnvMatch.js +11 -8
  10. package/dist/cjs/node/plugin/shared/{getConfigValueSourcesRelevant.js → getConfigValueSourcesNotOverriden.js} +3 -3
  11. package/dist/cjs/node/plugin/utils.js +2 -0
  12. package/dist/cjs/node/prerender/runPrerender.js +75 -67
  13. package/dist/cjs/node/runtime/html/injectAssets/injectAssets__public.js +1 -1
  14. package/dist/cjs/node/runtime/index-common.js +3 -1
  15. package/dist/cjs/node/runtime/renderPage/analyzePage.js +2 -2
  16. package/dist/cjs/node/runtime/renderPage/createHttpResponseObject/assertNoInfiniteHttpRedirect.js +12 -12
  17. package/dist/cjs/node/runtime/renderPage/createHttpResponseObject.js +3 -3
  18. package/dist/cjs/node/runtime/renderPage/executeOnRenderHtmlHook.js +1 -2
  19. package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +1 -1
  20. package/dist/cjs/node/runtime/renderPage.js +8 -5
  21. package/dist/cjs/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +1 -0
  22. package/dist/cjs/shared/page-configs/loadConfigValues.js +12 -3
  23. package/dist/cjs/shared/page-configs/serialize/parseConfigValuesSerialized.js +19 -0
  24. package/dist/cjs/shared/page-configs/serialize/parsePageConfigs.js +3 -12
  25. package/dist/cjs/utils/assertKeys.js +28 -0
  26. package/dist/cjs/utils/joinEnglish.js +3 -3
  27. package/dist/cjs/utils/parseUrl.js +24 -16
  28. package/dist/cjs/utils/projectInfo.js +3 -2
  29. package/dist/esm/client/client-routing-runtime/getPageContextFromHooks.js +25 -11
  30. package/dist/esm/client/client-routing-runtime/index.d.ts +1 -0
  31. package/dist/esm/client/client-routing-runtime/index.js +1 -0
  32. package/dist/esm/client/client-routing-runtime/onBrowserHistoryNavigation.js +2 -2
  33. package/dist/esm/client/shared/getPageContextSerializedInHtml.js +1 -1
  34. package/dist/esm/node/plugin/index.d.ts +1 -0
  35. package/dist/esm/node/plugin/index.js +1 -0
  36. package/dist/esm/node/plugin/plugins/devConfig/determineOptimizeDeps.js +3 -4
  37. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getConfigValuesSerialized.d.ts +5 -0
  38. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getConfigValuesSerialized.js +70 -0
  39. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +58 -37
  40. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.d.ts +5 -0
  41. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js +98 -0
  42. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +63 -76
  43. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +43 -17
  44. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.d.ts +0 -3
  45. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.js +13 -68
  46. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/isRuntimeEnvMatch.js +11 -8
  47. package/dist/esm/node/plugin/shared/getConfigValueSourcesNotOverriden.d.ts +5 -0
  48. package/dist/esm/node/plugin/shared/{getConfigValueSourcesRelevant.js → getConfigValueSourcesNotOverriden.js} +2 -2
  49. package/dist/esm/node/plugin/utils.d.ts +2 -0
  50. package/dist/esm/node/plugin/utils.js +2 -0
  51. package/dist/esm/node/prerender/runPrerender.js +75 -67
  52. package/dist/esm/node/runtime/html/injectAssets/injectAssets__public.js +1 -1
  53. package/dist/esm/node/runtime/index-common.d.ts +1 -0
  54. package/dist/esm/node/runtime/index-common.js +1 -0
  55. package/dist/esm/node/runtime/renderPage/analyzePage.js +2 -2
  56. package/dist/esm/node/runtime/renderPage/createHttpResponseObject/assertNoInfiniteHttpRedirect.d.ts +1 -1
  57. package/dist/esm/node/runtime/renderPage/createHttpResponseObject/assertNoInfiniteHttpRedirect.js +12 -12
  58. package/dist/esm/node/runtime/renderPage/createHttpResponseObject.d.ts +1 -1
  59. package/dist/esm/node/runtime/renderPage/createHttpResponseObject.js +3 -3
  60. package/dist/esm/node/runtime/renderPage/executeOnRenderHtmlHook.js +1 -2
  61. package/dist/esm/node/runtime/renderPage/getHttpResponseBody.js +1 -1
  62. package/dist/esm/node/runtime/renderPage.js +9 -6
  63. package/dist/esm/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +1 -0
  64. package/dist/esm/shared/page-configs/PageConfig.d.ts +14 -4
  65. package/dist/esm/shared/page-configs/loadConfigValues.js +12 -3
  66. package/dist/esm/shared/page-configs/serialize/parseConfigValuesSerialized.d.ts +4 -0
  67. package/dist/esm/shared/page-configs/serialize/parseConfigValuesSerialized.js +16 -0
  68. package/dist/esm/shared/page-configs/serialize/parsePageConfigs.js +4 -13
  69. package/dist/esm/utils/assertKeys.d.ts +4 -0
  70. package/dist/esm/utils/assertKeys.js +22 -0
  71. package/dist/esm/utils/joinEnglish.d.ts +1 -1
  72. package/dist/esm/utils/joinEnglish.js +3 -3
  73. package/dist/esm/utils/parseUrl.js +24 -16
  74. package/dist/esm/utils/projectInfo.d.ts +3 -1
  75. package/dist/esm/utils/projectInfo.js +2 -1
  76. package/package.json +3 -3
  77. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/helpers.js +0 -28
  78. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/helpers.d.ts +0 -5
  79. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/helpers.js +0 -25
  80. package/dist/esm/node/plugin/shared/getConfigValueSourcesRelevant.d.ts +0 -5
@@ -16,7 +16,7 @@ export type { DefinedAtFile };
16
16
  export type { DefinedAtFileFullInfo };
17
17
  export type { FilePathResolved };
18
18
  export type { FilePath };
19
- import type { ConfigValueImported } from './serialize/PageConfigSerialized.js';
19
+ import type { ConfigValueImported, ConfigValueSerialized } from './serialize/PageConfigSerialized.js';
20
20
  type PageConfigBase = {
21
21
  pageId: string;
22
22
  isErrorPage?: true;
@@ -30,7 +30,10 @@ type PageConfigRuntime = PageConfigBase & {
30
30
  /** All loaded config values */
31
31
  configValues: ConfigValues;
32
32
  /** Load config values that are lazily loaded such as config.Page */
33
- loadConfigValuesAll: () => Promise<ConfigValueImported[]>;
33
+ loadConfigValuesAll: () => Promise<{
34
+ configValuesImported: ConfigValueImported[];
35
+ configValuesSerialized: Record<string, ConfigValueSerialized>;
36
+ }>;
34
37
  };
35
38
  /** Same as PageConfigRuntime but also contains all lazily loaded config values such as config.Page */
36
39
  type PageConfigRuntimeLoaded = PageConfigRuntime & {
@@ -50,9 +53,16 @@ type PageConfigGlobalRuntime = {
50
53
  type PageConfigGlobalBuildTime = {
51
54
  configValueSources: ConfigValueSources;
52
55
  };
53
- type ConfigEnv = 'client-only' | 'server-only' | 'server-and-client' | 'config-only';
56
+ type ConfigEnv = {
57
+ client?: boolean;
58
+ server?: boolean;
59
+ config?: boolean;
60
+ };
54
61
  /** For Vike internal use */
55
- type ConfigEnvInternal = ConfigEnv | '_routing-eager' | '_routing-lazy';
62
+ type ConfigEnvInternal = Omit<ConfigEnv, 'client'> & {
63
+ client?: boolean | 'if-client-routing';
64
+ eager?: boolean;
65
+ };
56
66
  type ConfigValueSource = {
57
67
  value?: unknown;
58
68
  configEnv: ConfigEnvInternal;
@@ -1,15 +1,24 @@
1
1
  export { loadConfigValues };
2
2
  import { objectAssign } from '../utils.js';
3
3
  import { parseConfigValuesImported } from './serialize/parseConfigValuesImported.js';
4
+ import { parseConfigValuesSerialized } from './serialize/parseConfigValuesSerialized.js';
4
5
  async function loadConfigValues(pageConfig, isDev) {
5
6
  if ('isAllLoaded' in pageConfig &&
6
7
  // We don't need to cache in dev, since Vite already caches the virtual module
7
8
  !isDev) {
8
9
  return pageConfig;
9
10
  }
10
- const configValuesImported = await pageConfig.loadConfigValuesAll();
11
- const configValuesAddendum = parseConfigValuesImported(configValuesImported);
12
- Object.assign(pageConfig.configValues, configValuesAddendum);
11
+ const configValuesLoaded = await pageConfig.loadConfigValuesAll();
12
+ {
13
+ const { configValuesImported } = configValuesLoaded;
14
+ const configValuesAddendum = parseConfigValuesImported(configValuesImported);
15
+ Object.assign(pageConfig.configValues, configValuesAddendum);
16
+ }
17
+ {
18
+ const { configValuesSerialized } = configValuesLoaded;
19
+ const configValuesAddendum = parseConfigValuesSerialized(configValuesSerialized);
20
+ Object.assign(pageConfig.configValues, configValuesAddendum);
21
+ }
13
22
  objectAssign(pageConfig, { isAllLoaded: true });
14
23
  return pageConfig;
15
24
  }
@@ -0,0 +1,4 @@
1
+ export { parseConfigValuesSerialized };
2
+ import type { ConfigValues } from '../PageConfig.js';
3
+ import type { ConfigValueSerialized } from './PageConfigSerialized.js';
4
+ declare function parseConfigValuesSerialized(configValuesSerialized: Record<string, ConfigValueSerialized>): ConfigValues;
@@ -0,0 +1,16 @@
1
+ export { parseConfigValuesSerialized };
2
+ import { assert } from '../../utils.js';
3
+ import { parse } from '@brillout/json-serializer/parse';
4
+ function parseConfigValuesSerialized(configValuesSerialized) {
5
+ const configValues = {};
6
+ Object.entries(configValuesSerialized).forEach(([configName, configValueSeriliazed]) => {
7
+ const { valueSerialized, definedAt } = configValueSeriliazed;
8
+ assert(valueSerialized);
9
+ assert(!configValues[configName]);
10
+ configValues[configName] = {
11
+ value: parse(valueSerialized),
12
+ definedAt
13
+ };
14
+ });
15
+ return configValues;
16
+ }
@@ -1,24 +1,15 @@
1
1
  export { parsePageConfigs };
2
- import { parse } from '@brillout/json-serializer/parse';
3
2
  import { parseConfigValuesImported } from './parseConfigValuesImported.js';
4
- import { assert, assertUsage, isCallable } from '../../utils.js';
3
+ import { assertUsage, isCallable } from '../../utils.js';
5
4
  import { getConfigDefinedAtString } from '../helpers.js';
5
+ import { parseConfigValuesSerialized } from './parseConfigValuesSerialized.js';
6
6
  function parsePageConfigs(pageConfigsSerialized, pageConfigGlobalSerialized) {
7
7
  const pageConfigs = pageConfigsSerialized.map((pageConfigSerialized) => {
8
8
  const configValues = {};
9
9
  {
10
10
  const { configValuesSerialized } = pageConfigSerialized;
11
- Object.entries(configValuesSerialized).forEach(([configName, configValueSeriliazed]) => {
12
- {
13
- const { valueSerialized, definedAt } = configValueSeriliazed;
14
- assert(valueSerialized);
15
- assert(!configValues[configName]);
16
- configValues[configName] = {
17
- value: parse(valueSerialized),
18
- definedAt
19
- };
20
- }
21
- });
11
+ const configValuesAddendum = parseConfigValuesSerialized(configValuesSerialized);
12
+ Object.assign(configValues, configValuesAddendum);
22
13
  }
23
14
  {
24
15
  const { configValuesImported } = pageConfigSerialized;
@@ -0,0 +1,4 @@
1
+ export { assertKeys };
2
+ declare function assertKeys<Keys extends readonly string[]>(obj: Record<string, unknown>, keysExpected: Keys, errPrefix: string): asserts obj is {
3
+ [key in Keys[number]]?: unknown;
4
+ };
@@ -0,0 +1,22 @@
1
+ export { assertKeys };
2
+ import pc from '@brillout/picocolors';
3
+ import { assertUsage } from './assert.js';
4
+ import { joinEnglish } from './joinEnglish.js';
5
+ function assertKeys(obj, keysExpected, errPrefix) {
6
+ const keysUnknown = [];
7
+ const keys = Object.keys(obj);
8
+ for (const key of keys) {
9
+ if (!keysExpected.includes(key)) {
10
+ keysUnknown.push(key);
11
+ }
12
+ }
13
+ if (keysUnknown.length !== 0) {
14
+ assertUsage(false, [
15
+ errPrefix,
16
+ `unknown key${keysUnknown.length === 1 ? '' : 's'}`,
17
+ joinEnglish(keysUnknown, 'and', pc.cyan) + '.',
18
+ 'Only following keys are allowed:',
19
+ joinEnglish(keysExpected, 'and', pc.cyan) + '.'
20
+ ].join(' '));
21
+ }
22
+ }
@@ -1,2 +1,2 @@
1
1
  export { joinEnglish };
2
- declare function joinEnglish(arr: string[], conjunction: 'or' | 'and'): string;
2
+ declare function joinEnglish(arr: string[] | readonly string[], conjunction: 'or' | 'and', colorizer?: (s: string) => string): string;
@@ -1,11 +1,11 @@
1
1
  export { joinEnglish };
2
2
  import { assert } from './assert.js';
3
3
  // https://stackoverflow.com/questions/53879088/join-an-array-by-commas-and-and/53879103#53879103
4
- function joinEnglish(arr, conjunction) {
4
+ function joinEnglish(arr, conjunction, colorizer = (s) => s) {
5
5
  assert(arr.length > 0);
6
6
  if (arr.length === 1)
7
- return arr[0];
7
+ return colorizer(arr[0]);
8
8
  const firsts = arr.slice(0, arr.length - 1);
9
9
  const last = arr[arr.length - 1];
10
- return firsts.join(', ') + ` ${conjunction} ` + last;
10
+ return firsts.map(colorizer).join(', ') + ` ${conjunction} ` + colorizer(last);
11
11
  }
@@ -54,7 +54,7 @@ function parseUrl(url, baseServer) {
54
54
  searchAll[key] = [...(searchAll.hasOwnProperty(key) ? searchAll[key] : []), val];
55
55
  });
56
56
  // Origin + pathname
57
- const { origin, pathname: pathnameResolved } = parsePathname(urlWithoutHashNorSearch, baseServer);
57
+ const { origin, pathname: pathnameResolved } = getPathname(urlWithoutHashNorSearch, baseServer);
58
58
  assert(origin === null || origin === decodeSafe(origin)); // AFAICT decoding the origin is useless
59
59
  assert(pathnameResolved.startsWith('/'));
60
60
  assert(origin === null || url.startsWith(origin));
@@ -89,35 +89,43 @@ function decodeSafe(urlComponent) {
89
89
  return urlComponent;
90
90
  }
91
91
  function decodePathname(urlPathname) {
92
+ urlPathname = urlPathname.replace(/\s+$/, '');
92
93
  urlPathname = urlPathname
93
94
  .split('/')
94
95
  .map((dir) => decodeSafe(dir).split('/').join('%2F'))
95
96
  .join('/');
96
- urlPathname = urlPathname.replace(/\s/g, '');
97
97
  return urlPathname;
98
98
  }
99
- function parsePathname(urlWithoutHashNorSearch, baseServer) {
99
+ function getPathname(url, baseServer) {
100
+ // Search and hash already extracted
101
+ assert(!url.includes('?') && !url.includes('#'));
102
+ // url has origin
100
103
  {
101
- const { origin, pathname } = parseOrigin(urlWithoutHashNorSearch);
104
+ const { origin, pathname } = parseOrigin(url);
102
105
  if (origin) {
103
106
  return { origin, pathname };
104
107
  }
105
- assert(pathname === urlWithoutHashNorSearch);
108
+ assert(pathname === url);
106
109
  }
107
- if (urlWithoutHashNorSearch.startsWith('/')) {
108
- return { origin: null, pathname: urlWithoutHashNorSearch };
110
+ // url doesn't have origin
111
+ if (url.startsWith('/')) {
112
+ return { origin: null, pathname: url };
109
113
  }
110
114
  else {
111
- // In the browser, this is the Base URL of the current URL
115
+ // url is a relative path
116
+ // In the browser, this is the Base URL of the current URL.
112
117
  // Safe access `window?.document?.baseURI` for users who shim `window` in Node.js
113
- let baseURI = typeof window !== 'undefined' && window?.document?.baseURI;
114
- if (baseURI)
115
- baseURI = parseOrigin(baseURI).pathname;
116
- const base = baseURI || baseServer;
117
- const pathname = resolveUrlPathnameRelative(urlWithoutHashNorSearch, base);
118
- // We need to parse the origin in case `base === window.document.baseURI`
119
- const parsed = parseOrigin(pathname);
120
- return parsed;
118
+ const baseURI = typeof window !== 'undefined' ? window?.document?.baseURI : undefined;
119
+ let base;
120
+ if (baseURI) {
121
+ const baseURIPathaname = parseOrigin(baseURI.split('?')[0]).pathname;
122
+ base = baseURIPathaname;
123
+ }
124
+ else {
125
+ base = baseServer;
126
+ }
127
+ const pathname = resolveUrlPathnameRelative(url, base);
128
+ return { origin: null, pathname };
121
129
  }
122
130
  }
123
131
  function parseOrigin(url) {
@@ -1,11 +1,13 @@
1
1
  export { projectInfo };
2
2
  export type { ProjectTag };
3
+ export { PROJECT_VERSION };
4
+ declare const PROJECT_VERSION: "0.4.147-commit-2fa53b2";
3
5
  type PackageName = typeof projectInfo.npmPackageName;
4
6
  type ProjectVersion = typeof projectInfo.projectVersion;
5
7
  type ProjectTag = `[${PackageName}]` | `[${PackageName}@${ProjectVersion}]`;
6
8
  declare const projectInfo: {
7
9
  projectName: "Vike";
8
- projectVersion: "0.4.146-commit-701e2e5";
10
+ projectVersion: "0.4.147-commit-2fa53b2";
9
11
  npmPackageName: "vike";
10
12
  githubRepository: "https://github.com/vikejs/vike";
11
13
  };
@@ -1,6 +1,7 @@
1
1
  export { projectInfo };
2
+ export { PROJECT_VERSION };
2
3
  import { onProjectInfo } from './assertSingleInstance.js';
3
- const PROJECT_VERSION = '0.4.146-commit-701e2e5';
4
+ const PROJECT_VERSION = '0.4.147-commit-2fa53b2';
4
5
  const projectInfo = {
5
6
  projectName: 'Vike',
6
7
  projectVersion: PROJECT_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.146-commit-701e2e5",
3
+ "version": "0.4.147-commit-2fa53b2",
4
4
  "scripts": {
5
5
  "dev": "tsc --watch",
6
6
  "build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",
@@ -14,7 +14,7 @@
14
14
  "dependencies": {
15
15
  "@brillout/import": "0.2.3",
16
16
  "@brillout/json-serializer": "^0.5.8",
17
- "@brillout/picocolors": "^1.0.9",
17
+ "@brillout/picocolors": "^1.0.10",
18
18
  "@brillout/require-shim": "^0.1.2",
19
19
  "@brillout/vite-plugin-import-build": "^0.2.20",
20
20
  "acorn": "^8.8.2",
@@ -162,7 +162,7 @@
162
162
  "vike": "./node/cli/bin-entry.js"
163
163
  },
164
164
  "devDependencies": {
165
- "@brillout/release-me": "^0.1.8",
165
+ "@brillout/release-me": "^0.1.9",
166
166
  "@types/estree": "^1.0.0",
167
167
  "@types/jest": "^27.4.1",
168
168
  "@types/node": "^20.1.0",
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isConfigSet = exports.getConfigEnv = void 0;
4
- const utils_js_1 = require("../../../utils.js");
5
- (0, utils_js_1.assertIsNotProductionRuntime)();
6
- function getConfigEnv(configValueSources, configName) {
7
- const configValueSource = getConfigValueSource(configValueSources, configName);
8
- if (!configValueSource)
9
- return null;
10
- return configValueSource.configEnv;
11
- }
12
- exports.getConfigEnv = getConfigEnv;
13
- function isConfigSet(configValueSources, configName) {
14
- const configValueSource = getConfigValueSource(configValueSources, configName);
15
- // Enable users to suppress global config values by overriding the config's value to null
16
- if (configValueSource?.value === null)
17
- return false;
18
- return !!configValueSource;
19
- }
20
- exports.isConfigSet = isConfigSet;
21
- function getConfigValueSource(configValueSources, configName) {
22
- const sources = configValueSources[configName];
23
- if (!sources)
24
- return null;
25
- const configValueSource = sources[0];
26
- (0, utils_js_1.assert)(configValueSource);
27
- return configValueSource;
28
- }
@@ -1,5 +0,0 @@
1
- export { getConfigEnv };
2
- export { isConfigSet };
3
- import type { ConfigEnvInternal, ConfigValueSources } from '../../../../../shared/page-configs/PageConfig.js';
4
- declare function getConfigEnv(configValueSources: ConfigValueSources, configName: string): null | ConfigEnvInternal;
5
- declare function isConfigSet(configValueSources: ConfigValueSources, configName: string): boolean;
@@ -1,25 +0,0 @@
1
- export { getConfigEnv };
2
- export { isConfigSet };
3
- import { assert, assertIsNotProductionRuntime } from '../../../utils.js';
4
- assertIsNotProductionRuntime();
5
- function getConfigEnv(configValueSources, configName) {
6
- const configValueSource = getConfigValueSource(configValueSources, configName);
7
- if (!configValueSource)
8
- return null;
9
- return configValueSource.configEnv;
10
- }
11
- function isConfigSet(configValueSources, configName) {
12
- const configValueSource = getConfigValueSource(configValueSources, configName);
13
- // Enable users to suppress global config values by overriding the config's value to null
14
- if (configValueSource?.value === null)
15
- return false;
16
- return !!configValueSource;
17
- }
18
- function getConfigValueSource(configValueSources, configName) {
19
- const sources = configValueSources[configName];
20
- if (!sources)
21
- return null;
22
- const configValueSource = sources[0];
23
- assert(configValueSource);
24
- return configValueSource;
25
- }
@@ -1,5 +0,0 @@
1
- export { getConfigValueSourcesRelevant };
2
- import type { ConfigValueSource, PageConfigBuildTime } from '../../../shared/page-configs/PageConfig.js';
3
- declare function getConfigValueSourcesRelevant(pageConfig: PageConfigBuildTime): (ConfigValueSource & {
4
- configName: string;
5
- })[];