@xylabs/ts-scripts-yarn3 3.0.62 → 3.0.64
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/dupdeps.js +2 -1
- package/dist/actions/dupdeps.js.map +1 -1
- package/dist/actions/dupdeps.mjs +2 -1
- package/dist/actions/dupdeps.mjs.map +1 -1
- package/dist/actions/package/compile/compile.js +7 -4
- package/dist/actions/package/compile/compile.js.map +1 -1
- package/dist/actions/package/compile/compile.mjs +7 -4
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/getCompilerOptions.js +3 -2
- package/dist/actions/package/compile/getCompilerOptions.js.map +1 -1
- package/dist/actions/package/compile/getCompilerOptions.mjs +3 -2
- package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
- package/dist/actions/package/compile/inputs.js +2 -1
- package/dist/actions/package/compile/inputs.js.map +1 -1
- package/dist/actions/package/compile/inputs.mjs +2 -1
- package/dist/actions/package/compile/inputs.mjs.map +1 -1
- package/dist/actions/package/compile/rollup.js +5 -3
- package/dist/actions/package/compile/rollup.js.map +1 -1
- package/dist/actions/package/compile/rollup.mjs +5 -3
- package/dist/actions/package/compile/rollup.mjs.map +1 -1
- package/dist/actions/package/compile/tsc.js +3 -2
- package/dist/actions/package/compile/tsc.js.map +1 -1
- package/dist/actions/package/compile/tsc.mjs +3 -2
- package/dist/actions/package/compile/tsc.mjs.map +1 -1
- package/dist/actions/package/compile/tscNoEmit.js +1 -1
- package/dist/actions/package/compile/tscNoEmit.js.map +1 -1
- package/dist/actions/package/compile/tscNoEmit.mjs +1 -1
- package/dist/actions/package/compile/tscNoEmit.mjs.map +1 -1
- package/dist/actions/package/compile/tscTypes.js +5 -4
- package/dist/actions/package/compile/tscTypes.js.map +1 -1
- package/dist/actions/package/compile/tscTypes.mjs +5 -4
- package/dist/actions/package/compile/tscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/tsup.js +7 -5
- package/dist/actions/package/compile/tsup.js.map +1 -1
- package/dist/actions/package/compile/tsup.mjs +7 -5
- package/dist/actions/package/compile/tsup.mjs.map +1 -1
- package/dist/actions/package/compile/tsup2.js +6 -5
- package/dist/actions/package/compile/tsup2.js.map +1 -1
- package/dist/actions/package/compile/tsup2.mjs +6 -5
- package/dist/actions/package/compile/tsup2.mjs.map +1 -1
- package/dist/actions/package/publint.js +10 -11
- package/dist/actions/package/publint.js.map +1 -1
- package/dist/actions/package/publint.mjs +10 -11
- package/dist/actions/package/publint.mjs.map +1 -1
- package/dist/actions/statics.js +2 -1
- package/dist/actions/statics.js.map +1 -1
- package/dist/actions/statics.mjs +2 -1
- package/dist/actions/statics.mjs.map +1 -1
- package/dist/bin/package/publint.js +1 -0
- package/dist/bin/package/publint.js.map +1 -1
- package/dist/bin/package/publint.mjs +1 -0
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/lib/createBuildConfig.js +2 -1
- package/dist/lib/createBuildConfig.js.map +1 -1
- package/dist/lib/createBuildConfig.mjs +2 -1
- package/dist/lib/createBuildConfig.mjs.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.js +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.js.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
- package/dist/lib/loadConfig.js +2 -2
- package/dist/lib/loadConfig.js.map +1 -1
- package/dist/lib/loadConfig.mjs +2 -2
- package/dist/lib/loadConfig.mjs.map +1 -1
- package/dist/lib/runSteps.js +2 -2
- package/dist/lib/runSteps.js.map +1 -1
- package/dist/lib/runSteps.mjs +2 -2
- package/dist/lib/runSteps.mjs.map +1 -1
- package/dist/lib/runStepsAsync.js +1 -1
- package/dist/lib/runStepsAsync.js.map +1 -1
- package/dist/lib/runStepsAsync.mjs +1 -1
- package/dist/lib/runStepsAsync.mjs.map +1 -1
- package/dist/lib/string/empty.js +1 -1
- package/dist/lib/string/empty.js.map +1 -1
- package/dist/lib/string/empty.mjs +1 -1
- package/dist/lib/string/empty.mjs.map +1 -1
- package/package.json +17 -17
- package/src/actions/package/publint.ts +8 -10
- package/src/bin/package/publint.ts +1 -0
- package/tsconfig.build.json +20 -2
- package/tsup.config.ts +1 -0
package/dist/actions/dupdeps.js
CHANGED
|
@@ -34,8 +34,9 @@ module.exports = __toCommonJS(dupdeps_exports);
|
|
|
34
34
|
var import_chalk = __toESM(require("chalk"));
|
|
35
35
|
var import_lib = require("../lib");
|
|
36
36
|
const dupdeps = () => {
|
|
37
|
+
var _a;
|
|
37
38
|
console.log(import_chalk.default.green("Checking all Dependencies for Duplicates"));
|
|
38
|
-
const allDependencies = (0, import_lib.parsedPackageJSON)()
|
|
39
|
+
const allDependencies = (_a = (0, import_lib.parsedPackageJSON)()) == null ? void 0 : _a.dependencies;
|
|
39
40
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
40
41
|
return (0, import_lib.detectDuplicateDependencies)(dependencies);
|
|
41
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/actions/dupdeps.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { detectDuplicateDependencies, parsedPackageJSON } from '../lib'\n\nexport const dupdeps = () => {\n console.log(chalk.green('Checking all Dependencies for Duplicates'))\n\n const allDependencies = parsedPackageJSON()?.dependencies\n const dependencies = Object.entries(allDependencies).map(([k]) => k)\n\n return detectDuplicateDependencies(dependencies)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,iBAA+D;AAExD,MAAM,UAAU,MAAM;
|
|
1
|
+
{"version":3,"sources":["../../src/actions/dupdeps.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { detectDuplicateDependencies, parsedPackageJSON } from '../lib'\n\nexport const dupdeps = () => {\n console.log(chalk.green('Checking all Dependencies for Duplicates'))\n\n const allDependencies = parsedPackageJSON()?.dependencies\n const dependencies = Object.entries(allDependencies).map(([k]) => k)\n\n return detectDuplicateDependencies(dependencies)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,iBAA+D;AAExD,MAAM,UAAU,MAAM;AAJ7B;AAKE,UAAQ,IAAI,aAAAA,QAAM,MAAM,0CAA0C,CAAC;AAEnE,QAAM,mBAAkB,uCAAkB,MAAlB,mBAAqB;AAC7C,QAAM,eAAe,OAAO,QAAQ,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AAEnE,aAAO,wCAA4B,YAAY;AACjD;","names":["chalk"]}
|
package/dist/actions/dupdeps.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { detectDuplicateDependencies, parsedPackageJSON } from "../lib";
|
|
3
3
|
const dupdeps = () => {
|
|
4
|
+
var _a;
|
|
4
5
|
console.log(chalk.green("Checking all Dependencies for Duplicates"));
|
|
5
|
-
const allDependencies = parsedPackageJSON()
|
|
6
|
+
const allDependencies = (_a = parsedPackageJSON()) == null ? void 0 : _a.dependencies;
|
|
6
7
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
7
8
|
return detectDuplicateDependencies(dependencies);
|
|
8
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/actions/dupdeps.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { detectDuplicateDependencies, parsedPackageJSON } from '../lib'\n\nexport const dupdeps = () => {\n console.log(chalk.green('Checking all Dependencies for Duplicates'))\n\n const allDependencies = parsedPackageJSON()?.dependencies\n const dependencies = Object.entries(allDependencies).map(([k]) => k)\n\n return detectDuplicateDependencies(dependencies)\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAElB,SAAS,6BAA6B,yBAAyB;AAExD,MAAM,UAAU,MAAM;
|
|
1
|
+
{"version":3,"sources":["../../src/actions/dupdeps.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { detectDuplicateDependencies, parsedPackageJSON } from '../lib'\n\nexport const dupdeps = () => {\n console.log(chalk.green('Checking all Dependencies for Duplicates'))\n\n const allDependencies = parsedPackageJSON()?.dependencies\n const dependencies = Object.entries(allDependencies).map(([k]) => k)\n\n return detectDuplicateDependencies(dependencies)\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAElB,SAAS,6BAA6B,yBAAyB;AAExD,MAAM,UAAU,MAAM;AAJ7B;AAKE,UAAQ,IAAI,MAAM,MAAM,0CAA0C,CAAC;AAEnE,QAAM,mBAAkB,uBAAkB,MAAlB,mBAAqB;AAC7C,QAAM,eAAe,OAAO,QAAQ,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AAEnE,SAAO,4BAA4B,YAAY;AACjD;","names":[]}
|
|
@@ -38,14 +38,17 @@ var import_publint = require("../publint");
|
|
|
38
38
|
var import_rollup = require("./rollup");
|
|
39
39
|
var import_tsc = require("./tsc");
|
|
40
40
|
var import_tsup2 = require("./tsup2");
|
|
41
|
-
const packageCompile = async (params = {
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
const packageCompile = async (params = {
|
|
42
|
+
compile: {
|
|
43
|
+
publint: false
|
|
44
|
+
}
|
|
45
|
+
}) => {
|
|
46
|
+
var _a;
|
|
44
47
|
const pkg = process.env.INIT_CWD;
|
|
45
48
|
console.log(import_chalk.default.green(`Compiling ${pkg}`));
|
|
46
49
|
const config = await (0, import_lib.loadConfig)(params);
|
|
47
50
|
const publint = false;
|
|
48
|
-
const modes = config.compile
|
|
51
|
+
const modes = ((_a = config.compile) == null ? void 0 : _a.modes) ?? ["tsup"];
|
|
49
52
|
let modeIndex = 0;
|
|
50
53
|
let result = 0;
|
|
51
54
|
while (modeIndex < modes.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/compile.ts"],"sourcesContent":["import chalk from 'chalk'\n// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\n\nimport { loadConfig } from '../../../lib'\nimport { packagePublint } from '../publint'\nimport { CompileParams } from './CompileParams'\nimport { packageCompileRollup } from './rollup'\nimport { packageCompileTsc } from './tsc'\nimport { packageCompileTsup2 } from './tsup2'\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 = {compile: {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/compile.ts"],"sourcesContent":["import chalk from 'chalk'\n// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\n\nimport { loadConfig } from '../../../lib'\nimport { packagePublint } from '../publint'\nimport { CompileParams } from './CompileParams'\nimport { packageCompileRollup } from './rollup'\nimport { packageCompileTsc } from './tsc'\nimport { packageCompileTsup2 } from './tsup2'\n\nexport type PackageCompileMode = 'tsup' | 'tsc' | 'rollup'\n\nexport type PackageCompileParams = CompileParams & {\n compile?: {\n modes?: PackageCompileMode[]\n }\n}\n\nexport const packageCompile = async (\n params: PackageCompileParams = {\n compile: {\n publint: false,\n },\n },\n): Promise<number> => {\n const pkg = process.env.INIT_CWD\n console.log(chalk.green(`Compiling ${pkg}`))\n const config = await loadConfig(params)\n const publint = false //config.compile?.publint ?? false\n\n const modes = config.compile?.modes ?? ['tsup']\n let modeIndex = 0\n let result: number = 0\n while (modeIndex < modes.length) {\n const mode = modes[modeIndex]\n switch (mode) {\n case 'rollup': {\n result += await packageCompileRollup(\n merge({}, params, {\n compile: {\n publint: false,\n },\n }),\n )\n break\n }\n case 'tsc': {\n result += await packageCompileTsc(\n merge({}, params, {\n compile: {\n publint: false,\n },\n }),\n )\n break\n }\n case 'tsup': {\n result += await packageCompileTsup2(\n merge({}, params, {\n compile: {\n publint: false,\n },\n }),\n )\n break\n }\n }\n mod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BAAe,MAAM,IAAI;AAC5D;","names":["chalk","merge"]}
|
|
@@ -5,14 +5,17 @@ import { packagePublint } from "../publint";
|
|
|
5
5
|
import { packageCompileRollup } from "./rollup";
|
|
6
6
|
import { packageCompileTsc } from "./tsc";
|
|
7
7
|
import { packageCompileTsup2 } from "./tsup2";
|
|
8
|
-
const packageCompile = async (params = {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const packageCompile = async (params = {
|
|
9
|
+
compile: {
|
|
10
|
+
publint: false
|
|
11
|
+
}
|
|
12
|
+
}) => {
|
|
13
|
+
var _a;
|
|
11
14
|
const pkg = process.env.INIT_CWD;
|
|
12
15
|
console.log(chalk.green(`Compiling ${pkg}`));
|
|
13
16
|
const config = await loadConfig(params);
|
|
14
17
|
const publint = false;
|
|
15
|
-
const modes = config.compile
|
|
18
|
+
const modes = ((_a = config.compile) == null ? void 0 : _a.modes) ?? ["tsup"];
|
|
16
19
|
let modeIndex = 0;
|
|
17
20
|
let result = 0;
|
|
18
21
|
while (modeIndex < modes.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/compile.ts"],"sourcesContent":["import chalk from 'chalk'\n// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\n\nimport { loadConfig } from '../../../lib'\nimport { packagePublint } from '../publint'\nimport { CompileParams } from './CompileParams'\nimport { packageCompileRollup } from './rollup'\nimport { packageCompileTsc } from './tsc'\nimport { packageCompileTsup2 } from './tsup2'\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 = {compile: {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/compile.ts"],"sourcesContent":["import chalk from 'chalk'\n// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\n\nimport { loadConfig } from '../../../lib'\nimport { packagePublint } from '../publint'\nimport { CompileParams } from './CompileParams'\nimport { packageCompileRollup } from './rollup'\nimport { packageCompileTsc } from './tsc'\nimport { packageCompileTsup2 } from './tsup2'\n\nexport type PackageCompileMode = 'tsup' | 'tsc' | 'rollup'\n\nexport type PackageCompileParams = CompileParams & {\n compile?: {\n modes?: PackageCompileMode[]\n }\n}\n\nexport const packageCompile = async (\n params: PackageCompileParams = {\n compile: {\n publint: false,\n },\n },\n): Promise<number> => {\n const pkg = process.env.INIT_CWD\n console.log(chalk.green(`Compiling ${pkg}`))\n const config = await loadConfig(params)\n const publint = false //config.compile?.publint ?? false\n\n const modes = config.compile?.modes ?? ['tsup']\n let modeIndex = 0\n let result: number = 0\n while (modeIndex < modes.length) {\n const mode = modes[modeIndex]\n switch (mode) {\n case 'rollup': {\n result += await packageCompileRollup(\n merge({}, params, {\n compile: {\n publint: false,\n },\n }),\n )\n break\n }\n case 'tsc': {\n result += await packageCompileTsc(\n merge({}, params, {\n compile: {\n publint: false,\n },\n }),\n )\n break\n }\n case 'tsup': {\n result += await packageCompileTsup2(\n merge({}, params, {\n compile: {\n publint: false,\n },\n }),\n )\n break\n }\n }\n modeIndex++\n }\n return result + (publint ? await packagePublint(params) : 0)\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAElB,OAAO,WAAW;AAElB,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAE/B,SAAS,4BAA4B;AACrC,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AAU7B,MAAM,iBAAiB,OAC5B,SAA+B;AAAA,EAC7B,SAAS;AAAA,IACP,SAAS;AAAA,EACX;AACF,MACoB;AAzBtB;AA0BE,QAAM,MAAM,QAAQ,IAAI;AACxB,UAAQ,IAAI,MAAM,MAAM,aAAa,GAAG,EAAE,CAAC;AAC3C,QAAM,SAAS,MAAM,WAAW,MAAM;AACtC,QAAM,UAAU;AAEhB,QAAM,UAAQ,YAAO,YAAP,mBAAgB,UAAS,CAAC,MAAM;AAC9C,MAAI,YAAY;AAChB,MAAI,SAAiB;AACrB,SAAO,YAAY,MAAM,QAAQ;AAC/B,UAAM,OAAO,MAAM,SAAS;AAC5B,YAAQ,MAAM;AAAA,MACZ,KAAK,UAAU;AACb,kBAAU,MAAM;AAAA,UACd,MAAM,CAAC,GAAG,QAAQ;AAAA,YAChB,SAAS;AAAA,cACP,SAAS;AAAA,YACX;AAAA,UACF,CAAC;AAAA,QACH;AACA;AAAA,MACF;AAAA,MACA,KAAK,OAAO;AACV,kBAAU,MAAM;AAAA,UACd,MAAM,CAAC,GAAG,QAAQ;AAAA,YAChB,SAAS;AAAA,cACP,SAAS;AAAA,YACX;AAAA,UACF,CAAC;AAAA,QACH;AACA;AAAA,MACF;AAAA,MACA,KAAK,QAAQ;AACX,kBAAU,MAAM;AAAA,UACd,MAAM,CAAC,GAAG,QAAQ;AAAA,YAChB,SAAS;AAAA,cACP,SAAS;AAAA,YACX;AAAA,UACF,CAAC;AAAA,QACH;AACA;AAAA,MACF;AAAA,IACF;AACA;AAAA,EACF;AACA,SAAO,UAAU,UAAU,MAAM,eAAe,MAAM,IAAI;AAC5D;","names":[]}
|
|
@@ -35,14 +35,15 @@ module.exports = __toCommonJS(getCompilerOptions_exports);
|
|
|
35
35
|
var import_merge = __toESM(require("lodash/merge"));
|
|
36
36
|
var import_typescript = require("typescript");
|
|
37
37
|
const getCompilerOptionsJSONFollowExtends = (filename) => {
|
|
38
|
+
var _a;
|
|
38
39
|
let opts = {};
|
|
39
40
|
const config = (0, import_typescript.readConfigFile)(filename, import_typescript.sys.readFile).config;
|
|
40
41
|
if (config.extends) {
|
|
41
42
|
const requirePath = require.resolve(config.extends);
|
|
42
43
|
opts = getCompilerOptionsJSONFollowExtends(requirePath);
|
|
43
44
|
}
|
|
44
|
-
if (config
|
|
45
|
-
throw Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify(config
|
|
45
|
+
if (config == null ? void 0 : config.error) {
|
|
46
|
+
throw Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify((_a = config == null ? void 0 : config.error) == null ? void 0 : _a.messageText, null, 2)}`);
|
|
46
47
|
}
|
|
47
48
|
return { ...opts, ...config.compilerOptions };
|
|
48
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/getCompilerOptions.ts"],"sourcesContent":["// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\nimport { CompilerOptions, findConfigFile, readConfigFile, sys } from 'typescript'\n\nexport const getCompilerOptionsJSONFollowExtends = (filename: string): CompilerOptions => {\n let opts = {}\n const config = readConfigFile(filename, sys.readFile).config\n if (config.extends) {\n const requirePath = require.resolve(config.extends)\n opts = getCompilerOptionsJSONFollowExtends(requirePath)\n }\n if (config?.error) {\n throw Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify(config?.error?.messageText, null, 2)}`)\n }\n\n return { ...opts, ...config.compilerOptions }\n}\n\nexport const getCompilerOptions = (options?: CompilerOptions, tsconfig: string = 'tsconfig.json'): CompilerOptions => {\n const configFileName = findConfigFile('./', sys.fileExists, tsconfig)\n const configFileCompilerOptions = configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : undefined\n\n return merge({}, configFileCompilerOptions, options)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,wBAAqE;AAE9D,MAAM,sCAAsC,CAAC,aAAsC;
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/getCompilerOptions.ts"],"sourcesContent":["// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\nimport { CompilerOptions, findConfigFile, readConfigFile, sys } from 'typescript'\n\nexport const getCompilerOptionsJSONFollowExtends = (filename: string): CompilerOptions => {\n let opts = {}\n const config = readConfigFile(filename, sys.readFile).config\n if (config.extends) {\n const requirePath = require.resolve(config.extends)\n opts = getCompilerOptionsJSONFollowExtends(requirePath)\n }\n if (config?.error) {\n throw Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify(config?.error?.messageText, null, 2)}`)\n }\n\n return { ...opts, ...config.compilerOptions }\n}\n\nexport const getCompilerOptions = (options?: CompilerOptions, tsconfig: string = 'tsconfig.json'): CompilerOptions => {\n const configFileName = findConfigFile('./', sys.fileExists, tsconfig)\n const configFileCompilerOptions = configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : undefined\n\n return merge({}, configFileCompilerOptions, options)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,wBAAqE;AAE9D,MAAM,sCAAsC,CAAC,aAAsC;AAJ1F;AAKE,MAAI,OAAO,CAAC;AACZ,QAAM,aAAS,kCAAe,UAAU,sBAAI,QAAQ,EAAE;AACtD,MAAI,OAAO,SAAS;AAClB,UAAM,cAAc,QAAQ,QAAQ,OAAO,OAAO;AAClD,WAAO,oCAAoC,WAAW;AAAA,EACxD;AACA,MAAI,iCAAQ,OAAO;AACjB,UAAM,MAAM,8CAA8C,KAAK,WAAU,sCAAQ,UAAR,mBAAe,aAAa,MAAM,CAAC,CAAC,EAAE;AAAA,EACjH;AAEA,SAAO,EAAE,GAAG,MAAM,GAAG,OAAO,gBAAgB;AAC9C;AAEO,MAAM,qBAAqB,CAAC,SAA2B,WAAmB,oBAAqC;AACpH,QAAM,qBAAiB,kCAAe,MAAM,sBAAI,YAAY,QAAQ;AACpE,QAAM,4BAA4B,iBAAiB,oCAAoC,cAAc,IAAI;AAEzG,aAAO,aAAAA,SAAM,CAAC,GAAG,2BAA2B,OAAO;AACrD;","names":["merge"]}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import merge from "lodash/merge";
|
|
2
2
|
import { findConfigFile, readConfigFile, sys } from "typescript";
|
|
3
3
|
const getCompilerOptionsJSONFollowExtends = (filename) => {
|
|
4
|
+
var _a;
|
|
4
5
|
let opts = {};
|
|
5
6
|
const config = readConfigFile(filename, sys.readFile).config;
|
|
6
7
|
if (config.extends) {
|
|
7
8
|
const requirePath = require.resolve(config.extends);
|
|
8
9
|
opts = getCompilerOptionsJSONFollowExtends(requirePath);
|
|
9
10
|
}
|
|
10
|
-
if (config
|
|
11
|
-
throw Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify(config
|
|
11
|
+
if (config == null ? void 0 : config.error) {
|
|
12
|
+
throw Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify((_a = config == null ? void 0 : config.error) == null ? void 0 : _a.messageText, null, 2)}`);
|
|
12
13
|
}
|
|
13
14
|
return { ...opts, ...config.compilerOptions };
|
|
14
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/getCompilerOptions.ts"],"sourcesContent":["// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\nimport { CompilerOptions, findConfigFile, readConfigFile, sys } from 'typescript'\n\nexport const getCompilerOptionsJSONFollowExtends = (filename: string): CompilerOptions => {\n let opts = {}\n const config = readConfigFile(filename, sys.readFile).config\n if (config.extends) {\n const requirePath = require.resolve(config.extends)\n opts = getCompilerOptionsJSONFollowExtends(requirePath)\n }\n if (config?.error) {\n throw Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify(config?.error?.messageText, null, 2)}`)\n }\n\n return { ...opts, ...config.compilerOptions }\n}\n\nexport const getCompilerOptions = (options?: CompilerOptions, tsconfig: string = 'tsconfig.json'): CompilerOptions => {\n const configFileName = findConfigFile('./', sys.fileExists, tsconfig)\n const configFileCompilerOptions = configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : undefined\n\n return merge({}, configFileCompilerOptions, options)\n}\n"],"mappings":"AACA,OAAO,WAAW;AAClB,SAA0B,gBAAgB,gBAAgB,WAAW;AAE9D,MAAM,sCAAsC,CAAC,aAAsC;
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/getCompilerOptions.ts"],"sourcesContent":["// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\nimport { CompilerOptions, findConfigFile, readConfigFile, sys } from 'typescript'\n\nexport const getCompilerOptionsJSONFollowExtends = (filename: string): CompilerOptions => {\n let opts = {}\n const config = readConfigFile(filename, sys.readFile).config\n if (config.extends) {\n const requirePath = require.resolve(config.extends)\n opts = getCompilerOptionsJSONFollowExtends(requirePath)\n }\n if (config?.error) {\n throw Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify(config?.error?.messageText, null, 2)}`)\n }\n\n return { ...opts, ...config.compilerOptions }\n}\n\nexport const getCompilerOptions = (options?: CompilerOptions, tsconfig: string = 'tsconfig.json'): CompilerOptions => {\n const configFileName = findConfigFile('./', sys.fileExists, tsconfig)\n const configFileCompilerOptions = configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : undefined\n\n return merge({}, configFileCompilerOptions, options)\n}\n"],"mappings":"AACA,OAAO,WAAW;AAClB,SAA0B,gBAAgB,gBAAgB,WAAW;AAE9D,MAAM,sCAAsC,CAAC,aAAsC;AAJ1F;AAKE,MAAI,OAAO,CAAC;AACZ,QAAM,SAAS,eAAe,UAAU,IAAI,QAAQ,EAAE;AACtD,MAAI,OAAO,SAAS;AAClB,UAAM,cAAc,QAAQ,QAAQ,OAAO,OAAO;AAClD,WAAO,oCAAoC,WAAW;AAAA,EACxD;AACA,MAAI,iCAAQ,OAAO;AACjB,UAAM,MAAM,8CAA8C,KAAK,WAAU,sCAAQ,UAAR,mBAAe,aAAa,MAAM,CAAC,CAAC,EAAE;AAAA,EACjH;AAEA,SAAO,EAAE,GAAG,MAAM,GAAG,OAAO,gBAAgB;AAC9C;AAEO,MAAM,qBAAqB,CAAC,SAA2B,WAAmB,oBAAqC;AACpH,QAAM,iBAAiB,eAAe,MAAM,IAAI,YAAY,QAAQ;AACpE,QAAM,4BAA4B,iBAAiB,oCAAoC,cAAc,IAAI;AAEzG,SAAO,MAAM,CAAC,GAAG,2BAA2B,OAAO;AACrD;","names":[]}
|
|
@@ -38,7 +38,8 @@ const getInputDirs = async (depth = 0) => {
|
|
|
38
38
|
return [
|
|
39
39
|
".",
|
|
40
40
|
...(await (0, import_promises.readdir)("src", { recursive: true, withFileTypes: true })).filter((file) => file.isDirectory()).map((file) => {
|
|
41
|
-
|
|
41
|
+
var _a;
|
|
42
|
+
const pathParts = ((_a = file.path) == null ? void 0 : _a.split("/")) ?? [];
|
|
42
43
|
pathParts.shift();
|
|
43
44
|
if (pathParts.length) {
|
|
44
45
|
const root = pathParts.join("/");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/inputs.ts"],"sourcesContent":["import { readdir } from 'fs/promises'\nimport { glob } from 'glob'\n\nexport const getInputs = async (subDir?: string) => {\n return (await readdir(subDir ? `src/${subDir}` : 'src', { recursive: false }))\n .filter(\n (file) => (file.endsWith('.ts') || file.endsWith('.tsx')) && !file.endsWith('d.ts') && !file.includes('.spec.') && !file.includes('.stories.'),\n )\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: true, 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 = 100) => {\n const dirs = await getInputDirs(depth)\n return (await Promise.all(dirs.map(async (dir) => await getInputs(dir)))).flat()\n}\n\nexport const getAllInputs2 = () => {\n return glob.sync('src/**/*.*', { ignore: ['**/*.spec.*', '**/*.stories.*', '**/spec/**/*'] })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAwB;AACxB,kBAAqB;AAEd,MAAM,YAAY,OAAO,WAAoB;AAClD,UAAQ,UAAM,yBAAQ,SAAS,OAAO,MAAM,KAAK,OAAO,EAAE,WAAW,MAAM,CAAC,GACzE;AAAA,IACC,CAAC,UAAU,KAAK,SAAS,KAAK,KAAK,KAAK,SAAS,MAAM,MAAM,CAAC,KAAK,SAAS,MAAM,KAAK,CAAC,KAAK,SAAS,QAAQ,KAAK,CAAC,KAAK,SAAS,WAAW;AAAA,EAC/I,EACC,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,MAAM,eAAe,KAAK,CAAC,GAC9D,OAAO,CAAC,SAAS,KAAK,YAAY,CAAC,EACnC,IAAI,CAAC,SAAS;
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/inputs.ts"],"sourcesContent":["import { readdir } from 'fs/promises'\nimport { glob } from 'glob'\n\nexport const getInputs = async (subDir?: string) => {\n return (await readdir(subDir ? `src/${subDir}` : 'src', { recursive: false }))\n .filter(\n (file) => (file.endsWith('.ts') || file.endsWith('.tsx')) && !file.endsWith('d.ts') && !file.includes('.spec.') && !file.includes('.stories.'),\n )\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: true, 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 = 100) => {\n const dirs = await getInputDirs(depth)\n return (await Promise.all(dirs.map(async (dir) => await getInputs(dir)))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UAAU,GAAG,CAAC,CAAC,GAAG,KAAK;AACjF;AAEO,MAAM,gBAAgB,MAAM;AACjC,SAAO,iBAAK,KAAK,cAAc,EAAE,QAAQ,CAAC,eAAe,kBAAkB,cAAc,EAAE,CAAC;AAC9F;","names":[]}
|
|
@@ -12,7 +12,8 @@ const getInputDirs = async (depth = 0) => {
|
|
|
12
12
|
return [
|
|
13
13
|
".",
|
|
14
14
|
...(await readdir("src", { recursive: true, withFileTypes: true })).filter((file) => file.isDirectory()).map((file) => {
|
|
15
|
-
|
|
15
|
+
var _a;
|
|
16
|
+
const pathParts = ((_a = file.path) == null ? void 0 : _a.split("/")) ?? [];
|
|
16
17
|
pathParts.shift();
|
|
17
18
|
if (pathParts.length) {
|
|
18
19
|
const root = pathParts.join("/");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/inputs.ts"],"sourcesContent":["import { readdir } from 'fs/promises'\nimport { glob } from 'glob'\n\nexport const getInputs = async (subDir?: string) => {\n return (await readdir(subDir ? `src/${subDir}` : 'src', { recursive: false }))\n .filter(\n (file) => (file.endsWith('.ts') || file.endsWith('.tsx')) && !file.endsWith('d.ts') && !file.includes('.spec.') && !file.includes('.stories.'),\n )\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: true, 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 = 100) => {\n const dirs = await getInputDirs(depth)\n return (await Promise.all(dirs.map(async (dir) => await getInputs(dir)))).flat()\n}\n\nexport const getAllInputs2 = () => {\n return glob.sync('src/**/*.*', { ignore: ['**/*.spec.*', '**/*.stories.*', '**/spec/**/*'] })\n}\n"],"mappings":"AAAA,SAAS,eAAe;AACxB,SAAS,YAAY;AAEd,MAAM,YAAY,OAAO,WAAoB;AAClD,UAAQ,MAAM,QAAQ,SAAS,OAAO,MAAM,KAAK,OAAO,EAAE,WAAW,MAAM,CAAC,GACzE;AAAA,IACC,CAAC,UAAU,KAAK,SAAS,KAAK,KAAK,KAAK,SAAS,MAAM,MAAM,CAAC,KAAK,SAAS,MAAM,KAAK,CAAC,KAAK,SAAS,QAAQ,KAAK,CAAC,KAAK,SAAS,WAAW;AAAA,EAC/I,EACC,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,MAAM,eAAe,KAAK,CAAC,GAC9D,OAAO,CAAC,SAAS,KAAK,YAAY,CAAC,EACnC,IAAI,CAAC,SAAS;
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/inputs.ts"],"sourcesContent":["import { readdir } from 'fs/promises'\nimport { glob } from 'glob'\n\nexport const getInputs = async (subDir?: string) => {\n return (await readdir(subDir ? `src/${subDir}` : 'src', { recursive: false }))\n .filter(\n (file) => (file.endsWith('.ts') || file.endsWith('.tsx')) && !file.endsWith('d.ts') && !file.includes('.spec.') && !file.includes('.stories.'),\n )\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: true, 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 = 100) => {\n const dirs = await getInputDirs(depth)\n return (await Promise.all(dirs.map(async (dir) => await getInputs(dir)))).flat()\n}\n\nexport const getAllInputs2 = () => {\n return glob.sync('src/**/*.*', { ignore: ['**/*.spec.*', '**/*.stories.*', '**/spec/**/*'] })\n}\n"],"mappings":"AAAA,SAAS,eAAe;AACxB,SAAS,YAAY;AAEd,MAAM,YAAY,OAAO,WAAoB;AAClD,UAAQ,MAAM,QAAQ,SAAS,OAAO,MAAM,KAAK,OAAO,EAAE,WAAW,MAAM,CAAC,GACzE;AAAA,IACC,CAAC,UAAU,KAAK,SAAS,KAAK,KAAK,KAAK,SAAS,MAAM,MAAM,CAAC,KAAK,SAAS,MAAM,KAAK,CAAC,KAAK,SAAS,QAAQ,KAAK,CAAC,KAAK,SAAS,WAAW;AAAA,EAC/I,EACC,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,MAAM,eAAe,KAAK,CAAC,GAC9D,OAAO,CAAC,SAAS,KAAK,YAAY,CAAC,EACnC,IAAI,CAAC,SAAS;AAnBrB;AAoBQ,YAAM,cAAY,UAAK,SAAL,mBAAW,MAAM,SAAQ,CAAC;AAC5C,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,QAAQ,QAAQ;AACjD,QAAM,OAAO,MAAM,aAAa,KAAK;AACrC,UAAQ,MAAM,QAAQ,IAAI,KAAK,IAAI,OAAO,QAAQ,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,KAAK;AACjF;AAEO,MAAM,gBAAgB,MAAM;AACjC,SAAO,KAAK,KAAK,cAAc,EAAE,QAAQ,CAAC,eAAe,kBAAkB,cAAc,EAAE,CAAC;AAC9F;","names":[]}
|
|
@@ -65,6 +65,7 @@ const compileSubDir = async (format, ext, subDir, _verbose = false) => {
|
|
|
65
65
|
input: subDir ? input.map((file) => `./src/${file}`) : ["./src/index.ts"],
|
|
66
66
|
logLevel: "warn",
|
|
67
67
|
onLog: (level, log, defaultHandler) => {
|
|
68
|
+
var _a;
|
|
68
69
|
const pushLog = !(log.code === "EMPTY_BUNDLE" || log.code === "MIXED_EXPORTS" || log.code === "UNUSED_EXTERNAL_IMPORT");
|
|
69
70
|
if (pushLog) {
|
|
70
71
|
switch (level) {
|
|
@@ -90,7 +91,7 @@ const compileSubDir = async (format, ext, subDir, _verbose = false) => {
|
|
|
90
91
|
if (log.id) {
|
|
91
92
|
console.log(import_chalk.default.gray(log.id));
|
|
92
93
|
}
|
|
93
|
-
log.ids
|
|
94
|
+
(_a = log.ids) == null ? void 0 : _a.map((id) => {
|
|
94
95
|
console.log(import_chalk.default.gray(id));
|
|
95
96
|
});
|
|
96
97
|
return defaultHandler(level, log);
|
|
@@ -110,11 +111,12 @@ const compileSubDir = async (format, ext, subDir, _verbose = false) => {
|
|
|
110
111
|
return errors.length + warnings.length;
|
|
111
112
|
};
|
|
112
113
|
const packageCompileRollup = async (params) => {
|
|
114
|
+
var _a, _b;
|
|
113
115
|
const config = await (0, import_lib.loadConfig)(params);
|
|
114
116
|
const pkg = await (0, import_loadPackageConfig.loadPackageConfig)();
|
|
115
|
-
const inputDirs = await (0, import_inputs.getInputDirs)(config.compile
|
|
117
|
+
const inputDirs = await (0, import_inputs.getInputDirs)((_a = config.compile) == null ? void 0 : _a.depth);
|
|
116
118
|
const verbose = config.verbose;
|
|
117
|
-
const publint = config.compile
|
|
119
|
+
const publint = (_b = config.compile) == null ? void 0 : _b.publint;
|
|
118
120
|
const pkgType = pkg.type ?? "commonjs";
|
|
119
121
|
const esmExt = pkgType === "module" ? "js" : "mjs";
|
|
120
122
|
const cjsExt = pkgType === "commonjs" ? "js" : "cjs";
|
|
@@ -1 +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'\n\nimport { loadConfig } from '../../../lib'\nimport { loadPackageConfig } from '../../../loadPackageConfig'\nimport { packagePublint } from '../publint'\nimport { CompileParams } from './CompileParams'\nimport { getInputDirs, getInputs } from './inputs'\n\nexport interface PackageCompileRollupParams extends CompileParams {}\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 = (\n await Promise.all(\n inputDirs.map(async (inputDir) => {\n return (await compileSubDir('cjs', cjsExt, inputDir, verbose)) + (await compileSubDir('esm', esmExt, inputDir, verbose))\n }),\n )\n ).reduce((prev, result) => prev + result, 0)\n return result + (publint ? await packagePublint() : 0)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAqB;AACrB,yBAAiB;AACjB,+BAAuB;AACvB,mBAAkB;AAClB,oBAAgE;AAChE,4DAAyB;AACzB,0CAA0B;AAE1B,iBAA2B;AAC3B,+BAAkC;AAClC,qBAA+B;AAE/B,oBAAwC;AAIjC,MAAM,gBAAgB,OAAO,QAAuB,KAAa,QAAiB,WAAW,UAAU;AAC5G,QAAM,MAAM,WAAW,MAAM,SAAY;AACzC,QAAM,QAAQ,UAAM,yBAAU,GAAG;AACjC,QAAM,eAAW,yBAAAA,SAAW;AAAA,IAC1B,SAAS;AAAA,IACT,aAAa,CAAC,OAAO,CAAC;AAAA,IACtB,gBAAgB,CAAC,OAAO,CAAC;AAAA,IACzB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,SAAS,CAAC,eAAe,QAAQ,QAAQ,gBAAgB,UAAU;AAAA,IACnE,QAAQ,MAAM,QAAQ,GAAG,KAAK;AAAA,IAC9B,SAAS;AAAA,IACT,UAAU;AAAA,EACZ,CAAC;AAED,QAAM,SAAsB,CAAC;AAC7B,QAAM,WAAwB,CAAC;AAC/B,QAAM,QAAqB,CAAC;AAC5B,QAAM,SAAsB,CAAC;AAE7B,QAAM,UAAyB;AAAA,IAC7B,OAAO,SAAS,MAAM,IAAI,CAAC,SAAS,SAAS,IAAI,EAAE,IAAI,CAAC,gBAAgB;AAAA,IACxE,UAAU;AAAA,IACV,OAAO,CAAC,OAAO,KAAK,mBAAmB;
|
|
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'\n\nimport { loadConfig } from '../../../lib'\nimport { loadPackageConfig } from '../../../loadPackageConfig'\nimport { packagePublint } from '../publint'\nimport { CompileParams } from './CompileParams'\nimport { getInputDirs, getInputs } from './inputs'\n\nexport interface PackageCompileRollupParams extends CompileParams {}\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 = (\n await Promise.all(\n inputDirs.map(async (inputDir) => {\n return (await compileSubDir('cjs', cjsExt, inputDir, verbose)) + (await compileSubDir('esm', esmExt, inputDir, verbose))\n }),\n )\n ).reduce((prev, result) => prev + result, 0)\n return result + (publint ? await packagePublint() : 0)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAqB;AACrB,yBAAiB;AACjB,+BAAuB;AACvB,mBAAkB;AAClB,oBAAgE;AAChE,4DAAyB;AACzB,0CAA0B;AAE1B,iBAA2B;AAC3B,+BAAkC;AAClC,qBAA+B;AAE/B,oBAAwC;AAIjC,MAAM,gBAAgB,OAAO,QAAuB,KAAa,QAAiB,WAAW,UAAU;AAC5G,QAAM,MAAM,WAAW,MAAM,SAAY;AACzC,QAAM,QAAQ,UAAM,yBAAU,GAAG;AACjC,QAAM,eAAW,yBAAAA,SAAW;AAAA,IAC1B,SAAS;AAAA,IACT,aAAa,CAAC,OAAO,CAAC;AAAA,IACtB,gBAAgB,CAAC,OAAO,CAAC;AAAA,IACzB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,SAAS,CAAC,eAAe,QAAQ,QAAQ,gBAAgB,UAAU;AAAA,IACnE,QAAQ,MAAM,QAAQ,GAAG,KAAK;AAAA,IAC9B,SAAS;AAAA,IACT,UAAU;AAAA,EACZ,CAAC;AAED,QAAM,SAAsB,CAAC;AAC7B,QAAM,WAAwB,CAAC;AAC/B,QAAM,QAAqB,CAAC;AAC5B,QAAM,SAAsB,CAAC;AAE7B,QAAM,UAAyB;AAAA,IAC7B,OAAO,SAAS,MAAM,IAAI,CAAC,SAAS,SAAS,IAAI,EAAE,IAAI,CAAC,gBAAgB;AAAA,IACxE,UAAU;AAAA,IACV,OAAO,CAAC,OAAO,KAAK,mBAAmB;AAvC3C;AAwCM,YAAM,UAAU,EAAE,IAAI,SAAS,kBAAkB,IAAI,SAAS,mBAAmB,IAAI,SAA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AO,YAAP,mBAAgB,KAAK;AAC1D,QAAM,UAAU,OAAO;AACvB,QAAM,WAAU,YAAO,YAAP,mBAAgB;AAEhC,QAAM,UAAU,IAAI,QAAQ;AAE5B,QAAM,SAAS,YAAY,WAAW,OAAO;AAC7C,QAAM,SAAS,YAAY,aAAa,OAAO;AAE/C,QAAM,UACJ,MAAM,QAAQ;AAAA,IACZ,UAAU,IAAI,OAAO,aAAa;AAChC,aAAQ,MAAM,cAAc,OAAO,QAAQ,UAAU,OAAO,IAAM,MAAM,cAAc,OAAO,QAAQ,UAAU,OAAO;AAAA,IACxH,CAAC;AAAA,EACH,GACA,OAAO,CAAC,MAAMC,YAAW,OAAOA,SAAQ,CAAC;AAC3C,SAAO,UAAU,UAAU,UAAM,+BAAe,IAAI;AACtD;","names":["typescript","chalk","commonjs","externalDeps","nodeExternals","json","result"]}
|
|
@@ -31,6 +31,7 @@ const compileSubDir = async (format, ext, subDir, _verbose = false) => {
|
|
|
31
31
|
input: subDir ? input.map((file) => `./src/${file}`) : ["./src/index.ts"],
|
|
32
32
|
logLevel: "warn",
|
|
33
33
|
onLog: (level, log, defaultHandler) => {
|
|
34
|
+
var _a;
|
|
34
35
|
const pushLog = !(log.code === "EMPTY_BUNDLE" || log.code === "MIXED_EXPORTS" || log.code === "UNUSED_EXTERNAL_IMPORT");
|
|
35
36
|
if (pushLog) {
|
|
36
37
|
switch (level) {
|
|
@@ -56,7 +57,7 @@ const compileSubDir = async (format, ext, subDir, _verbose = false) => {
|
|
|
56
57
|
if (log.id) {
|
|
57
58
|
console.log(chalk.gray(log.id));
|
|
58
59
|
}
|
|
59
|
-
log.ids
|
|
60
|
+
(_a = log.ids) == null ? void 0 : _a.map((id) => {
|
|
60
61
|
console.log(chalk.gray(id));
|
|
61
62
|
});
|
|
62
63
|
return defaultHandler(level, log);
|
|
@@ -76,11 +77,12 @@ const compileSubDir = async (format, ext, subDir, _verbose = false) => {
|
|
|
76
77
|
return errors.length + warnings.length;
|
|
77
78
|
};
|
|
78
79
|
const packageCompileRollup = async (params) => {
|
|
80
|
+
var _a, _b;
|
|
79
81
|
const config = await loadConfig(params);
|
|
80
82
|
const pkg = await loadPackageConfig();
|
|
81
|
-
const inputDirs = await getInputDirs(config.compile
|
|
83
|
+
const inputDirs = await getInputDirs((_a = config.compile) == null ? void 0 : _a.depth);
|
|
82
84
|
const verbose = config.verbose;
|
|
83
|
-
const publint = config.compile
|
|
85
|
+
const publint = (_b = config.compile) == null ? void 0 : _b.publint;
|
|
84
86
|
const pkgType = pkg.type ?? "commonjs";
|
|
85
87
|
const esmExt = pkgType === "module" ? "js" : "mjs";
|
|
86
88
|
const cjsExt = pkgType === "commonjs" ? "js" : "cjs";
|
|
@@ -1 +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'\n\nimport { loadConfig } from '../../../lib'\nimport { loadPackageConfig } from '../../../loadPackageConfig'\nimport { packagePublint } from '../publint'\nimport { CompileParams } from './CompileParams'\nimport { getInputDirs, getInputs } from './inputs'\n\nexport interface PackageCompileRollupParams extends CompileParams {}\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 = (\n await Promise.all(\n inputDirs.map(async (inputDir) => {\n return (await compileSubDir('cjs', cjsExt, inputDir, verbose)) + (await compileSubDir('esm', esmExt, inputDir, verbose))\n }),\n )\n ).reduce((prev, result) => prev + result, 0)\n return result + (publint ? await packagePublint() : 0)\n}\n"],"mappings":"AAAA,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,OAAO,WAAW;AAClB,SAAwB,cAAwC;AAChE,OAAO,kBAAkB;AACzB,OAAO,mBAAmB;AAE1B,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAE/B,SAAS,cAAc,iBAAiB;AAIjC,MAAM,gBAAgB,OAAO,QAAuB,KAAa,QAAiB,WAAW,UAAU;AAC5G,QAAM,MAAM,WAAW,MAAM,SAAY;AACzC,QAAM,QAAQ,MAAM,UAAU,GAAG;AACjC,QAAM,WAAW,WAAW;AAAA,IAC1B,SAAS;AAAA,IACT,aAAa,CAAC,OAAO,CAAC;AAAA,IACtB,gBAAgB,CAAC,OAAO,CAAC;AAAA,IACzB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,SAAS,CAAC,eAAe,QAAQ,QAAQ,gBAAgB,UAAU;AAAA,IACnE,QAAQ,MAAM,QAAQ,GAAG,KAAK;AAAA,IAC9B,SAAS;AAAA,IACT,UAAU;AAAA,EACZ,CAAC;AAED,QAAM,SAAsB,CAAC;AAC7B,QAAM,WAAwB,CAAC;AAC/B,QAAM,QAAqB,CAAC;AAC5B,QAAM,SAAsB,CAAC;AAE7B,QAAM,UAAyB;AAAA,IAC7B,OAAO,SAAS,MAAM,IAAI,CAAC,SAAS,SAAS,IAAI,EAAE,IAAI,CAAC,gBAAgB;AAAA,IACxE,UAAU;AAAA,IACV,OAAO,CAAC,OAAO,KAAK,mBAAmB;
|
|
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'\n\nimport { loadConfig } from '../../../lib'\nimport { loadPackageConfig } from '../../../loadPackageConfig'\nimport { packagePublint } from '../publint'\nimport { CompileParams } from './CompileParams'\nimport { getInputDirs, getInputs } from './inputs'\n\nexport interface PackageCompileRollupParams extends CompileParams {}\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 = (\n await Promise.all(\n inputDirs.map(async (inputDir) => {\n return (await compileSubDir('cjs', cjsExt, inputDir, verbose)) + (await compileSubDir('esm', esmExt, inputDir, verbose))\n }),\n )\n ).reduce((prev, result) => prev + result, 0)\n return result + (publint ? await packagePublint() : 0)\n}\n"],"mappings":"AAAA,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,OAAO,WAAW;AAClB,SAAwB,cAAwC;AAChE,OAAO,kBAAkB;AACzB,OAAO,mBAAmB;AAE1B,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAE/B,SAAS,cAAc,iBAAiB;AAIjC,MAAM,gBAAgB,OAAO,QAAuB,KAAa,QAAiB,WAAW,UAAU;AAC5G,QAAM,MAAM,WAAW,MAAM,SAAY;AACzC,QAAM,QAAQ,MAAM,UAAU,GAAG;AACjC,QAAM,WAAW,WAAW;AAAA,IAC1B,SAAS;AAAA,IACT,aAAa,CAAC,OAAO,CAAC;AAAA,IACtB,gBAAgB,CAAC,OAAO,CAAC;AAAA,IACzB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,SAAS,CAAC,eAAe,QAAQ,QAAQ,gBAAgB,UAAU;AAAA,IACnE,QAAQ,MAAM,QAAQ,GAAG,KAAK;AAAA,IAC9B,SAAS;AAAA,IACT,UAAU;AAAA,EACZ,CAAC;AAED,QAAM,SAAsB,CAAC;AAC7B,QAAM,WAAwB,CAAC;AAC/B,QAAM,QAAqB,CAAC;AAC5B,QAAM,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AG,MAAM,aAAa;AAAA,EACnD;AAEA,SAAO,OAAO,SAAS,SAAS;AAClC;AAEO,MAAM,uBAAuB,OAAO,WAAwC;AAxFnF;AAyFE,QAAM,SAAS,MAAM,WAAW,MAAM;AACtC,QAAM,MAAM,MAAM,kBAAkB;AACpC,QAAM,YAAY,MAAM,cAAa,YAAO,YAAP,mBAAgB,KAAK;AAC1D,QAAM,UAAU,OAAO;AACvB,QAAM,WAAU,YAAO,YAAP,mBAAgB;AAEhC,QAAM,UAAU,IAAI,QAAQ;AAE5B,QAAM,SAAS,YAAY,WAAW,OAAO;AAC7C,QAAM,SAAS,YAAY,aAAa,OAAO;AAE/C,QAAM,UACJ,MAAM,QAAQ;AAAA,IACZ,UAAU,IAAI,OAAO,aAAa;AAChC,aAAQ,MAAM,cAAc,OAAO,QAAQ,UAAU,OAAO,IAAM,MAAM,cAAc,OAAO,QAAQ,UAAU,OAAO;AAAA,IACxH,CAAC;AAAA,EACH,GACA,OAAO,CAAC,MAAMA,YAAW,OAAOA,SAAQ,CAAC;AAC3C,SAAO,UAAU,UAAU,MAAM,eAAe,IAAI;AACtD;","names":["result"]}
|
|
@@ -66,6 +66,7 @@ const compile = (fileNames, options) => {
|
|
|
66
66
|
return errorDiagnostics.length;
|
|
67
67
|
};
|
|
68
68
|
const packageCompileTsc = async (params) => {
|
|
69
|
+
var _a, _b, _c;
|
|
69
70
|
const defaultCompilerOptions = {
|
|
70
71
|
declaration: true,
|
|
71
72
|
declarationMap: true,
|
|
@@ -73,12 +74,12 @@ const packageCompileTsc = async (params) => {
|
|
|
73
74
|
rootDir: "src",
|
|
74
75
|
sourceMap: true
|
|
75
76
|
};
|
|
76
|
-
const compilerOptions = (0, import_merge.default)({}, defaultCompilerOptions, params
|
|
77
|
+
const compilerOptions = (0, import_merge.default)({}, defaultCompilerOptions, (_b = (_a = params == null ? void 0 : params.compile) == null ? void 0 : _a.tsc) == null ? void 0 : _b.compilerOptions);
|
|
77
78
|
const config = await (0, import_lib.loadConfig)(params);
|
|
78
79
|
if (config.verbose) {
|
|
79
80
|
console.log("Compiling with TSC");
|
|
80
81
|
}
|
|
81
|
-
const fileNames = (await (0, import_inputs.getAllInputs)(config.compile
|
|
82
|
+
const fileNames = (await (0, import_inputs.getAllInputs)((_c = config.compile) == null ? void 0 : _c.depth)).map((fileName) => `src/${fileName}`);
|
|
82
83
|
const configFile = getConfigFile(compilerOptions);
|
|
83
84
|
return compile(fileNames, configFile.compilerOptions);
|
|
84
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/tsc.ts"],"sourcesContent":["import chalk from 'chalk'\n// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\nimport {\n CompilerOptions,\n createProgram,\n Diagnostic,\n findConfigFile,\n flattenDiagnosticMessageText,\n getLineAndCharacterOfPosition,\n getPreEmitDiagnostics,\n readConfigFile,\n sys,\n} from 'typescript'\n\nimport { loadConfig } from '../../../lib'\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\nimport { getAllInputs } from './inputs'\n\nexport type PackageCompileTscParams = Partial<\n CompileParams & {\n compile?: {\n tsc?: {\n compilerOptions?: CompilerOptions\n tsconfig?: string\n }\n }\n }\n>\n\nconst getConfigFile = (options?: CompilerOptions, tsconfig: string = 'tsconfig.json') => {\n const configFileName = findConfigFile('./', sys.fileExists, tsconfig)\n return { ...(configFileName ? readConfigFile(configFileName, sys.readFile).config : {}), compilerOptions: getCompilerOptions(options) }\n}\n\nconst compile = (fileNames: string[], options: CompilerOptions) => {\n console.log(chalk.blue('compile'))\n console.log(chalk.magenta(`options: ${JSON.stringify(options, null, 2)}`))\n const program = createProgram(fileNames, options)\n console.log(chalk.blue('createProgram'))\n const emitResult = program.emit()\n console.log(chalk.blue('emit'))\n\n const allDiagnostics: Diagnostic[] = getPreEmitDiagnostics(program).concat(emitResult.diagnostics)\n\n const errorDiagnostics = allDiagnostics.filter((diagnostic) => diagnostic.category === 1)\n\n allDiagnostics.forEach((diagnostic) => {\n if (diagnostic.file) {\n const { line, character } = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start!)\n const message = flattenDiagnosticMessageText(diagnostic.messageText, '\\n')\n console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`)\n } else {\n console.log(flattenDiagnosticMessageText(diagnostic.messageText, '\\n'))\n }\n })\n\n if (errorDiagnostics.length) {\n console.log(chalk.red(`Errors: ${errorDiagnostics.length}`))\n process.exit(errorDiagnostics.length)\n }\n\n return errorDiagnostics.length\n}\n\nexport const packageCompileTsc = async (params?: PackageCompileTscParams): Promise<number> => {\n const defaultCompilerOptions: CompilerOptions = {\n declaration: true,\n declarationMap: true,\n outDir: 'dist',\n rootDir: 'src',\n sourceMap: true,\n }\n const compilerOptions = merge({}, defaultCompilerOptions, params?.compile?.tsc?.compilerOptions)\n const config = await loadConfig(params)\n if (config.verbose) {\n console.log('Compiling with TSC')\n }\n\n const fileNames = (await getAllInputs(config.compile?.depth)).map((fileName) => `src/${fileName}`)\n const configFile = getConfigFile(compilerOptions)\n return compile(fileNames, configFile.compilerOptions)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,mBAAkB;AAClB,wBAUO;AAEP,iBAA2B;AAE3B,gCAAmC;AACnC,oBAA6B;AAa7B,MAAM,gBAAgB,CAAC,SAA2B,WAAmB,oBAAoB;AACvF,QAAM,qBAAiB,kCAAe,MAAM,sBAAI,YAAY,QAAQ;AACpE,SAAO,EAAE,GAAI,qBAAiB,kCAAe,gBAAgB,sBAAI,QAAQ,EAAE,SAAS,CAAC,GAAI,qBAAiB,8CAAmB,OAAO,EAAE;AACxI;AAEA,MAAM,UAAU,CAAC,WAAqB,YAA6B;AACjE,UAAQ,IAAI,aAAAA,QAAM,KAAK,SAAS,CAAC;AACjC,UAAQ,IAAI,aAAAA,QAAM,QAAQ,YAAY,KAAK,UAAU,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC;AACzE,QAAM,cAAU,iCAAc,WAAW,OAAO;AAChD,UAAQ,IAAI,aAAAA,QAAM,KAAK,eAAe,CAAC;AACvC,QAAM,aAAa,QAAQ,KAAK;AAChC,UAAQ,IAAI,aAAAA,QAAM,KAAK,MAAM,CAAC;AAE9B,QAAM,qBAA+B,yCAAsB,OAAO,EAAE,OAAO,WAAW,WAAW;AAEjG,QAAM,mBAAmB,eAAe,OAAO,CAAC,eAAe,WAAW,aAAa,CAAC;AAExF,iBAAe,QAAQ,CAAC,eAAe;AACrC,QAAI,WAAW,MAAM;AACnB,YAAM,EAAE,MAAM,UAAU,QAAI,iDAA8B,WAAW,MAAM,WAAW,KAAM;AAC5F,YAAM,cAAU,gDAA6B,WAAW,aAAa,IAAI;AACzE,cAAQ,IAAI,GAAG,WAAW,KAAK,QAAQ,KAAK,OAAO,CAAC,IAAI,YAAY,CAAC,MAAM,OAAO,EAAE;AAAA,IACtF,OAAO;AACL,cAAQ,QAAI,gDAA6B,WAAW,aAAa,IAAI,CAAC;AAAA,IACxE;AAAA,EACF,CAAC;AAED,MAAI,iBAAiB,QAAQ;AAC3B,YAAQ,IAAI,aAAAA,QAAM,IAAI,WAAW,iBAAiB,MAAM,EAAE,CAAC;AAC3D,YAAQ,KAAK,iBAAiB,MAAM;AAAA,EACtC;AAEA,SAAO,iBAAiB;AAC1B;AAEO,MAAM,oBAAoB,OAAO,WAAsD;
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/tsc.ts"],"sourcesContent":["import chalk from 'chalk'\n// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\nimport {\n CompilerOptions,\n createProgram,\n Diagnostic,\n findConfigFile,\n flattenDiagnosticMessageText,\n getLineAndCharacterOfPosition,\n getPreEmitDiagnostics,\n readConfigFile,\n sys,\n} from 'typescript'\n\nimport { loadConfig } from '../../../lib'\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\nimport { getAllInputs } from './inputs'\n\nexport type PackageCompileTscParams = Partial<\n CompileParams & {\n compile?: {\n tsc?: {\n compilerOptions?: CompilerOptions\n tsconfig?: string\n }\n }\n }\n>\n\nconst getConfigFile = (options?: CompilerOptions, tsconfig: string = 'tsconfig.json') => {\n const configFileName = findConfigFile('./', sys.fileExists, tsconfig)\n return { ...(configFileName ? readConfigFile(configFileName, sys.readFile).config : {}), compilerOptions: getCompilerOptions(options) }\n}\n\nconst compile = (fileNames: string[], options: CompilerOptions) => {\n console.log(chalk.blue('compile'))\n console.log(chalk.magenta(`options: ${JSON.stringify(options, null, 2)}`))\n const program = createProgram(fileNames, options)\n console.log(chalk.blue('createProgram'))\n const emitResult = program.emit()\n console.log(chalk.blue('emit'))\n\n const allDiagnostics: Diagnostic[] = getPreEmitDiagnostics(program).concat(emitResult.diagnostics)\n\n const errorDiagnostics = allDiagnostics.filter((diagnostic) => diagnostic.category === 1)\n\n allDiagnostics.forEach((diagnostic) => {\n if (diagnostic.file) {\n const { line, character } = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start!)\n const message = flattenDiagnosticMessageText(diagnostic.messageText, '\\n')\n console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`)\n } else {\n console.log(flattenDiagnosticMessageText(diagnostic.messageText, '\\n'))\n }\n })\n\n if (errorDiagnostics.length) {\n console.log(chalk.red(`Errors: ${errorDiagnostics.length}`))\n process.exit(errorDiagnostics.length)\n }\n\n return errorDiagnostics.length\n}\n\nexport const packageCompileTsc = async (params?: PackageCompileTscParams): Promise<number> => {\n const defaultCompilerOptions: CompilerOptions = {\n declaration: true,\n declarationMap: true,\n outDir: 'dist',\n rootDir: 'src',\n sourceMap: true,\n }\n const compilerOptions = merge({}, defaultCompilerOptions, params?.compile?.tsc?.compilerOptions)\n const config = await loadConfig(params)\n if (config.verbose) {\n console.log('Compiling with TSC')\n }\n\n const fileNames = (await getAllInputs(config.compile?.depth)).map((file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,QAAI,gDAA6B,WAAW,aAAa,IAAI,CAAC;AAAA,IACxE;AAAA,EACF,CAAC;AAED,MAAI,iBAAiB,QAAQ;AAC3B,YAAQ,IAAI,aAAAA,QAAM,IAAI,WAAW,iBAAiB,MAAM,EAAE,CAAC;AAC3D,YAAQ,KAAK,iBAAiB,MAAM;AAAA,EACtC;AAEA,SAAO,iBAAiB;AAC1B;AAEO,MAAM,oBAAoB,OAAO,WAAsD;AAlE9F;AAmEE,QAAM,yBAA0C;AAAA,IAC9C,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AACA,QAAM,sBAAkB,aAAAC,SAAM,CAAC,GAAG,yBAAwB,4CAAQ,YAAR,mBAAiB,QAAjB,mBAAsB,eAAe;AAC/F,QAAM,SAAS,UAAM,uBAAW,MAAM;AACtC,MAAI,OAAO,SAAS;AAClB,YAAQ,IAAI,oBAAoB;AAAA,EAClC;AAEA,QAAM,aAAa,UAAM,6BAAa,YAAO,YAAP,mBAAgB,KAAK,GAAG,IAAI,CAAC,aAAa,OAAO,QAAQ,EAAE;AACjG,QAAM,aAAa,cAAc,eAAe;AAChD,SAAO,QAAQ,WAAW,WAAW,eAAe;AACtD;","names":["chalk","merge"]}
|
|
@@ -41,6 +41,7 @@ const compile = (fileNames, options) => {
|
|
|
41
41
|
return errorDiagnostics.length;
|
|
42
42
|
};
|
|
43
43
|
const packageCompileTsc = async (params) => {
|
|
44
|
+
var _a, _b, _c;
|
|
44
45
|
const defaultCompilerOptions = {
|
|
45
46
|
declaration: true,
|
|
46
47
|
declarationMap: true,
|
|
@@ -48,12 +49,12 @@ const packageCompileTsc = async (params) => {
|
|
|
48
49
|
rootDir: "src",
|
|
49
50
|
sourceMap: true
|
|
50
51
|
};
|
|
51
|
-
const compilerOptions = merge({}, defaultCompilerOptions, params
|
|
52
|
+
const compilerOptions = merge({}, defaultCompilerOptions, (_b = (_a = params == null ? void 0 : params.compile) == null ? void 0 : _a.tsc) == null ? void 0 : _b.compilerOptions);
|
|
52
53
|
const config = await loadConfig(params);
|
|
53
54
|
if (config.verbose) {
|
|
54
55
|
console.log("Compiling with TSC");
|
|
55
56
|
}
|
|
56
|
-
const fileNames = (await getAllInputs(config.compile
|
|
57
|
+
const fileNames = (await getAllInputs((_c = config.compile) == null ? void 0 : _c.depth)).map((fileName) => `src/${fileName}`);
|
|
57
58
|
const configFile = getConfigFile(compilerOptions);
|
|
58
59
|
return compile(fileNames, configFile.compilerOptions);
|
|
59
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/tsc.ts"],"sourcesContent":["import chalk from 'chalk'\n// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\nimport {\n CompilerOptions,\n createProgram,\n Diagnostic,\n findConfigFile,\n flattenDiagnosticMessageText,\n getLineAndCharacterOfPosition,\n getPreEmitDiagnostics,\n readConfigFile,\n sys,\n} from 'typescript'\n\nimport { loadConfig } from '../../../lib'\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\nimport { getAllInputs } from './inputs'\n\nexport type PackageCompileTscParams = Partial<\n CompileParams & {\n compile?: {\n tsc?: {\n compilerOptions?: CompilerOptions\n tsconfig?: string\n }\n }\n }\n>\n\nconst getConfigFile = (options?: CompilerOptions, tsconfig: string = 'tsconfig.json') => {\n const configFileName = findConfigFile('./', sys.fileExists, tsconfig)\n return { ...(configFileName ? readConfigFile(configFileName, sys.readFile).config : {}), compilerOptions: getCompilerOptions(options) }\n}\n\nconst compile = (fileNames: string[], options: CompilerOptions) => {\n console.log(chalk.blue('compile'))\n console.log(chalk.magenta(`options: ${JSON.stringify(options, null, 2)}`))\n const program = createProgram(fileNames, options)\n console.log(chalk.blue('createProgram'))\n const emitResult = program.emit()\n console.log(chalk.blue('emit'))\n\n const allDiagnostics: Diagnostic[] = getPreEmitDiagnostics(program).concat(emitResult.diagnostics)\n\n const errorDiagnostics = allDiagnostics.filter((diagnostic) => diagnostic.category === 1)\n\n allDiagnostics.forEach((diagnostic) => {\n if (diagnostic.file) {\n const { line, character } = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start!)\n const message = flattenDiagnosticMessageText(diagnostic.messageText, '\\n')\n console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`)\n } else {\n console.log(flattenDiagnosticMessageText(diagnostic.messageText, '\\n'))\n }\n })\n\n if (errorDiagnostics.length) {\n console.log(chalk.red(`Errors: ${errorDiagnostics.length}`))\n process.exit(errorDiagnostics.length)\n }\n\n return errorDiagnostics.length\n}\n\nexport const packageCompileTsc = async (params?: PackageCompileTscParams): Promise<number> => {\n const defaultCompilerOptions: CompilerOptions = {\n declaration: true,\n declarationMap: true,\n outDir: 'dist',\n rootDir: 'src',\n sourceMap: true,\n }\n const compilerOptions = merge({}, defaultCompilerOptions, params?.compile?.tsc?.compilerOptions)\n const config = await loadConfig(params)\n if (config.verbose) {\n console.log('Compiling with TSC')\n }\n\n const fileNames = (await getAllInputs(config.compile?.depth)).map((fileName) => `src/${fileName}`)\n const configFile = getConfigFile(compilerOptions)\n return compile(fileNames, configFile.compilerOptions)\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAElB,OAAO,WAAW;AAClB;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,kBAAkB;AAE3B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAa7B,MAAM,gBAAgB,CAAC,SAA2B,WAAmB,oBAAoB;AACvF,QAAM,iBAAiB,eAAe,MAAM,IAAI,YAAY,QAAQ;AACpE,SAAO,EAAE,GAAI,iBAAiB,eAAe,gBAAgB,IAAI,QAAQ,EAAE,SAAS,CAAC,GAAI,iBAAiB,mBAAmB,OAAO,EAAE;AACxI;AAEA,MAAM,UAAU,CAAC,WAAqB,YAA6B;AACjE,UAAQ,IAAI,MAAM,KAAK,SAAS,CAAC;AACjC,UAAQ,IAAI,MAAM,QAAQ,YAAY,KAAK,UAAU,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC;AACzE,QAAM,UAAU,cAAc,WAAW,OAAO;AAChD,UAAQ,IAAI,MAAM,KAAK,eAAe,CAAC;AACvC,QAAM,aAAa,QAAQ,KAAK;AAChC,UAAQ,IAAI,MAAM,KAAK,MAAM,CAAC;AAE9B,QAAM,iBAA+B,sBAAsB,OAAO,EAAE,OAAO,WAAW,WAAW;AAEjG,QAAM,mBAAmB,eAAe,OAAO,CAAC,eAAe,WAAW,aAAa,CAAC;AAExF,iBAAe,QAAQ,CAAC,eAAe;AACrC,QAAI,WAAW,MAAM;AACnB,YAAM,EAAE,MAAM,UAAU,IAAI,8BAA8B,WAAW,MAAM,WAAW,KAAM;AAC5F,YAAM,UAAU,6BAA6B,WAAW,aAAa,IAAI;AACzE,cAAQ,IAAI,GAAG,WAAW,KAAK,QAAQ,KAAK,OAAO,CAAC,IAAI,YAAY,CAAC,MAAM,OAAO,EAAE;AAAA,IACtF,OAAO;AACL,cAAQ,IAAI,6BAA6B,WAAW,aAAa,IAAI,CAAC;AAAA,IACxE;AAAA,EACF,CAAC;AAED,MAAI,iBAAiB,QAAQ;AAC3B,YAAQ,IAAI,MAAM,IAAI,WAAW,iBAAiB,MAAM,EAAE,CAAC;AAC3D,YAAQ,KAAK,iBAAiB,MAAM;AAAA,EACtC;AAEA,SAAO,iBAAiB;AAC1B;AAEO,MAAM,oBAAoB,OAAO,WAAsD;
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/tsc.ts"],"sourcesContent":["import chalk from 'chalk'\n// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge'\nimport {\n CompilerOptions,\n createProgram,\n Diagnostic,\n findConfigFile,\n flattenDiagnosticMessageText,\n getLineAndCharacterOfPosition,\n getPreEmitDiagnostics,\n readConfigFile,\n sys,\n} from 'typescript'\n\nimport { loadConfig } from '../../../lib'\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\nimport { getAllInputs } from './inputs'\n\nexport type PackageCompileTscParams = Partial<\n CompileParams & {\n compile?: {\n tsc?: {\n compilerOptions?: CompilerOptions\n tsconfig?: string\n }\n }\n }\n>\n\nconst getConfigFile = (options?: CompilerOptions, tsconfig: string = 'tsconfig.json') => {\n const configFileName = findConfigFile('./', sys.fileExists, tsconfig)\n return { ...(configFileName ? readConfigFile(configFileName, sys.readFile).config : {}), compilerOptions: getCompilerOptions(options) }\n}\n\nconst compile = (fileNames: string[], options: CompilerOptions) => {\n console.log(chalk.blue('compile'))\n console.log(chalk.magenta(`options: ${JSON.stringify(options, null, 2)}`))\n const program = createProgram(fileNames, options)\n console.log(chalk.blue('createProgram'))\n const emitResult = program.emit()\n console.log(chalk.blue('emit'))\n\n const allDiagnostics: Diagnostic[] = getPreEmitDiagnostics(program).concat(emitResult.diagnostics)\n\n const errorDiagnostics = allDiagnostics.filter((diagnostic) => diagnostic.category === 1)\n\n allDiagnostics.forEach((diagnostic) => {\n if (diagnostic.file) {\n const { line, character } = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start!)\n const message = flattenDiagnosticMessageText(diagnostic.messageText, '\\n')\n console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`)\n } else {\n console.log(flattenDiagnosticMessageText(diagnostic.messageText, '\\n'))\n }\n })\n\n if (errorDiagnostics.length) {\n console.log(chalk.red(`Errors: ${errorDiagnostics.length}`))\n process.exit(errorDiagnostics.length)\n }\n\n return errorDiagnostics.length\n}\n\nexport const packageCompileTsc = async (params?: PackageCompileTscParams): Promise<number> => {\n const defaultCompilerOptions: CompilerOptions = {\n declaration: true,\n declarationMap: true,\n outDir: 'dist',\n rootDir: 'src',\n sourceMap: true,\n }\n const compilerOptions = merge({}, defaultCompilerOptions, params?.compile?.tsc?.compilerOptions)\n const config = await loadConfig(params)\n if (config.verbose) {\n console.log('Compiling with TSC')\n }\n\n const fileNames = (await getAllInputs(config.compile?.depth)).map((fileName) => `src/${fileName}`)\n const configFile = getConfigFile(compilerOptions)\n return compile(fileNames, configFile.compilerOptions)\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAElB,OAAO,WAAW;AAClB;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,kBAAkB;AAE3B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAa7B,MAAM,gBAAgB,CAAC,SAA2B,WAAmB,oBAAoB;AACvF,QAAM,iBAAiB,eAAe,MAAM,IAAI,YAAY,QAAQ;AACpE,SAAO,EAAE,GAAI,iBAAiB,eAAe,gBAAgB,IAAI,QAAQ,EAAE,SAAS,CAAC,GAAI,iBAAiB,mBAAmB,OAAO,EAAE;AACxI;AAEA,MAAM,UAAU,CAAC,WAAqB,YAA6B;AACjE,UAAQ,IAAI,MAAM,KAAK,SAAS,CAAC;AACjC,UAAQ,IAAI,MAAM,QAAQ,YAAY,KAAK,UAAU,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC;AACzE,QAAM,UAAU,cAAc,WAAW,OAAO;AAChD,UAAQ,IAAI,MAAM,KAAK,eAAe,CAAC;AACvC,QAAM,aAAa,QAAQ,KAAK;AAChC,UAAQ,IAAI,MAAM,KAAK,MAAM,CAAC;AAE9B,QAAM,iBAA+B,sBAAsB,OAAO,EAAE,OAAO,WAAW,WAAW;AAEjG,QAAM,mBAAmB,eAAe,OAAO,CAAC,eAAe,WAAW,aAAa,CAAC;AAExF,iBAAe,QAAQ,CAAC,eAAe;AACrC,QAAI,WAAW,MAAM;AACnB,YAAM,EAAE,MAAM,UAAU,IAAI,8BAA8B,WAAW,MAAM,WAAW,KAAM;AAC5F,YAAM,UAAU,6BAA6B,WAAW,aAAa,IAAI;AACzE,cAAQ,IAAI,GAAG,WAAW,KAAK,QAAQ,KAAK,OAAO,CAAC,IAAI,YAAY,CAAC,MAAM,OAAO,EAAE;AAAA,IACtF,OAAO;AACL,cAAQ,IAAI,6BAA6B,WAAW,aAAa,IAAI,CAAC;AAAA,IACxE;AAAA,EACF,CAAC;AAED,MAAI,iBAAiB,QAAQ;AAC3B,YAAQ,IAAI,MAAM,IAAI,WAAW,iBAAiB,MAAM,EAAE,CAAC;AAC3D,YAAQ,KAAK,iBAAiB,MAAM;AAAA,EACtC;AAEA,SAAO,iBAAiB;AAC1B;AAEO,MAAM,oBAAoB,OAAO,WAAsD;AAlE9F;AAmEE,QAAM,yBAA0C;AAAA,IAC9C,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AACA,QAAM,kBAAkB,MAAM,CAAC,GAAG,yBAAwB,4CAAQ,YAAR,mBAAiB,QAAjB,mBAAsB,eAAe;AAC/F,QAAM,SAAS,MAAM,WAAW,MAAM;AACtC,MAAI,OAAO,SAAS;AAClB,YAAQ,IAAI,oBAAoB;AAAA,EAClC;AAEA,QAAM,aAAa,MAAM,cAAa,YAAO,YAAP,mBAAgB,KAAK,GAAG,IAAI,CAAC,aAAa,OAAO,QAAQ,EAAE;AACjG,QAAM,aAAa,cAAc,eAAe;AAChD,SAAO,QAAQ,WAAW,WAAW,eAAe;AACtD;","names":[]}
|
|
@@ -27,7 +27,7 @@ var import_typescript = require("typescript");
|
|
|
27
27
|
var import_getCompilerOptions = require("./getCompilerOptions");
|
|
28
28
|
const packageCompileTscNoEmit = (params) => {
|
|
29
29
|
const pkg = process.env.INIT_CWD;
|
|
30
|
-
if (params
|
|
30
|
+
if (params == null ? void 0 : params.verbose) {
|
|
31
31
|
console.log(`Compiling with NoEmit TSC [${pkg}]`);
|
|
32
32
|
}
|
|
33
33
|
const result = (0, import_tsc_prog.createProgramFromConfig)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscNoEmit = (params?: CompileParams): number => {\n const pkg = process.env.INIT_CWD\n\n if (params?.verbose) {\n console.log(`Compiling with NoEmit TSC [${pkg}]`)\n }\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions: getCompilerOptions({\n declaration: false,\n declarationMap: false,\n esModuleInterop: true,\n noEmit: true,\n skipLibCheck: false,\n sourceMap: false,\n }) as TsConfigCompilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AACpB,sBAAiE;AACjE,wBAAmC;AAGnC,gCAAmC;AAE5B,MAAM,0BAA0B,CAAC,WAAmC;AACzE,QAAM,MAAM,QAAQ,IAAI;AAExB,MAAI,
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscNoEmit = (params?: CompileParams): number => {\n const pkg = process.env.INIT_CWD\n\n if (params?.verbose) {\n console.log(`Compiling with NoEmit TSC [${pkg}]`)\n }\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions: getCompilerOptions({\n declaration: false,\n declarationMap: false,\n esModuleInterop: true,\n noEmit: true,\n skipLibCheck: false,\n sourceMap: false,\n }) as TsConfigCompilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AACpB,sBAAiE;AACjE,wBAAmC;AAGnC,gCAAmC;AAE5B,MAAM,0BAA0B,CAAC,WAAmC;AACzE,QAAM,MAAM,QAAQ,IAAI;AAExB,MAAI,iCAAQ,SAAS;AACnB,YAAQ,IAAI,8BAA8B,GAAG,GAAG;AAAA,EAClD;AAEA,QAAM,aAAS,yCAAwB;AAAA,IACrC,UAAU,WAAO,oBAAI;AAAA,IACrB,qBAAiB,8CAAmB;AAAA,MAClC,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB,kBAAkB;AAAA,IAC7E,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC,EAAE,KAAK;AAER,SAAO,OAAO,YAAY,IAAI,CAAC,UAAU,MAAM,aAAa,qCAAmB,KAAK,EAAE;AACxF;","names":[]}
|
|
@@ -4,7 +4,7 @@ import { DiagnosticCategory } from "typescript";
|
|
|
4
4
|
import { getCompilerOptions } from "./getCompilerOptions";
|
|
5
5
|
const packageCompileTscNoEmit = (params) => {
|
|
6
6
|
const pkg = process.env.INIT_CWD;
|
|
7
|
-
if (params
|
|
7
|
+
if (params == null ? void 0 : params.verbose) {
|
|
8
8
|
console.log(`Compiling with NoEmit TSC [${pkg}]`);
|
|
9
9
|
}
|
|
10
10
|
const result = createProgramFromConfig({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscNoEmit = (params?: CompileParams): number => {\n const pkg = process.env.INIT_CWD\n\n if (params?.verbose) {\n console.log(`Compiling with NoEmit TSC [${pkg}]`)\n }\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions: getCompilerOptions({\n declaration: false,\n declarationMap: false,\n esModuleInterop: true,\n noEmit: true,\n skipLibCheck: false,\n sourceMap: false,\n }) as TsConfigCompilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length\n}\n"],"mappings":"AAAA,SAAS,WAAW;AACpB,SAAS,+BAAwD;AACjE,SAAS,0BAA0B;AAGnC,SAAS,0BAA0B;AAE5B,MAAM,0BAA0B,CAAC,WAAmC;AACzE,QAAM,MAAM,QAAQ,IAAI;AAExB,MAAI,
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscNoEmit = (params?: CompileParams): number => {\n const pkg = process.env.INIT_CWD\n\n if (params?.verbose) {\n console.log(`Compiling with NoEmit TSC [${pkg}]`)\n }\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions: getCompilerOptions({\n declaration: false,\n declarationMap: false,\n esModuleInterop: true,\n noEmit: true,\n skipLibCheck: false,\n sourceMap: false,\n }) as TsConfigCompilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length\n}\n"],"mappings":"AAAA,SAAS,WAAW;AACpB,SAAS,+BAAwD;AACjE,SAAS,0BAA0B;AAGnC,SAAS,0BAA0B;AAE5B,MAAM,0BAA0B,CAAC,WAAmC;AACzE,QAAM,MAAM,QAAQ,IAAI;AAExB,MAAI,iCAAQ,SAAS;AACnB,YAAQ,IAAI,8BAA8B,GAAG,GAAG;AAAA,EAClD;AAEA,QAAM,SAAS,wBAAwB;AAAA,IACrC,UAAU,OAAO,IAAI;AAAA,IACrB,iBAAiB,mBAAmB;AAAA,MAClC,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB,kBAAkB;AAAA,IAC7E,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC,EAAE,KAAK;AAER,SAAO,OAAO,YAAY,IAAI,CAAC,UAAU,MAAM,aAAa,mBAAmB,KAAK,EAAE;AACxF;","names":[]}
|
|
@@ -39,7 +39,7 @@ var import_copyTypeFiles = require("./copyTypeFiles");
|
|
|
39
39
|
var import_getCompilerOptions = require("./getCompilerOptions");
|
|
40
40
|
const packageCompileTscTypes = async (params, compilerOptionsParam, generateMts = true) => {
|
|
41
41
|
const pkg = process.env.INIT_CWD;
|
|
42
|
-
if (params
|
|
42
|
+
if (params == null ? void 0 : params.verbose) {
|
|
43
43
|
console.log(`Compiling types with TSC [${pkg}]`);
|
|
44
44
|
}
|
|
45
45
|
const compilerOptions = {
|
|
@@ -62,21 +62,22 @@ const packageCompileTscTypes = async (params, compilerOptionsParam, generateMts
|
|
|
62
62
|
}).emit();
|
|
63
63
|
const diagResults = result.diagnostics.map((value) => value.category === import_typescript.DiagnosticCategory.Error).length;
|
|
64
64
|
result.diagnostics.forEach((diag) => {
|
|
65
|
+
var _a, _b, _c;
|
|
65
66
|
switch (diag.category) {
|
|
66
67
|
case import_typescript.DiagnosticCategory.Error:
|
|
67
68
|
console.error(import_chalk.default.red(diag.messageText));
|
|
68
69
|
console.error(import_chalk.default.grey(pkg));
|
|
69
|
-
console.error(import_chalk.default.blue(diag.file
|
|
70
|
+
console.error(import_chalk.default.blue((_a = diag.file) == null ? void 0 : _a.fileName));
|
|
70
71
|
break;
|
|
71
72
|
case import_typescript.DiagnosticCategory.Warning:
|
|
72
73
|
console.error(import_chalk.default.yellow(diag.messageText));
|
|
73
74
|
console.error(import_chalk.default.grey(pkg));
|
|
74
|
-
console.error(import_chalk.default.blue(diag.file
|
|
75
|
+
console.error(import_chalk.default.blue((_b = diag.file) == null ? void 0 : _b.fileName));
|
|
75
76
|
break;
|
|
76
77
|
case import_typescript.DiagnosticCategory.Suggestion:
|
|
77
78
|
console.error(import_chalk.default.white(diag.messageText));
|
|
78
79
|
console.error(import_chalk.default.grey(pkg));
|
|
79
|
-
console.error(import_chalk.default.blue(diag.file
|
|
80
|
+
console.error(import_chalk.default.blue((_c = diag.file) == null ? void 0 : _c.fileName));
|
|
80
81
|
break;
|
|
81
82
|
}
|
|
82
83
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/tscTypes.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { CompilerOptions, DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { copyTypeFiles } from './copyTypeFiles'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscTypes = async (params?: CompileParams, compilerOptionsParam?: CompilerOptions, generateMts = true): Promise<number> => {\n const pkg = process.env.INIT_CWD\n\n if (params?.verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...getCompilerOptions({\n declaration: true,\n declarationMap: true,\n emitDeclarationOnly: true,\n esModuleInterop: true,\n outDir: 'dist',\n skipLibCheck: true,\n sourceMap: true,\n }),\n ...(compilerOptionsParam ?? {}),\n } as TsConfigCompilerOptions\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n const diagResults = result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length\n result.diagnostics.forEach((diag) => {\n switch (diag.category) {\n case DiagnosticCategory.Error:\n console.error(chalk.red(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n case DiagnosticCategory.Warning:\n console.error(chalk.yellow(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n case DiagnosticCategory.Suggestion:\n console.error(chalk.white(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n }\n })\n if (generateMts) {\n await copyTypeFiles(compilerOptions)\n }\n return diagResults\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,qBAAoB;AACpB,sBAAiE;AACjE,wBAAoD;AAGpD,2BAA8B;AAC9B,gCAAmC;AAE5B,MAAM,yBAAyB,OAAO,QAAwB,sBAAwC,cAAc,SAA0B;AACnJ,QAAM,MAAM,QAAQ,IAAI;AAExB,MAAI,
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/tscTypes.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { CompilerOptions, DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { copyTypeFiles } from './copyTypeFiles'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscTypes = async (params?: CompileParams, compilerOptionsParam?: CompilerOptions, generateMts = true): Promise<number> => {\n const pkg = process.env.INIT_CWD\n\n if (params?.verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...getCompilerOptions({\n declaration: true,\n declarationMap: true,\n emitDeclarationOnly: true,\n esModuleInterop: true,\n outDir: 'dist',\n skipLibCheck: true,\n sourceMap: true,\n }),\n ...(compilerOptionsParam ?? {}),\n } as TsConfigCompilerOptions\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n const diagResults = result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length\n result.diagnostics.forEach((diag) => {\n switch (diag.category) {\n case DiagnosticCategory.Error:\n console.error(chalk.red(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n case DiagnosticCategory.Warning:\n console.error(chalk.yellow(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n case DiagnosticCategory.Suggestion:\n console.error(chalk.white(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n }\n })\n if (generateMts) {\n await copyTypeFiles(compilerOptions)\n }\n return diagResults\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,qBAAoB;AACpB,sBAAiE;AACjE,wBAAoD;AAGpD,2BAA8B;AAC9B,gCAAmC;AAE5B,MAAM,yBAAyB,OAAO,QAAwB,sBAAwC,cAAc,SAA0B;AACnJ,QAAM,MAAM,QAAQ,IAAI;AAExB,MAAI,iCAAQ,SAAS;AACnB,YAAQ,IAAI,6BAA6B,GAAG,GAAG;AAAA,EACjD;AAEA,QAAM,kBAAkB;AAAA,IACtB,OAAG,8CA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