vike 0.4.159-commit-a6bc208 → 0.4.159-commit-d73533a
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/loadFileConfigEnv.js +129 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolveImportPath.js +139 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/{transformImports.js → getVikeConfig/transformImports.js} +1 -1
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/{transpileAndExecuteFile.js → getVikeConfig/transpileAndExecuteFile.js} +3 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +54 -262
- package/dist/cjs/node/plugin/shared/getHttpRequestAsyncStore.js +1 -1
- package/dist/cjs/node/plugin/shared/loggerNotProd.js +1 -1
- package/dist/cjs/utils/projectInfo.js +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileConfigEnv.d.ts +21 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileConfigEnv.js +123 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolveImportPath.d.ts +12 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolveImportPath.js +133 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/{transformImports.js → getVikeConfig/transformImports.js} +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/{transpileAndExecuteFile.d.ts → getVikeConfig/transpileAndExecuteFile.d.ts} +2 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/{transpileAndExecuteFile.js → getVikeConfig/transpileAndExecuteFile.js} +4 -4
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.d.ts +14 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +50 -258
- package/dist/esm/node/plugin/shared/getHttpRequestAsyncStore.js +1 -1
- package/dist/esm/node/plugin/shared/loggerNotProd.js +1 -1
- package/dist/esm/utils/projectInfo.d.ts +2 -2
- package/dist/esm/utils/projectInfo.js +1 -1
- package/package.json +1 -1
- /package/dist/esm/node/plugin/plugins/importUserCode/v1-design/{transformImports.d.ts → getVikeConfig/transformImports.d.ts} +0 -0
package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileConfigEnv.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Files loadded at config time:
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.loadConfigFile = exports.loadValueFile = exports.loadImportedFile = void 0;
|
|
8
|
+
const utils_js_1 = require("../../../../utils.js");
|
|
9
|
+
const transpileAndExecuteFile_js_1 = require("./transpileAndExecuteFile.js");
|
|
10
|
+
const assertPlusFileExport_js_1 = require("../../../../../../shared/page-configs/assertPlusFileExport.js");
|
|
11
|
+
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
12
|
+
const transformImports_js_1 = require("./transformImports.js");
|
|
13
|
+
const getConfigFileExport_js_1 = require("../getConfigFileExport.js");
|
|
14
|
+
const resolveImportPath_js_1 = require("./resolveImportPath.js");
|
|
15
|
+
(0, utils_js_1.assertIsNotProductionRuntime)();
|
|
16
|
+
// Load fake import
|
|
17
|
+
async function loadImportedFile(import_, userRootDir, importedFilesLoaded) {
|
|
18
|
+
const f = import_.filePathAbsoluteFilesystem;
|
|
19
|
+
if (!importedFilesLoaded[f]) {
|
|
20
|
+
importedFilesLoaded[f] = (0, transpileAndExecuteFile_js_1.transpileAndExecuteFile)(import_, true, userRootDir).then((r) => r.fileExports);
|
|
21
|
+
}
|
|
22
|
+
const fileExports = await importedFilesLoaded[f];
|
|
23
|
+
const fileExport = fileExports[import_.fileExportName];
|
|
24
|
+
return fileExport;
|
|
25
|
+
}
|
|
26
|
+
exports.loadImportedFile = loadImportedFile;
|
|
27
|
+
// Load +{configName}.js
|
|
28
|
+
async function loadValueFile(interfaceValueFile, configName, userRootDir) {
|
|
29
|
+
const { fileExports } = await (0, transpileAndExecuteFile_js_1.transpileAndExecuteFile)(interfaceValueFile.filePath, true, userRootDir);
|
|
30
|
+
const { filePathToShowToUser } = interfaceValueFile.filePath;
|
|
31
|
+
(0, assertPlusFileExport_js_1.assertPlusFileExport)(fileExports, filePathToShowToUser, configName);
|
|
32
|
+
Object.entries(fileExports).forEach(([exportName, configValue]) => {
|
|
33
|
+
const configName_ = exportName === 'default' ? configName : exportName;
|
|
34
|
+
interfaceValueFile.fileExportsByConfigName[configName_] = { configValue };
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
exports.loadValueFile = loadValueFile;
|
|
38
|
+
// Load +config.js, including all its extends fake imports
|
|
39
|
+
async function loadConfigFile(configFilePath, userRootDir, visited, isConfigOfExtension) {
|
|
40
|
+
const { filePathAbsoluteFilesystem } = configFilePath;
|
|
41
|
+
assertNoInfiniteLoop(visited, filePathAbsoluteFilesystem);
|
|
42
|
+
const { fileExports } = await (0, transpileAndExecuteFile_js_1.transpileAndExecuteFile)(configFilePath, false, userRootDir, isConfigOfExtension);
|
|
43
|
+
const { extendsConfigs, extendsFilePaths } = await loadExtendsConfigs(fileExports, configFilePath, userRootDir, [
|
|
44
|
+
...visited,
|
|
45
|
+
filePathAbsoluteFilesystem
|
|
46
|
+
]);
|
|
47
|
+
const configFile = {
|
|
48
|
+
fileExports,
|
|
49
|
+
filePath: configFilePath,
|
|
50
|
+
extendsFilePaths
|
|
51
|
+
};
|
|
52
|
+
return { configFile, extendsConfigs };
|
|
53
|
+
}
|
|
54
|
+
exports.loadConfigFile = loadConfigFile;
|
|
55
|
+
function assertNoInfiniteLoop(visited, filePathAbsoluteFilesystem) {
|
|
56
|
+
const idx = visited.indexOf(filePathAbsoluteFilesystem);
|
|
57
|
+
if (idx === -1)
|
|
58
|
+
return;
|
|
59
|
+
const loop = visited.slice(idx);
|
|
60
|
+
(0, utils_js_1.assert)(loop[0] === filePathAbsoluteFilesystem);
|
|
61
|
+
(0, utils_js_1.assertUsage)(idx === -1, `Infinite extends loop ${[...loop, filePathAbsoluteFilesystem].join('>')}`);
|
|
62
|
+
}
|
|
63
|
+
async function loadExtendsConfigs(configFileExports, configFilePath, userRootDir, visited) {
|
|
64
|
+
const extendsImportData = getExtendsImportData(configFileExports, configFilePath);
|
|
65
|
+
const extendsConfigFiles = [];
|
|
66
|
+
extendsImportData.map((importData) => {
|
|
67
|
+
const { importPath: importPath } = importData;
|
|
68
|
+
const filePathAbsoluteFilesystem = (0, resolveImportPath_js_1.resolveImportPath)(importData, configFilePath);
|
|
69
|
+
(0, resolveImportPath_js_1.assertImportPath)(filePathAbsoluteFilesystem, importData, configFilePath);
|
|
70
|
+
warnUserLandExtension(importPath, configFilePath);
|
|
71
|
+
// - filePathRelativeToUserRootDir has no functionality beyond nicer error messages for user
|
|
72
|
+
// - Using importPath would be visually nicer but it's ambigous => we rather pick filePathAbsoluteFilesystem for added clarity
|
|
73
|
+
const filePathRelativeToUserRootDir = determineFilePathRelativeToUserDir(filePathAbsoluteFilesystem, userRootDir);
|
|
74
|
+
const filePathAbsoluteVite = filePathRelativeToUserRootDir ?? importPath;
|
|
75
|
+
extendsConfigFiles.push({
|
|
76
|
+
filePathAbsoluteFilesystem,
|
|
77
|
+
filePathAbsoluteVite,
|
|
78
|
+
filePathRelativeToUserRootDir,
|
|
79
|
+
filePathToShowToUser: filePathAbsoluteVite,
|
|
80
|
+
importPathAbsolute: importPath
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
const extendsConfigs = [];
|
|
84
|
+
await Promise.all(extendsConfigFiles.map(async (configFilePath) => {
|
|
85
|
+
const result = await loadConfigFile(configFilePath, userRootDir, visited, true);
|
|
86
|
+
extendsConfigs.push(result.configFile);
|
|
87
|
+
extendsConfigs.push(...result.extendsConfigs);
|
|
88
|
+
}));
|
|
89
|
+
const extendsFilePaths = extendsConfigFiles.map((f) => f.filePathAbsoluteFilesystem);
|
|
90
|
+
return { extendsConfigs, extendsFilePaths };
|
|
91
|
+
}
|
|
92
|
+
function determineFilePathRelativeToUserDir(filePathAbsoluteFilesystem, userRootDir) {
|
|
93
|
+
(0, utils_js_1.assertPosixPath)(filePathAbsoluteFilesystem);
|
|
94
|
+
(0, utils_js_1.assertPosixPath)(userRootDir);
|
|
95
|
+
if (!filePathAbsoluteFilesystem.startsWith(userRootDir)) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
let filePathRelativeToUserRootDir = filePathAbsoluteFilesystem.slice(userRootDir.length);
|
|
99
|
+
if (!filePathRelativeToUserRootDir.startsWith('/'))
|
|
100
|
+
filePathRelativeToUserRootDir = '/' + filePathRelativeToUserRootDir;
|
|
101
|
+
return filePathRelativeToUserRootDir;
|
|
102
|
+
}
|
|
103
|
+
function warnUserLandExtension(importPath, configFilePath) {
|
|
104
|
+
(0, utils_js_1.assertWarning)((0, utils_js_1.isNpmPackageImport)(importPath), `${configFilePath.filePathToShowToUser} uses ${picocolors_1.default.cyan('extends')} to inherit from ${picocolors_1.default.cyan(importPath)} which is a user-land file: this is experimental and may be remove at any time. Reach out to a maintainer if you need this.`, { onlyOnce: true });
|
|
105
|
+
}
|
|
106
|
+
function getExtendsImportData(configFileExports, configFilePath) {
|
|
107
|
+
const { filePathToShowToUser } = configFilePath;
|
|
108
|
+
const configFileExport = (0, getConfigFileExport_js_1.getConfigFileExport)(configFileExports, filePathToShowToUser);
|
|
109
|
+
const wrongUsage = `${filePathToShowToUser} sets the config ${picocolors_1.default.cyan('extends')} to an invalid value, see https://vike.dev/extends`;
|
|
110
|
+
let extendList;
|
|
111
|
+
if (!('extends' in configFileExport)) {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
else if ((0, utils_js_1.hasProp)(configFileExport, 'extends', 'string')) {
|
|
115
|
+
extendList = [configFileExport.extends];
|
|
116
|
+
}
|
|
117
|
+
else if ((0, utils_js_1.hasProp)(configFileExport, 'extends', 'string[]')) {
|
|
118
|
+
extendList = configFileExport.extends;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
(0, utils_js_1.assertUsage)(false, wrongUsage);
|
|
122
|
+
}
|
|
123
|
+
const extendsImportData = extendList.map((importDataSerialized) => {
|
|
124
|
+
const importData = (0, transformImports_js_1.parseImportData)(importDataSerialized);
|
|
125
|
+
(0, utils_js_1.assertUsage)(importData, wrongUsage);
|
|
126
|
+
return importData;
|
|
127
|
+
});
|
|
128
|
+
return extendsImportData;
|
|
129
|
+
}
|
package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolveImportPath.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
exports.clearFilesEnvMap = exports.assertImportPath = exports.resolveImportPath = exports.resolveImport = void 0;
|
|
7
|
+
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
8
|
+
const utils_js_1 = require("../../../../utils.js");
|
|
9
|
+
const transformImports_js_1 = require("./transformImports.js");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const filesEnvMap = new Map();
|
|
12
|
+
function resolveImport(configValue, importerFilePath, userRootDir, configEnv, configName) {
|
|
13
|
+
if (typeof configValue !== 'string')
|
|
14
|
+
return null;
|
|
15
|
+
const importData = (0, transformImports_js_1.parseImportData)(configValue);
|
|
16
|
+
if (!importData)
|
|
17
|
+
return null;
|
|
18
|
+
const { importPath, exportName } = importData;
|
|
19
|
+
const filePathAbsoluteFilesystem = resolveImportPath(importData, importerFilePath);
|
|
20
|
+
assertFileEnv(filePathAbsoluteFilesystem ?? importPath, configEnv, configName);
|
|
21
|
+
const fileExportPathToShowToUser = exportName === 'default' || exportName === configName ? [] : [exportName];
|
|
22
|
+
if (importPath.startsWith('.')) {
|
|
23
|
+
// We need to resolve relative paths into absolute paths. Because the import paths are included in virtual files:
|
|
24
|
+
// ```
|
|
25
|
+
// [vite] Internal server error: Failed to resolve import "./onPageTransitionHooks" from "virtual:vike:pageConfigValuesAll:client:/pages/index". Does the file exist?
|
|
26
|
+
// ```
|
|
27
|
+
assertImportPath(filePathAbsoluteFilesystem, importData, importerFilePath);
|
|
28
|
+
const filePathRelativeToUserRootDir = resolveImportPath_relativeToUserRootDir(filePathAbsoluteFilesystem, importData, importerFilePath, userRootDir);
|
|
29
|
+
const filePath = {
|
|
30
|
+
filePathAbsoluteFilesystem,
|
|
31
|
+
filePathRelativeToUserRootDir,
|
|
32
|
+
filePathAbsoluteVite: filePathRelativeToUserRootDir,
|
|
33
|
+
filePathToShowToUser: filePathRelativeToUserRootDir,
|
|
34
|
+
importPathAbsolute: null
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
...filePath,
|
|
38
|
+
fileExportName: exportName,
|
|
39
|
+
fileExportPathToShowToUser
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// importPath can be:
|
|
44
|
+
// - an npm package import
|
|
45
|
+
// - a path alias
|
|
46
|
+
const filePath = {
|
|
47
|
+
filePathAbsoluteFilesystem,
|
|
48
|
+
filePathRelativeToUserRootDir: null,
|
|
49
|
+
filePathAbsoluteVite: importPath,
|
|
50
|
+
filePathToShowToUser: importPath,
|
|
51
|
+
importPathAbsolute: importPath
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
...filePath,
|
|
55
|
+
fileExportName: exportName,
|
|
56
|
+
fileExportPathToShowToUser
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.resolveImport = resolveImport;
|
|
61
|
+
function resolveImportPath_relativeToUserRootDir(filePathAbsoluteFilesystem, importData, configFilePath, userRootDir) {
|
|
62
|
+
(0, utils_js_1.assertPosixPath)(userRootDir);
|
|
63
|
+
let filePathRelativeToUserRootDir;
|
|
64
|
+
if (filePathAbsoluteFilesystem.startsWith(userRootDir)) {
|
|
65
|
+
filePathRelativeToUserRootDir = getVitePathFromAbsolutePath(filePathAbsoluteFilesystem, userRootDir);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
(0, utils_js_1.assertUsage)(false, `${configFilePath.filePathToShowToUser} imports from a relative path ${picocolors_1.default.cyan(importData.importPath)} outside of ${userRootDir} which is forbidden: import from a relative path inside ${userRootDir}, or import from a dependency's package.json#exports entry instead`);
|
|
69
|
+
// None of the following works. Seems to be a Vite bug?
|
|
70
|
+
// /*
|
|
71
|
+
// assert(filePathAbsoluteFilesystem.startsWith('/'))
|
|
72
|
+
// filePath = `/@fs${filePathAbsoluteFilesystem}`
|
|
73
|
+
// /*/
|
|
74
|
+
// filePathRelativeToUserRootDir = path.posix.relative(userRootDir, filePathAbsoluteFilesystem)
|
|
75
|
+
// assert(filePathRelativeToUserRootDir.startsWith('../'))
|
|
76
|
+
// filePathRelativeToUserRootDir = '/' + filePathRelativeToUserRootDir
|
|
77
|
+
// //*/
|
|
78
|
+
}
|
|
79
|
+
(0, utils_js_1.assertPosixPath)(filePathRelativeToUserRootDir);
|
|
80
|
+
(0, utils_js_1.assert)(filePathRelativeToUserRootDir.startsWith('/'));
|
|
81
|
+
return filePathRelativeToUserRootDir;
|
|
82
|
+
}
|
|
83
|
+
function resolveImportPath(importData, importerFilePath) {
|
|
84
|
+
const importerFilePathAbsolute = importerFilePath.filePathAbsoluteFilesystem;
|
|
85
|
+
(0, utils_js_1.assertPosixPath)(importerFilePathAbsolute);
|
|
86
|
+
const cwd = path_1.default.posix.dirname(importerFilePathAbsolute);
|
|
87
|
+
// We can't use import.meta.resolve() as of Junary 2023 (and probably for a lot longer): https://stackoverflow.com/questions/54977743/do-require-resolve-for-es-modules#comment137174954_62272600:~:text=But%20the%20argument%20parent%20(aka%20cwd)%20still%20requires%20a%20flag
|
|
88
|
+
// filePathAbsoluteFilesystem is expected to be null when importData.importPath is a Vite path alias
|
|
89
|
+
const filePathAbsoluteFilesystem = (0, utils_js_1.requireResolve)(importData.importPath, cwd);
|
|
90
|
+
return filePathAbsoluteFilesystem;
|
|
91
|
+
}
|
|
92
|
+
exports.resolveImportPath = resolveImportPath;
|
|
93
|
+
function assertImportPath(filePathAbsoluteFilesystem, importData, importerFilePath) {
|
|
94
|
+
const { importPath: importPath, importStringWasGenerated, importString } = importData;
|
|
95
|
+
const { filePathToShowToUser } = importerFilePath;
|
|
96
|
+
if (!filePathAbsoluteFilesystem) {
|
|
97
|
+
const importPathString = picocolors_1.default.cyan(`'${importPath}'`);
|
|
98
|
+
const errIntro = importStringWasGenerated
|
|
99
|
+
? `The import path ${importPathString} in ${filePathToShowToUser}`
|
|
100
|
+
: `The import ${picocolors_1.default.cyan(importString)} defined in ${filePathToShowToUser}`;
|
|
101
|
+
const errIntro2 = `${errIntro} couldn't be resolved: does ${importPathString}`;
|
|
102
|
+
if (importPath.startsWith('.')) {
|
|
103
|
+
(0, utils_js_1.assertUsage)(false, `${errIntro2} point to an existing file?`);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
(0, utils_js_1.assertUsage)(false, `${errIntro2} exist?`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.assertImportPath = assertImportPath;
|
|
111
|
+
function assertFileEnv(filePathForEnvCheck, configEnv, configName) {
|
|
112
|
+
(0, utils_js_1.assertPosixPath)(filePathForEnvCheck);
|
|
113
|
+
if (!filesEnvMap.has(filePathForEnvCheck)) {
|
|
114
|
+
filesEnvMap.set(filePathForEnvCheck, []);
|
|
115
|
+
}
|
|
116
|
+
const fileEnv = filesEnvMap.get(filePathForEnvCheck);
|
|
117
|
+
fileEnv.push({ configEnv, configName });
|
|
118
|
+
const configDifferentEnv = fileEnv.filter((c) => !(0, utils_js_1.deepEqual)(c.configEnv, configEnv))[0];
|
|
119
|
+
if (configDifferentEnv) {
|
|
120
|
+
(0, utils_js_1.assertUsage)(false, [
|
|
121
|
+
`${filePathForEnvCheck} defines the value of configs living in different environments:`,
|
|
122
|
+
...[configDifferentEnv, { configName, configEnv }].map((c) => ` - config ${picocolors_1.default.cyan(c.configName)} which value lives in environment ${picocolors_1.default.cyan(JSON.stringify(c.configEnv))}`),
|
|
123
|
+
'Defining config values in the same file is allowed only if they live in the same environment, see https://vike.dev/header-file'
|
|
124
|
+
].join('\n'));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function clearFilesEnvMap() {
|
|
128
|
+
filesEnvMap.clear();
|
|
129
|
+
}
|
|
130
|
+
exports.clearFilesEnvMap = clearFilesEnvMap;
|
|
131
|
+
function getVitePathFromAbsolutePath(filePathAbsoluteFilesystem, root) {
|
|
132
|
+
(0, utils_js_1.assertPosixPath)(filePathAbsoluteFilesystem);
|
|
133
|
+
(0, utils_js_1.assertPosixPath)(root);
|
|
134
|
+
(0, utils_js_1.assert)(filePathAbsoluteFilesystem.startsWith(root));
|
|
135
|
+
let vitePath = path_1.default.posix.relative(root, filePathAbsoluteFilesystem);
|
|
136
|
+
(0, utils_js_1.assert)(!vitePath.startsWith('/') && !vitePath.startsWith('.'));
|
|
137
|
+
vitePath = '/' + vitePath;
|
|
138
|
+
return vitePath;
|
|
139
|
+
}
|
|
@@ -8,7 +8,7 @@ exports.isImportData = exports.parseImportData = exports.transformImports = void
|
|
|
8
8
|
// Import attributes support: https://github.com/acornjs/acorn/issues/983
|
|
9
9
|
// - Isn't stage 4 yet: https://github.com/tc39/proposal-import-attributes
|
|
10
10
|
const acorn_1 = require("acorn");
|
|
11
|
-
const utils_js_1 = require("
|
|
11
|
+
const utils_js_1 = require("../../../../utils.js");
|
|
12
12
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
13
13
|
function transformImports(code, filePathToShowToUser2,
|
|
14
14
|
// For ./transformImports.spec.ts
|
|
@@ -9,11 +9,11 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
11
11
|
const import_1 = require("@brillout/import");
|
|
12
|
-
const utils_js_1 = require("
|
|
12
|
+
const utils_js_1 = require("../../../../utils.js");
|
|
13
13
|
const transformImports_js_1 = require("./transformImports.js");
|
|
14
|
-
const getVikeConfig_js_1 = require("
|
|
14
|
+
const getVikeConfig_js_1 = require("../getVikeConfig.js");
|
|
15
15
|
require("source-map-support/register.js");
|
|
16
|
-
const getConfigFileExport_js_1 = require("
|
|
16
|
+
const getConfigFileExport_js_1 = require("../getConfigFileExport.js");
|
|
17
17
|
(0, utils_js_1.assertIsNotProductionRuntime)();
|
|
18
18
|
async function transpileAndExecuteFile(filePath, isValueFile, userRootDir, isConfigOfExtension = false) {
|
|
19
19
|
if (isConfigOfExtension) {
|