vike 0.4.220-commit-a9f46b8 → 0.4.220-commit-9a798ce
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/node/api/utils.js +1 -1
- package/dist/cjs/{utils → node/plugin}/getOutDirs.js +11 -11
- package/dist/cjs/node/plugin/index.js +1 -7
- package/dist/cjs/node/plugin/onLoad.js +6 -1
- package/dist/cjs/node/plugin/plugins/autoFullBuild.js +12 -13
- package/dist/cjs/node/plugin/plugins/baseUrls.js +2 -2
- package/dist/cjs/node/plugin/plugins/buildConfig.js +6 -3
- package/dist/cjs/node/plugin/plugins/buildEntry/index.js +24 -21
- package/dist/cjs/node/plugin/plugins/commonConfig.js +4 -3
- package/dist/cjs/node/plugin/plugins/extractAssetsPlugin.js +4 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +10 -7
- package/dist/cjs/node/plugin/plugins/importUserCode/index.js +3 -4
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/assertExtensions.js +10 -9
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +8 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +158 -176
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +3 -1
- package/dist/cjs/node/plugin/plugins/previewConfig.js +3 -4
- package/dist/cjs/node/plugin/utils.js +1 -1
- package/dist/cjs/node/prerender/context.js +6 -4
- package/dist/cjs/node/prerender/resolvePrerenderConfig.js +25 -0
- package/dist/cjs/node/prerender/runPrerender.js +9 -4
- package/dist/cjs/node/prerender/utils.js +2 -2
- package/dist/cjs/node/runtime/globalContext.js +42 -36
- package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +6 -3
- package/dist/cjs/node/runtime/renderPage/resolveRedirects.js +6 -5
- package/dist/cjs/node/runtime/renderPage.js +10 -5
- package/dist/cjs/node/runtime/utils.js +2 -2
- package/dist/cjs/node/shared/resolveBase.js +9 -0
- package/dist/cjs/shared/page-configs/getPageConfigUserFriendly.js +2 -2
- package/dist/cjs/shared/utils.js +1 -1
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/findFile.js +3 -3
- package/dist/cjs/utils/isDev.js +2 -1
- package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +2 -2
- package/dist/cjs/utils/requireResolve.js +3 -3
- package/dist/esm/node/api/utils.d.ts +1 -1
- package/dist/esm/node/api/utils.js +1 -1
- package/dist/esm/{utils → node/plugin}/getOutDirs.js +5 -5
- package/dist/esm/node/plugin/index.d.ts +29 -1
- package/dist/esm/node/plugin/index.js +2 -8
- package/dist/esm/node/plugin/onLoad.js +7 -2
- package/dist/esm/node/plugin/plugins/autoFullBuild.js +12 -13
- package/dist/esm/node/plugin/plugins/baseUrls.js +2 -2
- package/dist/esm/node/plugin/plugins/buildConfig.js +7 -4
- package/dist/esm/node/plugin/plugins/buildEntry/index.d.ts +3 -3
- package/dist/esm/node/plugin/plugins/buildEntry/index.js +25 -22
- package/dist/esm/node/plugin/plugins/commonConfig.d.ts +1 -1
- package/dist/esm/node/plugin/plugins/commonConfig.js +4 -3
- package/dist/esm/node/plugin/plugins/extractAssetsPlugin.js +4 -2
- package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.d.ts +2 -2
- package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +10 -7
- package/dist/esm/node/plugin/plugins/importUserCode/index.js +3 -4
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/assertExtensions.d.ts +3 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/assertExtensions.js +10 -9
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +8 -3
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.d.ts +2 -95
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +159 -177
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +3 -1
- package/dist/esm/node/plugin/plugins/previewConfig.js +3 -4
- package/dist/esm/node/plugin/utils.js +1 -1
- package/dist/esm/node/prerender/context.d.ts +2 -2
- package/dist/esm/node/prerender/context.js +6 -4
- package/dist/esm/node/prerender/resolvePrerenderConfig.d.ts +5 -0
- package/dist/esm/node/prerender/resolvePrerenderConfig.js +23 -0
- package/dist/esm/node/prerender/runPrerender.js +9 -4
- package/dist/esm/node/prerender/utils.d.ts +2 -2
- package/dist/esm/node/prerender/utils.js +2 -2
- package/dist/esm/node/runtime/globalContext.d.ts +15 -9
- package/dist/esm/node/runtime/globalContext.js +43 -37
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +5 -5
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js +6 -3
- package/dist/esm/node/runtime/renderPage/resolveRedirects.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/resolveRedirects.js +5 -5
- package/dist/esm/node/runtime/renderPage.js +10 -5
- package/dist/esm/node/runtime/utils.d.ts +2 -2
- package/dist/esm/node/runtime/utils.js +2 -2
- package/dist/esm/node/shared/resolveBase.d.ts +4 -1
- package/dist/esm/node/shared/resolveBase.js +9 -0
- package/dist/esm/shared/page-configs/Config.d.ts +76 -3
- package/dist/esm/shared/page-configs/PageConfig.d.ts +25 -19
- package/dist/esm/shared/page-configs/getPageConfigUserFriendly.d.ts +1 -1
- package/dist/esm/shared/page-configs/getPageConfigUserFriendly.js +2 -2
- package/dist/esm/shared/utils.d.ts +1 -1
- package/dist/esm/shared/utils.js +1 -1
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/findFile.js +1 -1
- package/dist/esm/utils/isDev.js +2 -1
- package/dist/esm/utils/isFilePathAbsoluteFilesystem.js +1 -1
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/dist/esm/utils/requireResolve.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/node/plugin/plugins/buildEntry/getVikeManifest.js +0 -17
- package/dist/cjs/node/shared/assertPluginManifest.js +0 -20
- package/dist/cjs/node/shared/assertRuntimeManifest.js +0 -16
- package/dist/esm/node/plugin/plugins/buildEntry/getVikeManifest.d.ts +0 -5
- package/dist/esm/node/plugin/plugins/buildEntry/getVikeManifest.js +0 -15
- package/dist/esm/node/shared/assertPluginManifest.d.ts +0 -12
- package/dist/esm/node/shared/assertPluginManifest.js +0 -18
- package/dist/esm/node/shared/assertRuntimeManifest.d.ts +0 -10
- package/dist/esm/node/shared/assertRuntimeManifest.js +0 -14
- /package/dist/cjs/utils/{filesystemPathHandling.js → toPosixPath.js} +0 -0
- /package/dist/esm/{utils → node/plugin}/getOutDirs.d.ts +0 -0
- /package/dist/esm/utils/{filesystemPathHandling.d.ts → toPosixPath.d.ts} +0 -0
- /package/dist/esm/utils/{filesystemPathHandling.js → toPosixPath.js} +0 -0
|
@@ -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
|
|
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
|
|
32
|
-
type PageConfigRuntime =
|
|
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
|
-
/**
|
|
43
|
-
type
|
|
44
|
-
|
|
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
|
|
48
|
-
type PageConfigBuildTime =
|
|
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
|
-
/**
|
|
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 */
|
|
@@ -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/
|
|
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';
|
package/dist/esm/shared/utils.js
CHANGED
|
@@ -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/
|
|
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-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.220-commit-9a798ce";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.220-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.220-commit-9a798ce';
|
|
@@ -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 './
|
|
5
|
+
import { assertPosixPath } from './toPosixPath.js';
|
|
6
6
|
function findFile(arg, cwd) {
|
|
7
7
|
assertPosixPath(cwd);
|
|
8
8
|
const filenames = isArray(arg) ? arg : [arg];
|
package/dist/esm/utils/isDev.js
CHANGED
|
@@ -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
10
|
// - Surprisingly, this assert() can fail: https://github.com/vikejs/vike/issues/2120
|
|
10
|
-
assert(typeof isPreview === 'boolean');
|
|
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 './
|
|
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
|
*
|
|
@@ -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 './
|
|
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,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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|