vike 0.4.212 → 0.4.214
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/RenderErrorPage.js +3 -3
- package/__internal/loadImportBuild.js +3 -0
- package/__internal/setup.js +3 -3
- package/__internal.js +3 -3
- package/abort.js +3 -3
- package/api.js +3 -0
- package/cli.js +3 -3
- package/client/router.js +3 -3
- package/client.js +3 -3
- package/dist/cjs/client/server-routing-runtime/utils.js +2 -2
- package/dist/cjs/node/api/APIOptions.js +2 -0
- package/dist/cjs/node/api/build.js +50 -0
- package/dist/cjs/node/api/dev.js +10 -0
- package/dist/cjs/node/api/enhanceViteConfig.js +52 -0
- package/dist/cjs/node/api/index.js +36 -0
- package/dist/cjs/node/api/prerender.js +10 -0
- package/dist/cjs/node/api/preview.js +10 -0
- package/dist/cjs/node/cli/entry.js +100 -0
- package/dist/cjs/node/cli/index.js +8 -7
- package/dist/cjs/node/cli/parseCli.js +61 -0
- package/dist/cjs/node/cli/utils.js +3 -1
- package/dist/cjs/node/plugin/index.js +3 -1
- package/dist/cjs/node/plugin/plugins/autoFullBuild.js +5 -5
- package/dist/cjs/node/plugin/plugins/buildConfig.js +13 -10
- package/dist/cjs/node/plugin/plugins/commonConfig/pluginName.js +4 -0
- package/dist/cjs/node/plugin/plugins/commonConfig.js +13 -5
- package/dist/cjs/node/plugin/plugins/previewConfig.js +1 -1
- package/dist/cjs/node/plugin/plugins/vite6HmrRegressionWorkaround.js +35 -0
- package/dist/cjs/node/plugin/shared/getEnvVarObject.js +29 -0
- package/dist/cjs/node/plugin/utils.js +2 -2
- package/dist/cjs/node/prerender/index.js +9 -2
- package/dist/cjs/node/prerender/runPrerender.js +15 -9
- package/dist/cjs/node/runtime/globalContext.js +1 -1
- package/dist/cjs/node/runtime/utils.js +2 -1
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assertNodeEnv.js +1 -1
- package/dist/esm/client/client-routing-runtime/utils.js +2 -2
- package/dist/esm/client/server-routing-runtime/utils.js +2 -2
- package/dist/esm/node/api/APIOptions.d.ts +10 -0
- package/dist/esm/node/api/build.d.ts +6 -0
- package/dist/esm/node/api/build.js +25 -0
- package/dist/esm/node/api/dev.d.ts +3 -0
- package/dist/esm/node/api/dev.js +8 -0
- package/dist/esm/node/api/enhanceViteConfig.d.ts +6 -0
- package/dist/esm/node/api/enhanceViteConfig.js +27 -0
- package/dist/esm/node/api/index.d.ts +12 -0
- package/dist/esm/node/api/index.js +10 -0
- package/dist/esm/node/api/prerender.d.ts +3 -0
- package/dist/esm/node/api/prerender.js +8 -0
- package/dist/esm/node/api/preview.d.ts +3 -0
- package/dist/esm/node/api/preview.js +8 -0
- package/dist/esm/node/cli/entry.d.ts +1 -0
- package/dist/esm/node/cli/entry.js +72 -0
- package/dist/esm/node/cli/index.d.ts +1 -2
- package/dist/esm/node/cli/index.js +4 -6
- package/dist/esm/node/cli/parseCli.d.ts +4 -0
- package/dist/esm/node/cli/parseCli.js +56 -0
- package/dist/esm/node/cli/utils.d.ts +1 -0
- package/dist/esm/node/cli/utils.js +3 -1
- package/dist/esm/node/plugin/index.js +3 -1
- package/dist/esm/node/plugin/plugins/autoFullBuild.js +6 -6
- package/dist/esm/node/plugin/plugins/buildConfig.js +13 -10
- package/dist/esm/node/plugin/plugins/commonConfig/pluginName.d.ts +1 -0
- package/dist/esm/node/plugin/plugins/commonConfig/pluginName.js +1 -0
- package/dist/esm/node/plugin/plugins/commonConfig.d.ts +1 -1
- package/dist/esm/node/plugin/plugins/commonConfig.js +11 -3
- package/dist/esm/node/plugin/plugins/extractAssetsPlugin.js +1 -1
- package/dist/esm/node/plugin/plugins/previewConfig.js +1 -1
- package/dist/esm/node/plugin/plugins/vite6HmrRegressionWorkaround.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/vite6HmrRegressionWorkaround.js +33 -0
- package/dist/esm/node/plugin/shared/getEnvVarObject.d.ts +2 -0
- package/dist/esm/node/plugin/shared/getEnvVarObject.js +24 -0
- package/dist/esm/node/plugin/utils.js +2 -2
- package/dist/esm/node/prerender/index.d.ts +1 -1
- package/dist/esm/node/prerender/index.js +5 -1
- package/dist/esm/node/prerender/runPrerender.d.ts +7 -28
- package/dist/esm/node/prerender/runPrerender.js +15 -9
- package/dist/esm/node/runtime/globalContext.js +1 -1
- package/dist/esm/node/runtime/utils.js +2 -1
- package/dist/esm/shared/ConfigVike.d.ts +3 -9
- package/dist/esm/shared/page-configs/Config.d.ts +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/assertNodeEnv.js +1 -1
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/dist-cjs-fixup.mjs +41 -0
- package/getPageContext.js +3 -0
- package/modifyUrl.js +3 -0
- package/node/cli/bin.js +3 -0
- package/package.json +43 -19
- package/plugin.js +3 -3
- package/prerender.js +3 -3
- package/routing.js +3 -3
- package/server.js +3 -3
- package/types.js +3 -0
- package/dist/cjs/node/cli/bin.js +0 -49
- package/dist/esm/node/cli/bin.js +0 -44
- package/node/cli/bin-entry.js +0 -3
- /package/dist/esm/node/{cli/bin.d.ts → api/APIOptions.js} +0 -0
package/dist/cjs/node/cli/bin.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const cac_1 = require("cac");
|
|
7
|
-
const path_1 = require("path");
|
|
8
|
-
const runPrerender_js_1 = require("../prerender/runPrerender.js");
|
|
9
|
-
const utils_js_1 = require("./utils.js");
|
|
10
|
-
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
11
|
-
const cli = (0, cac_1.cac)(utils_js_1.projectInfo.projectName);
|
|
12
|
-
cli
|
|
13
|
-
.command('prerender', 'Pre-render the HTML of your pages', { allowUnknownOptions: true })
|
|
14
|
-
.option('--configFile <path>', '[string] Path to vite.config.js')
|
|
15
|
-
.action(async (options) => {
|
|
16
|
-
assertOptions();
|
|
17
|
-
const { partial, noExtraDir, base, parallel, outDir, configFile } = options;
|
|
18
|
-
const root = options.root && (0, path_1.resolve)(options.root);
|
|
19
|
-
await (0, runPrerender_js_1.runPrerenderFromCLI)({ partial, noExtraDir, base, root, parallel, outDir, configFile });
|
|
20
|
-
(0, runPrerender_js_1.runPrerender_forceExit)();
|
|
21
|
-
});
|
|
22
|
-
function assertOptions() {
|
|
23
|
-
// Using process.argv because cac convert names to camelCase
|
|
24
|
-
const rawOptions = process.argv.slice(3);
|
|
25
|
-
Object.values(rawOptions).forEach((option) => {
|
|
26
|
-
(0, utils_js_1.assertUsage)(!option.startsWith('--') ||
|
|
27
|
-
[
|
|
28
|
-
'--root',
|
|
29
|
-
'--partial',
|
|
30
|
-
'--noExtraDir',
|
|
31
|
-
'--clientRouter',
|
|
32
|
-
'--base',
|
|
33
|
-
'--parallel',
|
|
34
|
-
'--outDir',
|
|
35
|
-
'--configFile'
|
|
36
|
-
].includes(option), 'Unknown option: ' + option);
|
|
37
|
-
(0, utils_js_1.assertWarning)(false, `You set ${picocolors_1.default.cyan(option)}, but passing options to ${picocolors_1.default.cyan('$ vike prerender')} is deprecated: use the config file instead. See https://vike.dev/command-prerender.`, { onlyOnce: true });
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
// Listen to unknown commands
|
|
41
|
-
cli.on('command:*', () => {
|
|
42
|
-
(0, utils_js_1.assertUsage)(false, 'Unknown command: ' + cli.args.join(' '));
|
|
43
|
-
});
|
|
44
|
-
cli.help();
|
|
45
|
-
cli.version(utils_js_1.projectInfo.projectVersion);
|
|
46
|
-
cli.parse(process.argv.length === 2 ? [...process.argv, '--help'] : process.argv);
|
|
47
|
-
process.on('unhandledRejection', (rejectValue) => {
|
|
48
|
-
throw rejectValue;
|
|
49
|
-
});
|
package/dist/esm/node/cli/bin.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { cac } from 'cac';
|
|
2
|
-
import { resolve } from 'path';
|
|
3
|
-
import { runPrerenderFromCLI, runPrerender_forceExit } from '../prerender/runPrerender.js';
|
|
4
|
-
import { projectInfo, assertUsage, assertWarning } from './utils.js';
|
|
5
|
-
import pc from '@brillout/picocolors';
|
|
6
|
-
const cli = cac(projectInfo.projectName);
|
|
7
|
-
cli
|
|
8
|
-
.command('prerender', 'Pre-render the HTML of your pages', { allowUnknownOptions: true })
|
|
9
|
-
.option('--configFile <path>', '[string] Path to vite.config.js')
|
|
10
|
-
.action(async (options) => {
|
|
11
|
-
assertOptions();
|
|
12
|
-
const { partial, noExtraDir, base, parallel, outDir, configFile } = options;
|
|
13
|
-
const root = options.root && resolve(options.root);
|
|
14
|
-
await runPrerenderFromCLI({ partial, noExtraDir, base, root, parallel, outDir, configFile });
|
|
15
|
-
runPrerender_forceExit();
|
|
16
|
-
});
|
|
17
|
-
function assertOptions() {
|
|
18
|
-
// Using process.argv because cac convert names to camelCase
|
|
19
|
-
const rawOptions = process.argv.slice(3);
|
|
20
|
-
Object.values(rawOptions).forEach((option) => {
|
|
21
|
-
assertUsage(!option.startsWith('--') ||
|
|
22
|
-
[
|
|
23
|
-
'--root',
|
|
24
|
-
'--partial',
|
|
25
|
-
'--noExtraDir',
|
|
26
|
-
'--clientRouter',
|
|
27
|
-
'--base',
|
|
28
|
-
'--parallel',
|
|
29
|
-
'--outDir',
|
|
30
|
-
'--configFile'
|
|
31
|
-
].includes(option), 'Unknown option: ' + option);
|
|
32
|
-
assertWarning(false, `You set ${pc.cyan(option)}, but passing options to ${pc.cyan('$ vike prerender')} is deprecated: use the config file instead. See https://vike.dev/command-prerender.`, { onlyOnce: true });
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
// Listen to unknown commands
|
|
36
|
-
cli.on('command:*', () => {
|
|
37
|
-
assertUsage(false, 'Unknown command: ' + cli.args.join(' '));
|
|
38
|
-
});
|
|
39
|
-
cli.help();
|
|
40
|
-
cli.version(projectInfo.projectVersion);
|
|
41
|
-
cli.parse(process.argv.length === 2 ? [...process.argv, '--help'] : process.argv);
|
|
42
|
-
process.on('unhandledRejection', (rejectValue) => {
|
|
43
|
-
throw rejectValue;
|
|
44
|
-
});
|
package/node/cli/bin-entry.js
DELETED
|
File without changes
|