vike 0.4.181-commit-3fe2549 → 0.4.181-commit-1ff0c6d
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/getVikeConfig.js +9 -6
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +9 -6
- 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
|
@@ -293,6 +293,7 @@ async function loadVikeConfig(userRootDir, outDirRoot, isDev, crawlWithGit) {
|
|
|
293
293
|
}
|
|
294
294
|
// TODO/soon: refactor
|
|
295
295
|
// - Dedupe: most of the assertUsageGlobalConfigs() code below is a copy-paste of the assertUsage() logic inside getGlobalConfigs()
|
|
296
|
+
// - This assertUsage() message is slightly better: use this one for getGlobalConfigs()
|
|
296
297
|
// Global configs should be defined at global locations
|
|
297
298
|
function assertUsageGlobalConfigs(interfaceFilesRelevantList, configDefinitions, interfaceFilesByLocationId) {
|
|
298
299
|
interfaceFilesRelevantList.forEach(async (interfaceFile) => {
|
|
@@ -313,20 +314,22 @@ function assertUsageGlobalConfigs(interfaceFilesRelevantList, configDefinitions,
|
|
|
313
314
|
const interfaceFilesGlobal = (0, utils_js_1.objectFromEntries)((0, utils_js_1.objectEntries)(interfaceFilesByLocationId).filter(([locationId]) => {
|
|
314
315
|
return (0, filesystemRouting_js_1.isGlobalLocation)(locationId, locationIds);
|
|
315
316
|
}));
|
|
316
|
-
const
|
|
317
|
+
const configFilesGlobal = [];
|
|
317
318
|
(0, utils_js_1.objectEntries)(interfaceFilesGlobal).forEach(([locationId, interfaceFiles]) => {
|
|
318
319
|
(0, utils_js_1.assert)((0, filesystemRouting_js_1.isGlobalLocation)(locationId, locationIds));
|
|
319
|
-
interfaceFiles.forEach((
|
|
320
|
+
interfaceFiles.forEach((interfaceFile) => {
|
|
321
|
+
if (!interfaceFile.isConfigFile)
|
|
322
|
+
return;
|
|
323
|
+
const { filePath: { filePathAbsoluteUserRootDir } } = interfaceFile;
|
|
320
324
|
if (filePathAbsoluteUserRootDir) {
|
|
321
|
-
|
|
325
|
+
configFilesGlobal.push(filePathAbsoluteUserRootDir);
|
|
322
326
|
}
|
|
323
327
|
});
|
|
324
328
|
});
|
|
325
|
-
const globalPaths = Array.from(new Set(interfaceFilesGlobalPaths.map((p) => path_1.default.posix.dirname(p))));
|
|
326
329
|
(0, utils_js_1.assertUsage)(false, [
|
|
327
330
|
`${interfaceFile.filePath.filePathToShowToUser} defines the config ${picocolors_1.default.cyan(configName)} which is global:`,
|
|
328
|
-
|
|
329
|
-
? `define ${picocolors_1.default.cyan(configName)}
|
|
331
|
+
configFilesGlobal.length > 0
|
|
332
|
+
? `define ${picocolors_1.default.cyan(configName)} at ${(0, utils_js_1.joinEnglish)(configFilesGlobal, 'or')} instead`
|
|
330
333
|
: `create a global config (e.g. /pages/+config.js) and define ${picocolors_1.default.cyan(configName)} there instead`
|
|
331
334
|
].join(' '));
|
|
332
335
|
}
|
|
@@ -289,6 +289,7 @@ async function loadVikeConfig(userRootDir, outDirRoot, isDev, crawlWithGit) {
|
|
|
289
289
|
}
|
|
290
290
|
// TODO/soon: refactor
|
|
291
291
|
// - Dedupe: most of the assertUsageGlobalConfigs() code below is a copy-paste of the assertUsage() logic inside getGlobalConfigs()
|
|
292
|
+
// - This assertUsage() message is slightly better: use this one for getGlobalConfigs()
|
|
292
293
|
// Global configs should be defined at global locations
|
|
293
294
|
function assertUsageGlobalConfigs(interfaceFilesRelevantList, configDefinitions, interfaceFilesByLocationId) {
|
|
294
295
|
interfaceFilesRelevantList.forEach(async (interfaceFile) => {
|
|
@@ -309,20 +310,22 @@ function assertUsageGlobalConfigs(interfaceFilesRelevantList, configDefinitions,
|
|
|
309
310
|
const interfaceFilesGlobal = objectFromEntries(objectEntries(interfaceFilesByLocationId).filter(([locationId]) => {
|
|
310
311
|
return isGlobalLocation(locationId, locationIds);
|
|
311
312
|
}));
|
|
312
|
-
const
|
|
313
|
+
const configFilesGlobal = [];
|
|
313
314
|
objectEntries(interfaceFilesGlobal).forEach(([locationId, interfaceFiles]) => {
|
|
314
315
|
assert(isGlobalLocation(locationId, locationIds));
|
|
315
|
-
interfaceFiles.forEach((
|
|
316
|
+
interfaceFiles.forEach((interfaceFile) => {
|
|
317
|
+
if (!interfaceFile.isConfigFile)
|
|
318
|
+
return;
|
|
319
|
+
const { filePath: { filePathAbsoluteUserRootDir } } = interfaceFile;
|
|
316
320
|
if (filePathAbsoluteUserRootDir) {
|
|
317
|
-
|
|
321
|
+
configFilesGlobal.push(filePathAbsoluteUserRootDir);
|
|
318
322
|
}
|
|
319
323
|
});
|
|
320
324
|
});
|
|
321
|
-
const globalPaths = Array.from(new Set(interfaceFilesGlobalPaths.map((p) => path.posix.dirname(p))));
|
|
322
325
|
assertUsage(false, [
|
|
323
326
|
`${interfaceFile.filePath.filePathToShowToUser} defines the config ${pc.cyan(configName)} which is global:`,
|
|
324
|
-
|
|
325
|
-
? `define ${pc.cyan(configName)}
|
|
327
|
+
configFilesGlobal.length > 0
|
|
328
|
+
? `define ${pc.cyan(configName)} at ${joinEnglish(configFilesGlobal, 'or')} instead`
|
|
326
329
|
: `create a global config (e.g. /pages/+config.js) and define ${pc.cyan(configName)} there instead`
|
|
327
330
|
].join(' '));
|
|
328
331
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.181-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.181-commit-1ff0c6d";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.181-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.181-commit-1ff0c6d';
|