@plugjs/plug 0.0.14 → 0.0.15

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.
Files changed (212) hide show
  1. package/dist/async.cjs +20 -19
  2. package/dist/async.cjs.map +1 -1
  3. package/dist/async.d.ts +9 -9
  4. package/dist/async.mjs +18 -17
  5. package/dist/async.mjs.map +1 -1
  6. package/dist/build.cjs +144 -110
  7. package/dist/build.cjs.map +2 -2
  8. package/dist/build.d.ts +12 -56
  9. package/dist/build.mjs +146 -112
  10. package/dist/build.mjs.map +2 -2
  11. package/dist/files.cjs +2 -16
  12. package/dist/files.cjs.map +1 -1
  13. package/dist/files.d.ts +3 -10
  14. package/dist/files.mjs +3 -17
  15. package/dist/files.mjs.map +1 -1
  16. package/dist/fork.cjs +28 -40
  17. package/dist/fork.cjs.map +1 -1
  18. package/dist/fork.d.ts +6 -27
  19. package/dist/fork.mjs +29 -40
  20. package/dist/fork.mjs.map +1 -1
  21. package/dist/helpers.cjs +61 -63
  22. package/dist/helpers.cjs.map +2 -2
  23. package/dist/helpers.d.ts +15 -37
  24. package/dist/helpers.mjs +61 -64
  25. package/dist/helpers.mjs.map +2 -2
  26. package/dist/index.cjs +3 -2
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.ts +9 -13
  29. package/dist/index.mjs +3 -2
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/log/colors.cjs +3 -1
  32. package/dist/log/colors.cjs.map +1 -1
  33. package/dist/log/colors.d.ts +2 -2
  34. package/dist/log/colors.mjs +3 -1
  35. package/dist/log/colors.mjs.map +1 -1
  36. package/dist/log/emit.d.ts +1 -1
  37. package/dist/log/logger.cjs +4 -0
  38. package/dist/log/logger.cjs.map +1 -1
  39. package/dist/log/logger.d.ts +4 -1
  40. package/dist/log/logger.mjs +4 -0
  41. package/dist/log/logger.mjs.map +1 -1
  42. package/dist/log/options.d.ts +1 -1
  43. package/dist/log/report.cjs +2 -11
  44. package/dist/log/report.cjs.map +1 -1
  45. package/dist/log/report.d.ts +36 -4
  46. package/dist/log/report.mjs +1 -10
  47. package/dist/log/report.mjs.map +1 -1
  48. package/dist/log.cjs +1 -1
  49. package/dist/log.cjs.map +1 -1
  50. package/dist/log.d.ts +6 -6
  51. package/dist/log.mjs +2 -2
  52. package/dist/log.mjs.map +1 -1
  53. package/dist/pipe.cjs +41 -34
  54. package/dist/pipe.cjs.map +1 -1
  55. package/dist/pipe.d.ts +149 -119
  56. package/dist/pipe.mjs +38 -32
  57. package/dist/pipe.mjs.map +1 -1
  58. package/dist/plugs/copy.cjs +15 -25
  59. package/dist/plugs/copy.cjs.map +2 -2
  60. package/dist/plugs/copy.d.ts +14 -13
  61. package/dist/plugs/copy.mjs +15 -17
  62. package/dist/plugs/copy.mjs.map +2 -2
  63. package/dist/plugs/coverage/analysis.d.ts +2 -2
  64. package/dist/plugs/coverage/report.cjs +1 -1
  65. package/dist/plugs/coverage/report.cjs.map +1 -1
  66. package/dist/plugs/coverage/report.d.ts +3 -3
  67. package/dist/plugs/coverage/report.mjs +1 -1
  68. package/dist/plugs/coverage/report.mjs.map +1 -1
  69. package/dist/plugs/coverage.cjs +19 -25
  70. package/dist/plugs/coverage.cjs.map +1 -1
  71. package/dist/plugs/coverage.d.ts +33 -30
  72. package/dist/plugs/coverage.mjs +20 -18
  73. package/dist/plugs/coverage.mjs.map +1 -1
  74. package/dist/plugs/debug.cjs +8 -37
  75. package/dist/plugs/debug.cjs.map +1 -1
  76. package/dist/plugs/debug.d.ts +4 -11
  77. package/dist/plugs/debug.mjs +24 -20
  78. package/dist/plugs/debug.mjs.map +1 -1
  79. package/dist/plugs/esbuild/fix-extensions.mjs +1 -1
  80. package/dist/plugs/esbuild/fix-extensions.mjs.map +1 -1
  81. package/dist/plugs/esbuild.cjs +14 -25
  82. package/dist/plugs/esbuild.cjs.map +1 -1
  83. package/dist/plugs/esbuild.d.ts +11 -16
  84. package/dist/plugs/esbuild.mjs +14 -17
  85. package/dist/plugs/esbuild.mjs.map +1 -1
  86. package/dist/plugs/eslint/runner.cjs +5 -6
  87. package/dist/plugs/eslint/runner.cjs.map +1 -1
  88. package/dist/plugs/eslint/runner.d.ts +6 -20
  89. package/dist/plugs/eslint/runner.mjs +6 -7
  90. package/dist/plugs/eslint/runner.mjs.map +1 -1
  91. package/dist/{task.cjs → plugs/eslint.cjs} +7 -24
  92. package/dist/plugs/eslint.cjs.map +6 -0
  93. package/dist/plugs/eslint.d.ts +34 -0
  94. package/dist/plugs/eslint.mjs +5 -0
  95. package/dist/plugs/eslint.mjs.map +6 -0
  96. package/dist/plugs/exec.cjs +20 -24
  97. package/dist/plugs/exec.cjs.map +1 -1
  98. package/dist/plugs/exec.d.ts +53 -53
  99. package/dist/plugs/exec.mjs +20 -23
  100. package/dist/plugs/exec.mjs.map +1 -1
  101. package/dist/plugs/filter.cjs +9 -19
  102. package/dist/plugs/filter.cjs.map +1 -1
  103. package/dist/plugs/filter.d.ts +21 -15
  104. package/dist/plugs/filter.mjs +10 -12
  105. package/dist/plugs/filter.mjs.map +1 -1
  106. package/dist/plugs/mocha/reporter.cjs +12 -6
  107. package/dist/plugs/mocha/reporter.cjs.map +1 -1
  108. package/dist/plugs/mocha/reporter.d.ts +0 -2
  109. package/dist/plugs/mocha/reporter.mjs +11 -4
  110. package/dist/plugs/mocha/reporter.mjs.map +1 -1
  111. package/dist/plugs/mocha/runner.cjs +4 -5
  112. package/dist/plugs/mocha/runner.cjs.map +1 -1
  113. package/dist/plugs/mocha/runner.d.ts +5 -31
  114. package/dist/plugs/mocha/runner.mjs +5 -6
  115. package/dist/plugs/mocha/runner.mjs.map +1 -1
  116. package/dist/plugs/mocha.cjs +22 -0
  117. package/dist/plugs/mocha.cjs.map +6 -0
  118. package/dist/plugs/mocha.d.ts +35 -0
  119. package/dist/plugs/mocha.mjs +5 -0
  120. package/dist/plugs/mocha.mjs.map +6 -0
  121. package/dist/plugs/rmf.cjs +4 -32
  122. package/dist/plugs/rmf.cjs.map +1 -1
  123. package/dist/plugs/rmf.d.ts +8 -12
  124. package/dist/plugs/rmf.mjs +25 -20
  125. package/dist/plugs/rmf.mjs.map +1 -1
  126. package/dist/plugs/tsc/compiler.d.ts +1 -1
  127. package/dist/plugs/tsc/options.d.ts +1 -1
  128. package/dist/plugs/tsc/report.d.ts +2 -2
  129. package/dist/plugs/tsc/runner.cjs +12 -11
  130. package/dist/plugs/tsc/runner.cjs.map +1 -1
  131. package/dist/plugs/tsc/runner.d.ts +4 -9
  132. package/dist/plugs/tsc/runner.mjs +12 -11
  133. package/dist/plugs/tsc/runner.mjs.map +1 -1
  134. package/dist/plugs/tsc.cjs +7 -0
  135. package/dist/plugs/tsc.cjs.map +6 -0
  136. package/dist/plugs/tsc.d.ts +36 -0
  137. package/dist/plugs/tsc.mjs +15 -0
  138. package/dist/plugs/tsc.mjs.map +6 -0
  139. package/dist/plugs.cjs +3 -5
  140. package/dist/plugs.cjs.map +1 -1
  141. package/dist/plugs.d.ts +10 -17
  142. package/dist/plugs.mjs +3 -5
  143. package/dist/plugs.mjs.map +1 -1
  144. package/dist/types.cjs +19 -0
  145. package/dist/types.cjs.map +6 -0
  146. package/dist/types.d.ts +72 -0
  147. package/dist/types.mjs +1 -0
  148. package/dist/types.mjs.map +6 -0
  149. package/dist/utils/caller.cjs +8 -11
  150. package/dist/utils/caller.cjs.map +2 -2
  151. package/dist/utils/caller.d.ts +2 -7
  152. package/dist/utils/caller.mjs +8 -11
  153. package/dist/utils/caller.mjs.map +2 -2
  154. package/dist/utils/options.cjs +4 -6
  155. package/dist/utils/options.cjs.map +1 -1
  156. package/dist/utils/options.d.ts +16 -15
  157. package/dist/utils/options.mjs +4 -6
  158. package/dist/utils/options.mjs.map +1 -1
  159. package/dist/utils/walk.d.ts +2 -2
  160. package/extra/cli.mjs +31 -20
  161. package/extra/ts-loader.mjs +6 -5
  162. package/package.json +6 -6
  163. package/src/async.ts +27 -19
  164. package/src/files.ts +6 -30
  165. package/src/fork.ts +35 -76
  166. package/src/helpers.ts +89 -101
  167. package/src/index.ts +10 -15
  168. package/src/log/colors.ts +4 -3
  169. package/src/log/emit.ts +4 -4
  170. package/src/log/logger.ts +12 -4
  171. package/src/log/options.ts +1 -1
  172. package/src/log/report.ts +8 -22
  173. package/src/log/spinner.ts +3 -3
  174. package/src/log.ts +9 -9
  175. package/src/paths.ts +1 -1
  176. package/src/pipe.ts +191 -178
  177. package/src/plugs/copy.ts +40 -31
  178. package/src/plugs/coverage/analysis.ts +4 -4
  179. package/src/plugs/coverage/report.ts +6 -5
  180. package/src/plugs/coverage.ts +64 -53
  181. package/src/plugs/debug.ts +22 -27
  182. package/src/plugs/esbuild/fix-extensions.ts +2 -2
  183. package/src/plugs/esbuild.ts +42 -46
  184. package/src/plugs/eslint/runner.ts +16 -31
  185. package/src/plugs/eslint.ts +42 -0
  186. package/src/plugs/exec.ts +93 -82
  187. package/src/plugs/filter.ts +42 -27
  188. package/src/plugs/mocha/reporter.ts +10 -5
  189. package/src/plugs/mocha/runner.ts +12 -38
  190. package/src/plugs/mocha.ts +41 -0
  191. package/src/plugs/rmf.ts +21 -25
  192. package/src/plugs/tsc/compiler.ts +1 -1
  193. package/src/plugs/tsc/options.ts +2 -2
  194. package/src/plugs/tsc/report.ts +2 -2
  195. package/src/plugs/tsc/runner.ts +24 -30
  196. package/src/plugs/tsc.ts +45 -0
  197. package/src/plugs.ts +10 -25
  198. package/src/types.ts +123 -0
  199. package/src/utils/caller.ts +11 -22
  200. package/src/utils/options.ts +49 -17
  201. package/src/utils/walk.ts +4 -4
  202. package/dist/run.cjs +0 -90
  203. package/dist/run.cjs.map +0 -6
  204. package/dist/run.d.ts +0 -89
  205. package/dist/run.mjs +0 -65
  206. package/dist/run.mjs.map +0 -6
  207. package/dist/task.cjs.map +0 -6
  208. package/dist/task.d.ts +0 -15
  209. package/dist/task.mjs +0 -14
  210. package/dist/task.mjs.map +0 -6
  211. package/src/run.ts +0 -159
  212. package/src/task.ts +0 -26
