vike 0.4.162 → 0.4.163

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 (38) hide show
  1. package/dist/cjs/node/plugin/plugins/buildConfig.js +21 -17
  2. package/dist/cjs/node/plugin/plugins/commonConfig.js +8 -2
  3. package/dist/cjs/node/plugin/plugins/importBuild/index.js +2 -3
  4. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +6 -1
  5. package/dist/cjs/node/runtime/globalContext/loadImportBuild.js +3 -3
  6. package/dist/cjs/node/runtime/globalContext.js +47 -6
  7. package/dist/cjs/node/runtime/index-common.js +4 -1
  8. package/dist/cjs/node/runtime/renderPage/getPageAssets/getManifestEntry.js +19 -19
  9. package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +12 -12
  10. package/dist/cjs/node/runtime/renderPage/getPageAssets.js +5 -5
  11. package/dist/cjs/node/runtime/renderPage/logErrorHint.js +7 -0
  12. package/dist/cjs/node/runtime/renderPage.js +3 -0
  13. package/dist/cjs/shared/page-configs/serialize/serializeConfigValue.js +4 -11
  14. package/dist/cjs/utils/projectInfo.js +1 -1
  15. package/dist/esm/client/client-routing-runtime/renderPageClientSide.js +20 -14
  16. package/dist/esm/client/shared/getPageContextProxyForUser.js +19 -2
  17. package/dist/esm/node/plugin/plugins/buildConfig.js +21 -17
  18. package/dist/esm/node/plugin/plugins/commonConfig.js +9 -3
  19. package/dist/esm/node/plugin/plugins/importBuild/index.js +2 -3
  20. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +6 -1
  21. package/dist/esm/node/runtime/globalContext/loadImportBuild.d.ts +2 -2
  22. package/dist/esm/node/runtime/globalContext/loadImportBuild.js +3 -3
  23. package/dist/esm/node/runtime/globalContext.d.ts +11 -2
  24. package/dist/esm/node/runtime/globalContext.js +49 -6
  25. package/dist/esm/node/runtime/index-common.d.ts +1 -0
  26. package/dist/esm/node/runtime/index-common.js +1 -0
  27. package/dist/esm/node/runtime/renderPage/getPageAssets/getManifestEntry.d.ts +1 -1
  28. package/dist/esm/node/runtime/renderPage/getPageAssets/getManifestEntry.js +19 -19
  29. package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.d.ts +1 -1
  30. package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +12 -12
  31. package/dist/esm/node/runtime/renderPage/getPageAssets.js +5 -5
  32. package/dist/esm/node/runtime/renderPage/logErrorHint.js +7 -0
  33. package/dist/esm/node/runtime/renderPage.js +3 -0
  34. package/dist/esm/shared/page-configs/PageConfig.d.ts +1 -0
  35. package/dist/esm/shared/page-configs/serialize/serializeConfigValue.js +5 -9
  36. package/dist/esm/utils/projectInfo.d.ts +2 -2
  37. package/dist/esm/utils/projectInfo.js +1 -1
  38. package/package.json +1 -1
@@ -6,8 +6,7 @@ export { serializeConfigValueImported };
6
6
  // Both parsePageConfigs() parseConfigValuesImported() and are loaded on the client-side and server-side
7
7
  import { assertIsNotProductionRuntime } from '../../../utils/assertIsNotProductionRuntime.js';
8
8
  assertIsNotProductionRuntime();
9
- import path from 'path';
10
- import { assert, assertPosixPath } from '../../utils.js';
9
+ import { assert } from '../../utils.js';
11
10
  import { generateEagerImport } from '../../../node/plugin/plugins/importUserCode/generateEagerImport.js';
12
11
  function serializeConfigValue(lines, configName, configValueSerialized) {
13
12
  let whitespace = ' ';
@@ -23,13 +22,10 @@ function serializeConfigValue(lines, configName, configValueSerialized) {
23
22
  function serializeConfigValueImported(configValueSource, configName, whitespace, varCounterContainer, importStatements) {
24
23
  assert(!configValueSource.valueIsFilePath);
25
24
  assert(whitespace.replaceAll(' ', '').length === 0);
26
- const { valueIsImportedAtRuntime, definedAt } = configValueSource;
25
+ const { valueIsImportedAtRuntime, valueIsDefinedByValueFile, definedAt } = configValueSource;
27
26
  assert(valueIsImportedAtRuntime);
28
27
  const { filePathAbsoluteVite, fileExportName } = definedAt;
29
- assertPosixPath(filePathAbsoluteVite);
30
- const fileName = path.posix.basename(filePathAbsoluteVite);
31
- const isValueFile = fileName.startsWith('+');
32
- if (isValueFile)
28
+ if (valueIsDefinedByValueFile)
33
29
  assert(fileExportName === undefined);
34
30
  const { importName, importStatement } = generateEagerImport(filePathAbsoluteVite, varCounterContainer.varCounter++, fileExportName);
35
31
  importStatements.push(importStatement);
@@ -37,8 +33,8 @@ function serializeConfigValueImported(configValueSource, configName, whitespace,
37
33
  lines.push(` {`);
38
34
  lines.push(` configName: '${configName}',`);
39
35
  lines.push(` importPath: '${filePathAbsoluteVite}',`);
40
- lines.push(` isValueFile: ${JSON.stringify(isValueFile)},`);
41
- if (isValueFile) {
36
+ lines.push(` isValueFile: ${JSON.stringify(valueIsDefinedByValueFile)},`);
37
+ if (valueIsDefinedByValueFile) {
42
38
  lines.push(` exportValues: ${importName},`);
43
39
  }
44
40
  else {
@@ -1,7 +1,7 @@
1
1
  export { projectInfo };
2
2
  export { PROJECT_VERSION };
3
- declare const PROJECT_VERSION: "0.4.162";
3
+ declare const PROJECT_VERSION: "0.4.163";
4
4
  declare const projectInfo: {
5
5
  projectName: "Vike";
6
- projectVersion: "0.4.162";
6
+ projectVersion: "0.4.163";
7
7
  };
@@ -1,7 +1,7 @@
1
1
  export { projectInfo };
2
2
  export { PROJECT_VERSION };
3
3
  import { onProjectInfo } from './assertSingleInstance.js';
4
- const PROJECT_VERSION = '0.4.162';
4
+ const PROJECT_VERSION = '0.4.163';
5
5
  const projectInfo = {
6
6
  projectName: 'Vike',
7
7
  projectVersion: PROJECT_VERSION
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.162",
3
+ "version": "0.4.163",
4
4
  "scripts": {
5
5
  "dev": "tsc --watch",
6
6
  "build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",