jiek 2.1.10 → 2.1.12
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/bin-helper.cjs +18 -0
- package/bin-helper.js +3 -0
- package/dist/cli-only-build.cjs +128 -61
- package/dist/cli-only-build.js +123 -57
- package/dist/cli.cjs +42 -6
- package/dist/cli.js +37 -2
- package/dist/rollup/index.cjs +137 -27
- package/dist/rollup/index.js +136 -29
- package/package.json +35 -42
- package/src/bin/build.ts +0 -0
- package/src/cli-only-build.ts +5 -3
- package/src/cli.ts +2 -2
- package/src/commands/base.ts +1 -0
- package/src/commands/build.ts +86 -13
- package/src/commands/publish.ts +11 -0
- package/src/parseArgv.ts +26 -0
- package/src/rollup/index.ts +103 -14
- package/src/rollup/plugins/create-require.ts +74 -0
- package/src/utils/filterSupport.ts +1 -1
package/bin-helper.cjs
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
const {
|
2
|
+
JIEK_BIN__FILEPATH: binFilePath
|
3
|
+
} = process.env
|
4
|
+
|
5
|
+
const {
|
6
|
+
basename,
|
7
|
+
dirname
|
8
|
+
} = require('node:path')
|
9
|
+
|
10
|
+
const packageDir = dirname(dirname(binFilePath))
|
11
|
+
const binFilename = basename(binFilePath).replace(/(\.[cm]?)js$/, '$1ts')
|
12
|
+
|
13
|
+
process.env.JIEK_PACKAGE_DIR = packageDir
|
14
|
+
process.env.JIEK_BIN__FILENAME = binFilename
|
15
|
+
process.env.JIEK_BIN__FILEPATH = binFilePath
|
16
|
+
|
17
|
+
require('esbuild-register')
|
18
|
+
require(`${packageDir}/src/bin/${binFilename}`)
|
package/bin-helper.js
ADDED
package/dist/cli-only-build.cjs
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
var fs = require('node:fs');
|
4
4
|
var node_module = require('node:module');
|
5
5
|
var path = require('node:path');
|
6
|
-
var filterWorkspacePackages = require('@pnpm/filter-workspace-packages');
|
7
6
|
var commander = require('commander');
|
8
7
|
var jsYaml = require('js-yaml');
|
9
8
|
var getWorkspaceDir = require('@jiek/utils/getWorkspaceDir');
|
9
|
+
var process$1 = require('node:process');
|
10
10
|
var prompts = require('@inquirer/prompts');
|
11
11
|
var cliProgress = require('cli-progress');
|
12
12
|
var execa = require('execa');
|
@@ -16,6 +16,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
|
17
17
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
18
18
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
19
|
+
var process__default = /*#__PURE__*/_interopDefault(process$1);
|
19
20
|
|
20
21
|
let root;
|
21
22
|
function getRoot() {
|
@@ -53,7 +54,7 @@ function getWD() {
|
|
53
54
|
|
54
55
|
let type$1 = "";
|
55
56
|
try {
|
56
|
-
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cli-only-build.cjs', document.baseURI).href)));
|
57
|
+
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-only-build.cjs', document.baseURI).href)));
|
57
58
|
require$1.resolve("@pnpm/filter-workspace-packages");
|
58
59
|
type$1 = "pnpm";
|
59
60
|
} catch {
|
@@ -94,7 +95,8 @@ async function getSelectedProjectsGraph(filter = commander.program.getOptionValu
|
|
94
95
|
}
|
95
96
|
filter = packageJSON.name;
|
96
97
|
}
|
97
|
-
const {
|
98
|
+
const { filterPackagesFromDir } = await import('@pnpm/filter-workspace-packages');
|
99
|
+
const { selectedProjectsGraph } = await filterPackagesFromDir(wd, [{
|
98
100
|
filter: filter ?? "",
|
99
101
|
followProdDepsOnly: true
|
100
102
|
}], {
|
@@ -116,15 +118,29 @@ async function getSelectedProjectsGraph(filter = commander.program.getOptionValu
|
|
116
118
|
|
117
119
|
var name = "jiek";
|
118
120
|
var type = "module";
|
119
|
-
var version = "2.1.
|
121
|
+
var version = "2.1.11";
|
120
122
|
var description$1 = "A lightweight toolkit for compiling and managing libraries based on `package.json` metadata and suitable for `Monorepo`.";
|
121
123
|
var author = "YiJie <yijie4188@gmail.com>";
|
124
|
+
var homepage = "https://github.com/NWYLZW/jiek/tree/master/packages/jiek#readme";
|
122
125
|
var repository = {
|
123
126
|
url: "nwylzw/jiek",
|
124
127
|
directory: "packages/jiek"
|
125
128
|
};
|
126
|
-
var homepage = "https://github.com/NWYLZW/jiek/tree/master/packages/jiek#readme";
|
127
129
|
var bugs = "https://github.com/NWYLZW/jiek/issues?q=is%3Aissue+is%3Aopen+jiek";
|
130
|
+
var exports$1 = {
|
131
|
+
"./package.json": "./package.json",
|
132
|
+
".": "./src/index.ts",
|
133
|
+
"./bin-helper": {
|
134
|
+
require: "./bin-helper.cjs",
|
135
|
+
"default": "./bin-helper.js"
|
136
|
+
},
|
137
|
+
"./cli": "./src/cli.ts",
|
138
|
+
"./cli-only-build": "./src/cli-only-build.ts",
|
139
|
+
"./rollup": "./src/rollup/index.ts"
|
140
|
+
};
|
141
|
+
var imports = {
|
142
|
+
"#~/*": "./src/*"
|
143
|
+
};
|
128
144
|
var bin = {
|
129
145
|
jiek: "bin/jiek.js",
|
130
146
|
jk: "bin/jiek.js",
|
@@ -132,52 +148,47 @@ var bin = {
|
|
132
148
|
jb: "bin/jiek-build.js"
|
133
149
|
};
|
134
150
|
var files = [
|
135
|
-
"dist",
|
136
|
-
"src",
|
137
|
-
"bin",
|
138
151
|
"LICENSE",
|
139
|
-
"README.md"
|
152
|
+
"README.md",
|
153
|
+
"bin",
|
154
|
+
"bin-helper.cjs",
|
155
|
+
"bin-helper.js",
|
156
|
+
"dist",
|
157
|
+
"src"
|
140
158
|
];
|
141
159
|
var scripts = {
|
142
160
|
prepublish: "jb -nm && jk",
|
143
161
|
postpublish: "jk",
|
144
162
|
test: "vitest run"
|
145
163
|
};
|
146
|
-
var
|
147
|
-
"
|
148
|
-
"
|
149
|
-
"
|
150
|
-
|
151
|
-
"
|
152
|
-
|
153
|
-
|
154
|
-
|
164
|
+
var peerDependencies = {
|
165
|
+
"@pnpm/filter-workspace-packages": "^7.2.13||^8.0.0||^9.0.0||^10.0.0",
|
166
|
+
"@rollup/plugin-terser": "^0.4.4",
|
167
|
+
"esbuild-register": "^3.5.0",
|
168
|
+
postcss: "^8.4.47",
|
169
|
+
"rollup-plugin-esbuild": "^6.1.0",
|
170
|
+
"rollup-plugin-postcss": "^4.0.2",
|
171
|
+
"rollup-plugin-swc3": "^0.12.1",
|
172
|
+
typescript: "^4.0.0||^5.0.0",
|
173
|
+
"vite-bundle-analyzer": "^0.15.1"
|
155
174
|
};
|
156
175
|
var dependencies = {
|
176
|
+
"@inquirer/prompts": "^7.1.0",
|
157
177
|
"@jiek/pkger": "workspace:^",
|
158
178
|
"@jiek/rollup-plugin-dts": "^6.2.1",
|
159
179
|
"@jiek/utils": "workspace:^",
|
160
|
-
"@inquirer/prompts": "^7.1.0",
|
161
180
|
"@rollup/plugin-commonjs": "^28.0.0",
|
181
|
+
"@rollup/plugin-inject": "^5.0.5",
|
162
182
|
"@rollup/plugin-json": "^6.0.1",
|
163
183
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
184
|
+
"@rollup/plugin-replace": "^6.0.1",
|
164
185
|
"cli-progress": "^3.12.0",
|
165
186
|
commander: "^12.0.0",
|
166
187
|
"detect-indent": "^6.1.0",
|
167
|
-
execa: "9.3.1",
|
188
|
+
execa: "~9.3.1",
|
168
189
|
"js-yaml": "^4.1.0",
|
169
190
|
"jsonc-parser": "^3.2.1",
|
170
|
-
rollup: "4.
|
171
|
-
};
|
172
|
-
var peerDependencies = {
|
173
|
-
"@rollup/plugin-terser": "^0.4.4",
|
174
|
-
"@pnpm/filter-workspace-packages": "^7.2.13",
|
175
|
-
"esbuild-register": "^3.5.0",
|
176
|
-
postcss: "^8.4.47",
|
177
|
-
"rollup-plugin-postcss": "^4.0.2",
|
178
|
-
"rollup-plugin-esbuild": "^6.1.0",
|
179
|
-
"rollup-plugin-swc3": "^0.12.1",
|
180
|
-
typescript: "^4.0.0||^5.0.0"
|
191
|
+
rollup: "^4.0.0"
|
181
192
|
};
|
182
193
|
var devDependencies = {
|
183
194
|
"@npm/types": "^1.0.2",
|
@@ -192,9 +203,10 @@ var devDependencies = {
|
|
192
203
|
micromatch: "^4.0.5",
|
193
204
|
"node-sass": "^9.0.0",
|
194
205
|
postcss: "^8.4.47",
|
195
|
-
"rollup-plugin-postcss": "^4.0.2",
|
196
206
|
"rollup-plugin-esbuild": "^6.1.0",
|
197
|
-
"rollup-plugin-
|
207
|
+
"rollup-plugin-postcss": "^4.0.2",
|
208
|
+
"rollup-plugin-swc3": "^0.12.1",
|
209
|
+
"vite-bundle-analyzer": "^0.15.1"
|
198
210
|
};
|
199
211
|
var pkg = {
|
200
212
|
name: name,
|
@@ -202,16 +214,16 @@ var pkg = {
|
|
202
214
|
version: version,
|
203
215
|
description: description$1,
|
204
216
|
author: author,
|
205
|
-
repository: repository,
|
206
217
|
homepage: homepage,
|
218
|
+
repository: repository,
|
207
219
|
bugs: bugs,
|
220
|
+
exports: exports$1,
|
221
|
+
imports: imports,
|
208
222
|
bin: bin,
|
209
223
|
files: files,
|
210
224
|
scripts: scripts,
|
211
|
-
exports: exports$1,
|
212
|
-
imports: imports,
|
213
|
-
dependencies: dependencies,
|
214
225
|
peerDependencies: peerDependencies,
|
226
|
+
dependencies: dependencies,
|
215
227
|
devDependencies: devDependencies
|
216
228
|
};
|
217
229
|
|
@@ -234,12 +246,12 @@ Support with variables: 'PKG_NAME',
|
|
234
246
|
const { notWorkspace } = getWD();
|
235
247
|
const IS_WORKSPACE = !notWorkspace;
|
236
248
|
|
237
|
-
commander.program.name("jk/jiek").version(pkg.version).description(`${pkg.description} - Version ${pkg.version}`).option("-c, --config-path <configPath>", "Custom jiek config path");
|
249
|
+
commander.program.name("jk/jiek").version(pkg.version).description(`${pkg.description} - Version ${pkg.version}`).option("-c, --config-path <configPath>", "Custom jiek config path").option("--env.<name>=<value>", "Set the environment variable.");
|
238
250
|
if (type$1 !== "" && IS_WORKSPACE) {
|
239
251
|
commander.program.option("-f, --filter <filter>", filterDescription);
|
240
252
|
}
|
241
253
|
|
242
|
-
const require$3 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cli-only-build.cjs', document.baseURI).href)));
|
254
|
+
const require$3 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-only-build.cjs', document.baseURI).href)));
|
243
255
|
function packageIsExist(name) {
|
244
256
|
try {
|
245
257
|
require$3.resolve(name);
|
@@ -262,7 +274,7 @@ for (const register of registers) {
|
|
262
274
|
}
|
263
275
|
}
|
264
276
|
|
265
|
-
const require$2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cli-only-build.cjs', document.baseURI).href)));
|
277
|
+
const require$2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-only-build.cjs', document.baseURI).href)));
|
266
278
|
let configName = "jiek.config";
|
267
279
|
function getConfigPath(root, dir) {
|
268
280
|
const isSupportTsLoader = !!tsRegisterName;
|
@@ -297,10 +309,7 @@ function getConfigPath(root, dir) {
|
|
297
309
|
function loadConfig(dirOrOptions) {
|
298
310
|
let dir;
|
299
311
|
let root;
|
300
|
-
|
301
|
-
dir = dirOrOptions.dir;
|
302
|
-
root = dirOrOptions.root ?? getWD().wd;
|
303
|
-
} else {
|
312
|
+
{
|
304
313
|
dir = dirOrOptions;
|
305
314
|
root = getWD().wd;
|
306
315
|
}
|
@@ -354,8 +363,8 @@ const BUILDER_TYPE_PACKAGE_NAME_MAP = {
|
|
354
363
|
const FILE_TEMPLATE = (manifest) => `
|
355
364
|
module.exports = require('jiek/rollup').template(${JSON.stringify(manifest, null, 2)})
|
356
365
|
`.trimStart();
|
357
|
-
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cli-only-build.cjs', document.baseURI).href)));
|
358
|
-
const isDefault =
|
366
|
+
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-only-build.cjs', document.baseURI).href)));
|
367
|
+
const isDefault = process__default.default.env.JIEK_IS_ONLY_BUILD === "true";
|
359
368
|
const description = `
|
360
369
|
Build the package according to the 'exports' field from the package.json.
|
361
370
|
If you want to through the options to the \`rollup\` command, you can pass the options after '--'.
|
@@ -364,7 +373,7 @@ ${isDefault ? "This command is the default command." : ""}
|
|
364
373
|
async function checkDependency(dependency) {
|
365
374
|
try {
|
366
375
|
require$1.resolve(dependency);
|
367
|
-
} catch
|
376
|
+
} catch {
|
368
377
|
console.error(`The package '${dependency}' is not installed, please install it first.`);
|
369
378
|
const { notWorkspace } = getWD();
|
370
379
|
const command2 = `pnpm install -${notWorkspace ? "" : "w"}D ${dependency}`;
|
@@ -372,7 +381,7 @@ async function checkDependency(dependency) {
|
|
372
381
|
await execa.execaCommand(command2);
|
373
382
|
} else {
|
374
383
|
console.warn(`You can run the command '${command2}' to install it manually.`);
|
375
|
-
|
384
|
+
process__default.default.exit(1);
|
376
385
|
}
|
377
386
|
}
|
378
387
|
}
|
@@ -400,7 +409,7 @@ const buildEntriesDescription = `
|
|
400
409
|
${entriesDescription}
|
401
410
|
If you pass the --entries option, it will merge into the entries of the command.
|
402
411
|
`.trim();
|
403
|
-
|
412
|
+
let command = isDefault ? (() => {
|
404
413
|
const c = commander.program.name("jb/jiek-build").helpCommand(false);
|
405
414
|
if (IS_WORKSPACE) {
|
406
415
|
c.argument("[filters]", buildFilterDescription);
|
@@ -409,7 +418,7 @@ const command = isDefault ? (() => {
|
|
409
418
|
}
|
410
419
|
return c;
|
411
420
|
})() : commander.program.command(`build [${IS_WORKSPACE ? "filters" : "entries"}]`);
|
412
|
-
command.description(description).option("-t, --type <TYPE>", `The type of build, support ${BUILDER_TYPES.map((s) => `"${s}"`).join(", ")}.`, (v) => {
|
421
|
+
command = command.description(description).option("-t, --type <TYPE>", `The type of build, support ${BUILDER_TYPES.map((s) => `"${s}"`).join(", ")}.`, (v) => {
|
413
422
|
if (!BUILDER_TYPES.includes(v)) {
|
414
423
|
throw new Error(`The value of 'type' must be ${BUILDER_TYPES.map((s) => `"${s}"`).join(", ")}`);
|
415
424
|
}
|
@@ -427,7 +436,16 @@ command.description(description).option("-t, --type <TYPE>", `The type of build,
|
|
427
436
|
"-om, --onlyMin",
|
428
437
|
"Only output minify files, but dts files will still be output, it only replaces the js files.",
|
429
438
|
parseBoolean
|
430
|
-
)
|
439
|
+
);
|
440
|
+
command = command.option("--tsconfig <TSCONFIG>", "The path of the tsconfig file which is used to generate js and dts files.", String).option("--dtsconfig <DTSCONFIG>", "The path of the tsconfig file which is used to generate dts files.", String);
|
441
|
+
command = command.option("-w, --watch", "Watch the file changes.", parseBoolean);
|
442
|
+
command = command.option("--ana", "Enable the bundle analyzer.", parseBoolean).option("--ana.dir <DIR>", "The directory of the bundle analyzer.", ".jk-analyses").option("--ana.mode <MODE>", 'The mode of the bundle analyzer, support "static", "json" and "server".', "server").option("--ana.port <PORT>", "The port of the bundle analyzer.", Number.parseInt).option("--ana.open", "Open the bundle analyzer in the browser.", parseBoolean).option(
|
443
|
+
"--ana.size <SIZE>",
|
444
|
+
'The default size of the bundle analyzer, support "stat", "parsed" and "gzip".',
|
445
|
+
"parsed"
|
446
|
+
);
|
447
|
+
command = command.option("-s, --silent", "Don't display logs.", parseBoolean).option("-v, --verbose", "Display debug logs.", parseBoolean);
|
448
|
+
command.action(async (commandFiltersOrEntries, options) => {
|
431
449
|
let {
|
432
450
|
type,
|
433
451
|
outdir,
|
@@ -461,7 +479,7 @@ command.description(description).option("-t, --type <TYPE>", `The type of build,
|
|
461
479
|
);
|
462
480
|
}
|
463
481
|
let shouldPassThrough = false;
|
464
|
-
const passThroughOptions =
|
482
|
+
const passThroughOptions = process__default.default.argv.reduce(
|
465
483
|
(acc, value) => {
|
466
484
|
if (shouldPassThrough) {
|
467
485
|
acc.push(value);
|
@@ -473,6 +491,16 @@ command.description(description).option("-t, --type <TYPE>", `The type of build,
|
|
473
491
|
},
|
474
492
|
[]
|
475
493
|
);
|
494
|
+
const analyzer = options.ana ? {
|
495
|
+
dir: options["ana.dir"],
|
496
|
+
mode: options["ana.mode"],
|
497
|
+
port: options["ana.port"],
|
498
|
+
open: options["ana.open"],
|
499
|
+
size: options["ana.size"]
|
500
|
+
} : void 0;
|
501
|
+
if (analyzer) {
|
502
|
+
await checkDependency("vite-bundle-analyzer");
|
503
|
+
}
|
476
504
|
const { build } = loadConfig();
|
477
505
|
silent = silent ?? build?.silent ?? false;
|
478
506
|
if (withoutMin && onlyMin) {
|
@@ -489,7 +517,7 @@ command.description(description).option("-t, --type <TYPE>", `The type of build,
|
|
489
517
|
entries = void 0;
|
490
518
|
}
|
491
519
|
const env = {
|
492
|
-
|
520
|
+
JIEK_ANALYZER: analyzer && JSON.stringify(analyzer),
|
493
521
|
JIEK_BUILDER: type,
|
494
522
|
JIEK_OUT_DIR: outdir,
|
495
523
|
JIEK_CLEAN: String(!noClean),
|
@@ -501,7 +529,8 @@ command.description(description).option("-t, --type <TYPE>", `The type of build,
|
|
501
529
|
JIEK_ONLY_MINIFY: String(onlyMin),
|
502
530
|
JIEK_MINIFY_TYPE: minifyType,
|
503
531
|
JIEK_TSCONFIG: tsconfig,
|
504
|
-
JIEK_DTSCONFIG: dtsconfig
|
532
|
+
JIEK_DTSCONFIG: dtsconfig,
|
533
|
+
...process__default.default.env
|
505
534
|
};
|
506
535
|
const multiBars = new cliProgress.MultiBar({
|
507
536
|
clearOnComplete: false,
|
@@ -527,16 +556,33 @@ command.description(description).option("-t, --type <TYPE>", `The type of build,
|
|
527
556
|
let i = 0;
|
528
557
|
await Promise.all(
|
529
558
|
Object.entries(value).map(async ([dir, manifest]) => {
|
530
|
-
if (
|
559
|
+
if (manifest.name == null) {
|
531
560
|
throw new Error("package.json must have a name field");
|
532
561
|
}
|
562
|
+
if (analyzer) {
|
563
|
+
const anaDir = path__default.default.resolve(dir, analyzer.dir);
|
564
|
+
if (!fs.existsSync(anaDir)) {
|
565
|
+
fs__default.default.mkdirSync(anaDir, { recursive: true });
|
566
|
+
}
|
567
|
+
const gitIgnorePath = path__default.default.resolve(anaDir, ".gitignore");
|
568
|
+
if (!fs.existsSync(gitIgnorePath)) {
|
569
|
+
fs__default.default.writeFileSync(gitIgnorePath, "*\n!.gitignore\n");
|
570
|
+
}
|
571
|
+
const npmIgnorePath = path__default.default.resolve(anaDir, ".npmignore");
|
572
|
+
if (!fs.existsSync(npmIgnorePath)) {
|
573
|
+
fs__default.default.writeFileSync(npmIgnorePath, "*\n");
|
574
|
+
}
|
575
|
+
if (!fs.statSync(anaDir).isDirectory()) {
|
576
|
+
throw new Error(`The directory '${anaDir}' is not a directory.`);
|
577
|
+
}
|
578
|
+
}
|
533
579
|
const escapeManifestName = manifest.name.replace(/^@/g, "").replace(/\//g, "+");
|
534
580
|
const configFile = jiekTempDir(
|
535
581
|
`${escapeManifestName ?? `anonymous-${i++}`}.rollup.config.js`
|
536
582
|
);
|
537
583
|
fs__default.default.writeFileSync(configFile, FILE_TEMPLATE(manifest));
|
538
584
|
const command2 = [rollupBinaryPath, "--silent", "-c", configFile];
|
539
|
-
if (tsRegisterName) {
|
585
|
+
if (tsRegisterName != null) {
|
540
586
|
command2.unshift(`node -r ${tsRegisterName}`);
|
541
587
|
}
|
542
588
|
if (watch) {
|
@@ -649,7 +695,7 @@ command.description(description).option("-t, --type <TYPE>", `The type of build,
|
|
649
695
|
});
|
650
696
|
child.once("exit", (code) => code === 0 ? resolve() : reject(new Error(`rollup build failed:
|
651
697
|
${errorStr}`)));
|
652
|
-
verbose && child.stdout?.pipe(
|
698
|
+
verbose && child.stdout?.pipe(process__default.default.stdout);
|
653
699
|
});
|
654
700
|
})
|
655
701
|
);
|
@@ -673,8 +719,29 @@ ${errorStr}`)));
|
|
673
719
|
}
|
674
720
|
});
|
675
721
|
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
722
|
+
const { argv } = process__default.default;
|
723
|
+
const env = {};
|
724
|
+
let isPassThrough = false;
|
725
|
+
const newArgv = argv.filter((arg) => {
|
726
|
+
if (isPassThrough) {
|
727
|
+
return true;
|
728
|
+
}
|
729
|
+
if (arg === "--") {
|
730
|
+
isPassThrough = true;
|
731
|
+
return false;
|
732
|
+
}
|
733
|
+
const m = /^--env\.(\w+)=(.*)$/.exec(arg);
|
734
|
+
if (m) {
|
735
|
+
env[m[1]] = m[2];
|
736
|
+
return false;
|
737
|
+
}
|
738
|
+
return true;
|
739
|
+
});
|
740
|
+
for (const [key, value] of Object.entries(env)) {
|
741
|
+
process__default.default.env[key] = value;
|
742
|
+
}
|
743
|
+
var parseArgv = () => commander.program.parse(newArgv);
|
744
|
+
|
745
|
+
if (process__default.default.env.JIEK_IS_ONLY_BUILD === "true") {
|
746
|
+
parseArgv();
|
680
747
|
}
|