package/dist/log.cjs.map C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c,6BANd;AAOA,wBAAc,8BAPd;AAQA,wBAAc,6BARd;AAAA,IAeA,6BAAa;AAUN,IAAM,OAAoB,MAAmB;AAElD,QAAM,SAAS,MAAQ;AA3BzB;AA2B6B,mDAAe,MAAf,mBAAkB,YAAO,yBAAU;AAAA;AAG9D,QAAM,UAAe;AAAA,IACnB,SAAS,MAA4B;AACnC,aAAO,EAAE,MAAM,GAAG,IAAI;AACtB,aAAO;AAAA,IACT;AAAA,IAEA,SAAS,MAA4B;AACnC,aAAO,EAAE,MAAM,GAAG,IAAI;AACtB,aAAO;AAAA,IACT;AAAA,IAEA,QAAQ,MAA4B;AAClC,aAAO,EAAE,KAAK,GAAG,IAAI;AACrB,aAAO;AAAA,IACT;AAAA,IAEA,UAAU,MAA4B;AACpC,aAAO,EAAE,OAAO,GAAG,IAAI;AACvB,aAAO;AAAA,IACT;AAAA,IAEA,QAAQ,MAA4B;AAClC,aAAO,EAAE,KAAK,GAAG,IAAI;AACrB,aAAO;AAAA,IACT;AAAA,IAEA,SAAS,MAA4B;AACnC,aAAO,EAAE,MAAM,GAAG,IAAI;AACtB,aAAO;AAAA,IACT;AAAA,EACF;AAGA,QAAMA,OAAM,IAAI,SAAgC,KAAK,QAAQ,OAAO,GAAG,IAAI;AAG3E,SAAO,OAAO,OAAOA,MAAK,OAAO;AACnC,GAAG;",
5
5
  "names": ["log"]
