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.
@@ -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 interfaceFilesGlobalPaths = [];
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(({ filePath: { filePathAbsoluteUserRootDir } }) => {
320
+ interfaceFiles.forEach((interfaceFile) => {
321
+ if (!interfaceFile.isConfigFile)
322
+ return;
323
+ const { filePath: { filePathAbsoluteUserRootDir } } = interfaceFile;
320
324
  if (filePathAbsoluteUserRootDir) {
321
- interfaceFilesGlobalPaths.push(filePathAbsoluteUserRootDir);
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
- globalPaths.length
329
- ? `define ${picocolors_1.default.cyan(configName)} in ${(0, utils_js_1.joinEnglish)(globalPaths, 'or')} instead`
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
  }
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROJECT_VERSION = void 0;
4
4
  // Automatically updated by @brillout/release-me
5
- exports.PROJECT_VERSION = '0.4.181-commit-3fe2549';
5
+ exports.PROJECT_VERSION = '0.4.181-commit-1ff0c6d';
@@ -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 interfaceFilesGlobalPaths = [];
313
+ const configFilesGlobal = [];
313
314
  objectEntries(interfaceFilesGlobal).forEach(([locationId, interfaceFiles]) => {
314
315
  assert(isGlobalLocation(locationId, locationIds));
315
- interfaceFiles.forEach(({ filePath: { filePathAbsoluteUserRootDir } }) => {
316
+ interfaceFiles.forEach((interfaceFile) => {
317
+ if (!interfaceFile.isConfigFile)
318
+ return;
319
+ const { filePath: { filePathAbsoluteUserRootDir } } = interfaceFile;
316
320
  if (filePathAbsoluteUserRootDir) {
317
- interfaceFilesGlobalPaths.push(filePathAbsoluteUserRootDir);
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
- globalPaths.length
325
- ? `define ${pc.cyan(configName)} in ${joinEnglish(globalPaths, 'or')} instead`
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-3fe2549";
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-3fe2549';
2
+ export const PROJECT_VERSION = '0.4.181-commit-1ff0c6d';
@@ -1,4 +1,4 @@
1
1
  export declare const projectInfo: {
2
2
  projectName: "Vike";
3
- projectVersion: "0.4.181-commit-3fe2549";
3
+ projectVersion: "0.4.181-commit-1ff0c6d";
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.181-commit-3fe2549",
3
+ "version": "0.4.181-commit-1ff0c6d",
4
4
  "scripts": {
5
5
  "dev": "tsc --watch",
6
6
  "build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",