vike 0.4.201 → 0.4.202
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/plugin/plugins/importUserCode/v1-design/assertExtensions.js +9 -34
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js +2 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +3 -3
- package/dist/cjs/shared/page-configs/assertPlusFileExport.js +1 -1
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/assertExtensions.js +9 -34
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js +2 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +3 -3
- package/dist/esm/shared/page-configs/assertPlusFileExport.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/projectInfo.d.ts +1 -1
- package/package.json +1 -1
|
@@ -16,47 +16,22 @@ function assertExtensionsConventions(interfaceFile) {
|
|
|
16
16
|
assertConfigExportPath(interfaceFile);
|
|
17
17
|
}
|
|
18
18
|
function assertConfigExportPath(interfaceFile) {
|
|
19
|
-
const { importPathAbsolute } = interfaceFile.filePath;
|
|
20
|
-
|
|
19
|
+
const { importPathAbsolute, filePathAbsoluteFilesystem } = interfaceFile.filePath;
|
|
20
|
+
// Ejected Vike extension
|
|
21
|
+
if (!importPathAbsolute) {
|
|
22
|
+
const p = filePathAbsoluteFilesystem;
|
|
23
|
+
(0, utils_js_1.assert)(!p.includes('node_modules'));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
21
26
|
const name = getConfigNameValue(interfaceFile);
|
|
22
27
|
(0, utils_js_1.assert)(name); // already asserted in assertExtensionName()
|
|
23
28
|
const importPathAbsoluteExpected = `${name}/config`;
|
|
24
29
|
(0, utils_js_1.assertWarning)(importPathAbsolute === importPathAbsoluteExpected, `The Vike configuration of ${picocolors_1.default.bold(name)} is exported at ${picocolors_1.default.bold(importPathAbsolute)}, but it should be exported at ${picocolors_1.default.bold(importPathAbsoluteExpected)} instead.`, { onlyOnce: true });
|
|
25
30
|
}
|
|
26
31
|
function assertExtensionName(interfaceFile) {
|
|
27
|
-
let nameDeduced;
|
|
28
|
-
{
|
|
29
|
-
const { importPathAbsolute } = interfaceFile.filePath;
|
|
30
|
-
(0, utils_js_1.assert)(importPathAbsolute);
|
|
31
|
-
nameDeduced = importPathAbsolute
|
|
32
|
-
.split('/')
|
|
33
|
-
.slice(0, importPathAbsolute.startsWith('@') ? 2 : 1)
|
|
34
|
-
.join('/');
|
|
35
|
-
}
|
|
36
|
-
const name = getConfigNameValue(interfaceFile);
|
|
37
32
|
const filePathToShowToUser = getFilePathToShowToUser(interfaceFile);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
if (
|
|
43
|
-
// Let's eventually remove this
|
|
44
|
-
[
|
|
45
|
-
'vike-react',
|
|
46
|
-
'vike-react-query',
|
|
47
|
-
'vike-react-zustand',
|
|
48
|
-
'vike-vue',
|
|
49
|
-
'vike-vue-query',
|
|
50
|
-
'vike-vue-pinia',
|
|
51
|
-
'vike-pinia',
|
|
52
|
-
'vike-solid'
|
|
53
|
-
].includes(nameDeduced)) {
|
|
54
|
-
(0, utils_js_1.assertUsage)(false, `Update ${nameDeduced} to its latest version.`);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
(0, utils_js_1.assertUsage)(false, `The setting ${picocolors_1.default.bold('name')} is missing: it should be set by the config ${filePathToShowToUser} of ${picocolors_1.default.bold(nameDeduced)}.`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
33
|
+
const name = getConfigNameValue(interfaceFile);
|
|
34
|
+
(0, utils_js_1.assertUsage)(name, `Vike extension name missing: the config ${filePathToShowToUser} must define the setting ${picocolors_1.default.cyan('name')}`);
|
|
60
35
|
}
|
|
61
36
|
function assertExtensionsPeerDependencies(interfaceFilesRelevantList) {
|
|
62
37
|
// Get installed extensions
|
package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js
CHANGED
|
@@ -167,6 +167,7 @@ async function fastGlob(userRootDir, outDirRelativeFromUserRootDir) {
|
|
|
167
167
|
function getIgnoreAsPatterns(outDirRelativeFromUserRootDir) {
|
|
168
168
|
const ignoreAsPatterns = [
|
|
169
169
|
'**/node_modules/**',
|
|
170
|
+
'**/ejected/**',
|
|
170
171
|
// Allow:
|
|
171
172
|
// ```
|
|
172
173
|
// +Page.js
|
|
@@ -184,6 +185,7 @@ function getIgnoreAsPatterns(outDirRelativeFromUserRootDir) {
|
|
|
184
185
|
function getIgnoreAsFilterFn(outDirRelativeFromUserRootDir) {
|
|
185
186
|
(0, utils_js_1.assert)(outDirRelativeFromUserRootDir === null || !outDirRelativeFromUserRootDir.startsWith('/'));
|
|
186
187
|
return (file) => !file.includes('node_modules/') &&
|
|
188
|
+
!file.includes('ejected/') &&
|
|
187
189
|
!file.includes('.telefunc.') &&
|
|
188
190
|
(outDirRelativeFromUserRootDir === null || !file.startsWith(`${outDirRelativeFromUserRootDir}/`));
|
|
189
191
|
}
|
|
@@ -118,9 +118,9 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
|
|
|
118
118
|
let resolved = await build.resolve(path, opts);
|
|
119
119
|
if (debugEsbuildResolve.isActivated)
|
|
120
120
|
debugEsbuildResolve('resolved', resolved);
|
|
121
|
-
// Temporary workaround for https://github.com/
|
|
122
|
-
// -
|
|
123
|
-
// - Let's try to remove this workaround
|
|
121
|
+
// Temporary workaround for https://github.com/evanw/esbuild/issues/3973
|
|
122
|
+
// - Sitll required for esbuild@0.24.0 (November 2024).
|
|
123
|
+
// - Let's try to remove this workaround again later.
|
|
124
124
|
if (resolved.errors.length > 0) {
|
|
125
125
|
let resolvedWithNode;
|
|
126
126
|
try {
|
|
@@ -26,7 +26,7 @@ function assertPlusFileExport(fileExports, filePathToShowToUser, configName) {
|
|
|
26
26
|
const exportNamed = picocolors_1.default.code(`export { ${configName} }`);
|
|
27
27
|
(0, utils_js_1.assert)(exportNamesValid.length <= 2);
|
|
28
28
|
if (exportNamesValid.length === 0) {
|
|
29
|
-
(0, utils_js_1.assertUsage)(false, `${filePathToShowToUser} should have
|
|
29
|
+
(0, utils_js_1.assertUsage)(false, `${filePathToShowToUser} should have ${exportNamed} or ${exportDefault}`);
|
|
30
30
|
}
|
|
31
31
|
if (exportNamesValid.length === 2) {
|
|
32
32
|
(0, utils_js_1.assertWarning)(false, `${filePathToShowToUser} is ambiguous: remove ${exportDefault} or ${exportNamed}`, {
|
|
@@ -11,47 +11,22 @@ function assertExtensionsConventions(interfaceFile) {
|
|
|
11
11
|
assertConfigExportPath(interfaceFile);
|
|
12
12
|
}
|
|
13
13
|
function assertConfigExportPath(interfaceFile) {
|
|
14
|
-
const { importPathAbsolute } = interfaceFile.filePath;
|
|
15
|
-
|
|
14
|
+
const { importPathAbsolute, filePathAbsoluteFilesystem } = interfaceFile.filePath;
|
|
15
|
+
// Ejected Vike extension
|
|
16
|
+
if (!importPathAbsolute) {
|
|
17
|
+
const p = filePathAbsoluteFilesystem;
|
|
18
|
+
assert(!p.includes('node_modules'));
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
16
21
|
const name = getConfigNameValue(interfaceFile);
|
|
17
22
|
assert(name); // already asserted in assertExtensionName()
|
|
18
23
|
const importPathAbsoluteExpected = `${name}/config`;
|
|
19
24
|
assertWarning(importPathAbsolute === importPathAbsoluteExpected, `The Vike configuration of ${pc.bold(name)} is exported at ${pc.bold(importPathAbsolute)}, but it should be exported at ${pc.bold(importPathAbsoluteExpected)} instead.`, { onlyOnce: true });
|
|
20
25
|
}
|
|
21
26
|
function assertExtensionName(interfaceFile) {
|
|
22
|
-
let nameDeduced;
|
|
23
|
-
{
|
|
24
|
-
const { importPathAbsolute } = interfaceFile.filePath;
|
|
25
|
-
assert(importPathAbsolute);
|
|
26
|
-
nameDeduced = importPathAbsolute
|
|
27
|
-
.split('/')
|
|
28
|
-
.slice(0, importPathAbsolute.startsWith('@') ? 2 : 1)
|
|
29
|
-
.join('/');
|
|
30
|
-
}
|
|
31
|
-
const name = getConfigNameValue(interfaceFile);
|
|
32
27
|
const filePathToShowToUser = getFilePathToShowToUser(interfaceFile);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
if (
|
|
38
|
-
// Let's eventually remove this
|
|
39
|
-
[
|
|
40
|
-
'vike-react',
|
|
41
|
-
'vike-react-query',
|
|
42
|
-
'vike-react-zustand',
|
|
43
|
-
'vike-vue',
|
|
44
|
-
'vike-vue-query',
|
|
45
|
-
'vike-vue-pinia',
|
|
46
|
-
'vike-pinia',
|
|
47
|
-
'vike-solid'
|
|
48
|
-
].includes(nameDeduced)) {
|
|
49
|
-
assertUsage(false, `Update ${nameDeduced} to its latest version.`);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
assertUsage(false, `The setting ${pc.bold('name')} is missing: it should be set by the config ${filePathToShowToUser} of ${pc.bold(nameDeduced)}.`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
28
|
+
const name = getConfigNameValue(interfaceFile);
|
|
29
|
+
assertUsage(name, `Vike extension name missing: the config ${filePathToShowToUser} must define the setting ${pc.cyan('name')}`);
|
|
55
30
|
}
|
|
56
31
|
function assertExtensionsPeerDependencies(interfaceFilesRelevantList) {
|
|
57
32
|
// Get installed extensions
|
package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js
CHANGED
|
@@ -162,6 +162,7 @@ async function fastGlob(userRootDir, outDirRelativeFromUserRootDir) {
|
|
|
162
162
|
function getIgnoreAsPatterns(outDirRelativeFromUserRootDir) {
|
|
163
163
|
const ignoreAsPatterns = [
|
|
164
164
|
'**/node_modules/**',
|
|
165
|
+
'**/ejected/**',
|
|
165
166
|
// Allow:
|
|
166
167
|
// ```
|
|
167
168
|
// +Page.js
|
|
@@ -179,6 +180,7 @@ function getIgnoreAsPatterns(outDirRelativeFromUserRootDir) {
|
|
|
179
180
|
function getIgnoreAsFilterFn(outDirRelativeFromUserRootDir) {
|
|
180
181
|
assert(outDirRelativeFromUserRootDir === null || !outDirRelativeFromUserRootDir.startsWith('/'));
|
|
181
182
|
return (file) => !file.includes('node_modules/') &&
|
|
183
|
+
!file.includes('ejected/') &&
|
|
182
184
|
!file.includes('.telefunc.') &&
|
|
183
185
|
(outDirRelativeFromUserRootDir === null || !file.startsWith(`${outDirRelativeFromUserRootDir}/`));
|
|
184
186
|
}
|
|
@@ -113,9 +113,9 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
|
|
|
113
113
|
let resolved = await build.resolve(path, opts);
|
|
114
114
|
if (debugEsbuildResolve.isActivated)
|
|
115
115
|
debugEsbuildResolve('resolved', resolved);
|
|
116
|
-
// Temporary workaround for https://github.com/
|
|
117
|
-
// -
|
|
118
|
-
// - Let's try to remove this workaround
|
|
116
|
+
// Temporary workaround for https://github.com/evanw/esbuild/issues/3973
|
|
117
|
+
// - Sitll required for esbuild@0.24.0 (November 2024).
|
|
118
|
+
// - Let's try to remove this workaround again later.
|
|
119
119
|
if (resolved.errors.length > 0) {
|
|
120
120
|
let resolvedWithNode;
|
|
121
121
|
try {
|
|
@@ -21,7 +21,7 @@ function assertPlusFileExport(fileExports, filePathToShowToUser, configName) {
|
|
|
21
21
|
const exportNamed = pc.code(`export { ${configName} }`);
|
|
22
22
|
assert(exportNamesValid.length <= 2);
|
|
23
23
|
if (exportNamesValid.length === 0) {
|
|
24
|
-
assertUsage(false, `${filePathToShowToUser} should have
|
|
24
|
+
assertUsage(false, `${filePathToShowToUser} should have ${exportNamed} or ${exportDefault}`);
|
|
25
25
|
}
|
|
26
26
|
if (exportNamesValid.length === 2) {
|
|
27
27
|
assertWarning(false, `${filePathToShowToUser} is ambiguous: remove ${exportDefault} or ${exportNamed}`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.202";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.
|
|
2
|
+
export const PROJECT_VERSION = '0.4.202';
|