6
6
  }
package/dist/log.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { Log } from './log/logger.js';
2
- export * from './log/colors.js';
3
- export * from './log/levels.js';
4
- export * from './log/logger.js';
5
- export * from './log/options.js';
6
- export * from './log/report.js';
1
+ import { Log } from './log/logger';
2
+ export * from './log/colors';
3
+ export * from './log/levels';
4
+ export * from './log/logger';
5
+ export * from './log/options';
6
+ export * from './log/report';
7
7
  /** The generic, shared `log` function type. */
8
8
  export declare type LogFunction = ((...args: [any, ...any]) => void) & Log;
9
9
  /** Our logging function (defaulting to the `NOTICE` level) */
package/dist/log.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // log.ts
2
- import { currentRun } from "./async.mjs";
2
+ import { currentContext } from "./async.mjs";
3
3
  import { getLogger } from "./log/logger.mjs";
4
4
  import { setupSpinner } from "./log/spinner.mjs";
5
5
  export * from "./log/colors.mjs";
@@ -11,7 +11,7 @@ setupSpinner();
11
11
  var log = (() => {
12
12
  const logger = () => {
13
13
  var _a;
14
- return ((_a = currentRun()) == null ? void 0 : _a.log) || getLogger();
14
+ return ((_a = currentContext()) == null ? void 0 : _a.log) || getLogger();
15
15
  };
16
16
  const wrapper = {
17
17
  trace(...args) {
package/dist/log.mjs.map CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/log.ts"],
4
- "mappings": ";AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAsB;AAC/B,SAAS,oBAAoB;AAE7B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAOd,aAAa;AAUN,IAAM,OAAoB,MAAmB;AAElD,QAAM,SAAS,MAAQ;AA3BzB;AA2B6B,6BAAW,MAAX,mBAAc,QAAO,UAAU;AAAA;AAG1D,QAAM,UAAe;AAAA,IACnB,SAAS,MAA4B;AACnC,aAAO,EAAE,MAAM,GAAG,IAAI;AACtB,aAAO;AAAA,IACT;AAAA,IAEA,SAAS,MAA4B;AACnC,aAAO,EAAE,MAAM,GAAG,IAAI;AACtB,aAAO;AAAA,IACT;AAAA,IAEA,QAAQ,MAA4B;AAClC,aAAO,EAAE,KAAK,GAAG,IAAI;AACrB,aAAO;AAAA,IACT;AAAA,IAEA,UAAU,MAA4B;AACpC,aAAO,EAAE,OAAO,GAAG,IAAI;AACvB,aAAO;AAAA,IACT;AAAA,IAEA,QAAQ,MAA4B;AAClC,aAAO,EAAE,KAAK,GAAG,IAAI;AACrB,aAAO;AAAA,IACT;AAAA,IAEA,SAAS,MAA4B;AACnC,aAAO,EAAE,MAAM,GAAG,IAAI;AACtB,aAAO;AAAA,IACT;AAAA,EACF;AAGA,QAAMA,OAAM,IAAI,SAAgC,KAAK,QAAQ,OAAO,GAAG,IAAI;AAG3E,SAAO,OAAO,OAAOA,MAAK,OAAO;AACnC,GAAG;",
4
+ "mappings": ";AAAA,SAAS,sBAAsB;AAC/B,SAAS,iBAAsB;AAC/B,SAAS,oBAAoB;AAE7B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAOd,aAAa;AAUN,IAAM,OAAoB,MAAmB;AAElD,QAAM,SAAS,MAAQ;AA3BzB;AA2B6B,iCAAe,MAAf,mBAAkB,QAAO,UAAU;AAAA;AAG9D,QAAM,UAAe;AAAA,IACnB,SAAS,MAA4B;AACnC,aAAO,EAAE,MAAM,GAAG,IAAI;AACtB,aAAO;AAAA,IACT;AAAA,IAEA,SAAS,MAA4B;AACnC,aAAO,EAAE,MAAM,GAAG,IAAI;AACtB,aAAO;AAAA,IACT;AAAA,IAEA,QAAQ,MAA4B;AAClC,aAAO,EAAE,KAAK,GAAG,IAAI;AACrB,aAAO;AAAA,IACT;AAAA,IAEA,UAAU,MAA4B;AACpC,aAAO,EAAE,OAAO,GAAG,IAAI;AACvB,aAAO;AAAA,IACT;AAAA,IAEA,QAAQ,MAA4B;AAClC,aAAO,EAAE,KAAK,GAAG,IAAI;AACrB,aAAO;AAAA,IACT;AAAA,IAEA,SAAS,MAA4B;AACnC,aAAO,EAAE,MAAM,GAAG,IAAI;AACtB,aAAO;AAAA,IACT;AAAA,EACF;AAGA,QAAMA,OAAM,IAAI,SAAgC,KAAK,QAAQ,OAAO,GAAG,IAAI;AAG3E,SAAO,OAAO,OAAOA,MAAK,OAAO;AACnC,GAAG;",
5
5
  "names": ["log"]
6
6
  }
package/dist/pipe.cjs CHANGED
@@ -20,52 +20,59 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // pipe.ts
21
21
  var pipe_exports = {};
22
22
  __export(pipe_exports, {
23
+ Context: () => Context,
23
24
  Pipe: () => Pipe,
24
- PipeImpl: () => PipeImpl,
25
- install: () => install
25
+ install: () => install,
26
+ installForking: () => installForking
26
27
  });
27
28
  module.exports = __toCommonJS(pipe_exports);
28
- var import_assert = require("./assert.cjs");
29
- var Pipe = class {
30
- };
31
- var PipeImpl = class extends Pipe {
32
- #promise;
33
- #run;
34
- constructor(start, run) {
35
- super();
36
- this.#promise = Promise.resolve(start);
37
- this.#run = run;
38
- }
39
- plug(arg) {
40
- const plug = typeof arg === "function" ? { pipe: arg } : arg;
41
- const promise = this.#promise.then((files) => {
42
- (0, import_assert.assert)(files, "Pipe can not be further extended");
43
- return plug.pipe(files, this.#run);
44
- });
45
- return new PipeImpl(promise, this.#run);
46
- }
47
- then(onfulfilled, onrejected) {
48
- return this.#promise.then(onfulfilled, onrejected);
49
- }
50
- catch(onrejected) {
51
- return this.#promise.catch(onrejected);
29
+ var import_log = require("./log.cjs");
30
+ var import_paths = require("./paths.cjs");
31
+ var import_fork = require("./fork.cjs");
32
+ var import_path = require("path");
33
+ var Context = class {
34
+ constructor(buildFile, taskName) {
35
+ this.buildFile = buildFile;
36
+ this.taskName = taskName;
37
+ this.buildDir = (0, import_paths.getAbsoluteParent)(buildFile);
38
+ this.log = (0, import_log.getLogger)(taskName);
52
39
  }
53
- finally(onfinally) {
54
- return this.#promise.finally(onfinally);
40
+ buildDir;
41
+ log;
42
+ resolve(path, ...paths) {
43
+ if (path && path.startsWith("@")) {
44
+ const components = path.substring(1).split(import_path.sep).filter((s) => !!s);
45
+ return (0, import_paths.resolveAbsolutePath)(this.buildDir, ...components, ...paths);
46
+ }
47
+ if (!path)
48
+ return (0, import_paths.getCurrentWorkingDirectory)();
49
+ return (0, import_paths.resolveAbsolutePath)((0, import_paths.getCurrentWorkingDirectory)(), path, ...paths);
55
50
  }
56
- [Symbol.toStringTag] = "Pipe";
51
+ };
52
+ var PipeProto = class {
53
+ };
54
+ var Pipe = class extends PipeProto {
57
55
  };
58
56
  function install(name, ctor) {
59
- function create(...args) {
57
+ function plug(...args) {
60
58
  return this.plug(new ctor(...args));
61
59
  }
62
- Object.defineProperty(create, "name", { value: name });
63
- Object.defineProperty(Pipe.prototype, name, { value: create });
60
+ Object.defineProperty(plug, "name", { value: name });
61
+ Object.defineProperty(PipeProto.prototype, name, { value: plug });
62
+ }
63
+ function installForking(plugName, scriptFile) {
64
+ const ctor = class extends import_fork.ForkingPlug {
65
+ constructor(...args) {
66
+ super(scriptFile, args);
67
+ }
68
+ };
69
+ install(plugName, ctor);
64
70
  }
65
71
  // Annotate the CommonJS export names for ESM import in node:
66
72
  0 && (module.exports = {
73
+ Context,
67
74
  Pipe,
68
- PipeImpl,
69
- install
75
+ install,
76
+ installForking
70
77
  });
71
78
  //# sourceMappingURL=pipe.cjs.map
package/dist/pipe.cjs.map CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/pipe.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AA4BhB,IAAe,OAAf,MAAoC;AAG3C;AAIO,IAAM,WAAN,cAAoD,KAA2B;AAAA,EAC3E;AAAA,EACA;AAAA,EAET,YAAY,OAAuB,KAAU;AAC3C,UAAM;AACN,SAAK,WAAW,QAAQ,QAAQ,KAAK;AACrC,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,KAAkC,KAAmD;AACnF,UAAM,OAAO,OAAO,QAAQ,aAAa,EAAE,MAAM,IAAI,IAAI;AACzD,UAAM,UAAU,KAAK,SAAS,KAAK,CAAC,UAAU;AAC5C,gCAAO,OAAO,kCAAkC;AAChD,aAAO,KAAK,KAAK,OAAO,KAAK,IAAI;AAAA,IACnC,CAAC;AACD,WAAO,IAAI,SAAS,SAAS,KAAK,IAAI;AAAA,EACxC;AAAA,EAEA,KACI,aACA,YACgB;AAClB,WAAO,KAAK,SAAS,KAAK,aAAa,UAAU;AAAA,EACnD;AAAA,EAEA,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AAEvF,WAAO,KAAK,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC;AAAA,EACpC;AAGA,SAAO,eAAe,MAAM,QAAQ,EAAE,OAAO,KAAK,CAAC;AAGnD,SAAO,eAAe,UAAU,WAAW,MAAM,EAAE,OAAO,KAAK,CAAC;AAClE;AAmBO,SAAS,eACZ,UACA,YACI;AAEN,QAAM,OAAO,cAAc,wBAAY;AAAA,IACrC,eAAe,MAAa;AAC1B,YAAM,YAAY,IAAI;AAAA,IACxB;AAAA,EACF;AAGA,UAAQ,UAAU,IAAI;AACxB;",
5
5
  "names": []
6
6
  }
package/dist/pipe.d.ts CHANGED
@@ -1,128 +1,138 @@
1
- import { Files } from './files.js';
2
- import { Run } from './run.js';
1
+ import type { Files } from './files';
2
+ import { Logger } from './log';
3
+ import { AbsolutePath } from './paths';
4
+ /** A convenience type indicating what can be returned by a {@link Plug}. */
5
+ export declare type PlugResult = Files | undefined | void;
3
6
  /**
4
- * The {@link Plug} interface describes an extension mechanism for our build.
7
+ * The {@link Plug} interface describes _build plugin_.
8
+ *
9
+ * A {@link Plug} receives a {@link Files} instance in its input (for example
10
+ * a list of _source `.ts` files_) and optionally produces a possibly different
11
+ * list (for example the _compiled `.js` files_).
5
12
  */
6
- export interface Plug<T extends Files | undefined> {
7
- pipe(files: Files, run: Run): T | Promise<T>;
13
+ export interface Plug<T extends PlugResult> {
14
+ pipe(files: Files, context: Context): T | Promise<T>;
8
15
  }
16
+ /** A type identifying a {@link Plug} as a `function` */
17
+ export declare type PlugFunction<T extends PlugResult> = Plug<T>['pipe'];
9
18
  /**
10
- * A type identifying a {@link Plug} as a `function`
19
+ * The {@link Context} class defines the context in which a {@link Plug}
20
+ * is invoked.
11
21
  */
12
- export declare type PlugFunction<T extends Files | undefined> = Plug<T>['pipe'];
22
+ export declare class Context {
23
+ /** The absolute file name where the task was defined. */
24
+ readonly buildFile: AbsolutePath;
25
+ /** The _name_ of the task associated with this {@link Context}. */
26
+ readonly taskName: string;
27
+ /** The directory of the file where the task was defined (convenience). */
28
+ readonly buildDir: AbsolutePath;
29
+ /** The {@link Logger} associated with this instance. */
30
+ readonly log: Logger;
31
+ constructor(
32
+ /** The absolute file name where the task was defined. */
33
+ buildFile: AbsolutePath,
34
+ /** The _name_ of the task associated with this {@link Context}. */
35
+ taskName: string);
36
+ resolve(path: string, ...paths: string[]): AbsolutePath;
37
+ }
13
38
  /**
14
- * A {@link Pipe} represents a sequence of operations performed by
15
- * a series of {@link Plug | Plugs}.
39
+ * A class that will be extended by {@link Pipe} where {@link install} will
40
+ * add prototype properties from installed {@link Plug}s
16
41
  */
17
- export interface Pipe {
42
+ declare abstract class PipeProto {
43
+ abstract plug(plug: Plug<PlugResult>): Pipe | Promise<undefined>;
18
44
  }
19
45
  /**
20
- * The {@link Pipe} abstract class exposes the prototype upon which all
21
- * extension plugs will be installed on.
46
+ * The {@link Pipe} abstract defines processing pipeline where multiple
47
+ * {@link Plug}s can transform lists of {@link Files}.
22
48
  */
23
- export declare abstract class Pipe implements Pipe {
24
- abstract plug(plug: Plug<Files> | PlugFunction<Files>): Pipe & Promise<Files>;
25
- abstract plug(plug: Plug<undefined> | PlugFunction<undefined>): Promise<undefined>;
26
- }
27
- /** Implementation of our {@link Pipe}. */
28
- export declare class PipeImpl<T extends Files | undefined> extends Pipe implements Promise<T> {
29
- #private;
30
- constructor(start: T | Promise<T>, run: Run);
31
- plug<T extends Files | undefined>(arg: Plug<T> | PlugFunction<T>): Pipe & Promise<T>;
32
- then<T1 = T, T2 = never>(onfulfilled?: ((value: T) => T1 | PromiseLike<T1>) | null | undefined, onrejected?: ((reason: any) => T2 | PromiseLike<T2>) | null | undefined): Promise<T1 | T2>;
33
- catch<T0 = never>(onrejected?: ((reason: any) => T0 | PromiseLike<T0>) | null | undefined): Promise<T0 | T>;
34
- finally(onfinally?: (() => void) | null | undefined): Promise<T>;
35
- [Symbol.toStringTag]: string;
49
+ export declare abstract class Pipe extends PipeProto {
50
+ abstract plug(plug: Plug<Files>): Pipe;
51
+ abstract plug(plug: PlugFunction<Files>): Pipe;
52
+ abstract plug(plug: Plug<void | undefined>): Promise<undefined>;
53
+ abstract plug(plug: PlugFunction<void | undefined>): Promise<undefined>;
54
+ abstract run(): Promise<Files>;
36
55
  }
37
56
  /** The names which can be installed as direct plugs. */
38
- export declare type PlugName = string & Exclude<keyof Pipe, 'plug' | keyof Promise<Files>>;
39
- /** A convenience type identifying a {@link Plug} constructor. */
40
- export declare type PlugConstructor = new (...args: any) => Plug<Files | undefined>;
41
- /** Convert the resulting type of a {@link Plug} for use in a {@link Pipe} */
42
- declare type PlugReturnForPipe<T> = T extends Plug<infer R> ? R extends Files ? Promise<Files> & Pipe : R extends undefined ? Promise<undefined> : never : never;
43
- /**
44
- * Map constructors into an array of all known overloads.
45
- *
46
- * This is a _royal_ pain in the ass, as we need to distinguish between
47
- * all possible number of overloads of a constructor... Limit to 5 of them!
48
- *
49
- * Also, the empty constructor (when specified in the overloads) will simply
50
- * match the first case (most overloads) and generate functions somewhat like
51
- *
52
- * (...args: unknown[]) => never
53
- * (...args: unknown[]) => never
54
- * (...args: unknown[]) => never
55
- * () => PlugReturnForPipe<R3>
56
- * (arg: Options) => PlugReturnForPipe<R4>
57
- *
58
- * Somehow inferring the result to `Function` or the right type and ANDing all
59
- * those together here doesn't work, so we create this array and we'll AND
60
- * all its members in the PipeExtension<...> type.
61
- */
62
- declare type PlugConstructorOverloads<T extends PlugConstructor> = T extends {
63
- new (...args: infer A0): infer R0;
64
- new (...args: infer A1): infer R1;
65
- new (...args: infer A2): infer R2;
66
- new (...args: infer A3): infer R3;
67
- new (...args: infer A4): infer R4;
68
- } ? [
69
- R0 extends Plug<Files | undefined> ? ((...args: A0) => PlugReturnForPipe<R0>) : Function,
70
- R1 extends Plug<Files | undefined> ? ((...args: A1) => PlugReturnForPipe<R1>) : Function,
71
- R2 extends Plug<Files | undefined> ? ((...args: A2) => PlugReturnForPipe<R2>) : Function,
72
- R3 extends Plug<Files | undefined> ? ((...args: A3) => PlugReturnForPipe<R3>) : Function,
73
- R4 extends Plug<Files | undefined> ? ((...args: A4) => PlugReturnForPipe<R4>) : Function
74
- ] : T extends {
75
- new (...args: infer A0): infer R0;
76
- new (...args: infer A1): infer R1;
77
- new (...args: infer A2): infer R2;
78
- new (...args: infer A3): infer R3;
79
- } ? [
80
- R0 extends Plug<Files | undefined> ? (...args: A0) => PlugReturnForPipe<R0> : Function,
81
- R1 extends Plug<Files | undefined> ? (...args: A1) => PlugReturnForPipe<R1> : Function,
82
- R2 extends Plug<Files | undefined> ? (...args: A2) => PlugReturnForPipe<R2> : Function,
83
- R3 extends Plug<Files | undefined> ? (...args: A3) => PlugReturnForPipe<R3> : Function
84
- ] : T extends {
85
- new (...args: infer A0): infer R0;
86
- new (...args: infer A1): infer R1;
87
- new (...args: infer A2): infer R2;
88
- } ? [
89
- R0 extends Plug<Files | undefined> ? (...args: A0) => PlugReturnForPipe<R0> : Function,
90
- R1 extends Plug<Files | undefined> ? (...args: A1) => PlugReturnForPipe<R1> : Function,
91
- R2 extends Plug<Files | undefined> ? (...args: A2) => PlugReturnForPipe<R2> : Function
92
- ] : T extends {
93
- new (...args: infer A0): infer R0;
94
- new (...args: infer A1): infer R1;
95
- } ? [
96
- R0 extends Plug<Files | undefined> ? (...args: A0) => PlugReturnForPipe<R0> : Function,
97
- R1 extends Plug<Files | undefined> ? (...args: A1) => PlugReturnForPipe<R1> : Function
98
- ] : T extends {
99
- new (...args: infer A0): infer R0;
100
- } ? [
101
- R0 extends Plug<Files | undefined> ? (...args: A0) => PlugReturnForPipe<R0> : Function
102
- ] : never;
57
+ export declare type PlugName = string & Exclude<keyof Pipe, 'plug' | 'run'>;
58
+ /** The parameters of the plug extension with the given name */
59
+ export declare type PipeParameters<Name extends PlugName> = PipeOverloads<Name>['args'];
60
+ /** Extract arguments and return types from function overloads. */
61
+ declare type PipeOverloads<Name extends PlugName> = Pipe[Name] extends {
62
+ (...args: infer A0): infer R0;
63
+ (...args: infer A1): infer R1;
64
+ (...args: infer A2): infer R2;
65
+ (...args: infer A3): infer R3;
66
+ (...args: infer A4): infer R4;
67
+ } ? (R0 extends (Pipe | Promise<undefined>) ? {
68
+ args: A0;
69
+ ret: R0;
70
+ } : never) | (R1 extends (Pipe | Promise<undefined>) ? {
71
+ args: A1;
72
+ ret: R1;
73
+ } : never) | (R2 extends (Pipe | Promise<undefined>) ? {
74
+ args: A2;
75
+ ret: R2;
76
+ } : never) | (R3 extends (Pipe | Promise<undefined>) ? {
77
+ args: A3;
78
+ ret: R3;
79
+ } : never) | (R4 extends (Pipe | Promise<undefined>) ? {
80
+ args: A4;
81
+ ret: R4;
82
+ } : never) : Pipe[Name] extends {
83
+ (...args: infer A0): infer R0;
84
+ (...args: infer A1): infer R1;
85
+ (...args: infer A2): infer R2;
86
+ (...args: infer A3): infer R3;
87
+ } ? (R0 extends (Pipe | Promise<undefined>) ? {
88
+ args: A0;
89
+ ret: R0;
90
+ } : never) | (R1 extends (Pipe | Promise<undefined>) ? {
91
+ args: A1;
92
+ ret: R1;
93
+ } : never) | (R2 extends (Pipe | Promise<undefined>) ? {
94
+ args: A2;
95
+ ret: R2;
96
+ } : never) | (R3 extends (Pipe | Promise<undefined>) ? {
97
+ args: A3;
98
+ ret: R3;
99
+ } : never) : Pipe[Name] extends {
100
+ (...args: infer A0): infer R0;
101
+ (...args: infer A1): infer R1;
102
+ (...args: infer A2): infer R2;
103
+ } ? (R0 extends (Pipe | Promise<undefined>) ? {
104
+ args: A0;
105
+ ret: R0;
106
+ } : never) | (R1 extends (Pipe | Promise<undefined>) ? {
107
+ args: A1;
108
+ ret: R1;
109
+ } : never) | (R2 extends (Pipe | Promise<undefined>) ? {
110
+ args: A2;
111
+ ret: R2;
112
+ } : never) : Pipe[Name] extends {
113
+ (...args: infer A0): infer R0;
114
+ (...args: infer A1): infer R1;
115
+ } ? (R0 extends (Pipe | Promise<undefined>) ? {
116
+ args: A0;
117
+ ret: R0;
118
+ } : never) | (R1 extends (Pipe | Promise<undefined>) ? {
119
+ args: A1;
120
+ ret: R1;
121
+ } : never) : Pipe[Name] extends {
122
+ (...args: infer A0): infer R0;
123
+ } ? (R0 extends (Pipe | Promise<undefined>) ? {
124
+ args: A0;
125
+ ret: R0;
126
+ } : never) : never;
127
+ /** The parameters of the plug extension with the given name */
128
+ declare type PipeResult<Name extends PlugName> = PipeOverloads<Name>['ret'];
103
129
  /**
104
- * A convenience type to easily annotate installed {@link Plug Plugs}.
105
- *
106
- * See also {@link install}.
107
- *
108
- * ```
109
- * export class Write implements Plug {
110
- * // ... the plug implementation lives here
111
- * }
112
- *
113
- * install('write', Write)
114
- *
115
- * declare module '../pipe' {
116
- * export interface Pipe {
117
- * write: PipeExtension<typeof Write>
118
- * }
119
- * }
120
- * ```
130
+ * A type defining the correct constructor for a {@link Plug}, inferring
131
+ * argument types and instance type from the definitions in {@link Pipe}.
121
132
  */
122
- export declare type PipeExtension<T extends PlugConstructor, A = PlugConstructorOverloads<T>> = A extends readonly [infer First, ...infer Rest] ? First & PipeExtension<T, Rest> : A extends readonly [infer Only] ? Only : Function;
133
+ declare type PlugConstructor<Name extends PlugName> = PipeResult<Name> extends Pipe ? new (...args: PipeParameters<Name>) => Plug<Files> : PipeResult<Name> extends Promise<undefined> ? new (...args: PipeParameters<Name>) => Plug<void | undefined> : PipeResult<Name> extends (Pipe | Promise<undefined>) ? new (...args: PipeParameters<Name>) => Plug<Files | void | undefined> : never;
123
134
  /**
124
- * Install a {@link Plug} into our {@link Pipe} prototype, and return a static
125
- * creator function for the {@link Plug} itself.
135
+ * Install a {@link Plug} into our {@link Pipe} prototype.
126
136
  *
127
137
  * This allows our shorthand syntax for well-defined plugs such as:
128
138
  *
@@ -135,18 +145,38 @@ export declare type PipeExtension<T extends PlugConstructor, A = PlugConstructor
135
145
  * Use this alongside interface merging like:
136
146
  *
137
147
  * ```
138
- * export class Write implements Plug {
139
- * // ... the plug implementation lives here
140
- * }
141
- *
142
- * install('write', Write)
143
- *
144
- * declare module '../pipe' {
148
+ * declare module '@plugjs/plug/pipe' {
145
149
  * export interface Pipe {
146
- * write: PipeExtension<typeof Write>
150
+ * write(): Pipe
147
151
  * }
148
152
  * }
153
+ *
154
+ * install('write', class Write implements Plug {
155
+ * constructorg(...args: PipeParams<'write'>) {
156
+ * // here `args` is automatically inferred by whatever was declared above
157
+ * }
158
+ *
159
+ * // ... the plug implementation lives here
160
+ * })
149
161
  * ```
150
162
  */
151
- export declare function install<C extends PlugConstructor>(name: PlugName, ctor: C): void;
163
+ export declare function install<Name extends PlugName, Ctor extends PlugConstructor<Name>>(name: Name, ctor: Ctor): void;
164
+ /**
165
+ * Install a _forking_ {@link Plug} in the {@link Pipe}, in other words
166
+ * execute the plug in a separate process.
167
+ *
168
+ * As a contract, if the _last non-null_ parameter of the constructor is an
169
+ * object and contains the key `coverageDir`, the process will be forked with
170
+ * the approptiately resolved `NODE_V8_COVERAGE` environment variable.
171
+ *
172
+ * Also, forking plugs require some special attention:
173
+ *
174
+ * * plug functions are not supported, only classes implementing the
175
+ * {@link Plug} interface can be used with this.
176
+ *
177
+ * * the class itself _MUST_ be exported as the _default_ export for the
178
+ * `scriptFile` specified below. This is to simplify interoperability between
179
+ * CommonJS and ESM modules as we use dynamic `import(...)` statements.
180
+ */
181
+ export declare function installForking<Name extends PlugName>(plugName: Name, scriptFile: AbsolutePath): void;
152
182
  export {};
package/dist/pipe.mjs CHANGED
@@ -1,44 +1,50 @@
1
1
  // pipe.ts
2
- import { assert } from "./assert.mjs";
3
- var Pipe = class {
4
- };
5
- var PipeImpl = class extends Pipe {
6
- #promise;
7
- #run;
8
- constructor(start, run) {
9
- super();
10
- this.#promise = Promise.resolve(start);
11
- this.#run = run;
12
- }
13
- plug(arg) {
14
- const plug = typeof arg === "function" ? { pipe: arg } : arg;
15
- const promise = this.#promise.then((files) => {
16
- assert(files, "Pipe can not be further extended");
17
- return plug.pipe(files, this.#run);
18
- });
19
- return new PipeImpl(promise, this.#run);
20
- }
21
- then(onfulfilled, onrejected) {
22
- return this.#promise.then(onfulfilled, onrejected);
23
- }
24
- catch(onrejected) {
25
- return this.#promise.catch(onrejected);
2
+ import { getLogger } from "./log.mjs";
3
+ import { getAbsoluteParent, getCurrentWorkingDirectory, resolveAbsolutePath } from "./paths.mjs";
4
+ import { ForkingPlug } from "./fork.mjs";
5
+ import { sep } from "path";
6
+ var Context = class {
7
+ constructor(buildFile, taskName) {
8
+ this.buildFile = buildFile;
9
+ this.taskName = taskName;
10
+ this.buildDir = getAbsoluteParent(buildFile);
11
+ this.log = getLogger(taskName);
26
12
  }
27
- finally(onfinally) {
28
- return this.#promise.finally(onfinally);
13
+ buildDir;
14
+ log;
15
+ resolve(path, ...paths) {
16
+ if (path && path.startsWith("@")) {
17
+ const components = path.substring(1).split(sep).filter((s) => !!s);
18
+ return resolveAbsolutePath(this.buildDir, ...components, ...paths);
19
+ }
20
+ if (!path)
21
+ return getCurrentWorkingDirectory();
22
+ return resolveAbsolutePath(getCurrentWorkingDirectory(), path, ...paths);
29
23
  }
30
- [Symbol.toStringTag] = "Pipe";
24
+ };
25
+ var PipeProto = class {
26
+ };
27
+ var Pipe = class extends PipeProto {
31
28
  };
32
29
  function install(name, ctor) {
33
- function create(...args) {
30
+ function plug(...args) {
34
31
  return this.plug(new ctor(...args));
35
32
  }
36
- Object.defineProperty(create, "name", { value: name });
37
- Object.defineProperty(Pipe.prototype, name, { value: create });
33
+ Object.defineProperty(plug, "name", { value: name });
34
+ Object.defineProperty(PipeProto.prototype, name, { value: plug });
35
+ }
36
+ function installForking(plugName, scriptFile) {
37
+ const ctor = class extends ForkingPlug {
38
+ constructor(...args) {
39
+ super(scriptFile, args);
40
+ }
41
+ };
42
+ install(plugName, ctor);
38
43
  }
39
44
  export {
45
+ Context,
40
46
  Pipe,
41
- PipeImpl,
42
- install
47
+ install,
48
+ installForking
43
49
  };
44
50
  //# sourceMappingURL=pipe.mjs.map
package/dist/pipe.mjs.map CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2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