@plugjs/plug 0.6.116 → 0.7.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.d.ts +1 -0
- package/dist/asserts.d.ts.map +1 -0
- package/dist/asserts.js +68 -0
- package/dist/asserts.js.map +1 -0
- package/dist/async.d.ts +2 -1
- package/dist/async.d.ts.map +1 -0
- package/dist/async.js +52 -0
- package/dist/async.js.map +1 -0
- package/dist/build.d.ts +2 -1
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +236 -0
- package/dist/build.js.map +1 -0
- package/dist/{cli.d.mts → cli.d.ts} +3 -1
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +330 -0
- package/dist/cli.js.map +1 -0
- package/dist/files.d.ts +2 -1
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +93 -0
- package/dist/files.js.map +1 -0
- package/dist/fork.d.ts +5 -4
- package/dist/fork.d.ts.map +1 -0
- package/dist/fork.js +259 -0
- package/dist/fork.js.map +1 -0
- package/dist/fs.d.ts +1 -0
- package/dist/fs.d.ts.map +1 -0
- package/dist/fs.js +72 -0
- package/dist/fs.js.map +1 -0
- package/dist/globals.d.ts +4 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/globals.js +2 -0
- package/dist/globals.js.map +1 -0
- package/dist/helpers.d.ts +8 -7
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +231 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +22 -21
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/colors.d.ts +2 -1
- package/dist/logging/colors.d.ts.map +1 -0
- package/dist/logging/colors.js +121 -0
- package/dist/logging/colors.js.map +1 -0
- package/dist/logging/emit.d.ts +2 -1
- package/dist/logging/emit.d.ts.map +1 -0
- package/dist/logging/emit.js +137 -0
- package/dist/logging/emit.js.map +1 -0
- package/dist/logging/github.d.ts +2 -1
- package/dist/logging/github.d.ts.map +1 -0
- package/dist/logging/github.js +46 -0
- package/dist/logging/github.js.map +1 -0
- package/dist/logging/levels.d.ts +1 -0
- package/dist/logging/levels.d.ts.map +1 -0
- package/dist/logging/levels.js +50 -0
- package/dist/logging/levels.js.map +1 -0
- package/dist/logging/logger.d.ts +4 -3
- package/dist/logging/logger.d.ts.map +1 -0
- package/dist/logging/logger.js +161 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/logging/options.d.ts +2 -1
- package/dist/logging/options.d.ts.map +1 -0
- package/dist/logging/options.js +182 -0
- package/dist/logging/options.js.map +1 -0
- package/dist/logging/report.d.ts +4 -3
- package/dist/logging/report.d.ts.map +1 -0
- package/dist/logging/report.js +346 -0
- package/dist/logging/report.js.map +1 -0
- package/dist/logging/spinner.d.ts +1 -0
- package/dist/logging/spinner.d.ts.map +1 -0
- package/dist/logging/spinner.js +70 -0
- package/dist/logging/spinner.js.map +1 -0
- package/dist/logging.d.ts +8 -7
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +66 -0
- package/dist/logging.js.map +1 -0
- package/dist/paths.d.ts +33 -13
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +223 -0
- package/dist/paths.js.map +1 -0
- package/dist/pipe.d.ts +8 -5
- package/dist/pipe.d.ts.map +1 -0
- package/dist/pipe.js +205 -0
- package/dist/pipe.js.map +1 -0
- package/dist/plugs/build.d.ts +5 -4
- package/dist/plugs/build.d.ts.map +1 -0
- package/dist/plugs/build.js +56 -0
- package/dist/plugs/build.js.map +1 -0
- package/dist/plugs/copy.d.ts +1 -0
- package/dist/plugs/copy.d.ts.map +1 -0
- package/dist/plugs/copy.js +92 -0
- package/dist/plugs/copy.js.map +1 -0
- package/dist/plugs/debug.d.ts +1 -0
- package/dist/plugs/debug.d.ts.map +1 -0
- package/dist/plugs/debug.js +25 -0
- package/dist/plugs/debug.js.map +1 -0
- package/dist/plugs/edit.d.ts +2 -1
- package/dist/plugs/edit.d.ts.map +1 -0
- package/dist/plugs/edit.js +22 -0
- package/dist/plugs/edit.js.map +1 -0
- package/dist/plugs/esbuild/bundle-locals.d.ts +1 -0
- package/dist/plugs/esbuild/bundle-locals.d.ts.map +1 -0
- package/dist/plugs/esbuild/bundle-locals.js +29 -0
- package/dist/plugs/esbuild/bundle-locals.js.map +1 -0
- package/dist/plugs/esbuild/fix-extensions.d.ts +1 -0
- package/dist/plugs/esbuild/fix-extensions.d.ts.map +1 -0
- package/dist/plugs/esbuild/fix-extensions.js +98 -0
- package/dist/plugs/esbuild/fix-extensions.js.map +1 -0
- package/dist/plugs/esbuild.d.ts +21 -2
- package/dist/plugs/esbuild.d.ts.map +1 -0
- package/dist/plugs/esbuild.js +193 -0
- package/dist/plugs/esbuild.js.map +1 -0
- package/dist/plugs/exec.d.ts +2 -1
- package/dist/plugs/exec.d.ts.map +1 -0
- package/dist/plugs/exec.js +33 -0
- package/dist/plugs/exec.js.map +1 -0
- package/dist/plugs/exports.d.ts +1 -0
- package/dist/plugs/exports.d.ts.map +1 -0
- package/dist/plugs/exports.js +110 -0
- package/dist/plugs/exports.js.map +1 -0
- package/dist/plugs/filter.d.ts +2 -1
- package/dist/plugs/filter.d.ts.map +1 -0
- package/dist/plugs/filter.js +34 -0
- package/dist/plugs/filter.js.map +1 -0
- package/dist/plugs/rmf.d.ts +1 -0
- package/dist/plugs/rmf.d.ts.map +1 -0
- package/dist/plugs/rmf.js +24 -0
- package/dist/plugs/rmf.js.map +1 -0
- package/dist/plugs.d.ts +9 -8
- package/dist/plugs.d.ts.map +1 -0
- package/dist/plugs.js +9 -0
- package/dist/plugs.js.map +1 -0
- package/dist/types.d.ts +4 -3
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/ansi.d.ts +1 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +10 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/caller.d.ts +2 -1
- package/dist/utils/caller.d.ts.map +1 -0
- package/dist/utils/caller.js +33 -0
- package/dist/utils/caller.js.map +1 -0
- package/dist/utils/diff.d.ts +1 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/diff.js +278 -0
- package/dist/utils/diff.js.map +1 -0
- package/dist/utils/exec.d.ts +2 -1
- package/dist/utils/exec.d.ts.map +1 -0
- package/dist/utils/exec.js +84 -0
- package/dist/utils/exec.js.map +1 -0
- package/dist/utils/jsonc.d.ts +1 -0
- package/dist/utils/jsonc.d.ts.map +1 -0
- package/dist/utils/jsonc.js +46 -0
- package/dist/utils/jsonc.js.map +1 -0
- package/dist/utils/match.d.ts +1 -0
- package/dist/utils/match.d.ts.map +1 -0
- package/dist/utils/match.js +40 -0
- package/dist/utils/match.js.map +1 -0
- package/dist/utils/options.d.ts +1 -0
- package/dist/utils/options.d.ts.map +1 -0
- package/dist/utils/options.js +17 -0
- package/dist/utils/options.js.map +1 -0
- package/dist/utils/singleton.d.ts +1 -0
- package/dist/utils/singleton.d.ts.map +1 -0
- package/dist/utils/singleton.js +20 -0
- package/dist/utils/singleton.js.map +1 -0
- package/dist/utils/walk.d.ts +3 -2
- package/dist/utils/walk.d.ts.map +1 -0
- package/dist/utils/walk.js +84 -0
- package/dist/utils/walk.js.map +1 -0
- package/dist/utils.d.ts +9 -8
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +9 -0
- package/dist/utils.js.map +1 -0
- package/package.json +28 -88
- package/src/asserts.ts +2 -2
- package/src/async.ts +3 -3
- package/src/build.ts +10 -10
- package/src/{cli.mts → cli.ts} +27 -16
- package/src/files.ts +4 -4
- package/src/fork.ts +17 -17
- package/src/globals.ts +3 -0
- package/src/helpers.ts +20 -20
- package/src/index.ts +21 -21
- package/src/logging/colors.ts +4 -4
- package/src/logging/emit.ts +6 -6
- package/src/logging/github.ts +3 -3
- package/src/logging/logger.ts +12 -12
- package/src/logging/options.ts +10 -10
- package/src/logging/report.ts +10 -10
- package/src/logging/spinner.ts +3 -3
- package/src/logging.ts +14 -14
- package/src/paths.ts +42 -23
- package/src/pipe.ts +13 -8
- package/src/plugs/build.ts +8 -8
- package/src/plugs/copy.ts +8 -8
- package/src/plugs/debug.ts +4 -4
- package/src/plugs/edit.ts +5 -5
- package/src/plugs/esbuild/fix-extensions.ts +8 -10
- package/src/plugs/esbuild.ts +88 -27
- package/src/plugs/exec.ts +6 -6
- package/src/plugs/exports.ts +32 -35
- package/src/plugs/filter.ts +7 -7
- package/src/plugs/rmf.ts +5 -5
- package/src/plugs.ts +8 -8
- package/src/types.ts +3 -3
- package/src/utils/caller.ts +4 -4
- package/src/utils/diff.ts +2 -2
- package/src/utils/exec.ts +7 -7
- package/src/utils/jsonc.ts +1 -1
- package/src/utils/walk.ts +6 -6
- package/src/utils.ts +8 -8
- package/dist/asserts.cjs +0 -86
- package/dist/asserts.cjs.map +0 -6
- package/dist/asserts.mjs +0 -58
- package/dist/asserts.mjs.map +0 -6
- package/dist/async.cjs +0 -64
- package/dist/async.cjs.map +0 -6
- package/dist/async.mjs +0 -36
- package/dist/async.mjs.map +0 -6
- package/dist/build.cjs +0 -222
- package/dist/build.cjs.map +0 -6
- package/dist/build.mjs +0 -192
- package/dist/build.mjs.map +0 -6
- package/dist/cli.mjs +0 -258
- package/dist/cli.mjs.map +0 -6
- package/dist/files.cjs +0 -113
- package/dist/files.cjs.map +0 -6
- package/dist/files.mjs +0 -93
- package/dist/files.mjs.map +0 -6
- package/dist/fork.cjs +0 -224
- package/dist/fork.cjs.map +0 -6
- package/dist/fork.mjs +0 -198
- package/dist/fork.mjs.map +0 -6
- package/dist/fs.cjs +0 -146
- package/dist/fs.cjs.map +0 -6
- package/dist/fs.mjs +0 -82
- package/dist/fs.mjs.map +0 -6
- package/dist/globals.cjs +0 -2
- package/dist/globals.cjs.map +0 -6
- package/dist/globals.mjs +0 -1
- package/dist/globals.mjs.map +0 -6
- package/dist/helpers.cjs +0 -182
- package/dist/helpers.cjs.map +0 -6
- package/dist/helpers.mjs +0 -151
- package/dist/helpers.mjs.map +0 -6
- package/dist/index.cjs +0 -114
- package/dist/index.cjs.map +0 -6
- package/dist/index.mjs +0 -48
- package/dist/index.mjs.map +0 -6
- package/dist/logging/colors.cjs +0 -136
- package/dist/logging/colors.cjs.map +0 -6
- package/dist/logging/colors.mjs +0 -99
- package/dist/logging/colors.mjs.map +0 -6
- package/dist/logging/emit.cjs +0 -134
- package/dist/logging/emit.cjs.map +0 -6
- package/dist/logging/emit.mjs +0 -106
- package/dist/logging/emit.mjs.map +0 -6
- package/dist/logging/github.cjs +0 -60
- package/dist/logging/github.cjs.map +0 -6
- package/dist/logging/github.mjs +0 -35
- package/dist/logging/github.mjs.map +0 -6
- package/dist/logging/levels.cjs +0 -69
- package/dist/logging/levels.cjs.map +0 -6
- package/dist/logging/levels.mjs +0 -35
- package/dist/logging/levels.mjs.map +0 -6
- package/dist/logging/logger.cjs +0 -165
- package/dist/logging/logger.cjs.map +0 -6
- package/dist/logging/logger.mjs +0 -139
- package/dist/logging/logger.mjs.map +0 -6
- package/dist/logging/options.cjs +0 -192
- package/dist/logging/options.cjs.map +0 -6
- package/dist/logging/options.mjs +0 -167
- package/dist/logging/options.mjs.map +0 -6
- package/dist/logging/report.cjs +0 -298
- package/dist/logging/report.cjs.map +0 -6
- package/dist/logging/report.mjs +0 -273
- package/dist/logging/report.mjs.map +0 -6
- package/dist/logging/spinner.cjs +0 -100
- package/dist/logging/spinner.cjs.map +0 -6
- package/dist/logging/spinner.mjs +0 -72
- package/dist/logging/spinner.mjs.map +0 -6
- package/dist/logging.cjs +0 -91
- package/dist/logging.cjs.map +0 -6
- package/dist/logging.mjs +0 -58
- package/dist/logging.mjs.map +0 -6
- package/dist/paths.cjs +0 -170
- package/dist/paths.cjs.map +0 -6
- package/dist/paths.mjs +0 -132
- package/dist/paths.mjs.map +0 -6
- package/dist/pipe.cjs +0 -163
- package/dist/pipe.cjs.map +0 -6
- package/dist/pipe.mjs +0 -135
- package/dist/pipe.mjs.map +0 -6
- package/dist/plugs/build.cjs +0 -73
- package/dist/plugs/build.cjs.map +0 -6
- package/dist/plugs/build.mjs +0 -47
- package/dist/plugs/build.mjs.map +0 -6
- package/dist/plugs/copy.cjs +0 -86
- package/dist/plugs/copy.cjs.map +0 -6
- package/dist/plugs/copy.mjs +0 -69
- package/dist/plugs/copy.mjs.map +0 -6
- package/dist/plugs/debug.cjs +0 -24
- package/dist/plugs/debug.cjs.map +0 -6
- package/dist/plugs/debug.mjs +0 -22
- package/dist/plugs/debug.mjs.map +0 -6
- package/dist/plugs/edit.cjs +0 -20
- package/dist/plugs/edit.cjs.map +0 -6
- package/dist/plugs/edit.mjs +0 -18
- package/dist/plugs/edit.mjs.map +0 -6
- package/dist/plugs/esbuild/bundle-locals.cjs +0 -48
- package/dist/plugs/esbuild/bundle-locals.cjs.map +0 -6
- package/dist/plugs/esbuild/bundle-locals.mjs +0 -23
- package/dist/plugs/esbuild/bundle-locals.mjs.map +0 -6
- package/dist/plugs/esbuild/fix-extensions.cjs +0 -89
- package/dist/plugs/esbuild/fix-extensions.cjs.map +0 -6
- package/dist/plugs/esbuild/fix-extensions.mjs +0 -54
- package/dist/plugs/esbuild/fix-extensions.mjs.map +0 -6
- package/dist/plugs/esbuild.cjs +0 -139
- package/dist/plugs/esbuild.cjs.map +0 -6
- package/dist/plugs/esbuild.mjs +0 -116
- package/dist/plugs/esbuild.mjs.map +0 -6
- package/dist/plugs/exec.cjs +0 -42
- package/dist/plugs/exec.cjs.map +0 -6
- package/dist/plugs/exec.mjs +0 -25
- package/dist/plugs/exec.mjs.map +0 -6
- package/dist/plugs/exports.cjs +0 -117
- package/dist/plugs/exports.cjs.map +0 -6
- package/dist/plugs/exports.mjs +0 -100
- package/dist/plugs/exports.mjs.map +0 -6
- package/dist/plugs/filter.cjs +0 -47
- package/dist/plugs/filter.cjs.map +0 -6
- package/dist/plugs/filter.mjs +0 -30
- package/dist/plugs/filter.mjs.map +0 -6
- package/dist/plugs/rmf.cjs +0 -25
- package/dist/plugs/rmf.cjs.map +0 -6
- package/dist/plugs/rmf.mjs +0 -23
- package/dist/plugs/rmf.mjs.map +0 -6
- package/dist/plugs.cjs +0 -39
- package/dist/plugs.cjs.map +0 -6
- package/dist/plugs.mjs +0 -10
- package/dist/plugs.mjs.map +0 -6
- package/dist/types.cjs +0 -19
- package/dist/types.cjs.map +0 -6
- package/dist/types.mjs +0 -1
- package/dist/types.mjs.map +0 -6
- package/dist/utils/ansi.cjs +0 -39
- package/dist/utils/ansi.cjs.map +0 -6
- package/dist/utils/ansi.mjs +0 -13
- package/dist/utils/ansi.mjs.map +0 -6
- package/dist/utils/caller.cjs +0 -57
- package/dist/utils/caller.cjs.map +0 -6
- package/dist/utils/caller.mjs +0 -32
- package/dist/utils/caller.mjs.map +0 -6
- package/dist/utils/diff.cjs +0 -282
- package/dist/utils/diff.cjs.map +0 -6
- package/dist/utils/diff.mjs +0 -256
- package/dist/utils/diff.mjs.map +0 -6
- package/dist/utils/exec.cjs +0 -113
- package/dist/utils/exec.cjs.map +0 -6
- package/dist/utils/exec.mjs +0 -78
- package/dist/utils/exec.mjs.map +0 -6
- package/dist/utils/jsonc.cjs +0 -74
- package/dist/utils/jsonc.cjs.map +0 -6
- package/dist/utils/jsonc.mjs +0 -48
- package/dist/utils/jsonc.mjs.map +0 -6
- package/dist/utils/match.cjs +0 -74
- package/dist/utils/match.cjs.map +0 -6
- package/dist/utils/match.mjs +0 -39
- package/dist/utils/match.mjs.map +0 -6
- package/dist/utils/options.cjs +0 -39
- package/dist/utils/options.cjs.map +0 -6
- package/dist/utils/options.mjs +0 -14
- package/dist/utils/options.mjs.map +0 -6
- package/dist/utils/singleton.cjs +0 -37
- package/dist/utils/singleton.cjs.map +0 -6
- package/dist/utils/singleton.mjs +0 -12
- package/dist/utils/singleton.mjs.map +0 -6
- package/dist/utils/walk.cjs +0 -98
- package/dist/utils/walk.cjs.map +0 -6
- package/dist/utils/walk.mjs +0 -73
- package/dist/utils/walk.mjs.map +0 -6
- package/dist/utils.cjs +0 -39
- package/dist/utils.cjs.map +0 -6
- package/dist/utils.mjs +0 -10
- package/dist/utils.mjs.map +0 -6
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// plugs/esbuild/fix-extensions.ts
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { stat } from "../../fs.mjs";
|
|
4
|
-
import { assertAbsolutePath, resolveAbsolutePath, resolveFile } from "../../paths.mjs";
|
|
5
|
-
function fixExtensions() {
|
|
6
|
-
return {
|
|
7
|
-
name: "fix-extensions",
|
|
8
|
-
setup(build) {
|
|
9
|
-
build.initialOptions.bundle = true;
|
|
10
|
-
const cjs = build.initialOptions.outExtension?.[".cjs"] || ".cjs";
|
|
11
|
-
const mjs = build.initialOptions.outExtension?.[".mjs"] || ".mjs";
|
|
12
|
-
const js = build.initialOptions.outExtension?.[".js"] || ".js";
|
|
13
|
-
const exts = build.initialOptions.resolveExtensions || [".ts", ".js", ".tsx", ".jsx"];
|
|
14
|
-
build.onResolve({ filter: /.*/ }, async (args) => {
|
|
15
|
-
if (!args.importer) return null;
|
|
16
|
-
if (!args.path.match(/^\.\.?\//)) return { external: true };
|
|
17
|
-
const resolveDir = args.resolveDir;
|
|
18
|
-
assertAbsolutePath(resolveDir);
|
|
19
|
-
const resolved = resolveAbsolutePath(resolveDir, args.path);
|
|
20
|
-
if (resolveFile(resolved)) return { path: args.path, external: true };
|
|
21
|
-
const match = args.path.match(/(.*)(\.[mc]?js$)/);
|
|
22
|
-
if (match) {
|
|
23
|
-
const [, name, ext] = match;
|
|
24
|
-
const tspath = name + ext.replace("js", "ts");
|
|
25
|
-
const tsfile = resolveAbsolutePath(resolveDir, tspath);
|
|
26
|
-
if (resolveFile(tsfile)) {
|
|
27
|
-
const newext = ext === ".mjs" ? mjs : ext === ".cjs" ? cjs : js;
|
|
28
|
-
return { path: name + newext, external: true };
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
for (const ext of exts) {
|
|
32
|
-
const fileName = `${args.path}${ext}`;
|
|
33
|
-
const filePath = path.resolve(args.resolveDir, fileName);
|
|
34
|
-
const isFile = await stat(filePath).then((stat2) => stat2.isFile(), (error) => void error);
|
|
35
|
-
if (isFile) return { path: `${args.path}${js}`, external: true };
|
|
36
|
-
}
|
|
37
|
-
const dirPath = path.resolve(args.resolveDir, args.path);
|
|
38
|
-
const isDir = await stat(dirPath).then((stat2) => stat2.isDirectory(), (error) => void error);
|
|
39
|
-
if (!isDir) return { external: true };
|
|
40
|
-
for (const ext of exts) {
|
|
41
|
-
const fileName = path.join(args.path, `index${ext}`);
|
|
42
|
-
const filePath = path.resolve(args.resolveDir, fileName);
|
|
43
|
-
const isFile = await stat(filePath).then((stat2) => stat2.isFile(), (error) => void error);
|
|
44
|
-
if (isFile) return { path: `${args.path}/index${js}`, external: true };
|
|
45
|
-
}
|
|
46
|
-
return { external: true };
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
fixExtensions
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=fix-extensions.mjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugs/esbuild/fix-extensions.ts"],
|
|
4
|
-
"mappings": ";AAAA,OAAO,UAAU;AAEjB,SAAS,YAAY;AACrB,SAAS,oBAAoB,qBAAqB,mBAAmB;AA+B9D,SAAS,gBAAwB;AACtC,SAAO;AAAA,IACL,MAAM;AAAA,IAEN,MAAM,OAAa;AAEjB,YAAM,eAAe,SAAS;AAG9B,YAAM,MAAM,MAAM,eAAe,eAAe,MAAM,KAAK;AAC3D,YAAM,MAAM,MAAM,eAAe,eAAe,MAAM,KAAK;AAC3D,YAAM,KAAK,MAAM,eAAe,eAAe,KAAK,KAAK;AAGzD,YAAM,OAAO,MAAM,eAAe,qBAAqB,CAAE,OAAO,OAAO,QAAQ,MAAO;AAGtF,YAA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AW,OAAO,MAAM;AACtB,gBAAM,WAAW,KAAK,KAAK,KAAK,MAAM,QAAQ,GAAG,EAAE;AACnD,gBAAM,WAAW,KAAK,QAAQ,KAAK,YAAY,QAAQ;AACvD,gBAAM,SAAS,MAAM,KAAK,QAAQ,EAAE,KAAK,CAACA,UAASA,MAAK,OAAO,GAAG,CAAC,UAAU,KAAK,KAAK;AACvF,cAAI,OAAQ,QAAO,EAAE,MAAM,GAAG,KAAK,IAAI,SAAS,EAAE,IAAI,UAAU,KAAK;AAAA,QACvE;AAGA,eAAO,EAAE,UAAU,KAAK;AAAA,MAC1B,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
|
|
5
|
-
"names": ["stat"]
|
|
6
|
-
}
|
package/dist/plugs/esbuild.cjs
DELETED
|
@@ -1,139 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
|
|
17
|
-
// plugs/esbuild.ts
|
|
18
|
-
var esbuild_exports = {};
|
|
19
|
-
module.exports = __toCommonJS(esbuild_exports);
|
|
20
|
-
var import_node_path = require("node:path");
|
|
21
|
-
var import_esbuild = require("esbuild");
|
|
22
|
-
var import_asserts = require("../asserts.cjs");
|
|
23
|
-
var import_files = require("../files.cjs");
|
|
24
|
-
var import_fs = require("../fs.cjs");
|
|
25
|
-
var import_logging = require("../logging.cjs");
|
|
26
|
-
var import_paths = require("../paths.cjs");
|
|
27
|
-
var import_pipe = require("../pipe.cjs");
|
|
28
|
-
__reExport(esbuild_exports, require("./esbuild/bundle-locals.cjs"), module.exports);
|
|
29
|
-
__reExport(esbuild_exports, require("./esbuild/fix-extensions.cjs"), module.exports);
|
|
30
|
-
(0, import_pipe.install)("esbuild", class ESBuild {
|
|
31
|
-
constructor(_options) {
|
|
32
|
-
this._options = _options;
|
|
33
|
-
}
|
|
34
|
-
_options;
|
|
35
|
-
async pipe(files, context) {
|
|
36
|
-
const entryPoints = [...files];
|
|
37
|
-
const absWorkingDir = files.directory;
|
|
38
|
-
const options = {
|
|
39
|
-
/* Default our platform/target to NodeJS, current major version */
|
|
40
|
-
platform: "node",
|
|
41
|
-
target: `node${process.versions["node"].split(".")[0]}`,
|
|
42
|
-
/* The default format (if not specified in options) is from package.json */
|
|
43
|
-
format: this._options.format || await _moduleFormat(files.directory, context.log),
|
|
44
|
-
/* Output bese directory */
|
|
45
|
-
outbase: absWorkingDir,
|
|
46
|
-
/* Merge in the caller's options */
|
|
47
|
-
...this._options,
|
|
48
|
-
/* Always override */
|
|
49
|
-
absWorkingDir,
|
|
50
|
-
entryPoints,
|
|
51
|
-
logLevel: "silent"
|
|
52
|
-
};
|
|
53
|
-
if (options.format === "cjs") {
|
|
54
|
-
options.define = Object.assign({ __fileurl: "__filename" }, options.define);
|
|
55
|
-
} else if (options.format === "esm") {
|
|
56
|
-
options.define = Object.assign({ __fileurl: "import.meta.url" }, options.define);
|
|
57
|
-
}
|
|
58
|
-
(0, import_asserts.assert)(!(options.outdir && options.outfile), 'Options "outfile" and "outdir" can not coexist');
|
|
59
|
-
let builder;
|
|
60
|
-
if (options.bundle && options.outfile && entryPoints.length === 1) {
|
|
61
|
-
builder = import_files.Files.builder(absWorkingDir);
|
|
62
|
-
const outputFile = (0, import_paths.resolveAbsolutePath)(absWorkingDir, options.outfile);
|
|
63
|
-
const entryPoint = (0, import_paths.resolveAbsolutePath)(absWorkingDir, entryPoints[0]);
|
|
64
|
-
options.outfile = outputFile;
|
|
65
|
-
context.log.debug("Bundling", (0, import_logging.$p)(entryPoint), "into", (0, import_logging.$p)(outputFile));
|
|
66
|
-
} else {
|
|
67
|
-
(0, import_asserts.assert)(options.outdir, 'Option "outdir" must be specified');
|
|
68
|
-
builder = import_files.Files.builder(context.resolve(options.outdir));
|
|
69
|
-
options.outdir = builder.directory;
|
|
70
|
-
const message = options.bundle ? "Bundling" : "Transpiling";
|
|
71
|
-
context.log.debug(message, entryPoints.length, "files to", (0, import_logging.$p)(builder.directory));
|
|
72
|
-
}
|
|
73
|
-
const report = context.log.report("ESBuild Report");
|
|
74
|
-
context.log.trace("Running ESBuild", options);
|
|
75
|
-
let esbuild;
|
|
76
|
-
try {
|
|
77
|
-
esbuild = await (0, import_esbuild.build)({ ...options, metafile: true });
|
|
78
|
-
context.log.trace("ESBuild Results", esbuild);
|
|
79
|
-
report.add(...esbuild.warnings.map((m) => convertMessage(import_logging.WARN, m, absWorkingDir)));
|
|
80
|
-
report.add(...esbuild.errors.map((m) => convertMessage(import_logging.ERROR, m, absWorkingDir)));
|
|
81
|
-
} catch (error) {
|
|
82
|
-
const e = error;
|
|
83
|
-
if (e.warnings) report.add(...e.warnings.map((m) => convertMessage(import_logging.WARN, m, absWorkingDir)));
|
|
84
|
-
if (e.errors) report.add(...e.errors.map((m) => convertMessage(import_logging.ERROR, m, absWorkingDir)));
|
|
85
|
-
}
|
|
86
|
-
await report.loadSources();
|
|
87
|
-
report.done();
|
|
88
|
-
(0, import_asserts.assert)(esbuild, "ESBuild did not produce any result");
|
|
89
|
-
for (const file in esbuild.metafile.outputs) {
|
|
90
|
-
builder.add((0, import_paths.resolveAbsolutePath)(absWorkingDir, file));
|
|
91
|
-
}
|
|
92
|
-
const result = builder.build();
|
|
93
|
-
context.log.info("ESBuild produced", result.length, "files into", (0, import_logging.$p)(result.directory));
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
function convertMessage(level, message, directory) {
|
|
98
|
-
const record = { level, message: message.text };
|
|
99
|
-
record.tags = [message.id, message.pluginName].filter((tag) => !!tag);
|
|
100
|
-
if (message.location) {
|
|
101
|
-
record.line = message.location.line;
|
|
102
|
-
record.column = message.location.column + 1;
|
|
103
|
-
record.length = message.location.length;
|
|
104
|
-
record.file = (0, import_paths.resolveAbsolutePath)(directory, message.location.file);
|
|
105
|
-
}
|
|
106
|
-
return record;
|
|
107
|
-
}
|
|
108
|
-
var _moduleFormatCache = /* @__PURE__ */ new Map();
|
|
109
|
-
async function _moduleFormat(directory, log) {
|
|
110
|
-
const type = _moduleFormatCache.get(directory);
|
|
111
|
-
if (type) return type;
|
|
112
|
-
const file = (0, import_paths.resolveAbsolutePath)(directory, "package.json");
|
|
113
|
-
try {
|
|
114
|
-
const json = await (0, import_fs.readFile)(file, "utf-8");
|
|
115
|
-
const data = JSON.parse(json);
|
|
116
|
-
const type2 = data.type === "module" ? "esm" : "cjs";
|
|
117
|
-
log.debug(`File "${file}" defines module type as "${data.type}" (${type2})`);
|
|
118
|
-
_moduleFormatCache.set(directory, type2);
|
|
119
|
-
return type2;
|
|
120
|
-
} catch (cause) {
|
|
121
|
-
if (cause.code !== "ENOENT" && cause.code !== "EISDIR") throw cause;
|
|
122
|
-
}
|
|
123
|
-
const name = (0, import_node_path.basename)(directory);
|
|
124
|
-
const parent = (0, import_paths.getAbsoluteParent)(directory);
|
|
125
|
-
if (name === "node_modules" || parent === directory) {
|
|
126
|
-
_moduleFormatCache.set(directory, "cjs");
|
|
127
|
-
return "cjs";
|
|
128
|
-
} else {
|
|
129
|
-
const type2 = await _moduleFormat(parent, log);
|
|
130
|
-
_moduleFormatCache.set(directory, type2);
|
|
131
|
-
return type2;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
135
|
-
0 && (module.exports = {
|
|
136
|
-
...require("./esbuild/bundle-locals.cjs"),
|
|
137
|
-
...require("./esbuild/fix-extensions.cjs")
|
|
138
|
-
});
|
|
139
|
-
//# sourceMappingURL=esbuild.cjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/plugs/esbuild.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,uBAAyB;AAEzB,qBAAsB;AAEtB,qBAAuB;AACvB,mBAAsB;AACtB,gBAAyB;AACzB,qBAAgC;AAChC,mBAAuD;AACvD,kBAAwB;AAUxB,4BAAc,wCAnBd;AAoBA,4BAAc,yCApBd;AAAA,IAoDA,qBAAQ,WAAW,MAAM,QAA+B;AAAA,EAEtD,YAA6B,UAA0B;AAA1B;AAAA,EAA2B;AAAA,EAA3B;AAAA,EAE7B,MAAM,KAAK,OAAc,SAAkC;AACzD,UAAM,cAAc,CAAE,GAAG,KAAM;AAC/B,UAAM,gBAAgB,MAAM;AAE5B,UAAM,UAAwB;AAAA;AAAA,MAE5B,UAAU;AAAA,MACV,QAAQ,OAAO,QAAQ,SAAS,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC,CAAC;AAAA;AAAA,MAGrD,QAAQ,KAAK,SAAS,UAAU,MAAM,cAAc,MAAM,WAAW,QAAQ,GAAG;AAAA;AAAA,MAGhF,SAAS;AAAA;AAAA,MAGT,GAAG,KAAK;AAAA;AAAA,MAGR;AAAA,MACA;AAAA,MACA,UAAU;AAAA,IACZ;AAEA,QAAI,QAAQ,WAAW,OAAO;AAC5B,cAAQ,SAAS,OAAO,OAAO,EAAE,WAAW,aAAa,GAAG,QAAQ,MAAM;AAAA,IAC5E,WAAW,QAAQ,WAAW,OAA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AI,GAAG;AAC1E,uBAAmB,IAAI,WAAWA,KAAI;AACtC,WAAOA;AAAA,EACT,SAAS,OAAY;AAEnB,QAAK,MAAM,SAAS,YAAc,MAAM,SAAS,SAAW,OAAM;AAAA,EACpE;AASA,QAAM,WAAO,2BAAS,SAAS;AAC/B,QAAM,aAAS,gCAAkB,SAAS;AAE1C,MAAK,SAAS,kBAAoB,WAAW,WAAY;AACvD,uBAAmB,IAAI,WAAW,KAAK;AACvC,WAAO;AAAA,EACT,OAAO;AAEL,UAAMA,QAAO,MAAM,cAAc,QAAQ,GAAG;AAC5C,uBAAmB,IAAI,WAAWA,KAAI;AACtC,WAAOA;AAAA,EACT;AACF;",
|
|
5
|
-
"names": ["type"]
|
|
6
|
-
}
|
package/dist/plugs/esbuild.mjs
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
// plugs/esbuild.ts
|
|
2
|
-
import { basename } from "node:path";
|
|
3
|
-
import { build } from "esbuild";
|
|
4
|
-
import { assert } from "../asserts.mjs";
|
|
5
|
-
import { Files } from "../files.mjs";
|
|
6
|
-
import { readFile } from "../fs.mjs";
|
|
7
|
-
import { $p, ERROR, WARN } from "../logging.mjs";
|
|
8
|
-
import { getAbsoluteParent, resolveAbsolutePath } from "../paths.mjs";
|
|
9
|
-
import { install } from "../pipe.mjs";
|
|
10
|
-
export * from "./esbuild/bundle-locals.mjs";
|
|
11
|
-
export * from "./esbuild/fix-extensions.mjs";
|
|
12
|
-
install("esbuild", class ESBuild {
|
|
13
|
-
constructor(_options) {
|
|
14
|
-
this._options = _options;
|
|
15
|
-
}
|
|
16
|
-
_options;
|
|
17
|
-
async pipe(files, context) {
|
|
18
|
-
const entryPoints = [...files];
|
|
19
|
-
const absWorkingDir = files.directory;
|
|
20
|
-
const options = {
|
|
21
|
-
/* Default our platform/target to NodeJS, current major version */
|
|
22
|
-
platform: "node",
|
|
23
|
-
target: `node${process.versions["node"].split(".")[0]}`,
|
|
24
|
-
/* The default format (if not specified in options) is from package.json */
|
|
25
|
-
format: this._options.format || await _moduleFormat(files.directory, context.log),
|
|
26
|
-
/* Output bese directory */
|
|
27
|
-
outbase: absWorkingDir,
|
|
28
|
-
/* Merge in the caller's options */
|
|
29
|
-
...this._options,
|
|
30
|
-
/* Always override */
|
|
31
|
-
absWorkingDir,
|
|
32
|
-
entryPoints,
|
|
33
|
-
logLevel: "silent"
|
|
34
|
-
};
|
|
35
|
-
if (options.format === "cjs") {
|
|
36
|
-
options.define = Object.assign({ __fileurl: "__filename" }, options.define);
|
|
37
|
-
} else if (options.format === "esm") {
|
|
38
|
-
options.define = Object.assign({ __fileurl: "import.meta.url" }, options.define);
|
|
39
|
-
}
|
|
40
|
-
assert(!(options.outdir && options.outfile), 'Options "outfile" and "outdir" can not coexist');
|
|
41
|
-
let builder;
|
|
42
|
-
if (options.bundle && options.outfile && entryPoints.length === 1) {
|
|
43
|
-
builder = Files.builder(absWorkingDir);
|
|
44
|
-
const outputFile = resolveAbsolutePath(absWorkingDir, options.outfile);
|
|
45
|
-
const entryPoint = resolveAbsolutePath(absWorkingDir, entryPoints[0]);
|
|
46
|
-
options.outfile = outputFile;
|
|
47
|
-
context.log.debug("Bundling", $p(entryPoint), "into", $p(outputFile));
|
|
48
|
-
} else {
|
|
49
|
-
assert(options.outdir, 'Option "outdir" must be specified');
|
|
50
|
-
builder = Files.builder(context.resolve(options.outdir));
|
|
51
|
-
options.outdir = builder.directory;
|
|
52
|
-
const message = options.bundle ? "Bundling" : "Transpiling";
|
|
53
|
-
context.log.debug(message, entryPoints.length, "files to", $p(builder.directory));
|
|
54
|
-
}
|
|
55
|
-
const report = context.log.report("ESBuild Report");
|
|
56
|
-
context.log.trace("Running ESBuild", options);
|
|
57
|
-
let esbuild;
|
|
58
|
-
try {
|
|
59
|
-
esbuild = await build({ ...options, metafile: true });
|
|
60
|
-
context.log.trace("ESBuild Results", esbuild);
|
|
61
|
-
report.add(...esbuild.warnings.map((m) => convertMessage(WARN, m, absWorkingDir)));
|
|
62
|
-
report.add(...esbuild.errors.map((m) => convertMessage(ERROR, m, absWorkingDir)));
|
|
63
|
-
} catch (error) {
|
|
64
|
-
const e = error;
|
|
65
|
-
if (e.warnings) report.add(...e.warnings.map((m) => convertMessage(WARN, m, absWorkingDir)));
|
|
66
|
-
if (e.errors) report.add(...e.errors.map((m) => convertMessage(ERROR, m, absWorkingDir)));
|
|
67
|
-
}
|
|
68
|
-
await report.loadSources();
|
|
69
|
-
report.done();
|
|
70
|
-
assert(esbuild, "ESBuild did not produce any result");
|
|
71
|
-
for (const file in esbuild.metafile.outputs) {
|
|
72
|
-
builder.add(resolveAbsolutePath(absWorkingDir, file));
|
|
73
|
-
}
|
|
74
|
-
const result = builder.build();
|
|
75
|
-
context.log.info("ESBuild produced", result.length, "files into", $p(result.directory));
|
|
76
|
-
return result;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
function convertMessage(level, message, directory) {
|
|
80
|
-
const record = { level, message: message.text };
|
|
81
|
-
record.tags = [message.id, message.pluginName].filter((tag) => !!tag);
|
|
82
|
-
if (message.location) {
|
|
83
|
-
record.line = message.location.line;
|
|
84
|
-
record.column = message.location.column + 1;
|
|
85
|
-
record.length = message.location.length;
|
|
86
|
-
record.file = resolveAbsolutePath(directory, message.location.file);
|
|
87
|
-
}
|
|
88
|
-
return record;
|
|
89
|
-
}
|
|
90
|
-
var _moduleFormatCache = /* @__PURE__ */ new Map();
|
|
91
|
-
async function _moduleFormat(directory, log) {
|
|
92
|
-
const type = _moduleFormatCache.get(directory);
|
|
93
|
-
if (type) return type;
|
|
94
|
-
const file = resolveAbsolutePath(directory, "package.json");
|
|
95
|
-
try {
|
|
96
|
-
const json = await readFile(file, "utf-8");
|
|
97
|
-
const data = JSON.parse(json);
|
|
98
|
-
const type2 = data.type === "module" ? "esm" : "cjs";
|
|
99
|
-
log.debug(`File "${file}" defines module type as "${data.type}" (${type2})`);
|
|
100
|
-
_moduleFormatCache.set(directory, type2);
|
|
101
|
-
return type2;
|
|
102
|
-
} catch (cause) {
|
|
103
|
-
if (cause.code !== "ENOENT" && cause.code !== "EISDIR") throw cause;
|
|
104
|
-
}
|
|
105
|
-
const name = basename(directory);
|
|
106
|
-
const parent = getAbsoluteParent(directory);
|
|
107
|
-
if (name === "node_modules" || parent === directory) {
|
|
108
|
-
_moduleFormatCache.set(directory, "cjs");
|
|
109
|
-
return "cjs";
|
|
110
|
-
} else {
|
|
111
|
-
const type2 = await _moduleFormat(parent, log);
|
|
112
|
-
_moduleFormatCache.set(directory, type2);
|
|
113
|
-
return type2;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=esbuild.mjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/plugs/esbuild.ts"],
|
|
4
|
-
"mappings": ";AAAA,SAAS,gBAAgB;AAEzB,SAAS,aAAa;AAEtB,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,IAAI,OAAO,YAAY;AAChC,SAAS,mBAAmB,2BAA2B;AACvD,SAAS,eAAe;AAUxB,cAAc;AACd,cAAc;AAgCd,QAAQ,WAAW,MAAM,QAA+B;AAAA,EAEtD,YAA6B,UAA0B;AAA1B;AAAA,EAA2B;AAAA,EAA3B;AAAA,EAE7B,MAAM,KAAK,OAAc,SAAkC;AACzD,UAAM,cAAc,CAAE,GAAG,KAAM;AAC/B,UAAM,gBAAgB,MAAM;AAE5B,UAAM,UAAwB;AAAA;AAAA,MAE5B,UAAU;AAAA,MACV,QAAQ,OAAO,QAAQ,SAAS,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC,CAAC;AAAA;AAAA,MAGrD,QAAQ,KAAK,SAAS,UAAU,MAAM,cAAc,MAAM,WAAW,QAAQ,GAAG;AAAA;AAAA,MAGhF,SAAS;AAAA;AAAA,MAGT,GAAG,KAAK;AAAA;AAAA,MAGR;AAAA,MACA;AAAA,MACA,UAA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O,KAAK,MAAM,IAAI;AAG5B,UAAMA,QAAO,KAAK,SAAS,WAAW,QAAQ;AAC9C,QAAI,MAAM,SAAS,IAAI,6BAA6B,KAAK,IAAI,MAAMA,KAAI,GAAG;AAC1E,uBAAmB,IAAI,WAAWA,KAAI;AACtC,WAAOA;AAAA,EACT,SAAS,OAAY;AAEnB,QAAK,MAAM,SAAS,YAAc,MAAM,SAAS,SAAW,OAAM;AAAA,EACpE;AASA,QAAM,OAAO,SAAS,SAAS;AAC/B,QAAM,SAAS,kBAAkB,SAAS;AAE1C,MAAK,SAAS,kBAAoB,WAAW,WAAY;AACvD,uBAAmB,IAAI,WAAW,KAAK;AACvC,WAAO;AAAA,EACT,OAAO;AAEL,UAAMA,QAAO,MAAM,cAAc,QAAQ,GAAG;AAC5C,uBAAmB,IAAI,WAAWA,KAAI;AACtC,WAAOA;AAAA,EACT;AACF;",
|
|
5
|
-
"names": ["type"]
|
|
6
|
-
}
|
package/dist/plugs/exec.cjs
DELETED
|
@@ -1,42 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// plugs/exec.ts
|
|
17
|
-
var exec_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(exec_exports);
|
|
19
|
-
var import_pipe = require("../pipe.cjs");
|
|
20
|
-
var import_exec = require("../utils/exec.cjs");
|
|
21
|
-
var import_options = require("../utils/options.cjs");
|
|
22
|
-
(0, import_pipe.install)("exec", class Exec {
|
|
23
|
-
_cmd;
|
|
24
|
-
_args;
|
|
25
|
-
_options;
|
|
26
|
-
constructor(...args) {
|
|
27
|
-
const { params, options } = (0, import_options.parseOptions)(args, {});
|
|
28
|
-
const [_cmd, ..._args] = params;
|
|
29
|
-
this._cmd = _cmd;
|
|
30
|
-
this._args = _args;
|
|
31
|
-
this._options = options;
|
|
32
|
-
}
|
|
33
|
-
async pipe(files, context) {
|
|
34
|
-
const { relativePaths = true, ...options } = this._options;
|
|
35
|
-
if (!options.cwd) options.cwd = files.directory;
|
|
36
|
-
const params = [...relativePaths ? files : files.absolutePaths()];
|
|
37
|
-
if (options.shell) params.forEach((s, i, a) => a[i] = JSON.stringify(s));
|
|
38
|
-
await (0, import_exec.execChild)(this._cmd, [...this._args, ...params], options, context);
|
|
39
|
-
return files;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
//# sourceMappingURL=exec.cjs.map
|
package/dist/plugs/exec.cjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/plugs/exec.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,kBAAwB;AACxB,kBAA0B;AAC1B,qBAA6B;AAAA,IA4E7B,qBAAQ,QAAQ,MAAM,KAA4B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EAEjB,eAAe,MAA8B;AAC3C,UAAM,EAAE,QAAQ,QAAQ,QAAI,6BAAa,MAAM,CAAC,CAAC;AACjD,UAAM,CAAE,MAAM,GAAG,KAAM,IAAI;AAC3B,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,MAAM,KAAK,OAAc,SAAkC;AACzD,UAAM,EAAE,gBAAgB,MAAM,GAAG,QAAQ,IAAI,KAAK;AAElD,QAAI,CAAE,QAAQ,IAAK,SAAQ,MAAM,MAAM;AAGvC,UAAM,SAAS,CAAE,GAAI,gBAAgB,QAAQ,MAAM,cAAc,CAAI;AAGrE,QAAI,QAAQ,MAAO,QAAO,QAAQ,CAAC,GAAG,GAAG,MAAM,EAAE,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;AAGvE,cAAM,uBAAU,KAAK,MAAM,CAAE,GAAG,KAAK,OAAO,GAAG,MAAO,GAAG,SAAS,OAAO;AAGzE,WAAO;AAAA,EACT;AACF,CAAC;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/plugs/exec.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// plugs/exec.ts
|
|
2
|
-
import { install } from "../pipe.mjs";
|
|
3
|
-
import { execChild } from "../utils/exec.mjs";
|
|
4
|
-
import { parseOptions } from "../utils/options.mjs";
|
|
5
|
-
install("exec", class Exec {
|
|
6
|
-
_cmd;
|
|
7
|
-
_args;
|
|
8
|
-
_options;
|
|
9
|
-
constructor(...args) {
|
|
10
|
-
const { params, options } = parseOptions(args, {});
|
|
11
|
-
const [_cmd, ..._args] = params;
|
|
12
|
-
this._cmd = _cmd;
|
|
13
|
-
this._args = _args;
|
|
14
|
-
this._options = options;
|
|
15
|
-
}
|
|
16
|
-
async pipe(files, context) {
|
|
17
|
-
const { relativePaths = true, ...options } = this._options;
|
|
18
|
-
if (!options.cwd) options.cwd = files.directory;
|
|
19
|
-
const params = [...relativePaths ? files : files.absolutePaths()];
|
|
20
|
-
if (options.shell) params.forEach((s, i, a) => a[i] = JSON.stringify(s));
|
|
21
|
-
await execChild(this._cmd, [...this._args, ...params], options, context);
|
|
22
|
-
return files;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=exec.mjs.map
|
package/dist/plugs/exec.mjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/plugs/exec.ts"],
|
|
4
|
-
"mappings": ";AAAA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AA4E7B,QAAQ,QAAQ,MAAM,KAA4B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EAEjB,eAAe,MAA8B;AAC3C,UAAM,EAAE,QAAQ,QAAQ,IAAI,aAAa,MAAM,CAAC,CAAC;AACjD,UAAM,CAAE,MAAM,GAAG,KAAM,IAAI;AAC3B,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,MAAM,KAAK,OAAc,SAAkC;AACzD,UAAM,EAAE,gBAAgB,MAAM,GAAG,QAAQ,IAAI,KAAK;AAElD,QAAI,CAAE,QAAQ,IAAK,SAAQ,MAAM,MAAM;AAGvC,UAAM,SAAS,CAAE,GAAI,gBAAgB,QAAQ,MAAM,cAAc,CAAI;AAGrE,QAAI,QAAQ,MAAO,QAAO,QAAQ,CAAC,GAAG,GAAG,MAAM,EAAE,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;AAGvE,UAAM,UAAU,KAAK,MAAM,CAAE,GAAG,KAAK,OAAO,GAAG,MAAO,GAAG,SAAS,OAAO;AAGzE,WAAO;AAAA,EACT;AACF,CAAC;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/plugs/exports.cjs
DELETED
|
@@ -1,117 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// plugs/exports.ts
|
|
17
|
-
var exports_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(exports_exports);
|
|
19
|
-
var import_node_os = require("node:os");
|
|
20
|
-
var import_node_path = require("node:path");
|
|
21
|
-
var import_asserts = require("../asserts.cjs");
|
|
22
|
-
var import_files = require("../files.cjs");
|
|
23
|
-
var import_fs = require("../fs.cjs");
|
|
24
|
-
var import_logging = require("../logging.cjs");
|
|
25
|
-
var import_paths = require("../paths.cjs");
|
|
26
|
-
var import_pipe = require("../pipe.cjs");
|
|
27
|
-
(0, import_pipe.install)("exports", class Exports {
|
|
28
|
-
_packageJson;
|
|
29
|
-
_outputPackageJson;
|
|
30
|
-
_cjsExtension;
|
|
31
|
-
_esmExtension;
|
|
32
|
-
constructor(...args) {
|
|
33
|
-
const options = args[0] || {};
|
|
34
|
-
const {
|
|
35
|
-
packageJson = "package.json",
|
|
36
|
-
outputPackageJson = packageJson,
|
|
37
|
-
cjsExtension,
|
|
38
|
-
esmExtension
|
|
39
|
-
} = options;
|
|
40
|
-
this._packageJson = packageJson;
|
|
41
|
-
this._outputPackageJson = outputPackageJson;
|
|
42
|
-
this._cjsExtension = cjsExtension;
|
|
43
|
-
this._esmExtension = esmExtension;
|
|
44
|
-
}
|
|
45
|
-
async pipe(files, context) {
|
|
46
|
-
const incomingFile = context.resolve(this._packageJson);
|
|
47
|
-
const incomingData = await (0, import_fs.readFile)(incomingFile, "utf8");
|
|
48
|
-
const packageData = JSON.parse(incomingData);
|
|
49
|
-
const outgoingFile = context.resolve(this._outputPackageJson);
|
|
50
|
-
const outgoingDirectory = (0, import_paths.getAbsoluteParent)(outgoingFile);
|
|
51
|
-
const type = packageData.type === "module" ? "module" : packageData.type === "commonjs" ? "commonjs" : packageData.type == null ? "commonjs" : void 0;
|
|
52
|
-
(0, import_asserts.assert)(type, `Unknown module type "${packageData.type}" in ${(0, import_logging.$p)(incomingFile)}`);
|
|
53
|
-
context.log.debug(`Package file ${(0, import_logging.$p)(incomingFile)} declares module type "${type}"`);
|
|
54
|
-
const cjsExtension = this._cjsExtension || (type === "commonjs" ? ".js" : ".cjs");
|
|
55
|
-
const esmExtension = this._esmExtension || (type === "module" ? ".js" : ".mjs");
|
|
56
|
-
(0, import_asserts.assert)(cjsExtension !== esmExtension, `CommonJS and EcmaScript modules both resolve to same extension "${cjsExtension}"`);
|
|
57
|
-
const exports2 = {};
|
|
58
|
-
function addExport(name, type2, kind, file) {
|
|
59
|
-
if (!exports2[name]) exports2[name] = {};
|
|
60
|
-
if (!exports2[name][type2]) exports2[name][type2] = {};
|
|
61
|
-
exports2[name][type2][kind] = file;
|
|
62
|
-
}
|
|
63
|
-
const exts = [".d.mts", ".d.cts", ".d.ts", cjsExtension, esmExtension];
|
|
64
|
-
for (const [name, absolute] of files.pathMappings()) {
|
|
65
|
-
const relative = (0, import_paths.assertRelativeChildPath)(outgoingDirectory, absolute);
|
|
66
|
-
for (const ext of exts) {
|
|
67
|
-
if (!relative.endsWith(ext)) continue;
|
|
68
|
-
const base = `.${import_node_path.sep}${name.slice(0, -ext.length)}`;
|
|
69
|
-
const exp = base.endsWith(`${import_node_path.sep}index`) ? base.slice(0, -6) : base;
|
|
70
|
-
switch (ext) {
|
|
71
|
-
case cjsExtension:
|
|
72
|
-
addExport(exp, "require", "default", `.${import_node_path.sep}${relative}`);
|
|
73
|
-
break;
|
|
74
|
-
case esmExtension:
|
|
75
|
-
addExport(exp, "import", "default", `.${import_node_path.sep}${relative}`);
|
|
76
|
-
break;
|
|
77
|
-
case ".d.cts":
|
|
78
|
-
addExport(exp, "require", "types", `.${import_node_path.sep}${relative}`);
|
|
79
|
-
break;
|
|
80
|
-
case ".d.mts":
|
|
81
|
-
addExport(exp, "import", "types", `.${import_node_path.sep}${relative}`);
|
|
82
|
-
break;
|
|
83
|
-
case ".d.ts":
|
|
84
|
-
addExport(exp, "require", "types", `.${import_node_path.sep}${relative}`);
|
|
85
|
-
addExport(exp, "import", "types", `.${import_node_path.sep}${relative}`);
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if ("." in exports2) {
|
|
91
|
-
const rootExport = exports2["."];
|
|
92
|
-
packageData["main"] = rootExport?.require?.default;
|
|
93
|
-
packageData["module"] = rootExport?.import?.default;
|
|
94
|
-
packageData["types"] = packageData["type"] === "module" ? rootExport?.import?.types : rootExport?.require?.types;
|
|
95
|
-
}
|
|
96
|
-
packageData["exports"] = Object.keys(exports2).sort().reduce((obj, name) => {
|
|
97
|
-
const current = exports2[name];
|
|
98
|
-
if (!current) return obj;
|
|
99
|
-
obj[name] = current.require?.default || current.import?.default ? {
|
|
100
|
-
require: current.require?.default ? {
|
|
101
|
-
types: current.require.types || void 0,
|
|
102
|
-
default: current.require.default || void 0
|
|
103
|
-
} : void 0,
|
|
104
|
-
import: current.import?.default ? {
|
|
105
|
-
types: current.import.types || void 0,
|
|
106
|
-
default: current.import.default || void 0
|
|
107
|
-
} : void 0
|
|
108
|
-
} : void 0;
|
|
109
|
-
return obj;
|
|
110
|
-
}, {});
|
|
111
|
-
const outgoingData = JSON.stringify(packageData, null, 2);
|
|
112
|
-
context.log.info(`Writing new ${(0, import_logging.$p)(outgoingFile)}`, outgoingData);
|
|
113
|
-
await (0, import_fs.writeFile)(outgoingFile, outgoingData + import_node_os.EOL, "utf8");
|
|
114
|
-
return import_files.Files.builder((0, import_paths.getAbsoluteParent)(outgoingFile)).add(outgoingFile).build();
|
|
115
|
-
}
|
|
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