vike 0.4.220-commit-a9f46b8 → 0.4.220-commit-5c7810f

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 (110) hide show
  1. package/dist/cjs/node/api/utils.js +1 -1
  2. package/dist/cjs/{utils → node/plugin}/getOutDirs.js +11 -11
  3. package/dist/cjs/node/plugin/index.js +1 -7
  4. package/dist/cjs/node/plugin/onLoad.js +6 -1
  5. package/dist/cjs/node/plugin/plugins/autoFullBuild.js +12 -13
  6. package/dist/cjs/node/plugin/plugins/baseUrls.js +2 -2
  7. package/dist/cjs/node/plugin/plugins/buildConfig.js +6 -3
  8. package/dist/cjs/node/plugin/plugins/buildEntry/index.js +24 -21
  9. package/dist/cjs/node/plugin/plugins/commonConfig.js +4 -3
  10. package/dist/cjs/node/plugin/plugins/extractAssetsPlugin.js +4 -2
  11. package/dist/cjs/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +10 -7
  12. package/dist/cjs/node/plugin/plugins/importUserCode/index.js +3 -4
  13. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/assertExtensions.js +18 -13
  14. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +8 -3
  15. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js +29 -3
  16. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +216 -233
  17. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +3 -1
  18. package/dist/cjs/node/plugin/plugins/previewConfig.js +3 -4
  19. package/dist/cjs/node/plugin/utils.js +1 -1
  20. package/dist/cjs/node/prerender/context.js +6 -4
  21. package/dist/cjs/node/prerender/resolvePrerenderConfig.js +25 -0
  22. package/dist/cjs/node/prerender/runPrerender.js +9 -4
  23. package/dist/cjs/node/prerender/utils.js +2 -2
  24. package/dist/cjs/node/runtime/globalContext.js +42 -36
  25. package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +6 -3
  26. package/dist/cjs/node/runtime/renderPage/resolveRedirects.js +6 -5
  27. package/dist/cjs/node/runtime/renderPage.js +10 -5
  28. package/dist/cjs/node/runtime/utils.js +2 -2
  29. package/dist/cjs/node/shared/resolveBase.js +9 -0
  30. package/dist/cjs/shared/getPageContextUrlComputed.js +6 -1
  31. package/dist/cjs/shared/page-configs/getPageConfigUserFriendly.js +2 -2
  32. package/dist/cjs/shared/utils.js +1 -1
  33. package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
  34. package/dist/cjs/utils/findFile.js +3 -3
  35. package/dist/cjs/utils/isDev.js +3 -2
  36. package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +2 -2
  37. package/dist/cjs/utils/requireResolve.js +3 -3
  38. package/dist/esm/node/api/utils.d.ts +1 -1
  39. package/dist/esm/node/api/utils.js +1 -1
  40. package/dist/esm/{utils → node/plugin}/getOutDirs.js +5 -5
  41. package/dist/esm/node/plugin/index.d.ts +29 -1
  42. package/dist/esm/node/plugin/index.js +2 -8
  43. package/dist/esm/node/plugin/onLoad.js +7 -2
  44. package/dist/esm/node/plugin/plugins/autoFullBuild.js +12 -13
  45. package/dist/esm/node/plugin/plugins/baseUrls.js +2 -2
  46. package/dist/esm/node/plugin/plugins/buildConfig.js +7 -4
  47. package/dist/esm/node/plugin/plugins/buildEntry/index.d.ts +3 -3
  48. package/dist/esm/node/plugin/plugins/buildEntry/index.js +25 -22
  49. package/dist/esm/node/plugin/plugins/commonConfig.d.ts +1 -1
  50. package/dist/esm/node/plugin/plugins/commonConfig.js +4 -3
  51. package/dist/esm/node/plugin/plugins/extractAssetsPlugin.js +4 -2
  52. package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.d.ts +2 -2
  53. package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +10 -7
  54. package/dist/esm/node/plugin/plugins/importUserCode/index.js +3 -4
  55. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/assertExtensions.d.ts +3 -2
  56. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/assertExtensions.js +19 -14
  57. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +8 -3
  58. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.d.ts +5 -2
  59. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js +30 -4
  60. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.d.ts +23 -101
  61. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +219 -236
  62. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +3 -1
  63. package/dist/esm/node/plugin/plugins/previewConfig.js +3 -4
  64. package/dist/esm/node/plugin/utils.js +1 -1
  65. package/dist/esm/node/prerender/context.d.ts +2 -2
  66. package/dist/esm/node/prerender/context.js +6 -4
  67. package/dist/esm/node/prerender/resolvePrerenderConfig.d.ts +5 -0
  68. package/dist/esm/node/prerender/resolvePrerenderConfig.js +23 -0
  69. package/dist/esm/node/prerender/runPrerender.js +9 -4
  70. package/dist/esm/node/prerender/utils.d.ts +2 -2
  71. package/dist/esm/node/prerender/utils.js +2 -2
  72. package/dist/esm/node/runtime/globalContext.d.ts +15 -9
  73. package/dist/esm/node/runtime/globalContext.js +43 -37
  74. package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +5 -5
  75. package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js +6 -3
  76. package/dist/esm/node/runtime/renderPage/resolveRedirects.d.ts +2 -0
  77. package/dist/esm/node/runtime/renderPage/resolveRedirects.js +5 -5
  78. package/dist/esm/node/runtime/renderPage.js +10 -5
  79. package/dist/esm/node/runtime/utils.d.ts +2 -2
  80. package/dist/esm/node/runtime/utils.js +2 -2
  81. package/dist/esm/node/shared/resolveBase.d.ts +4 -1
  82. package/dist/esm/node/shared/resolveBase.js +9 -0
  83. package/dist/esm/shared/getPageContextUrlComputed.js +6 -1
  84. package/dist/esm/shared/page-configs/Config.d.ts +76 -3
  85. package/dist/esm/shared/page-configs/PageConfig.d.ts +25 -19
  86. package/dist/esm/shared/page-configs/getPageConfigUserFriendly.d.ts +1 -1
  87. package/dist/esm/shared/page-configs/getPageConfigUserFriendly.js +2 -2
  88. package/dist/esm/shared/utils.d.ts +1 -1
  89. package/dist/esm/shared/utils.js +1 -1
  90. package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
  91. package/dist/esm/utils/PROJECT_VERSION.js +1 -1
  92. package/dist/esm/utils/findFile.js +1 -1
  93. package/dist/esm/utils/isDev.js +3 -2
  94. package/dist/esm/utils/isFilePathAbsoluteFilesystem.js +1 -1
  95. package/dist/esm/utils/projectInfo.d.ts +1 -1
  96. package/dist/esm/utils/requireResolve.js +1 -1
  97. package/package.json +1 -1
  98. package/dist/cjs/node/plugin/plugins/buildEntry/getVikeManifest.js +0 -17
  99. package/dist/cjs/node/shared/assertPluginManifest.js +0 -20
  100. package/dist/cjs/node/shared/assertRuntimeManifest.js +0 -16
  101. package/dist/esm/node/plugin/plugins/buildEntry/getVikeManifest.d.ts +0 -5
  102. package/dist/esm/node/plugin/plugins/buildEntry/getVikeManifest.js +0 -15
  103. package/dist/esm/node/shared/assertPluginManifest.d.ts +0 -12
  104. package/dist/esm/node/shared/assertPluginManifest.js +0 -18
  105. package/dist/esm/node/shared/assertRuntimeManifest.d.ts +0 -10
  106. package/dist/esm/node/shared/assertRuntimeManifest.js +0 -14
  107. /package/dist/cjs/utils/{filesystemPathHandling.js → toPosixPath.js} +0 -0
  108. /package/dist/esm/{utils → node/plugin}/getOutDirs.d.ts +0 -0
  109. /package/dist/esm/utils/{filesystemPathHandling.d.ts → toPosixPath.d.ts} +0 -0
  110. /package/dist/esm/utils/{filesystemPathHandling.js → toPosixPath.js} +0 -0
