@sanity/pkg-utils 1.6.0 → 1.7.2
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/{__resolveBuildContext-bc09bff3.cjs → __resolveBuildContext-9b0aa9f9.cjs} +218 -104
- package/dist/__resolveBuildContext-9b0aa9f9.cjs.map +1 -0
- package/dist/{_build-89aeaf6a.cjs → _build-6e7deb31.cjs} +82 -47
- package/dist/_build-6e7deb31.cjs.map +1 -0
- package/dist/{_buildAction-8855cb5a.cjs → _buildAction-d8841b41.cjs} +35 -8
- package/dist/_buildAction-d8841b41.cjs.map +1 -0
- package/dist/_check-04a1f749.cjs +242 -0
- package/dist/_check-04a1f749.cjs.map +1 -0
- package/dist/{_checkAction-a96c4021.cjs → _checkAction-09426a13.cjs} +17 -4
- package/dist/_checkAction-09426a13.cjs.map +1 -0
- package/dist/{_index-0e8b664d.cjs → _index-46cab21c.cjs} +331 -202
- package/dist/_index-46cab21c.cjs.map +1 -0
- package/dist/_watch-cf9c717f.cjs +264 -0
- package/dist/_watch-cf9c717f.cjs.map +1 -0
- package/dist/{_watchAction-bd901b01.cjs → _watchAction-5941527f.cjs} +38 -4
- package/dist/_watchAction-5941527f.cjs.map +1 -0
- package/dist/cli.cjs +24 -9
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +49 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +763 -500
- package/dist/index.js.map +1 -1
- package/package.json +15 -9
- package/src/node/_core/config/_loadConfig.ts +5 -0
- package/src/node/_core/config/types.ts +3 -2
- package/src/node/_core/pkg/_loadPkg.ts +2 -1
- package/src/node/_core/pkg/_parseExports.ts +4 -3
- package/src/node/_core/pkg/_types.ts +3 -2
- package/src/node/_printPackageTree.ts +3 -1
- package/src/node/_resolveBuildTasks.ts +1 -3
- package/src/node/_resolveWatchTasks.ts +1 -3
- package/src/node/_spinner.ts +5 -13
- package/src/node/_tasks/rollup/_resolveRollupConfig.ts +26 -3
- package/src/node/build.ts +0 -3
- package/dist/__printPackageTree-3ff3ecd3.cjs +0 -76
- package/dist/__printPackageTree-3ff3ecd3.cjs.map +0 -1
- package/dist/__resolveBuildContext-bc09bff3.cjs.map +0 -1
- package/dist/_build-89aeaf6a.cjs.map +0 -1
- package/dist/_buildAction-8855cb5a.cjs.map +0 -1
- package/dist/_check-0ebe9af4.cjs +0 -118
- package/dist/_check-0ebe9af4.cjs.map +0 -1
- package/dist/_checkAction-a96c4021.cjs.map +0 -1
- package/dist/_index-0e8b664d.cjs.map +0 -1
- package/dist/_watch-cf0df170.cjs +0 -219
- package/dist/_watch-cf0df170.cjs.map +0 -1
- package/dist/_watchAction-bd901b01.cjs.map +0 -1
- package/src/node/_resolveEsTarget.ts +0 -39
|
@@ -1,33 +1,56 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
9
|
+
var _resolveBuildContext = require('./__resolveBuildContext-9b0aa9f9.cjs');
|
|
10
|
+
|
|
4
11
|
require('typescript');
|
|
5
|
-
|
|
12
|
+
|
|
6
13
|
var fs = require('fs');
|
|
14
|
+
|
|
7
15
|
var path = require('path');
|
|
8
|
-
|
|
16
|
+
|
|
9
17
|
var chalk = require('chalk');
|
|
10
|
-
var ora = require('ora');
|
|
11
18
|
|
|
12
|
-
|
|
19
|
+
var index = require('./_index-46cab21c.cjs');
|
|
20
|
+
|
|
21
|
+
function _interopDefaultLegacy(e) {
|
|
22
|
+
return e && typeof e === 'object' && 'default' in e ? e : {
|
|
23
|
+
'default': e
|
|
24
|
+
};
|
|
25
|
+
}
|
|
13
26
|
|
|
14
27
|
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
28
|
+
|
|
15
29
|
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
30
|
+
|
|
16
31
|
var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
|
|
17
|
-
var ora__default = /*#__PURE__*/_interopDefaultLegacy(ora);
|
|
18
32
|
|
|
19
33
|
function _resolveBuildTasks(ctx) {
|
|
20
34
|
var _a, _b, _c, _d, _e;
|
|
21
|
-
|
|
22
|
-
const
|
|
35
|
+
|
|
36
|
+
const {
|
|
37
|
+
cwd,
|
|
38
|
+
pkg,
|
|
39
|
+
target
|
|
40
|
+
} = ctx;
|
|
23
41
|
const tasks = [];
|
|
24
|
-
const exports = Object.entries(ctx.exports || {}).map(
|
|
25
|
-
|
|
26
|
-
|
|
42
|
+
const exports = Object.entries(ctx.exports || {}).map(_ref => {
|
|
43
|
+
let [_path, exp] = _ref;
|
|
44
|
+
return _objectSpread({
|
|
45
|
+
_path
|
|
46
|
+
}, exp);
|
|
47
|
+
});
|
|
27
48
|
const dtsTasks = {};
|
|
28
49
|
const rollupTasks = {};
|
|
50
|
+
|
|
29
51
|
function _addRollupTaskEntry(format, runtime, entry) {
|
|
30
|
-
const buildId =
|
|
52
|
+
const buildId = "".concat(format, ":").concat(runtime);
|
|
53
|
+
|
|
31
54
|
if (!rollupTasks[buildId]) {
|
|
32
55
|
rollupTasks[buildId] = {
|
|
33
56
|
type: "build:js",
|
|
@@ -35,14 +58,16 @@ function _resolveBuildTasks(ctx) {
|
|
|
35
58
|
entries: [entry],
|
|
36
59
|
runtime,
|
|
37
60
|
format,
|
|
38
|
-
target:
|
|
61
|
+
target: target[runtime]
|
|
39
62
|
};
|
|
40
63
|
} else {
|
|
41
64
|
rollupTasks[buildId].entries.push(entry);
|
|
42
65
|
}
|
|
43
66
|
}
|
|
67
|
+
|
|
44
68
|
for (const exp of exports) {
|
|
45
69
|
const importId = path__default["default"].join(pkg.name, exp._path);
|
|
70
|
+
|
|
46
71
|
if (exp.types) {
|
|
47
72
|
if (!dtsTasks[importId]) {
|
|
48
73
|
dtsTasks[importId] = {
|
|
@@ -55,97 +80,106 @@ function _resolveBuildTasks(ctx) {
|
|
|
55
80
|
}
|
|
56
81
|
}
|
|
57
82
|
}
|
|
83
|
+
|
|
58
84
|
for (const exp of exports) {
|
|
59
85
|
const output = exp.require;
|
|
60
|
-
if (!output)
|
|
61
|
-
|
|
86
|
+
if (!output) continue;
|
|
87
|
+
|
|
62
88
|
_addRollupTaskEntry("commonjs", ctx.runtime, {
|
|
63
89
|
path: exp._path,
|
|
64
90
|
source: exp.source,
|
|
65
91
|
output
|
|
66
92
|
});
|
|
67
93
|
}
|
|
94
|
+
|
|
68
95
|
for (const exp of exports) {
|
|
69
96
|
const output = (_a = exp.browser) == null ? void 0 : _a.require;
|
|
70
|
-
if (!output)
|
|
71
|
-
|
|
97
|
+
if (!output) continue;
|
|
98
|
+
|
|
72
99
|
_addRollupTaskEntry("commonjs", "browser", {
|
|
73
100
|
path: exp._path,
|
|
74
101
|
source: ((_b = exp.browser) == null ? void 0 : _b.source) || exp.source,
|
|
75
102
|
output
|
|
76
103
|
});
|
|
77
104
|
}
|
|
105
|
+
|
|
78
106
|
for (const exp of exports) {
|
|
79
107
|
const output = exp.import;
|
|
80
|
-
if (!output)
|
|
81
|
-
|
|
108
|
+
if (!output) continue;
|
|
109
|
+
|
|
82
110
|
_addRollupTaskEntry("esm", ctx.runtime, {
|
|
83
111
|
path: exp._path,
|
|
84
112
|
source: exp.source,
|
|
85
113
|
output
|
|
86
114
|
});
|
|
87
115
|
}
|
|
116
|
+
|
|
88
117
|
for (const exp of exports) {
|
|
89
118
|
const output = (_c = exp.browser) == null ? void 0 : _c.import;
|
|
90
|
-
if (!output)
|
|
91
|
-
|
|
119
|
+
if (!output) continue;
|
|
120
|
+
|
|
92
121
|
_addRollupTaskEntry("esm", "browser", {
|
|
93
122
|
path: exp._path,
|
|
94
123
|
source: ((_d = exp.browser) == null ? void 0 : _d.source) || exp.source,
|
|
95
124
|
output
|
|
96
125
|
});
|
|
97
126
|
}
|
|
127
|
+
|
|
98
128
|
tasks.push(...Object.values(dtsTasks));
|
|
99
129
|
tasks.push(...Object.values(rollupTasks));
|
|
130
|
+
|
|
100
131
|
for (const exp of exports) {
|
|
101
132
|
if (exp._exported && exp._path !== ".") {
|
|
102
133
|
const relativeTargetPath = (((_e = exp.browser) == null ? void 0 : _e.import) || exp.import || "").replace(/\.[^/.]+$/, "");
|
|
134
|
+
|
|
103
135
|
if (relativeTargetPath) {
|
|
104
|
-
fs__default["default"].writeFileSync(
|
|
105
|
-
path__default["default"].resolve(cwd, `${exp._path}.js`),
|
|
106
|
-
[
|
|
107
|
-
`// AUTO-GENERATED \u2013 DO NOT EDIT`,
|
|
108
|
-
``,
|
|
109
|
-
`export * from '${relativeTargetPath}'`,
|
|
110
|
-
``
|
|
111
|
-
].join("\n")
|
|
112
|
-
);
|
|
136
|
+
fs__default["default"].writeFileSync(path__default["default"].resolve(cwd, "".concat(exp._path, ".js")), ["// AUTO-GENERATED \u2013 DO NOT EDIT", "", "export * from '".concat(relativeTargetPath, "'"), ""].join("\n"));
|
|
113
137
|
}
|
|
114
138
|
}
|
|
115
139
|
}
|
|
140
|
+
|
|
116
141
|
return tasks;
|
|
117
142
|
}
|
|
118
143
|
|
|
119
144
|
function _spinner(msg) {
|
|
120
145
|
const startTime = Date.now();
|
|
121
|
-
|
|
122
|
-
spinner: "dots",
|
|
123
|
-
text: `${chalk__default["default"].yellow("run ")} ${msg}`
|
|
124
|
-
});
|
|
125
|
-
spinner.color = "yellow";
|
|
126
|
-
spinner.start();
|
|
146
|
+
console.log("".concat(chalk__default["default"].yellow("run "), " ").concat(msg));
|
|
127
147
|
return {
|
|
128
148
|
complete: () => {
|
|
129
|
-
|
|
130
|
-
spinner.succeed(`${chalk__default["default"].green("ok ")} ${msg} ${chalk__default["default"].gray(`${Date.now() - startTime}ms`)}`);
|
|
149
|
+
console.log("".concat(chalk__default["default"].green("ok "), " ").concat(chalk__default["default"].gray("".concat(Date.now() - startTime, "ms"))));
|
|
131
150
|
},
|
|
132
151
|
error: () => {
|
|
133
|
-
|
|
134
|
-
spinner.fail(chalk__default["default"].red(`${msg} failed ${chalk__default["default"].gray(`${Date.now() - startTime}ms`)}`));
|
|
152
|
+
console.log("".concat(chalk__default["default"].red("failed"), " ").concat(chalk__default["default"].gray("".concat(Date.now() - startTime, "ms"))));
|
|
135
153
|
}
|
|
136
154
|
};
|
|
137
155
|
}
|
|
138
156
|
|
|
139
157
|
async function build(options) {
|
|
140
|
-
const {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
158
|
+
const {
|
|
159
|
+
cwd,
|
|
160
|
+
tsconfig = "tsconfig.json"
|
|
161
|
+
} = options;
|
|
162
|
+
const pkg = await _resolveBuildContext._loadPkgWithReporting({
|
|
163
|
+
cwd
|
|
164
|
+
});
|
|
165
|
+
const config = await _resolveBuildContext._loadConfig({
|
|
166
|
+
cwd
|
|
167
|
+
});
|
|
168
|
+
const ctx = await _resolveBuildContext._resolveBuildContext({
|
|
169
|
+
config,
|
|
170
|
+
cwd,
|
|
171
|
+
pkg,
|
|
172
|
+
tsconfig
|
|
173
|
+
});
|
|
174
|
+
|
|
144
175
|
const buildTasks = _resolveBuildTasks(ctx);
|
|
176
|
+
|
|
145
177
|
for (const task of buildTasks) {
|
|
146
178
|
const handler = index._buildTaskHandlers[task.type];
|
|
147
179
|
const taskName = handler.name(ctx, task);
|
|
180
|
+
|
|
148
181
|
const spinner = _spinner(taskName);
|
|
182
|
+
|
|
149
183
|
try {
|
|
150
184
|
const result = await handler.exec(ctx, task).toPromise();
|
|
151
185
|
spinner.complete();
|
|
@@ -153,18 +187,19 @@ async function build(options) {
|
|
|
153
187
|
handler.complete(ctx, task, result);
|
|
154
188
|
} catch (err) {
|
|
155
189
|
spinner.error();
|
|
190
|
+
|
|
156
191
|
if (err instanceof Error) {
|
|
157
|
-
const RE_CWD = new RegExp(
|
|
192
|
+
const RE_CWD = new RegExp("".concat(cwd), "g");
|
|
158
193
|
ctx.logger.error(err.message.replace(RE_CWD, "."));
|
|
159
194
|
ctx.logger.log();
|
|
160
195
|
}
|
|
196
|
+
|
|
161
197
|
handler.error(ctx, task, err);
|
|
162
198
|
process.exit(1);
|
|
163
199
|
}
|
|
164
200
|
}
|
|
165
|
-
_printPackageTree._printPackageTree(ctx);
|
|
166
201
|
}
|
|
167
202
|
|
|
168
203
|
exports._resolveBuildTasks = _resolveBuildTasks;
|
|
169
204
|
exports.build = build;
|
|
170
|
-
//# sourceMappingURL=_build-
|
|
205
|
+
//# sourceMappingURL=_build-6e7deb31.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_build-6e7deb31.cjs","sources":["../src/node/_resolveBuildTasks.ts","../src/node/_spinner.ts","../src/node/build.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\nimport {PkgExport, PkgFormat, PkgRuntime, _BuildContext} from './_core'\nimport {_BuildTask, _DtsTask, _RollupTask, _RollupTaskEntry} from './_tasks'\n\n/** @internal */\nexport function _resolveBuildTasks(ctx: _BuildContext): _BuildTask[] {\n const {cwd, pkg, target} = ctx\n\n const tasks: _BuildTask[] = []\n\n const exports = Object.entries(ctx.exports || {}).map(\n ([_path, exp]) => ({_path, ...exp} as PkgExport & {_path: string})\n )\n\n const dtsTasks: Record<string, _DtsTask> = {}\n const rollupTasks: Record<string, _RollupTask> = {}\n\n function _addRollupTaskEntry(format: PkgFormat, runtime: PkgRuntime, entry: _RollupTaskEntry) {\n const buildId = `${format}:${runtime}`\n\n if (!rollupTasks[buildId]) {\n rollupTasks[buildId] = {\n type: 'build:js',\n buildId,\n entries: [entry],\n runtime,\n format,\n target: target[runtime],\n }\n } else {\n rollupTasks[buildId].entries.push(entry)\n }\n }\n\n // Parse `dts` tasks\n for (const exp of exports) {\n const importId = path.join(pkg.name, exp._path)\n\n if (exp.types) {\n if (!dtsTasks[importId]) {\n dtsTasks[importId] = {\n type: 'build:dts',\n importId,\n exportPath: exp._path,\n sourcePath: exp.source,\n targetPath: exp.types,\n }\n }\n }\n }\n\n // Parse rollup:commonjs:* tasks\n for (const exp of exports) {\n const output = exp.require\n\n if (!output) continue\n\n _addRollupTaskEntry('commonjs', ctx.runtime, {\n path: exp._path,\n source: exp.source,\n output,\n })\n }\n\n // Parse rollup:commonjs:browser tasks\n for (const exp of exports) {\n const output = exp.browser?.require\n\n if (!output) continue\n\n _addRollupTaskEntry('commonjs', 'browser', {\n path: exp._path,\n source: exp.browser?.source || exp.source,\n output,\n })\n }\n\n // Parse rollup:esm:* tasks\n for (const exp of exports) {\n const output = exp.import\n\n if (!output) continue\n\n _addRollupTaskEntry('esm', ctx.runtime, {\n path: exp._path,\n source: exp.source,\n output,\n })\n }\n\n // Parse rollup:esm:browser tasks\n for (const exp of exports) {\n const output = exp.browser?.import\n\n if (!output) continue\n\n _addRollupTaskEntry('esm', 'browser', {\n path: exp._path,\n source: exp.browser?.source || exp.source,\n output,\n })\n }\n\n tasks.push(...Object.values(dtsTasks))\n tasks.push(...Object.values(rollupTasks))\n\n // Parse rollup:esm:browser tasks\n for (const exp of exports) {\n if (exp._exported && exp._path !== '.') {\n const relativeTargetPath = (exp.browser?.import || exp.import || '').replace(/\\.[^/.]+$/, '')\n\n if (relativeTargetPath) {\n fs.writeFileSync(\n path.resolve(cwd, `${exp._path}.js`),\n [\n `// AUTO-GENERATED – DO NOT EDIT`,\n ``,\n // `export {default} from '${relativeTargetPath}'`,\n `export * from '${relativeTargetPath}'`,\n ``,\n ].join('\\n')\n )\n }\n }\n }\n\n return tasks\n}\n","/* eslint-disable no-console */\n\nimport chalk from 'chalk'\n\nexport function _spinner(msg: string): {complete: () => void; error: () => void} {\n const startTime = Date.now()\n\n console.log(`${chalk.yellow('run ')} ${msg}`)\n\n return {\n complete: () => {\n console.log(`${chalk.green('ok ')} ${chalk.gray(`${Date.now() - startTime}ms`)}`)\n },\n error: () => {\n console.log(`${chalk.red(`failed`)} ${chalk.gray(`${Date.now() - startTime}ms`)}`)\n },\n }\n}\n","import {_loadConfig, _loadPkgWithReporting} from './_core'\nimport {_resolveBuildContext} from './_resolveBuildContext'\nimport {_resolveBuildTasks} from './_resolveBuildTasks'\nimport {_spinner} from './_spinner'\nimport {_BuildTask, _TaskHandler, _buildTaskHandlers} from './_tasks'\n\n/** @public */\nexport async function build(options: {cwd: string; tsconfig?: string}): Promise<void> {\n const {cwd, tsconfig = 'tsconfig.json'} = options\n\n const pkg = await _loadPkgWithReporting({cwd})\n const config = await _loadConfig({cwd})\n\n const ctx = await _resolveBuildContext({config, cwd, pkg, tsconfig})\n\n const buildTasks = _resolveBuildTasks(ctx)\n\n for (const task of buildTasks) {\n const handler = _buildTaskHandlers[task.type] as _TaskHandler<_BuildTask>\n const taskName = handler.name(ctx, task)\n\n const spinner = _spinner(taskName)\n\n try {\n const result = await handler.exec(ctx, task).toPromise()\n\n spinner.complete()\n ctx.logger.log()\n\n handler.complete(ctx, task, result)\n } catch (err) {\n spinner.error()\n\n if (err instanceof Error) {\n const RE_CWD = new RegExp(`${cwd}`, 'g')\n\n ctx.logger.error(err.message.replace(RE_CWD, '.'))\n ctx.logger.log()\n }\n\n handler.error(ctx, task, err)\n\n process.exit(1)\n }\n }\n}\n"],"names":["_resolveBuildTasks","ctx","_a","_b","_c","_d","_e","cwd","pkg","target","tasks","exports","Object","entries","map","_path","exp","dtsTasks","rollupTasks","_addRollupTaskEntry","format","runtime","entry","buildId","type","push","importId","path","join","name","types","exportPath","sourcePath","source","targetPath","output","require","browser","import","values","_exported","relativeTargetPath","replace","fs","writeFileSync","resolve","_spinner","msg","startTime","Date","now","console","log","chalk","yellow","complete","green","gray","error","red","build","options","tsconfig","_loadPkgWithReporting","config","_loadConfig","_resolveBuildContext","buildTasks","task","handler","_buildTaskHandlers","taskName","spinner","result","exec","toPromise","logger","err","Error","RE_CWD","RegExp","message","process","exit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,SAASA,kBAAT,CAA4BC,GAA5B,EAAiC;EACtC,IAAIC,EAAJ,EAAQC,EAAR,EAAYC,EAAZ,EAAgBC,EAAhB,EAAoBC,EAApB;;EACA,MAAM;IAAEC,GAAF;IAAOC,GAAP;IAAYC;EAAZ,IAAuBR,GAA7B;EACA,MAAMS,KAAK,GAAG,EAAd;EACA,MAAMC,OAAO,GAAGC,MAAM,CAACC,OAAP,CAAeZ,GAAG,CAACU,OAAJ,IAAe,EAA9B,EAAkCG,GAAlC,CACd;IAAA,IAAC,CAACC,KAAD,EAAQC,GAAR,CAAD;IAAA;MAAqBD;IAArB,GAA+BC,GAA/B;EAAA,CADc,CAAhB;EAGA,MAAMC,QAAQ,GAAG,EAAjB;EACA,MAAMC,WAAW,GAAG,EAApB;;EACA,SAASC,mBAAT,CAA6BC,MAA7B,EAAqCC,OAArC,EAA8CC,KAA9C,EAAqD;IACnD,MAAMC,OAAO,aAAMH,MAAN,cAAgBC,OAAhB,CAAb;;IACA,IAAI,CAACH,WAAW,CAACK,OAAD,CAAhB,EAA2B;MACzBL,WAAW,CAACK,OAAD,CAAX,GAAuB;QACrBC,IAAI,EAAE,UADe;QAErBD,OAFqB;QAGrBV,OAAO,EAAE,CAACS,KAAD,CAHY;QAIrBD,OAJqB;QAKrBD,MALqB;QA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B,KAAX,CAAiBmB,GAAG,CAACI,OAAJ,CAAYvC,OAAZ,CAAoBqC,MAApB,EAA4B,GAA5B,CAAjB;QACA9E,GAAG,CAAC2E,MAAJ,CAAWxB,GAAX;MACD;;MACDiB,OAAO,CAACX,KAAR,CAAczD,GAAd,EAAmBmE,IAAnB,EAAyBS,GAAzB;MACAK,OAAO,CAACC,IAAR,CAAa,CAAb;IACD;EACF;AACH;;;"}
|
|
@@ -1,37 +1,64 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var build = require('./_build-
|
|
4
|
-
|
|
3
|
+
var build = require('./_build-6e7deb31.cjs');
|
|
4
|
+
|
|
5
|
+
require('./__resolveBuildContext-9b0aa9f9.cjs');
|
|
6
|
+
|
|
5
7
|
require('path');
|
|
8
|
+
|
|
6
9
|
require('esbuild-register/dist/node');
|
|
10
|
+
|
|
7
11
|
require('find-config');
|
|
12
|
+
|
|
8
13
|
require('pkg-up');
|
|
14
|
+
|
|
9
15
|
require('chalk');
|
|
16
|
+
|
|
10
17
|
require('zod');
|
|
18
|
+
|
|
11
19
|
require('fs/promises');
|
|
20
|
+
|
|
12
21
|
require('typescript');
|
|
22
|
+
|
|
13
23
|
require('browserslist');
|
|
14
|
-
|
|
24
|
+
|
|
15
25
|
require('fs');
|
|
16
|
-
|
|
17
|
-
require('
|
|
18
|
-
|
|
26
|
+
|
|
27
|
+
require('./_index-46cab21c.cjs');
|
|
28
|
+
|
|
19
29
|
require('rxjs');
|
|
30
|
+
|
|
20
31
|
require('util');
|
|
32
|
+
|
|
21
33
|
require('rimraf');
|
|
34
|
+
|
|
22
35
|
require('@microsoft/api-extractor');
|
|
36
|
+
|
|
23
37
|
require('mkdirp');
|
|
38
|
+
|
|
24
39
|
require('prettier');
|
|
40
|
+
|
|
25
41
|
require('@microsoft/tsdoc-config');
|
|
42
|
+
|
|
26
43
|
require('jsonc-parser');
|
|
44
|
+
|
|
27
45
|
require('rollup');
|
|
46
|
+
|
|
28
47
|
require('@rollup/plugin-alias');
|
|
48
|
+
|
|
49
|
+
require('@rollup/plugin-babel');
|
|
50
|
+
|
|
29
51
|
require('@rollup/plugin-commonjs');
|
|
52
|
+
|
|
30
53
|
require('@rollup/plugin-json');
|
|
54
|
+
|
|
31
55
|
require('@rollup/plugin-node-resolve');
|
|
56
|
+
|
|
32
57
|
require('@rollup/plugin-replace');
|
|
58
|
+
|
|
33
59
|
require('rollup-plugin-esbuild');
|
|
34
|
-
|
|
60
|
+
|
|
61
|
+
require('rollup-plugin-terser');
|
|
35
62
|
|
|
36
63
|
async function buildAction(options) {
|
|
37
64
|
return await build.build({
|
|
@@ -41,4 +68,4 @@ async function buildAction(options) {
|
|
|
41
68
|
}
|
|
42
69
|
|
|
43
70
|
exports.buildAction = buildAction;
|
|
44
|
-
//# sourceMappingURL=_buildAction-
|
|
71
|
+
//# sourceMappingURL=_buildAction-d8841b41.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_buildAction-d8841b41.cjs","sources":["../src/cli/buildAction.ts"],"sourcesContent":["import {build} from '../node/build'\n\nexport async function buildAction(options: {tsconfig?: string}): Promise<void> {\n return await build({\n cwd: process.cwd(),\n tsconfig: options.tsconfig,\n })\n}\n"],"names":["buildAction","options","build","cwd","process","tsconfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACO,eAAeA,WAAf,CAA2BC,OAA3B,EAAoC;EACzC,OAAO,MAAMC,KAAAA,CAAAA,KAAAA,CAAM;IACjBC,GAAG,EAAEC,OAAO,CAACD,GAAR,EADY;IAEjBE,QAAQ,EAAEJ,OAAO,CAACI;EAFD,CAANH,CAAb;AAIF;;"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('path');
|
|
4
|
+
|
|
5
|
+
var chalk = require('chalk');
|
|
6
|
+
|
|
7
|
+
var esbuild = require('esbuild');
|
|
8
|
+
|
|
9
|
+
var _resolveBuildContext = require('./__resolveBuildContext-9b0aa9f9.cjs');
|
|
10
|
+
|
|
11
|
+
require('typescript');
|
|
12
|
+
|
|
13
|
+
var fs = require('fs');
|
|
14
|
+
|
|
15
|
+
var treeify = require('treeify');
|
|
16
|
+
|
|
17
|
+
var prettyBytes = require('pretty-bytes');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultLegacy(e) {
|
|
20
|
+
return e && typeof e === 'object' && 'default' in e ? e : {
|
|
21
|
+
'default': e
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
26
|
+
|
|
27
|
+
var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
|
|
28
|
+
|
|
29
|
+
var esbuild__default = /*#__PURE__*/_interopDefaultLegacy(esbuild);
|
|
30
|
+
|
|
31
|
+
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
32
|
+
|
|
33
|
+
var treeify__default = /*#__PURE__*/_interopDefaultLegacy(treeify);
|
|
34
|
+
|
|
35
|
+
var prettyBytes__default = /*#__PURE__*/_interopDefaultLegacy(prettyBytes);
|
|
36
|
+
|
|
37
|
+
function _getFilesize(file) {
|
|
38
|
+
const stats = fs.statSync(file);
|
|
39
|
+
return prettyBytes__default["default"](stats.size);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function _fileExists(file) {
|
|
43
|
+
try {
|
|
44
|
+
fs__default["default"].accessSync(file);
|
|
45
|
+
return true;
|
|
46
|
+
} catch (_) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function _getFileInfo(cwd, filePath) {
|
|
52
|
+
const p = path__default["default"].resolve(cwd, filePath);
|
|
53
|
+
|
|
54
|
+
const exists = _fileExists(p);
|
|
55
|
+
|
|
56
|
+
const size = exists ? _getFilesize(p) : void 0;
|
|
57
|
+
return {
|
|
58
|
+
exists,
|
|
59
|
+
size
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function _printPackageTree(ctx) {
|
|
64
|
+
const {
|
|
65
|
+
cwd,
|
|
66
|
+
exports,
|
|
67
|
+
logger,
|
|
68
|
+
pkg
|
|
69
|
+
} = ctx;
|
|
70
|
+
if (!exports) return;
|
|
71
|
+
logger.log("".concat(chalk__default["default"].blue(pkg.name), "@").concat(chalk__default["default"].green(pkg.version)));
|
|
72
|
+
const tree = {};
|
|
73
|
+
|
|
74
|
+
if (pkg.bin) {
|
|
75
|
+
tree.bin = pkg.bin;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function _fileInfo(file) {
|
|
79
|
+
const info = _getFileInfo(cwd, file);
|
|
80
|
+
|
|
81
|
+
if (!info.size) {
|
|
82
|
+
return "".concat(chalk__default["default"].gray(file), " ").concat(chalk__default["default"].red("does not exist"));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return "".concat(file, " ").concat(chalk__default["default"].gray(info.size));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
tree.exports = Object.fromEntries(Object.entries(exports).filter(_ref => {
|
|
89
|
+
let [, entry] = _ref;
|
|
90
|
+
return entry._exported;
|
|
91
|
+
}).map(_ref2 => {
|
|
92
|
+
let [exportPath, entry] = _ref2;
|
|
93
|
+
const exp = {
|
|
94
|
+
source: entry.source,
|
|
95
|
+
default: entry.default
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
if (entry.browser) {
|
|
99
|
+
exp.browser = {};
|
|
100
|
+
if (entry.browser.import) exp.browser.import = _fileInfo(entry.browser.import);
|
|
101
|
+
if (entry.browser.require) exp.browser.import = _fileInfo(entry.browser.require);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (entry.import) exp.import = _fileInfo(entry.import);
|
|
105
|
+
if (entry.require) exp.require = _fileInfo(entry.require);
|
|
106
|
+
if (entry.types) exp.types = _fileInfo(entry.types);
|
|
107
|
+
exp.default = _fileInfo(entry.default);
|
|
108
|
+
return [chalk__default["default"].green(path__default["default"].join(pkg.name, exportPath)), exp];
|
|
109
|
+
}));
|
|
110
|
+
logger.log(treeify__default["default"].asTree(tree, true, true));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
async function check(options) {
|
|
114
|
+
const {
|
|
115
|
+
cwd,
|
|
116
|
+
strict,
|
|
117
|
+
tsconfig = "tsconfig.json"
|
|
118
|
+
} = options;
|
|
119
|
+
const pkg = await _resolveBuildContext._loadPkgWithReporting({
|
|
120
|
+
cwd
|
|
121
|
+
});
|
|
122
|
+
const config = await _resolveBuildContext._loadConfig({
|
|
123
|
+
cwd
|
|
124
|
+
});
|
|
125
|
+
const ctx = await _resolveBuildContext._resolveBuildContext({
|
|
126
|
+
config,
|
|
127
|
+
cwd,
|
|
128
|
+
pkg,
|
|
129
|
+
tsconfig
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
_printPackageTree(ctx);
|
|
133
|
+
|
|
134
|
+
if (strict) {
|
|
135
|
+
const missingFiles = [];
|
|
136
|
+
|
|
137
|
+
for (const [, exp] of Object.entries(ctx.exports || {})) {
|
|
138
|
+
if (exp.source && !_fileExists(path__default["default"].resolve(cwd, exp.source))) {
|
|
139
|
+
missingFiles.push(exp.source);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (exp.require && !_fileExists(path__default["default"].resolve(cwd, exp.require))) {
|
|
143
|
+
missingFiles.push(exp.require);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (exp.import && !_fileExists(path__default["default"].resolve(cwd, exp.import))) {
|
|
147
|
+
missingFiles.push(exp.import);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (exp.types && !_fileExists(path__default["default"].resolve(cwd, exp.types))) {
|
|
151
|
+
missingFiles.push(exp.types);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (missingFiles.length) {
|
|
156
|
+
throw new Error("missing files");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const _paths = {
|
|
160
|
+
require: [],
|
|
161
|
+
import: []
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
for (const [exportPath, exp] of Object.entries(ctx.exports || {})) {
|
|
165
|
+
if (!exp._exported) continue;
|
|
166
|
+
if (exp.require) _paths.require.push(exportPath);
|
|
167
|
+
if (exp.import) _paths.import.push(exportPath);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const external = Object.keys(pkg.dependencies || {}).concat(Object.keys(pkg.devDependencies || {}));
|
|
171
|
+
|
|
172
|
+
if (_paths.import.length) {
|
|
173
|
+
const code = _paths.import.map(id => "import('".concat(id, "')")).join("\n");
|
|
174
|
+
|
|
175
|
+
try {
|
|
176
|
+
const esbuildResult = await esbuild__default["default"].build({
|
|
177
|
+
external,
|
|
178
|
+
stdin: {
|
|
179
|
+
contents: code,
|
|
180
|
+
loader: "js",
|
|
181
|
+
resolveDir: cwd
|
|
182
|
+
},
|
|
183
|
+
format: "esm",
|
|
184
|
+
bundle: true,
|
|
185
|
+
logLevel: "silent",
|
|
186
|
+
outfile: "/dev/null",
|
|
187
|
+
platform: "node"
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
if (esbuildResult.warnings.length > 0) {
|
|
191
|
+
console.warn(...esbuildResult.warnings);
|
|
192
|
+
}
|
|
193
|
+
} catch (err) {
|
|
194
|
+
const {
|
|
195
|
+
errors
|
|
196
|
+
} = err;
|
|
197
|
+
|
|
198
|
+
for (const _err of errors) {
|
|
199
|
+
if (_err.location) {
|
|
200
|
+
console.log(chalk__default["default"].red("error"), _err.detail || _err.text);
|
|
201
|
+
console.log("".concat(_err.location.line, " | ").concat(_err.location.lineText));
|
|
202
|
+
console.log("in", "./".concat(_err.location.file, ":").concat(_err.location.line, ":").concat(_err.location.column));
|
|
203
|
+
} else {
|
|
204
|
+
console.log(_err.detail || _err.text);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
console.log();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
process.exit(1);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (_paths.require.length) {
|
|
215
|
+
const code = _paths.require.map(id => "require('".concat(id, "')")).join("\n");
|
|
216
|
+
|
|
217
|
+
const esbuildResult = await esbuild__default["default"].build({
|
|
218
|
+
external,
|
|
219
|
+
stdin: {
|
|
220
|
+
contents: code,
|
|
221
|
+
loader: "js",
|
|
222
|
+
resolveDir: cwd
|
|
223
|
+
},
|
|
224
|
+
format: "cjs",
|
|
225
|
+
bundle: true,
|
|
226
|
+
outfile: "/dev/null",
|
|
227
|
+
platform: "node"
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
if (esbuildResult.errors.length > 0) {
|
|
231
|
+
throw new Error(esbuildResult.errors.join(", "));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (esbuildResult.warnings.length > 0) {
|
|
235
|
+
console.warn(...esbuildResult.warnings);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
exports.check = check;
|
|
242
|
+
//# sourceMappingURL=_check-04a1f749.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_check-04a1f749.cjs","sources":["../src/node/_getFilesize.ts","../src/node/_printPackageTree.ts","../src/node/check.ts"],"sourcesContent":["import {statSync} from 'fs'\nimport prettyBytes from 'pretty-bytes'\n\nexport function _getFilesize(file: string): string {\n const stats = statSync(file)\n\n return prettyBytes(stats.size)\n}\n","import fs from 'fs'\nimport path from 'path'\nimport chalk from 'chalk'\nimport treeify from 'treeify'\nimport {PkgExport, _BuildContext} from './_core'\nimport {_getFilesize} from './_getFilesize'\n\nexport function _fileExists(file: string): boolean {\n try {\n fs.accessSync(file)\n\n return true\n } catch (_) {\n return false\n }\n}\n\nfunction _getFileInfo(cwd: string, filePath: string) {\n const p = path.resolve(cwd, filePath)\n const exists = _fileExists(p)\n const size = exists ? _getFilesize(p) : undefined\n\n return {exists, size}\n}\n\nexport function _printPackageTree(ctx: _BuildContext): void {\n const {cwd, exports, logger, pkg} = ctx\n\n if (!exports) return\n\n logger.log(`${chalk.blue(pkg.name)}@${chalk.green(pkg.version)}`)\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const tree: Record<string, any> = {}\n\n if (pkg.bin) {\n tree.bin = pkg.bin\n }\n\n function _fileInfo(file: string) {\n const info = _getFileInfo(cwd, file)\n\n if (!info.size) {\n return `${chalk.gray(file)} ${chalk.red('does not exist')}`\n }\n\n return `${file} ${chalk.gray(info.size)}`\n }\n\n tree.exports = Object.fromEntries(\n Object.entries(exports)\n .filter(([, entry]) => entry._exported)\n .map(([exportPath, entry]) => {\n const exp: Omit<PkgExport, '_exported'> = {source: entry.source, default: entry.default}\n\n if (entry.browser) {\n exp.browser = {}\n\n if (entry.browser.import) exp.browser.import = _fileInfo(entry.browser.import)\n if (entry.browser.require) exp.browser.import = _fileInfo(entry.browser.require)\n }\n\n if (entry.import) exp.import = _fileInfo(entry.import)\n if (entry.require) exp.require = _fileInfo(entry.require)\n if (entry.types) exp.types = _fileInfo(entry.types)\n\n exp.default = _fileInfo(entry.default)\n\n return [chalk.green(path.join(pkg.name, exportPath)), exp]\n })\n )\n\n logger.log(treeify.asTree(tree, true, true))\n}\n","/* eslint-disable no-console */\n\nimport path from 'path'\nimport chalk from 'chalk'\nimport esbuild, {BuildFailure} from 'esbuild'\nimport {_loadConfig, _loadPkgWithReporting} from './_core'\nimport {_fileExists, _printPackageTree} from './_printPackageTree'\nimport {_resolveBuildContext} from './_resolveBuildContext'\n\n/** @public */\nexport async function check(options: {\n cwd: string\n strict?: boolean\n tsconfig?: string\n}): Promise<void> {\n const {cwd, strict, tsconfig = 'tsconfig.json'} = options\n\n const pkg = await _loadPkgWithReporting({cwd})\n const config = await _loadConfig({cwd})\n const ctx = await _resolveBuildContext({config, cwd, pkg, tsconfig})\n\n _printPackageTree(ctx)\n\n if (strict) {\n const missingFiles: string[] = []\n\n // Check if there are missing files\n for (const [, exp] of Object.entries(ctx.exports || {})) {\n if (exp.source && !_fileExists(path.resolve(cwd, exp.source))) {\n missingFiles.push(exp.source)\n }\n\n if (exp.require && !_fileExists(path.resolve(cwd, exp.require))) {\n missingFiles.push(exp.require)\n }\n\n if (exp.import && !_fileExists(path.resolve(cwd, exp.import))) {\n missingFiles.push(exp.import)\n }\n\n if (exp.types && !_fileExists(path.resolve(cwd, exp.types))) {\n missingFiles.push(exp.types)\n }\n }\n\n if (missingFiles.length) {\n throw new Error('missing files')\n }\n\n // Check if the files are resolved\n const _paths: {require: string[]; import: string[]} = {\n require: [],\n import: [],\n }\n\n for (const [exportPath, exp] of Object.entries(ctx.exports || {})) {\n if (!exp._exported) continue\n if (exp.require) _paths.require.push(exportPath)\n if (exp.import) _paths.import.push(exportPath)\n }\n\n const external = Object.keys(pkg.dependencies || {}).concat(\n Object.keys(pkg.devDependencies || {})\n )\n\n if (_paths.import.length) {\n const code = _paths.import.map((id) => `import('${id}')`).join('\\n')\n\n try {\n const esbuildResult = await esbuild.build({\n external,\n stdin: {\n contents: code,\n loader: 'js',\n resolveDir: cwd,\n },\n format: 'esm',\n bundle: true,\n logLevel: 'silent',\n // otherwise output maps to stdout as we're using stdin\n outfile: '/dev/null',\n platform: 'node',\n })\n\n if (esbuildResult.warnings.length > 0) {\n console.warn(...esbuildResult.warnings)\n }\n } catch (err) {\n const {errors} = err as BuildFailure\n\n for (const _err of errors) {\n if (_err.location) {\n console.log(chalk.red('error'), _err.detail || _err.text)\n console.log(`${_err.location.line} | ${_err.location.lineText}`)\n console.log(\n 'in',\n `./${_err.location.file}:${_err.location.line}:${_err.location.column}`\n )\n } else {\n console.log(_err.detail || _err.text)\n }\n\n console.log()\n }\n\n process.exit(1)\n }\n }\n\n if (_paths.require.length) {\n const code = _paths.require.map((id) => `require('${id}')`).join('\\n')\n\n const esbuildResult = await esbuild.build({\n external,\n stdin: {\n contents: code,\n loader: 'js',\n resolveDir: cwd,\n },\n format: 'cjs',\n bundle: true,\n // otherwise output maps to stdout as we're using stdin\n outfile: '/dev/null',\n platform: 'node',\n })\n\n if (esbuildResult.errors.length > 0) {\n throw new Error(esbuildResult.errors.join(', '))\n }\n\n if (esbuildResult.warnings.length > 0) {\n console.warn(...esbuildResult.warnings)\n }\n }\n }\n}\n"],"names":["_getFilesize","file","stats","statSync","prettyBytes","size","_fileExists","fs","accessSync","_","_getFileInfo","cwd","filePath","p","path","resolve","exists","_printPackageTree","ctx","exports","logger","pkg","log","chalk","blue","name","green","version","tree","bin","_fileInfo","info","gray","red","Object","fromEntries","entries","filter","entry","_exported","map","exportPath","exp","source","default","browser","import","require","types","join","treeify","asTree","check","options","strict","tsconfig","_loadPkgWithReporting","config","_loadConfig","_resolveBuildContext","missingFiles","push","length","Error","_paths","external","keys","dependencies","concat","devDependencies","code","id","esbuildResult","esbuild","build","stdin","contents","loader","resolveDir","format","bundle","logLevel","outfile","platform","warnings","console","warn","err","errors","_err","location","detail","text","line","lineText","column","process","exit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,SAASA,YAAT,CAAsBC,IAAtB,EAA4B;EACjC,MAAMC,KAAK,GAAGC,WAAAA,CAASF,IAATE,CAAd;EACA,OAAOC,oBAAW,CAAA,SAAA,CAAXA,CAAYF,KAAK,CAACG,IAAlBD,CAAP;AACF;;ACAO,SAASE,WAAT,CAAqBL,IAArB,EAA2B;EAChC,IAAI;IACFM,sBAAAA,CAAGC,UAAHD,CAAcN,IAAdM;IACA,OAAO,IAAP;EACD,CAHD,CAGE,OAAOE,CAAP,EAAU;IACV,OAAO,KAAP;EACD;AACF;;AACD,SAASC,YAAT,CAAsBC,GAAtB,EAA2BC,QAA3B,EAAqC;EACnC,MAAMC,CAAC,GAAGC,aAAI,CAAA,SAAA,CAAJA,CAAKC,OAALD,CAAaH,GAAbG,EAAkBF,QAAlBE,CAAV;;E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,IAAeF,IAAI,CAACG,IAAhC;UACD;;UACDP,OAAO,CAAC/D,GAAR;QACD;;QACD0E,OAAO,CAACC,IAAR,CAAa,CAAb;MACD;IACF;;IACD,IAAIjC,MAAM,CAACjB,OAAP,CAAee,MAAnB,EAA2B;MACzB,MAAMQ,IAAI,GAAGN,MAAM,CAACjB,OAAP,CAAeP,GAAf,CAAoB+B,EAAD,uBAAoBA,EAApB,OAAnB,EAA+CtB,IAA/C,CAAoD,IAApD,CAAb;;MACA,MAAMuB,aAAa,GAAG,MAAMC,gBAAO,CAAA,SAAA,CAAPA,CAAQC,KAARD,CAAc;QACxCR,QADwC;QAExCU,KAAK,EAAE;UACLC,QAAQ,EAAEN,IADL;UAELO,MAAM,EAAE,IAFH;UAGLC,UAAU,EAAEnE;QAHP,CAFiC;QAOxCoE,MAAM,EAAE,KAPgC;QAQxCC,MAAM,EAAE,IARgC;QASxCE,OAAO,EAAE,WAT+B;QAUxCC,QAAQ,EAAE;MAV8B,CAAdV,CAA5B;;MAYA,IAAID,aAAa,CAACgB,MAAd,CAAqB1B,MAArB,GAA8B,CAAlC,EAAqC;QACnC,MAAM,IAAIC,KAAJ,CAAUS,aAAa,CAACgB,MAAd,CAAqBvC,IAArB,CAA0B,IAA1B,CAAV,CAAN;MACD;;MACD,IAAIuB,aAAa,CAACY,QAAd,CAAuBtB,MAAvB,GAAgC,CAApC,EAAuC;QACrCuB,OAAO,CAACC,IAAR,CAAa,GAAGd,aAAa,CAACY,QAA9B;MACD;IACF;EACF;AACH;;"}
|
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var check = require('./_check-
|
|
3
|
+
var check = require('./_check-04a1f749.cjs');
|
|
4
|
+
|
|
4
5
|
require('path');
|
|
6
|
+
|
|
5
7
|
require('chalk');
|
|
8
|
+
|
|
6
9
|
require('esbuild');
|
|
7
|
-
|
|
10
|
+
|
|
11
|
+
require('./__resolveBuildContext-9b0aa9f9.cjs');
|
|
12
|
+
|
|
8
13
|
require('esbuild-register/dist/node');
|
|
14
|
+
|
|
9
15
|
require('find-config');
|
|
16
|
+
|
|
10
17
|
require('pkg-up');
|
|
18
|
+
|
|
11
19
|
require('zod');
|
|
20
|
+
|
|
12
21
|
require('fs/promises');
|
|
22
|
+
|
|
13
23
|
require('typescript');
|
|
24
|
+
|
|
14
25
|
require('browserslist');
|
|
15
|
-
|
|
26
|
+
|
|
16
27
|
require('fs');
|
|
28
|
+
|
|
17
29
|
require('treeify');
|
|
30
|
+
|
|
18
31
|
require('pretty-bytes');
|
|
19
32
|
|
|
20
33
|
async function checkAction(options) {
|
|
@@ -26,4 +39,4 @@ async function checkAction(options) {
|
|
|
26
39
|
}
|
|
27
40
|
|
|
28
41
|
exports.checkAction = checkAction;
|
|
29
|
-
//# sourceMappingURL=_checkAction-
|
|
42
|
+
//# sourceMappingURL=_checkAction-09426a13.cjs.map
|