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.
- 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 +18 -13
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +8 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js +29 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +216 -233
- 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/getPageContextUrlComputed.js +6 -1
- 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 +3 -2
- 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 +19 -14
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +8 -3
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.d.ts +5 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js +30 -4
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.d.ts +23 -101
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +219 -236
- 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/getPageContextUrlComputed.js +6 -1
- 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 +3 -2
- 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
|
@@ -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
|
-
|
|
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/
|
|
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
|
-
*
|
|
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
|
|
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-5c7810f";
|
|
@@ -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-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 './
|
|
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
|
-
// - Surprisingly, this assert() can fail: https://github.com/vikejs/vike/issues/
|
|
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 './
|
|
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
|