@@ -37,24 +37,29 @@ function getUrlParsed(pageContext) {
37
37
  // 6. The value of pageContext.urlPathname is now '/login': the pathname of `pageContext.urlLogical`. (While pageContext.urlOriginal is still '/fr-FR/admin'.)
38
38
  // Reproduction: https://github.com/vikejs/vike/discussions/1436#discussioncomment-8142023
39
39
  // Determine logical URL
40
+ // TODO/soon: revert https://github.com/vikejs/vike/issues/2138#issuecomment-2631713411
41
+ const assertUrlResolved = (src) => assert(urlResolved && typeof urlResolved === 'string', { src, urlResolved });
40
42
  let urlResolved;
41
43
  let baseToBeRemoved;
42
44
  if (pageContext.urlLogical) {
43
45
  // Set by onBeforeRoute()
44
46
  urlResolved = pageContext.urlLogical;
45
47
  baseToBeRemoved = false;
48
+ assertUrlResolved(1);
46
49
  }
47
50
  else if (pageContext._urlRewrite) {
48
51
  // Set by `throw render()`
49
52
  urlResolved = pageContext._urlRewrite;
50
53
  baseToBeRemoved = false;
54
+ assertUrlResolved(2);
51
55
  }
52
56
  else {
53
57
  // Set by renderPage()
54
58
  urlResolved = pageContext.urlOriginal;
55
59
  baseToBeRemoved = true;
60
+ assertUrlResolved(3);
56
61
  }
57
- assert(urlResolved && typeof urlResolved === 'string');
62
+ assertUrlResolved(4);
58
63
  // Remove .pageContext.json
59
64
  let urlHandler = pageContext._urlHandler;
60
65
  if (!urlHandler)
@@ -37,7 +37,7 @@ import type { PrefetchSetting, PrefetchStaticAssets } from '../../client/client-
37
37
  import type { ConfigDefinition } from '../../node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js';
38
38
  import type { DocumentHtml } from '../../node/runtime/html/renderHtml.js';
39
39
  import type { InjectFilterEntry } from '../../types/index.js';
40
- import type { VikeVitePluginOptions } from '../../node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js';
40
+ import type { VikeVitePluginOptions } from '../../node/plugin/index.js';
41
41
  import type { Vike, VikePackages } from '../VikeNamespace.js';
42
42
  import type { HooksTimeoutProvidedByUser } from '../hooks/getHook.js';
43
43
  import type { PageContextClient, PageContextServer } from '../types.js';
@@ -246,11 +246,55 @@ type ConfigBuiltIn = {
246
246
  */
247
247
  guard?: GuardAsync | GuardSync | ImportString;
248
248
  /**
249
- * Whether to pre-render the page(s).
249
+ * Pre-render page(s).
250
250
  *
251
251
  * https://vike.dev/pre-rendering
252
+ * https://vike.dev/prerender
253
+ *
254
+ * @default false
252
255
  */
253
- prerender?: boolean | ImportString;
256
+ prerender?: boolean | ImportString | {
257
+ /**
258
+ * Allow only some of your pages to be pre-rendered.
259
+ *
260
+ * This setting doesn't affect the pre-rendering process: it merely suppresses the warnings when some of your pages cannot be pre-rendered.
261
+ *
262
+ * https://vike.dev/prerender#partial
263
+ *
264
+ * @default false
265
+ */
266
+ partial?: boolean;
267
+ /**
268
+ * Don't create a new directory for each HTML file.
269
+ *
270
+ * For example, generate `dist/client/about.html` instead of `dist/client/about/index.html`.
271
+ *
272
+ * https://vike.dev/prerender#noextradir
273
+ *
274
+ * @default false
275
+ */
276
+ noExtraDir?: boolean;
277
+ /**
278
+ * Number of concurrent pre-render jobs.
279
+ *
280
+ * Set to `false` to disable concurrency.
281
+ *
282
+ * https://vike.dev/prerender#parallel
283
+ *
284
+ * @default os.cpus().length
285
+ */
286
+ parallel?: boolean | number;
287
+ /**
288
+ * Disable the automatic initiation of the pre-rendering process when running `$ vike build`.
289
+ *
290
+ * Use this if you want to programmatically initiate the pre-rendering process instead.
291
+ *
292
+ * https://vike.dev/prerender#disableautorun
293
+ *
294
+ * @default false
295
+ */
296
+ disableAutoRun?: boolean;
297
+ };
254
298
  /**
255
299
  * Install Vike extensions.
256
300
  *
@@ -358,6 +402,34 @@ type ConfigBuiltIn = {
358
402
  * https://vike.dev/redirects
359
403
  */
360
404
  redirects?: Record<string, string>;
405
+ /** Whether URLs should end with a trailing slash.
406
+ *
407
+ * https://vike.dev/url-normalization
408
+ *
409
+ * @default false
410
+ */
411
+ trailingSlash?: boolean;
412
+ /** Disable automatic URL normalization.
413
+ *
414
+ * https://vike.dev/url-normalization
415
+ *
416
+ * @default false
417
+ */
418
+ disableUrlNormalization?: boolean;
419
+ /** @deprecated It's now `true` by default. You can remove this option. */
420
+ includeAssetsImportedByServer?: boolean;
421
+ /** @deprecated See https://vike.dev/disableAutoFullBuild */
422
+ disableAutoFullBuild?: boolean | 'prerender';
423
+ /** The Base URL of your server.
424
+ *
425
+ * https://vike.dev/base-url
426
+ */
427
+ baseServer?: string;
428
+ /** The Base URL of your static assets.
429
+ *
430
+ * https://vike.dev/base-url
431
+ */
432
+ baseAssets?: string;
361
433
  /**
362
434
  * @experimental DON'T USE: the API *will* have breaking changes upon any minor version release.
363
435
  *
@@ -407,6 +479,7 @@ type ConfigBuiltIn = {
407
479
  type ConfigBuiltInResolved = {
408
480
  passToClient?: string[][];
409
481
  redirects?: Record<string, string>[];
482
+ prerender?: Exclude<Config['prerender'], ImportString | undefined>[];
410
483
  };
411
484
  type ConfigMeta = Record<string, ConfigDefinition>;
412
485
  type ImportString = `import:${string}`;
@@ -20,7 +20,8 @@ import type { ConfigValueSerialized } from './serialize/PageConfigSerialized.js'
20
20
  import type { LocationId } from '../../node/plugin/plugins/importUserCode/v1-design/getVikeConfig/filesystemRouting.js';
21
21
  import type { FilePath } from './FilePath.js';
22
22
  import type { ConfigDefinitions } from '../../node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js';
23
- type PageConfigBase = {
23
+ import type { InterfaceFile, InterfaceFilesByLocationId } from '../../node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js';
24
+ type PageConfigCommon = {
24
25
  pageId: string;
25
26
  isErrorPage?: true;
26
27
  routeFilesystem?: {
@@ -28,37 +29,41 @@ type PageConfigBase = {
28
29
  definedBy: string;
29
30
  };
30
31
  };
31
- /** Page config data structure available at runtime */
32
- type PageConfigRuntime = PageConfigBase & {
32
+ /** Page config, runtime data structure */
33
+ type PageConfigRuntime = PageConfigCommon & {
33
34
  configValues: ConfigValues;
34
35
  /** Load config values that are lazily loaded such as config.Page */
35
- loadConfigValuesAll: () => {
36
- moduleId: string;
37
- moduleExports: Promise<{
38
- configValuesSerialized: Record<string, ConfigValueSerialized>;
39
- }>;
40
- };
36
+ loadConfigValuesAll: LoadConfigValuesAll;
41
37
  };
42
- /** Same as PageConfigRuntime but also contains all lazily loaded config values such as config.Page */
43
- type PageConfigRuntimeLoaded = PageConfigRuntime & {
44
- /** Whether loadConfigValuesAll() was called */
45
- isAllLoaded: true;
38
+ /** Global config that applies to all pages, runtime data structure */
39
+ type PageConfigGlobalRuntime = {
40
+ configValues: ConfigValues;
46
41
  };
47
- /** Page config data structure available at build-time */
48
- type PageConfigBuildTime = PageConfigBase & {
42
+ /** Page config, build-time data structure */
43
+ type PageConfigBuildTime = PageConfigCommon & {
49
44
  configDefinitions: ConfigDefinitions;
45
+ interfaceFiles: InterfaceFilesByLocationId;
50
46
  configValueSources: ConfigValueSources;
51
47
  configValuesComputed: ConfigValuesComputed;
52
48
  };
53
- /** Page config that applies to all pages */
54
- type PageConfigGlobalRuntime = {
55
- configValues: ConfigValues;
56
- };
49
+ /** Global config that applies to all pages, build-time data structure */
57
50
  type PageConfigGlobalBuildTime = {
58
51
  configValueSources: ConfigValueSources;
52
+ interfaceFiles: InterfaceFilesByLocationId;
59
53
  configDefinitions: ConfigDefinitions;
60
54
  configValuesComputed?: undefined;
61
55
  };
56
+ /** Same as PageConfigRuntime but also contains all lazily loaded config values such as config.Page */
57
+ type PageConfigRuntimeLoaded = PageConfigRuntime & {
58
+ /** Whether loadConfigValuesAll() was called */
59
+ isAllLoaded: true;
60
+ };
61
+ type LoadConfigValuesAll = () => {
62
+ moduleId: string;
63
+ moduleExports: Promise<{
64
+ configValuesSerialized: Record<string, ConfigValueSerialized>;
65
+ }>;
66
+ };
62
67
  /** In what environment(s) the config value is loaded.
63
68
  *
64
69
  * https://vike.dev/meta
@@ -80,6 +85,7 @@ type ConfigValueSource = {
80
85
  value?: unknown;
81
86
  configEnv: ConfigEnvInternal;
82
87
  definedAtFilePath: DefinedAtFilePath;
88
+ interfaceFile: InterfaceFile | null;
83
89
  locationId: LocationId;
84
90
  isOverriden: boolean;
85
91
  /** Wether the config value is loaded at runtime, for example config.Page or config.onBeforeRender */
@@ -33,7 +33,7 @@ type ConfigEntries = Record<string, {
33
33
  configDefinedByFile: string | null;
34
34
  }[]>;
35
35
  type PageConfigUserFriendly = {
36
- config: Record<string, unknown>;
36
+ config: ConfigResolved;
37
37
  source: Source;
38
38
  sources: Sources;
39
39
  from: From;
@@ -63,11 +63,11 @@ function getPageConfigUserFriendly(pageFiles, pageConfig) {
63
63
  assert(!('default' in exports));
64
64
  assert(!('default' in exportsAll));
65
65
  const pageContextExports = {
66
+ config: config,
66
67
  from,
67
68
  source,
68
69
  sources,
69
70
  // TODO/eventually: deprecate/remove every prop below
70
- config,
71
71
  configEntries,
72
72
  exports,
73
73
  exportsAll,
@@ -151,7 +151,7 @@ function getPageConfigUserFriendlyNew(pageConfig) {
151
151
  });
152
152
  });
153
153
  return {
154
- config,
154
+ config: config,
155
155
  configEntries,
156
156
  exportsAll,
157
157
  source,
@@ -12,7 +12,7 @@ export * from '../utils/isPlainObject.js';
12
12
  export * from '../utils/compareString.js';
13
13
  export * from '../utils/isNotNullish.js';
14
14
  export * from '../utils/stringifyStringArray.js';
15
- export * from '../utils/filesystemPathHandling.js';
15
+ export * from '../utils/toPosixPath.js';
16
16
  export * from '../utils/cast.js';
17
17
  export * from '../utils/isPropertyGetter.js';
18
18
  export * from '../utils/isPromise.js';
@@ -16,7 +16,7 @@ export * from '../utils/isPlainObject.js';
16
16
  export * from '../utils/compareString.js';
17
17
  export * from '../utils/isNotNullish.js';
18
18
  export * from '../utils/stringifyStringArray.js';
19
- export * from '../utils/filesystemPathHandling.js';
19
+ export * from '../utils/toPosixPath.js';
20
20
  export * from '../utils/cast.js';
21
21
  export * from '../utils/isPropertyGetter.js';
22
22
  export * from '../utils/isPromise.js';
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.220-commit-a9f46b8";
1
+ export declare const PROJECT_VERSION: "0.4.220-commit-5c7810f";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.220-commit-a9f46b8';
2
+ export const PROJECT_VERSION = '0.4.220-commit-5c7810f';
@@ -2,7 +2,7 @@ export { findFile };
2
2
  import path from 'path';
3
3
  import fs from 'fs';
4
4
  import { isArray } from './isArray.js';
5
- import { assertPosixPath } from './filesystemPathHandling.js';
5
+ import { assertPosixPath } from './toPosixPath.js';
6
6
  function findFile(arg, cwd) {
7
7
  assertPosixPath(cwd);
8
8
  const filenames = isArray(arg) ? arg : [arg];
@@ -2,12 +2,13 @@ export { isDevCheck };
2
2
  export { applyDev };
3
3
  export { applyPreview };
4
4
  import { assert } from './assert.js';
5
+ import { version } from 'vite';
5
6
  function isDevCheck(configEnv) {
6
7
  const { isPreview, command } = configEnv;
7
8
  // Released at vite@5.1.0 which is guaranteed with `assertVersion('Vite', version, '5.1.0')`
8
9
  // - Release: https://github.com/vitejs/vite/blob/6f7466e6211027686f40ad7e4ce6ec8477414546/packages/vite/CHANGELOG.md#510-beta4-2024-01-26:~:text=fix(preview)%3A-,set%20isPreview%20true,-(%2315695)%20(93fce55
9
- // - Surprisingly, this assert() can fail: https://github.com/vikejs/vike/issues/2120
10
- assert(typeof isPreview === 'boolean');
10
+ // - Surprisingly, this assert() can fail: https://github.com/vikejs/vike/issues/2135
11
+ assert(typeof isPreview === 'boolean', { isPreview, version });
11
12
  return command === 'serve' && !isPreview;
12
13
  }
13
14
  function applyDev(_, env) {
@@ -2,7 +2,7 @@ export { assertFilePathAbsoluteFilesystem };
2
2
  export { isFilePathAbsolute };
3
3
  import path from 'path';
4
4
  import { assert } from './assert.js';
5
- import { assertPosixPath } from './filesystemPathHandling.js';
5
+ import { assertPosixPath } from './toPosixPath.js';
6
6
  /**
7
7
  * Asserts that `filePath` is an absolute file path starting from the filesystem root.
8
8
  *
@@ -1,4 +1,4 @@
1
1
  export declare const projectInfo: {
2
2
  projectName: "Vike";
3
- projectVersion: "0.4.220-commit-a9f46b8";
3
+ projectVersion: "0.4.220-commit-5c7810f";
4
4
  };
@@ -2,7 +2,7 @@ export { requireResolve };
2
2
  import { assert } from './assert.js';
3
3
  import { assertIsNotBrowser } from './assertIsNotBrowser.js';
4
4
  import { assertIsNotProductionRuntime } from './assertSetup.js';
5
- import { assertPosixPath, toPosixPath } from './filesystemPathHandling.js';
5
+ import { assertPosixPath, toPosixPath } from './toPosixPath.js';
6
6
  import { scriptFileExtensionList } from './isScriptFile.js';
7
7
  import { createRequire } from 'module';
8
8
  // @ts-ignore Shimmed by dist-cjs-fixup.js for CJS build.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.220-commit-a9f46b8",
3
+ "version": "0.4.220-commit-5c7810f",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getVikeManifest = getVikeManifest;
4
- const utils_js_1 = require("../../utils.js");
5
- const assertPluginManifest_js_1 = require("../../../shared/assertPluginManifest.js");
6
- const extractExportNamesPlugin_js_1 = require("../extractExportNamesPlugin.js");
7
- const globalContext_js_1 = require("../../../runtime/globalContext.js");
8
- function getVikeManifest(vikeConfigGlobal, viteConfig) {
9
- const runtimeManifest = (0, globalContext_js_1.getRuntimeManifest)(vikeConfigGlobal, viteConfig);
10
- const manifest = {
11
- version: utils_js_1.projectInfo.projectVersion,
12
- usesClientRouter: (0, extractExportNamesPlugin_js_1.isUsingClientRouter)(), // TODO/v1-release: remove
13
- ...runtimeManifest
14
- };
15
- (0, assertPluginManifest_js_1.assertPluginManifest)(manifest);
16
- return manifest;
17
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assertPluginManifest = assertPluginManifest;
4
- const assertRuntimeManifest_js_1 = require("./assertRuntimeManifest.js");
5
- const utils_js_1 = require("./utils.js");
6
- function assertPluginManifest(pluginManifest) {
7
- (0, utils_js_1.assert)((0, utils_js_1.isPlainObject)(pluginManifest));
8
- (0, utils_js_1.assertUsage)(pluginManifest.version === utils_js_1.projectInfo.projectVersion, `Re-build your app (you're using vike@${utils_js_1.projectInfo.projectVersion} but your app was built with vike@${pluginManifest.version})`);
9
- (0, assertRuntimeManifest_js_1.assertRuntimeManifest)(pluginManifest);
10
- (0, utils_js_1.assert)((0, utils_js_1.hasProp)(pluginManifest, 'usesClientRouter', 'boolean'));
11
- (0, utils_js_1.assert)((0, utils_js_1.hasProp)(pluginManifest, 'version', 'string'));
12
- // Avoid:
13
- // ```
14
- // Uncaught (in promise) TypeError: Cannot set property manifestKeyMap of #<Object> which has only a getter
15
- // ```
16
- // We removed manifestKeyMap, maybe this isn't needed anymore.
17
- // See https://github.com/vikejs/vike/issues/596
18
- const pluginManifestClone = { ...pluginManifest };
19
- (0, utils_js_1.checkType)(pluginManifestClone);
20
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assertRuntimeManifest = assertRuntimeManifest;
4
- const utils_js_1 = require("./utils.js");
5
- function assertRuntimeManifest(obj) {
6
- (0, utils_js_1.assert)(obj);
7
- (0, utils_js_1.assert)((0, utils_js_1.isObject)(obj));
8
- (0, utils_js_1.assert)((0, utils_js_1.hasProp)(obj, 'baseServer', 'string'));
9
- (0, utils_js_1.assert)((0, utils_js_1.hasProp)(obj, 'baseAssets', 'string'));
10
- (0, utils_js_1.assert)((0, utils_js_1.isBaseServer)(obj.baseServer));
11
- (0, utils_js_1.assert)((0, utils_js_1.isBaseAssets)(obj.baseAssets));
12
- (0, utils_js_1.assert)((0, utils_js_1.hasProp)(obj, 'includeAssetsImportedByServer', 'boolean'));
13
- (0, utils_js_1.assert)((0, utils_js_1.hasProp)(obj, 'trailingSlash', 'boolean'));
14
- (0, utils_js_1.assert)((0, utils_js_1.hasProp)(obj, 'disableUrlNormalization', 'boolean'));
15
- (0, utils_js_1.checkType)(obj);
16
- }
@@ -1,5 +0,0 @@
1
- export { getVikeManifest };
2
- import { type PluginManifest } from '../../../shared/assertPluginManifest.js';
3
- import type { VikeConfigGlobal } from '../importUserCode/v1-design/getVikeConfig.js';
4
- import type { ResolvedConfig } from 'vite';
5
- declare function getVikeManifest(vikeConfigGlobal: VikeConfigGlobal, viteConfig: ResolvedConfig): PluginManifest;
@@ -1,15 +0,0 @@
1
- export { getVikeManifest };
2
- import { projectInfo } from '../../utils.js';
3
- import { assertPluginManifest } from '../../../shared/assertPluginManifest.js';
4
- import { isUsingClientRouter } from '../extractExportNamesPlugin.js';
5
- import { getRuntimeManifest } from '../../../runtime/globalContext.js';
6
- function getVikeManifest(vikeConfigGlobal, viteConfig) {
7
- const runtimeManifest = getRuntimeManifest(vikeConfigGlobal, viteConfig);
8
- const manifest = {
9
- version: projectInfo.projectVersion,
10
- usesClientRouter: isUsingClientRouter(), // TODO/v1-release: remove
11
- ...runtimeManifest
12
- };
13
- assertPluginManifest(manifest);
14
- return manifest;
15
- }
@@ -1,12 +0,0 @@
1
- export { assertPluginManifest };
2
- export type { PluginManifest };
3
- type PluginManifest = {
4
- version: string;
5
- baseServer: string;
6
- baseAssets: string | null;
7
- usesClientRouter: boolean;
8
- includeAssetsImportedByServer: boolean;
9
- trailingSlash: boolean;
10
- disableUrlNormalization: boolean;
11
- };
12
- declare function assertPluginManifest(pluginManifest: unknown): asserts pluginManifest is PluginManifest;
@@ -1,18 +0,0 @@
1
- export { assertPluginManifest };
2
- import { assertRuntimeManifest } from './assertRuntimeManifest.js';
3
- import { assert, assertUsage, isPlainObject, projectInfo, checkType, hasProp } from './utils.js';
4
- function assertPluginManifest(pluginManifest) {
5
- assert(isPlainObject(pluginManifest));
6
- assertUsage(pluginManifest.version === projectInfo.projectVersion, `Re-build your app (you're using vike@${projectInfo.projectVersion} but your app was built with vike@${pluginManifest.version})`);
7
- assertRuntimeManifest(pluginManifest);
8
- assert(hasProp(pluginManifest, 'usesClientRouter', 'boolean'));
9
- assert(hasProp(pluginManifest, 'version', 'string'));
10
- // Avoid:
11
- // ```
12
- // Uncaught (in promise) TypeError: Cannot set property manifestKeyMap of #<Object> which has only a getter
13
- // ```
14
- // We removed manifestKeyMap, maybe this isn't needed anymore.
15
- // See https://github.com/vikejs/vike/issues/596
16
- const pluginManifestClone = { ...pluginManifest };
17
- checkType(pluginManifestClone);
18
- }
@@ -1,10 +0,0 @@
1
- export { assertRuntimeManifest };
2
- export type { RuntimeManifest };
3
- type RuntimeManifest = {
4
- baseServer: string;
5
- baseAssets: string;
6
- includeAssetsImportedByServer: boolean;
7
- trailingSlash: boolean;
8
- disableUrlNormalization: boolean;
9
- };
10
- declare function assertRuntimeManifest(obj: unknown): asserts obj is RuntimeManifest & Record<string, unknown>;
@@ -1,14 +0,0 @@
1
- export { assertRuntimeManifest };
2
- import { assert, checkType, hasProp, isBaseAssets, isBaseServer, isObject } from './utils.js';
3
- function assertRuntimeManifest(obj) {
4
- assert(obj);
5
- assert(isObject(obj));
6
- assert(hasProp(obj, 'baseServer', 'string'));
7
- assert(hasProp(obj, 'baseAssets', 'string'));
8
- assert(isBaseServer(obj.baseServer));
9
- assert(isBaseAssets(obj.baseAssets));
10
- assert(hasProp(obj, 'includeAssetsImportedByServer', 'boolean'));
11
- assert(hasProp(obj, 'trailingSlash', 'boolean'));
12
- assert(hasProp(obj, 'disableUrlNormalization', 'boolean'));
13
- checkType(obj);
14
- }
File without changes