@xylabs/ts-scripts-yarn3 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.mjs +7 -148
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +6 -146
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/getCompilerOptions.mjs +3 -143
- package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +6 -146
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs +3 -143
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +3 -143
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +3 -143
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/deps.mjs +0 -1
- package/dist/actions/package/deps.mjs.map +1 -1
- package/dist/actions/package/index.mjs +6 -147
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +6 -146
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/actions/test.mjs +1 -1
- package/dist/actions/test.mjs.map +1 -1
- package/dist/bin/package/build-only.mjs +6 -146
- package/dist/bin/package/build-only.mjs.map +1 -1
- package/dist/bin/package/build.mjs +6 -146
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +6 -146
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +3 -143
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +6 -146
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/deps.mjs +0 -1
- package/dist/bin/package/deps.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +6 -146
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy-ts.mjs +1 -1
- package/dist/bin/xy-ts.mjs.map +1 -1
- package/dist/bin/xy.mjs +1 -1
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.mjs +7 -148
- package/dist/index.mjs.map +1 -1
- package/dist/lib/index.mjs +3 -143
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/loadConfig.mjs +3 -143
- package/dist/lib/loadConfig.mjs.map +1 -1
- package/dist/xy/index.mjs +1 -1
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +1 -1
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyCommonCommands.mjs +1 -1
- package/dist/xy/xyCommonCommands.mjs.map +1 -1
- package/package.json +8 -11
- package/spec/yarn/workspace/tsconfig.json +1 -1
- package/src/actions/package/deps.ts +0 -1
- package/src/actions/test.ts +1 -1
- package/tsconfig.json +1 -2
|
@@ -1,157 +1,17 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
|
|
28
|
-
// ../../node_modules/deepmerge/dist/cjs.js
|
|
29
|
-
var require_cjs = __commonJS({
|
|
30
|
-
"../../node_modules/deepmerge/dist/cjs.js"(exports, module) {
|
|
31
|
-
"use strict";
|
|
32
|
-
var isMergeableObject = /* @__PURE__ */ __name(function isMergeableObject2(value) {
|
|
33
|
-
return isNonNullObject(value) && !isSpecial(value);
|
|
34
|
-
}, "isMergeableObject");
|
|
35
|
-
function isNonNullObject(value) {
|
|
36
|
-
return !!value && typeof value === "object";
|
|
37
|
-
}
|
|
38
|
-
__name(isNonNullObject, "isNonNullObject");
|
|
39
|
-
function isSpecial(value) {
|
|
40
|
-
var stringValue = Object.prototype.toString.call(value);
|
|
41
|
-
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
42
|
-
}
|
|
43
|
-
__name(isSpecial, "isSpecial");
|
|
44
|
-
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
45
|
-
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
46
|
-
function isReactElement(value) {
|
|
47
|
-
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
48
|
-
}
|
|
49
|
-
__name(isReactElement, "isReactElement");
|
|
50
|
-
function emptyTarget(val) {
|
|
51
|
-
return Array.isArray(val) ? [] : {};
|
|
52
|
-
}
|
|
53
|
-
__name(emptyTarget, "emptyTarget");
|
|
54
|
-
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
55
|
-
return options.clone !== false && options.isMergeableObject(value) ? deepmerge3(emptyTarget(value), value, options) : value;
|
|
56
|
-
}
|
|
57
|
-
__name(cloneUnlessOtherwiseSpecified, "cloneUnlessOtherwiseSpecified");
|
|
58
|
-
function defaultArrayMerge(target, source, options) {
|
|
59
|
-
return target.concat(source).map(function(element) {
|
|
60
|
-
return cloneUnlessOtherwiseSpecified(element, options);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
__name(defaultArrayMerge, "defaultArrayMerge");
|
|
64
|
-
function getMergeFunction(key, options) {
|
|
65
|
-
if (!options.customMerge) {
|
|
66
|
-
return deepmerge3;
|
|
67
|
-
}
|
|
68
|
-
var customMerge = options.customMerge(key);
|
|
69
|
-
return typeof customMerge === "function" ? customMerge : deepmerge3;
|
|
70
|
-
}
|
|
71
|
-
__name(getMergeFunction, "getMergeFunction");
|
|
72
|
-
function getEnumerableOwnPropertySymbols(target) {
|
|
73
|
-
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
74
|
-
return Object.propertyIsEnumerable.call(target, symbol);
|
|
75
|
-
}) : [];
|
|
76
|
-
}
|
|
77
|
-
__name(getEnumerableOwnPropertySymbols, "getEnumerableOwnPropertySymbols");
|
|
78
|
-
function getKeys(target) {
|
|
79
|
-
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
80
|
-
}
|
|
81
|
-
__name(getKeys, "getKeys");
|
|
82
|
-
function propertyIsOnObject(object, property) {
|
|
83
|
-
try {
|
|
84
|
-
return property in object;
|
|
85
|
-
} catch (_) {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
__name(propertyIsOnObject, "propertyIsOnObject");
|
|
90
|
-
function propertyIsUnsafe(target, key) {
|
|
91
|
-
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
92
|
-
}
|
|
93
|
-
__name(propertyIsUnsafe, "propertyIsUnsafe");
|
|
94
|
-
function mergeObject(target, source, options) {
|
|
95
|
-
var destination = {};
|
|
96
|
-
if (options.isMergeableObject(target)) {
|
|
97
|
-
getKeys(target).forEach(function(key) {
|
|
98
|
-
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
getKeys(source).forEach(function(key) {
|
|
102
|
-
if (propertyIsUnsafe(target, key)) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
106
|
-
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
107
|
-
} else {
|
|
108
|
-
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
return destination;
|
|
112
|
-
}
|
|
113
|
-
__name(mergeObject, "mergeObject");
|
|
114
|
-
function deepmerge3(target, source, options) {
|
|
115
|
-
options = options || {};
|
|
116
|
-
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
117
|
-
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
118
|
-
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
119
|
-
var sourceIsArray = Array.isArray(source);
|
|
120
|
-
var targetIsArray = Array.isArray(target);
|
|
121
|
-
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
122
|
-
if (!sourceAndTargetTypesMatch) {
|
|
123
|
-
return cloneUnlessOtherwiseSpecified(source, options);
|
|
124
|
-
} else if (sourceIsArray) {
|
|
125
|
-
return options.arrayMerge(target, source, options);
|
|
126
|
-
} else {
|
|
127
|
-
return mergeObject(target, source, options);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
__name(deepmerge3, "deepmerge");
|
|
131
|
-
deepmerge3.all = /* @__PURE__ */ __name(function deepmergeAll(array, options) {
|
|
132
|
-
if (!Array.isArray(array)) {
|
|
133
|
-
throw new Error("first argument should be an array");
|
|
134
|
-
}
|
|
135
|
-
return array.reduce(function(prev, next) {
|
|
136
|
-
return deepmerge3(prev, next, options);
|
|
137
|
-
}, {});
|
|
138
|
-
}, "deepmergeAll");
|
|
139
|
-
var deepmerge_1 = deepmerge3;
|
|
140
|
-
module.exports = deepmerge_1;
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
3
|
|
|
144
4
|
// src/actions/package/compile/compile.ts
|
|
145
5
|
import chalk5 from "chalk";
|
|
146
6
|
|
|
147
7
|
// src/lib/loadConfig.ts
|
|
148
|
-
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
149
8
|
import chalk from "chalk";
|
|
150
9
|
import { cosmiconfig } from "cosmiconfig";
|
|
10
|
+
import deepmerge from "deepmerge";
|
|
151
11
|
var config;
|
|
152
12
|
var loadConfig = /* @__PURE__ */ __name(async (params) => {
|
|
153
13
|
if (config) {
|
|
154
|
-
return (
|
|
14
|
+
return deepmerge(config, params ?? {});
|
|
155
15
|
}
|
|
156
16
|
const cosmicConfigResult = await cosmiconfig("xy", {
|
|
157
17
|
cache: true
|
|
@@ -161,7 +21,7 @@ var loadConfig = /* @__PURE__ */ __name(async (params) => {
|
|
|
161
21
|
if (configFilePath) {
|
|
162
22
|
console.log(chalk.gray(`Loading config from ${configFilePath}`));
|
|
163
23
|
}
|
|
164
|
-
return (
|
|
24
|
+
return deepmerge(config, params ?? {});
|
|
165
25
|
}, "loadConfig");
|
|
166
26
|
|
|
167
27
|
// src/actions/package/publint.ts
|
|
@@ -215,14 +75,14 @@ import { createProgramFromConfig } from "tsc-prog";
|
|
|
215
75
|
import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getLineAndCharacterOfPosition, getPreEmitDiagnostics } from "typescript";
|
|
216
76
|
|
|
217
77
|
// src/actions/package/compile/getCompilerOptions.ts
|
|
218
|
-
var import_deepmerge2 = __toESM(require_cjs(), 1);
|
|
219
78
|
import { createRequire } from "node:module";
|
|
79
|
+
import deepmerge2 from "deepmerge";
|
|
220
80
|
import { findConfigFile, readConfigFile, sys } from "typescript";
|
|
221
81
|
var getNested = /* @__PURE__ */ __name((config2) => {
|
|
222
82
|
if (config2.extends) {
|
|
223
83
|
const require2 = createRequire(import.meta.url);
|
|
224
84
|
const opts = require2(config2.extends);
|
|
225
|
-
return (
|
|
85
|
+
return deepmerge2(getNested(opts), config2.compilerOptions ?? {});
|
|
226
86
|
}
|
|
227
87
|
return config2.compilerOptions;
|
|
228
88
|
}, "getNested");
|
|
@@ -233,7 +93,7 @@ var getCompilerOptionsJSONFollowExtends = /* @__PURE__ */ __name((filename) => {
|
|
|
233
93
|
var getCompilerOptions = /* @__PURE__ */ __name((options = {}, tsconfig = "tsconfig.json") => {
|
|
234
94
|
const configFileName = findConfigFile("./", sys.fileExists, tsconfig);
|
|
235
95
|
const configFileCompilerOptions = (configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0) ?? {};
|
|
236
|
-
return (
|
|
96
|
+
return deepmerge2(configFileCompilerOptions, options);
|
|
237
97
|
}, "getCompilerOptions");
|
|
238
98
|
|
|
239
99
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../node_modules/deepmerge/dist/cjs.js","../../../../src/actions/package/compile/compile.ts","../../../../src/lib/loadConfig.ts","../../../../src/actions/package/publint.ts","../../../../src/actions/package/compile/packageCompileTsc.ts","../../../../src/actions/package/compile/getCompilerOptions.ts","../../../../src/actions/package/compile/packageCompileTsup.ts","../../../../src/actions/package/compile/inputs.ts","../../../../src/actions/package/compile/buildEntries.ts","../../../../src/actions/package/compile/packageCompileTscTypes.ts"],"sourcesContent":["'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","import chalk from 'chalk'\n\nimport { loadConfig } from '../../../lib/index.ts'\nimport { packagePublint } from '../publint.ts'\nimport { packageCompileTsc } from './packageCompileTsc.ts'\nimport { packageCompileTsup } from './packageCompileTsup.ts'\nimport type {\n XyConfig, XyTscConfig, XyTsupConfig,\n} from './XyConfig.ts'\n\nexport const packageCompile = async (inConfig: XyConfig = {}, types?: 'tsc' | 'tsup'): Promise<number> => {\n const pkg = process.env.INIT_CWD\n console.log(chalk.green(`Compiling ${pkg}`))\n const config = await loadConfig(inConfig)\n const publint = config.publint\n\n const mode = config.compile?.mode ?? 'tsup'\n let result: number = 0\n switch (mode) {\n case 'tsc': {\n result += await packageCompileTsc(undefined, config as XyTscConfig)\n break\n }\n case 'tsup': {\n result += await packageCompileTsup(config as XyTsupConfig, types)\n break\n }\n }\n return result + (publint ? await packagePublint(config) : 0)\n}\n","import chalk from 'chalk'\nimport { cosmiconfig } from 'cosmiconfig'\nimport deepmerge from 'deepmerge'\n\nlet config: Record<string, unknown>\n\nexport const loadConfig = async <T extends object>(params?: T): Promise<T> => {\n if (config) {\n return deepmerge(config, params ?? {}) as T\n }\n\n const cosmicConfigResult = await cosmiconfig('xy', { cache: true }).search()\n config = cosmicConfigResult?.config\n const configFilePath = cosmicConfigResult?.filepath\n if (configFilePath) {\n console.log(chalk.gray(`Loading config from ${configFilePath}`))\n }\n return deepmerge(config, params ?? {}) as T\n}\n","import { promises as fs } from 'node:fs'\n\nimport chalk from 'chalk'\nimport type { Message } from 'publint'\nimport sortPackageJson from 'sort-package-json'\n\nexport interface PackagePublintParams { verbose?: boolean }\n\nexport const packagePublint = async (params?: PackagePublintParams) => {\n const pkgDir = process.env.INIT_CWD\n\n const sortedPkg = sortPackageJson(await fs.readFile(`${pkgDir}/package.json`, 'utf8'))\n await fs.writeFile(`${pkgDir}/package.json`, sortedPkg)\n\n const pkg = JSON.parse(await fs.readFile(`${pkgDir}/package.json`, 'utf8'))\n\n console.log(chalk.green(`Publint: ${pkg.name}`))\n console.log(chalk.gray(pkgDir))\n\n const { publint } = await import('publint')\n\n const { messages } = await publint({\n level: 'suggestion',\n pkgDir,\n strict: true,\n })\n\n // eslint-disable-next-line import-x/no-internal-modules\n const { formatMessage } = await import('publint/utils')\n\n const validMessage = (_message: Message): boolean => {\n return true\n /* try {\n const value = getValueFromPath(pkg, message.path)\n switch (message.code) {\n case 'FILE_INVALID_FORMAT':\n return !message.args?.actualFilePath?.includes('dist/browser') && !value?.includes('dist/browser')\n case 'EXPORT_TYPES_INVALID_FORMAT':\n return !`${value}`.includes('dist/browser')\n default:\n return true\n }\n } catch (ex) {\n const error = ex as Error\n console.error(chalk.red(`validMessage Excepted: ${error.message}`))\n console.error(chalk.gray(JSON.stringify(error.stack)))\n return true\n } */\n }\n\n // we filter out invalid file formats for the esm folder since it is intentionally done\n const validMessages = messages.filter(validMessage)\n for (const message of validMessages) {\n switch (message.type) {\n case 'error': {\n console.error(chalk.red(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n case 'warning': {\n console.warn(chalk.yellow(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n default: {\n console.log(chalk.white(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n }\n }\n\n if (params?.verbose) {\n console.log(chalk.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`))\n }\n\n return validMessages.filter(message => message.type === 'error').length\n}\n","import { cwd } from 'node:process'\n\nimport chalk from 'chalk'\nimport type { TsConfigCompilerOptions } from 'tsc-prog'\nimport { createProgramFromConfig } from 'tsc-prog'\nimport type {\n CompilerOptions,\n FormatDiagnosticsHost,\n LineAndCharacter,\n} from 'typescript'\nimport {\n DiagnosticCategory,\n formatDiagnosticsWithColorAndContext,\n getLineAndCharacterOfPosition,\n getPreEmitDiagnostics,\n} from 'typescript'\n\nimport { packagePublint } from '../publint.ts'\nimport { getCompilerOptions } from './getCompilerOptions.ts'\nimport type { XyTscConfig } from './XyConfig.ts'\n\nexport const packageCompileTsc = async (noEmit?: boolean, config?: XyTscConfig, compilerOptionsParam?: CompilerOptions): Promise<number> => {\n const pkg = process.env.INIT_CWD ?? cwd()\n\n const publint = config?.publint ?? true\n const verbose = config?.verbose ?? false\n\n const formatHost: FormatDiagnosticsHost = {\n getCanonicalFileName: fileName => fileName,\n getCurrentDirectory: () => pkg,\n getNewLine: () => '\\n',\n }\n\n if (verbose) {\n console.log(`Compiling with NoEmit TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...(getCompilerOptions({\n outDir: 'dist',\n removeComments: true,\n rootDir: 'src',\n })),\n ...compilerOptionsParam,\n ...(noEmit === undefined ? {} : { noEmit }),\n } as TsConfigCompilerOptions\n\n const program = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n })\n\n const results = getPreEmitDiagnostics(program)\n\n for (const diag of results) {\n const lineAndChar: LineAndCharacter = diag.file\n ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0)\n : { character: 0, line: 0 }\n console.log(chalk.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`))\n console.log(formatDiagnosticsWithColorAndContext([diag], formatHost))\n }\n\n // eslint-disable-next-line unicorn/no-array-reduce\n return results.reduce((prev, diag) => (prev + diag.category === DiagnosticCategory.Error ? 1 : 0), 0) || (publint ? await packagePublint() : 0)\n}\n","import { createRequire } from 'node:module'\n\nimport deepmerge from 'deepmerge'\nimport type { TsConfig } from 'tsc-prog'\nimport type { CompilerOptions } from 'typescript'\nimport {\n findConfigFile, readConfigFile, sys,\n} from 'typescript'\n\nconst getNested = (config: TsConfig): CompilerOptions => {\n if (config.extends) {\n const require = createRequire(import.meta.url)\n const opts = require(config.extends)\n return deepmerge(getNested(opts), config.compilerOptions ?? {}) as CompilerOptions\n }\n\n return config.compilerOptions as CompilerOptions\n}\n\nexport const getCompilerOptionsJSONFollowExtends = (filename: string): CompilerOptions => {\n const config = readConfigFile(filename, sys.readFile).config\n return getNested(config)\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 deepmerge(configFileCompilerOptions, options)\n}\n","import type { Loader } from 'esbuild'\nimport type { Options } from 'tsup'\nimport { build, defineConfig } from 'tsup'\n\nimport { packagePublint } from '../publint.ts'\nimport { buildEntries } from './buildEntries.ts'\nimport { packageCompileTscTypes } from './packageCompileTscTypes.ts'\nimport type { EntryMode, XyTsupConfig } from './XyConfig.ts'\n\nconst compileFolder = async (\n folder: string,\n entryMode: EntryMode = 'single',\n options?: Options,\n types: 'tsc' | 'tsup' = 'tsup',\n verbose?: boolean,\n): Promise<number> => {\n const outDir = options?.outDir ?? 'dist'\n const entry = buildEntries(folder, entryMode)\n const optionsResult = defineConfig({\n bundle: true,\n cjsInterop: true,\n clean: true,\n dts: true,\n entry,\n format: ['esm'],\n outDir,\n silent: true,\n sourcemap: types === 'tsup',\n splitting: false,\n tsconfig: 'tsconfig.json',\n ...options,\n })\n const optionsList = (\n await Promise.all(\n (Array.isArray(optionsResult) ? optionsResult : [optionsResult]).flatMap<Promise<Options[]>>(async (options) => {\n const result = typeof options === 'function' ? await options({}) : [options]\n return Array.isArray(result) ? result : [result]\n }),\n )\n ).flat()\n\n await Promise.all(optionsList.map(options => build(options)))\n if (types === 'tsc') {\n return packageCompileTscTypes(folder, { verbose }, { outDir })\n }\n return 0\n}\n\n// eslint-disable-next-line complexity\nexport const packageCompileTsup = async (config?: XyTsupConfig, types: 'tsc' | 'tsup' = 'tsup') => {\n console.warn('packageCompileTsup-types', types)\n const compile = config?.compile\n const publint = config?.publint ?? true\n const verbose = config?.verbose ?? false\n if (verbose) {\n console.log(`Compiling with TSUP [Depth: ${compile?.depth}]`)\n }\n\n const compileForNode = compile?.node ?? { src: {} }\n const compileForBrowser = compile?.browser ?? { src: {} }\n const compileForNeutral = compile?.neutral ?? { src: {} }\n\n const standardLoaders: Record<string, Loader> = {\n '.gif': 'copy', '.html': 'copy', '.jpg': 'copy', '.json': 'json', '.png': 'copy', '.svg': 'copy', '.webp': 'copy',\n }\n const standardOptions: Options = {\n bundle: true,\n format: ['esm'],\n loader: standardLoaders,\n outExtension: ({ format }) => (format === 'esm' ? { js: '.mjs' } : { js: '.cjs' }),\n skipNodeModulesBundle: true,\n sourcemap: true,\n target: 'esnext',\n }\n\n return (\n (\n await Promise.all(\n Object.entries(compileForNode).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.node?.esbuildOptions === 'object' ? compile?.node?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n {\n ...standardOptions,\n loader: {\n ...standardOptions.loader,\n ...inEsBuildOptions?.loader,\n },\n outDir: 'dist/node',\n platform: 'node',\n ...compile?.tsup?.options,\n ...(typeof options === 'object' ? options : {}),\n },\n types,\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || (\n await Promise.all(\n Object.entries(compileForBrowser).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.browser?.esbuildOptions === 'object' ? compile?.browser?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n {\n ...standardOptions,\n loader: {\n ...standardOptions.loader,\n ...inEsBuildOptions?.loader,\n },\n outDir: 'dist/browser',\n platform: 'browser',\n ...compile?.tsup?.options,\n ...(typeof options === 'object' ? options : {}),\n },\n types,\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || (\n await Promise.all(\n Object.entries(compileForNeutral).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.neutral?.esbuildOptions === 'object' ? compile?.neutral?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n {\n ...standardOptions,\n loader: {\n ...standardOptions.loader,\n ...inEsBuildOptions?.loader,\n },\n outDir: 'dist/neutral',\n platform: 'neutral',\n ...compile?.tsup?.options,\n ...(typeof options === 'object' ? options : {}),\n },\n types,\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || (publint ? await packagePublint() : 0)\n )\n}\n","import { readdir } from 'node:fs/promises'\n\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 > 0) {\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 = (folder: string) => {\n /* tsup wants posix paths */\n return glob.sync(`${folder}/**/*.*`, { ignore: ['**/*.spec.*', '**/*.stories.*', '**/spec/**/*'], posix: true })\n}\n","import { getAllInputs2 } from './inputs.ts'\nimport type { EntryMode } from './XyConfig.ts'\n\nexport const buildEntries = (folder: string, entryMode?: EntryMode, verbose = false) => {\n switch (entryMode) {\n case 'platform': {\n if (verbose) console.log('buildEntries [platform]')\n return [`${folder}/index-node.ts`, `${folder}/index-browser.ts`]\n }\n case 'all': {\n if (verbose) console.log('buildEntries [all]')\n return getAllInputs2(folder).filter(entry => !entry.includes('.spec.') && !entry.includes('.story.'))\n }\n default: {\n if (verbose) console.log('buildEntries [single]')\n return [`${folder}/index.ts`]\n }\n }\n}\n","import { cwd } from 'node:process'\n\nimport chalk from 'chalk'\nimport type { TsConfigCompilerOptions } from 'tsc-prog'\nimport { createProgramFromConfig } from 'tsc-prog'\nimport type { CompilerOptions } from 'typescript'\nimport { DiagnosticCategory } from 'typescript'\n\nimport { buildEntries } from './buildEntries.ts'\nimport { getCompilerOptions } from './getCompilerOptions.ts'\nimport type { XyConfig } from './XyConfig.ts'\n\nexport const packageCompileTscTypes = (\n folder: string = 'src',\n { verbose }: XyConfig = {},\n compilerOptionsParam?: CompilerOptions,\n): number => {\n const pkg = process.env.INIT_CWD ?? cwd()\n\n if (verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...(getCompilerOptions({\n declaration: true,\n emitDeclarationOnly: true,\n outDir: 'dist',\n removeComments: true,\n skipDefaultLibCheck: true,\n skipLibCheck: true,\n sourceMap: true,\n })),\n ...compilerOptionsParam,\n } as TsConfigCompilerOptions\n\n // calling all here since the types do not get rolled up\n const files = buildEntries(folder, 'all')\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n files,\n }).emit()\n\n const diagResults = result.diagnostics.length\n for (const diag of result.diagnostics) {\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 }\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 }\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 }\n return diagResults\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;AAEA,QAAIA,oBAAoB,gCAASA,mBA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,CAAC3B,QAAQE,OAAAA,MAAQ;AAC5D,UAAMoD,mBAAmB,OAAOpB,SAASU,SAASW,mBAAmB,WAAWrB,SAASU,SAASW,iBAAiB,CAAC;AACpH,WAAOvD,SACH,MAAMD,cACNC,QACAkC,SAASjC,WACT;MACE,GAAG6C;MACHC,QAAQ;QACN,GAAGD,gBAAgBC;QACnB,GAAGO,kBAAkBP;MACvB;MACA1C,QAAQ;MACRmD,UAAU;MACV,GAAGtB,SAASuB,MAAMvD;MAClB,GAAI,OAAOA,YAAY,WAAWA,UAAU,CAAC;IAC/C,GACAC,OACAC,OAAAA,IAEA;EACN,CAAA,CAAA,GAEFsD,OAAO,CAACC,MAAMC,UAAUD,OAAOC,OAAO,CAAA,MACpCzB,UAAU,MAAM0B,eAAAA,IAAmB;AAE3C,GA3GkC;;;ALvC3B,IAAMC,iBAAiB,8BAAOC,WAAqB,CAAC,GAAGC,UAAAA;AAC5D,QAAMC,MAAMC,QAAQC,IAAIC;AACxBC,UAAQC,IAAIC,OAAMC,MAAM,aAAaP,GAAAA,EAAK,CAAA;AAC1C,QAAMQ,UAAS,MAAMC,WAAWX,QAAAA;AAChC,QAAMY,UAAUF,QAAOE;AAEvB,QAAMC,OAAOH,QAAOI,SAASD,QAAQ;AACrC,MAAIE,SAAiB;AACrB,UAAQF,MAAAA;IACN,KAAK,OAAO;AACVE,gBAAU,MAAMC,kBAAkBC,QAAWP,OAAAA;AAC7C;IACF;IACA,KAAK,QAAQ;AACXK,gBAAU,MAAMG,mBAAmBR,SAAwBT,KAAAA;AAC3D;IACF;EACF;AACA,SAAOc,UAAUH,UAAU,MAAMO,eAAeT,OAAAA,IAAU;AAC5D,GAnB8B;","names":["isMergeableObject","value","isNonNullObject","isSpecial","stringValue","Object","prototype","toString","call","isReactElement","canUseSymbol","Symbol","for","REACT_ELEMENT_TYPE","$$typeof","emptyTarget","val","Array","isArray","cloneUnlessOtherwiseSpecified","options","clone","deepmerge","defaultArrayMerge","target","source","concat","map","element","getMergeFunction","key","customMerge","getEnumerableOwnPropertySymbols","getOwnPropertySymbols","filter","symbol","propertyIsEnumerable","getKeys","keys","propertyIsOnObject","object","property","_","propertyIsUnsafe","hasOwnProperty","mergeObject","destination","forEach","arrayMerge","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","all","deepmergeAll","array","Error","reduce","prev","next","deepmerge_1","module","exports","chalk","chalk","cosmiconfig","config","loadConfig","params","deepmerge","cosmicConfigResult","cosmiconfig","cache","search","configFilePath","filepath","console","log","chalk","gray","promises","fs","chalk","sortPackageJson","packagePublint","params","pkgDir","process","env","INIT_CWD","sortedPkg","sortPackageJson","fs","readFile","writeFile","pkg","JSON","parse","console","log","chalk","green","name","gray","publint","messages","level","strict","formatMessage","validMessage","_message","validMessages","filter","message","type","error","red","code","warn","yellow","white","verbose","length","cwd","chalk","createProgramFromConfig","DiagnosticCategory","formatDiagnosticsWithColorAndContext","getLineAndCharacterOfPosition","getPreEmitDiagnostics","import_deepmerge","createRequire","findConfigFile","readConfigFile","sys","getNested","config","extends","require","createRequire","url","opts","deepmerge","compilerOptions","getCompilerOptionsJSONFollowExtends","filename","readConfigFile","sys","readFile","getCompilerOptions","options","tsconfig","configFileName","findConfigFile","fileExists","configFileCompilerOptions","undefined","packageCompileTsc","noEmit","config","compilerOptionsParam","pkg","process","env","INIT_CWD","cwd","publint","verbose","formatHost","getCanonicalFileName","fileName","getCurrentDirectory","getNewLine","console","log","compilerOptions","getCompilerOptions","outDir","removeComments","rootDir","undefined","program","createProgramFromConfig","basePath","exclude","include","results","getPreEmitDiagnostics","diag","lineAndChar","file","getLineAndCharacterOfPosition","start","character","line","chalk","cyan","formatDiagnosticsWithColorAndContext","reduce","prev","category","DiagnosticCategory","Error","packagePublint","build","defineConfig","glob","getAllInputs2","folder","glob","sync","ignore","posix","buildEntries","folder","entryMode","verbose","console","log","getAllInputs2","filter","entry","includes","cwd","chalk","createProgramFromConfig","DiagnosticCategory","packageCompileTscTypes","folder","verbose","compilerOptionsParam","pkg","process","env","INIT_CWD","cwd","console","log","compilerOptions","getCompilerOptions","declaration","emitDeclarationOnly","outDir","removeComments","skipDefaultLibCheck","skipLibCheck","sourceMap","files","buildEntries","result","createProgramFromConfig","basePath","exclude","emit","diagResults","diagnostics","length","diag","category","DiagnosticCategory","Error","error","chalk","red","messageText","grey","blue","file","fileName","Warning","yellow","Suggestion","white","compileFolder","folder","entryMode","options","types","verbose","outDir","entry","buildEntries","optionsResult","defineConfig","bundle","cjsInterop","clean","dts","format","silent","sourcemap","splitting","tsconfig","optionsList","Promise","all","Array","isArray","flatMap","result","flat","map","build","packageCompileTscTypes","packageCompileTsup","config","console","warn","compile","publint","log","depth","compileForNode","node","src","compileForBrowser","browser","compileForNeutral","neutral","standardLoaders","standardOptions","loader","outExtension","js","skipNodeModulesBundle","target","Object","entries","inEsBuildOptions","esbuildOptions","platform","tsup","reduce","prev","value","packagePublint","packageCompile","inConfig","types","pkg","process","env","INIT_CWD","console","log","chalk","green","config","loadConfig","publint","mode","compile","result","packageCompileTsc","undefined","packageCompileTsup","packagePublint"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/compile.ts","../../../../src/lib/loadConfig.ts","../../../../src/actions/package/publint.ts","../../../../src/actions/package/compile/packageCompileTsc.ts","../../../../src/actions/package/compile/getCompilerOptions.ts","../../../../src/actions/package/compile/packageCompileTsup.ts","../../../../src/actions/package/compile/inputs.ts","../../../../src/actions/package/compile/buildEntries.ts","../../../../src/actions/package/compile/packageCompileTscTypes.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { loadConfig } from '../../../lib/index.ts'\nimport { packagePublint } from '../publint.ts'\nimport { packageCompileTsc } from './packageCompileTsc.ts'\nimport { packageCompileTsup } from './packageCompileTsup.ts'\nimport type {\n XyConfig, XyTscConfig, XyTsupConfig,\n} from './XyConfig.ts'\n\nexport const packageCompile = async (inConfig: XyConfig = {}, types?: 'tsc' | 'tsup'): Promise<number> => {\n const pkg = process.env.INIT_CWD\n console.log(chalk.green(`Compiling ${pkg}`))\n const config = await loadConfig(inConfig)\n const publint = config.publint\n\n const mode = config.compile?.mode ?? 'tsup'\n let result: number = 0\n switch (mode) {\n case 'tsc': {\n result += await packageCompileTsc(undefined, config as XyTscConfig)\n break\n }\n case 'tsup': {\n result += await packageCompileTsup(config as XyTsupConfig, types)\n break\n }\n }\n return result + (publint ? await packagePublint(config) : 0)\n}\n","import chalk from 'chalk'\nimport { cosmiconfig } from 'cosmiconfig'\nimport deepmerge from 'deepmerge'\n\nlet config: Record<string, unknown>\n\nexport const loadConfig = async <T extends object>(params?: T): Promise<T> => {\n if (config) {\n return deepmerge(config, params ?? {}) as T\n }\n\n const cosmicConfigResult = await cosmiconfig('xy', { cache: true }).search()\n config = cosmicConfigResult?.config\n const configFilePath = cosmicConfigResult?.filepath\n if (configFilePath) {\n console.log(chalk.gray(`Loading config from ${configFilePath}`))\n }\n return deepmerge(config, params ?? {}) as T\n}\n","import { promises as fs } from 'node:fs'\n\nimport chalk from 'chalk'\nimport type { Message } from 'publint'\nimport sortPackageJson from 'sort-package-json'\n\nexport interface PackagePublintParams { verbose?: boolean }\n\nexport const packagePublint = async (params?: PackagePublintParams) => {\n const pkgDir = process.env.INIT_CWD\n\n const sortedPkg = sortPackageJson(await fs.readFile(`${pkgDir}/package.json`, 'utf8'))\n await fs.writeFile(`${pkgDir}/package.json`, sortedPkg)\n\n const pkg = JSON.parse(await fs.readFile(`${pkgDir}/package.json`, 'utf8'))\n\n console.log(chalk.green(`Publint: ${pkg.name}`))\n console.log(chalk.gray(pkgDir))\n\n const { publint } = await import('publint')\n\n const { messages } = await publint({\n level: 'suggestion',\n pkgDir,\n strict: true,\n })\n\n // eslint-disable-next-line import-x/no-internal-modules\n const { formatMessage } = await import('publint/utils')\n\n const validMessage = (_message: Message): boolean => {\n return true\n /* try {\n const value = getValueFromPath(pkg, message.path)\n switch (message.code) {\n case 'FILE_INVALID_FORMAT':\n return !message.args?.actualFilePath?.includes('dist/browser') && !value?.includes('dist/browser')\n case 'EXPORT_TYPES_INVALID_FORMAT':\n return !`${value}`.includes('dist/browser')\n default:\n return true\n }\n } catch (ex) {\n const error = ex as Error\n console.error(chalk.red(`validMessage Excepted: ${error.message}`))\n console.error(chalk.gray(JSON.stringify(error.stack)))\n return true\n } */\n }\n\n // we filter out invalid file formats for the esm folder since it is intentionally done\n const validMessages = messages.filter(validMessage)\n for (const message of validMessages) {\n switch (message.type) {\n case 'error': {\n console.error(chalk.red(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n case 'warning': {\n console.warn(chalk.yellow(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n default: {\n console.log(chalk.white(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n }\n }\n\n if (params?.verbose) {\n console.log(chalk.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`))\n }\n\n return validMessages.filter(message => message.type === 'error').length\n}\n","import { cwd } from 'node:process'\n\nimport chalk from 'chalk'\nimport type { TsConfigCompilerOptions } from 'tsc-prog'\nimport { createProgramFromConfig } from 'tsc-prog'\nimport type {\n CompilerOptions,\n FormatDiagnosticsHost,\n LineAndCharacter,\n} from 'typescript'\nimport {\n DiagnosticCategory,\n formatDiagnosticsWithColorAndContext,\n getLineAndCharacterOfPosition,\n getPreEmitDiagnostics,\n} from 'typescript'\n\nimport { packagePublint } from '../publint.ts'\nimport { getCompilerOptions } from './getCompilerOptions.ts'\nimport type { XyTscConfig } from './XyConfig.ts'\n\nexport const packageCompileTsc = async (noEmit?: boolean, config?: XyTscConfig, compilerOptionsParam?: CompilerOptions): Promise<number> => {\n const pkg = process.env.INIT_CWD ?? cwd()\n\n const publint = config?.publint ?? true\n const verbose = config?.verbose ?? false\n\n const formatHost: FormatDiagnosticsHost = {\n getCanonicalFileName: fileName => fileName,\n getCurrentDirectory: () => pkg,\n getNewLine: () => '\\n',\n }\n\n if (verbose) {\n console.log(`Compiling with NoEmit TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...(getCompilerOptions({\n outDir: 'dist',\n removeComments: true,\n rootDir: 'src',\n })),\n ...compilerOptionsParam,\n ...(noEmit === undefined ? {} : { noEmit }),\n } as TsConfigCompilerOptions\n\n const program = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n })\n\n const results = getPreEmitDiagnostics(program)\n\n for (const diag of results) {\n const lineAndChar: LineAndCharacter = diag.file\n ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0)\n : { character: 0, line: 0 }\n console.log(chalk.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`))\n console.log(formatDiagnosticsWithColorAndContext([diag], formatHost))\n }\n\n // eslint-disable-next-line unicorn/no-array-reduce\n return results.reduce((prev, diag) => (prev + diag.category === DiagnosticCategory.Error ? 1 : 0), 0) || (publint ? await packagePublint() : 0)\n}\n","import { createRequire } from 'node:module'\n\nimport deepmerge from 'deepmerge'\nimport type { TsConfig } from 'tsc-prog'\nimport type { CompilerOptions } from 'typescript'\nimport {\n findConfigFile, readConfigFile, sys,\n} from 'typescript'\n\nconst getNested = (config: TsConfig): CompilerOptions => {\n if (config.extends) {\n const require = createRequire(import.meta.url)\n const opts = require(config.extends)\n return deepmerge(getNested(opts), config.compilerOptions ?? {}) as CompilerOptions\n }\n\n return config.compilerOptions as CompilerOptions\n}\n\nexport const getCompilerOptionsJSONFollowExtends = (filename: string): CompilerOptions => {\n const config = readConfigFile(filename, sys.readFile).config\n return getNested(config)\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 deepmerge(configFileCompilerOptions, options)\n}\n","import type { Loader } from 'esbuild'\nimport type { Options } from 'tsup'\nimport { build, defineConfig } from 'tsup'\n\nimport { packagePublint } from '../publint.ts'\nimport { buildEntries } from './buildEntries.ts'\nimport { packageCompileTscTypes } from './packageCompileTscTypes.ts'\nimport type { EntryMode, XyTsupConfig } from './XyConfig.ts'\n\nconst compileFolder = async (\n folder: string,\n entryMode: EntryMode = 'single',\n options?: Options,\n types: 'tsc' | 'tsup' = 'tsup',\n verbose?: boolean,\n): Promise<number> => {\n const outDir = options?.outDir ?? 'dist'\n const entry = buildEntries(folder, entryMode)\n const optionsResult = defineConfig({\n bundle: true,\n cjsInterop: true,\n clean: true,\n dts: true,\n entry,\n format: ['esm'],\n outDir,\n silent: true,\n sourcemap: types === 'tsup',\n splitting: false,\n tsconfig: 'tsconfig.json',\n ...options,\n })\n const optionsList = (\n await Promise.all(\n (Array.isArray(optionsResult) ? optionsResult : [optionsResult]).flatMap<Promise<Options[]>>(async (options) => {\n const result = typeof options === 'function' ? await options({}) : [options]\n return Array.isArray(result) ? result : [result]\n }),\n )\n ).flat()\n\n await Promise.all(optionsList.map(options => build(options)))\n if (types === 'tsc') {\n return packageCompileTscTypes(folder, { verbose }, { outDir })\n }\n return 0\n}\n\n// eslint-disable-next-line complexity\nexport const packageCompileTsup = async (config?: XyTsupConfig, types: 'tsc' | 'tsup' = 'tsup') => {\n console.warn('packageCompileTsup-types', types)\n const compile = config?.compile\n const publint = config?.publint ?? true\n const verbose = config?.verbose ?? false\n if (verbose) {\n console.log(`Compiling with TSUP [Depth: ${compile?.depth}]`)\n }\n\n const compileForNode = compile?.node ?? { src: {} }\n const compileForBrowser = compile?.browser ?? { src: {} }\n const compileForNeutral = compile?.neutral ?? { src: {} }\n\n const standardLoaders: Record<string, Loader> = {\n '.gif': 'copy', '.html': 'copy', '.jpg': 'copy', '.json': 'json', '.png': 'copy', '.svg': 'copy', '.webp': 'copy',\n }\n const standardOptions: Options = {\n bundle: true,\n format: ['esm'],\n loader: standardLoaders,\n outExtension: ({ format }) => (format === 'esm' ? { js: '.mjs' } : { js: '.cjs' }),\n skipNodeModulesBundle: true,\n sourcemap: true,\n target: 'esnext',\n }\n\n return (\n (\n await Promise.all(\n Object.entries(compileForNode).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.node?.esbuildOptions === 'object' ? compile?.node?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n {\n ...standardOptions,\n loader: {\n ...standardOptions.loader,\n ...inEsBuildOptions?.loader,\n },\n outDir: 'dist/node',\n platform: 'node',\n ...compile?.tsup?.options,\n ...(typeof options === 'object' ? options : {}),\n },\n types,\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || (\n await Promise.all(\n Object.entries(compileForBrowser).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.browser?.esbuildOptions === 'object' ? compile?.browser?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n {\n ...standardOptions,\n loader: {\n ...standardOptions.loader,\n ...inEsBuildOptions?.loader,\n },\n outDir: 'dist/browser',\n platform: 'browser',\n ...compile?.tsup?.options,\n ...(typeof options === 'object' ? options : {}),\n },\n types,\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || (\n await Promise.all(\n Object.entries(compileForNeutral).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.neutral?.esbuildOptions === 'object' ? compile?.neutral?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n {\n ...standardOptions,\n loader: {\n ...standardOptions.loader,\n ...inEsBuildOptions?.loader,\n },\n outDir: 'dist/neutral',\n platform: 'neutral',\n ...compile?.tsup?.options,\n ...(typeof options === 'object' ? options : {}),\n },\n types,\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || (publint ? await packagePublint() : 0)\n )\n}\n","import { readdir } from 'node:fs/promises'\n\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 > 0) {\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 = (folder: string) => {\n /* tsup wants posix paths */\n return glob.sync(`${folder}/**/*.*`, { ignore: ['**/*.spec.*', '**/*.stories.*', '**/spec/**/*'], posix: true })\n}\n","import { getAllInputs2 } from './inputs.ts'\nimport type { EntryMode } from './XyConfig.ts'\n\nexport const buildEntries = (folder: string, entryMode?: EntryMode, verbose = false) => {\n switch (entryMode) {\n case 'platform': {\n if (verbose) console.log('buildEntries [platform]')\n return [`${folder}/index-node.ts`, `${folder}/index-browser.ts`]\n }\n case 'all': {\n if (verbose) console.log('buildEntries [all]')\n return getAllInputs2(folder).filter(entry => !entry.includes('.spec.') && !entry.includes('.story.'))\n }\n default: {\n if (verbose) console.log('buildEntries [single]')\n return [`${folder}/index.ts`]\n }\n }\n}\n","import { cwd } from 'node:process'\n\nimport chalk from 'chalk'\nimport type { TsConfigCompilerOptions } from 'tsc-prog'\nimport { createProgramFromConfig } from 'tsc-prog'\nimport type { CompilerOptions } from 'typescript'\nimport { DiagnosticCategory } from 'typescript'\n\nimport { buildEntries } from './buildEntries.ts'\nimport { getCompilerOptions } from './getCompilerOptions.ts'\nimport type { XyConfig } from './XyConfig.ts'\n\nexport const packageCompileTscTypes = (\n folder: string = 'src',\n { verbose }: XyConfig = {},\n compilerOptionsParam?: CompilerOptions,\n): number => {\n const pkg = process.env.INIT_CWD ?? cwd()\n\n if (verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...(getCompilerOptions({\n declaration: true,\n emitDeclarationOnly: true,\n outDir: 'dist',\n removeComments: true,\n skipDefaultLibCheck: true,\n skipLibCheck: true,\n sourceMap: true,\n })),\n ...compilerOptionsParam,\n } as TsConfigCompilerOptions\n\n // calling all here since the types do not get rolled up\n const files = buildEntries(folder, 'all')\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n files,\n }).emit()\n\n const diagResults = result.diagnostics.length\n for (const diag of result.diagnostics) {\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 }\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 }\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 }\n return diagResults\n}\n"],"mappings":";;;;AAAA,OAAOA,YAAW;;;ACAlB,OAAOC,WAAW;AAClB,SAASC,mBAAmB;AAC5B,OAAOC,eAAe;AAEtB,IAAIC;AAEG,IAAMC,aAAa,8BAAyBC,WAAAA;AACjD,MAAIF,QAAQ;AACV,WAAOG,UAAUH,QAAQE,UAAU,CAAC,CAAA;EACtC;AAEA,QAAME,qBAAqB,MAAMC,YAAY,MAAM;IAAEC,OAAO;EAAK,CAAA,EAAGC,OAAM;AAC1EP,WAASI,oBAAoBJ;AAC7B,QAAMQ,iBAA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OC,QAAQV,iBAAAA,EAAmBhB,IAAI,OAAO,CAAC3B,QAAQE,OAAAA,MAAQ;AAC5D,UAAMoD,mBAAmB,OAAOpB,SAASU,SAASW,mBAAmB,WAAWrB,SAASU,SAASW,iBAAiB,CAAC;AACpH,WAAOvD,SACH,MAAMD,cACNC,QACAkC,SAASjC,WACT;MACE,GAAG6C;MACHC,QAAQ;QACN,GAAGD,gBAAgBC;QACnB,GAAGO,kBAAkBP;MACvB;MACA1C,QAAQ;MACRmD,UAAU;MACV,GAAGtB,SAASuB,MAAMvD;MAClB,GAAI,OAAOA,YAAY,WAAWA,UAAU,CAAC;IAC/C,GACAC,OACAC,OAAAA,IAEA;EACN,CAAA,CAAA,GAEFsD,OAAO,CAACC,MAAMC,UAAUD,OAAOC,OAAO,CAAA,MACpCzB,UAAU,MAAM0B,eAAAA,IAAmB;AAE3C,GA3GkC;;;ALvC3B,IAAMC,iBAAiB,8BAAOC,WAAqB,CAAC,GAAGC,UAAAA;AAC5D,QAAMC,MAAMC,QAAQC,IAAIC;AACxBC,UAAQC,IAAIC,OAAMC,MAAM,aAAaP,GAAAA,EAAK,CAAA;AAC1C,QAAMQ,UAAS,MAAMC,WAAWX,QAAAA;AAChC,QAAMY,UAAUF,QAAOE;AAEvB,QAAMC,OAAOH,QAAOI,SAASD,QAAQ;AACrC,MAAIE,SAAiB;AACrB,UAAQF,MAAAA;IACN,KAAK,OAAO;AACVE,gBAAU,MAAMC,kBAAkBC,QAAWP,OAAAA;AAC7C;IACF;IACA,KAAK,QAAQ;AACXK,gBAAU,MAAMG,mBAAmBR,SAAwBT,KAAAA;AAC3D;IACF;EACF;AACA,SAAOc,UAAUH,UAAU,MAAMO,eAAeT,OAAAA,IAAU;AAC5D,GAnB8B;","names":["chalk","chalk","cosmiconfig","deepmerge","config","loadConfig","params","deepmerge","cosmicConfigResult","cosmiconfig","cache","search","configFilePath","filepath","console","log","chalk","gray","promises","fs","chalk","sortPackageJson","packagePublint","params","pkgDir","process","env","INIT_CWD","sortedPkg","sortPackageJson","fs","readFile","writeFile","pkg","JSON","parse","console","log","chalk","green","name","gray","publint","messages","level","strict","formatMessage","validMessage","_message","validMessages","filter","message","type","error","red","code","warn","yellow","white","verbose","length","cwd","chalk","createProgramFromConfig","DiagnosticCategory","formatDiagnosticsWithColorAndContext","getLineAndCharacterOfPosition","getPreEmitDiagnostics","createRequire","deepmerge","findConfigFile","readConfigFile","sys","getNested","config","extends","require","createRequire","url","opts","deepmerge","compilerOptions","getCompilerOptionsJSONFollowExtends","filename","readConfigFile","sys","readFile","getCompilerOptions","options","tsconfig","configFileName","findConfigFile","fileExists","configFileCompilerOptions","undefined","packageCompileTsc","noEmit","config","compilerOptionsParam","pkg","process","env","INIT_CWD","cwd","publint","verbose","formatHost","getCanonicalFileName","fileName","getCurrentDirectory","getNewLine","console","log","compilerOptions","getCompilerOptions","outDir","removeComments","rootDir","undefined","program","createProgramFromConfig","basePath","exclude","include","results","getPreEmitDiagnostics","diag","lineAndChar","file","getLineAndCharacterOfPosition","start","character","line","chalk","cyan","formatDiagnosticsWithColorAndContext","reduce","prev","category","DiagnosticCategory","Error","packagePublint","build","defineConfig","glob","getAllInputs2","folder","glob","sync","ignore","posix","buildEntries","folder","entryMode","verbose","console","log","getAllInputs2","filter","entry","includes","cwd","chalk","createProgramFromConfig","DiagnosticCategory","packageCompileTscTypes","folder","verbose","compilerOptionsParam","pkg","process","env","INIT_CWD","cwd","console","log","compilerOptions","getCompilerOptions","declaration","emitDeclarationOnly","outDir","removeComments","skipDefaultLibCheck","skipLibCheck","sourceMap","files","buildEntries","result","createProgramFromConfig","basePath","exclude","emit","diagResults","diagnostics","length","diag","category","DiagnosticCategory","Error","error","chalk","red","messageText","grey","blue","file","fileName","Warning","yellow","Suggestion","white","compileFolder","folder","entryMode","options","types","verbose","outDir","entry","buildEntries","optionsResult","defineConfig","bundle","cjsInterop","clean","dts","format","silent","sourcemap","splitting","tsconfig","optionsList","Promise","all","Array","isArray","flatMap","result","flat","map","build","packageCompileTscTypes","packageCompileTsup","config","console","warn","compile","publint","log","depth","compileForNode","node","src","compileForBrowser","browser","compileForNeutral","neutral","standardLoaders","standardOptions","loader","outExtension","js","skipNodeModulesBundle","target","Object","entries","inEsBuildOptions","esbuildOptions","platform","tsup","reduce","prev","value","packagePublint","packageCompile","inConfig","types","pkg","process","env","INIT_CWD","console","log","chalk","green","config","loadConfig","publint","mode","compile","result","packageCompileTsc","undefined","packageCompileTsup","packagePublint"]}
|
|
@@ -1,155 +1,15 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
|
|
28
|
-
// ../../node_modules/deepmerge/dist/cjs.js
|
|
29
|
-
var require_cjs = __commonJS({
|
|
30
|
-
"../../node_modules/deepmerge/dist/cjs.js"(exports, module) {
|
|
31
|
-
"use strict";
|
|
32
|
-
var isMergeableObject = /* @__PURE__ */ __name(function isMergeableObject2(value) {
|
|
33
|
-
return isNonNullObject(value) && !isSpecial(value);
|
|
34
|
-
}, "isMergeableObject");
|
|
35
|
-
function isNonNullObject(value) {
|
|
36
|
-
return !!value && typeof value === "object";
|
|
37
|
-
}
|
|
38
|
-
__name(isNonNullObject, "isNonNullObject");
|
|
39
|
-
function isSpecial(value) {
|
|
40
|
-
var stringValue = Object.prototype.toString.call(value);
|
|
41
|
-
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
42
|
-
}
|
|
43
|
-
__name(isSpecial, "isSpecial");
|
|
44
|
-
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
45
|
-
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
46
|
-
function isReactElement(value) {
|
|
47
|
-
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
48
|
-
}
|
|
49
|
-
__name(isReactElement, "isReactElement");
|
|
50
|
-
function emptyTarget(val) {
|
|
51
|
-
return Array.isArray(val) ? [] : {};
|
|
52
|
-
}
|
|
53
|
-
__name(emptyTarget, "emptyTarget");
|
|
54
|
-
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
55
|
-
return options.clone !== false && options.isMergeableObject(value) ? deepmerge2(emptyTarget(value), value, options) : value;
|
|
56
|
-
}
|
|
57
|
-
__name(cloneUnlessOtherwiseSpecified, "cloneUnlessOtherwiseSpecified");
|
|
58
|
-
function defaultArrayMerge(target, source, options) {
|
|
59
|
-
return target.concat(source).map(function(element) {
|
|
60
|
-
return cloneUnlessOtherwiseSpecified(element, options);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
__name(defaultArrayMerge, "defaultArrayMerge");
|
|
64
|
-
function getMergeFunction(key, options) {
|
|
65
|
-
if (!options.customMerge) {
|
|
66
|
-
return deepmerge2;
|
|
67
|
-
}
|
|
68
|
-
var customMerge = options.customMerge(key);
|
|
69
|
-
return typeof customMerge === "function" ? customMerge : deepmerge2;
|
|
70
|
-
}
|
|
71
|
-
__name(getMergeFunction, "getMergeFunction");
|
|
72
|
-
function getEnumerableOwnPropertySymbols(target) {
|
|
73
|
-
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
74
|
-
return Object.propertyIsEnumerable.call(target, symbol);
|
|
75
|
-
}) : [];
|
|
76
|
-
}
|
|
77
|
-
__name(getEnumerableOwnPropertySymbols, "getEnumerableOwnPropertySymbols");
|
|
78
|
-
function getKeys(target) {
|
|
79
|
-
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
80
|
-
}
|
|
81
|
-
__name(getKeys, "getKeys");
|
|
82
|
-
function propertyIsOnObject(object, property) {
|
|
83
|
-
try {
|
|
84
|
-
return property in object;
|
|
85
|
-
} catch (_) {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
__name(propertyIsOnObject, "propertyIsOnObject");
|
|
90
|
-
function propertyIsUnsafe(target, key) {
|
|
91
|
-
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
92
|
-
}
|
|
93
|
-
__name(propertyIsUnsafe, "propertyIsUnsafe");
|
|
94
|
-
function mergeObject(target, source, options) {
|
|
95
|
-
var destination = {};
|
|
96
|
-
if (options.isMergeableObject(target)) {
|
|
97
|
-
getKeys(target).forEach(function(key) {
|
|
98
|
-
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
getKeys(source).forEach(function(key) {
|
|
102
|
-
if (propertyIsUnsafe(target, key)) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
106
|
-
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
107
|
-
} else {
|
|
108
|
-
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
return destination;
|
|
112
|
-
}
|
|
113
|
-
__name(mergeObject, "mergeObject");
|
|
114
|
-
function deepmerge2(target, source, options) {
|
|
115
|
-
options = options || {};
|
|
116
|
-
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
117
|
-
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
118
|
-
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
119
|
-
var sourceIsArray = Array.isArray(source);
|
|
120
|
-
var targetIsArray = Array.isArray(target);
|
|
121
|
-
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
122
|
-
if (!sourceAndTargetTypesMatch) {
|
|
123
|
-
return cloneUnlessOtherwiseSpecified(source, options);
|
|
124
|
-
} else if (sourceIsArray) {
|
|
125
|
-
return options.arrayMerge(target, source, options);
|
|
126
|
-
} else {
|
|
127
|
-
return mergeObject(target, source, options);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
__name(deepmerge2, "deepmerge");
|
|
131
|
-
deepmerge2.all = /* @__PURE__ */ __name(function deepmergeAll(array, options) {
|
|
132
|
-
if (!Array.isArray(array)) {
|
|
133
|
-
throw new Error("first argument should be an array");
|
|
134
|
-
}
|
|
135
|
-
return array.reduce(function(prev, next) {
|
|
136
|
-
return deepmerge2(prev, next, options);
|
|
137
|
-
}, {});
|
|
138
|
-
}, "deepmergeAll");
|
|
139
|
-
var deepmerge_1 = deepmerge2;
|
|
140
|
-
module.exports = deepmerge_1;
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
3
|
|
|
144
4
|
// src/actions/package/compile/getCompilerOptions.ts
|
|
145
|
-
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
146
5
|
import { createRequire } from "node:module";
|
|
6
|
+
import deepmerge from "deepmerge";
|
|
147
7
|
import { findConfigFile, readConfigFile, sys } from "typescript";
|
|
148
8
|
var getNested = /* @__PURE__ */ __name((config) => {
|
|
149
9
|
if (config.extends) {
|
|
150
10
|
const require2 = createRequire(import.meta.url);
|
|
151
11
|
const opts = require2(config.extends);
|
|
152
|
-
return (
|
|
12
|
+
return deepmerge(getNested(opts), config.compilerOptions ?? {});
|
|
153
13
|
}
|
|
154
14
|
return config.compilerOptions;
|
|
155
15
|
}, "getNested");
|
|
@@ -160,7 +20,7 @@ var getCompilerOptionsJSONFollowExtends = /* @__PURE__ */ __name((filename) => {
|
|
|
160
20
|
var getCompilerOptions = /* @__PURE__ */ __name((options = {}, tsconfig = "tsconfig.json") => {
|
|
161
21
|
const configFileName = findConfigFile("./", sys.fileExists, tsconfig);
|
|
162
22
|
const configFileCompilerOptions = (configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0) ?? {};
|
|
163
|
-
return (
|
|
23
|
+
return deepmerge(configFileCompilerOptions, options);
|
|
164
24
|
}, "getCompilerOptions");
|
|
165
25
|
export {
|
|
166
26
|
getCompilerOptions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../node_modules/deepmerge/dist/cjs.js","../../../../src/actions/package/compile/getCompilerOptions.ts"],"sourcesContent":["'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","import { createRequire } from 'node:module'\n\nimport deepmerge from 'deepmerge'\nimport type { TsConfig } from 'tsc-prog'\nimport type { CompilerOptions } from 'typescript'\nimport {\n findConfigFile, readConfigFile, sys,\n} from 'typescript'\n\nconst getNested = (config: TsConfig): CompilerOptions => {\n if (config.extends) {\n const require = createRequire(import.meta.url)\n const opts = require(config.extends)\n return deepmerge(getNested(opts), config.compilerOptions ?? {}) as CompilerOptions\n }\n\n return config.compilerOptions as CompilerOptions\n}\n\nexport const getCompilerOptionsJSONFollowExtends = (filename: string): CompilerOptions => {\n const config = readConfigFile(filename, sys.readFile).config\n return getNested(config)\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 deepmerge(configFileCompilerOptions, options)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;AAEA,QAAIA,oBAAoB,gCAASA,mBAAkBC,OAAK;AACvD,aAAOC,gBAAgBD,KAAAA,KACnB,CAACE,UAAUF,KAAAA;IAChB,GAHwB;AAKxB,aAASC,gBAAgBD,OAAK;AAC7B,aAAO,CAAC,CAACA,SAAS,OAAOA,UAAU;IACpC;AAFSC;AAIT,aAASC,UAAUF,OAAK;AACvB,UAAIG,cAAcC,OAAOC,UAAUC,SAASC,KAAKP,KAAAA;AAEjD,aAAOG,gBAAgB,qBACnBA,gBAAgB,mBAChBK,eAAeR,KAAAA;IACpB;AANSE;AAST,QAAIO,eAAe,OAAOC,WAAW,cAAcA,OAAOC;AAC1D,QAAIC,qBAAqBH,eAAeC,OAAOC,IAAI,eAAA,IAAmB;AAEtE,aAASH,eAAeR,OAAK;AAC5B,aAAOA,MAAMa,aAAaD;IAC3B;AAFSJ;AAIT,aAASM,YAAYC,KAAG;AACvB,aAAOC,MAAMC,QAAQF,GAAAA,IAAO,CAAA,IAAK,CAAC;IACnC;AAFSD;AAIT,aAASI,8BAA8BlB,OAAOmB,SAAO;AACpD,aAAQA,QAAQC,UAAU,SAASD,QAAQpB,kBAAkBC,KAAAA,IAC1DqB,WAAUP,YAAYd,KAAAA,GAAQA,OA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AMtC,OAAAA;MAC9B,GAAG,CAAC,CAAA;IACL,GARgB;AAUhB,QAAIuC,cAAcrC;AAElBsC,WAAOC,UAAUF;;;;;AClIjB,uBAAsB;AAFtB,SAASG,qBAAqB;AAK9B,SACEC,gBAAgBC,gBAAgBC,WAC3B;AAEP,IAAMC,YAAY,wBAACC,WAAAA;AACjB,MAAIA,OAAOC,SAAS;AAClB,UAAMC,WAAUC,cAAc,YAAYC,GAAG;AAC7C,UAAMC,OAAOH,SAAQF,OAAOC,OAAO;AACnC,eAAOK,iBAAAA,SAAUP,UAAUM,IAAAA,GAAOL,OAAOO,mBAAmB,CAAC,CAAA;EAC/D;AAEA,SAAOP,OAAOO;AAChB,GARkB;AAUX,IAAMC,sCAAsC,wBAACC,aAAAA;AAClD,QAAMT,SAASU,eAAeD,UAAUE,IAAIC,QAAQ,EAAEZ;AACtD,SAAOD,UAAUC,MAAAA;AACnB,GAHmD;AAK5C,IAAMa,qBAAqB,wBAACC,UAA2B,CAAC,GAAGC,WAAmB,oBAAe;AAClG,QAAMC,iBAAiBC,eAAe,MAAMN,IAAIO,YAAYH,QAAAA;AAC5D,QAAMI,6BAA6BH,iBAAiBR,oCAAoCQ,cAAAA,IAAkBI,WAAc,CAAC;AAEzH,aAAOd,iBAAAA,SAAUa,2BAA2BL,OAAAA;AAC9C,GALkC;","names":["isMergeableObject","value","isNonNullObject","isSpecial","stringValue","Object","prototype","toString","call","isReactElement","canUseSymbol","Symbol","for","REACT_ELEMENT_TYPE","$$typeof","emptyTarget","val","Array","isArray","cloneUnlessOtherwiseSpecified","options","clone","deepmerge","defaultArrayMerge","target","source","concat","map","element","getMergeFunction","key","customMerge","getEnumerableOwnPropertySymbols","getOwnPropertySymbols","filter","symbol","propertyIsEnumerable","getKeys","keys","propertyIsOnObject","object","property","_","propertyIsUnsafe","hasOwnProperty","mergeObject","destination","forEach","arrayMerge","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","all","deepmergeAll","array","Error","reduce","prev","next","deepmerge_1","module","exports","createRequire","findConfigFile","readConfigFile","sys","getNested","config","extends","require","createRequire","url","opts","deepmerge","compilerOptions","getCompilerOptionsJSONFollowExtends","filename","readConfigFile","sys","readFile","getCompilerOptions","options","tsconfig","configFileName","findConfigFile","fileExists","configFileCompilerOptions","undefined"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/getCompilerOptions.ts"],"sourcesContent":["import { createRequire } from 'node:module'\n\nimport deepmerge from 'deepmerge'\nimport type { TsConfig } from 'tsc-prog'\nimport type { CompilerOptions } from 'typescript'\nimport {\n findConfigFile, readConfigFile, sys,\n} from 'typescript'\n\nconst getNested = (config: TsConfig): CompilerOptions => {\n if (config.extends) {\n const require = createRequire(import.meta.url)\n const opts = require(config.extends)\n return deepmerge(getNested(opts), config.compilerOptions ?? {}) as CompilerOptions\n }\n\n return config.compilerOptions as CompilerOptions\n}\n\nexport const getCompilerOptionsJSONFollowExtends = (filename: string): CompilerOptions => {\n const config = readConfigFile(filename, sys.readFile).config\n return getNested(config)\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 deepmerge(configFileCompilerOptions, options)\n}\n"],"mappings":";;;;AAAA,SAASA,qBAAqB;AAE9B,OAAOC,eAAe;AAGtB,SACEC,gBAAgBC,gBAAgBC,WAC3B;AAEP,IAAMC,YAAY,wBAACC,WAAAA;AACjB,MAAIA,OAAOC,SAAS;AAClB,UAAMC,WAAUC,cAAc,YAAYC,GAAG;AAC7C,UAAMC,OAAOH,SAAQF,OAAOC,OAAO;AACnC,WAAOK,UAAUP,UAAUM,IAAAA,GAAOL,OAAOO,mBAAmB,CAAC,CAAA;EAC/D;AAEA,SAAOP,OAAOO;AAChB,GARkB;AAUX,IAAMC,sCAAsC,wBAACC,aAAAA;AAClD,QAAMT,SAASU,eAAeD,UAAUE,IAAIC,QAAQ,EAAEZ;AACtD,SAAOD,UAAUC,MAAAA;AACnB,GAHmD;AAK5C,IAAMa,qBAAqB,wBAACC,UAA2B,CAAC,GAAGC,WAAmB,oBAAe;AAClG,QAAMC,iBAAiBC,eAAe,MAAMN,IAAIO,YAAYH,QAAAA;AAC5D,QAAMI,6BAA6BH,iBAAiBR,oCAAoCQ,cAAAA,IAAkBI,WAAc,CAAC;AAEzH,SAAOd,UAAUa,2BAA2BL,OAAAA;AAC9C,GALkC;","names":["createRequire","deepmerge","findConfigFile","readConfigFile","sys","getNested","config","extends","require","createRequire","url","opts","deepmerge","compilerOptions","getCompilerOptionsJSONFollowExtends","filename","readConfigFile","sys","readFile","getCompilerOptions","options","tsconfig","configFileName","findConfigFile","fileExists","configFileCompilerOptions","undefined"]}
|