@storm-software/workspace-tools 1.45.1 → 1.45.2
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/CHANGELOG.md +7 -0
- package/index.js +286 -247
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +246 -206
- package/src/executors/design-tokens/executor.js +259 -219
- package/src/executors/tsup/executor.js +261 -222
- package/src/executors/tsup-browser/executor.js +261 -222
- package/src/executors/tsup-neutral/executor.js +261 -222
- package/src/executors/tsup-node/executor.js +261 -222
- package/src/executors/typia/executor.js +250 -210
- package/src/generators/browser-library/generator.js +246 -206
- package/src/generators/config-schema/generator.js +244 -204
- package/src/generators/neutral-library/generator.js +246 -206
- package/src/generators/node-library/generator.js +246 -206
- package/src/generators/preset/generator.js +244 -204
package/index.js
CHANGED
|
@@ -34308,7 +34308,7 @@ var require_jsonfile = __commonJS({
|
|
|
34308
34308
|
return obj;
|
|
34309
34309
|
}
|
|
34310
34310
|
var readFile = universalify.fromPromise(_readFile);
|
|
34311
|
-
function
|
|
34311
|
+
function readFileSync4(file, options = {}) {
|
|
34312
34312
|
if (typeof options === "string") {
|
|
34313
34313
|
options = { encoding: options };
|
|
34314
34314
|
}
|
|
@@ -34340,7 +34340,7 @@ var require_jsonfile = __commonJS({
|
|
|
34340
34340
|
}
|
|
34341
34341
|
var jsonfile = {
|
|
34342
34342
|
readFile,
|
|
34343
|
-
readFileSync:
|
|
34343
|
+
readFileSync: readFileSync4,
|
|
34344
34344
|
writeFile: writeFile2,
|
|
34345
34345
|
writeFileSync: writeFileSync3
|
|
34346
34346
|
};
|
|
@@ -46989,7 +46989,7 @@ var require_lib6 = __commonJS({
|
|
|
46989
46989
|
function _interopRequireDefault(obj) {
|
|
46990
46990
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
46991
46991
|
}
|
|
46992
|
-
var
|
|
46992
|
+
var readFileSync4 = (fp) => {
|
|
46993
46993
|
return _fs.default.readFileSync(fp, "utf8");
|
|
46994
46994
|
};
|
|
46995
46995
|
var pathExists = (fp) => new Promise((resolve) => {
|
|
@@ -47113,7 +47113,7 @@ var require_lib6 = __commonJS({
|
|
|
47113
47113
|
if (this.packageJsonCache.has(filepath2)) {
|
|
47114
47114
|
return this.packageJsonCache.get(filepath2)[options.packageKey];
|
|
47115
47115
|
}
|
|
47116
|
-
const data2 = this.options.parseJSON(
|
|
47116
|
+
const data2 = this.options.parseJSON(readFileSync4(filepath2));
|
|
47117
47117
|
return data2;
|
|
47118
47118
|
}
|
|
47119
47119
|
};
|
|
@@ -47147,7 +47147,7 @@ var require_lib6 = __commonJS({
|
|
|
47147
47147
|
if (this.packageJsonCache.has(filepath2)) {
|
|
47148
47148
|
return this.packageJsonCache.get(filepath2)[options.packageKey];
|
|
47149
47149
|
}
|
|
47150
|
-
const data2 = this.options.parseJSON(
|
|
47150
|
+
const data2 = this.options.parseJSON(readFileSync4(filepath2));
|
|
47151
47151
|
return data2;
|
|
47152
47152
|
}
|
|
47153
47153
|
};
|
|
@@ -73213,7 +73213,7 @@ var require_util5 = __commonJS({
|
|
|
73213
73213
|
var normalize2 = createSafeHandler((url) => {
|
|
73214
73214
|
});
|
|
73215
73215
|
exports.normalize = normalize2;
|
|
73216
|
-
function
|
|
73216
|
+
function join7(aRoot, aPath) {
|
|
73217
73217
|
const pathType = getURLType(aPath);
|
|
73218
73218
|
const rootType = getURLType(aRoot);
|
|
73219
73219
|
aRoot = ensureDirectory(aRoot);
|
|
@@ -73239,7 +73239,7 @@ var require_util5 = __commonJS({
|
|
|
73239
73239
|
const newPath = withBase(aPath, withBase(aRoot, base));
|
|
73240
73240
|
return computeRelativeURL(base, newPath);
|
|
73241
73241
|
}
|
|
73242
|
-
exports.join =
|
|
73242
|
+
exports.join = join7;
|
|
73243
73243
|
function relative(rootURL, targetURL) {
|
|
73244
73244
|
const result = relativeIfPossible(rootURL, targetURL);
|
|
73245
73245
|
return typeof result === "string" ? result : normalize2(targetURL);
|
|
@@ -73269,9 +73269,9 @@ var require_util5 = __commonJS({
|
|
|
73269
73269
|
}
|
|
73270
73270
|
let url = normalize2(sourceURL || "");
|
|
73271
73271
|
if (sourceRoot)
|
|
73272
|
-
url =
|
|
73272
|
+
url = join7(sourceRoot, url);
|
|
73273
73273
|
if (sourceMapURL)
|
|
73274
|
-
url =
|
|
73274
|
+
url = join7(trimFilename(sourceMapURL), url);
|
|
73275
73275
|
return url;
|
|
73276
73276
|
}
|
|
73277
73277
|
exports.computeSourceURL = computeSourceURL;
|
|
@@ -75036,8 +75036,8 @@ var require_source_map = __commonJS({
|
|
|
75036
75036
|
// node_modules/.pnpm/rollup@4.5.0/node_modules/rollup/dist/native.js
|
|
75037
75037
|
var require_native = __commonJS({
|
|
75038
75038
|
"node_modules/.pnpm/rollup@4.5.0/node_modules/rollup/dist/native.js"(exports, module2) {
|
|
75039
|
-
var { existsSync:
|
|
75040
|
-
var { join:
|
|
75039
|
+
var { existsSync: existsSync6 } = require("node:fs");
|
|
75040
|
+
var { join: join7 } = require("node:path");
|
|
75041
75041
|
var { platform, arch, report } = require("node:process");
|
|
75042
75042
|
var isMusl = () => !report.getReport().header.glibcVersionRuntime;
|
|
75043
75043
|
var bindingsByPlatformAndArch = {
|
|
@@ -75087,7 +75087,7 @@ If this is important to you, please consider supporting Rollup to make a native
|
|
|
75087
75087
|
return imported.base;
|
|
75088
75088
|
}
|
|
75089
75089
|
var localName = `./rollup.${packageBase}.node`;
|
|
75090
|
-
var { parse, parseAsync, xxhashBase64Url } =
|
|
75090
|
+
var { parse, parseAsync, xxhashBase64Url } = existsSync6(join7(__dirname, localName)) ? require(localName) : require(`@rollup/rollup-${packageBase}`);
|
|
75091
75091
|
module2.exports.parse = parse;
|
|
75092
75092
|
module2.exports.parseAsync = parseAsync;
|
|
75093
75093
|
module2.exports.xxhashBase64Url = xxhashBase64Url;
|
|
@@ -111287,7 +111287,7 @@ var require_TransformerError = __commonJS({
|
|
|
111287
111287
|
TransformerError2.from = function(method) {
|
|
111288
111288
|
return function(errors) {
|
|
111289
111289
|
var body = errors.map(function(e) {
|
|
111290
|
-
var subject = e.explore.object === null ? "" :
|
|
111290
|
+
var subject = e.explore.object === null ? "" : join7(e.explore.object)(e.explore.property);
|
|
111291
111291
|
var type = "".concat(subject.length ? "".concat(subject, ": ") : "").concat(e.name);
|
|
111292
111292
|
return "- ".concat(type, "\n").concat(e.messages.map(function(msg) {
|
|
111293
111293
|
return " - ".concat(msg);
|
|
@@ -111299,7 +111299,7 @@ var require_TransformerError = __commonJS({
|
|
|
111299
111299
|
});
|
|
111300
111300
|
};
|
|
111301
111301
|
};
|
|
111302
|
-
var
|
|
111302
|
+
var join7 = function(object) {
|
|
111303
111303
|
return function(key) {
|
|
111304
111304
|
if (key === null)
|
|
111305
111305
|
return object.name;
|
|
@@ -117379,13 +117379,13 @@ var require_application_object = __commonJS({
|
|
|
117379
117379
|
return __assign2(__assign2({ type: "object", properties, nullable: options.purpose === "swagger" ? nullable : void 0, required: required.length ? required : void 0, description: obj.description }, options.surplus ? { "x-typia-jsDocTags": obj.jsDocTags } : {}), options.purpose === "ajv" ? extraProps : options.surplus ? {
|
|
117380
117380
|
"x-typia-additionalProperties": extraProps.additionalProperties,
|
|
117381
117381
|
"x-typia-patternProperties": extraProps.patternProperties,
|
|
117382
|
-
additionalProperties:
|
|
117382
|
+
additionalProperties: join7(options)(components)(extraMeta)
|
|
117383
117383
|
} : {});
|
|
117384
117384
|
};
|
|
117385
117385
|
};
|
|
117386
117386
|
};
|
|
117387
117387
|
};
|
|
117388
|
-
var
|
|
117388
|
+
var join7 = function(options) {
|
|
117389
117389
|
return function(components) {
|
|
117390
117390
|
return function(extra) {
|
|
117391
117391
|
var _a;
|
|
@@ -126847,6 +126847,189 @@ module.exports = __toCommonJS(workspace_tools_exports);
|
|
|
126847
126847
|
|
|
126848
126848
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
126849
126849
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
126850
|
+
|
|
126851
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
126852
|
+
var chalk = __toESM(require_source(), 1);
|
|
126853
|
+
|
|
126854
|
+
// packages/config-tools/src/types.ts
|
|
126855
|
+
var LogLevel = {
|
|
126856
|
+
SILENT: 0,
|
|
126857
|
+
FATAL: 10,
|
|
126858
|
+
ERROR: 20,
|
|
126859
|
+
WARN: 30,
|
|
126860
|
+
INFO: 40,
|
|
126861
|
+
SUCCESS: 45,
|
|
126862
|
+
DEBUG: 60,
|
|
126863
|
+
TRACE: 70,
|
|
126864
|
+
ALL: 100
|
|
126865
|
+
};
|
|
126866
|
+
var LogLevelLabel = {
|
|
126867
|
+
SILENT: "silent",
|
|
126868
|
+
FATAL: "fatal",
|
|
126869
|
+
ERROR: "error",
|
|
126870
|
+
WARN: "warn",
|
|
126871
|
+
INFO: "info",
|
|
126872
|
+
DEBUG: "debug",
|
|
126873
|
+
TRACE: "trace",
|
|
126874
|
+
ALL: "all"
|
|
126875
|
+
};
|
|
126876
|
+
|
|
126877
|
+
// packages/config-tools/src/utilities/get-log-level.ts
|
|
126878
|
+
var getLogLevel = (label) => {
|
|
126879
|
+
switch (label) {
|
|
126880
|
+
case "all":
|
|
126881
|
+
return LogLevel.ALL;
|
|
126882
|
+
case "trace":
|
|
126883
|
+
return LogLevel.TRACE;
|
|
126884
|
+
case "debug":
|
|
126885
|
+
return LogLevel.DEBUG;
|
|
126886
|
+
case "info":
|
|
126887
|
+
return LogLevel.INFO;
|
|
126888
|
+
case "warn":
|
|
126889
|
+
return LogLevel.WARN;
|
|
126890
|
+
case "error":
|
|
126891
|
+
return LogLevel.ERROR;
|
|
126892
|
+
case "fatal":
|
|
126893
|
+
return LogLevel.FATAL;
|
|
126894
|
+
case "silent":
|
|
126895
|
+
return LogLevel.SILENT;
|
|
126896
|
+
default:
|
|
126897
|
+
return LogLevel.INFO;
|
|
126898
|
+
}
|
|
126899
|
+
};
|
|
126900
|
+
var getLogLevelLabel = (logLevel) => {
|
|
126901
|
+
if (logLevel >= LogLevel.ALL) {
|
|
126902
|
+
return LogLevelLabel.ALL;
|
|
126903
|
+
}
|
|
126904
|
+
if (logLevel >= LogLevel.TRACE) {
|
|
126905
|
+
return LogLevelLabel.TRACE;
|
|
126906
|
+
}
|
|
126907
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
126908
|
+
return LogLevelLabel.DEBUG;
|
|
126909
|
+
}
|
|
126910
|
+
if (logLevel >= LogLevel.INFO) {
|
|
126911
|
+
return LogLevelLabel.INFO;
|
|
126912
|
+
}
|
|
126913
|
+
if (logLevel >= LogLevel.WARN) {
|
|
126914
|
+
return LogLevelLabel.WARN;
|
|
126915
|
+
}
|
|
126916
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
126917
|
+
return LogLevelLabel.ERROR;
|
|
126918
|
+
}
|
|
126919
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
126920
|
+
return LogLevelLabel.FATAL;
|
|
126921
|
+
}
|
|
126922
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
126923
|
+
return LogLevelLabel.SILENT;
|
|
126924
|
+
}
|
|
126925
|
+
return LogLevelLabel.INFO;
|
|
126926
|
+
};
|
|
126927
|
+
|
|
126928
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
126929
|
+
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
126930
|
+
if (typeof logLevel === "number" && (logLevel >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
|
|
126931
|
+
return (_) => {
|
|
126932
|
+
};
|
|
126933
|
+
}
|
|
126934
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
126935
|
+
return (message) => {
|
|
126936
|
+
console.error(
|
|
126937
|
+
`
|
|
126938
|
+
${chalk.bold.hex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
|
|
126939
|
+
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
126940
|
+
)(message)}
|
|
126941
|
+
|
|
126942
|
+
`
|
|
126943
|
+
);
|
|
126944
|
+
};
|
|
126945
|
+
}
|
|
126946
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
126947
|
+
return (message) => {
|
|
126948
|
+
console.error(
|
|
126949
|
+
`
|
|
126950
|
+
${chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").white(" \u{1F6D1} Error ")} ${chalk.hex(
|
|
126951
|
+
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
126952
|
+
)(message)}
|
|
126953
|
+
`
|
|
126954
|
+
);
|
|
126955
|
+
};
|
|
126956
|
+
}
|
|
126957
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
126958
|
+
return (message) => {
|
|
126959
|
+
console.warn(
|
|
126960
|
+
`
|
|
126961
|
+
${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" \u26A0\uFE0F Warn ")} ${chalk.hex(
|
|
126962
|
+
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
126963
|
+
)(message)}
|
|
126964
|
+
`
|
|
126965
|
+
);
|
|
126966
|
+
};
|
|
126967
|
+
}
|
|
126968
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
126969
|
+
return (message) => {
|
|
126970
|
+
console.info(
|
|
126971
|
+
`
|
|
126972
|
+
${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").white(" \u{1F4EC} Info ")} ${chalk.hex(
|
|
126973
|
+
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
126974
|
+
)(message)}
|
|
126975
|
+
`
|
|
126976
|
+
);
|
|
126977
|
+
};
|
|
126978
|
+
}
|
|
126979
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
126980
|
+
return (message) => {
|
|
126981
|
+
console.info(
|
|
126982
|
+
`
|
|
126983
|
+
${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u{1F389} Success ")} ${chalk.hex(
|
|
126984
|
+
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
126985
|
+
)(message)}
|
|
126986
|
+
`
|
|
126987
|
+
);
|
|
126988
|
+
};
|
|
126989
|
+
}
|
|
126990
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
126991
|
+
return (message) => {
|
|
126992
|
+
console.debug(
|
|
126993
|
+
`
|
|
126994
|
+
${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
|
|
126995
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
126996
|
+
)(message)}
|
|
126997
|
+
`
|
|
126998
|
+
);
|
|
126999
|
+
};
|
|
127000
|
+
}
|
|
127001
|
+
return (message) => {
|
|
127002
|
+
console.log(
|
|
127003
|
+
`
|
|
127004
|
+
${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.hex(
|
|
127005
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
127006
|
+
)(message)}
|
|
127007
|
+
`
|
|
127008
|
+
);
|
|
127009
|
+
};
|
|
127010
|
+
};
|
|
127011
|
+
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
127012
|
+
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
127013
|
+
var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
|
|
127014
|
+
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
127015
|
+
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
127016
|
+
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
127017
|
+
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
127018
|
+
var getStopwatch = (name) => {
|
|
127019
|
+
const start = process.hrtime();
|
|
127020
|
+
return () => {
|
|
127021
|
+
const end = process.hrtime(start);
|
|
127022
|
+
console.info(
|
|
127023
|
+
chalk.dim(
|
|
127024
|
+
`\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
127025
|
+
end[0] * 1e3 + end[1] / 1e6
|
|
127026
|
+
)}ms to complete`
|
|
127027
|
+
)
|
|
127028
|
+
);
|
|
127029
|
+
};
|
|
127030
|
+
};
|
|
127031
|
+
|
|
127032
|
+
// packages/config-tools/src/config-file/get-config-file.ts
|
|
126850
127033
|
var _static_cache = void 0;
|
|
126851
127034
|
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
126852
127035
|
var getConfigFile = async (filePath) => {
|
|
@@ -126873,6 +127056,10 @@ var getConfigFile = async (filePath) => {
|
|
|
126873
127056
|
console.warn(
|
|
126874
127057
|
"No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not."
|
|
126875
127058
|
);
|
|
127059
|
+
writeWarning(
|
|
127060
|
+
{ logLevel: "error" },
|
|
127061
|
+
"No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not."
|
|
127062
|
+
);
|
|
126876
127063
|
return void 0;
|
|
126877
127064
|
}
|
|
126878
127065
|
const config = cosmiconfigResult.config ?? {};
|
|
@@ -126953,6 +127140,10 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
126953
127140
|
return result;
|
|
126954
127141
|
}
|
|
126955
127142
|
|
|
127143
|
+
// packages/config-tools/src/utilities/get-default-config.ts
|
|
127144
|
+
var import_node_fs2 = require("node:fs");
|
|
127145
|
+
var import_node_path2 = require("node:path");
|
|
127146
|
+
|
|
126956
127147
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
126957
127148
|
var util;
|
|
126958
127149
|
(function(util2) {
|
|
@@ -130613,184 +130804,50 @@ var DefaultStormConfig = {
|
|
|
130613
130804
|
colors: { ...DefaultColorConfig },
|
|
130614
130805
|
extensions: {}
|
|
130615
130806
|
};
|
|
130616
|
-
|
|
130617
|
-
|
|
130618
|
-
|
|
130619
|
-
|
|
130620
|
-
|
|
130621
|
-
|
|
130622
|
-
|
|
130623
|
-
|
|
130624
|
-
|
|
130625
|
-
|
|
130626
|
-
|
|
130627
|
-
|
|
130628
|
-
|
|
130629
|
-
|
|
130630
|
-
|
|
130631
|
-
|
|
130632
|
-
|
|
130633
|
-
|
|
130634
|
-
|
|
130635
|
-
|
|
130636
|
-
|
|
130637
|
-
|
|
130638
|
-
|
|
130639
|
-
|
|
130640
|
-
|
|
130641
|
-
|
|
130642
|
-
|
|
130643
|
-
|
|
130644
|
-
|
|
130645
|
-
case "trace":
|
|
130646
|
-
return LogLevel.TRACE;
|
|
130647
|
-
case "debug":
|
|
130648
|
-
return LogLevel.DEBUG;
|
|
130649
|
-
case "info":
|
|
130650
|
-
return LogLevel.INFO;
|
|
130651
|
-
case "warn":
|
|
130652
|
-
return LogLevel.WARN;
|
|
130653
|
-
case "error":
|
|
130654
|
-
return LogLevel.ERROR;
|
|
130655
|
-
case "fatal":
|
|
130656
|
-
return LogLevel.FATAL;
|
|
130657
|
-
case "silent":
|
|
130658
|
-
return LogLevel.SILENT;
|
|
130659
|
-
default:
|
|
130660
|
-
return LogLevel.INFO;
|
|
130661
|
-
}
|
|
130662
|
-
};
|
|
130663
|
-
var getLogLevelLabel = (logLevel) => {
|
|
130664
|
-
if (logLevel >= LogLevel.ALL) {
|
|
130665
|
-
return LogLevelLabel.ALL;
|
|
130666
|
-
}
|
|
130667
|
-
if (logLevel >= LogLevel.TRACE) {
|
|
130668
|
-
return LogLevelLabel.TRACE;
|
|
130669
|
-
}
|
|
130670
|
-
if (logLevel >= LogLevel.DEBUG) {
|
|
130671
|
-
return LogLevelLabel.DEBUG;
|
|
130672
|
-
}
|
|
130673
|
-
if (logLevel >= LogLevel.INFO) {
|
|
130674
|
-
return LogLevelLabel.INFO;
|
|
130675
|
-
}
|
|
130676
|
-
if (logLevel >= LogLevel.WARN) {
|
|
130677
|
-
return LogLevelLabel.WARN;
|
|
130678
|
-
}
|
|
130679
|
-
if (logLevel >= LogLevel.ERROR) {
|
|
130680
|
-
return LogLevelLabel.ERROR;
|
|
130681
|
-
}
|
|
130682
|
-
if (logLevel >= LogLevel.FATAL) {
|
|
130683
|
-
return LogLevelLabel.FATAL;
|
|
130684
|
-
}
|
|
130685
|
-
if (logLevel <= LogLevel.SILENT) {
|
|
130686
|
-
return LogLevelLabel.SILENT;
|
|
130687
|
-
}
|
|
130688
|
-
return LogLevelLabel.INFO;
|
|
130689
|
-
};
|
|
130690
|
-
|
|
130691
|
-
// packages/config-tools/src/utilities/logger.ts
|
|
130692
|
-
var chalk = __toESM(require_source(), 1);
|
|
130693
|
-
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
130694
|
-
if (typeof logLevel === "number" && (logLevel >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
|
|
130695
|
-
return (_) => {
|
|
130696
|
-
};
|
|
130697
|
-
}
|
|
130698
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
130699
|
-
return (message) => {
|
|
130700
|
-
console.error(
|
|
130701
|
-
`
|
|
130702
|
-
${chalk.bold.hex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
|
|
130703
|
-
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
130704
|
-
)(message)}
|
|
130705
|
-
|
|
130706
|
-
`
|
|
130707
|
-
);
|
|
130708
|
-
};
|
|
130709
|
-
}
|
|
130710
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
130711
|
-
return (message) => {
|
|
130712
|
-
console.error(
|
|
130713
|
-
`
|
|
130714
|
-
${chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").white(" \u{1F6D1} Error ")} ${chalk.hex(
|
|
130715
|
-
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
130716
|
-
)(message)}
|
|
130717
|
-
`
|
|
130718
|
-
);
|
|
130719
|
-
};
|
|
130720
|
-
}
|
|
130721
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
130722
|
-
return (message) => {
|
|
130723
|
-
console.warn(
|
|
130724
|
-
`
|
|
130725
|
-
${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" \u26A0\uFE0F Warn ")} ${chalk.hex(
|
|
130726
|
-
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
130727
|
-
)(message)}
|
|
130728
|
-
`
|
|
130729
|
-
);
|
|
130730
|
-
};
|
|
130731
|
-
}
|
|
130732
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
130733
|
-
return (message) => {
|
|
130734
|
-
console.info(
|
|
130735
|
-
`
|
|
130736
|
-
${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").white(" \u{1F4EC} Info ")} ${chalk.hex(
|
|
130737
|
-
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
130738
|
-
)(message)}
|
|
130739
|
-
`
|
|
130740
|
-
);
|
|
130741
|
-
};
|
|
130742
|
-
}
|
|
130743
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
130744
|
-
return (message) => {
|
|
130745
|
-
console.info(
|
|
130746
|
-
`
|
|
130747
|
-
${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u{1F389} Success ")} ${chalk.hex(
|
|
130748
|
-
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
130749
|
-
)(message)}
|
|
130750
|
-
`
|
|
130751
|
-
);
|
|
130752
|
-
};
|
|
130753
|
-
}
|
|
130754
|
-
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
130755
|
-
return (message) => {
|
|
130756
|
-
console.debug(
|
|
130757
|
-
`
|
|
130758
|
-
${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
|
|
130759
|
-
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
130760
|
-
)(message)}
|
|
130761
|
-
`
|
|
130762
|
-
);
|
|
130763
|
-
};
|
|
130807
|
+
var getDefaultConfig = (config = {}, root) => {
|
|
130808
|
+
let name = "storm-workspace";
|
|
130809
|
+
let namespace = "storm-software";
|
|
130810
|
+
let repository = "https://github.com/storm-software/storm-ops";
|
|
130811
|
+
let license = DefaultStormConfig.license;
|
|
130812
|
+
let homepage = DefaultStormConfig.homepage;
|
|
130813
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
130814
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
130815
|
+
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
130816
|
+
encoding: "utf-8"
|
|
130817
|
+
});
|
|
130818
|
+
if (file) {
|
|
130819
|
+
const packageJson = JSON.parse(file);
|
|
130820
|
+
if (packageJson.name) {
|
|
130821
|
+
name = packageJson.name;
|
|
130822
|
+
}
|
|
130823
|
+
if (packageJson.namespace) {
|
|
130824
|
+
namespace = packageJson.namespace;
|
|
130825
|
+
}
|
|
130826
|
+
if (packageJson.repository?.url) {
|
|
130827
|
+
repository = packageJson.repository?.url;
|
|
130828
|
+
}
|
|
130829
|
+
if (packageJson.license) {
|
|
130830
|
+
license = packageJson.license;
|
|
130831
|
+
}
|
|
130832
|
+
if (packageJson.homepage) {
|
|
130833
|
+
homepage = packageJson.homepage;
|
|
130834
|
+
}
|
|
130835
|
+
}
|
|
130764
130836
|
}
|
|
130765
|
-
return (
|
|
130766
|
-
|
|
130767
|
-
|
|
130768
|
-
|
|
130769
|
-
|
|
130770
|
-
|
|
130771
|
-
|
|
130772
|
-
|
|
130773
|
-
|
|
130774
|
-
|
|
130775
|
-
|
|
130776
|
-
|
|
130777
|
-
|
|
130778
|
-
|
|
130779
|
-
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
130780
|
-
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
130781
|
-
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
130782
|
-
var getStopwatch = (name) => {
|
|
130783
|
-
const start = process.hrtime();
|
|
130784
|
-
return () => {
|
|
130785
|
-
const end = process.hrtime(start);
|
|
130786
|
-
console.info(
|
|
130787
|
-
chalk.dim(
|
|
130788
|
-
`\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
130789
|
-
end[0] * 1e3 + end[1] / 1e6
|
|
130790
|
-
)}ms to complete`
|
|
130791
|
-
)
|
|
130792
|
-
);
|
|
130793
|
-
};
|
|
130837
|
+
return StormConfigSchema.parse({
|
|
130838
|
+
...DefaultStormConfig,
|
|
130839
|
+
...config,
|
|
130840
|
+
colors: { ...DefaultColorConfig, ...config.colors },
|
|
130841
|
+
workspaceRoot,
|
|
130842
|
+
name,
|
|
130843
|
+
namespace,
|
|
130844
|
+
repository,
|
|
130845
|
+
license: license ?? DefaultStormConfig.license,
|
|
130846
|
+
homepage: homepage ?? DefaultStormConfig.homepage,
|
|
130847
|
+
extensions: {
|
|
130848
|
+
...config.extensions
|
|
130849
|
+
}
|
|
130850
|
+
});
|
|
130794
130851
|
};
|
|
130795
130852
|
|
|
130796
130853
|
// packages/config-tools/src/env/set-env.ts
|
|
@@ -130980,39 +131037,21 @@ var getConfigEnv = () => {
|
|
|
130980
131037
|
|
|
130981
131038
|
// packages/config-tools/src/create-storm-config.ts
|
|
130982
131039
|
var loadStormConfig = async (workspaceRoot) => {
|
|
131040
|
+
let config = {};
|
|
130983
131041
|
let _workspaceRoot = workspaceRoot;
|
|
130984
131042
|
if (!_workspaceRoot) {
|
|
130985
131043
|
_workspaceRoot = findWorkspaceRoot();
|
|
130986
131044
|
}
|
|
130987
|
-
|
|
130988
|
-
|
|
130989
|
-
|
|
130990
|
-
|
|
130991
|
-
|
|
130992
|
-
|
|
130993
|
-
|
|
130994
|
-
|
|
130995
|
-
|
|
130996
|
-
info: process.env.STORM_COLOR_INFO ?? configFile.colors?.info,
|
|
130997
|
-
warning: process.env.STORM_COLOR_WARNING ?? configFile.colors?.warning,
|
|
130998
|
-
error: process.env.STORM_COLOR_ERROR ?? configFile.colors?.error,
|
|
130999
|
-
fatal: process.env.STORM_COLOR_FATAL ?? configFile.colors?.fatal
|
|
131000
|
-
};
|
|
131001
|
-
} else {
|
|
131002
|
-
configFile[key] = configEnv[key];
|
|
131003
|
-
}
|
|
131004
|
-
}
|
|
131005
|
-
}
|
|
131006
|
-
const config = StormConfigSchema.parse(configFile);
|
|
131045
|
+
config = StormConfigSchema.parse(
|
|
131046
|
+
await getDefaultConfig(
|
|
131047
|
+
{
|
|
131048
|
+
...await getConfigFile(_workspaceRoot),
|
|
131049
|
+
...getConfigEnv()
|
|
131050
|
+
},
|
|
131051
|
+
_workspaceRoot
|
|
131052
|
+
)
|
|
131053
|
+
);
|
|
131007
131054
|
setConfigEnv(config);
|
|
131008
|
-
console.debug("\r\n\r\n");
|
|
131009
|
-
console.debug(`Loaded Storm config from ${config.configFile}`);
|
|
131010
|
-
for (const key of Object.keys(configFile)) {
|
|
131011
|
-
console.debug(`
|
|
131012
|
-
----- ${key} ----- `);
|
|
131013
|
-
console.debug(configFile[key]);
|
|
131014
|
-
}
|
|
131015
|
-
console.debug("\r\n\r\n");
|
|
131016
131055
|
return config;
|
|
131017
131056
|
};
|
|
131018
131057
|
|
|
@@ -131803,9 +131842,9 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
131803
131842
|
};
|
|
131804
131843
|
|
|
131805
131844
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
131806
|
-
var
|
|
131845
|
+
var import_node_fs3 = require("node:fs");
|
|
131807
131846
|
var import_promises2 = require("node:fs/promises");
|
|
131808
|
-
var
|
|
131847
|
+
var import_node_path4 = require("node:path");
|
|
131809
131848
|
var import_esbuild_decorators = __toESM(require_src2());
|
|
131810
131849
|
var import_devkit3 = __toESM(require_devkit());
|
|
131811
131850
|
var import_js2 = __toESM(require_src());
|
|
@@ -138037,13 +138076,13 @@ var import_tsup = __toESM(require_dist6());
|
|
|
138037
138076
|
var ts = __toESM(require("typescript"));
|
|
138038
138077
|
|
|
138039
138078
|
// packages/workspace-tools/src/utils/file-path-utils.ts
|
|
138040
|
-
var
|
|
138079
|
+
var import_node_path3 = require("node:path");
|
|
138041
138080
|
var removeExtension = (filePath) => {
|
|
138042
138081
|
return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
|
|
138043
138082
|
};
|
|
138044
138083
|
function findFileName(filePath) {
|
|
138045
138084
|
return filePath?.split(
|
|
138046
|
-
filePath?.includes(
|
|
138085
|
+
filePath?.includes(import_node_path3.sep) ? import_node_path3.sep : filePath?.includes("/") ? "/" : "\\"
|
|
138047
138086
|
)?.pop() ?? "";
|
|
138048
138087
|
}
|
|
138049
138088
|
|
|
@@ -138394,7 +138433,7 @@ ${externalDependencies.map((dep) => {
|
|
|
138394
138433
|
packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_devkit3.joinPathFragments)("packages", context.projectName);
|
|
138395
138434
|
const packageJsonPath = (0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "package.json");
|
|
138396
138435
|
writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
138397
|
-
(0,
|
|
138436
|
+
(0, import_node_fs3.writeFileSync)(
|
|
138398
138437
|
packageJsonPath,
|
|
138399
138438
|
await (0, import_prettier.format)(JSON.stringify(packageJson), {
|
|
138400
138439
|
...prettierOptions,
|
|
@@ -138418,7 +138457,7 @@ ${externalDependencies.map((dep) => {
|
|
|
138418
138457
|
await (0, import_prettier.format)(
|
|
138419
138458
|
`${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
|
|
138420
138459
|
|
|
138421
|
-
${(0,
|
|
138460
|
+
${(0, import_node_fs3.readFileSync)(file, "utf-8")}`,
|
|
138422
138461
|
{
|
|
138423
138462
|
...prettierOptions,
|
|
138424
138463
|
parser: "typescript"
|
|
@@ -138527,7 +138566,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
138527
138566
|
}
|
|
138528
138567
|
},
|
|
138529
138568
|
ts.sys,
|
|
138530
|
-
(0,
|
|
138569
|
+
(0, import_node_path4.dirname)(options.tsConfig)
|
|
138531
138570
|
);
|
|
138532
138571
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
138533
138572
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
@@ -140440,12 +140479,12 @@ var generator_default3 = withRunGenerator(
|
|
|
140440
140479
|
);
|
|
140441
140480
|
|
|
140442
140481
|
// packages/workspace-tools/src/utils/find-cache-dir.ts
|
|
140443
|
-
var
|
|
140444
|
-
var
|
|
140482
|
+
var import_node_fs4 = require("node:fs");
|
|
140483
|
+
var import_node_path5 = require("node:path");
|
|
140445
140484
|
var import_node_process = require("node:process");
|
|
140446
140485
|
var isWritable2 = (path3) => {
|
|
140447
140486
|
try {
|
|
140448
|
-
(0,
|
|
140487
|
+
(0, import_node_fs4.accessSync)(path3, import_node_fs4.constants.W_OK);
|
|
140449
140488
|
return true;
|
|
140450
140489
|
} catch {
|
|
140451
140490
|
return false;
|
|
@@ -140453,13 +140492,13 @@ var isWritable2 = (path3) => {
|
|
|
140453
140492
|
};
|
|
140454
140493
|
function useDirectory(directory, { create = true }) {
|
|
140455
140494
|
if (create) {
|
|
140456
|
-
(0,
|
|
140495
|
+
(0, import_node_fs4.mkdirSync)(directory, { recursive: true });
|
|
140457
140496
|
}
|
|
140458
140497
|
return directory;
|
|
140459
140498
|
}
|
|
140460
140499
|
function getNodeModuleDirectory(workspaceRoot) {
|
|
140461
|
-
const nodeModules = (0,
|
|
140462
|
-
if ((0,
|
|
140500
|
+
const nodeModules = (0, import_node_path5.join)(workspaceRoot, "node_modules");
|
|
140501
|
+
if ((0, import_node_fs4.existsSync)(nodeModules) && !isWritable2(nodeModules)) {
|
|
140463
140502
|
throw new Error("Cannot write to node_modules directory");
|
|
140464
140503
|
}
|
|
140465
140504
|
return nodeModules;
|
|
@@ -140475,10 +140514,10 @@ function findCacheDirectory({
|
|
|
140475
140514
|
create: true
|
|
140476
140515
|
}) {
|
|
140477
140516
|
if (import_node_process.env.CACHE_DIR && !["true", "false", "1", "0"].includes(import_node_process.env.CACHE_DIR)) {
|
|
140478
|
-
return useDirectory((0,
|
|
140517
|
+
return useDirectory((0, import_node_path5.join)(import_node_process.env.CACHE_DIR, name, cacheName), { create });
|
|
140479
140518
|
}
|
|
140480
140519
|
if (import_node_process.env.STORM_CACHE_DIR && !["true", "false", "1", "0"].includes(import_node_process.env.STORM_CACHE_DIR)) {
|
|
140481
|
-
return useDirectory((0,
|
|
140520
|
+
return useDirectory((0, import_node_path5.join)(import_node_process.env.STORM_CACHE_DIR, name, cacheName), {
|
|
140482
140521
|
create
|
|
140483
140522
|
});
|
|
140484
140523
|
}
|
|
@@ -140487,7 +140526,7 @@ function findCacheDirectory({
|
|
|
140487
140526
|
throw new Error("Cannot find node_modules directory");
|
|
140488
140527
|
}
|
|
140489
140528
|
return useDirectory(
|
|
140490
|
-
(0,
|
|
140529
|
+
(0, import_node_path5.join)(workspaceRoot, "node_modules", ".cache", name, cacheName),
|
|
140491
140530
|
{ create }
|
|
140492
140531
|
);
|
|
140493
140532
|
}
|
|
@@ -140497,8 +140536,8 @@ var import_transform = __toESM(require_transform());
|
|
|
140497
140536
|
var getTypiaTransform = (program, diagnostics) => (0, import_transform.default)(program, {}, { addDiagnostic: (input) => diagnostics.push(input) });
|
|
140498
140537
|
|
|
140499
140538
|
// packages/workspace-tools/src/utils/workspace-storage.ts
|
|
140500
|
-
var
|
|
140501
|
-
var
|
|
140539
|
+
var import_node_fs5 = require("node:fs");
|
|
140540
|
+
var import_node_path6 = require("node:path");
|
|
140502
140541
|
var WorkspaceStorage = class {
|
|
140503
140542
|
constructor({
|
|
140504
140543
|
cacheName,
|
|
@@ -140518,9 +140557,9 @@ var WorkspaceStorage = class {
|
|
|
140518
140557
|
* @returns The value of the key
|
|
140519
140558
|
*/
|
|
140520
140559
|
getItem(key) {
|
|
140521
|
-
const cacheFile = (0,
|
|
140522
|
-
if ((0,
|
|
140523
|
-
return (0,
|
|
140560
|
+
const cacheFile = (0, import_node_path6.join)(this.cacheDir, key);
|
|
140561
|
+
if ((0, import_node_fs5.existsSync)(cacheFile)) {
|
|
140562
|
+
return (0, import_node_fs5.readFileSync)(cacheFile, "utf-8");
|
|
140524
140563
|
}
|
|
140525
140564
|
return void 0;
|
|
140526
140565
|
}
|
|
@@ -140531,7 +140570,7 @@ var WorkspaceStorage = class {
|
|
|
140531
140570
|
* @param value - The value to set
|
|
140532
140571
|
*/
|
|
140533
140572
|
setItem(key, value) {
|
|
140534
|
-
(0,
|
|
140573
|
+
(0, import_node_fs5.writeFileSync)((0, import_node_path6.join)(this.cacheDir, key), value, { encoding: "utf-8" });
|
|
140535
140574
|
}
|
|
140536
140575
|
/**
|
|
140537
140576
|
* Remove item from cache
|
|
@@ -140539,14 +140578,14 @@ var WorkspaceStorage = class {
|
|
|
140539
140578
|
* @param key - The key to remove
|
|
140540
140579
|
*/
|
|
140541
140580
|
removeItem(key) {
|
|
140542
|
-
(0,
|
|
140581
|
+
(0, import_node_fs5.rmSync)((0, import_node_path6.join)(this.cacheDir, key), { force: true, recursive: true });
|
|
140543
140582
|
}
|
|
140544
140583
|
/**
|
|
140545
140584
|
* Clear the cache
|
|
140546
140585
|
*/
|
|
140547
140586
|
clear() {
|
|
140548
|
-
(0,
|
|
140549
|
-
(0,
|
|
140587
|
+
(0, import_node_fs5.readdirSync)(this.cacheDir).forEach((cacheFile) => {
|
|
140588
|
+
(0, import_node_fs5.rmSync)(cacheFile, { force: true, recursive: true });
|
|
140550
140589
|
});
|
|
140551
140590
|
}
|
|
140552
140591
|
/**
|
|
@@ -140556,7 +140595,7 @@ var WorkspaceStorage = class {
|
|
|
140556
140595
|
* @returns The key at the index
|
|
140557
140596
|
*/
|
|
140558
140597
|
key(index) {
|
|
140559
|
-
const files = (0,
|
|
140598
|
+
const files = (0, import_node_fs5.readdirSync)(this.cacheDir);
|
|
140560
140599
|
if (index < files.length && index >= 0) {
|
|
140561
140600
|
return files[index];
|
|
140562
140601
|
}
|