@sanity/pkg-utils 2.3.13-canary.0 → 2.3.13-canary.1
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/{src/node/resolveBuildTasks.cjs → _chunks/build-fabfa3af.cjs} +78 -6
- package/dist/_chunks/build-fabfa3af.cjs.map +1 -0
- package/dist/{src/cli/buildAction.cjs → _chunks/buildAction-dae78abb.cjs} +3 -6
- package/dist/_chunks/buildAction-dae78abb.cjs.map +1 -0
- package/dist/_chunks/check-332a2bb9.cjs +250 -0
- package/dist/_chunks/check-332a2bb9.cjs.map +1 -0
- package/dist/{src/cli/checkAction.cjs → _chunks/checkAction-c39d7dbf.cjs} +3 -6
- package/dist/_chunks/checkAction-c39d7dbf.cjs.map +1 -0
- package/dist/_chunks/consoleSpy-686c350b.cjs +590 -0
- package/dist/_chunks/consoleSpy-686c350b.cjs.map +1 -0
- package/dist/{src/cli/handleError.cjs → _chunks/handleError-13d87f55.cjs} +1 -4
- package/dist/_chunks/handleError-13d87f55.cjs.map +1 -0
- package/dist/_chunks/index-1811ae9f.cjs +883 -0
- package/dist/_chunks/index-1811ae9f.cjs.map +1 -0
- package/dist/{src/node/templates/default/template.cjs → _chunks/init-e45c0c31.cjs} +112 -23
- package/dist/_chunks/init-e45c0c31.cjs.map +1 -0
- package/dist/{src/cli/initAction.cjs → _chunks/initAction-48ce747a.cjs} +3 -6
- package/dist/_chunks/initAction-48ce747a.cjs.map +1 -0
- package/dist/_chunks/logger-718e11be.cjs +99 -0
- package/dist/_chunks/logger-718e11be.cjs.map +1 -0
- package/dist/_chunks/watch-4e565bee.cjs +231 -0
- package/dist/_chunks/watch-4e565bee.cjs.map +1 -0
- package/dist/{src/cli/watchAction.cjs → _chunks/watchAction-a5721084.cjs} +3 -6
- package/dist/_chunks/watchAction-a5721084.cjs.map +1 -0
- package/dist/cli.cjs +6 -6
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +30 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2564 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/node/core/config/types.ts +5 -0
- package/src/node/core/pkg/validatePkg.ts +2 -28
- package/src/node/tasks/rollup/resolveRollupConfig.ts +8 -6
- package/src/node/tasks/rollup/rollupTask.ts +13 -1
- package/dist/build.js +0 -69
- package/dist/build.js.map +0 -1
- package/dist/check.js +0 -152
- package/dist/check.js.map +0 -1
- package/dist/consoleSpy.js +0 -49
- package/dist/consoleSpy.js.map +0 -1
- package/dist/core/config/defineConfig.js +0 -5
- package/dist/core/config/defineConfig.js.map +0 -1
- package/dist/core/config/findConfigFile.js +0 -21
- package/dist/core/config/findConfigFile.js.map +0 -1
- package/dist/core/config/loadConfig.js +0 -34
- package/dist/core/config/loadConfig.js.map +0 -1
- package/dist/core/config/resolveConfigProperty.js +0 -9
- package/dist/core/config/resolveConfigProperty.js.map +0 -1
- package/dist/core/defaults.js +0 -3
- package/dist/core/defaults.js.map +0 -1
- package/dist/core/findCommonPath.js +0 -28
- package/dist/core/findCommonPath.js.map +0 -1
- package/dist/core/isRecord.js +0 -5
- package/dist/core/isRecord.js.map +0 -1
- package/dist/core/pkg/helpers.js +0 -24
- package/dist/core/pkg/helpers.js.map +0 -1
- package/dist/core/pkg/loadPkg.js +0 -18
- package/dist/core/pkg/loadPkg.js.map +0 -1
- package/dist/core/pkg/loadPkgWithReporting.js +0 -107
- package/dist/core/pkg/loadPkgWithReporting.js.map +0 -1
- package/dist/core/pkg/parseExports.js +0 -75
- package/dist/core/pkg/parseExports.js.map +0 -1
- package/dist/core/pkg/pkgExt.js +0 -29
- package/dist/core/pkg/pkgExt.js.map +0 -1
- package/dist/core/pkg/validateExports.js +0 -19
- package/dist/core/pkg/validateExports.js.map +0 -1
- package/dist/core/pkg/validatePkg.js +0 -49
- package/dist/core/pkg/validatePkg.js.map +0 -1
- package/dist/core/template/createFromTemplate.js +0 -59
- package/dist/core/template/createFromTemplate.js.map +0 -1
- package/dist/core/template/define.js +0 -5
- package/dist/core/template/define.js.map +0 -1
- package/dist/core/ts/loadTSConfig.js +0 -15
- package/dist/core/ts/loadTSConfig.js.map +0 -1
- package/dist/fileExists.js +0 -11
- package/dist/fileExists.js.map +0 -1
- package/dist/getFilesize.js +0 -8
- package/dist/getFilesize.js.map +0 -1
- package/dist/globFiles.js +0 -7
- package/dist/globFiles.js.map +0 -1
- package/dist/init.js +0 -42
- package/dist/init.js.map +0 -1
- package/dist/isEmptyDirectory.js +0 -6
- package/dist/isEmptyDirectory.js.map +0 -1
- package/dist/logger.js +0 -37
- package/dist/logger.js.map +0 -1
- package/dist/package.json.cjs +0 -8
- package/dist/package.json.cjs.map +0 -1
- package/dist/printExtractMessages.js +0 -32
- package/dist/printExtractMessages.js.map +0 -1
- package/dist/printPackageTree.js +0 -92
- package/dist/printPackageTree.js.map +0 -1
- package/dist/resolveBrowserTarget.js +0 -27
- package/dist/resolveBrowserTarget.js.map +0 -1
- package/dist/resolveBrowserslistVersions.js +0 -44
- package/dist/resolveBrowserslistVersions.js.map +0 -1
- package/dist/resolveBuildContext.js +0 -109
- package/dist/resolveBuildContext.js.map +0 -1
- package/dist/resolveBuildTasks.js +0 -140
- package/dist/resolveBuildTasks.js.map +0 -1
- package/dist/resolveNodeTarget.js +0 -12
- package/dist/resolveNodeTarget.js.map +0 -1
- package/dist/resolveWatchTasks.js +0 -103
- package/dist/resolveWatchTasks.js.map +0 -1
- package/dist/spinner.js +0 -15
- package/dist/spinner.js.map +0 -1
- package/dist/src/cli/buildAction.cjs.map +0 -1
- package/dist/src/cli/checkAction.cjs.map +0 -1
- package/dist/src/cli/handleError.cjs.map +0 -1
- package/dist/src/cli/initAction.cjs.map +0 -1
- package/dist/src/cli/watchAction.cjs.map +0 -1
- package/dist/src/node/build.cjs +0 -74
- package/dist/src/node/build.cjs.map +0 -1
- package/dist/src/node/check.cjs +0 -164
- package/dist/src/node/check.cjs.map +0 -1
- package/dist/src/node/consoleSpy.cjs +0 -54
- package/dist/src/node/consoleSpy.cjs.map +0 -1
- package/dist/src/node/core/config/defineConfig.cjs +0 -10
- package/dist/src/node/core/config/defineConfig.cjs.map +0 -1
- package/dist/src/node/core/config/findConfigFile.cjs +0 -33
- package/dist/src/node/core/config/findConfigFile.cjs.map +0 -1
- package/dist/src/node/core/config/loadConfig.cjs +0 -46
- package/dist/src/node/core/config/loadConfig.cjs.map +0 -1
- package/dist/src/node/core/config/resolveConfigProperty.cjs +0 -14
- package/dist/src/node/core/config/resolveConfigProperty.cjs.map +0 -1
- package/dist/src/node/core/defaults.cjs +0 -8
- package/dist/src/node/core/defaults.cjs.map +0 -1
- package/dist/src/node/core/findCommonPath.cjs +0 -40
- package/dist/src/node/core/findCommonPath.cjs.map +0 -1
- package/dist/src/node/core/isRecord.cjs +0 -10
- package/dist/src/node/core/isRecord.cjs.map +0 -1
- package/dist/src/node/core/pkg/helpers.cjs +0 -31
- package/dist/src/node/core/pkg/helpers.cjs.map +0 -1
- package/dist/src/node/core/pkg/loadPkg.cjs +0 -30
- package/dist/src/node/core/pkg/loadPkg.cjs.map +0 -1
- package/dist/src/node/core/pkg/loadPkgWithReporting.cjs +0 -118
- package/dist/src/node/core/pkg/loadPkgWithReporting.cjs.map +0 -1
- package/dist/src/node/core/pkg/parseExports.cjs +0 -80
- package/dist/src/node/core/pkg/parseExports.cjs.map +0 -1
- package/dist/src/node/core/pkg/pkgExt.cjs +0 -35
- package/dist/src/node/core/pkg/pkgExt.cjs.map +0 -1
- package/dist/src/node/core/pkg/validateExports.cjs +0 -24
- package/dist/src/node/core/pkg/validateExports.cjs.map +0 -1
- package/dist/src/node/core/pkg/validatePkg.cjs +0 -54
- package/dist/src/node/core/pkg/validatePkg.cjs.map +0 -1
- package/dist/src/node/core/template/createFromTemplate.cjs +0 -70
- package/dist/src/node/core/template/createFromTemplate.cjs.map +0 -1
- package/dist/src/node/core/template/define.cjs +0 -10
- package/dist/src/node/core/template/define.cjs.map +0 -1
- package/dist/src/node/core/ts/loadTSConfig.cjs +0 -26
- package/dist/src/node/core/ts/loadTSConfig.cjs.map +0 -1
- package/dist/src/node/fileExists.cjs +0 -16
- package/dist/src/node/fileExists.cjs.map +0 -1
- package/dist/src/node/getFilesize.cjs +0 -19
- package/dist/src/node/getFilesize.cjs.map +0 -1
- package/dist/src/node/globFiles.cjs +0 -19
- package/dist/src/node/globFiles.cjs.map +0 -1
- package/dist/src/node/init.cjs +0 -47
- package/dist/src/node/init.cjs.map +0 -1
- package/dist/src/node/isEmptyDirectory.cjs +0 -11
- package/dist/src/node/isEmptyDirectory.cjs.map +0 -1
- package/dist/src/node/logger.cjs +0 -48
- package/dist/src/node/logger.cjs.map +0 -1
- package/dist/src/node/printExtractMessages.cjs +0 -44
- package/dist/src/node/printExtractMessages.cjs.map +0 -1
- package/dist/src/node/printPackageTree.cjs +0 -105
- package/dist/src/node/printPackageTree.cjs.map +0 -1
- package/dist/src/node/resolveBrowserTarget.cjs +0 -32
- package/dist/src/node/resolveBrowserTarget.cjs.map +0 -1
- package/dist/src/node/resolveBrowserslistVersions.cjs +0 -55
- package/dist/src/node/resolveBrowserslistVersions.cjs.map +0 -1
- package/dist/src/node/resolveBuildContext.cjs +0 -120
- package/dist/src/node/resolveBuildContext.cjs.map +0 -1
- package/dist/src/node/resolveBuildTasks.cjs.map +0 -1
- package/dist/src/node/resolveNodeTarget.cjs +0 -17
- package/dist/src/node/resolveNodeTarget.cjs.map +0 -1
- package/dist/src/node/resolveWatchTasks.cjs +0 -115
- package/dist/src/node/resolveWatchTasks.cjs.map +0 -1
- package/dist/src/node/spinner.cjs +0 -26
- package/dist/src/node/spinner.cjs.map +0 -1
- package/dist/src/node/tasks/dts/DtsError.cjs +0 -17
- package/dist/src/node/tasks/dts/DtsError.cjs.map +0 -1
- package/dist/src/node/tasks/dts/buildTypes.cjs +0 -50
- package/dist/src/node/tasks/dts/buildTypes.cjs.map +0 -1
- package/dist/src/node/tasks/dts/createApiExtractorConfig.cjs +0 -52
- package/dist/src/node/tasks/dts/createApiExtractorConfig.cjs.map +0 -1
- package/dist/src/node/tasks/dts/createTSDocConfig.cjs +0 -37
- package/dist/src/node/tasks/dts/createTSDocConfig.cjs.map +0 -1
- package/dist/src/node/tasks/dts/doExtract.cjs +0 -88
- package/dist/src/node/tasks/dts/doExtract.cjs.map +0 -1
- package/dist/src/node/tasks/dts/dtsTask.cjs +0 -44
- package/dist/src/node/tasks/dts/dtsTask.cjs.map +0 -1
- package/dist/src/node/tasks/dts/dtsWatchTask.cjs +0 -47
- package/dist/src/node/tasks/dts/dtsWatchTask.cjs.map +0 -1
- package/dist/src/node/tasks/dts/extractModuleBlocks.cjs +0 -38
- package/dist/src/node/tasks/dts/extractModuleBlocks.cjs.map +0 -1
- package/dist/src/node/tasks/dts/extractTypes.cjs +0 -90
- package/dist/src/node/tasks/dts/extractTypes.cjs.map +0 -1
- package/dist/src/node/tasks/dts/getExtractMessagesConfig.cjs +0 -73
- package/dist/src/node/tasks/dts/getExtractMessagesConfig.cjs.map +0 -1
- package/dist/src/node/tasks/dts/printDiagnostic.cjs +0 -48
- package/dist/src/node/tasks/dts/printDiagnostic.cjs.map +0 -1
- package/dist/src/node/tasks/index.cjs +0 -26
- package/dist/src/node/tasks/index.cjs.map +0 -1
- package/dist/src/node/tasks/node/reexportCjsTask.cjs +0 -64
- package/dist/src/node/tasks/node/reexportCjsTask.cjs.map +0 -1
- package/dist/src/node/tasks/rollup/resolveRollupConfig.cjs +0 -207
- package/dist/src/node/tasks/rollup/resolveRollupConfig.cjs.map +0 -1
- package/dist/src/node/tasks/rollup/rollupTask.cjs +0 -116
- package/dist/src/node/tasks/rollup/rollupTask.cjs.map +0 -1
- package/dist/src/node/tasks/rollup/rollupWatchTask.cjs +0 -72
- package/dist/src/node/tasks/rollup/rollupWatchTask.cjs.map +0 -1
- package/dist/src/node/templates/default/template.cjs.map +0 -1
- package/dist/src/node/watch.cjs +0 -90
- package/dist/src/node/watch.cjs.map +0 -1
- package/dist/src/node/watchConfigFiles.cjs +0 -40
- package/dist/src/node/watchConfigFiles.cjs.map +0 -1
- package/dist/src/node/watchFiles.cjs +0 -33
- package/dist/src/node/watchFiles.cjs.map +0 -1
- package/dist/tasks/dts/DtsError.js +0 -12
- package/dist/tasks/dts/DtsError.js.map +0 -1
- package/dist/tasks/dts/buildTypes.js +0 -39
- package/dist/tasks/dts/buildTypes.js.map +0 -1
- package/dist/tasks/dts/createApiExtractorConfig.js +0 -41
- package/dist/tasks/dts/createApiExtractorConfig.js.map +0 -1
- package/dist/tasks/dts/createTSDocConfig.js +0 -32
- package/dist/tasks/dts/createTSDocConfig.js.map +0 -1
- package/dist/tasks/dts/doExtract.js +0 -76
- package/dist/tasks/dts/doExtract.js.map +0 -1
- package/dist/tasks/dts/dtsTask.js +0 -33
- package/dist/tasks/dts/dtsTask.js.map +0 -1
- package/dist/tasks/dts/dtsWatchTask.js +0 -36
- package/dist/tasks/dts/dtsWatchTask.js.map +0 -1
- package/dist/tasks/dts/extractModuleBlocks.js +0 -26
- package/dist/tasks/dts/extractModuleBlocks.js.map +0 -1
- package/dist/tasks/dts/extractTypes.js +0 -77
- package/dist/tasks/dts/extractTypes.js.map +0 -1
- package/dist/tasks/dts/getExtractMessagesConfig.js +0 -68
- package/dist/tasks/dts/getExtractMessagesConfig.js.map +0 -1
- package/dist/tasks/dts/printDiagnostic.js +0 -35
- package/dist/tasks/dts/printDiagnostic.js.map +0 -1
- package/dist/tasks/index.js +0 -16
- package/dist/tasks/index.js.map +0 -1
- package/dist/tasks/node/reexportCjsTask.js +0 -52
- package/dist/tasks/node/reexportCjsTask.js.map +0 -1
- package/dist/tasks/rollup/resolveRollupConfig.js +0 -189
- package/dist/tasks/rollup/resolveRollupConfig.js.map +0 -1
- package/dist/tasks/rollup/rollupTask.js +0 -104
- package/dist/tasks/rollup/rollupTask.js.map +0 -1
- package/dist/tasks/rollup/rollupWatchTask.js +0 -60
- package/dist/tasks/rollup/rollupWatchTask.js.map +0 -1
- package/dist/templates/default/template.js +0 -366
- package/dist/templates/default/template.js.map +0 -1
- package/dist/watch.js +0 -79
- package/dist/watch.js.map +0 -1
- package/dist/watchConfigFiles.js +0 -29
- package/dist/watchConfigFiles.js.map +0 -1
- package/dist/watchFiles.js +0 -22
- package/dist/watchFiles.js.map +0 -1
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var node = require('esbuild-register/dist/node');
|
|
4
|
+
var path = require('path');
|
|
5
|
+
var pkgUp = require('pkg-up');
|
|
6
|
+
var findConfig = require('find-config');
|
|
7
|
+
var logger = require('./logger-718e11be.cjs');
|
|
8
|
+
var chalk = require('chalk');
|
|
9
|
+
var zod = require('zod');
|
|
10
|
+
var fs = require('fs/promises');
|
|
11
|
+
require('fs');
|
|
12
|
+
require('mkdirp');
|
|
13
|
+
require('prompts');
|
|
14
|
+
var ts = require('typescript');
|
|
15
|
+
var browserslist = require('browserslist');
|
|
16
|
+
function _interopDefaultCompat(e) {
|
|
17
|
+
return e && typeof e === 'object' && 'default' in e ? e : {
|
|
18
|
+
default: e
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
var path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
22
|
+
var pkgUp__default = /*#__PURE__*/_interopDefaultCompat(pkgUp);
|
|
23
|
+
var findConfig__default = /*#__PURE__*/_interopDefaultCompat(findConfig);
|
|
24
|
+
var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
25
|
+
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
26
|
+
var ts__default = /*#__PURE__*/_interopDefaultCompat(ts);
|
|
27
|
+
var browserslist__default = /*#__PURE__*/_interopDefaultCompat(browserslist);
|
|
28
|
+
const CONFIG_FILE_NAMES = ["package.config.ts", "package.config.js", "package.config.cjs", "package.config.mjs"];
|
|
29
|
+
function findConfigFile(cwd) {
|
|
30
|
+
const pkgJsonPath = findConfig__default.default("package.json", {
|
|
31
|
+
cwd
|
|
32
|
+
});
|
|
33
|
+
if (!pkgJsonPath) return void 0;
|
|
34
|
+
const pkgPath = path__default.default.dirname(pkgJsonPath);
|
|
35
|
+
for (const fileName of CONFIG_FILE_NAMES) {
|
|
36
|
+
const configPath = path__default.default.resolve(pkgPath, fileName);
|
|
37
|
+
const exists = logger.fileExists(configPath);
|
|
38
|
+
if (exists) {
|
|
39
|
+
return configPath;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return void 0;
|
|
43
|
+
}
|
|
44
|
+
async function loadConfig(options) {
|
|
45
|
+
const {
|
|
46
|
+
cwd
|
|
47
|
+
} = options;
|
|
48
|
+
const pkgPath = await pkgUp__default.default({
|
|
49
|
+
cwd
|
|
50
|
+
});
|
|
51
|
+
if (!pkgPath) return void 0;
|
|
52
|
+
const root = path__default.default.dirname(pkgPath);
|
|
53
|
+
const configFile = await findConfigFile(root);
|
|
54
|
+
if (!configFile) {
|
|
55
|
+
return void 0;
|
|
56
|
+
}
|
|
57
|
+
if (!configFile.startsWith(cwd)) {
|
|
58
|
+
return void 0;
|
|
59
|
+
}
|
|
60
|
+
const esbuildOptions = {
|
|
61
|
+
extensions: [".js", ".mjs", ".ts"]
|
|
62
|
+
};
|
|
63
|
+
const {
|
|
64
|
+
unregister
|
|
65
|
+
} = globalThis.__DEV__ ? {
|
|
66
|
+
unregister: () => void 0
|
|
67
|
+
} : node.register(esbuildOptions);
|
|
68
|
+
const mod = require(configFile);
|
|
69
|
+
unregister();
|
|
70
|
+
return (mod == null ? void 0 : mod.default) || mod || void 0;
|
|
71
|
+
}
|
|
72
|
+
function resolveConfigProperty(prop, initialValue) {
|
|
73
|
+
if (!prop) return initialValue;
|
|
74
|
+
if (typeof prop === "function") {
|
|
75
|
+
return prop(initialValue);
|
|
76
|
+
}
|
|
77
|
+
return prop;
|
|
78
|
+
}
|
|
79
|
+
const DEFAULT_BROWSERSLIST_QUERY = ["> 0.2% and supports es6-module and supports es6-module-dynamic-import", "not dead", "not IE 11", "maintained node versions"];
|
|
80
|
+
async function loadPkg(options) {
|
|
81
|
+
const {
|
|
82
|
+
cwd
|
|
83
|
+
} = options;
|
|
84
|
+
const pkgPath = await pkgUp__default.default({
|
|
85
|
+
cwd
|
|
86
|
+
});
|
|
87
|
+
if (!pkgPath) throw new Error("no package.json found");
|
|
88
|
+
const buf = await fs__default.default.readFile(pkgPath);
|
|
89
|
+
const raw = JSON.parse(buf.toString());
|
|
90
|
+
logger.validatePkg(raw);
|
|
91
|
+
return raw;
|
|
92
|
+
}
|
|
93
|
+
function assertFirst(a, arr) {
|
|
94
|
+
const aIdx = arr.indexOf(a);
|
|
95
|
+
if (aIdx === -1) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
return aIdx === 0;
|
|
99
|
+
}
|
|
100
|
+
function assertLast(a, arr) {
|
|
101
|
+
const aIdx = arr.indexOf(a);
|
|
102
|
+
if (aIdx === -1) {
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
return aIdx === arr.length - 1;
|
|
106
|
+
}
|
|
107
|
+
function assertOrder(a, b, arr) {
|
|
108
|
+
const aIdx = arr.indexOf(a);
|
|
109
|
+
const bIdx = arr.indexOf(b);
|
|
110
|
+
if (aIdx === -1 || bIdx === -1) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
return aIdx < bIdx;
|
|
114
|
+
}
|
|
115
|
+
async function loadPkgWithReporting(options) {
|
|
116
|
+
const {
|
|
117
|
+
cwd,
|
|
118
|
+
logger
|
|
119
|
+
} = options;
|
|
120
|
+
try {
|
|
121
|
+
const pkg = await loadPkg({
|
|
122
|
+
cwd
|
|
123
|
+
});
|
|
124
|
+
let shouldError = false;
|
|
125
|
+
if (pkg.exports) {
|
|
126
|
+
const _exports = Object.entries(pkg.exports);
|
|
127
|
+
for (const [expPath, exp] of _exports) {
|
|
128
|
+
if (typeof exp === "string") {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const keys = Object.keys(exp);
|
|
132
|
+
if (!assertFirst("types", keys)) {
|
|
133
|
+
shouldError = true;
|
|
134
|
+
logger.error("exports[\"".concat(expPath, "\"]: the `types` property should be the first property"));
|
|
135
|
+
}
|
|
136
|
+
if (exp.node) {
|
|
137
|
+
const nodeKeys = Object.keys(exp.node);
|
|
138
|
+
if (!assertOrder("module", "import", nodeKeys)) {
|
|
139
|
+
shouldError = true;
|
|
140
|
+
logger.error("exports[\"".concat(expPath, "\"]: the `node.module` property should come before the `node.import` property"));
|
|
141
|
+
}
|
|
142
|
+
if (!assertOrder("import", "require", nodeKeys)) {
|
|
143
|
+
logger.warn("exports[\"".concat(expPath, "\"]: the `node.import` property should come before the `node.require` property"));
|
|
144
|
+
}
|
|
145
|
+
if (!assertOrder("module", "require", nodeKeys)) {
|
|
146
|
+
logger.warn("exports[\"".concat(expPath, "\"]: the `node.module` property should come before `node.require` property"));
|
|
147
|
+
}
|
|
148
|
+
if (exp.import && exp.node.import && !assertOrder("node", "import", keys)) {
|
|
149
|
+
shouldError = true;
|
|
150
|
+
logger.error("exports[\"".concat(expPath, "\"]: the `node` property should come before the `import` property"));
|
|
151
|
+
}
|
|
152
|
+
if (exp.module && exp.node.module && !assertOrder("node", "module", keys)) {
|
|
153
|
+
shouldError = true;
|
|
154
|
+
logger.error("exports[\"".concat(expPath, "\"]: the `node` property should come before the `module` property"));
|
|
155
|
+
}
|
|
156
|
+
if (exp.node.import && !exp.node.require && !exp.node.module) {
|
|
157
|
+
shouldError = true;
|
|
158
|
+
logger.error("exports[\"".concat(expPath, "\"]: the `node.module` property should be added so bundlers don't unintentionally try to bundle `node.import`"));
|
|
159
|
+
}
|
|
160
|
+
if (exp.node.import && !exp.node.require && exp.node.module && exp.import && exp.node.module !== exp.import) {
|
|
161
|
+
shouldError = true;
|
|
162
|
+
logger.error("exports[\"".concat(expPath, "\"]: the `node.module` property should match `import`"));
|
|
163
|
+
}
|
|
164
|
+
if (exp.require && exp.node.require && exp.require === exp.node.require) {
|
|
165
|
+
shouldError = true;
|
|
166
|
+
logger.error("exports[\"".concat(expPath, "\"]: the `node.require` property isn't necessary as it's identical to `require`"));
|
|
167
|
+
} else if (exp.require && exp.node.require && !assertOrder("node", "require", keys)) {
|
|
168
|
+
shouldError = true;
|
|
169
|
+
logger.error("exports[\"".concat(expPath, "\"]: the `node` property should come before the `require` property"));
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
if (!assertOrder("import", "require", keys)) {
|
|
173
|
+
logger.warn("exports[\"".concat(expPath, "\"]: the `import` property should come before the `require` property"));
|
|
174
|
+
}
|
|
175
|
+
if (!assertOrder("module", "import", keys)) {
|
|
176
|
+
logger.warn("exports[\"".concat(expPath, "\"]: the `module` property should come before `import` property"));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (!assertLast("default", keys)) {
|
|
180
|
+
shouldError = true;
|
|
181
|
+
logger.error("exports[\"".concat(expPath, "\"]: the `default` property should be the last property"));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (shouldError) {
|
|
186
|
+
process.exit(1);
|
|
187
|
+
}
|
|
188
|
+
return pkg;
|
|
189
|
+
} catch (err) {
|
|
190
|
+
if (err instanceof zod.ZodError) {
|
|
191
|
+
for (const issue of err.issues) {
|
|
192
|
+
if (issue.code === "invalid_type") {
|
|
193
|
+
logger.error(["`".concat(formatPath(issue.path), "` "), "in `./package.json` must be of type ".concat(chalk__default.default.magenta(issue.expected), " "), "(received ".concat(chalk__default.default.magenta(issue.received), ")")].join(""));
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
logger.error(issue);
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
logger.error(err);
|
|
200
|
+
}
|
|
201
|
+
process.exit(1);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function formatPath(segments) {
|
|
205
|
+
return segments.map((s, idx) => {
|
|
206
|
+
if (idx === 0) return s;
|
|
207
|
+
if (typeof s === "number") {
|
|
208
|
+
return "[".concat(s, "]");
|
|
209
|
+
}
|
|
210
|
+
if (s.startsWith(".")) {
|
|
211
|
+
return "[\"".concat(s, "\"]");
|
|
212
|
+
}
|
|
213
|
+
return ".".concat(s);
|
|
214
|
+
}).join("");
|
|
215
|
+
}
|
|
216
|
+
function validateExports(_exports, options) {
|
|
217
|
+
const {
|
|
218
|
+
extMap,
|
|
219
|
+
pkg
|
|
220
|
+
} = options;
|
|
221
|
+
const ext = extMap[pkg.type || "commonjs"];
|
|
222
|
+
const errors = [];
|
|
223
|
+
for (const exp of _exports) {
|
|
224
|
+
if (exp.require && !exp.require.endsWith(ext.commonjs)) {
|
|
225
|
+
errors.push("package.json with `type: \"".concat(pkg.type, "\"` - `exports[\"").concat(exp._path, "\"].require` must end with \"").concat(ext.commonjs, "\""));
|
|
226
|
+
}
|
|
227
|
+
if (exp.import && !exp.import.endsWith(ext.esm)) {
|
|
228
|
+
errors.push("package.json with `type: \"".concat(pkg.type, "\"` - `exports[\"").concat(exp._path, "\"].import` must end with \"").concat(ext.esm, "\""));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return errors;
|
|
232
|
+
}
|
|
233
|
+
function parseExports(options) {
|
|
234
|
+
const {
|
|
235
|
+
extMap,
|
|
236
|
+
pkg,
|
|
237
|
+
strict
|
|
238
|
+
} = options;
|
|
239
|
+
const rootExport = {
|
|
240
|
+
_exported: true,
|
|
241
|
+
_path: ".",
|
|
242
|
+
types: pkg.types,
|
|
243
|
+
source: pkg.source || "",
|
|
244
|
+
browser: pkg.browser && {
|
|
245
|
+
source: pkg.source || "",
|
|
246
|
+
require: pkg.main && pkg.browser[pkg.main],
|
|
247
|
+
import: pkg.module && pkg.browser[pkg.module]
|
|
248
|
+
},
|
|
249
|
+
require: pkg.main,
|
|
250
|
+
import: pkg.module,
|
|
251
|
+
default: pkg.module || pkg.main || ""
|
|
252
|
+
};
|
|
253
|
+
const extraExports = [];
|
|
254
|
+
const errors = [];
|
|
255
|
+
if (pkg.exports) {
|
|
256
|
+
if (strict && !pkg.exports["./package.json"]) {
|
|
257
|
+
errors.push('package.json: `exports["./package.json"] must be declared.');
|
|
258
|
+
}
|
|
259
|
+
for (const [exportPath, exportEntry] of Object.entries(pkg.exports)) {
|
|
260
|
+
if (exportPath.endsWith(".json")) {
|
|
261
|
+
if (exportPath === "./package.json") {
|
|
262
|
+
if (exportEntry !== "./package.json") {
|
|
263
|
+
errors.push('package.json: `exports["./package.json"] must be "./package.json".');
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
} else if (logger.isRecord(exportEntry)) {
|
|
267
|
+
if (exportPath === ".") {
|
|
268
|
+
if (exportEntry.require && rootExport.require && exportEntry.require !== rootExport.require) {
|
|
269
|
+
errors.push('package.json: mismatch between "main" and "exports.require". These must be equal.');
|
|
270
|
+
}
|
|
271
|
+
if (exportEntry.import && rootExport.import && exportEntry.import !== rootExport.import) {
|
|
272
|
+
errors.push('package.json: mismatch between "module" and "exports.import" These must be equal.');
|
|
273
|
+
}
|
|
274
|
+
if (exportEntry.types && rootExport.types && exportEntry.types !== rootExport.types) {
|
|
275
|
+
errors.push('package.json: mismatch between "types" and "exports.types". These must be equal.');
|
|
276
|
+
}
|
|
277
|
+
if (exportEntry.source && rootExport.source && exportEntry.source !== rootExport.source) {
|
|
278
|
+
errors.push('package.json: mismatch between "source" and "exports.source". These must be equal.');
|
|
279
|
+
}
|
|
280
|
+
Object.assign(rootExport, exportEntry);
|
|
281
|
+
} else {
|
|
282
|
+
const extraExport = {
|
|
283
|
+
_exported: true,
|
|
284
|
+
_path: exportPath,
|
|
285
|
+
...exportEntry
|
|
286
|
+
};
|
|
287
|
+
extraExports.push(extraExport);
|
|
288
|
+
}
|
|
289
|
+
} else {
|
|
290
|
+
errors.push("package.json: exports must be an object");
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
const _exports = [rootExport, ...extraExports];
|
|
295
|
+
errors.push(...validateExports(_exports, {
|
|
296
|
+
extMap,
|
|
297
|
+
pkg
|
|
298
|
+
}));
|
|
299
|
+
if (errors.length) {
|
|
300
|
+
throw new Error("\n- " + errors.join("\n- "));
|
|
301
|
+
}
|
|
302
|
+
return _exports;
|
|
303
|
+
}
|
|
304
|
+
const DEFAULT_PKG_EXT_MAP = {
|
|
305
|
+
// pkg.type: "commonjs"
|
|
306
|
+
commonjs: {
|
|
307
|
+
commonjs: ".js",
|
|
308
|
+
esm: ".mjs"
|
|
309
|
+
},
|
|
310
|
+
// pkg.type: "module"
|
|
311
|
+
module: {
|
|
312
|
+
commonjs: ".cjs",
|
|
313
|
+
esm: ".js"
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
function getPkgExtMap(options) {
|
|
317
|
+
const {
|
|
318
|
+
legacyExports
|
|
319
|
+
} = options;
|
|
320
|
+
const ret = {
|
|
321
|
+
...DEFAULT_PKG_EXT_MAP
|
|
322
|
+
};
|
|
323
|
+
if (legacyExports) {
|
|
324
|
+
ret["commonjs"] = {
|
|
325
|
+
commonjs: ".js",
|
|
326
|
+
esm: ".esm.js"
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
return ret;
|
|
330
|
+
}
|
|
331
|
+
async function loadTSConfig(options) {
|
|
332
|
+
const {
|
|
333
|
+
cwd,
|
|
334
|
+
tsconfigPath
|
|
335
|
+
} = options;
|
|
336
|
+
const configPath = ts__default.default.findConfigFile(cwd, ts__default.default.sys.fileExists, tsconfigPath);
|
|
337
|
+
if (!configPath) {
|
|
338
|
+
throw new Error("could not find a valid '".concat(tsconfigPath, "'"));
|
|
339
|
+
}
|
|
340
|
+
const configFile = ts__default.default.readConfigFile(configPath, ts__default.default.sys.readFile);
|
|
341
|
+
return ts__default.default.parseJsonConfigFileContent(configFile.config, ts__default.default.sys, cwd);
|
|
342
|
+
}
|
|
343
|
+
function pathContains(containerPath, itemPath) {
|
|
344
|
+
return !path__default.default.relative(containerPath, itemPath).startsWith("..");
|
|
345
|
+
}
|
|
346
|
+
function findCommonDirPath(filePaths) {
|
|
347
|
+
let ret = void 0;
|
|
348
|
+
for (const filePath of filePaths) {
|
|
349
|
+
let dirPath = path__default.default.dirname(filePath);
|
|
350
|
+
if (!ret) {
|
|
351
|
+
ret = dirPath;
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
while (dirPath !== ret) {
|
|
355
|
+
dirPath = path__default.default.dirname(dirPath);
|
|
356
|
+
if (dirPath === ret) {
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
if (pathContains(dirPath, ret)) {
|
|
360
|
+
ret = dirPath;
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
if (dirPath === ".") return void 0;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return ret;
|
|
367
|
+
}
|
|
368
|
+
function sortAsNumber(a, b) {
|
|
369
|
+
const aVersion = Number(a);
|
|
370
|
+
const bVersion = Number(b);
|
|
371
|
+
return aVersion - bVersion;
|
|
372
|
+
}
|
|
373
|
+
function resolveBrowserslistVersions(query) {
|
|
374
|
+
const result = browserslist__default.default(query);
|
|
375
|
+
const entries = result.map(key => {
|
|
376
|
+
const [name, version] = key.split(" ");
|
|
377
|
+
return {
|
|
378
|
+
name,
|
|
379
|
+
version: version.split("-")[0].split(".")[0]
|
|
380
|
+
};
|
|
381
|
+
});
|
|
382
|
+
const andChr = entries.filter(b => b.name === "and_chr");
|
|
383
|
+
const andFf = entries.filter(b => b.name === "and_ff");
|
|
384
|
+
const chrome = entries.filter(b => b.name === "chrome");
|
|
385
|
+
const edge = entries.filter(b => b.name === "edge");
|
|
386
|
+
const ff = entries.filter(b => b.name === "firefox");
|
|
387
|
+
const iosSaf = entries.filter(b => b.name === "ios_saf");
|
|
388
|
+
const saf = entries.filter(b => b.name === "safari");
|
|
389
|
+
const opera = entries.filter(b => b.name === "opera");
|
|
390
|
+
const node = entries.filter(b => b.name === "node");
|
|
391
|
+
const versions = {
|
|
392
|
+
chrome: andChr.concat(chrome).map(b => b.version),
|
|
393
|
+
ff: andFf.concat(ff).map(b => b.version),
|
|
394
|
+
edge: edge.map(b => b.version),
|
|
395
|
+
iosSaf: iosSaf.map(b => b.version),
|
|
396
|
+
saf: saf.map(b => b.version),
|
|
397
|
+
opera: opera.map(b => b.version),
|
|
398
|
+
node: node.map(b => b.version)
|
|
399
|
+
};
|
|
400
|
+
versions.chrome.sort(sortAsNumber);
|
|
401
|
+
versions.ff.sort(sortAsNumber);
|
|
402
|
+
versions.edge.sort(sortAsNumber);
|
|
403
|
+
versions.iosSaf.sort(sortAsNumber);
|
|
404
|
+
versions.saf.sort(sortAsNumber);
|
|
405
|
+
versions.opera.sort(sortAsNumber);
|
|
406
|
+
versions.node.sort(sortAsNumber);
|
|
407
|
+
return versions;
|
|
408
|
+
}
|
|
409
|
+
function resolveBrowserTarget(versions) {
|
|
410
|
+
const target = [];
|
|
411
|
+
if (versions.chrome.length) {
|
|
412
|
+
target.push("chrome".concat(versions.chrome[0]));
|
|
413
|
+
}
|
|
414
|
+
if (versions.ff.length) {
|
|
415
|
+
target.push("firefox".concat(versions.ff[0]));
|
|
416
|
+
}
|
|
417
|
+
if (versions.edge.length) {
|
|
418
|
+
target.push("edge".concat(versions.edge[0]));
|
|
419
|
+
}
|
|
420
|
+
if (versions.iosSaf.length) {
|
|
421
|
+
target.push("ios".concat(versions.iosSaf[0]));
|
|
422
|
+
}
|
|
423
|
+
if (versions.saf.length) {
|
|
424
|
+
target.push("safari".concat(versions.saf[0]));
|
|
425
|
+
}
|
|
426
|
+
if (versions.opera.length) {
|
|
427
|
+
target.push("opera".concat(versions.opera[0]));
|
|
428
|
+
}
|
|
429
|
+
if (target.length === 0) {
|
|
430
|
+
return void 0;
|
|
431
|
+
}
|
|
432
|
+
return target;
|
|
433
|
+
}
|
|
434
|
+
function resolveNodeTarget(versions) {
|
|
435
|
+
const target = [];
|
|
436
|
+
if (versions.node.length) {
|
|
437
|
+
target.push("node".concat(versions.node[0]));
|
|
438
|
+
}
|
|
439
|
+
if (target.length === 0) {
|
|
440
|
+
return void 0;
|
|
441
|
+
}
|
|
442
|
+
return target;
|
|
443
|
+
}
|
|
444
|
+
async function resolveBuildContext(options) {
|
|
445
|
+
var _ref;
|
|
446
|
+
const {
|
|
447
|
+
config,
|
|
448
|
+
cwd,
|
|
449
|
+
emitDeclarationOnly = false,
|
|
450
|
+
extMap,
|
|
451
|
+
logger,
|
|
452
|
+
pkg,
|
|
453
|
+
strict,
|
|
454
|
+
tsconfig: tsconfigPath
|
|
455
|
+
} = options;
|
|
456
|
+
const tsconfig = await loadTSConfig({
|
|
457
|
+
cwd,
|
|
458
|
+
tsconfigPath
|
|
459
|
+
});
|
|
460
|
+
const targetVersions = resolveBrowserslistVersions(pkg.browserslist || DEFAULT_BROWSERSLIST_QUERY);
|
|
461
|
+
const nodeTarget = resolveNodeTarget(targetVersions);
|
|
462
|
+
const webTarget = resolveBrowserTarget(targetVersions);
|
|
463
|
+
if (!nodeTarget) {
|
|
464
|
+
throw new Error("no matching `node` target");
|
|
465
|
+
}
|
|
466
|
+
if (!webTarget) {
|
|
467
|
+
throw new Error("no matching `web` target");
|
|
468
|
+
}
|
|
469
|
+
const target = {
|
|
470
|
+
"*": webTarget.concat(nodeTarget),
|
|
471
|
+
browser: webTarget,
|
|
472
|
+
node: nodeTarget
|
|
473
|
+
};
|
|
474
|
+
const parsedExports = parseExports({
|
|
475
|
+
extMap,
|
|
476
|
+
pkg,
|
|
477
|
+
strict
|
|
478
|
+
}).reduce((acc, x) => {
|
|
479
|
+
const {
|
|
480
|
+
_path: exportPath,
|
|
481
|
+
...exportEntry
|
|
482
|
+
} = x;
|
|
483
|
+
return {
|
|
484
|
+
...acc,
|
|
485
|
+
[exportPath]: exportEntry
|
|
486
|
+
};
|
|
487
|
+
}, {});
|
|
488
|
+
const exports = resolveConfigProperty(config == null ? void 0 : config.exports, parsedExports);
|
|
489
|
+
const parsedExternal = [...(pkg.dependencies ? Object.keys(pkg.dependencies) : []), ...(pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [])];
|
|
490
|
+
const external = config && Array.isArray(config.external) ? [...parsedExternal, ...config.external] : resolveConfigProperty(config == null ? void 0 : config.external, parsedExternal);
|
|
491
|
+
const outputPaths = Object.values(exports).flatMap(exportEntry => {
|
|
492
|
+
var _a, _b, _c, _d;
|
|
493
|
+
return [exportEntry.import, exportEntry.require, (_a = exportEntry.browser) == null ? void 0 : _a.import, (_b = exportEntry.browser) == null ? void 0 : _b.require, ((_c = exportEntry.node) == null ? void 0 : _c.source) && exportEntry.node.import, ((_d = exportEntry.node) == null ? void 0 : _d.source) && exportEntry.node.require].filter(Boolean);
|
|
494
|
+
}).map(p => path__default.default.resolve(cwd, p));
|
|
495
|
+
const commonDistPath = findCommonDirPath(outputPaths);
|
|
496
|
+
if (commonDistPath === cwd) {
|
|
497
|
+
throw new Error("all output files must share a common parent directory which is not the root package directory");
|
|
498
|
+
}
|
|
499
|
+
if (commonDistPath && !pathContains(cwd, commonDistPath)) {
|
|
500
|
+
throw new Error("all output files must be located within the package");
|
|
501
|
+
}
|
|
502
|
+
const configDistPath = (config == null ? void 0 : config.dist) ? path__default.default.resolve(cwd, config.dist) : void 0;
|
|
503
|
+
if (configDistPath && commonDistPath && configDistPath !== commonDistPath && !pathContains(configDistPath, commonDistPath)) {
|
|
504
|
+
logger.log("did you mean to configure `dist: './".concat(path__default.default.relative(cwd, commonDistPath), "'`?"));
|
|
505
|
+
throw new Error("all output files must be located with the configured `dist` path");
|
|
506
|
+
}
|
|
507
|
+
const distPath = configDistPath || commonDistPath;
|
|
508
|
+
if (!distPath) {
|
|
509
|
+
throw new Error("could not detect `dist` path");
|
|
510
|
+
}
|
|
511
|
+
const ctx = {
|
|
512
|
+
config,
|
|
513
|
+
cwd,
|
|
514
|
+
distPath,
|
|
515
|
+
emitDeclarationOnly,
|
|
516
|
+
exports,
|
|
517
|
+
external,
|
|
518
|
+
extMap,
|
|
519
|
+
files: [],
|
|
520
|
+
logger,
|
|
521
|
+
pkg,
|
|
522
|
+
runtime: (_ref = config == null ? void 0 : config.runtime) !== null && _ref !== void 0 ? _ref : "*",
|
|
523
|
+
strict,
|
|
524
|
+
target,
|
|
525
|
+
ts: {
|
|
526
|
+
config: tsconfig,
|
|
527
|
+
configPath: tsconfigPath
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
return ctx;
|
|
531
|
+
}
|
|
532
|
+
function createConsoleSpy(options) {
|
|
533
|
+
const {
|
|
534
|
+
onRestored
|
|
535
|
+
} = options || {};
|
|
536
|
+
const original = {
|
|
537
|
+
log: console.log,
|
|
538
|
+
warn: console.warn,
|
|
539
|
+
error: console.error
|
|
540
|
+
};
|
|
541
|
+
const messages = [];
|
|
542
|
+
console.log = function () {
|
|
543
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
544
|
+
args[_key] = arguments[_key];
|
|
545
|
+
}
|
|
546
|
+
return messages.push({
|
|
547
|
+
type: "log",
|
|
548
|
+
args
|
|
549
|
+
});
|
|
550
|
+
};
|
|
551
|
+
console.warn = function () {
|
|
552
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
553
|
+
args[_key2] = arguments[_key2];
|
|
554
|
+
}
|
|
555
|
+
return messages.push({
|
|
556
|
+
type: "warn",
|
|
557
|
+
args
|
|
558
|
+
});
|
|
559
|
+
};
|
|
560
|
+
console.error = function () {
|
|
561
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
562
|
+
args[_key3] = arguments[_key3];
|
|
563
|
+
}
|
|
564
|
+
return messages.push({
|
|
565
|
+
type: "error",
|
|
566
|
+
args
|
|
567
|
+
});
|
|
568
|
+
};
|
|
569
|
+
return {
|
|
570
|
+
messages,
|
|
571
|
+
restore: () => {
|
|
572
|
+
console.log = original.log;
|
|
573
|
+
console.warn = original.warn;
|
|
574
|
+
console.error = original.error;
|
|
575
|
+
onRestored == null ? void 0 : onRestored(messages);
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
exports.DEFAULT_BROWSERSLIST_QUERY = DEFAULT_BROWSERSLIST_QUERY;
|
|
580
|
+
exports.DEFAULT_PKG_EXT_MAP = DEFAULT_PKG_EXT_MAP;
|
|
581
|
+
exports.createConsoleSpy = createConsoleSpy;
|
|
582
|
+
exports.getPkgExtMap = getPkgExtMap;
|
|
583
|
+
exports.loadConfig = loadConfig;
|
|
584
|
+
exports.loadPkg = loadPkg;
|
|
585
|
+
exports.loadPkgWithReporting = loadPkgWithReporting;
|
|
586
|
+
exports.loadTSConfig = loadTSConfig;
|
|
587
|
+
exports.parseExports = parseExports;
|
|
588
|
+
exports.resolveBuildContext = resolveBuildContext;
|
|
589
|
+
exports.resolveConfigProperty = resolveConfigProperty;
|
|
590
|
+
//# sourceMappingURL=consoleSpy-686c350b.cjs.map
|