vike 0.4.142-commit-937cb3b → 0.4.142-commit-acfc159
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/commonConfig.js +1 -1
- package/dist/cjs/node/plugin/plugins/suppressRollupWarning.js +16 -3
- package/dist/cjs/utils/projectInfo.js +1 -1
- package/dist/esm/node/plugin/plugins/commonConfig.js +1 -1
- package/dist/esm/node/plugin/plugins/suppressRollupWarning.js +16 -3
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/dist/esm/utils/projectInfo.js +1 -1
- package/package.json +1 -1
|
@@ -76,5 +76,5 @@ function assertEsm(userViteRoot) {
|
|
|
76
76
|
}
|
|
77
77
|
(0, utils_js_1.assert)(dir.endsWith('/'));
|
|
78
78
|
dir = picocolors_1.default.dim(dir);
|
|
79
|
-
(0, utils_js_1.assertWarning)(packageJson.type === 'module', `We recommend setting ${dir}package.json#type to "module"
|
|
79
|
+
(0, utils_js_1.assertWarning)(packageJson.type === 'module', `We recommend setting ${dir}package.json#type to "module", see https://vike.dev/CJS`, { onlyOnce: true });
|
|
80
80
|
}
|
|
@@ -42,10 +42,23 @@ function suppressUnusedImport(warning) {
|
|
|
42
42
|
if (warning.code !== 'UNUSED_EXTERNAL_IMPORT')
|
|
43
43
|
return false;
|
|
44
44
|
// I guess it's expected that JSX contains unsused `import React from 'react'`
|
|
45
|
-
if (warning.exporter === 'react' && warning.names?.includes('default'))
|
|
46
|
-
|
|
45
|
+
if (warning.exporter === 'react' && warning.names?.includes('default')) {
|
|
46
|
+
warning.names = warning.names.filter((n) => n !== 'default');
|
|
47
|
+
if (warning.names.length === 0)
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
// Suppress:
|
|
51
|
+
// ```
|
|
52
|
+
// "untrack" is imported from external module "solid-js" but never used in "pages/star-wars/index/+Page.tsx", "pages/index/Counter.tsx", "components/Link.tsx", "pages/todo/TodoList.tsx" and "pages/todo/+Page.tsx".
|
|
53
|
+
// ```
|
|
54
|
+
// I'm guessing Solid's transformer injects `import { untrack } from 'solid-js'`
|
|
55
|
+
if (warning.exporter === 'solid-js' && warning.names?.includes('untrack')) {
|
|
56
|
+
warning.names = warning.names.filter((n) => n !== 'untrack');
|
|
57
|
+
if (warning.names.length === 0)
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
47
60
|
// If some library does something unexpected, we suppress since it isn't actionable
|
|
48
|
-
if (warning.ids?.
|
|
61
|
+
if (warning.ids?.every((id) => id.includes('/node_modules/')))
|
|
49
62
|
return true;
|
|
50
63
|
return false;
|
|
51
64
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.projectInfo = void 0;
|
|
4
4
|
const assertSingleInstance_js_1 = require("./assertSingleInstance.js");
|
|
5
|
-
const PROJECT_VERSION = '0.4.142-commit-
|
|
5
|
+
const PROJECT_VERSION = '0.4.142-commit-acfc159';
|
|
6
6
|
const projectInfo = {
|
|
7
7
|
projectName: 'Vike',
|
|
8
8
|
projectVersion: PROJECT_VERSION,
|
|
@@ -70,5 +70,5 @@ function assertEsm(userViteRoot) {
|
|
|
70
70
|
}
|
|
71
71
|
assert(dir.endsWith('/'));
|
|
72
72
|
dir = pc.dim(dir);
|
|
73
|
-
assertWarning(packageJson.type === 'module', `We recommend setting ${dir}package.json#type to "module"
|
|
73
|
+
assertWarning(packageJson.type === 'module', `We recommend setting ${dir}package.json#type to "module", see https://vike.dev/CJS`, { onlyOnce: true });
|
|
74
74
|
}
|
|
@@ -39,10 +39,23 @@ function suppressUnusedImport(warning) {
|
|
|
39
39
|
if (warning.code !== 'UNUSED_EXTERNAL_IMPORT')
|
|
40
40
|
return false;
|
|
41
41
|
// I guess it's expected that JSX contains unsused `import React from 'react'`
|
|
42
|
-
if (warning.exporter === 'react' && warning.names?.includes('default'))
|
|
43
|
-
|
|
42
|
+
if (warning.exporter === 'react' && warning.names?.includes('default')) {
|
|
43
|
+
warning.names = warning.names.filter((n) => n !== 'default');
|
|
44
|
+
if (warning.names.length === 0)
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
// Suppress:
|
|
48
|
+
// ```
|
|
49
|
+
// "untrack" is imported from external module "solid-js" but never used in "pages/star-wars/index/+Page.tsx", "pages/index/Counter.tsx", "components/Link.tsx", "pages/todo/TodoList.tsx" and "pages/todo/+Page.tsx".
|
|
50
|
+
// ```
|
|
51
|
+
// I'm guessing Solid's transformer injects `import { untrack } from 'solid-js'`
|
|
52
|
+
if (warning.exporter === 'solid-js' && warning.names?.includes('untrack')) {
|
|
53
|
+
warning.names = warning.names.filter((n) => n !== 'untrack');
|
|
54
|
+
if (warning.names.length === 0)
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
44
57
|
// If some library does something unexpected, we suppress since it isn't actionable
|
|
45
|
-
if (warning.ids?.
|
|
58
|
+
if (warning.ids?.every((id) => id.includes('/node_modules/')))
|
|
46
59
|
return true;
|
|
47
60
|
return false;
|
|
48
61
|
}
|
|
@@ -5,7 +5,7 @@ type ProjectVersion = typeof projectInfo.projectVersion;
|
|
|
5
5
|
type ProjectTag = `[${PackageName}]` | `[${PackageName}@${ProjectVersion}]`;
|
|
6
6
|
declare const projectInfo: {
|
|
7
7
|
projectName: "Vike";
|
|
8
|
-
projectVersion: "0.4.142-commit-
|
|
8
|
+
projectVersion: "0.4.142-commit-acfc159";
|
|
9
9
|
npmPackageName: "vike";
|
|
10
10
|
githubRepository: "https://github.com/vikejs/vike";
|
|
11
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { projectInfo };
|
|
2
2
|
import { onProjectInfo } from './assertSingleInstance.js';
|
|
3
|
-
const PROJECT_VERSION = '0.4.142-commit-
|
|
3
|
+
const PROJECT_VERSION = '0.4.142-commit-acfc159';
|
|
4
4
|
const projectInfo = {
|
|
5
5
|
projectName: 'Vike',
|
|
6
6
|
projectVersion: PROJECT_VERSION,
|