@plugjs/plug 0.3.4 → 0.4.0
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/asserts.cjs +9 -11
- package/dist/asserts.cjs.map +1 -1
- package/dist/asserts.d.ts +1 -2
- package/dist/asserts.mjs +8 -9
- package/dist/asserts.mjs.map +1 -1
- package/dist/build.cjs +29 -5
- package/dist/build.cjs.map +1 -1
- package/dist/build.d.ts +4 -0
- package/dist/build.mjs +27 -5
- package/dist/build.mjs.map +1 -1
- package/dist/cli.d.mts +12 -0
- package/dist/cli.mjs +266 -0
- package/dist/cli.mjs.map +6 -0
- package/dist/fork.cjs +35 -12
- package/dist/fork.cjs.map +1 -1
- package/dist/fork.d.ts +10 -0
- package/dist/fork.mjs +36 -13
- package/dist/fork.mjs.map +1 -1
- package/dist/helpers.cjs +30 -10
- package/dist/helpers.cjs.map +2 -2
- package/dist/helpers.d.ts +12 -0
- package/dist/helpers.mjs +35 -11
- package/dist/helpers.mjs.map +2 -2
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/logging/emit.cjs +4 -4
- package/dist/logging/emit.cjs.map +1 -1
- package/dist/logging/emit.mjs +4 -4
- package/dist/logging/emit.mjs.map +1 -1
- package/dist/logging/logger.cjs +43 -2
- package/dist/logging/logger.cjs.map +1 -1
- package/dist/logging/logger.d.ts +36 -3
- package/dist/logging/logger.mjs +43 -3
- package/dist/logging/logger.mjs.map +1 -1
- package/dist/logging/options.cjs +5 -2
- package/dist/logging/options.cjs.map +1 -1
- package/dist/logging/options.mjs +5 -2
- package/dist/logging/options.mjs.map +1 -1
- package/dist/logging.cjs +14 -3
- package/dist/logging.cjs.map +1 -1
- package/dist/logging.d.ts +2 -0
- package/dist/logging.mjs +13 -3
- package/dist/logging.mjs.map +1 -1
- package/dist/plugs/build.cjs +66 -0
- package/dist/plugs/build.cjs.map +6 -0
- package/dist/plugs/build.d.ts +13 -0
- package/dist/plugs/build.mjs +40 -0
- package/dist/plugs/build.mjs.map +6 -0
- package/dist/types.d.ts +2 -0
- package/dist/utils/exec.cjs +5 -12
- package/dist/utils/exec.cjs.map +2 -2
- package/dist/utils/exec.d.ts +0 -2
- package/dist/utils/exec.mjs +6 -13
- package/dist/utils/exec.mjs.map +1 -1
- package/package.json +7 -9
- package/src/asserts.ts +9 -11
- package/src/build.ts +33 -4
- package/{extra/plug.mts → src/cli.mts} +115 -141
- package/src/fork.ts +50 -13
- package/src/helpers.ts +53 -1
- package/src/index.ts +2 -1
- package/src/logging/emit.ts +4 -4
- package/src/logging/logger.ts +60 -7
- package/src/logging/options.ts +5 -1
- package/src/logging.ts +20 -5
- package/src/plugs/build.ts +58 -0
- package/src/types.ts +2 -0
- package/src/utils/exec.ts +6 -20
- package/cli/plug.mjs +0 -1385
- package/cli/ts-loader.mjs +0 -275
- package/cli/tsrun.mjs +0 -1204
- package/extra/ts-loader.mts +0 -546
- package/extra/tsrun.mts +0 -127
- package/extra/utils.ts +0 -150
package/dist/fork.cjs
CHANGED
|
@@ -58,6 +58,10 @@ var ForkingPlug = class {
|
|
|
58
58
|
const dir = env.NODE_V8_COVERAGE = context.resolve(this._arguments[i].coverageDir);
|
|
59
59
|
context.log.debug("Forked process will produce coverage in", (0, import_logging.$p)(dir));
|
|
60
60
|
}
|
|
61
|
+
if (typeof this._arguments[i].forceModule === "string") {
|
|
62
|
+
const force = env.__TS_LOADER_FORCE_TYPE = this._arguments[i].forceModule;
|
|
63
|
+
context.log.debug("Forked process will force module type as", (0, import_logging.$p)(force));
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
67
|
const child = (0, import_node_child_process.fork)(script, {
|
|
@@ -72,22 +76,22 @@ var ForkingPlug = class {
|
|
|
72
76
|
return new Promise((resolve, reject) => {
|
|
73
77
|
let response = void 0;
|
|
74
78
|
child.on("error", (error) => {
|
|
75
|
-
context.log.error("
|
|
79
|
+
context.log.error("Forked plug process error", error);
|
|
76
80
|
return done || reject(import_asserts.BuildFailure.fail());
|
|
77
81
|
});
|
|
78
82
|
child.on("message", (message) => {
|
|
79
|
-
context.log.debug("Message from
|
|
83
|
+
context.log.debug("Message from forked plug process with PID", child.pid, message);
|
|
80
84
|
response = message;
|
|
81
85
|
});
|
|
82
86
|
child.on("exit", (code, signal) => {
|
|
83
87
|
if (signal) {
|
|
84
|
-
context.log.error(`
|
|
88
|
+
context.log.error(`Forked plug process exited with signal ${signal}`, (0, import_logging.$gry)(`(pid=${child.pid})`));
|
|
85
89
|
return done || reject(import_asserts.BuildFailure.fail());
|
|
86
90
|
} else if (code !== 0) {
|
|
87
|
-
context.log.error(`
|
|
91
|
+
context.log.error(`Forked plug process exited with code ${code}`, (0, import_logging.$gry)(`(pid=${child.pid})`));
|
|
88
92
|
return done || reject(import_asserts.BuildFailure.fail());
|
|
89
93
|
} else if (!response) {
|
|
90
|
-
context.log.error("
|
|
94
|
+
context.log.error("Forked plug process exited with no result", (0, import_logging.$gry)(`(pid=${child.pid})`));
|
|
91
95
|
return done || reject(import_asserts.BuildFailure.fail());
|
|
92
96
|
} else if (response.failed) {
|
|
93
97
|
return done || reject(import_asserts.BuildFailure.fail());
|
|
@@ -97,26 +101,38 @@ var ForkingPlug = class {
|
|
|
97
101
|
try {
|
|
98
102
|
const result = child.send(request, (error) => {
|
|
99
103
|
if (error) {
|
|
100
|
-
context.log.error("Error sending message to
|
|
104
|
+
context.log.error("Error sending message to forked plug process (callback failure)", error);
|
|
101
105
|
reject(import_asserts.BuildFailure.fail());
|
|
102
106
|
}
|
|
103
107
|
});
|
|
104
108
|
if (!result) {
|
|
105
|
-
context.log.error("Error sending message to
|
|
109
|
+
context.log.error("Error sending message to forked plug process (send returned false)");
|
|
106
110
|
reject(import_asserts.BuildFailure.fail());
|
|
107
111
|
}
|
|
108
112
|
} catch (error) {
|
|
109
|
-
context.log.error("Error sending message to
|
|
113
|
+
context.log.error("Error sending message to forked plug process (exception caught)", error);
|
|
110
114
|
reject(import_asserts.BuildFailure.fail());
|
|
111
115
|
}
|
|
112
116
|
}).finally(() => done = true);
|
|
113
117
|
}
|
|
114
118
|
};
|
|
115
119
|
if (process.argv[1] === (0, import_paths.requireFilename)(__filename) && process.send) {
|
|
120
|
+
process.on("uncaughtException", (error, origin) => {
|
|
121
|
+
console.error(
|
|
122
|
+
(0, import_logging.$red)("\n= UNCAUGHT EXCEPTION ========================================="),
|
|
123
|
+
`
|
|
124
|
+
Error (${origin}):`,
|
|
125
|
+
error,
|
|
126
|
+
`
|
|
127
|
+
Node.js ${process.version} (pid=${process.pid})
|
|
128
|
+
`
|
|
129
|
+
);
|
|
130
|
+
process.nextTick(() => process.exit(3));
|
|
131
|
+
});
|
|
116
132
|
const timeout = setTimeout(() => {
|
|
117
133
|
console.error("Fork not initialized in 5 seconds");
|
|
118
134
|
process.exit(2);
|
|
119
|
-
}, 5e3);
|
|
135
|
+
}, 5e3).unref();
|
|
120
136
|
process.on("message", (message) => {
|
|
121
137
|
clearTimeout(timeout);
|
|
122
138
|
const {
|
|
@@ -162,10 +178,17 @@ if (process.argv[1] === (0, import_paths.requireFilename)(__filename) && process
|
|
|
162
178
|
});
|
|
163
179
|
promise.then(() => {
|
|
164
180
|
context.log.debug("Forked plug exiting");
|
|
165
|
-
process.
|
|
181
|
+
process.disconnect();
|
|
182
|
+
process.exitCode = 0;
|
|
166
183
|
}, (error) => {
|
|
167
|
-
|
|
168
|
-
process.
|
|
184
|
+
console.log("\n\nError sending message back to parent process", error);
|
|
185
|
+
process.exitCode = 1;
|
|
186
|
+
}).finally(() => {
|
|
187
|
+
import_logging.logOptions.output.end();
|
|
188
|
+
setTimeout(() => {
|
|
189
|
+
console.log("\n\nProcess %d for %s did not exit in 5 seconds", process.pid, exportName);
|
|
190
|
+
process.exit(2);
|
|
191
|
+
}, 5e3).unref();
|
|
169
192
|
});
|
|
170
193
|
});
|
|
171
194
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QAAQ,MAAM;AAClB,aAAO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC5C,gBAAQ,KAAMC,UAAS,CAAC,QAAe,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC;AAAA,MACtE,CAAC;AAAA,IACH,GAAG,CAAC,UAAU;AACZ,cAAQ,IAAI,MAAM,KAAK;AACvB,aAAO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC5C,gBAAQ,KAAM,EAAE,QAAQ,KAAK,GAAG,CAAC,QAAe,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC;AAAA,MAC/E,CAAC;AAAA,IACH,CAAC;AAGD,YAAQ,KAAK,MAAM;AACjB,cAAQ,IAAI,MAAM,qBAAqB;AACvC,cAAQ,WAAW;AACnB,cAAQ,WAAW;AAAA,IACrB,GAAG,CAAC,UAAU;AAEZ,cAAQ,IAAI,oDAAoD,KAAK;AACrE,cAAQ,WAAW;AAAA,IACrB,CAAC,EAAE,QAAQ,MAAM;AAEf,gCAAW,OAAO,IAAI;AAGtB,iBAAW,MAAM;AAEf,gBAAQ,IAAI,mDAAmD,QAAQ,KAAK,UAAU;AACtF,gBAAQ,KAAK,CAAC;AAAA,MAChB,GAAG,GAAI,EAAE,MAAM;AAAA,IACjB,CAAC;AAAA,EACH,CAAC;AACH;AAmBO,SAAS,eACZ,UACA,YACA,aAAqB,WACjB;AAEN,QAAM,OAAO,cAAc,YAAY;AAAA,IACrC,eAAe,MAAa;AAC1B,YAAM,YAAY,MAAM,UAAU;AAAA,IACpC;AAAA,EACF;AAGA,2BAAQ,UAAU,IAAW;AAC/B;",
|
|
5
5
|
"names": ["result", "message"]
|
|
6
6
|
}
|
package/dist/fork.d.ts
CHANGED
|
@@ -2,6 +2,16 @@ import { Files } from './files';
|
|
|
2
2
|
import { Context } from './pipe';
|
|
3
3
|
import type { AbsolutePath } from './paths';
|
|
4
4
|
import type { Plug, PlugName, PlugResult } from './pipe';
|
|
5
|
+
/**
|
|
6
|
+
* Options accepted by {@link ForkingPlug}'s instrumenting how the process
|
|
7
|
+
* will be spawned (environment variables to be passed to the child process).
|
|
8
|
+
*/
|
|
9
|
+
export interface ForkOptions {
|
|
10
|
+
/** The directory where coverage data will be saved */
|
|
11
|
+
coverageDir?: string;
|
|
12
|
+
/** Force the specified module type when dynamically transpiling TypeScript */
|
|
13
|
+
forceModule?: 'commonjs' | 'module';
|
|
14
|
+
}
|
|
5
15
|
/** Fork data, from parent to child process */
|
|
6
16
|
export interface ForkData {
|
|
7
17
|
/** Script name for the Plug to execute */
|
package/dist/fork.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { fork } from "node:child_process";
|
|
|
3
3
|
import { assert, BuildFailure } from "./asserts.mjs";
|
|
4
4
|
import { runAsync } from "./async.mjs";
|
|
5
5
|
import { Files } from "./files.mjs";
|
|
6
|
-
import { $gry, $p, logOptions } from "./logging.mjs";
|
|
6
|
+
import { $gry, $p, $red, logOptions } from "./logging.mjs";
|
|
7
7
|
import { requireFilename, resolveFile } from "./paths.mjs";
|
|
8
8
|
import { Context, install } from "./pipe.mjs";
|
|
9
9
|
var ForkingPlug = class {
|
|
@@ -33,6 +33,10 @@ var ForkingPlug = class {
|
|
|
33
33
|
const dir = env.NODE_V8_COVERAGE = context.resolve(this._arguments[i].coverageDir);
|
|
34
34
|
context.log.debug("Forked process will produce coverage in", $p(dir));
|
|
35
35
|
}
|
|
36
|
+
if (typeof this._arguments[i].forceModule === "string") {
|
|
37
|
+
const force = env.__TS_LOADER_FORCE_TYPE = this._arguments[i].forceModule;
|
|
38
|
+
context.log.debug("Forked process will force module type as", $p(force));
|
|
39
|
+
}
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
const child = fork(script, {
|
|
@@ -47,22 +51,22 @@ var ForkingPlug = class {
|
|
|
47
51
|
return new Promise((resolve, reject) => {
|
|
48
52
|
let response = void 0;
|
|
49
53
|
child.on("error", (error) => {
|
|
50
|
-
context.log.error("
|
|
54
|
+
context.log.error("Forked plug process error", error);
|
|
51
55
|
return done || reject(BuildFailure.fail());
|
|
52
56
|
});
|
|
53
57
|
child.on("message", (message) => {
|
|
54
|
-
context.log.debug("Message from
|
|
58
|
+
context.log.debug("Message from forked plug process with PID", child.pid, message);
|
|
55
59
|
response = message;
|
|
56
60
|
});
|
|
57
61
|
child.on("exit", (code, signal) => {
|
|
58
62
|
if (signal) {
|
|
59
|
-
context.log.error(`
|
|
63
|
+
context.log.error(`Forked plug process exited with signal ${signal}`, $gry(`(pid=${child.pid})`));
|
|
60
64
|
return done || reject(BuildFailure.fail());
|
|
61
65
|
} else if (code !== 0) {
|
|
62
|
-
context.log.error(`
|
|
66
|
+
context.log.error(`Forked plug process exited with code ${code}`, $gry(`(pid=${child.pid})`));
|
|
63
67
|
return done || reject(BuildFailure.fail());
|
|
64
68
|
} else if (!response) {
|
|
65
|
-
context.log.error("
|
|
69
|
+
context.log.error("Forked plug process exited with no result", $gry(`(pid=${child.pid})`));
|
|
66
70
|
return done || reject(BuildFailure.fail());
|
|
67
71
|
} else if (response.failed) {
|
|
68
72
|
return done || reject(BuildFailure.fail());
|
|
@@ -72,26 +76,38 @@ var ForkingPlug = class {
|
|
|
72
76
|
try {
|
|
73
77
|
const result = child.send(request, (error) => {
|
|
74
78
|
if (error) {
|
|
75
|
-
context.log.error("Error sending message to
|
|
79
|
+
context.log.error("Error sending message to forked plug process (callback failure)", error);
|
|
76
80
|
reject(BuildFailure.fail());
|
|
77
81
|
}
|
|
78
82
|
});
|
|
79
83
|
if (!result) {
|
|
80
|
-
context.log.error("Error sending message to
|
|
84
|
+
context.log.error("Error sending message to forked plug process (send returned false)");
|
|
81
85
|
reject(BuildFailure.fail());
|
|
82
86
|
}
|
|
83
87
|
} catch (error) {
|
|
84
|
-
context.log.error("Error sending message to
|
|
88
|
+
context.log.error("Error sending message to forked plug process (exception caught)", error);
|
|
85
89
|
reject(BuildFailure.fail());
|
|
86
90
|
}
|
|
87
91
|
}).finally(() => done = true);
|
|
88
92
|
}
|
|
89
93
|
};
|
|
90
94
|
if (process.argv[1] === requireFilename(import.meta.url) && process.send) {
|
|
95
|
+
process.on("uncaughtException", (error, origin) => {
|
|
96
|
+
console.error(
|
|
97
|
+
$red("\n= UNCAUGHT EXCEPTION ========================================="),
|
|
98
|
+
`
|
|
99
|
+
Error (${origin}):`,
|
|
100
|
+
error,
|
|
101
|
+
`
|
|
102
|
+
Node.js ${process.version} (pid=${process.pid})
|
|
103
|
+
`
|
|
104
|
+
);
|
|
105
|
+
process.nextTick(() => process.exit(3));
|
|
106
|
+
});
|
|
91
107
|
const timeout = setTimeout(() => {
|
|
92
108
|
console.error("Fork not initialized in 5 seconds");
|
|
93
109
|
process.exit(2);
|
|
94
|
-
}, 5e3);
|
|
110
|
+
}, 5e3).unref();
|
|
95
111
|
process.on("message", (message) => {
|
|
96
112
|
clearTimeout(timeout);
|
|
97
113
|
const {
|
|
@@ -137,10 +153,17 @@ if (process.argv[1] === requireFilename(import.meta.url) && process.send) {
|
|
|
137
153
|
});
|
|
138
154
|
promise.then(() => {
|
|
139
155
|
context.log.debug("Forked plug exiting");
|
|
140
|
-
process.
|
|
156
|
+
process.disconnect();
|
|
157
|
+
process.exitCode = 0;
|
|
141
158
|
}, (error) => {
|
|
142
|
-
|
|
143
|
-
process.
|
|
159
|
+
console.log("\n\nError sending message back to parent process", error);
|
|
160
|
+
process.exitCode = 1;
|
|
161
|
+
}).finally(() => {
|
|
162
|
+
logOptions.output.end();
|
|
163
|
+
setTimeout(() => {
|
|
164
|
+
console.log("\n\nProcess %d for %s did not exit in 5 seconds", process.pid, exportName);
|
|
165
|
+
process.exit(2);
|
|
166
|
+
}, 5e3).unref();
|
|
144
167
|
});
|
|
145
168
|
});
|
|
146
169
|
}
|
package/dist/fork.mjs.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/fork.ts"],
|
|
4
|
-
"mappings": ";AAAA,SAAS,YAAY;AAErB,SAAS,QA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,KAAK;AACvB,aAAO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC5C,gBAAQ,KAAM,EAAE,QAAQ,KAAK,GAAG,CAAC,QAAe,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC;AAAA,MAC/E,CAAC;AAAA,IACH,CAAC;AAGD,YAAQ,KAAK,MAAM;AACjB,cAAQ,IAAI,MAAM,qBAAqB;AACvC,cAAQ,WAAW;AACnB,cAAQ,WAAW;AAAA,IACrB,GAAG,CAAC,UAAU;AAEZ,cAAQ,IAAI,oDAAoD,KAAK;AACrE,cAAQ,WAAW;AAAA,IACrB,CAAC,EAAE,QAAQ,MAAM;AAEf,iBAAW,OAAO,IAAI;AAGtB,iBAAW,MAAM;AAEf,gBAAQ,IAAI,mDAAmD,QAAQ,KAAK,UAAU;AACtF,gBAAQ,KAAK,CAAC;AAAA,MAChB,GAAG,GAAI,EAAE,MAAM;AAAA,IACjB,CAAC;AAAA,EACH,CAAC;AACH;AAmBO,SAAS,eACZ,UACA,YACA,aAAqB,WACjB;AAEN,QAAM,OAAO,cAAc,YAAY;AAAA,IACrC,eAAe,MAAa;AAC1B,YAAM,YAAY,MAAM,UAAU;AAAA,IACpC;AAAA,EACF;AAGA,UAAQ,UAAU,IAAW;AAC/B;",
|
|
5
5
|
"names": ["result", "message"]
|
|
6
6
|
}
|
package/dist/helpers.cjs
CHANGED
|
@@ -20,8 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// helpers.ts
|
|
21
21
|
var helpers_exports = {};
|
|
22
22
|
__export(helpers_exports, {
|
|
23
|
+
context: () => context,
|
|
23
24
|
exec: () => exec,
|
|
24
25
|
find: () => find,
|
|
26
|
+
invokeBuild: () => invokeBuild,
|
|
25
27
|
isDirectory: () => isDirectory,
|
|
26
28
|
isFile: () => isFile,
|
|
27
29
|
merge: () => merge,
|
|
@@ -42,14 +44,18 @@ var import_fs = require("./fs.cjs");
|
|
|
42
44
|
var import_logging = require("./logging.cjs");
|
|
43
45
|
var import_paths = require("./paths.cjs");
|
|
44
46
|
var import_pipe = require("./pipe.cjs");
|
|
47
|
+
var import_build = require("./plugs/build.cjs");
|
|
45
48
|
var import_exec = require("./utils/exec.cjs");
|
|
46
49
|
var import_options = require("./utils/options.cjs");
|
|
47
50
|
var import_walk = require("./utils/walk.cjs");
|
|
51
|
+
function context() {
|
|
52
|
+
return (0, import_async.requireContext)();
|
|
53
|
+
}
|
|
48
54
|
function find(...args) {
|
|
49
55
|
const { params: globs, options } = (0, import_options.parseOptions)(args, {});
|
|
50
|
-
const
|
|
51
|
-
return new import_pipe.PipeImpl(
|
|
52
|
-
const directory = options.directory ?
|
|
56
|
+
const context2 = (0, import_async.requireContext)();
|
|
57
|
+
return new import_pipe.PipeImpl(context2, Promise.resolve().then(async () => {
|
|
58
|
+
const directory = options.directory ? context2.resolve(options.directory) : (0, import_paths.getCurrentWorkingDirectory)();
|
|
53
59
|
const builder = import_files.Files.builder(directory);
|
|
54
60
|
for await (const file of (0, import_walk.walk)(directory, globs, options)) {
|
|
55
61
|
builder.add(file);
|
|
@@ -57,15 +63,27 @@ function find(...args) {
|
|
|
57
63
|
return builder.build();
|
|
58
64
|
}));
|
|
59
65
|
}
|
|
66
|
+
async function invokeBuild(buildFile, tasksOrOptions, maybeOptions) {
|
|
67
|
+
const [tasks, options = {}] = typeof tasksOrOptions === "string" ? [[tasksOrOptions], maybeOptions] : Array.isArray(tasksOrOptions) ? [tasksOrOptions, maybeOptions] : typeof tasksOrOptions === "object" ? [["default"], tasksOrOptions] : [["default"], {}];
|
|
68
|
+
if (tasks.length === 0)
|
|
69
|
+
tasks.push("default");
|
|
70
|
+
const { coverageDir, forceModule, ...props } = options;
|
|
71
|
+
const forkOptions = { coverageDir, forceModule };
|
|
72
|
+
const context2 = (0, import_async.requireContext)();
|
|
73
|
+
const file = context2.resolve(buildFile);
|
|
74
|
+
const dir = (0, import_paths.getAbsoluteParent)(file);
|
|
75
|
+
const files = import_files.Files.builder(dir).add(file).build();
|
|
76
|
+
return new import_build.RunBuild(tasks, props, forkOptions).pipe(files, context2).then(() => void 0);
|
|
77
|
+
}
|
|
60
78
|
async function rmrf(directory) {
|
|
61
|
-
const
|
|
62
|
-
const dir =
|
|
79
|
+
const context2 = (0, import_async.requireContext)();
|
|
80
|
+
const dir = context2.resolve(directory);
|
|
63
81
|
(0, import_asserts.assert)(
|
|
64
82
|
dir !== (0, import_paths.getCurrentWorkingDirectory)(),
|
|
65
83
|
`Cowardly refusing to wipe current working directory ${(0, import_logging.$p)(dir)}`
|
|
66
84
|
);
|
|
67
85
|
(0, import_asserts.assert)(
|
|
68
|
-
dir !==
|
|
86
|
+
dir !== context2.resolve("@"),
|
|
69
87
|
`Cowardly refusing to wipe build file directory ${(0, import_logging.$p)(dir)}`
|
|
70
88
|
);
|
|
71
89
|
if (!(0, import_paths.resolveDirectory)(dir)) {
|
|
@@ -76,8 +94,8 @@ async function rmrf(directory) {
|
|
|
76
94
|
await (0, import_fs.rm)(dir, { recursive: true });
|
|
77
95
|
}
|
|
78
96
|
function merge(pipes) {
|
|
79
|
-
const
|
|
80
|
-
return new import_pipe.PipeImpl(
|
|
97
|
+
const context2 = (0, import_async.requireContext)();
|
|
98
|
+
return new import_pipe.PipeImpl(context2, Promise.resolve().then(async () => {
|
|
81
99
|
if (pipes.length === 0)
|
|
82
100
|
return import_files.Files.builder((0, import_paths.getCurrentWorkingDirectory)()).build();
|
|
83
101
|
const awaited = await (0, import_asserts.assertPromises)(pipes);
|
|
@@ -90,9 +108,9 @@ function merge(pipes) {
|
|
|
90
108
|
}));
|
|
91
109
|
}
|
|
92
110
|
function noop() {
|
|
93
|
-
const
|
|
111
|
+
const context2 = (0, import_async.requireContext)();
|
|
94
112
|
const files = new import_files.Files((0, import_paths.getCurrentWorkingDirectory)());
|
|
95
|
-
return new import_pipe.PipeImpl(
|
|
113
|
+
return new import_pipe.PipeImpl(context2, Promise.resolve(files));
|
|
96
114
|
}
|
|
97
115
|
function resolve(...paths) {
|
|
98
116
|
return (0, import_async.requireContext)().resolve(...paths);
|
|
@@ -134,8 +152,10 @@ function parseJson(file) {
|
|
|
134
152
|
}
|
|
135
153
|
// Annotate the CommonJS export names for ESM import in node:
|
|
136
154
|
0 && (module.exports = {
|
|
155
|
+
context,
|
|
137
156
|
exec,
|
|
138
157
|
find,
|
|
158
|
+
invokeBuild,
|
|
139
159
|
isDirectory,
|
|
140
160
|
isFile,
|
|
141
161
|
merge,
|
package/dist/helpers.cjs.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/helpers.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA0C;AAC1C,qBAAuB;AACvB,uBAAqB;AAErB,qBAAuC;AACvC,mBAA+B;AAC/B,mBAAsB;AACtB,gBAAmB;AACnB,qBAAwB;AACxB,
|
|
5
|
-
"names": []
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA0C;AAC1C,qBAAuB;AACvB,uBAAqB;AAErB,qBAAuC;AACvC,mBAA+B;AAC/B,mBAAsB;AACtB,gBAAmB;AACnB,qBAAwB;AACxB,mBAMO;AACP,kBAAyB;AACzB,mBAAyB;AACzB,kBAA0B;AAC1B,qBAA6B;AAC7B,kBAAqB;AAqBd,SAAS,UAAmB;AACjC,aAAO,6BAAe;AACxB;AAWO,SAAS,QAAQ,MAAuC;AAC7D,QAAM,EAAE,QAAQ,OAAO,QAAQ,QAAI,6BAAa,MAAM,CAAC,CAAC;AAExD,QAAMA,eAAU,6BAAe;AAC/B,SAAO,IAAI,qBAASA,UA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AAE,QAAQ,GAAG,KAAK;AAC9C,aAAO,+BAAiB,IAAI;AAC9B;AAOO,SAAS,UAAwB;AACtC,QAAM,aAAS,2BAAK,uBAAO,GAAG,SAAS;AACvC,QAAM,WAAO,4BAAY,MAAM;AAC/B,SAAO,QAAQ,IAAI;AACrB;AAuBO,SAAS,KACZ,QACG,MACU;AACf,QAAM,EAAE,QAAQ,QAAQ,QAAI,6BAAa,IAAI;AAC7C,aAAO,uBAAU,KAAK,QAAQ,aAAS,6BAAe,CAAC;AACzD;AAOO,SAAS,UAAU,MAAmB;AAC3C,QAAM,eAAW,6BAAe,EAAE,QAAQ,IAAI;AAC9C,MAAI;AACJ,MAAI;AACF,mBAAW,6BAAa,UAAU,OAAO;AAAA,EAC3C,SAAS,OAAP;AACA,QAAI,MAAM,SAAS;AAAU,yBAAI,KAAK,YAAQ,mBAAG,QAAQ,aAAa;AACtE,QAAI,MAAM,SAAS;AAAU,yBAAI,KAAK,YAAQ,mBAAG,QAAQ,uBAAuB;AAChF,uBAAI,KAAK,qBAAiB,mBAAG,QAAQ,KAAK,KAAK;AAAA,EACjD;AAEA,MAAI;AACF,WAAO,KAAK,MAAM,QAAQ;AAAA,EAC5B,SAAS,OAAP;AACA,uBAAI,KAAK,qBAAiB,mBAAG,QAAQ,KAAK,KAAK;AAAA,EACjD;AACF;",
|
|
5
|
+
"names": ["context"]
|
|
6
6
|
}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Files } from './files';
|
|
2
|
+
import type { ForkOptions } from './fork';
|
|
2
3
|
import type { Pipe } from './index';
|
|
3
4
|
import type { AbsolutePath } from './paths';
|
|
5
|
+
import type { Context } from './pipe';
|
|
4
6
|
import type { ExecChildOptions } from './utils/exec';
|
|
5
7
|
import type { WalkOptions } from './utils/walk';
|
|
6
8
|
/** The {@link FindOptions} interface defines the options for finding files. */
|
|
@@ -8,6 +10,8 @@ export interface FindOptions extends WalkOptions {
|
|
|
8
10
|
/** The directory where to start looking for files. */
|
|
9
11
|
directory?: string;
|
|
10
12
|
}
|
|
13
|
+
/** Return the current execution {@link Context} */
|
|
14
|
+
export declare function context(): Context;
|
|
11
15
|
/** Find files in the current directory using the specified _glob_. */
|
|
12
16
|
export declare function find(glob: string): Pipe;
|
|
13
17
|
/** Find files in the current directory using the specified _globs_. */
|
|
@@ -16,6 +20,14 @@ export declare function find(glob: string, ...globs: string[]): Pipe;
|
|
|
16
20
|
export declare function find(glob: string, options: FindOptions): Pipe;
|
|
17
21
|
/** Find files using the specified _globs_ and {@link FindOptions | options}. */
|
|
18
22
|
export declare function find(glob: string, ...extra: [...globs: string[], options: FindOptions]): Pipe;
|
|
23
|
+
export type InvokeBuildOptions = ForkOptions & Record<string, string>;
|
|
24
|
+
export type InvokeBuildTasks = string | [string, ...string[]];
|
|
25
|
+
export declare function invokeBuild(buildFile: string): Promise<void>;
|
|
26
|
+
export declare function invokeBuild(buildFile: string, task: string): Promise<void>;
|
|
27
|
+
export declare function invokeBuild(buildFile: string, task: string, options: InvokeBuildOptions): Promise<void>;
|
|
28
|
+
export declare function invokeBuild(buildFile: string, tasks: [string, ...string[]]): Promise<void>;
|
|
29
|
+
export declare function invokeBuild(buildFile: string, tasks: [string, ...string[]], options: InvokeBuildOptions): Promise<void>;
|
|
30
|
+
export declare function invokeBuild(buildFile: string, options: InvokeBuildOptions): Promise<void>;
|
|
19
31
|
/**
|
|
20
32
|
* Recursively remove the specified directory _**(use with care)**_.
|
|
21
33
|
*/
|
package/dist/helpers.mjs
CHANGED
|
@@ -7,16 +7,26 @@ import { requireContext } from "./async.mjs";
|
|
|
7
7
|
import { Files } from "./files.mjs";
|
|
8
8
|
import { rm } from "./fs.mjs";
|
|
9
9
|
import { $p, log } from "./logging.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
commonPath,
|
|
12
|
+
getAbsoluteParent,
|
|
13
|
+
getCurrentWorkingDirectory,
|
|
14
|
+
resolveDirectory,
|
|
15
|
+
resolveFile
|
|
16
|
+
} from "./paths.mjs";
|
|
11
17
|
import { PipeImpl } from "./pipe.mjs";
|
|
18
|
+
import { RunBuild } from "./plugs/build.mjs";
|
|
12
19
|
import { execChild } from "./utils/exec.mjs";
|
|
13
20
|
import { parseOptions } from "./utils/options.mjs";
|
|
14
21
|
import { walk } from "./utils/walk.mjs";
|
|
22
|
+
function context() {
|
|
23
|
+
return requireContext();
|
|
24
|
+
}
|
|
15
25
|
function find(...args) {
|
|
16
26
|
const { params: globs, options } = parseOptions(args, {});
|
|
17
|
-
const
|
|
18
|
-
return new PipeImpl(
|
|
19
|
-
const directory = options.directory ?
|
|
27
|
+
const context2 = requireContext();
|
|
28
|
+
return new PipeImpl(context2, Promise.resolve().then(async () => {
|
|
29
|
+
const directory = options.directory ? context2.resolve(options.directory) : getCurrentWorkingDirectory();
|
|
20
30
|
const builder = Files.builder(directory);
|
|
21
31
|
for await (const file of walk(directory, globs, options)) {
|
|
22
32
|
builder.add(file);
|
|
@@ -24,15 +34,27 @@ function find(...args) {
|
|
|
24
34
|
return builder.build();
|
|
25
35
|
}));
|
|
26
36
|
}
|
|
37
|
+
async function invokeBuild(buildFile, tasksOrOptions, maybeOptions) {
|
|
38
|
+
const [tasks, options = {}] = typeof tasksOrOptions === "string" ? [[tasksOrOptions], maybeOptions] : Array.isArray(tasksOrOptions) ? [tasksOrOptions, maybeOptions] : typeof tasksOrOptions === "object" ? [["default"], tasksOrOptions] : [["default"], {}];
|
|
39
|
+
if (tasks.length === 0)
|
|
40
|
+
tasks.push("default");
|
|
41
|
+
const { coverageDir, forceModule, ...props } = options;
|
|
42
|
+
const forkOptions = { coverageDir, forceModule };
|
|
43
|
+
const context2 = requireContext();
|
|
44
|
+
const file = context2.resolve(buildFile);
|
|
45
|
+
const dir = getAbsoluteParent(file);
|
|
46
|
+
const files = Files.builder(dir).add(file).build();
|
|
47
|
+
return new RunBuild(tasks, props, forkOptions).pipe(files, context2).then(() => void 0);
|
|
48
|
+
}
|
|
27
49
|
async function rmrf(directory) {
|
|
28
|
-
const
|
|
29
|
-
const dir =
|
|
50
|
+
const context2 = requireContext();
|
|
51
|
+
const dir = context2.resolve(directory);
|
|
30
52
|
assert(
|
|
31
53
|
dir !== getCurrentWorkingDirectory(),
|
|
32
54
|
`Cowardly refusing to wipe current working directory ${$p(dir)}`
|
|
33
55
|
);
|
|
34
56
|
assert(
|
|
35
|
-
dir !==
|
|
57
|
+
dir !== context2.resolve("@"),
|
|
36
58
|
`Cowardly refusing to wipe build file directory ${$p(dir)}`
|
|
37
59
|
);
|
|
38
60
|
if (!resolveDirectory(dir)) {
|
|
@@ -43,8 +65,8 @@ async function rmrf(directory) {
|
|
|
43
65
|
await rm(dir, { recursive: true });
|
|
44
66
|
}
|
|
45
67
|
function merge(pipes) {
|
|
46
|
-
const
|
|
47
|
-
return new PipeImpl(
|
|
68
|
+
const context2 = requireContext();
|
|
69
|
+
return new PipeImpl(context2, Promise.resolve().then(async () => {
|
|
48
70
|
if (pipes.length === 0)
|
|
49
71
|
return Files.builder(getCurrentWorkingDirectory()).build();
|
|
50
72
|
const awaited = await assertPromises(pipes);
|
|
@@ -57,9 +79,9 @@ function merge(pipes) {
|
|
|
57
79
|
}));
|
|
58
80
|
}
|
|
59
81
|
function noop() {
|
|
60
|
-
const
|
|
82
|
+
const context2 = requireContext();
|
|
61
83
|
const files = new Files(getCurrentWorkingDirectory());
|
|
62
|
-
return new PipeImpl(
|
|
84
|
+
return new PipeImpl(context2, Promise.resolve(files));
|
|
63
85
|
}
|
|
64
86
|
function resolve(...paths) {
|
|
65
87
|
return requireContext().resolve(...paths);
|
|
@@ -100,8 +122,10 @@ function parseJson(file) {
|
|
|
100
122
|
}
|
|
101
123
|
}
|
|
102
124
|
export {
|
|
125
|
+
context,
|
|
103
126
|
exec,
|
|
104
127
|
find,
|
|
128
|
+
invokeBuild,
|
|
105
129
|
isDirectory,
|
|
106
130
|
isFile,
|
|
107
131
|
merge,
|
package/dist/helpers.mjs.map
C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AC9C,MAAI;AACJ,MAAI;AACF,eAAW,aAAa,UAAU,OAAO;AAAA,EAC3C,SAAS,OAAP;AACA,QAAI,MAAM,SAAS;AAAU,UAAI,KAAK,QAAQ,GAAG,QAAQ,aAAa;AACtE,QAAI,MAAM,SAAS;AAAU,UAAI,KAAK,QAAQ,GAAG,QAAQ,uBAAuB;AAChF,QAAI,KAAK,iBAAiB,GAAG,QAAQ,KAAK,KAAK;AAAA,EACjD;AAEA,MAAI;AACF,WAAO,KAAK,MAAM,QAAQ;AAAA,EAC5B,SAAS,OAAP;AACA,QAAI,KAAK,iBAAiB,GAAG,QAAQ,KAAK,KAAK;AAAA,EACjD;AACF;",
|
|
5
|
+
"names": ["context"]
|
|
6
6
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -47,6 +47,8 @@ __export(src_exports, {
|
|
|
47
47
|
Files: () => import_files.Files,
|
|
48
48
|
assert: () => import_asserts.assert,
|
|
49
49
|
asserts: () => asserts,
|
|
50
|
+
async: () => async,
|
|
51
|
+
banner: () => import_logging.banner,
|
|
50
52
|
fail: () => import_asserts.fail,
|
|
51
53
|
files: () => files,
|
|
52
54
|
fork: () => fork,
|
|
@@ -60,6 +62,7 @@ __export(src_exports, {
|
|
|
60
62
|
module.exports = __toCommonJS(src_exports);
|
|
61
63
|
var import_files = require("./files.cjs");
|
|
62
64
|
var asserts = __toESM(require("./asserts.cjs"), 1);
|
|
65
|
+
var async = __toESM(require("./async.cjs"), 1);
|
|
63
66
|
var files = __toESM(require("./files.cjs"), 1);
|
|
64
67
|
var fork = __toESM(require("./fork.cjs"), 1);
|
|
65
68
|
var fs = __toESM(require("./fs.cjs"), 1);
|
|
@@ -91,6 +94,8 @@ __reExport(src_exports, require("./types.cjs"), module.exports);
|
|
|
91
94
|
Files,
|
|
92
95
|
assert,
|
|
93
96
|
asserts,
|
|
97
|
+
async,
|
|
98
|
+
banner,
|
|
94
99
|
fail,
|
|
95
100
|
files,
|
|
96
101
|
fork,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,mBAAsB;AAqBtB,cAAyB;AACzB,YAAuB;AACvB,WAAsB;AACtB,SAAoB;AACpB,cAAyB;AACzB,YAAuB;AACvB,WAAsB;AACtB,YAAuB;AAGvB,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,mBAAsB;AAqBtB,cAAyB;AACzB,YAAuB;AACvB,YAAuB;AACvB,WAAsB;AACtB,SAAoB;AACpB,cAAyB;AACzB,YAAuB;AACvB,WAAsB;AACtB,YAAuB;AAGvB,qBAA+F;AAC/F,qBAA2C;AAG3C,wBAAc,wBA5Cd;AA6CA,wBAAc,0BA7Cd;AA8CA,wBAAc,wBA9Cd;AA+CA,wBAAc,wBA/Cd;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface Pipe extends Promise<Files> {
|
|
|
20
20
|
plug(plug: PlugFunction<Files | void | undefined>): Pipe | Promise<undefined>;
|
|
21
21
|
}
|
|
22
22
|
export * as asserts from './asserts';
|
|
23
|
+
export * as async from './async';
|
|
23
24
|
export * as files from './files';
|
|
24
25
|
export * as fork from './fork';
|
|
25
26
|
export * as fs from './fs';
|
|
@@ -27,7 +28,7 @@ export * as logging from './logging';
|
|
|
27
28
|
export * as paths from './paths';
|
|
28
29
|
export * as pipe from './pipe';
|
|
29
30
|
export * as utils from './utils';
|
|
30
|
-
export { log, $ms, $p, $t, $blu, $cyn, $grn, $gry, $mgt, $red, $und, $wht, $ylw } from './logging';
|
|
31
|
+
export { banner, log, $ms, $p, $t, $blu, $cyn, $grn, $gry, $mgt, $red, $und, $wht, $ylw } from './logging';
|
|
31
32
|
export { assert, fail, BuildFailure } from './asserts';
|
|
32
33
|
export * from './build';
|
|
33
34
|
export * from './helpers';
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// index.ts
|
|
2
2
|
import { Files } from "./files.mjs";
|
|
3
3
|
import * as asserts from "./asserts.mjs";
|
|
4
|
+
import * as async from "./async.mjs";
|
|
4
5
|
import * as files from "./files.mjs";
|
|
5
6
|
import * as fork from "./fork.mjs";
|
|
6
7
|
import * as fs from "./fs.mjs";
|
|
@@ -8,7 +9,7 @@ import * as logging from "./logging.mjs";
|
|
|
8
9
|
import * as paths from "./paths.mjs";
|
|
9
10
|
import * as pipe from "./pipe.mjs";
|
|
10
11
|
import * as utils from "./utils.mjs";
|
|
11
|
-
import { log, $ms, $p, $t, $blu, $cyn, $grn, $gry, $mgt, $red, $und, $wht, $ylw } from "./logging.mjs";
|
|
12
|
+
import { banner, log, $ms, $p, $t, $blu, $cyn, $grn, $gry, $mgt, $red, $und, $wht, $ylw } from "./logging.mjs";
|
|
12
13
|
import { assert, fail, BuildFailure } from "./asserts.mjs";
|
|
13
14
|
export * from "./build.mjs";
|
|
14
15
|
export * from "./helpers.mjs";
|
|
@@ -31,6 +32,8 @@ export {
|
|
|
31
32
|
Files,
|
|
32
33
|
assert,
|
|
33
34
|
asserts,
|
|
35
|
+
async,
|
|
36
|
+
banner,
|
|
34
37
|
fail,
|
|
35
38
|
files,
|
|
36
39
|
fork,
|