@plugjs/plug 0.0.27 → 0.1.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/{failure.cjs → asserts.cjs} +29 -9
- package/dist/asserts.cjs.map +6 -0
- package/dist/{failure.d.ts → asserts.d.ts} +4 -1
- package/dist/asserts.mjs +51 -0
- package/dist/asserts.mjs.map +6 -0
- package/dist/async.cjs +2 -2
- package/dist/async.cjs.map +1 -1
- package/dist/async.mjs +2 -2
- package/dist/async.mjs.map +1 -1
- package/dist/build.cjs +21 -30
- package/dist/build.cjs.map +1 -1
- package/dist/build.d.ts +2 -13
- package/dist/build.mjs +16 -24
- package/dist/build.mjs.map +1 -1
- package/dist/files.cjs +3 -3
- package/dist/files.cjs.map +1 -1
- package/dist/files.mjs +1 -1
- package/dist/files.mjs.map +1 -1
- package/dist/fork.cjs +35 -30
- package/dist/fork.cjs.map +1 -1
- package/dist/fork.d.ts +6 -3
- package/dist/fork.mjs +18 -13
- package/dist/fork.mjs.map +1 -1
- package/dist/{utils/asyncfs.cjs → fs.cjs} +6 -6
- package/dist/{utils/asyncfs.cjs.map → fs.cjs.map} +2 -2
- package/dist/{utils/asyncfs.d.ts → fs.d.ts} +1 -1
- package/dist/{utils/asyncfs.mjs → fs.mjs} +3 -3
- package/dist/{utils/asyncfs.mjs.map → fs.mjs.map} +2 -2
- package/dist/helpers.cjs +21 -14
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.ts +24 -1
- package/dist/helpers.mjs +13 -7
- package/dist/helpers.mjs.map +1 -1
- package/dist/index.cjs +36 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +25 -8
- package/dist/index.mjs +20 -5
- package/dist/index.mjs.map +1 -1
- package/dist/{log → logging}/colors.cjs +1 -1
- package/dist/{log → logging}/colors.cjs.map +1 -1
- package/dist/{log → logging}/colors.d.ts +0 -0
- package/dist/{log → logging}/colors.mjs +1 -1
- package/dist/{log → logging}/colors.mjs.map +1 -1
- package/dist/{log → logging}/emit.cjs +1 -2
- package/dist/{log → logging}/emit.cjs.map +2 -2
- package/dist/{log → logging}/emit.d.ts +0 -0
- package/dist/{log → logging}/emit.mjs +1 -2
- package/dist/{log → logging}/emit.mjs.map +2 -2
- package/dist/{log → logging}/levels.cjs +1 -1
- package/dist/{log → logging}/levels.cjs.map +1 -1
- package/dist/{log → logging}/levels.d.ts +0 -0
- package/dist/{log → logging}/levels.mjs +1 -1
- package/dist/{log → logging}/levels.mjs.map +1 -1
- package/dist/{log → logging}/logger.cjs +13 -7
- package/dist/logging/logger.cjs.map +6 -0
- package/dist/{log → logging}/logger.d.ts +0 -0
- package/dist/{log → logging}/logger.mjs +11 -5
- package/dist/logging/logger.mjs.map +6 -0
- package/dist/{log → logging}/options.cjs +12 -6
- package/dist/logging/options.cjs.map +6 -0
- package/dist/{log → logging}/options.d.ts +1 -1
- package/dist/{log → logging}/options.mjs +12 -6
- package/dist/logging/options.mjs.map +6 -0
- package/dist/{log → logging}/report.cjs +10 -9
- package/dist/{log → logging}/report.cjs.map +2 -2
- package/dist/{log → logging}/report.d.ts +0 -0
- package/dist/{log → logging}/report.mjs +7 -6
- package/dist/{log → logging}/report.mjs.map +2 -2
- package/dist/{log → logging}/spinner.cjs +1 -1
- package/dist/{log → logging}/spinner.cjs.map +1 -1
- package/dist/{log → logging}/spinner.d.ts +0 -0
- package/dist/{log → logging}/spinner.mjs +1 -1
- package/dist/{log → logging}/spinner.mjs.map +1 -1
- package/dist/{log.cjs → logging.cjs} +12 -12
- package/dist/{log.cjs.map → logging.cjs.map} +2 -2
- package/dist/{log.d.ts → logging.d.ts} +6 -6
- package/dist/{log.mjs → logging.mjs} +9 -9
- package/dist/{log.mjs.map → logging.mjs.map} +1 -1
- package/dist/paths.cjs +5 -5
- package/dist/paths.cjs.map +1 -1
- package/dist/paths.mjs +1 -1
- package/dist/pipe.cjs +10 -13
- package/dist/pipe.cjs.map +1 -1
- package/dist/pipe.d.ts +6 -12
- package/dist/pipe.mjs +6 -9
- package/dist/pipe.mjs.map +1 -1
- package/dist/plugs/copy.cjs +14 -14
- package/dist/plugs/copy.cjs.map +1 -1
- package/dist/plugs/copy.d.ts +1 -1
- package/dist/plugs/copy.mjs +3 -3
- package/dist/plugs/copy.mjs.map +1 -1
- package/dist/plugs/debug.cjs +7 -7
- package/dist/plugs/debug.cjs.map +1 -1
- package/dist/plugs/debug.d.ts +1 -1
- package/dist/plugs/debug.mjs +1 -1
- package/dist/plugs/edit.cjs +21 -0
- package/dist/plugs/edit.cjs.map +6 -0
- package/dist/plugs/edit.d.ts +7 -0
- package/dist/plugs/edit.mjs +29 -0
- package/dist/plugs/edit.mjs.map +6 -0
- package/dist/plugs/esbuild/fix-extensions.cjs +4 -4
- package/dist/plugs/esbuild/fix-extensions.cjs.map +1 -1
- package/dist/plugs/esbuild/fix-extensions.mjs +1 -1
- package/dist/plugs/esbuild/fix-extensions.mjs.map +1 -1
- package/dist/plugs/esbuild.cjs +19 -14
- package/dist/plugs/esbuild.cjs.map +1 -1
- package/dist/plugs/esbuild.d.ts +1 -1
- package/dist/plugs/esbuild.mjs +8 -3
- package/dist/plugs/esbuild.mjs.map +1 -1
- package/dist/plugs/exec.cjs +2 -82
- package/dist/plugs/exec.cjs.map +2 -2
- package/dist/plugs/exec.d.ts +6 -32
- package/dist/plugs/exec.mjs +2 -68
- package/dist/plugs/exec.mjs.map +1 -1
- package/dist/plugs/filter.d.ts +1 -1
- package/dist/plugs/rmf.cjs +5 -5
- package/dist/plugs/rmf.cjs.map +1 -1
- package/dist/plugs/rmf.d.ts +1 -1
- package/dist/plugs/rmf.mjs +2 -2
- package/dist/plugs/rmf.mjs.map +1 -1
- package/dist/plugs.cjs +1 -4
- package/dist/plugs.cjs.map +1 -1
- package/dist/plugs.d.ts +1 -4
- package/dist/plugs.mjs +1 -4
- package/dist/plugs.mjs.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/caller.cjs +8 -5
- package/dist/utils/caller.cjs.map +1 -1
- package/dist/utils/caller.mjs +6 -3
- package/dist/utils/caller.mjs.map +1 -1
- package/dist/utils/exec.cjs +102 -0
- package/dist/utils/exec.cjs.map +6 -0
- package/dist/utils/exec.d.ts +15 -0
- package/dist/utils/exec.mjs +71 -0
- package/dist/utils/exec.mjs.map +6 -0
- package/dist/utils/walk.cjs +7 -7
- package/dist/utils/walk.cjs.map +1 -1
- package/dist/utils/walk.mjs +2 -2
- package/dist/utils/walk.mjs.map +1 -1
- package/dist/{plugs/tsc.cjs → utils.cjs} +9 -7
- package/dist/utils.cjs.map +6 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.mjs +6 -0
- package/dist/utils.mjs.map +6 -0
- package/extra/cli.mjs +26 -5
- package/extra/ts-loader.mjs +2 -2
- package/package.json +90 -15
- package/src/{assert.ts → asserts.ts} +36 -1
- package/src/async.ts +3 -1
- package/src/files.ts +1 -1
- package/src/fork.ts +19 -11
- package/src/{utils/asyncfs.ts → fs.ts} +1 -1
- package/src/helpers.ts +40 -8
- package/src/index.ts +30 -8
- package/src/{log → logging}/colors.ts +0 -0
- package/src/{log → logging}/emit.ts +0 -1
- package/src/{log → logging}/levels.ts +0 -0
- package/src/{log → logging}/logger.ts +13 -4
- package/src/{log → logging}/options.ts +11 -7
- package/src/{log → logging}/report.ts +10 -9
- package/src/{log → logging}/spinner.ts +0 -0
- package/src/{log.ts → logging.ts} +7 -7
- package/src/paths.ts +1 -1
- package/src/pipe.ts +13 -20
- package/src/plugs/copy.ts +4 -4
- package/src/plugs/debug.ts +2 -2
- package/src/plugs/edit.ts +34 -0
- package/src/plugs/esbuild/fix-extensions.ts +2 -2
- package/src/plugs/esbuild.ts +13 -7
- package/src/plugs/exec.ts +8 -129
- package/src/plugs/filter.ts +1 -1
- package/src/plugs/rmf.ts +3 -3
- package/src/plugs.ts +1 -13
- package/src/types.ts +1 -1
- package/src/utils/caller.ts +6 -3
- package/src/utils/exec.ts +112 -0
- package/src/utils/walk.ts +3 -3
- package/src/utils.ts +4 -0
- package/types/{webassembly.d.ts → plugjs.d.ts} +7 -1
- package/dist/assert.cjs +0 -52
- package/dist/assert.cjs.map +0 -6
- package/dist/assert.d.ts +0 -4
- package/dist/assert.mjs +0 -26
- package/dist/assert.mjs.map +0 -6
- package/dist/failure.cjs.map +0 -6
- package/dist/failure.mjs +0 -33
- package/dist/failure.mjs.map +0 -6
- package/dist/log/logger.cjs.map +0 -6
- package/dist/log/logger.mjs.map +0 -6
- package/dist/log/options.cjs.map +0 -6
- package/dist/log/options.mjs.map +0 -6
- package/dist/plugs/coverage/analysis.cjs +0 -234
- package/dist/plugs/coverage/analysis.cjs.map +0 -6
- package/dist/plugs/coverage/analysis.d.ts +0 -104
- package/dist/plugs/coverage/analysis.mjs +0 -207
- package/dist/plugs/coverage/analysis.mjs.map +0 -6
- package/dist/plugs/coverage/report.cjs +0 -235
- package/dist/plugs/coverage/report.cjs.map +0 -6
- package/dist/plugs/coverage/report.d.ts +0 -59
- package/dist/plugs/coverage/report.mjs +0 -220
- package/dist/plugs/coverage/report.mjs.map +0 -6
- package/dist/plugs/coverage.cjs +0 -140
- package/dist/plugs/coverage.cjs.map +0 -6
- package/dist/plugs/coverage.d.ts +0 -49
- package/dist/plugs/coverage.mjs +0 -123
- package/dist/plugs/coverage.mjs.map +0 -6
- package/dist/plugs/eslint/runner.cjs +0 -91
- package/dist/plugs/eslint/runner.cjs.map +0 -6
- package/dist/plugs/eslint/runner.d.ts +0 -8
- package/dist/plugs/eslint/runner.mjs +0 -68
- package/dist/plugs/eslint/runner.mjs.map +0 -6
- package/dist/plugs/eslint.cjs +0 -22
- package/dist/plugs/eslint.cjs.map +0 -6
- package/dist/plugs/eslint.d.ts +0 -34
- package/dist/plugs/eslint.mjs +0 -5
- package/dist/plugs/eslint.mjs.map +0 -6
- package/dist/plugs/mocha/reporter.cjs +0 -159
- package/dist/plugs/mocha/reporter.cjs.map +0 -6
- package/dist/plugs/mocha/reporter.d.ts +0 -6
- package/dist/plugs/mocha/reporter.mjs +0 -127
- package/dist/plugs/mocha/reporter.mjs.map +0 -6
- package/dist/plugs/mocha/runner.cjs +0 -82
- package/dist/plugs/mocha/runner.cjs.map +0 -6
- package/dist/plugs/mocha/runner.d.ts +0 -8
- package/dist/plugs/mocha/runner.mjs +0 -53
- package/dist/plugs/mocha/runner.mjs.map +0 -6
- package/dist/plugs/mocha.cjs +0 -22
- package/dist/plugs/mocha.cjs.map +0 -6
- package/dist/plugs/mocha.d.ts +0 -37
- package/dist/plugs/mocha.mjs +0 -5
- package/dist/plugs/mocha.mjs.map +0 -6
- package/dist/plugs/tsc/compiler.cjs +0 -74
- package/dist/plugs/tsc/compiler.cjs.map +0 -6
- package/dist/plugs/tsc/compiler.d.ts +0 -24
- package/dist/plugs/tsc/compiler.mjs +0 -43
- package/dist/plugs/tsc/compiler.mjs.map +0 -6
- package/dist/plugs/tsc/options.cjs +0 -82
- package/dist/plugs/tsc/options.cjs.map +0 -6
- package/dist/plugs/tsc/options.d.ts +0 -8
- package/dist/plugs/tsc/options.mjs +0 -51
- package/dist/plugs/tsc/options.mjs.map +0 -6
- package/dist/plugs/tsc/report.cjs +0 -90
- package/dist/plugs/tsc/report.cjs.map +0 -6
- package/dist/plugs/tsc/report.d.ts +0 -5
- package/dist/plugs/tsc/report.mjs +0 -59
- package/dist/plugs/tsc/report.mjs.map +0 -6
- package/dist/plugs/tsc/runner.cjs +0 -124
- package/dist/plugs/tsc/runner.cjs.map +0 -6
- package/dist/plugs/tsc/runner.d.ts +0 -8
- package/dist/plugs/tsc/runner.mjs +0 -95
- package/dist/plugs/tsc/runner.mjs.map +0 -6
- package/dist/plugs/tsc.cjs.map +0 -6
- package/dist/plugs/tsc.d.ts +0 -48
- package/dist/plugs/tsc.mjs +0 -5
- package/dist/plugs/tsc.mjs.map +0 -6
- package/src/failure.ts +0 -43
- package/src/plugs/coverage/analysis.ts +0 -400
- package/src/plugs/coverage/report.ts +0 -368
- package/src/plugs/coverage.ts +0 -216
- package/src/plugs/eslint/runner.ts +0 -100
- package/src/plugs/eslint.ts +0 -42
- package/src/plugs/mocha/reporter.ts +0 -178
- package/src/plugs/mocha/runner.ts +0 -66
- package/src/plugs/mocha.ts +0 -43
- package/src/plugs/tsc/compiler.ts +0 -68
- package/src/plugs/tsc/options.ts +0 -100
- package/src/plugs/tsc/report.ts +0 -77
- package/src/plugs/tsc/runner.ts +0 -133
- package/src/plugs/tsc.ts +0 -58
- package/types/globals.d.ts +0 -15
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
|
|
3
|
+
import { stat } from '../../fs'
|
|
3
4
|
import { assertAbsolutePath, resolveAbsolutePath, resolveFile } from '../../paths'
|
|
4
|
-
import { stat } from '../../utils/asyncfs'
|
|
5
5
|
|
|
6
6
|
import type { Plugin } from 'esbuild'
|
|
7
7
|
|
|
@@ -72,7 +72,7 @@ export function fixExtensions(): Plugin {
|
|
|
72
72
|
const match = args.path.match(/(.*)(\.[mc]?js$)/)
|
|
73
73
|
if (match) {
|
|
74
74
|
const [ , name, ext ] = match
|
|
75
|
-
const tspath = name + ext
|
|
75
|
+
const tspath = name + ext!.replace('js', 'ts')
|
|
76
76
|
const tsfile = resolveAbsolutePath(resolveDir, tspath)
|
|
77
77
|
if (resolveFile(tsfile)) {
|
|
78
78
|
const newext = ext === '.mjs' ? mjs : ext === '.cjs' ? cjs : js
|
package/src/plugs/esbuild.ts
CHANGED
|
@@ -2,25 +2,25 @@ import { basename } from 'node:path'
|
|
|
2
2
|
|
|
3
3
|
import { build } from 'esbuild'
|
|
4
4
|
|
|
5
|
-
import { assert } from '../
|
|
5
|
+
import { assert } from '../asserts'
|
|
6
6
|
import { Files } from '../files'
|
|
7
|
-
import {
|
|
7
|
+
import { readFile } from '../fs'
|
|
8
|
+
import { $p, ERROR, WARN } from '../logging'
|
|
8
9
|
import { getAbsoluteParent, resolveAbsolutePath } from '../paths'
|
|
9
10
|
import { install } from '../pipe'
|
|
10
|
-
import { readFile } from '../utils/asyncfs'
|
|
11
11
|
|
|
12
|
+
import type { BuildFailure, BuildOptions, BuildResult, Format, Message, Metafile } from 'esbuild'
|
|
12
13
|
import type { FilesBuilder } from '../files'
|
|
13
|
-
import type { Logger, ReportLevel, ReportRecord } from '../
|
|
14
|
+
import type { Logger, ReportLevel, ReportRecord } from '../logging'
|
|
14
15
|
import type { AbsolutePath } from '../paths'
|
|
15
16
|
import type { Context, PipeParameters, Plug } from '../pipe'
|
|
16
|
-
import type { BuildFailure, BuildOptions, BuildResult, Format, Message, Metafile } from 'esbuild'
|
|
17
17
|
|
|
18
18
|
export type ESBuildOptions = Omit<BuildOptions, 'absWorkingDir' | 'entryPoints' | 'watch'>
|
|
19
19
|
|
|
20
20
|
export * from './esbuild/bundle-locals'
|
|
21
21
|
export * from './esbuild/fix-extensions'
|
|
22
22
|
|
|
23
|
-
declare module '../
|
|
23
|
+
declare module '../index' {
|
|
24
24
|
export interface Pipe {
|
|
25
25
|
/**
|
|
26
26
|
* Transpile and bundle with {@link https://esbuild.github.io/ esbuild}.
|
|
@@ -68,6 +68,12 @@ install('esbuild', class ESBuild implements Plug<Files> {
|
|
|
68
68
|
watch: false,
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
if (options.format === 'cjs') {
|
|
72
|
+
options.define = Object.assign({ __fileurl: '__filename' }, options.define)
|
|
73
|
+
} else if (options.format === 'esm') {
|
|
74
|
+
options.define = Object.assign({ __fileurl: 'import.meta.url' }, options.define)
|
|
75
|
+
}
|
|
76
|
+
|
|
71
77
|
/* Sanity check on output file/directory */
|
|
72
78
|
assert(!(options.outdir && options.outfile), 'Options "outfile" and "outdir" can not coexist')
|
|
73
79
|
|
|
@@ -76,7 +82,7 @@ install('esbuild', class ESBuild implements Plug<Files> {
|
|
|
76
82
|
if (options.bundle && options.outfile && (entryPoints.length === 1)) {
|
|
77
83
|
builder = Files.builder(absWorkingDir)
|
|
78
84
|
const outputFile = resolveAbsolutePath(absWorkingDir, options.outfile)
|
|
79
|
-
const entryPoint = resolveAbsolutePath(absWorkingDir, entryPoints[0])
|
|
85
|
+
const entryPoint = resolveAbsolutePath(absWorkingDir, entryPoints[0]!)
|
|
80
86
|
options.outfile = outputFile
|
|
81
87
|
|
|
82
88
|
context.log.debug('Bundling', $p(entryPoint), 'into', $p(outputFile))
|
package/src/plugs/exec.ts
CHANGED
|
@@ -1,40 +1,27 @@
|
|
|
1
|
-
import { spawn } from 'node:child_process'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import reaadline from 'node:readline'
|
|
4
|
-
|
|
5
|
-
import { assert } from '../assert'
|
|
6
|
-
import { requireContext } from '../async'
|
|
7
|
-
import { $p, logOptions } from '../log'
|
|
8
|
-
import { getCurrentWorkingDirectory, resolveDirectory } from '../paths'
|
|
9
1
|
import { install } from '../pipe'
|
|
10
2
|
import { parseOptions } from '../utils/options'
|
|
3
|
+
import { execChild } from '../utils/exec'
|
|
11
4
|
|
|
5
|
+
import type { ExecChildOptions } from '../utils/exec'
|
|
12
6
|
import type { Files } from '../files'
|
|
13
|
-
import type { AbsolutePath } from '../paths'
|
|
14
7
|
import type { Context, PipeParameters, Plug } from '../pipe'
|
|
15
|
-
import type { SpawnOptions } from 'node:child_process'
|
|
16
8
|
|
|
17
9
|
/** Options for executing scripts */
|
|
18
|
-
export interface ExecOptions {
|
|
19
|
-
/** Extra environment variables, or overrides for existing ones */
|
|
20
|
-
env?: Record<string, any>,
|
|
21
|
-
/** Whether to run in the context of a _shell_ or not */
|
|
22
|
-
shell?: string | boolean,
|
|
10
|
+
export interface ExecOptions extends ExecChildOptions {
|
|
23
11
|
/**
|
|
24
12
|
* The current working directory of the process to execute.
|
|
25
13
|
*
|
|
26
|
-
* Defaults to the current {@link Files.directory | Files' directory}
|
|
27
|
-
* used as a {@link Plug} or `process.cwd()` when used from {@link exec}.
|
|
14
|
+
* Defaults to the current {@link Files.directory | Files' directory}.
|
|
28
15
|
*/
|
|
29
16
|
cwd?: string
|
|
30
17
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
18
|
+
* Whether the {@link Files} will be appended to the current arguments as
|
|
19
|
+
* _relative_ files (default or `true`) or _absolute_ (if `false`).
|
|
33
20
|
*/
|
|
34
21
|
relativePaths?: boolean
|
|
35
22
|
}
|
|
36
23
|
|
|
37
|
-
declare module '../
|
|
24
|
+
declare module '../index' {
|
|
38
25
|
export interface Pipe {
|
|
39
26
|
/**
|
|
40
27
|
* Execute a shell command, adding to its _arguments_ the list of files
|
|
@@ -114,117 +101,9 @@ install('exec', class Exec implements Plug<Files> {
|
|
|
114
101
|
if (options.shell) params.forEach((s, i, a) => a[i] = JSON.stringify(s))
|
|
115
102
|
|
|
116
103
|
// Run our child
|
|
117
|
-
await
|
|
104
|
+
await execChild(this._cmd, [ ...this._args, ...params ], options, context)
|
|
118
105
|
|
|
119
106
|
// Return our files
|
|
120
107
|
return files
|
|
121
108
|
}
|
|
122
109
|
})
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Execute a command and await for its result from within a task.
|
|
126
|
-
*
|
|
127
|
-
* For example:
|
|
128
|
-
*
|
|
129
|
-
* ```
|
|
130
|
-
* import { exec } from '@plugjs/plugjs'
|
|
131
|
-
*
|
|
132
|
-
* export default build({
|
|
133
|
-
* async runme() {
|
|
134
|
-
* await exec('ls', '-la', '/')
|
|
135
|
-
* // or similarly letting the shell interpret the command
|
|
136
|
-
* await exec('ls -la /', { shell: true })
|
|
137
|
-
* },
|
|
138
|
-
* })
|
|
139
|
-
* ```
|
|
140
|
-
*
|
|
141
|
-
* @param cmd The command to execute
|
|
142
|
-
* @param args Any additional argument for the command to execute
|
|
143
|
-
* @param options Extra {@link ExecOptions | options} for process execution
|
|
144
|
-
*/
|
|
145
|
-
export function exec(
|
|
146
|
-
cmd: string,
|
|
147
|
-
...args:
|
|
148
|
-
| [ ...args: string[] ]
|
|
149
|
-
| [ ...args: string[], options: ExecOptions ]
|
|
150
|
-
): Promise<void> {
|
|
151
|
-
const { params, options } = parseOptions(args)
|
|
152
|
-
return spawnChild(cmd, params, options, requireContext())
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
/* ========================================================================== *
|
|
157
|
-
* INTERNALS *
|
|
158
|
-
* ========================================================================== */
|
|
159
|
-
|
|
160
|
-
async function spawnChild(
|
|
161
|
-
cmd: string,
|
|
162
|
-
args: readonly string[],
|
|
163
|
-
options: ExecOptions = {},
|
|
164
|
-
context: Context,
|
|
165
|
-
): Promise<void> {
|
|
166
|
-
const {
|
|
167
|
-
env = {}, // default empty environment
|
|
168
|
-
shell = false, // by default do not use a shell
|
|
169
|
-
cwd = undefined, // by default use "process.cwd()"
|
|
170
|
-
...extraOptions
|
|
171
|
-
} = options
|
|
172
|
-
|
|
173
|
-
const childCwd = cwd ? context.resolve(cwd) : getCurrentWorkingDirectory()
|
|
174
|
-
assert(resolveDirectory(childCwd), `Current working directory ${$p(childCwd)} does not exist`)
|
|
175
|
-
|
|
176
|
-
// Figure out the PATH environment variable
|
|
177
|
-
const childPaths: AbsolutePath[] = []
|
|
178
|
-
|
|
179
|
-
// The `.../node_modules/.bin` path relative to the current working dir */
|
|
180
|
-
const baseNodePath = context.resolve('@node_modules', '.bin')
|
|
181
|
-
if (resolveDirectory(baseNodePath)) childPaths.push(baseNodePath)
|
|
182
|
-
|
|
183
|
-
// The `.../node_bodules/.bin` path relative to the buildDir */
|
|
184
|
-
const buildNodePath = context.resolve('./node_modules', '.bin')
|
|
185
|
-
if (resolveDirectory(buildNodePath)) childPaths.push(buildNodePath)
|
|
186
|
-
|
|
187
|
-
// Any other paths either from `process.env` or `env` (which overrides it)
|
|
188
|
-
const extraPath = env.PATH || process.env.PATH
|
|
189
|
-
if (extraPath) childPaths.push(extraPath)
|
|
190
|
-
|
|
191
|
-
// Build our environment variables record
|
|
192
|
-
const PATH = childPaths.join(path.delimiter)
|
|
193
|
-
const __LOG_OPTIONS = JSON.stringify(logOptions.fork(context.taskName))
|
|
194
|
-
const childEnv = { ...process.env, ...env, PATH, __LOG_OPTIONS }
|
|
195
|
-
|
|
196
|
-
// Prepare the options for calling `spawn`
|
|
197
|
-
const childOptions: SpawnOptions = {
|
|
198
|
-
...extraOptions,
|
|
199
|
-
stdio: [ 'ignore', 'pipe', 'pipe' ],
|
|
200
|
-
cwd: childCwd,
|
|
201
|
-
env: childEnv,
|
|
202
|
-
shell,
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// Spawn our subprocess and monitor its stdout/stderr
|
|
206
|
-
context.log.info('Executing', [ cmd, ...args ])
|
|
207
|
-
context.log.info('Execution options', childOptions)
|
|
208
|
-
const child = spawn(cmd, args, childOptions)
|
|
209
|
-
|
|
210
|
-
if (child.stdout) {
|
|
211
|
-
const out = reaadline.createInterface(child.stdout)
|
|
212
|
-
out.on('line', (line) => line ? context.log.notice(line) : context.log.notice('\u00a0'))
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if (child.stderr) {
|
|
216
|
-
const err = reaadline.createInterface(child.stderr)
|
|
217
|
-
err.on('line', (line) => line ? context.log.warn(line) : context.log.warn('\u00a0'))
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// Return our promise from the spawn events
|
|
221
|
-
return new Promise<void>((resolve, reject) => {
|
|
222
|
-
child.on('error', (error) => reject(error))
|
|
223
|
-
child.on('exit', (code, signal) => {
|
|
224
|
-
if (code === 0) return resolve()
|
|
225
|
-
if (signal) return reject(new Error(`Child process exited with signal ${signal}`))
|
|
226
|
-
if (code) return reject(new Error(`Child process exited with code ${code}`))
|
|
227
|
-
reject(new Error('Child process failed for an unknown reason'))
|
|
228
|
-
})
|
|
229
|
-
})
|
|
230
|
-
}
|
package/src/plugs/filter.ts
CHANGED
package/src/plugs/rmf.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { rm } from '../fs'
|
|
2
|
+
import { $gry, $p } from '../logging'
|
|
2
3
|
import { install } from '../pipe'
|
|
3
|
-
import { rm } from '../utils/asyncfs'
|
|
4
4
|
|
|
5
5
|
import type { Files } from '../files'
|
|
6
6
|
import type { Context, PipeParameters, Plug } from '../pipe'
|
|
7
7
|
|
|
8
|
-
declare module '../
|
|
8
|
+
declare module '../index' {
|
|
9
9
|
export interface Pipe {
|
|
10
10
|
/**
|
|
11
11
|
* Remove all {@link Files} piped in.
|
package/src/plugs.ts
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
/* ========================================================================== *
|
|
2
|
-
* FORKING PLUGS *
|
|
3
|
-
* ========================================================================== */
|
|
4
|
-
|
|
5
|
-
export * from './plugs/eslint'
|
|
6
|
-
export * from './plugs/mocha'
|
|
7
|
-
export * from './plugs/tsc'
|
|
8
|
-
|
|
9
|
-
/* ========================================================================== *
|
|
10
|
-
* STANDARD IN-PROCESS PLUGS *
|
|
11
|
-
* ========================================================================== */
|
|
12
|
-
|
|
13
1
|
export * from './plugs/copy'
|
|
14
|
-
export * from './plugs/coverage'
|
|
15
2
|
export * from './plugs/debug'
|
|
3
|
+
export * from './plugs/edit'
|
|
16
4
|
export * from './plugs/esbuild'
|
|
17
5
|
export * from './plugs/exec'
|
|
18
6
|
export * from './plugs/filter'
|
package/src/types.ts
CHANGED
package/src/utils/caller.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { statSync } from 'node:fs'
|
|
2
2
|
import { fileURLToPath } from 'node:url'
|
|
3
3
|
|
|
4
|
-
import { assert } from '../
|
|
5
|
-
import { $p } from '../
|
|
4
|
+
import { assert } from '../asserts'
|
|
5
|
+
import { $p } from '../logging'
|
|
6
6
|
import { assertAbsolutePath } from '../paths'
|
|
7
7
|
|
|
8
8
|
import type { AbsolutePath } from '../paths'
|
|
@@ -12,7 +12,10 @@ export function findCaller(of: (...args: any[]) => any): AbsolutePath {
|
|
|
12
12
|
|
|
13
13
|
try {
|
|
14
14
|
Error.prepareStackTrace = (_, stackTraces): AbsolutePath | undefined => {
|
|
15
|
-
const
|
|
15
|
+
const [ stackTrace ] = stackTraces
|
|
16
|
+
if (! stackTrace) return
|
|
17
|
+
|
|
18
|
+
const nullableFileOrUrl = stackTrace.getFileName()
|
|
16
19
|
if (! nullableFileOrUrl) return
|
|
17
20
|
|
|
18
21
|
const file =
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import reaadline from 'node:readline'
|
|
3
|
+
import { fork as forkProcess, spawn as spawnProcess } from 'node:child_process'
|
|
4
|
+
|
|
5
|
+
import { assert, BuildFailure } from '../asserts'
|
|
6
|
+
import { $p, logOptions } from '../logging'
|
|
7
|
+
import { getCurrentWorkingDirectory, resolveDirectory } from '../paths'
|
|
8
|
+
|
|
9
|
+
import type { SpawnOptions } from 'node:child_process'
|
|
10
|
+
import type { AbsolutePath } from '../paths'
|
|
11
|
+
import type { Context } from '../pipe'
|
|
12
|
+
|
|
13
|
+
/** Options for executing scripts */
|
|
14
|
+
export interface ExecChildOptions {
|
|
15
|
+
/** Specify the directory where coverage data will be saved */
|
|
16
|
+
coverageDir?: string,
|
|
17
|
+
/** Extra environment variables, or overrides for existing ones */
|
|
18
|
+
env?: Record<string, any>,
|
|
19
|
+
/** Whether to _fork_ the process (argument is a javascript file) or not */
|
|
20
|
+
fork?: boolean,
|
|
21
|
+
/** Whether to run the command in a shell (optionally name the shell) */
|
|
22
|
+
shell?: string | boolean,
|
|
23
|
+
/** The current working directory of the process to execute. */
|
|
24
|
+
cwd?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function execChild(
|
|
28
|
+
cmd: string,
|
|
29
|
+
args: readonly string[],
|
|
30
|
+
options: ExecChildOptions = {},
|
|
31
|
+
context: Context,
|
|
32
|
+
): Promise<void> {
|
|
33
|
+
const {
|
|
34
|
+
env = {}, // default empty environment
|
|
35
|
+
fork = false, // by default do not fork
|
|
36
|
+
shell = false, // by default do not use a shell
|
|
37
|
+
cwd = undefined, // by default use "process.cwd()"
|
|
38
|
+
coverageDir, // default "undefined" (pass throug from env)
|
|
39
|
+
...extraOptions
|
|
40
|
+
} = options
|
|
41
|
+
|
|
42
|
+
const childCwd = cwd ? context.resolve(cwd) : getCurrentWorkingDirectory()
|
|
43
|
+
assert(resolveDirectory(childCwd), `Current working directory ${$p(childCwd)} does not exist`)
|
|
44
|
+
|
|
45
|
+
// Check for wrong fork/shell combination
|
|
46
|
+
assert(!(fork && shell), 'Options "fork" and "shell" can not coexist')
|
|
47
|
+
|
|
48
|
+
// Figure out the PATH environment variable
|
|
49
|
+
const childPaths: AbsolutePath[] = []
|
|
50
|
+
|
|
51
|
+
// The `.../node_modules/.bin` path relative to the current working dir */
|
|
52
|
+
const baseNodePath = context.resolve('@node_modules', '.bin')
|
|
53
|
+
if (resolveDirectory(baseNodePath)) childPaths.push(baseNodePath)
|
|
54
|
+
|
|
55
|
+
// The `.../node_bodules/.bin` path relative to the buildDir */
|
|
56
|
+
const buildNodePath = context.resolve('./node_modules', '.bin')
|
|
57
|
+
if (resolveDirectory(buildNodePath)) childPaths.push(buildNodePath)
|
|
58
|
+
|
|
59
|
+
// Any other paths either from `process.env` or `env` (which overrides it)
|
|
60
|
+
const extraPath = env.PATH || process.env.PATH
|
|
61
|
+
if (extraPath) childPaths.push(extraPath)
|
|
62
|
+
|
|
63
|
+
// Build our environment variables record
|
|
64
|
+
const PATH = childPaths.join(path.delimiter)
|
|
65
|
+
const __LOG_OPTIONS = JSON.stringify(logOptions.fork(context.taskName))
|
|
66
|
+
const childEnv: Record<string, string> = { ...process.env, ...env, PATH, __LOG_OPTIONS }
|
|
67
|
+
|
|
68
|
+
// Instrument coverage directory if needed
|
|
69
|
+
if (coverageDir) childEnv.NODE_V8_COVERAGE = context.resolve(coverageDir)
|
|
70
|
+
|
|
71
|
+
// Prepare the options for calling `spawn`
|
|
72
|
+
const childOptions: SpawnOptions = {
|
|
73
|
+
...extraOptions,
|
|
74
|
+
stdio: [ 'ignore', 'pipe', 'pipe' ],
|
|
75
|
+
cwd: childCwd,
|
|
76
|
+
env: childEnv,
|
|
77
|
+
shell,
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Add the 'ipc' channel to stdio options if forking
|
|
81
|
+
if (fork) childOptions.stdio = [ 'ignore', 'pipe', 'pipe', 'ipc' ]
|
|
82
|
+
|
|
83
|
+
// Spawn our subprocess and monitor its stdout/stderr
|
|
84
|
+
context.log.info('Executing', [ cmd, ...args ])
|
|
85
|
+
context.log.info('Execution options', childOptions)
|
|
86
|
+
const child = fork ?
|
|
87
|
+
forkProcess(cmd, args, childOptions) :
|
|
88
|
+
spawnProcess(cmd, args, childOptions)
|
|
89
|
+
|
|
90
|
+
// Standard output to "notice"
|
|
91
|
+
if (child.stdout) {
|
|
92
|
+
const out = reaadline.createInterface(child.stdout)
|
|
93
|
+
out.on('line', (line) => line ? context.log.notice(line) : context.log.notice('\u00a0'))
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Standard error to "warning"
|
|
97
|
+
if (child.stderr) {
|
|
98
|
+
const err = reaadline.createInterface(child.stderr)
|
|
99
|
+
err.on('line', (line) => line ? context.log.warn(line) : context.log.warn('\u00a0'))
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Return our promise from the spawn events
|
|
103
|
+
return new Promise<void>((resolve, reject) => {
|
|
104
|
+
child.on('error', (error) => reject(error))
|
|
105
|
+
child.on('exit', (code, signal) => {
|
|
106
|
+
if (code === 0) return resolve()
|
|
107
|
+
if (signal) return reject(BuildFailure.withMessage(`Child process exited with signal ${signal}`))
|
|
108
|
+
if (code) return reject(BuildFailure.withMessage(`Child process exited with code ${code}`))
|
|
109
|
+
reject(BuildFailure.withMessage('Child process failed for an unknown reason'))
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
}
|
package/src/utils/walk.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { basename, join } from 'node:path'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { opendir, stat } from '../fs'
|
|
4
|
+
import { $p, log } from '../logging'
|
|
4
5
|
import { resolveAbsolutePath } from '../paths'
|
|
5
|
-
import { opendir, stat } from './asyncfs'
|
|
6
6
|
import { match } from './match'
|
|
7
7
|
|
|
8
|
+
import type { Dir } from 'node:fs'
|
|
8
9
|
import type { AbsolutePath } from '../paths'
|
|
9
10
|
import type { MatchOptions } from './match'
|
|
10
|
-
import type { Dir } from 'node:fs'
|
|
11
11
|
|
|
12
12
|
/** Specific options for walking a directory */
|
|
13
13
|
export interface WalkOptions extends MatchOptions {
|
package/src/utils.ts
ADDED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/// <reference no-default-lib="true"/>
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* A pseudo-variable replaced by `ESBuild` resolving to either `__filename`
|
|
5
|
+
* in CJS modules, or to `import.meta.url` in ESM modules.
|
|
6
|
+
*/
|
|
7
|
+
declare const __fileurl: string
|
|
8
|
+
|
|
3
9
|
/*
|
|
4
10
|
* Type definition for `WebAssembly`. This is normally provided to TypeScript
|
|
5
11
|
* by `lib.dom.d.ts`, and is not defined by Node's own types.
|
|
@@ -7,5 +13,5 @@
|
|
|
7
13
|
* https://github.com/evanw/esbuild/issues/2388
|
|
8
14
|
*/
|
|
9
15
|
declare namespace WebAssembly {
|
|
10
|
-
interface Module {} //
|
|
16
|
+
interface Module {} // just define an empty interface...
|
|
11
17
|
}
|
package/dist/assert.cjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// assert.ts
|
|
21
|
-
var assert_exports = {};
|
|
22
|
-
__export(assert_exports, {
|
|
23
|
-
assert: () => assert,
|
|
24
|
-
assertPromises: () => assertPromises
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(assert_exports);
|
|
27
|
-
var import_failure = require("./failure.cjs");
|
|
28
|
-
async function assertPromises(promises) {
|
|
29
|
-
const settlements = await Promise.allSettled(promises);
|
|
30
|
-
const results = [];
|
|
31
|
-
const failures = /* @__PURE__ */ new Set();
|
|
32
|
-
settlements.forEach((settlement) => {
|
|
33
|
-
if (settlement.status === "fulfilled") {
|
|
34
|
-
results.push(settlement.value);
|
|
35
|
-
} else {
|
|
36
|
-
failures.add(settlement.reason);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
if (failures.size)
|
|
40
|
-
throw import_failure.BuildFailure.withErrors([...failures]);
|
|
41
|
-
return results;
|
|
42
|
-
}
|
|
43
|
-
function assert(assertion, message) {
|
|
44
|
-
if (!assertion)
|
|
45
|
-
throw import_failure.BuildFailure.withMessage(message);
|
|
46
|
-
}
|
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
assert,
|
|
50
|
-
assertPromises
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=assert.cjs.map
|
package/dist/assert.cjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/assert.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,qBAA6B;AAG7B,eAAsB,eAAkB,UAA4C;AAElF,QAAM,cAAc,MAAM,QAAQ,WAAW,QAAQ;AAGrD,QAAM,UAAe,CAAC;AACtB,QAAM,WAAW,oBAAI,IAAS;AAE9B,cAAY,QAAQ,CAAC,eAAe;AAClC,QAAI,WAAW,WAAW,aAAa;AACrC,cAAQ,KAAK,WAAW,KAAK;AAAA,IAC/B,OAAO;AACL,eAAS,IAAI,WAAW,MAAM;AAAA,IAChC;AAAA,EACF,CAAC;AAGD,MAAI,SAAS;AAAM,UAAM,4BAAa,WAAW,CAAE,GAAG,QAAS,CAAC;AAEhE,SAAO;AACT;AAGO,SAAS,OAAO,WAAgB,SAAoC;AACzE,MAAI,CAAE;AAAW,UAAM,4BAAa,YAAY,OAAO;AACzD;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/assert.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Await and assert that all specified promises were fulfilled */
|
|
2
|
-
export declare function assertPromises<T>(promises: (T | Promise<T>)[]): Promise<T[]>;
|
|
3
|
-
/** Asserts something as _truthy_ and fail the build if not */
|
|
4
|
-
export declare function assert(assertion: any, message: string): asserts assertion;
|
package/dist/assert.mjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// assert.ts
|
|
2
|
-
import { BuildFailure } from "./failure.mjs";
|
|
3
|
-
async function assertPromises(promises) {
|
|
4
|
-
const settlements = await Promise.allSettled(promises);
|
|
5
|
-
const results = [];
|
|
6
|
-
const failures = /* @__PURE__ */ new Set();
|
|
7
|
-
settlements.forEach((settlement) => {
|
|
8
|
-
if (settlement.status === "fulfilled") {
|
|
9
|
-
results.push(settlement.value);
|
|
10
|
-
} else {
|
|
11
|
-
failures.add(settlement.reason);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
if (failures.size)
|
|
15
|
-
throw BuildFailure.withErrors([...failures]);
|
|
16
|
-
return results;
|
|
17
|
-
}
|
|
18
|
-
function assert(assertion, message) {
|
|
19
|
-
if (!assertion)
|
|
20
|
-
throw BuildFailure.withMessage(message);
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
assert,
|
|
24
|
-
assertPromises
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=assert.mjs.map
|
package/dist/assert.mjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/assert.ts"],
|
|
4
|
-
"mappings": ";AAIA,SAAS,oBAAoB;AAG7B,eAAsB,eAAkB,UAA4C;AAElF,QAAM,cAAc,MAAM,QAAQ,WAAW,QAAQ;AAGrD,QAAM,UAAe,CAAC;AACtB,QAAM,WAAW,oBAAI,IAAS;AAE9B,cAAY,QAAQ,CAAC,eAAe;AAClC,QAAI,WAAW,WAAW,aAAa;AACrC,cAAQ,KAAK,WAAW,KAAK;AAAA,IAC/B,OAAO;AACL,eAAS,IAAI,WAAW,MAAM;AAAA,IAChC;AAAA,EACF,CAAC;AAGD,MAAI,SAAS;AAAM,UAAM,aAAa,WAAW,CAAE,GAAG,QAAS,CAAC;AAEhE,SAAO;AACT;AAGO,SAAS,OAAO,WAAgB,SAAoC;AACzE,MAAI,CAAE;AAAW,UAAM,aAAa,YAAY,OAAO;AACzD;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/failure.cjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/failure.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAM,eAAe,OAAO,IAAI,qBAAqB;AAG9C,SAAS,eAAe,KAA+B;AAC5D,SAAO,OAAO,IAAI,kBAAkB;AACtC;AAGO,IAAM,eAAN,cAA2B,MAAM;AAAA,EAC7B;AAAA,EACT;AAAA,EAGQ,YAAY,SAA6B,QAAe;AAC9D,UAAM,WAAW,EAAE;AAGnB,aAAS,OAAO,OAAO,CAAC,MAAM,EAAG,eAAe,CAAC,KAAK,EAAE,OAAO;AAG/D,UAAM,kBAAkB,MAAM,YAAY;AAC1C,WAAO,iBAAiB,MAAM;AAAA,MAC5B,UAAU,EAAE,OAAO,OAAO,OAAO,MAAM,EAAE;AAAA,MACzC,CAAC,eAAe,EAAE,OAAO,aAAa;AAAA,IACxC,CAAC;AAGD,SAAK,SAAS,EAAG,WAAW,OAAO;AAAA,EACrC;AAAA,EAEA,OAAO,OAAqB;AAC1B,WAAO,IAAI,aAAa,QAAW,CAAC,CAAC;AAAA,EACvC;AAAA,EAEA,OAAO,YAAY,SAA+B;AAChD,WAAO,IAAI,aAAa,WAAW,QAAW,CAAC,CAAC;AAAA,EAClD;AAAA,EAEA,OAAO,WAAW,QAA6B;AAC7C,WAAO,IAAI,aAAa,QAAW,MAAM;AAAA,EAC3C;AACF;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/failure.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// failure.ts
|
|
2
|
-
var buildFailure = Symbol.for("plugjs:buildFailure");
|
|
3
|
-
function isBuildFailure(arg) {
|
|
4
|
-
return arg && arg[buildFailure] === buildFailure;
|
|
5
|
-
}
|
|
6
|
-
var BuildFailure = class extends Error {
|
|
7
|
-
errors;
|
|
8
|
-
logged;
|
|
9
|
-
constructor(message, errors) {
|
|
10
|
-
super(message || "");
|
|
11
|
-
errors = errors.filter((e) => !(isBuildFailure(e) && e.logged));
|
|
12
|
-
Error.captureStackTrace(this, BuildFailure);
|
|
13
|
-
Object.defineProperties(this, {
|
|
14
|
-
"errors": { value: Object.freeze(errors) },
|
|
15
|
-
[buildFailure]: { value: buildFailure }
|
|
16
|
-
});
|
|
17
|
-
this.logged = !(message || errors.length);
|
|
18
|
-
}
|
|
19
|
-
static fail() {
|
|
20
|
-
return new BuildFailure(void 0, []);
|
|
21
|
-
}
|
|
22
|
-
static withMessage(message) {
|
|
23
|
-
return new BuildFailure(message || void 0, []);
|
|
24
|
-
}
|
|
25
|
-
static withErrors(errors) {
|
|
26
|
-
return new BuildFailure(void 0, errors);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
BuildFailure,
|
|
31
|
-
isBuildFailure
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=failure.mjs.map
|
package/dist/failure.mjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/failure.ts"],
|
|
4
|
-
"mappings": ";AACA,IAAM,eAAe,OAAO,IAAI,qBAAqB;AAG9C,SAAS,eAAe,KAA+B;AAC5D,SAAO,OAAO,IAAI,kBAAkB;AACtC;AAGO,IAAM,eAAN,cAA2B,MAAM;AAAA,EAC7B;AAAA,EACT;AAAA,EAGQ,YAAY,SAA6B,QAAe;AAC9D,UAAM,WAAW,EAAE;AAGnB,aAAS,OAAO,OAAO,CAAC,MAAM,EAAG,eAAe,CAAC,KAAK,EAAE,OAAO;AAG/D,UAAM,kBAAkB,MAAM,YAAY;AAC1C,WAAO,iBAAiB,MAAM;AAAA,MAC5B,UAAU,EAAE,OAAO,OAAO,OAAO,MAAM,EAAE;AAAA,MACzC,CAAC,eAAe,EAAE,OAAO,aAAa;AAAA,IACxC,CAAC;AAGD,SAAK,SAAS,EAAG,WAAW,OAAO;AAAA,EACrC;AAAA,EAEA,OAAO,OAAqB;AAC1B,WAAO,IAAI,aAAa,QAAW,CAAC,CAAC;AAAA,EACvC;AAAA,EAEA,OAAO,YAAY,SAA+B;AAChD,WAAO,IAAI,aAAa,WAAW,QAAW,CAAC,CAAC;AAAA,EAClD;AAAA,EAEA,OAAO,WAAW,QAA6B;AAC7C,WAAO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