@xylabs/ts-scripts-yarn3 3.0.10 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/package/compile/CompileParams.js +17 -0
- package/dist/actions/package/compile/CompileParams.js.map +1 -0
- package/dist/actions/package/compile/CompileParams.mjs +1 -0
- package/dist/actions/package/compile/CompileParams.mjs.map +1 -0
- package/dist/actions/package/compile/compile.js +86 -0
- package/dist/actions/package/compile/compile.js.map +1 -0
- package/dist/actions/package/compile/compile.mjs +52 -0
- package/dist/actions/package/compile/compile.mjs.map +1 -0
- package/dist/actions/package/compile/copyTypeFiles.js +49 -0
- package/dist/actions/package/compile/copyTypeFiles.js.map +1 -0
- package/dist/actions/package/compile/copyTypeFiles.mjs +25 -0
- package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -0
- package/dist/actions/package/compile/index.js +29 -0
- package/dist/actions/package/compile/index.js.map +1 -0
- package/dist/actions/package/compile/index.mjs +5 -0
- package/dist/actions/package/compile/index.mjs.map +1 -0
- package/dist/actions/package/compile/inputs.js +58 -0
- package/dist/actions/package/compile/inputs.js.map +1 -0
- package/dist/actions/package/compile/inputs.mjs +32 -0
- package/dist/actions/package/compile/inputs.mjs.map +1 -0
- package/dist/actions/package/{compile.js → compile/rollup.js} +26 -76
- package/dist/actions/package/compile/rollup.js.map +1 -0
- package/dist/actions/package/compile/rollup.mjs +98 -0
- package/dist/actions/package/compile/rollup.mjs.map +1 -0
- package/dist/actions/package/compile/tsc.js +114 -0
- package/dist/actions/package/compile/tsc.js.map +1 -0
- package/dist/actions/package/compile/tsc.mjs +80 -0
- package/dist/actions/package/compile/tsc.mjs.map +1 -0
- package/dist/actions/package/compile/tscTypes.js +55 -0
- package/dist/actions/package/compile/tscTypes.js.map +1 -0
- package/dist/actions/package/compile/tscTypes.mjs +31 -0
- package/dist/actions/package/compile/tscTypes.mjs.map +1 -0
- package/dist/actions/package/compile/tsup.js +75 -0
- package/dist/actions/package/compile/tsup.js.map +1 -0
- package/dist/actions/package/compile/tsup.mjs +51 -0
- package/dist/actions/package/compile/tsup.mjs.map +1 -0
- package/dist/actions/package/publint.js +1 -1
- package/dist/actions/package/publint.js.map +1 -1
- package/dist/actions/package/publint.mjs +1 -1
- package/dist/actions/package/publint.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.js +31 -0
- package/dist/bin/package/compile-tsup.js.map +1 -0
- package/dist/bin/package/compile-tsup.mjs +8 -0
- package/dist/bin/package/compile-tsup.mjs.map +1 -0
- package/dist/index.d.mts +53 -10
- package/dist/index.d.ts +53 -10
- package/dist/lib/index.js +3 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +1 -0
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/loadConfig.js +54 -0
- package/dist/lib/loadConfig.js.map +1 -0
- package/dist/lib/loadConfig.mjs +20 -0
- package/dist/lib/loadConfig.mjs.map +1 -0
- package/package.json +6 -6
- package/src/actions/package/compile/CompileParams.ts +10 -0
- package/src/actions/package/compile/compile.ts +59 -0
- package/src/actions/package/compile/copyTypeFiles.ts +27 -0
- package/src/actions/package/compile/index.ts +4 -0
- package/src/actions/package/compile/inputs.ts +33 -0
- package/src/actions/package/compile/rollup.ts +108 -0
- package/src/actions/package/compile/tsc.ts +100 -0
- package/src/actions/package/compile/tscTypes.ts +32 -0
- package/src/actions/package/compile/tsup.ts +64 -0
- package/src/actions/package/publint.ts +5 -1
- package/src/bin/package/compile-tsup.ts +9 -0
- package/src/lib/index.ts +1 -0
- package/src/lib/loadConfig.ts +19 -0
- package/tsconfig.json +1 -7
- package/dist/actions/package/compile.js.map +0 -1
- package/dist/actions/package/compile.mjs +0 -149
- package/dist/actions/package/compile.mjs.map +0 -1
- package/src/actions/package/compile.ts +0 -176
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
var CompileParams_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(CompileParams_exports);
|
|
17
|
+
//# sourceMappingURL=CompileParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/CompileParams.ts"],"sourcesContent":["export interface RootParams {\n verbose?: boolean\n}\n\nexport interface CompileParams extends RootParams {\n compile?: {\n depth?: number\n publint?: boolean\n }\n}"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=CompileParams.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var compile_exports = {};
|
|
30
|
+
__export(compile_exports, {
|
|
31
|
+
packageCompile: () => packageCompile
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(compile_exports);
|
|
34
|
+
var import_tsup = require("./tsup");
|
|
35
|
+
var import_tsc = require("./tsc");
|
|
36
|
+
var import_rollup = require("./rollup");
|
|
37
|
+
var import_publint = require("../publint");
|
|
38
|
+
var import_lib = require("../../../lib");
|
|
39
|
+
var import_merge = __toESM(require("lodash/merge"));
|
|
40
|
+
var import_chalk = __toESM(require("chalk"));
|
|
41
|
+
const packageCompile = async (params) => {
|
|
42
|
+
const pkg = process.env.INIT_CWD;
|
|
43
|
+
console.log(import_chalk.default.green(`Compiling ${pkg}`));
|
|
44
|
+
const config = await (0, import_lib.loadConfig)(params);
|
|
45
|
+
const modes = config.compile?.modes ?? ["tsup"];
|
|
46
|
+
let modeIndex = 0;
|
|
47
|
+
while (modeIndex < modes.length) {
|
|
48
|
+
const mode = modes[modeIndex];
|
|
49
|
+
switch (mode) {
|
|
50
|
+
case "rollup": {
|
|
51
|
+
const result = (0, import_rollup.packageCompileRollup)((0, import_merge.default)({}, params, { compile: {
|
|
52
|
+
publint: false
|
|
53
|
+
} }));
|
|
54
|
+
if (result) {
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case "tsc": {
|
|
60
|
+
const result = (0, import_tsc.packageCompileTsc)((0, import_merge.default)({}, params, { compile: {
|
|
61
|
+
publint: false
|
|
62
|
+
} }));
|
|
63
|
+
if (result) {
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
case "tsup": {
|
|
69
|
+
const result = (0, import_tsup.packageCompileTsup)((0, import_merge.default)({}, params, { compile: {
|
|
70
|
+
publint: false
|
|
71
|
+
} }));
|
|
72
|
+
if (result) {
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
modeIndex++;
|
|
79
|
+
}
|
|
80
|
+
return config.compile?.publint ? await (0, import_publint.packagePublint)(params) : 0;
|
|
81
|
+
};
|
|
82
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
+
0 && (module.exports = {
|
|
84
|
+
packageCompile
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=compile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/compile.ts"],"sourcesContent":["import { packageCompileTsup } from './tsup'\nimport { CompileParams } from './CompileParams'\nimport { packageCompileTsc } from './tsc'\nimport { packageCompileRollup } from './rollup'\nimport { packagePublint } from '../publint'\nimport { loadConfig } from '../../../lib'\nimport merge from 'lodash/merge'\nimport chalk from 'chalk'\n\nexport type PackageCompileMode = 'tsup' | 'tsc' | 'rollup'\n\nexport type PackageCompileParams = CompileParams & {\n compile?: {\n modes?: PackageCompileMode[]\n }\n}\n\nexport const packageCompile = async (params?: PackageCompileParams): Promise<number> => {\n const pkg = process.env.INIT_CWD\n console.log(chalk.green(`Compiling ${pkg}`))\n const config = await loadConfig(params)\n\n const modes = config.compile?.modes ?? ['tsup']\n let modeIndex = 0\n while (modeIndex < modes.length) {\n const mode = modes[modeIndex]\n switch (mode) {\n case 'rollup': {\n const result = packageCompileRollup(merge({}, params, {compile: {\n publint: false\n }}))\n if (result) {\n return result\n }\n break\n }\n case 'tsc': {\n const result = packageCompileTsc(merge({}, params, {compile: {\n publint: false\n }}))\n if (result) {\n return result\n }\n break\n }\n case 'tsup': {\n const result = packageCompileTsup(merge({}, params, {compile: {\n publint: false\n }}))\n if (result) {\n return result\n }\n break\n }\n }\n modeIndex++\n }\n return (config.compile?.publint ? await packagePublint(params) : 0)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmC;AAEnC,iBAAkC;AAClC,oBAAqC;AACrC,qBAA+B;AAC/B,iBAA2B;AAC3B,mBAAkB;AAClB,mBAAkB;AAUX,MAAM,iBAAiB,OAAO,WAAmD;AACtF,QAAM,MAAM,QAAQ,IAAI;AACxB,UAAQ,IAAI,aAAAA,QAAM,MAAM,aAAa,GAAG,EAAE,CAAC;AAC3C,QAAM,SAAS,UAAM,uBAAW,MAAM;AAEtC,QAAM,QAAQ,OAAO,SAAS,SAAS,CAAC,MAAM;AAC9C,MAAI,YAAY;AAChB,SAAO,YAAY,MAAM,QAAQ;AAC/B,UAAM,OAAO,MAAM,SAAS;AAC5B,YAAQ,MAAM;AAAA,MACZ,KAAK,UAAU;AACb,cAAM,aAAS,wCAAqB,aAAAC,SAAM,CAAC,GAAG,QAAQ,EAAC,SAAS;AAAA,UAC9D,SAAS;AAAA,QACX,EAAC,CAAC,CAAC;AACH,YAAI,QAAQ;AACV,iBAAO;AAAA,QACT;AACA;AAAA,MACF;AAAA,MACA,KAAK,OAAO;AACV,cAAM,aAAS,kCAAkB,aAAAA,SAAM,CAAC,GAAG,QAAQ,EAAC,SAAS;AAAA,UAC3D,SAAS;AAAA,QACX,EAAC,CAAC,CAAC;AACH,YAAI,QAAQ;AACV,iBAAO;AAAA,QACT;AACA;AAAA,MACF;AAAA,MACA,KAAK,QAAQ;AACX,cAAM,aAAS,oCAAmB,aAAAA,SAAM,CAAC,GAAG,QAAQ,EAAC,SAAS;AAAA,UAC5D,SAAS;AAAA,QACX,EAAC,CAAC,CAAC;AACH,YAAI,QAAQ;AACV,iBAAO;AAAA,QACT;AACA;AAAA,MACF;AAAA,IACF;AACA;AAAA,EACF;AACA,SAAQ,OAAO,SAAS,UAAU,UAAM,+BAAe,MAAM,IAAI;AACnE;","names":["chalk","merge"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { packageCompileTsup } from "./tsup";
|
|
2
|
+
import { packageCompileTsc } from "./tsc";
|
|
3
|
+
import { packageCompileRollup } from "./rollup";
|
|
4
|
+
import { packagePublint } from "../publint";
|
|
5
|
+
import { loadConfig } from "../../../lib";
|
|
6
|
+
import merge from "lodash/merge";
|
|
7
|
+
import chalk from "chalk";
|
|
8
|
+
const packageCompile = async (params) => {
|
|
9
|
+
const pkg = process.env.INIT_CWD;
|
|
10
|
+
console.log(chalk.green(`Compiling ${pkg}`));
|
|
11
|
+
const config = await loadConfig(params);
|
|
12
|
+
const modes = config.compile?.modes ?? ["tsup"];
|
|
13
|
+
let modeIndex = 0;
|
|
14
|
+
while (modeIndex < modes.length) {
|
|
15
|
+
const mode = modes[modeIndex];
|
|
16
|
+
switch (mode) {
|
|
17
|
+
case "rollup": {
|
|
18
|
+
const result = packageCompileRollup(merge({}, params, { compile: {
|
|
19
|
+
publint: false
|
|
20
|
+
} }));
|
|
21
|
+
if (result) {
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
case "tsc": {
|
|
27
|
+
const result = packageCompileTsc(merge({}, params, { compile: {
|
|
28
|
+
publint: false
|
|
29
|
+
} }));
|
|
30
|
+
if (result) {
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
case "tsup": {
|
|
36
|
+
const result = packageCompileTsup(merge({}, params, { compile: {
|
|
37
|
+
publint: false
|
|
38
|
+
} }));
|
|
39
|
+
if (result) {
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
modeIndex++;
|
|
46
|
+
}
|
|
47
|
+
return config.compile?.publint ? await packagePublint(params) : 0;
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
packageCompile
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=compile.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/compile.ts"],"sourcesContent":["import { packageCompileTsup } from './tsup'\nimport { CompileParams } from './CompileParams'\nimport { packageCompileTsc } from './tsc'\nimport { packageCompileRollup } from './rollup'\nimport { packagePublint } from '../publint'\nimport { loadConfig } from '../../../lib'\nimport merge from 'lodash/merge'\nimport chalk from 'chalk'\n\nexport type PackageCompileMode = 'tsup' | 'tsc' | 'rollup'\n\nexport type PackageCompileParams = CompileParams & {\n compile?: {\n modes?: PackageCompileMode[]\n }\n}\n\nexport const packageCompile = async (params?: PackageCompileParams): Promise<number> => {\n const pkg = process.env.INIT_CWD\n console.log(chalk.green(`Compiling ${pkg}`))\n const config = await loadConfig(params)\n\n const modes = config.compile?.modes ?? ['tsup']\n let modeIndex = 0\n while (modeIndex < modes.length) {\n const mode = modes[modeIndex]\n switch (mode) {\n case 'rollup': {\n const result = packageCompileRollup(merge({}, params, {compile: {\n publint: false\n }}))\n if (result) {\n return result\n }\n break\n }\n case 'tsc': {\n const result = packageCompileTsc(merge({}, params, {compile: {\n publint: false\n }}))\n if (result) {\n return result\n }\n break\n }\n case 'tsup': {\n const result = packageCompileTsup(merge({}, params, {compile: {\n publint: false\n }}))\n if (result) {\n return result\n }\n break\n }\n }\n modeIndex++\n }\n return (config.compile?.publint ? await packagePublint(params) : 0)\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AAEnC,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,OAAO,WAAW;AAClB,OAAO,WAAW;AAUX,MAAM,iBAAiB,OAAO,WAAmD;AACtF,QAAM,MAAM,QAAQ,IAAI;AACxB,UAAQ,IAAI,MAAM,MAAM,aAAa,GAAG,EAAE,CAAC;AAC3C,QAAM,SAAS,MAAM,WAAW,MAAM;AAEtC,QAAM,QAAQ,OAAO,SAAS,SAAS,CAAC,MAAM;AAC9C,MAAI,YAAY;AAChB,SAAO,YAAY,MAAM,QAAQ;AAC/B,UAAM,OAAO,MAAM,SAAS;AAC5B,YAAQ,MAAM;AAAA,MACZ,KAAK,UAAU;AACb,cAAM,SAAS,qBAAqB,MAAM,CAAC,GAAG,QAAQ,EAAC,SAAS;AAAA,UAC9D,SAAS;AAAA,QACX,EAAC,CAAC,CAAC;AACH,YAAI,QAAQ;AACV,iBAAO;AAAA,QACT;AACA;AAAA,MACF;AAAA,MACA,KAAK,OAAO;AACV,cAAM,SAAS,kBAAkB,MAAM,CAAC,GAAG,QAAQ,EAAC,SAAS;AAAA,UAC3D,SAAS;AAAA,QACX,EAAC,CAAC,CAAC;AACH,YAAI,QAAQ;AACV,iBAAO;AAAA,QACT;AACA;AAAA,MACF;AAAA,MACA,KAAK,QAAQ;AACX,cAAM,SAAS,mBAAmB,MAAM,CAAC,GAAG,QAAQ,EAAC,SAAS;AAAA,UAC5D,SAAS;AAAA,QACX,EAAC,CAAC,CAAC;AACH,YAAI,QAAQ;AACV,iBAAO;AAAA,QACT;AACA;AAAA,MACF;AAAA,IACF;AACA;AAAA,EACF;AACA,SAAQ,OAAO,SAAS,UAAU,MAAM,eAAe,MAAM,IAAI;AACnE;","names":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
var copyTypeFiles_exports = {};
|
|
20
|
+
__export(copyTypeFiles_exports, {
|
|
21
|
+
copyTypeFiles: () => copyTypeFiles
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(copyTypeFiles_exports);
|
|
24
|
+
var import_promises = require("fs/promises");
|
|
25
|
+
const getDistTypeFiles = async () => {
|
|
26
|
+
return (await (0, import_promises.readdir)("dist", { recursive: true })).filter((file) => file.endsWith("d.ts")).map((file) => `dist/${file}`);
|
|
27
|
+
};
|
|
28
|
+
const getDistTypeMapFiles = async () => {
|
|
29
|
+
return (await (0, import_promises.readdir)("dist", { recursive: true })).filter((file) => file.endsWith("d.ts.map")).map((file) => `dist/${file}`);
|
|
30
|
+
};
|
|
31
|
+
const copyTypeFiles = async () => {
|
|
32
|
+
const distTypeFiles = await getDistTypeFiles();
|
|
33
|
+
await Promise.all(
|
|
34
|
+
distTypeFiles.map(async (file) => {
|
|
35
|
+
await (0, import_promises.copyFile)(file, file.replace("d.ts", "d.mts"));
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
const distTypeMapFiles = await getDistTypeMapFiles();
|
|
39
|
+
await Promise.all(
|
|
40
|
+
distTypeMapFiles.map(async (file) => {
|
|
41
|
+
await (0, import_promises.copyFile)(file, file.replace("d.ts.map", "d.mts.map"));
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
copyTypeFiles
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=copyTypeFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/copyTypeFiles.ts"],"sourcesContent":["import { copyFile, readdir } from 'fs/promises'\n\n\nconst getDistTypeFiles = async () => {\n return (await readdir('dist', { recursive: true })).filter((file) => file.endsWith('d.ts')).map((file) => `dist/${file}`)\n}\n\nconst getDistTypeMapFiles = async () => {\n return (await readdir('dist', { recursive: true })).filter((file) => file.endsWith('d.ts.map')).map((file) => `dist/${file}`)\n}\n\nexport const copyTypeFiles = async () => {\n //hybrid packages want two copies of the types\n const distTypeFiles = await getDistTypeFiles()\n await Promise.all(\n distTypeFiles.map(async (file) => {\n await copyFile(file, file.replace('d.ts', 'd.mts'))\n }),\n )\n \n const distTypeMapFiles = await getDistTypeMapFiles()\n await Promise.all(\n distTypeMapFiles.map(async (file) => {\n await copyFile(file, file.replace('d.ts.map', 'd.mts.map'))\n }),\n )\n}"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAkC;AAGlC,MAAM,mBAAmB,YAAY;AACnC,UAAQ,UAAM,yBAAQ,QAAQ,EAAE,WAAW,KAAK,CAAC,GAAG,OAAO,CAAC,SAAS,KAAK,SAAS,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,QAAQ,IAAI,EAAE;AAC1H;AAEA,MAAM,sBAAsB,YAAY;AACtC,UAAQ,UAAM,yBAAQ,QAAQ,EAAE,WAAW,KAAK,CAAC,GAAG,OAAO,CAAC,SAAS,KAAK,SAAS,UAAU,CAAC,EAAE,IAAI,CAAC,SAAS,QAAQ,IAAI,EAAE;AAC9H;AAEO,MAAM,gBAAgB,YAAY;AAErC,QAAM,gBAAgB,MAAM,iBAAiB;AAC7C,QAAM,QAAQ;AAAA,IACZ,cAAc,IAAI,OAAO,SAAS;AAChC,gBAAM,0BAAS,MAAM,KAAK,QAAQ,QAAQ,OAAO,CAAC;AAAA,IACpD,CAAC;AAAA,EACH;AAEA,QAAM,mBAAmB,MAAM,oBAAoB;AACnD,QAAM,QAAQ;AAAA,IACZ,iBAAiB,IAAI,OAAO,SAAS;AACnC,gBAAM,0BAAS,MAAM,KAAK,QAAQ,YAAY,WAAW,CAAC;AAAA,IAC5D,CAAC;AAAA,EACH;AACJ;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { copyFile, readdir } from "fs/promises";
|
|
2
|
+
const getDistTypeFiles = async () => {
|
|
3
|
+
return (await readdir("dist", { recursive: true })).filter((file) => file.endsWith("d.ts")).map((file) => `dist/${file}`);
|
|
4
|
+
};
|
|
5
|
+
const getDistTypeMapFiles = async () => {
|
|
6
|
+
return (await readdir("dist", { recursive: true })).filter((file) => file.endsWith("d.ts.map")).map((file) => `dist/${file}`);
|
|
7
|
+
};
|
|
8
|
+
const copyTypeFiles = async () => {
|
|
9
|
+
const distTypeFiles = await getDistTypeFiles();
|
|
10
|
+
await Promise.all(
|
|
11
|
+
distTypeFiles.map(async (file) => {
|
|
12
|
+
await copyFile(file, file.replace("d.ts", "d.mts"));
|
|
13
|
+
})
|
|
14
|
+
);
|
|
15
|
+
const distTypeMapFiles = await getDistTypeMapFiles();
|
|
16
|
+
await Promise.all(
|
|
17
|
+
distTypeMapFiles.map(async (file) => {
|
|
18
|
+
await copyFile(file, file.replace("d.ts.map", "d.mts.map"));
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
copyTypeFiles
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=copyTypeFiles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/copyTypeFiles.ts"],"sourcesContent":["import { copyFile, readdir } from 'fs/promises'\n\n\nconst getDistTypeFiles = async () => {\n return (await readdir('dist', { recursive: true })).filter((file) => file.endsWith('d.ts')).map((file) => `dist/${file}`)\n}\n\nconst getDistTypeMapFiles = async () => {\n return (await readdir('dist', { recursive: true })).filter((file) => file.endsWith('d.ts.map')).map((file) => `dist/${file}`)\n}\n\nexport const copyTypeFiles = async () => {\n //hybrid packages want two copies of the types\n const distTypeFiles = await getDistTypeFiles()\n await Promise.all(\n distTypeFiles.map(async (file) => {\n await copyFile(file, file.replace('d.ts', 'd.mts'))\n }),\n )\n \n const distTypeMapFiles = await getDistTypeMapFiles()\n await Promise.all(\n distTypeMapFiles.map(async (file) => {\n await copyFile(file, file.replace('d.ts.map', 'd.mts.map'))\n }),\n )\n}"],"mappings":"AAAA,SAAS,UAAU,eAAe;AAGlC,MAAM,mBAAmB,YAAY;AACnC,UAAQ,MAAM,QAAQ,QAAQ,EAAE,WAAW,KAAK,CAAC,GAAG,OAAO,CAAC,SAAS,KAAK,SAAS,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,QAAQ,IAAI,EAAE;AAC1H;AAEA,MAAM,sBAAsB,YAAY;AACtC,UAAQ,MAAM,QAAQ,QAAQ,EAAE,WAAW,KAAK,CAAC,GAAG,OAAO,CAAC,SAAS,KAAK,SAAS,UAAU,CAAC,EAAE,IAAI,CAAC,SAAS,QAAQ,IAAI,EAAE;AAC9H;AAEO,MAAM,gBAAgB,YAAY;AAErC,QAAM,gBAAgB,MAAM,iBAAiB;AAC7C,QAAM,QAAQ;AAAA,IACZ,cAAc,IAAI,OAAO,SAAS;AAChC,YAAM,SAAS,MAAM,KAAK,QAAQ,QAAQ,OAAO,CAAC;AAAA,IACpD,CAAC;AAAA,EACH;AAEA,QAAM,mBAAmB,MAAM,oBAAoB;AACnD,QAAM,QAAQ;AAAA,IACZ,iBAAiB,IAAI,OAAO,SAAS;AACnC,YAAM,SAAS,MAAM,KAAK,QAAQ,YAAY,WAAW,CAAC;AAAA,IAC5D,CAAC;AAAA,EACH;AACJ;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
var compile_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(compile_exports);
|
|
18
|
+
__reExport(compile_exports, require("./compile"), module.exports);
|
|
19
|
+
__reExport(compile_exports, require("./tsc"), module.exports);
|
|
20
|
+
__reExport(compile_exports, require("./tsup"), module.exports);
|
|
21
|
+
__reExport(compile_exports, require("./rollup"), module.exports);
|
|
22
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
+
0 && (module.exports = {
|
|
24
|
+
...require("./compile"),
|
|
25
|
+
...require("./tsc"),
|
|
26
|
+
...require("./tsup"),
|
|
27
|
+
...require("./rollup")
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/index.ts"],"sourcesContent":["export * from './compile'\nexport * from './tsc'\nexport * from './tsup'\nexport * from './rollup'"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4BAAc,sBAAd;AACA,4BAAc,kBADd;AAEA,4BAAc,mBAFd;AAGA,4BAAc,qBAHd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/index.ts"],"sourcesContent":["export * from './compile'\nexport * from './tsc'\nexport * from './tsup'\nexport * from './rollup'"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
var inputs_exports = {};
|
|
20
|
+
__export(inputs_exports, {
|
|
21
|
+
getAllInputs: () => getAllInputs,
|
|
22
|
+
getInputDirs: () => getInputDirs,
|
|
23
|
+
getInputs: () => getInputs
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(inputs_exports);
|
|
26
|
+
var import_promises = require("fs/promises");
|
|
27
|
+
const getInputs = async (subDir) => {
|
|
28
|
+
return (await (0, import_promises.readdir)(subDir ? `src/${subDir}` : "src", { recursive: false })).filter((file) => (file.endsWith(".ts") || file.endsWith(".tsx")) && !file.endsWith("d.ts") && !file.endsWith("spec.ts")).map((file) => subDir ? `${subDir}/${file}` : file);
|
|
29
|
+
};
|
|
30
|
+
const getInputDirs = async (depth = 0) => {
|
|
31
|
+
if (depth === 0) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
return [
|
|
35
|
+
".",
|
|
36
|
+
...(await (0, import_promises.readdir)("src", { recursive: depth > 1, withFileTypes: true })).filter((file) => file.isDirectory()).map((file) => {
|
|
37
|
+
const pathParts = file.path.split("/");
|
|
38
|
+
pathParts.shift();
|
|
39
|
+
if (pathParts.length) {
|
|
40
|
+
const root = pathParts.join("/");
|
|
41
|
+
return `${root}/${file.name}`;
|
|
42
|
+
} else {
|
|
43
|
+
return file.name;
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
];
|
|
47
|
+
};
|
|
48
|
+
const getAllInputs = async (depth = 100) => {
|
|
49
|
+
const dirs = await getInputDirs(depth);
|
|
50
|
+
return (await Promise.all(dirs.map(async (dir) => await getInputs(dir)))).flat();
|
|
51
|
+
};
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
getAllInputs,
|
|
55
|
+
getInputDirs,
|
|
56
|
+
getInputs
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=inputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/inputs.ts"],"sourcesContent":["import { readdir } from 'fs/promises'\n\nexport const getInputs = async (subDir?: string) => {\n return (await readdir(subDir ? `src/${subDir}` : 'src', { recursive: false }))\n .filter((file) => (file.endsWith('.ts') || file.endsWith('.tsx')) && !file.endsWith('d.ts') && !file.endsWith('spec.ts'))\n .map((file) => (subDir ? `${subDir}/${file}` : file))\n}\n\nexport const getInputDirs = async (depth: number = 0) => {\n if (depth === 0) {\n return []\n }\n return [\n '.',\n ...(await readdir('src', { recursive: depth > 1, withFileTypes: true }))\n .filter((file) => file.isDirectory())\n .map((file) => {\n const pathParts = file.path.split('/')\n pathParts.shift()\n if (pathParts.length) {\n const root = pathParts.join('/')\n return `${root}/${file.name}`\n } else {\n return file.name\n }\n }),\n ]\n}\n\nexport const getAllInputs = async (depth: number = 100) => {\n const dirs = await getInputDirs(depth)\n return (await Promise.all(dirs.map(async (dir) => await getInputs(dir)))).flat()\n}"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAwB;AAEjB,MAAM,YAAY,OAAO,WAAoB;AAClD,UAAQ,UAAM,yBAAQ,SAAS,OAAO,MAAM,KAAK,OAAO,EAAE,WAAW,MAAM,CAAC,GACzE,OAAO,CAAC,UAAU,KAAK,SAAS,KAAK,KAAK,KAAK,SAAS,MAAM,MAAM,CAAC,KAAK,SAAS,MAAM,KAAK,CAAC,KAAK,SAAS,SAAS,CAAC,EACvH,IAAI,CAAC,SAAU,SAAS,GAAG,MAAM,IAAI,IAAI,KAAK,IAAK;AACxD;AAEO,MAAM,eAAe,OAAO,QAAgB,MAAM;AACvD,MAAI,UAAU,GAAG;AACf,WAAO,CAAC;AAAA,EACV;AACA,SAAO;AAAA,IACL;AAAA,IACA,IAAI,UAAM,yBAAQ,OAAO,EAAE,WAAW,QAAQ,GAAG,eAAe,KAAK,CAAC,GACnE,OAAO,CAAC,SAAS,KAAK,YAAY,CAAC,EACnC,IAAI,CAAC,SAAS;AACb,YAAM,YAAY,KAAK,KAAK,MAAM,GAAG;AACrC,gBAAU,MAAM;AAChB,UAAI,UAAU,QAAQ;AACpB,cAAM,OAAO,UAAU,KAAK,GAAG;AAC/B,eAAO,GAAG,IAAI,IAAI,KAAK,IAAI;AAAA,MAC7B,OAAO;AACL,eAAO,KAAK;AAAA,MACd;AAAA,IACF,CAAC;AAAA,EACL;AACF;AAEO,MAAM,eAAe,OAAO,QAAgB,QAAQ;AACzD,QAAM,OAAO,MAAM,aAAa,KAAK;AACrC,UAAQ,MAAM,QAAQ,IAAI,KAAK,IAAI,OAAO,QAAQ,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,KAAK;AACjF;","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { readdir } from "fs/promises";
|
|
2
|
+
const getInputs = async (subDir) => {
|
|
3
|
+
return (await readdir(subDir ? `src/${subDir}` : "src", { recursive: false })).filter((file) => (file.endsWith(".ts") || file.endsWith(".tsx")) && !file.endsWith("d.ts") && !file.endsWith("spec.ts")).map((file) => subDir ? `${subDir}/${file}` : file);
|
|
4
|
+
};
|
|
5
|
+
const getInputDirs = async (depth = 0) => {
|
|
6
|
+
if (depth === 0) {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
return [
|
|
10
|
+
".",
|
|
11
|
+
...(await readdir("src", { recursive: depth > 1, withFileTypes: true })).filter((file) => file.isDirectory()).map((file) => {
|
|
12
|
+
const pathParts = file.path.split("/");
|
|
13
|
+
pathParts.shift();
|
|
14
|
+
if (pathParts.length) {
|
|
15
|
+
const root = pathParts.join("/");
|
|
16
|
+
return `${root}/${file.name}`;
|
|
17
|
+
} else {
|
|
18
|
+
return file.name;
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
];
|
|
22
|
+
};
|
|
23
|
+
const getAllInputs = async (depth = 100) => {
|
|
24
|
+
const dirs = await getInputDirs(depth);
|
|
25
|
+
return (await Promise.all(dirs.map(async (dir) => await getInputs(dir)))).flat();
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
getAllInputs,
|
|
29
|
+
getInputDirs,
|
|
30
|
+
getInputs
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=inputs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/inputs.ts"],"sourcesContent":["import { readdir } from 'fs/promises'\n\nexport const getInputs = async (subDir?: string) => {\n return (await readdir(subDir ? `src/${subDir}` : 'src', { recursive: false }))\n .filter((file) => (file.endsWith('.ts') || file.endsWith('.tsx')) && !file.endsWith('d.ts') && !file.endsWith('spec.ts'))\n .map((file) => (subDir ? `${subDir}/${file}` : file))\n}\n\nexport const getInputDirs = async (depth: number = 0) => {\n if (depth === 0) {\n return []\n }\n return [\n '.',\n ...(await readdir('src', { recursive: depth > 1, withFileTypes: true }))\n .filter((file) => file.isDirectory())\n .map((file) => {\n const pathParts = file.path.split('/')\n pathParts.shift()\n if (pathParts.length) {\n const root = pathParts.join('/')\n return `${root}/${file.name}`\n } else {\n return file.name\n }\n }),\n ]\n}\n\nexport const getAllInputs = async (depth: number = 100) => {\n const dirs = await getInputDirs(depth)\n return (await Promise.all(dirs.map(async (dir) => await getInputs(dir)))).flat()\n}"],"mappings":"AAAA,SAAS,eAAe;AAEjB,MAAM,YAAY,OAAO,WAAoB;AAClD,UAAQ,MAAM,QAAQ,SAAS,OAAO,MAAM,KAAK,OAAO,EAAE,WAAW,MAAM,CAAC,GACzE,OAAO,CAAC,UAAU,KAAK,SAAS,KAAK,KAAK,KAAK,SAAS,MAAM,MAAM,CAAC,KAAK,SAAS,MAAM,KAAK,CAAC,KAAK,SAAS,SAAS,CAAC,EACvH,IAAI,CAAC,SAAU,SAAS,GAAG,MAAM,IAAI,IAAI,KAAK,IAAK;AACxD;AAEO,MAAM,eAAe,OAAO,QAAgB,MAAM;AACvD,MAAI,UAAU,GAAG;AACf,WAAO,CAAC;AAAA,EACV;AACA,SAAO;AAAA,IACL;AAAA,IACA,IAAI,MAAM,QAAQ,OAAO,EAAE,WAAW,QAAQ,GAAG,eAAe,KAAK,CAAC,GACnE,OAAO,CAAC,SAAS,KAAK,YAAY,CAAC,EACnC,IAAI,CAAC,SAAS;AACb,YAAM,YAAY,KAAK,KAAK,MAAM,GAAG;AACrC,gBAAU,MAAM;AAChB,UAAI,UAAU,QAAQ;AACpB,cAAM,OAAO,UAAU,KAAK,GAAG;AAC/B,eAAO,GAAG,IAAI,IAAI,KAAK,IAAI;AAAA,MAC7B,OAAO;AACL,eAAO,KAAK;AAAA,MACd;AAAA,IACF,CAAC;AAAA,EACL;AACF;AAEO,MAAM,eAAe,OAAO,QAAgB,QAAQ;AACzD,QAAM,OAAO,MAAM,aAAa,KAAK;AACrC,UAAQ,MAAM,QAAQ,IAAI,KAAK,IAAI,OAAO,QAAQ,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,KAAK;AACjF;","names":[]}
|
|
@@ -26,24 +26,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
|
|
29
|
+
var rollup_exports = {};
|
|
30
|
+
__export(rollup_exports, {
|
|
31
|
+
compileSubDir: () => compileSubDir,
|
|
32
|
+
packageCompileRollup: () => packageCompileRollup
|
|
32
33
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(rollup_exports);
|
|
34
35
|
var import_plugin_commonjs = __toESM(require("@rollup/plugin-commonjs"));
|
|
36
|
+
var import_plugin_json = __toESM(require("@rollup/plugin-json"));
|
|
35
37
|
var import_plugin_typescript = __toESM(require("@rollup/plugin-typescript"));
|
|
36
38
|
var import_chalk = __toESM(require("chalk"));
|
|
37
|
-
var import_cosmiconfig = require("cosmiconfig");
|
|
38
|
-
var import_promises = require("fs/promises");
|
|
39
39
|
var import_rollup = require("rollup");
|
|
40
40
|
var import_rollup_plugin_exclude_dependencies_from_bundle = __toESM(require("rollup-plugin-exclude-dependencies-from-bundle"));
|
|
41
41
|
var import_rollup_plugin_node_externals = __toESM(require("rollup-plugin-node-externals"));
|
|
42
|
-
var
|
|
43
|
-
var import_publint = require("
|
|
44
|
-
|
|
42
|
+
var import_inputs = require("./inputs");
|
|
43
|
+
var import_publint = require("../publint");
|
|
44
|
+
var import_loadPackageConfig = require("../../../loadPackageConfig");
|
|
45
|
+
var import_lib = require("../../../lib");
|
|
46
|
+
const compileSubDir = async (format, ext, subDir, verbose = false) => {
|
|
45
47
|
const dir = subDir === "." ? void 0 : subDir;
|
|
46
|
-
const input = await getInputs(dir);
|
|
48
|
+
const input = await (0, import_inputs.getInputs)(dir);
|
|
47
49
|
const tsPlugIn = (0, import_plugin_typescript.default)({
|
|
48
50
|
baseUrl: "src",
|
|
49
51
|
declaration: !dir || !subDir,
|
|
@@ -93,7 +95,7 @@ const rollItUp = async (format, ext, subDir) => {
|
|
|
93
95
|
});
|
|
94
96
|
return defaultHandler(level, log);
|
|
95
97
|
},
|
|
96
|
-
plugins: [(0, import_plugin_commonjs.default)(), (0, import_rollup_plugin_exclude_dependencies_from_bundle.default)(), (0, import_rollup_plugin_node_externals.default)(), tsPlugIn]
|
|
98
|
+
plugins: [(0, import_plugin_commonjs.default)(), (0, import_rollup_plugin_exclude_dependencies_from_bundle.default)(), (0, import_rollup_plugin_node_externals.default)(), (0, import_plugin_json.default)(), tsPlugIn]
|
|
97
99
|
};
|
|
98
100
|
const outputOptions = {
|
|
99
101
|
dir: subDir ? `dist/${subDir}` : "dist",
|
|
@@ -107,77 +109,25 @@ const rollItUp = async (format, ext, subDir) => {
|
|
|
107
109
|
}
|
|
108
110
|
return errors.length + warnings.length;
|
|
109
111
|
};
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
return [
|
|
118
|
-
".",
|
|
119
|
-
...(await (0, import_promises.readdir)("src", { recursive: depth > 1, withFileTypes: true })).filter((file) => file.isDirectory()).map((file) => {
|
|
120
|
-
const pathParts = file.path.split("/");
|
|
121
|
-
pathParts.shift();
|
|
122
|
-
if (pathParts.length) {
|
|
123
|
-
const root = pathParts.join("/");
|
|
124
|
-
return `${root}/${file.name}`;
|
|
125
|
-
} else {
|
|
126
|
-
return file.name;
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
];
|
|
130
|
-
};
|
|
131
|
-
const getDistTypeFiles = async () => {
|
|
132
|
-
return (await (0, import_promises.readdir)("dist", { recursive: true })).filter((file) => file.endsWith("d.ts")).map((file) => `dist/${file}`);
|
|
133
|
-
};
|
|
134
|
-
const getDistTypeMapFiles = async () => {
|
|
135
|
-
return (await (0, import_promises.readdir)("dist", { recursive: true })).filter((file) => file.endsWith("d.ts.map")).map((file) => `dist/${file}`);
|
|
136
|
-
};
|
|
137
|
-
const buildIt = async (pkg, compileDepth) => {
|
|
138
|
-
console.log(`Compile Depth: ${compileDepth}`);
|
|
139
|
-
const inputDirs = await getInputDirs(compileDepth);
|
|
112
|
+
const packageCompileRollup = async (params) => {
|
|
113
|
+
const config = await (0, import_lib.loadConfig)(params);
|
|
114
|
+
const pkg = await (0, import_loadPackageConfig.loadPackageConfig)();
|
|
115
|
+
const inputDirs = await (0, import_inputs.getInputDirs)(config.compile?.depth);
|
|
116
|
+
const verbose = config.verbose;
|
|
117
|
+
const publint = config.compile?.publint;
|
|
140
118
|
const pkgType = pkg.type ?? "commonjs";
|
|
141
119
|
const esmExt = pkgType === "module" ? "js" : "mjs";
|
|
142
120
|
const cjsExt = pkgType === "commonjs" ? "js" : "cjs";
|
|
143
|
-
const
|
|
121
|
+
const result = (await Promise.all(
|
|
144
122
|
inputDirs.map(async (inputDir) => {
|
|
145
|
-
return await
|
|
146
|
-
})
|
|
147
|
-
) : [await rollItUp("esm", esmExt) + await rollItUp("cjs", cjsExt)];
|
|
148
|
-
const distTypeFiles = await getDistTypeFiles();
|
|
149
|
-
await Promise.all(
|
|
150
|
-
distTypeFiles.map(async (file) => {
|
|
151
|
-
await (0, import_promises.copyFile)(file, file.replace("d.ts", "d.mts"));
|
|
152
|
-
})
|
|
153
|
-
);
|
|
154
|
-
const distTypeMapFiles = await getDistTypeMapFiles();
|
|
155
|
-
await Promise.all(
|
|
156
|
-
distTypeMapFiles.map(async (file) => {
|
|
157
|
-
await (0, import_promises.copyFile)(file, file.replace("d.ts.map", "d.mts.map"));
|
|
123
|
+
return await compileSubDir("cjs", cjsExt, inputDir, verbose) + await compileSubDir("esm", esmExt, inputDir, verbose);
|
|
158
124
|
})
|
|
159
|
-
);
|
|
160
|
-
return
|
|
161
|
-
};
|
|
162
|
-
const packageCompile = async ({ publint = true, verbose } = { verbose: false }) => {
|
|
163
|
-
const xyConfig = await (0, import_cosmiconfig.cosmiconfig)("xy").search();
|
|
164
|
-
const compileDepth = xyConfig?.config.compile?.depth ?? 0;
|
|
165
|
-
const pkgName = process.env.npm_package_name;
|
|
166
|
-
if (verbose) {
|
|
167
|
-
console.log(import_chalk.default.green(`Compiling ${pkgName} Start`));
|
|
168
|
-
}
|
|
169
|
-
const result = await buildIt(await (0, import_loadPackageConfig.loadPackageConfig)(), compileDepth) + (publint ? await (0, import_publint.packagePublint)() : 0);
|
|
170
|
-
if (result) {
|
|
171
|
-
const input = await getInputs();
|
|
172
|
-
console.log(`Inputs: ${JSON.stringify(input, null, 2)}`);
|
|
173
|
-
console.error(import_chalk.default.red(`Compiling ${pkgName} Failed [${result}]`));
|
|
174
|
-
} else if (verbose) {
|
|
175
|
-
console.log(import_chalk.default.green(`Compiling ${pkgName} Done`));
|
|
176
|
-
}
|
|
177
|
-
return result;
|
|
125
|
+
)).reduce((prev, result2) => prev + result2, 0);
|
|
126
|
+
return result + (publint ? await (0, import_publint.packagePublint)() : 0);
|
|
178
127
|
};
|
|
179
128
|
// Annotate the CommonJS export names for ESM import in node:
|
|
180
129
|
0 && (module.exports = {
|
|
181
|
-
|
|
130
|
+
compileSubDir,
|
|
131
|
+
packageCompileRollup
|
|
182
132
|
});
|
|
183
|
-
//# sourceMappingURL=
|
|
133
|
+
//# sourceMappingURL=rollup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/rollup.ts"],"sourcesContent":["import commonjs from '@rollup/plugin-commonjs'\nimport json from '@rollup/plugin-json'\nimport typescript from '@rollup/plugin-typescript'\nimport chalk from 'chalk'\nimport { OutputOptions, rollup, RollupLog, RollupOptions } from 'rollup'\nimport externalDeps from 'rollup-plugin-exclude-dependencies-from-bundle'\nimport nodeExternals from 'rollup-plugin-node-externals'\nimport { getInputDirs, getInputs } from './inputs'\nimport { packagePublint } from '../publint'\nimport { loadPackageConfig } from '../../../loadPackageConfig'\nimport { CompileParams } from './CompileParams'\nimport { loadConfig } from '../../../lib'\n\nexport interface PackageCompileRollupParams extends CompileParams {\n\n}\n\nexport const compileSubDir = async (format: 'cjs' | 'esm', ext: string, subDir?: string, verbose = false) => {\n const dir = subDir === '.' ? undefined : subDir\n const input = await getInputs(dir)\n const tsPlugIn = typescript({\n baseUrl: 'src',\n declaration: !dir || !subDir,\n declarationMap: !dir || !subDir,\n emitDeclarationOnly: false,\n esModuleInterop: true,\n exclude: ['**/*.spec.*', 'dist', 'docs', 'node_modules', 'packages'],\n outDir: dir ? `dist/${dir}` : 'dist',\n rootDir: 'src',\n tsconfig: 'tsconfig.json',\n })\n\n const errors: RollupLog[] = []\n const warnings: RollupLog[] = []\n const infos: RollupLog[] = []\n const debugs: RollupLog[] = []\n\n const options: RollupOptions = {\n input: subDir ? input.map((file) => `./src/${file}`) : ['./src/index.ts'],\n logLevel: 'warn',\n onLog: (level, log, defaultHandler) => {\n const pushLog = !(log.code === 'EMPTY_BUNDLE' || log.code === 'MIXED_EXPORTS' || log.code === 'UNUSED_EXTERNAL_IMPORT')\n if (pushLog) {\n switch (level) {\n case 'warn': {\n warnings.push(log)\n break\n }\n case 'info': {\n infos.push(log)\n break\n }\n case 'debug': {\n debugs.push(log)\n break\n }\n default: {\n errors.push(log)\n break\n }\n }\n }\n console.log(chalk.yellow(`${level}: ${log.message} [${log.code}]`))\n if (log.id) {\n console.log(chalk.gray(log.id))\n }\n log.ids?.map((id) => {\n console.log(chalk.gray(id))\n })\n return defaultHandler(level, log)\n },\n plugins: [commonjs(), externalDeps(), nodeExternals(), json(), tsPlugIn],\n }\n\n const outputOptions: OutputOptions = {\n dir: subDir ? `dist/${subDir}` : 'dist',\n dynamicImportInCjs: true,\n entryFileNames: (chunkInfo) => `${chunkInfo.name}.${ext}`,\n format,\n sourcemap: true,\n }\n\n if (input.length) {\n await (await rollup(options)).write(outputOptions)\n }\n\n return errors.length + warnings.length\n}\n\nexport const packageCompileRollup = async (params?: PackageCompileRollupParams) => {\n const config = await loadConfig(params)\n const pkg = await loadPackageConfig()\n const inputDirs = await getInputDirs(config.compile?.depth)\n const verbose = config.verbose\n const publint = config.compile?.publint\n\n const pkgType = pkg.type ?? 'commonjs'\n\n const esmExt = pkgType === 'module' ? 'js' : 'mjs'\n const cjsExt = pkgType === 'commonjs' ? 'js' : 'cjs'\n\n const result = (await Promise.all(\n inputDirs.map(async (inputDir) => {\n return await compileSubDir('cjs', cjsExt, inputDir, verbose) + await compileSubDir('esm', esmExt, inputDir, verbose)\n }),\n )).reduce(((prev, result) => prev + result), 0)\n return result + (publint ? await packagePublint() : 0)\n}"],"mappings":"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","names":["typescript","chalk","commonjs","externalDeps","nodeExternals","json","result"]}
|