@storm-software/esbuild 0.4.1 → 0.14.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/README.md +1 -1
- package/dist/build.cjs +15 -11
- package/dist/build.d.cts +3 -3
- package/dist/build.d.ts +3 -3
- package/dist/build.js +14 -10
- package/dist/{chunk-WCQVDF3K.js → chunk-3GQAWCBQ.js} +0 -1
- package/dist/chunk-4JLYXTKD.cjs +26 -0
- package/dist/chunk-5I2MGPRN.cjs +919 -0
- package/dist/{chunk-CMWXE5MF.js → chunk-7KR3YBS6.js} +5 -3
- package/dist/chunk-7MDMXJ5V.js +26 -0
- package/dist/{chunk-WGEGR3DF.cjs → chunk-BGYQAVKQ.cjs} +0 -1
- package/dist/{chunk-J34FQYKV.cjs → chunk-CGFDQ5AJ.cjs} +8 -5
- package/dist/{chunk-TTHABTDU.js → chunk-DAGDNKO5.js} +8 -6
- package/dist/{chunk-DFGHPRBD.cjs → chunk-EZGTDCYM.cjs} +6 -6
- package/dist/chunk-GGNOJ77I.js +0 -0
- package/dist/{chunk-YQBU3FSL.js → chunk-GWG4HOQ6.js} +4 -4
- package/dist/chunk-HQGUIF4U.js +537 -0
- package/dist/{chunk-X5TLV7MF.js → chunk-KE5DL2BG.js} +11 -6
- package/dist/{chunk-KJ7ZHAFS.js → chunk-KOK4WCHS.js} +52 -28
- package/dist/chunk-LVWQSCJM.cjs +26 -0
- package/dist/chunk-LYDEMC26.js +23 -0
- package/dist/chunk-MAMLS55E.js +582 -0
- package/dist/chunk-NVWDQVN6.js +21 -0
- package/dist/chunk-PQ6YIJ72.cjs +136 -0
- package/dist/{chunk-BF5W6GVP.cjs → chunk-RMB62XEL.cjs} +10 -8
- package/dist/chunk-S6M44SSZ.cjs +60 -0
- package/dist/chunk-SFZRYJZ2.cjs +1 -0
- package/dist/chunk-T5272PC2.js +60 -0
- package/dist/chunk-TP5EOMRD.cjs +21 -0
- package/dist/chunk-VBINBV4Z.cjs +537 -0
- package/dist/chunk-VLP3P6HF.js +919 -0
- package/dist/{chunk-KVBDKVBU.cjs → chunk-VZBOWHCM.cjs} +9 -7
- package/dist/chunk-WRBUO7H6.cjs +23 -0
- package/dist/chunk-WYMD6YG2.cjs +582 -0
- package/dist/{chunk-437F3SFI.js → chunk-YNQ45EAM.js} +7 -4
- package/dist/clean.cjs +9 -0
- package/dist/clean.d.cts +1194 -0
- package/dist/clean.d.ts +1194 -0
- package/dist/clean.js +9 -0
- package/dist/config.cjs +14 -4
- package/dist/config.d.cts +8 -13
- package/dist/config.d.ts +8 -13
- package/dist/config.js +15 -5
- package/dist/esbuild.cjs +1185 -0
- package/dist/index.cjs +21 -12
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +22 -13
- package/dist/types.cjs +1 -2
- package/dist/types.d.cts +84 -1177
- package/dist/types.d.ts +84 -1177
- package/dist/types.js +1 -2
- package/package.json +1 -222
- package/dist/build.cjs.map +0 -1
- package/dist/build.js.map +0 -1
- package/dist/chunk-263L44RM.cjs +0 -112
- package/dist/chunk-263L44RM.cjs.map +0 -1
- package/dist/chunk-437F3SFI.js.map +0 -1
- package/dist/chunk-BF5W6GVP.cjs.map +0 -1
- package/dist/chunk-CMEDJ4L4.js +0 -352
- package/dist/chunk-CMEDJ4L4.js.map +0 -1
- package/dist/chunk-CMWXE5MF.js.map +0 -1
- package/dist/chunk-D5PRB2E2.cjs +0 -40
- package/dist/chunk-D5PRB2E2.cjs.map +0 -1
- package/dist/chunk-DFGHPRBD.cjs.map +0 -1
- package/dist/chunk-DRRPNILS.js +0 -40
- package/dist/chunk-DRRPNILS.js.map +0 -1
- package/dist/chunk-J34FQYKV.cjs.map +0 -1
- package/dist/chunk-KJ7ZHAFS.js.map +0 -1
- package/dist/chunk-KVBDKVBU.cjs.map +0 -1
- package/dist/chunk-MUYXFAKB.cjs +0 -1
- package/dist/chunk-MUYXFAKB.cjs.map +0 -1
- package/dist/chunk-MVLEDP7K.cjs +0 -21
- package/dist/chunk-MVLEDP7K.cjs.map +0 -1
- package/dist/chunk-PBHOTQGA.cjs +0 -352
- package/dist/chunk-PBHOTQGA.cjs.map +0 -1
- package/dist/chunk-QNDLJ2W7.js +0 -1
- package/dist/chunk-QNDLJ2W7.js.map +0 -1
- package/dist/chunk-TTHABTDU.js.map +0 -1
- package/dist/chunk-WCQVDF3K.js.map +0 -1
- package/dist/chunk-WGEGR3DF.cjs.map +0 -1
- package/dist/chunk-X5TLV7MF.js.map +0 -1
- package/dist/chunk-YQBU3FSL.js.map +0 -1
- package/dist/config.cjs.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types.cjs.map +0 -1
- package/dist/types.js.map +0 -1
package/dist/chunk-MVLEDP7K.cjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/plugins/on-error.ts
|
|
2
|
-
var _configtools = require('@storm-software/config-tools');
|
|
3
|
-
var onErrorPlugin = {
|
|
4
|
-
name: "storm:on-error",
|
|
5
|
-
setup(build) {
|
|
6
|
-
build.onEnd((result) => {
|
|
7
|
-
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
8
|
-
_configtools.writeError.call(void 0, `The following errors occurred during the build:
|
|
9
|
-
${result.errors.map((error) => error.text).join("\n")}
|
|
10
|
-
|
|
11
|
-
`);
|
|
12
|
-
throw new Error("ESBuild process failed with errors.");
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
exports.onErrorPlugin = onErrorPlugin;
|
|
21
|
-
//# sourceMappingURL=chunk-MVLEDP7K.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/chunk-MVLEDP7K.cjs","../src/plugins/on-error.ts"],"names":["onErrorPlugin","name","setup","build","onEnd","result","errors","length","process","env","WATCH","writeError","map","error","text","join","Error"],"mappings":"AAAA;ACiBA,2DAA2B;AAMpB,IAAMA,cAAAA,EAAgC;ADpB7C,ECqBEC,IAAAA,EAAM,gBAAA;ADpBR,ECqBEC,KAAAA,CAAMC,KAAAA,EAAK;AACTA,IAAAA,KAAAA,CAAMC,KAAAA,CAAMC,CAAAA,MAAAA,EAAAA,GAAAA;AAEV,MAAA,GAAA,CAAIA,MAAAA,CAAOC,MAAAA,CAAOC,OAAAA,EAAS,EAAA,GAAKC,OAAAA,CAAQC,GAAAA,CAAIC,MAAAA,IAAU,MAAA,EAAQ;AAC5DC,QAAAA,qCAAAA,CACE;ADtBV,ECuBEN,MAAAA,CAAOC,MAAAA,CAAOM,GAAAA,CAAIC,CAAAA,KAAAA,EAAAA,GAASA,KAAAA,CAAMC,IAAI,CAAA,CAAEC,IAAAA,CAAK,IAAA,CAAA,CAAA;ADtB9C;AACA,CCuBC,CAAA;AAGO,QAAA,MAAM,IAAIC,KAAAA,CAAM,qCAAA,CAAA;ADxBxB,MCyBM;ADxBN,ICyBI,CAAA,CAAA;ADxBJ,ECyBE;AACF,CAAA;ADxBA;AACA;AACE;AACF,sCAAC","file":"/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/chunk-MVLEDP7K.cjs","sourcesContent":[null,"/*-------------------------------------------------------------------\n\n ⚡ Storm Software - Storm Stack\n\n This code was released as part of the Storm Stack project. Storm Stack\n is maintained by Storm Software under the Apache-2.0 License, and is\n free for commercial and private use. For more information, please visit\n our licensing page.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/storm-ops\n Documentation: https://stormsoftware.com/projects/storm-ops/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/storm-ops/license\n\n -------------------------------------------------------------------*/\n\nimport { writeError } from \"@storm-software/config-tools\";\nimport type * as esbuild from \"esbuild\";\n\n/**\n * Causes esbuild to exit immediately with an error code.\n */\nexport const onErrorPlugin: esbuild.Plugin = {\n name: \"storm:on-error\",\n setup(build) {\n build.onEnd(result => {\n // if there were errors found on the build\n if (result.errors.length > 0 && process.env.WATCH !== \"true\") {\n writeError(\n `The following errors occurred during the build:\n${result.errors.map(error => error.text).join(\"\\n\")}\n\n`\n );\n\n throw new Error(\"ESBuild process failed with errors.\");\n }\n });\n }\n};\n"]}
|
package/dist/chunk-PBHOTQGA.cjs
DELETED
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
-
|
|
3
|
-
var _chunkBF5W6GVPcjs = require('./chunk-BF5W6GVP.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunk263L44RMcjs = require('./chunk-263L44RM.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkD5PRB2E2cjs = require('./chunk-D5PRB2E2.cjs');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _chunkKVBDKVBUcjs = require('./chunk-KVBDKVBU.cjs');
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _chunkJ34FQYKVcjs = require('./chunk-J34FQYKV.cjs');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _chunkDFGHPRBDcjs = require('./chunk-DFGHPRBD.cjs');
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _chunkMVLEDP7Kcjs = require('./chunk-MVLEDP7K.cjs');
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var _chunkWGEGR3DFcjs = require('./chunk-WGEGR3DF.cjs');
|
|
25
|
-
|
|
26
|
-
// src/build.ts
|
|
27
|
-
var _node = require('@humanfs/node');
|
|
28
|
-
var _devkit = require('@nx/devkit');
|
|
29
|
-
var _buildtools = require('@storm-software/build-tools');
|
|
30
|
-
var _configtools = require('@storm-software/config-tools');
|
|
31
|
-
var _chokidar = require('chokidar');
|
|
32
|
-
var _estoolkit = require('es-toolkit');
|
|
33
|
-
var _compat = require('es-toolkit/compat');
|
|
34
|
-
var _esbuild = require('esbuild'); var esbuild = _interopRequireWildcard(_esbuild);
|
|
35
|
-
var _globby = require('globby');
|
|
36
|
-
var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
|
|
37
|
-
|
|
38
|
-
// src/utilities/helpers.ts
|
|
39
|
-
function handleSync(fn) {
|
|
40
|
-
try {
|
|
41
|
-
return fn();
|
|
42
|
-
} catch (error_) {
|
|
43
|
-
return error_;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, handleSync, "handleSync");
|
|
47
|
-
async function handleAsync(fn) {
|
|
48
|
-
try {
|
|
49
|
-
return await fn();
|
|
50
|
-
} catch (error_) {
|
|
51
|
-
return error_;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, handleAsync, "handleAsync");
|
|
55
|
-
var handle = handleSync;
|
|
56
|
-
handle.async = handleAsync;
|
|
57
|
-
var skip = Symbol("skip");
|
|
58
|
-
function transduceSync(list, transformer) {
|
|
59
|
-
const transduced = [];
|
|
60
|
-
for (const [i, element_] of list.entries()) {
|
|
61
|
-
const transformed = transformer(element_, i);
|
|
62
|
-
if (transformed !== skip) {
|
|
63
|
-
transduced[transduced.length] = transformed;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return transduced;
|
|
67
|
-
}
|
|
68
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, transduceSync, "transduceSync");
|
|
69
|
-
async function transduceAsync(list, transformer) {
|
|
70
|
-
const transduced = [];
|
|
71
|
-
await Promise.all(list.entries().map(async ([i, element_]) => {
|
|
72
|
-
const transformed = await transformer(element_, i);
|
|
73
|
-
if (transformed !== skip) {
|
|
74
|
-
transduced[transduced.length] = transformed;
|
|
75
|
-
}
|
|
76
|
-
}));
|
|
77
|
-
return transduced;
|
|
78
|
-
}
|
|
79
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, transduceAsync, "transduceAsync");
|
|
80
|
-
var Filter = /* @__PURE__ */ _chunkWGEGR3DFcjs.__name.call(void 0, (filter) => (item) => {
|
|
81
|
-
return filter(item) ? item : skip;
|
|
82
|
-
}, "Filter");
|
|
83
|
-
var Mapper = /* @__PURE__ */ _chunkWGEGR3DFcjs.__name.call(void 0, (mapper) => (item) => {
|
|
84
|
-
return mapper(item);
|
|
85
|
-
}, "Mapper");
|
|
86
|
-
var transduce = transduceSync;
|
|
87
|
-
transduce.async = transduceAsync;
|
|
88
|
-
function pipeSync(fn, ...fns) {
|
|
89
|
-
return (...args) => {
|
|
90
|
-
let result = fn(...args);
|
|
91
|
-
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
92
|
-
result = _optionalChain([fns, 'access', _ => _[i], 'optionalCall', _2 => _2(result)]);
|
|
93
|
-
}
|
|
94
|
-
return result;
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, pipeSync, "pipeSync");
|
|
98
|
-
function pipeAsync(fn, ...fns) {
|
|
99
|
-
return async (...args) => {
|
|
100
|
-
let result = await fn(...args);
|
|
101
|
-
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
102
|
-
result = await _optionalChain([fns, 'access', _3 => _3[i], 'optionalCall', _4 => _4(result)]);
|
|
103
|
-
}
|
|
104
|
-
return result;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, pipeAsync, "pipeAsync");
|
|
108
|
-
var pipe = pipeSync;
|
|
109
|
-
pipe.async = pipeAsync;
|
|
110
|
-
|
|
111
|
-
// src/build.ts
|
|
112
|
-
var resolveOptions = /* @__PURE__ */ _chunkWGEGR3DFcjs.__name.call(void 0, async (options) => {
|
|
113
|
-
const projectRoot = options.projectRoot;
|
|
114
|
-
const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
|
|
115
|
-
if (!workspaceRoot) {
|
|
116
|
-
throw new Error("Cannot find Nx workspace root");
|
|
117
|
-
}
|
|
118
|
-
const nxJsonPath = _devkit.joinPathFragments.call(void 0, workspaceRoot.dir, "nx.json");
|
|
119
|
-
if (!await _node.hfs.isFile(nxJsonPath)) {
|
|
120
|
-
throw new Error("Cannot find Nx workspace configuration");
|
|
121
|
-
}
|
|
122
|
-
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
123
|
-
exitOnError: true
|
|
124
|
-
});
|
|
125
|
-
const projectJsonPath = _devkit.joinPathFragments.call(void 0, workspaceRoot.dir, projectRoot, "project.json");
|
|
126
|
-
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
127
|
-
throw new Error("Cannot find project.json configuration");
|
|
128
|
-
}
|
|
129
|
-
const projectJson = await _node.hfs.json(projectJsonPath);
|
|
130
|
-
const projectName = projectJson.name;
|
|
131
|
-
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
132
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _5 => _5.projects, 'optionalAccess', _6 => _6[projectName]])) {
|
|
133
|
-
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
134
|
-
}
|
|
135
|
-
const config = await _configtools.loadStormConfig.call(void 0, workspaceRoot.dir);
|
|
136
|
-
return {
|
|
137
|
-
..._chunkD5PRB2E2cjs.DEFAULT_BUILD_OPTIONS,
|
|
138
|
-
config,
|
|
139
|
-
format: "cjs",
|
|
140
|
-
outExtension: {
|
|
141
|
-
".js": ".js"
|
|
142
|
-
},
|
|
143
|
-
resolveExtensions: [
|
|
144
|
-
".ts",
|
|
145
|
-
".js",
|
|
146
|
-
".node"
|
|
147
|
-
],
|
|
148
|
-
mainFields: [
|
|
149
|
-
"module",
|
|
150
|
-
"main"
|
|
151
|
-
],
|
|
152
|
-
...options,
|
|
153
|
-
entryPoints: options.entryPoints || [
|
|
154
|
-
"./src/index.ts"
|
|
155
|
-
],
|
|
156
|
-
outdir: options.outdir || _devkit.joinPathFragments.call(void 0, workspaceRoot.dir, "dist", projectRoot),
|
|
157
|
-
plugins: [
|
|
158
|
-
..._nullishCoalesce(options.plugins, () => ( [])),
|
|
159
|
-
_chunkBF5W6GVPcjs.resolvePathsPlugin,
|
|
160
|
-
_chunkDFGHPRBDcjs.fixImportsPlugin,
|
|
161
|
-
_chunkJ34FQYKVcjs.esmSplitCodeToCjsPlugin,
|
|
162
|
-
_chunk263L44RMcjs.tscPlugin.call(void 0, options.emitTypes),
|
|
163
|
-
_chunkMVLEDP7Kcjs.onErrorPlugin
|
|
164
|
-
],
|
|
165
|
-
external: [
|
|
166
|
-
..._nullishCoalesce(options.external, () => ( []))
|
|
167
|
-
],
|
|
168
|
-
name: `${options.name || projectName}-${options.format || "cjs"}`,
|
|
169
|
-
projectConfigurations,
|
|
170
|
-
projectName,
|
|
171
|
-
projectGraph,
|
|
172
|
-
workspaceRoot,
|
|
173
|
-
sourceRoot: options.sourceRoot || _devkit.joinPathFragments.call(void 0, workspaceRoot.dir, projectRoot, "src")
|
|
174
|
-
};
|
|
175
|
-
}, "resolveOptions");
|
|
176
|
-
var generatePackageJson = /* @__PURE__ */ _chunkWGEGR3DFcjs.__name.call(void 0, async (options) => {
|
|
177
|
-
if (options.generatePackageJson !== false && await _node.hfs.isFile(_devkit.joinPathFragments.call(void 0, options.projectRoot, "package.json"))) {
|
|
178
|
-
_configtools.writeDebug.call(void 0, "\u270D\uFE0F Writing package.json file", options.config);
|
|
179
|
-
const packageJsonPath = _devkit.joinPathFragments.call(void 0, options.projectRoot, "project.json");
|
|
180
|
-
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
181
|
-
throw new Error("Cannot find package.json configuration");
|
|
182
|
-
}
|
|
183
|
-
let packageJson = await _node.hfs.json(_devkit.joinPathFragments.call(void 0, options.workspaceRoot.dir, options.projectRoot, "package.json"));
|
|
184
|
-
if (!packageJson) {
|
|
185
|
-
throw new Error("Cannot find package.json configuration file");
|
|
186
|
-
}
|
|
187
|
-
packageJson = await _buildtools.addPackageDependencies.call(void 0, options.workspaceRoot.dir, options.projectRoot, options.projectName, packageJson);
|
|
188
|
-
packageJson = await _buildtools.addWorkspacePackageJsonFields.call(void 0, options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
|
|
189
|
-
let entryPoints = [
|
|
190
|
-
{
|
|
191
|
-
in: "./src/index.ts",
|
|
192
|
-
out: "./src/index.ts"
|
|
193
|
-
}
|
|
194
|
-
];
|
|
195
|
-
if (options.entryPoints) {
|
|
196
|
-
if (Array.isArray(options.entryPoints)) {
|
|
197
|
-
entryPoints = options.entryPoints.map((entryPoint) => typeof entryPoint === "string" ? {
|
|
198
|
-
in: entryPoint,
|
|
199
|
-
out: entryPoint
|
|
200
|
-
} : entryPoint);
|
|
201
|
-
} else {
|
|
202
|
-
entryPoints = Object.entries(options.entryPoints).map(([key, value]) => ({
|
|
203
|
-
in: key,
|
|
204
|
-
out: value
|
|
205
|
-
}));
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
for (const entryPoint of entryPoints) {
|
|
209
|
-
const split = entryPoint.out.split(".");
|
|
210
|
-
split.pop();
|
|
211
|
-
const entry = split.join(".").replaceAll("\\", "/");
|
|
212
|
-
packageJson.exports[`./${entry}`] ??= _buildtools.addPackageJsonExport.call(void 0, entry);
|
|
213
|
-
}
|
|
214
|
-
packageJson.exports["./package.json"] ??= "./package.json";
|
|
215
|
-
packageJson.exports["."] ??= _buildtools.addPackageJsonExport.call(void 0, "./src/index.ts");
|
|
216
|
-
packageJson.main = "./dist/index.cjs";
|
|
217
|
-
packageJson.module = "./dist/index.js";
|
|
218
|
-
packageJson.types = "./dist/index.d.ts";
|
|
219
|
-
await _devkit.writeJsonFile.call(void 0, _devkit.joinPathFragments.call(void 0, options.outdir, "package.json"), packageJson);
|
|
220
|
-
}
|
|
221
|
-
return options;
|
|
222
|
-
}, "generatePackageJson");
|
|
223
|
-
async function createOptions(options) {
|
|
224
|
-
return _estoolkit.flatten.call(void 0, await Promise.all(_compat.map.call(void 0, options, (options2) => [
|
|
225
|
-
// we defer it so that we don't trigger glob immediately
|
|
226
|
-
() => resolveOptions(options2)
|
|
227
|
-
])));
|
|
228
|
-
}
|
|
229
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, createOptions, "createOptions");
|
|
230
|
-
async function computeOptions(options) {
|
|
231
|
-
return options();
|
|
232
|
-
}
|
|
233
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, computeOptions, "computeOptions");
|
|
234
|
-
async function executeEsBuild(options) {
|
|
235
|
-
const stopwatch = _configtools.getStopwatch.call(void 0, `${options.name} build`);
|
|
236
|
-
if (process.env.WATCH === "true") {
|
|
237
|
-
const context2 = await esbuild.context(_estoolkit.omit.call(void 0, options, [
|
|
238
|
-
"name",
|
|
239
|
-
"emitTypes",
|
|
240
|
-
"emitMetafile"
|
|
241
|
-
]));
|
|
242
|
-
watch(context2, options);
|
|
243
|
-
}
|
|
244
|
-
const result = await esbuild.build(_estoolkit.omit.call(void 0, options, [
|
|
245
|
-
"name",
|
|
246
|
-
"emitTypes",
|
|
247
|
-
"emitMetafile"
|
|
248
|
-
]));
|
|
249
|
-
if (result.metafile && options.emitMetafile) {
|
|
250
|
-
const metafilePath = `${options.outdir}/${options.name}.meta.json`;
|
|
251
|
-
await _node.hfs.write(metafilePath, JSON.stringify(result.metafile));
|
|
252
|
-
}
|
|
253
|
-
stopwatch();
|
|
254
|
-
return [
|
|
255
|
-
options,
|
|
256
|
-
result
|
|
257
|
-
];
|
|
258
|
-
}
|
|
259
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
260
|
-
async function copyBuildAssets([options, result]) {
|
|
261
|
-
if (result.errors.length === 0) {
|
|
262
|
-
await _buildtools.copyAssets.call(void 0, options.config, _nullishCoalesce(options.assets, () => ( [])), options.outdir, options.projectRoot, options.projectName, options.sourceRoot, true, false);
|
|
263
|
-
}
|
|
264
|
-
return [
|
|
265
|
-
options,
|
|
266
|
-
result
|
|
267
|
-
];
|
|
268
|
-
}
|
|
269
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
270
|
-
async function reportResults([options, result]) {
|
|
271
|
-
if (result.errors.length === 0) {
|
|
272
|
-
if (result.warnings.length > 0) {
|
|
273
|
-
_configtools.writeWarning.call(void 0, `The following warnings occurred during the build: ${result.warnings.map((warning) => warning.text).join("\n")}`, options.config);
|
|
274
|
-
}
|
|
275
|
-
_configtools.writeSuccess.call(void 0, `The ${options.name} build completed successfully`, options.config);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, reportResults, "reportResults");
|
|
279
|
-
async function dependencyCheck(options) {
|
|
280
|
-
if (process.env.DEV === "true") return void 0;
|
|
281
|
-
if (process.env.CI && !process.env.BUILDKITE) return void 0;
|
|
282
|
-
const buildPromise = esbuild.build({
|
|
283
|
-
entryPoints: _globby.globbySync.call(void 0, "**/*.{j,t}s", {
|
|
284
|
-
// We don't check dependencies in ecosystem tests because tests are isolated from the build.
|
|
285
|
-
ignore: [
|
|
286
|
-
"./src/__tests__/**/*",
|
|
287
|
-
"./tests/e2e/**/*",
|
|
288
|
-
"./dist/**/*"
|
|
289
|
-
],
|
|
290
|
-
gitignore: true
|
|
291
|
-
}),
|
|
292
|
-
logLevel: "silent",
|
|
293
|
-
bundle: true,
|
|
294
|
-
write: false,
|
|
295
|
-
outdir: "out",
|
|
296
|
-
plugins: [
|
|
297
|
-
_chunkKVBDKVBUcjs.depsCheckPlugin.call(void 0, options.bundle)
|
|
298
|
-
]
|
|
299
|
-
});
|
|
300
|
-
await buildPromise.catch(() => {
|
|
301
|
-
});
|
|
302
|
-
return void 0;
|
|
303
|
-
}
|
|
304
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, dependencyCheck, "dependencyCheck");
|
|
305
|
-
async function build2(options) {
|
|
306
|
-
const stopwatch = _configtools.getStopwatch.call(void 0, "full build");
|
|
307
|
-
try {
|
|
308
|
-
void transduce.async(options, dependencyCheck);
|
|
309
|
-
await transduce.async(await createOptions(options), pipe.async(computeOptions, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
|
|
310
|
-
} catch (error) {
|
|
311
|
-
_configtools.writeFatal.call(void 0, "Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
312
|
-
}
|
|
313
|
-
stopwatch();
|
|
314
|
-
}
|
|
315
|
-
_chunkWGEGR3DFcjs.__name.call(void 0, build2, "build");
|
|
316
|
-
var watch = /* @__PURE__ */ _chunkWGEGR3DFcjs.__name.call(void 0, (context2, options) => {
|
|
317
|
-
if (process.env.WATCH !== "true") return context2;
|
|
318
|
-
const config = {
|
|
319
|
-
ignoreInitial: true,
|
|
320
|
-
useFsEvents: true,
|
|
321
|
-
ignored: [
|
|
322
|
-
"./src/__tests__/**/*",
|
|
323
|
-
"./package.json"
|
|
324
|
-
]
|
|
325
|
-
};
|
|
326
|
-
const changeWatcher = _chokidar.watch.call(void 0, [
|
|
327
|
-
"./src/**/*"
|
|
328
|
-
], config);
|
|
329
|
-
const fastRebuild = _estoolkit.debounce.call(void 0, async () => {
|
|
330
|
-
const timeBefore = Date.now();
|
|
331
|
-
const rebuildResult = await handle.async(() => {
|
|
332
|
-
return context2.rebuild();
|
|
333
|
-
});
|
|
334
|
-
if (rebuildResult instanceof Error) {
|
|
335
|
-
_configtools.writeError.call(void 0, rebuildResult.message);
|
|
336
|
-
}
|
|
337
|
-
_configtools.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
338
|
-
}, 10);
|
|
339
|
-
changeWatcher.on("change", fastRebuild);
|
|
340
|
-
return void 0;
|
|
341
|
-
}, "watch");
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
exports.handle = handle; exports.skip = skip; exports.Filter = Filter; exports.Mapper = Mapper; exports.transduce = transduce; exports.pipe = pipe; exports.build = build2;
|
|
352
|
-
//# sourceMappingURL=chunk-PBHOTQGA.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/chunk-PBHOTQGA.cjs","../src/build.ts","../src/utilities/helpers.ts"],"names":["handleSync","fn","error_","handleAsync","handle","async","skip","Symbol","transduceSync","list","transformer","transduced","i","element_","entries","transformed","length","transduceAsync","Promise","all","map","Filter","filter","item","Mapper","mapper","transduce","pipeSync","fns","args","result","pipeAsync","pipe","resolveOptions","options","projectRoot","workspaceRoot","findWorkspaceRoot","Error","nxJsonPath","joinPathFragments","dir","hfs","isFile","projectGraph","createProjectGraphAsync","exitOnError","projectJsonPath","projectJson","json","projectName","name","projectConfigurations","readProjectsConfigurationFromProjectGraph","projects","config","loadStormConfig","DEFAULT_BUILD_OPTIONS","format","outExtension","resolveExtensions","mainFields","entryPoints","outdir","plugins","resolvePathsPlugin","fixImportsPlugin","esmSplitCodeToCjsPlugin","tscPlugin","emitTypes","onErrorPlugin","external","sourceRoot","generatePackageJson","writeDebug","packageJsonPath","packageJson","in","out","Array","split","writeJsonFile","flatten","createOptions","computeOptions","stopwatch","process","context","metafilePath","executeEsBuild","copyAssets","copyBuildAssets","writeWarning","writeSuccess","reportResults","buildPromise","ignore","gitignore","logLevel","bundle","depsCheckPlugin","undefined","dependencyCheck","error","writeFatal","build","watch","ignoreInitial","useFsEvents","ignored","changeWatcher","fastRebuild","timeBefore","rebuildResult","writeError","writeTrace"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACRA,qCAAoB;AACpB,oCAKO;AACP,yDAKO;AACP,2DASO;AACP,oCAAuC;AACvC,uCAAwC;AACxC,2CAAoB;AACpB,mFAAyB;AAEzB,gCAA2B;AAC3B,qEAAkC;ADVlC;AACA;AEpBA,SAASA,UAAAA,CAAyBC,EAAAA,EAAW;AAC3C,EAAA,IAAI;AACF,IAAA,OAAOA,EAAAA,CAAAA,CAAAA;AFsBX,EErBE,EAAA,MAAA,CAASC,MAAAA,EAAiB;AACxB,IAAA,OAAOA,MAAAA;AFsBX,EErBE;AACF;AANSF,sCAAAA,UAAAA,EAAAA,YAAAA,CAAAA;AAQT,MAAA,SAAeG,WAAAA,CACbF,EAAAA,EAAwB;AAExB,EAAA,IAAI;AACF,IAAA,OAAO,MAAMA,EAAAA,CAAAA,CAAAA;AFoBjB,EEnBE,EAAA,MAAA,CAASC,MAAAA,EAAiB;AACxB,IAAA,OAAOA,MAAAA;AFoBX,EEnBE;AACF;AAReC,sCAAAA,WAAAA,EAAAA,aAAAA,CAAAA;AAcf,IAAMC,OAAAA,EAASJ,UAAAA;AAIfI,MAAAA,CAAOC,MAAAA,EAAQF,WAAAA;AAIf,IAAMG,KAAAA,EA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ACA;AACA;AACA;AACA","file":"/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/chunk-PBHOTQGA.cjs","sourcesContent":[null,"/*-------------------------------------------------------------------\n\n ⚡ Storm Software - Storm Stack\n\n This code was released as part of the Storm Stack project. Storm Stack\n is maintained by Storm Software under the Apache-2.0 License, and is\n free for commercial and private use. For more information, please visit\n our licensing page.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/storm-ops\n Documentation: https://stormsoftware.com/projects/storm-ops/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/storm-ops/license\n\n -------------------------------------------------------------------*/\n\nimport { hfs } from \"@humanfs/node\";\nimport {\n createProjectGraphAsync,\n joinPathFragments,\n readProjectsConfigurationFromProjectGraph,\n writeJsonFile\n} from \"@nx/devkit\";\nimport {\n addPackageDependencies,\n addPackageJsonExport,\n addWorkspacePackageJsonFields,\n copyAssets\n} from \"@storm-software/build-tools\";\nimport {\n getStopwatch,\n loadStormConfig,\n writeDebug,\n writeError,\n writeFatal,\n writeSuccess,\n writeTrace,\n writeWarning\n} from \"@storm-software/config-tools\";\nimport { watch as createWatcher } from \"chokidar\";\nimport { debounce, flatten, omit } from \"es-toolkit\";\nimport { map } from \"es-toolkit/compat\";\nimport * as esbuild from \"esbuild\";\nimport { BuildContext } from \"esbuild\";\nimport { globbySync } from \"globby\";\nimport { findWorkspaceRoot } from \"nx/src/utils/find-workspace-root\";\nimport { DEFAULT_BUILD_OPTIONS } from \"./config\";\nimport { depsCheckPlugin } from \"./plugins/deps-check\";\nimport { esmSplitCodeToCjsPlugin } from \"./plugins/esm-split-code-to-cjs\";\nimport { fixImportsPlugin } from \"./plugins/fix-imports\";\nimport { onErrorPlugin } from \"./plugins/on-error\";\nimport { resolvePathsPlugin } from \"./plugins/resolve-paths\";\nimport { tscPlugin } from \"./plugins/tsc\";\nimport { ESBuildResolvedOptions, type ESBuildOptions } from \"./types\";\nimport { handle, pipe, transduce } from \"./utilities/helpers\";\n\n/**\n * Apply defaults to the original build options\n *\n * @param options - the original build options\n * @returns the build options with defaults applied\n */\nconst resolveOptions = async (\n options: ESBuildOptions\n): Promise<ESBuildResolvedOptions> => {\n const projectRoot = options.projectRoot;\n\n const workspaceRoot = findWorkspaceRoot(projectRoot);\n if (!workspaceRoot) {\n throw new Error(\"Cannot find Nx workspace root\");\n }\n\n const nxJsonPath = joinPathFragments(workspaceRoot.dir, \"nx.json\");\n if (!(await hfs.isFile(nxJsonPath))) {\n throw new Error(\"Cannot find Nx workspace configuration\");\n }\n\n const projectGraph = await createProjectGraphAsync({\n exitOnError: true\n });\n\n const projectJsonPath = joinPathFragments(\n workspaceRoot.dir,\n projectRoot,\n \"project.json\"\n );\n if (!(await hfs.isFile(projectJsonPath))) {\n throw new Error(\"Cannot find project.json configuration\");\n }\n\n const projectJson = await hfs.json(projectJsonPath);\n const projectName = projectJson.name;\n\n const projectConfigurations =\n readProjectsConfigurationFromProjectGraph(projectGraph);\n if (!projectConfigurations?.projects?.[projectName]) {\n throw new Error(\n \"The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.\"\n );\n }\n\n const config = await loadStormConfig(workspaceRoot.dir);\n\n return {\n ...DEFAULT_BUILD_OPTIONS,\n config,\n format: \"cjs\",\n outExtension: { \".js\": \".js\" },\n resolveExtensions: [\".ts\", \".js\", \".node\"],\n mainFields: [\"module\", \"main\"],\n ...options,\n entryPoints: options.entryPoints || [\"./src/index.ts\"],\n outdir:\n options.outdir ||\n joinPathFragments(workspaceRoot.dir, \"dist\", projectRoot),\n plugins: [\n ...(options.plugins ?? []),\n resolvePathsPlugin,\n fixImportsPlugin,\n esmSplitCodeToCjsPlugin,\n tscPlugin(options.emitTypes),\n onErrorPlugin\n ],\n external: [...(options.external ?? [])],\n name: `${options.name || projectName}-${options.format || \"cjs\"}`,\n projectConfigurations,\n projectName,\n projectGraph,\n workspaceRoot,\n sourceRoot:\n options.sourceRoot ||\n joinPathFragments(workspaceRoot.dir, projectRoot, \"src\")\n };\n};\n\nconst generatePackageJson = async (options: ESBuildResolvedOptions) => {\n if (\n options.generatePackageJson !== false &&\n (await hfs.isFile(joinPathFragments(options.projectRoot, \"package.json\")))\n ) {\n writeDebug(\"✍️ Writing package.json file\", options.config);\n\n const packageJsonPath = joinPathFragments(\n options.projectRoot,\n \"project.json\"\n );\n if (!(await hfs.isFile(packageJsonPath))) {\n throw new Error(\"Cannot find package.json configuration\");\n }\n\n let packageJson = await hfs.json(\n joinPathFragments(\n options.workspaceRoot.dir,\n options.projectRoot,\n \"package.json\"\n )\n );\n if (!packageJson) {\n throw new Error(\"Cannot find package.json configuration file\");\n }\n\n packageJson = await addPackageDependencies(\n options.workspaceRoot.dir,\n options.projectRoot,\n options.projectName,\n packageJson\n );\n\n packageJson = await addWorkspacePackageJsonFields(\n options.config,\n options.projectRoot,\n options.sourceRoot,\n options.projectName,\n false,\n packageJson\n );\n\n let entryPoints = [{ in: \"./src/index.ts\", out: \"./src/index.ts\" }];\n if (options.entryPoints) {\n if (Array.isArray(options.entryPoints)) {\n entryPoints = (\n options.entryPoints as (string | { in: string; out: string })[]\n ).map(entryPoint =>\n typeof entryPoint === \"string\"\n ? { in: entryPoint, out: entryPoint }\n : entryPoint\n );\n } else {\n entryPoints = Object.entries(options.entryPoints).map(\n ([key, value]) => ({\n in: key,\n out: value\n })\n );\n }\n }\n\n for (const entryPoint of entryPoints) {\n const split = entryPoint.out.split(\".\");\n split.pop();\n const entry = split.join(\".\").replaceAll(\"\\\\\", \"/\");\n\n packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry);\n }\n\n packageJson.exports[\"./package.json\"] ??= \"./package.json\";\n packageJson.exports[\".\"] ??= addPackageJsonExport(\"./src/index.ts\");\n\n packageJson.main = \"./dist/index.cjs\";\n packageJson.module = \"./dist/index.js\";\n packageJson.types = \"./dist/index.d.ts\";\n\n await writeJsonFile(\n joinPathFragments(options.outdir, \"package.json\"),\n packageJson\n );\n }\n\n return options;\n};\n\n/**\n * Create two deferred builds for esm and cjs. The one follows the other:\n * - 1. The code gets compiled to an optimized tree-shaken esm output\n * - 2. We take that output and compile it to an optimized cjs output\n *\n * @param options - the original build options\n * @returns if options = [a, b], we get [a-esm, a-cjs, b-esm, b-cjs]\n */\nasync function createOptions(options: ESBuildOptions[]) {\n return flatten(\n await Promise.all(\n map(options, options => [\n // we defer it so that we don't trigger glob immediately\n () => resolveOptions(options)\n ])\n )\n );\n}\n\n/**\n * We only want to trigger the glob search once we are ready, and that is when\n * the previous build has finished. We get the build options from the deferred.\n */\nasync function computeOptions(\n options: () => Promise<ESBuildResolvedOptions>\n): Promise<ESBuildResolvedOptions> {\n return options();\n}\n\n// /**\n// * Extensions are not automatically by esbuild set for `options.outfile`. We\n// * look at the set `options.outExtension` and we add that to `options.outfile`.\n// */\n// function addExtensionFormat(options: ESBuildOptions) {\n// if (options.outfile && options.outExtension) {\n// const ext = options.outExtension[\".js\"];\n\n// options.outfile = `${options.outfile}${ext}`;\n// }\n\n// return options;\n// }\n\n// /**\n// * If we don't have `options.outfile`, we default `options.outdir`\n// */\n// function addDefaultOutDir(options: ESBuildOptions) {\n// if (options.outfile === undefined) {\n// options.outdir = getOutDir(options);\n// }\n\n// return options;\n// }\n\n/**\n * Execute esbuild with all the configurations we pass\n */\nasync function executeEsBuild(options: ESBuildResolvedOptions) {\n const stopwatch = getStopwatch(`${options.name} build`);\n\n if (process.env.WATCH === \"true\") {\n const context = await esbuild.context(\n omit(options, [\"name\", \"emitTypes\", \"emitMetafile\"]) as any\n );\n\n watch(context, options);\n }\n\n const result = await esbuild.build(\n omit(options, [\"name\", \"emitTypes\", \"emitMetafile\"]) as any\n );\n\n if (result.metafile && options.emitMetafile) {\n const metafilePath = `${options.outdir}/${options.name}.meta.json`;\n await hfs.write(metafilePath, JSON.stringify(result.metafile));\n }\n\n stopwatch();\n\n return [options, result] as const;\n}\n\n/**\n * Copy the assets to the build directory\n */\nasync function copyBuildAssets([options, result]: [\n ESBuildResolvedOptions,\n esbuild.BuildResult\n]) {\n if (result.errors.length === 0) {\n await copyAssets(\n options.config,\n options.assets ?? [],\n options.outdir,\n options.projectRoot,\n options.projectName,\n options.sourceRoot,\n true,\n false\n );\n }\n\n return [options, result] as const;\n}\n\n/**\n * Report the results of the build\n */\nasync function reportResults([options, result]: [\n ESBuildResolvedOptions,\n esbuild.BuildResult\n]) {\n if (result.errors.length === 0) {\n if (result.warnings.length > 0) {\n writeWarning(\n `The following warnings occurred during the build: ${result.warnings\n .map(warning => warning.text)\n .join(\"\\n\")}`,\n options.config\n );\n }\n\n writeSuccess(\n `The ${options.name} build completed successfully`,\n options.config\n );\n }\n}\n\n/**\n * A blank esbuild run to do an analysis of our deps\n */\nasync function dependencyCheck(options: ESBuildResolvedOptions) {\n // we only check our dependencies for a full build\n if (process.env.DEV === \"true\") return undefined;\n // Only run on test and publish pipelines on Buildkite\n // Meaning we skip on GitHub Actions\n // Because it's slow and runs for each job, during setup, making each job slower\n if (process.env.CI && !process.env.BUILDKITE) return undefined;\n\n // we need to bundle everything to do the analysis\n const buildPromise = esbuild.build({\n entryPoints: globbySync(\"**/*.{j,t}s\", {\n // We don't check dependencies in ecosystem tests because tests are isolated from the build.\n ignore: [\"./src/__tests__/**/*\", \"./tests/e2e/**/*\", \"./dist/**/*\"],\n gitignore: true\n }),\n logLevel: \"silent\", // there will be errors\n bundle: true, // we bundle to get everything\n write: false, // no need to write for analysis\n outdir: \"out\",\n plugins: [depsCheckPlugin(options.bundle)]\n });\n\n // we absolutely don't care if it has any errors\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n await buildPromise.catch(() => {});\n\n return undefined;\n}\n\n/**\n * Execution pipeline that applies a set of actions\n *\n * @param options - the build options\n * @returns the build result\n */\nexport async function build(options: ESBuildOptions[]) {\n const stopwatch = getStopwatch(\"full build\");\n\n try {\n void transduce.async(options, dependencyCheck);\n\n await transduce.async(\n await createOptions(options),\n pipe.async(\n computeOptions,\n generatePackageJson,\n executeEsBuild,\n copyBuildAssets,\n reportResults\n )\n );\n } catch (error) {\n writeFatal(\n \"Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.\"\n );\n }\n\n stopwatch();\n}\n\n/**\n * Executes the build and rebuilds what is necessary\n *\n * @param context - the build context\n * @param options - the build options\n * @returns the build result\n */\nconst watch = (context: BuildContext, options: ESBuildResolvedOptions) => {\n if (process.env.WATCH !== \"true\") return context;\n\n // common chokidar options for the watchers\n const config = {\n ignoreInitial: true,\n useFsEvents: true,\n ignored: [\"./src/__tests__/**/*\", \"./package.json\"]\n };\n\n // prepare the incremental builds watcher\n const changeWatcher = createWatcher([\"./src/**/*\"], config);\n\n // triggers quick rebuild on file change\n const fastRebuild = debounce(async () => {\n const timeBefore = Date.now();\n\n // we handle possible rebuild exceptions\n const rebuildResult = await handle.async(() => {\n return context.rebuild();\n });\n\n if (rebuildResult instanceof Error) {\n writeError(rebuildResult.message);\n }\n\n writeTrace(`${Date.now() - timeBefore}ms [${options.name ?? \"\"}]`);\n }, 10);\n\n changeWatcher.on(\"change\", fastRebuild);\n\n return undefined;\n};\n\n// Utils ::::::::::::::::::::::::::::::::::::::::::::::::::\n\n// get the current project externals this helps to mark dependencies as external\n// by having convention in the package.json (dev = bundled, non-dev = external)\n// function getProjectExternals(options: ESBuildOptions) {\n// const pkg = require(`${process.cwd()}/package.json`);\n// const peerDeps = Object.keys(pkg.peerDependencies ?? {});\n// const regDeps = Object.keys(pkg.dependencies ?? {});\n\n// // when bundling, only the devDeps will be bundled\n// if (!process.env.IGNORE_EXTERNALS && options.bundle === true) {\n// return [...new Set([...peerDeps, ...regDeps])];\n// }\n\n// // otherwise, all the dependencies will be bundled\n// return [];\n// }\n","/*-------------------------------------------------------------------\n\n ⚡ Storm Software - Storm Stack\n\n This code was released as part of the Storm Stack project. Storm Stack\n is maintained by Storm Software under the Apache-2.0 License, and is\n free for commercial and private use. For more information, please visit\n our licensing page.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/storm-ops\n Documentation: https://stormsoftware.com/projects/storm-ops/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/storm-ops/license\n\n -------------------------------------------------------------------*/\n\nfunction handleSync<R, E = Error>(fn: () => R): R | E {\n try {\n return fn();\n } catch (error_: unknown) {\n return error_ as E;\n }\n}\n\nasync function handleAsync<R, E = Error>(\n fn: () => Promise<R> | R\n): Promise<R | E> {\n try {\n return await fn();\n } catch (error_: unknown) {\n return error_ as E;\n }\n}\n\n/**\n * Executes a function, catches exceptions, and returns any outcome.\n * @param fn - to be executed\n */\nconst handle = handleSync as typeof handleSync & {\n async: typeof handleAsync;\n};\n\nhandle.async = handleAsync;\n\nexport { handle };\n\nconst skip = Symbol(\"skip\");\n\ntype SyncTransformer<I, R> = (item: I, key: number) => R | typeof skip;\ntype ASyncTransformer<I, R> = (\n item: I,\n key: number\n) => Promise<R | typeof skip>;\n\nfunction transduceSync<I, R>(\n list: Array<I>,\n transformer: SyncTransformer<I, R>\n) {\n const transduced = [] as R[];\n\n for (const [i, element_] of list.entries()) {\n const transformed = transformer(element_, i);\n\n if (transformed !== skip) {\n transduced[transduced.length] = transformed;\n }\n }\n\n return transduced;\n}\n\nasync function transduceAsync<I, R>(\n list: Array<I>,\n transformer: ASyncTransformer<I, R>\n) {\n const transduced = [] as R[];\n\n await Promise.all(\n list.entries().map(async ([i, element_]) => {\n const transformed = await transformer(element_, i);\n\n if (transformed !== skip) {\n transduced[transduced.length] = transformed;\n }\n })\n );\n\n return transduced;\n}\n\nconst Filter =\n <I>(filter: (item: I) => boolean) =>\n (item: I) => {\n return filter(item) ? item : (skip as never);\n };\n\nconst Mapper =\n <I, R>(mapper: (item: I) => R) =>\n (item: I) => {\n return mapper(item);\n };\n\n/**\n * Transducers enable efficient data processing. They allow the composition of\n * mappers and filters to be applied on a list. And this is applied in a single\n * pass, that's the efficient pipeline processing.\n *\n * (does not reduce at the same time)\n *\n * @see https://medium.com/javascript-scene/7985330fe73d\n *\n * @param list - to transform\n * @param transformer - to apply\n\n * @example\n * ```ts\n * const filterEven = Filter(<U>(unit: U) =>\n * typeof unit === 'number' ? !(unit % 2) : true,\n * )\n * const mapTimes2 = Mapper(<U>(unit: U) =>\n * typeof unit === 'number' ? unit * 2 : unit,\n * )\n * const mapString = Mapper(<U>(unit: U) => `${unit}`)\n *\n * const test0 = transduce(\n * [1, 2, 3, 4, 5, 6, 7, 'a'],\n * pipe(filterEven, mapTimes2, mapTimes2, mapString, filterEven),\n * )\n * ```\n */\nconst transduce = transduceSync as typeof transduceSync & {\n async: typeof transduceAsync;\n};\n\ntransduce.async = transduceAsync;\n\nexport { Filter, Mapper, skip, transduce };\n\ntype FunctionLike<P extends Array<any> = any, R = any> = (...args: P) => R;\ntype Await<P> = P extends Promise<infer A> ? A : P;\n\nfunction pipeSync(fn: FunctionLike, ...fns: FunctionLike[]) {\n return (...args: unknown[]) => {\n let result = fn(...args);\n\n for (let i = 0; result !== skip && i < fns.length; ++i) {\n result = fns[i]?.(result);\n }\n\n return result;\n };\n}\n\nfunction pipeAsync(fn: FunctionLike, ...fns: FunctionLike[]) {\n return async (...args: unknown[]) => {\n let result = await fn(...args);\n\n for (let i = 0; result !== skip && i < fns.length; ++i) {\n // eslint-disable-next-line no-await-in-loop\n result = await fns[i]?.(result);\n }\n\n return result;\n };\n}\n\n/**\n * Pipe the input and output of functions.\n *\n * @param fn - parameter-taking function\n * @param fns - subsequent piped functions\n * @returns\n */\nconst pipe = pipeSync as PipeMultiSync & {\n async: PipeMultiAsync;\n};\n\npipe.async = pipeAsync;\n\n// TODO: use the one from ts-toolbelt (broken atm since ts 4.1)\nexport declare type PipeMultiSync = {\n <R0, P extends any[]>(...fns: [FunctionLike<P, R0>]): FunctionLike<P, R0>;\n <R0, R1, P extends any[]>(\n ...fns: [FunctionLike<P, R0>, FunctionLike<[R0], R1>]\n ): FunctionLike<P, R1>;\n <R0, R1, R2, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[R0], R1>,\n FunctionLike<[R1], R2>\n ]\n ): FunctionLike<P, R2>;\n <R0, R1, R2, R3, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[R0], R1>,\n FunctionLike<[R1], R2>,\n FunctionLike<[R2], R3>\n ]\n ): FunctionLike<P, R3>;\n <R0, R1, R2, R3, R4, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[R0], R1>,\n FunctionLike<[R1], R2>,\n FunctionLike<[R2], R3>,\n FunctionLike<[R3], R4>\n ]\n ): FunctionLike<P, R4>;\n <R0, R1, R2, R3, R4, R5, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[R0], R1>,\n FunctionLike<[R1], R2>,\n FunctionLike<[R2], R3>,\n FunctionLike<[R3], R4>,\n FunctionLike<[R4], R5>\n ]\n ): FunctionLike<P, R5>;\n <R0, R1, R2, R3, R4, R5, R6, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[R0], R1>,\n FunctionLike<[R1], R2>,\n FunctionLike<[R2], R3>,\n FunctionLike<[R3], R4>,\n FunctionLike<[R4], R5>,\n FunctionLike<[R5], R6>\n ]\n ): FunctionLike<P, R6>;\n <R0, R1, R2, R3, R4, R5, R6, R7, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[R0], R1>,\n FunctionLike<[R1], R2>,\n FunctionLike<[R2], R3>,\n FunctionLike<[R3], R4>,\n FunctionLike<[R4], R5>,\n FunctionLike<[R5], R6>,\n FunctionLike<[R6], R7>\n ]\n ): FunctionLike<P, R7>;\n <R0, R1, R2, R3, R4, R5, R6, R7, R8, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[R0], R1>,\n FunctionLike<[R1], R2>,\n FunctionLike<[R2], R3>,\n FunctionLike<[R3], R4>,\n FunctionLike<[R4], R5>,\n FunctionLike<[R5], R6>,\n FunctionLike<[R6], R7>,\n FunctionLike<[R7], R8>\n ]\n ): FunctionLike<P, R8>;\n <R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[R0], R1>,\n FunctionLike<[R1], R2>,\n FunctionLike<[R2], R3>,\n FunctionLike<[R3], R4>,\n FunctionLike<[R4], R5>,\n FunctionLike<[R5], R6>,\n FunctionLike<[R6], R7>,\n FunctionLike<[R7], R8>,\n FunctionLike<[R8], R9>\n ]\n ): FunctionLike<P, R9>;\n};\n\nexport declare type PipeMultiAsync = {\n <R0, P extends any[]>(\n ...fns: [FunctionLike<P, R0>]\n ): FunctionLike<P, Promise<Await<R0>>>;\n <R0, R1, P extends any[]>(\n ...fns: [FunctionLike<P, R0>, FunctionLike<[Await<R0>], R1>]\n ): FunctionLike<P, Promise<Await<R1>>>;\n <R0, R1, R2, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[Await<R0>], R1>,\n FunctionLike<[Await<R1>], R2>\n ]\n ): FunctionLike<P, Promise<Await<R2>>>;\n <R0, R1, R2, R3, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[Await<R0>], R1>,\n FunctionLike<[Await<R1>], R2>,\n FunctionLike<[Await<R2>], R3>\n ]\n ): FunctionLike<P, Promise<Await<R3>>>;\n <R0, R1, R2, R3, R4, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[Await<R0>], R1>,\n FunctionLike<[Await<R1>], R2>,\n FunctionLike<[Await<R2>], R3>,\n FunctionLike<[Await<R3>], R4>\n ]\n ): FunctionLike<P, Promise<Await<R4>>>;\n <R0, R1, R2, R3, R4, R5, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[Await<R0>], R1>,\n FunctionLike<[Await<R1>], R2>,\n FunctionLike<[Await<R2>], R3>,\n FunctionLike<[Await<R3>], R4>,\n FunctionLike<[Await<R4>], R5>\n ]\n ): FunctionLike<P, Promise<Await<R5>>>;\n <R0, R1, R2, R3, R4, R5, R6, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[Await<R0>], R1>,\n FunctionLike<[Await<R1>], R2>,\n FunctionLike<[Await<R2>], R3>,\n FunctionLike<[Await<R3>], R4>,\n FunctionLike<[Await<R4>], R5>,\n FunctionLike<[Await<R5>], R6>\n ]\n ): FunctionLike<P, Promise<Await<R6>>>;\n <R0, R1, R2, R3, R4, R5, R6, R7, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[Await<R0>], R1>,\n FunctionLike<[Await<R1>], R2>,\n FunctionLike<[Await<R2>], R3>,\n FunctionLike<[Await<R3>], R4>,\n FunctionLike<[Await<R4>], R5>,\n FunctionLike<[Await<R5>], R6>,\n FunctionLike<[Await<R6>], R7>\n ]\n ): FunctionLike<P, Promise<Await<R7>>>;\n <R0, R1, R2, R3, R4, R5, R6, R7, R8, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[Await<R0>], R1>,\n FunctionLike<[Await<R1>], R2>,\n FunctionLike<[Await<R2>], R3>,\n FunctionLike<[Await<R3>], R4>,\n FunctionLike<[Await<R4>], R5>,\n FunctionLike<[Await<R5>], R6>,\n FunctionLike<[Await<R6>], R7>,\n FunctionLike<[Await<R7>], R8>\n ]\n ): FunctionLike<P, Promise<Await<R8>>>;\n <R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, P extends any[]>(\n ...fns: [\n FunctionLike<P, R0>,\n FunctionLike<[Await<R0>], R1>,\n FunctionLike<[Await<R1>], R2>,\n FunctionLike<[Await<R2>], R3>,\n FunctionLike<[Await<R3>], R4>,\n FunctionLike<[Await<R4>], R5>,\n FunctionLike<[Await<R5>], R6>,\n FunctionLike<[Await<R6>], R7>,\n FunctionLike<[Await<R7>], R8>,\n FunctionLike<[Await<R8>], R9>\n ]\n ): FunctionLike<P, Promise<Await<R9>>>;\n};\n\nexport { pipe };\n"]}
|
package/dist/chunk-QNDLJ2W7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-QNDLJ2W7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugins/resolve-paths.ts"],"sourcesContent":["/*-------------------------------------------------------------------\n\n ⚡ Storm Software - Storm Stack\n\n This code was released as part of the Storm Stack project. Storm Stack\n is maintained by Storm Software under the Apache-2.0 License, and is\n free for commercial and private use. For more information, please visit\n our licensing page.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/storm-ops\n Documentation: https://stormsoftware.com/projects/storm-ops/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/storm-ops/license\n\n -------------------------------------------------------------------*/\n\nimport type * as esbuild from \"esbuild\";\nimport path from \"node:path\";\n\ntype TsConfig = {\n compilerOptions?: {\n paths?: Record<string, string[]>;\n };\n extends?: string;\n};\n\n/**\n * Recursive function to resolve the paths config from a tsconfig.json, whether\n * it is in the config directly or via an inherited config (via \"extends\").\n * @param options\n * @param cwd\n * @returns\n */\nfunction resolvePathsConfig(options: TsConfig, cwd: string) {\n if (options?.compilerOptions?.paths) {\n const paths = Object.entries(options.compilerOptions.paths);\n\n const resolvedPaths = paths.map(([key, paths]) => {\n return [key, paths.map(v => path.resolve(cwd, v))] as const;\n });\n\n return Object.fromEntries(resolvedPaths);\n }\n\n if (options.extends) {\n const extendsPath = path.resolve(cwd, options.extends);\n const extendsDir = path.dirname(extendsPath);\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const extendsConfig = require(extendsPath);\n\n return resolvePathsConfig(extendsConfig, extendsDir);\n }\n\n return [];\n}\n\n/**\n * Forces `esbuild` to always use the TS compiler paths, even when we are\n * bundling a local dependency of a local dependency, ensuring maximum\n * tree-shaking. Note: `esbuild` has some support for this, though it is limited\n * in the amount of dependency nesting it supports.\n */\nexport const resolvePathsPlugin: esbuild.Plugin = {\n name: \"storm:resolve-paths\",\n setup(build) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const parentTsConfig = require(\n `${process.cwd()}/${build.initialOptions.tsconfig}`\n );\n const resolvedTsPaths = resolvePathsConfig(parentTsConfig, process.cwd());\n const packagesRegex = new RegExp(\n `^(${Object.keys(resolvedTsPaths).join(\"|\")})$`\n );\n\n build.onResolve({ filter: packagesRegex }, args => {\n if (build.initialOptions.external?.includes(args.path)) {\n return { path: args.path, external: true };\n }\n\n return { path: `${resolvedTsPaths[args.path][0]}/index.ts` };\n });\n }\n};\n"],"mappings":";;;;;;AAkBA,OAAOA,UAAU;AAgBjB,SAASC,mBAAmBC,SAAmBC,KAAW;AACxD,MAAID,SAASE,iBAAiBC,OAAO;AACnC,UAAMA,QAAQC,OAAOC,QAAQL,QAAQE,gBAAgBC,KAAK;AAE1D,UAAMG,gBAAgBH,MAAMI,IAAI,CAAC,CAACC,KAAKL,MAAAA,MAAM;AAC3C,aAAO;QAACK;QAAKL,OAAMI,IAAIE,CAAAA,MAAKC,KAAKC,QAAQV,KAAKQ,CAAAA,CAAAA;;IAChD,CAAA;AAEA,WAAOL,OAAOQ,YAAYN,aAAAA;EAC5B;AAEA,MAAIN,QAAQa,SAAS;AACnB,UAAMC,cAAcJ,KAAKC,QAAQV,KAAKD,QAAQa,OAAO;AACrD,UAAME,aAAaL,KAAKM,QAAQF,WAAAA;AAEhC,UAAMG,gBAAgBC,UAAQJ,WAAAA;AAE9B,WAAOf,mBAAmBkB,eAAeF,UAAAA;EAC3C;AAEA,SAAO,CAAA;AACT;AArBShB;AA6BF,IAAMoB,qBAAqC;EAChDC,MAAM;EACNC,MAAMC,OAAK;AAET,UAAMC,iBAAiBL,UACrB,GAAGM,QAAQvB,IAAG,CAAA,IAAMqB,MAAMG,eAAeC,QAAQ,EAAE;AAErD,UAAMC,kBAAkB5B,mBAAmBwB,gBAAgBC,QAAQvB,IAAG,CAAA;AACtE,UAAM2B,gBAAgB,IAAIC,OACxB,KAAKzB,OAAO0B,KAAKH,eAAAA,EAAiBI,KAAK,GAAA,CAAA,IAAQ;AAGjDT,UAAMU,UAAU;MAAEC,QAAQL;IAAc,GAAGM,CAAAA,SAAAA;AACzC,UAAIZ,MAAMG,eAAeU,UAAUC,SAASF,KAAKxB,IAAI,GAAG;AACtD,eAAO;UAAEA,MAAMwB,KAAKxB;UAAMyB,UAAU;QAAK;MAC3C;AAEA,aAAO;QAAEzB,MAAM,GAAGiB,gBAAgBO,KAAKxB,IAAI,EAAE,CAAA,CAAE;MAAY;IAC7D,CAAA;EACF;AACF;","names":["path","resolvePathsConfig","options","cwd","compilerOptions","paths","Object","entries","resolvedPaths","map","key","v","path","resolve","fromEntries","extends","extendsPath","extendsDir","dirname","extendsConfig","require","resolvePathsPlugin","name","setup","build","parentTsConfig","process","initialOptions","tsconfig","resolvedTsPaths","packagesRegex","RegExp","keys","join","onResolve","filter","args","external","includes"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/chunk-WGEGR3DF.cjs"],"names":[],"mappings":"AAAA,6EAAI,UAAU,EAAE,MAAM,CAAC,cAAc;AACrC,IAAI,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;AACxF,IAAI,UAAU,kBAAkB,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,QAAQ,IAAI,YAAY,EAAE,QAAQ,EAAE,OAAO,MAAM,IAAI,YAAY,EAAE,IAAI,KAAK,CAAC,CAAC,EAAE;AAC/H,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,QAAQ,IAAI,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE;AACpB,EAAE,GAAG,CAAC,OAAO,QAAQ,IAAI,WAAW,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC;AAC3E,EAAE,MAAM,KAAK,CAAC,uBAAuB,EAAE,EAAE,EAAE,oBAAoB,CAAC;AAChE,CAAC,CAAC;AACF;AACA;AACE;AACA;AACF,uDAAC","file":"/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/chunk-WGEGR3DF.cjs"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugins/on-error.ts"],"sourcesContent":["/*-------------------------------------------------------------------\n\n ⚡ Storm Software - Storm Stack\n\n This code was released as part of the Storm Stack project. Storm Stack\n is maintained by Storm Software under the Apache-2.0 License, and is\n free for commercial and private use. For more information, please visit\n our licensing page.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/storm-ops\n Documentation: https://stormsoftware.com/projects/storm-ops/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/storm-ops/license\n\n -------------------------------------------------------------------*/\n\nimport { writeError } from \"@storm-software/config-tools\";\nimport type * as esbuild from \"esbuild\";\n\n/**\n * Causes esbuild to exit immediately with an error code.\n */\nexport const onErrorPlugin: esbuild.Plugin = {\n name: \"storm:on-error\",\n setup(build) {\n build.onEnd(result => {\n // if there were errors found on the build\n if (result.errors.length > 0 && process.env.WATCH !== \"true\") {\n writeError(\n `The following errors occurred during the build:\n${result.errors.map(error => error.text).join(\"\\n\")}\n\n`\n );\n\n throw new Error(\"ESBuild process failed with errors.\");\n }\n });\n }\n};\n"],"mappings":";AAiBA,SAASA,kBAAkB;AAMpB,IAAMC,gBAAgC;EAC3CC,MAAM;EACNC,MAAMC,OAAK;AACTA,UAAMC,MAAMC,CAAAA,WAAAA;AAEV,UAAIA,OAAOC,OAAOC,SAAS,KAAKC,QAAQC,IAAIC,UAAU,QAAQ;AAC5DX,mBACE;EACRM,OAAOC,OAAOK,IAAIC,CAAAA,UAASA,MAAMC,IAAI,EAAEC,KAAK,IAAA,CAAA;;CAE7C;AAGO,cAAM,IAAIC,MAAM,qCAAA;MAClB;IACF,CAAA;EACF;AACF;","names":["writeError","onErrorPlugin","name","setup","build","onEnd","result","errors","length","process","env","WATCH","map","error","text","join","Error"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugins/fix-imports.ts"],"sourcesContent":["/*-------------------------------------------------------------------\n\n ⚡ Storm Software - Storm Stack\n\n This code was released as part of the Storm Stack project. Storm Stack\n is maintained by Storm Software under the Apache-2.0 License, and is\n free for commercial and private use. For more information, please visit\n our licensing page.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/storm-ops\n Documentation: https://stormsoftware.com/projects/storm-ops/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/storm-ops/license\n\n -------------------------------------------------------------------*/\n\nimport type * as esbuild from \"esbuild\";\n\n/**\n * For dependencies that forgot to add them into their package.json.\n */\nexport const fixImportsPlugin: esbuild.Plugin = {\n name: \"storm:fix-imports\",\n setup(build) {\n build.onResolve({ filter: /^spdx-exceptions/ }, () => {\n return { path: require.resolve(\"spdx-exceptions\") };\n });\n build.onResolve({ filter: /^spdx-license-ids/ }, () => {\n return { path: require.resolve(\"spdx-license-ids\") };\n });\n }\n};\n"],"mappings":";;;;;AAsBO,IAAMA,mBAAmC;EAC9CC,MAAM;EACNC,MAAMC,OAAK;AACTA,UAAMC,UAAU;MAAEC,QAAQ;IAAmB,GAAG,MAAA;AAC9C,aAAO;QAAEC,MAAMC,UAAQC,QAAQ,iBAAA;MAAmB;IACpD,CAAA;AACAL,UAAMC,UAAU;MAAEC,QAAQ;IAAoB,GAAG,MAAA;AAC/C,aAAO;QAAEC,MAAMC,UAAQC,QAAQ,kBAAA;MAAoB;IACrD,CAAA;EACF;AACF;","names":["fixImportsPlugin","name","setup","build","onResolve","filter","path","require","resolve"]}
|
package/dist/config.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/config.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,iIAAC","file":"/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/config.cjs"}
|
package/dist/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,0aAAC","file":"/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/index.cjs"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/types.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/types.cjs"],"names":[],"mappings":"AAAA,6CAA6B","file":"/home/runner/work/storm-ops/storm-ops/packages/esbuild/dist/types.cjs"}
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|