@storm-software/esbuild 0.35.12 → 0.35.13
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 -2
- package/bin/esbuild.cjs +61 -112
- package/dist/assets.cjs +5 -5
- package/dist/assets.js +4 -4
- package/dist/build.cjs +12 -13
- package/dist/build.js +11 -12
- package/dist/{chunk-ZF7HGC35.js → chunk-2LYIFO7K.js} +1 -1
- package/dist/{chunk-MYUKVBFG.cjs → chunk-55UPQQ65.cjs} +60 -60
- package/dist/{chunk-77XQDMGA.js → chunk-7KIT5JE6.js} +7 -7
- package/dist/{chunk-4PZGT5BH.cjs → chunk-B3MHVZOK.cjs} +2 -1
- package/dist/{chunk-WQVSYEMN.cjs → chunk-BK5GLVSJ.cjs} +11 -11
- package/dist/{chunk-EGUR2GEF.cjs → chunk-BWMW4ZUS.cjs} +22 -22
- package/dist/{chunk-HIO4TSG7.cjs → chunk-C25ALB4J.cjs} +5 -5
- package/dist/{chunk-Q366M4DV.js → chunk-CEJM5IFH.js} +2 -2
- package/dist/{chunk-MAXDIXOQ.js → chunk-FHHEEOIV.js} +1 -1
- package/dist/{chunk-PB5XBFPA.cjs → chunk-H7NSISN4.cjs} +15 -21
- package/dist/{chunk-OV5OYAJ7.cjs → chunk-IULOZ7MO.cjs} +3 -3
- package/dist/{chunk-F3R5ZFGB.js → chunk-KV6GNLVF.js} +1 -0
- package/dist/{chunk-POMR4JSG.js → chunk-KXZCIMKJ.js} +2 -2
- package/dist/{chunk-7VE5Y757.cjs → chunk-LBRDOW2V.cjs} +5 -5
- package/dist/{chunk-EBH4ZCN5.js → chunk-NACKZM5D.js} +1 -1
- package/dist/{chunk-77TTTWKY.cjs → chunk-NLIYZM5H.cjs} +3 -3
- package/dist/{chunk-47A73LZ7.js → chunk-Q3WZPCLD.js} +2 -2
- package/dist/{chunk-UAPH32Y3.cjs → chunk-RBXXACL5.cjs} +4 -4
- package/dist/{chunk-CV2AM72J.js → chunk-RNXNYWO3.js} +5 -11
- package/dist/{chunk-42HYZLJH.cjs → chunk-T4N45NGL.cjs} +3 -3
- package/dist/{chunk-SB2WRTQ2.js → chunk-VLK67MTI.js} +3 -3
- package/dist/{chunk-PDYSQLJS.js → chunk-VNLMOUVN.js} +1 -1
- package/dist/clean.cjs +4 -4
- package/dist/clean.js +3 -3
- package/dist/config.cjs +5 -5
- package/dist/config.js +4 -4
- package/dist/context.cjs +6 -7
- package/dist/context.js +5 -6
- package/dist/index.cjs +12 -13
- package/dist/index.js +11 -12
- package/dist/package-json.cjs +5 -5
- package/dist/package-json.js +4 -4
- package/dist/plugins/deps-check.cjs +4 -4
- package/dist/plugins/deps-check.js +3 -3
- package/dist/plugins/resolve-paths.cjs +82 -5
- package/dist/plugins/resolve-paths.js +81 -4
- package/dist/tsup.cjs +4 -4
- package/dist/tsup.js +3 -3
- package/dist/watch.cjs +4 -4
- package/dist/watch.js +2 -2
- package/package.json +4 -4
- package/dist/chunk-HPZXWRI7.cjs +0 -59
- package/dist/chunk-KR4NRRPF.js +0 -59
|
@@ -1,8 +1,85 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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
2
|
|
|
3
|
-
var _chunkHPZXWRI7cjs = require('../chunk-HPZXWRI7.cjs');
|
|
4
|
-
require('../chunk-4PZGT5BH.cjs');
|
|
5
|
-
require('../chunk-JCICRU7K.cjs');
|
|
6
3
|
|
|
4
|
+
var _chunkB3MHVZOKcjs = require('../chunk-B3MHVZOK.cjs');
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkJCICRU7Kcjs = require('../chunk-JCICRU7K.cjs');
|
|
9
|
+
|
|
10
|
+
// src/plugins/resolve-paths.ts
|
|
11
|
+
_chunkJCICRU7Kcjs.init_cjs_shims.call(void 0, );
|
|
12
|
+
|
|
13
|
+
// ../config-tools/src/utilities/file-path-utils.ts
|
|
14
|
+
_chunkJCICRU7Kcjs.init_cjs_shims.call(void 0, );
|
|
15
|
+
function findFileName(filePath, { requireExtension, withExtension } = {}) {
|
|
16
|
+
const result = _nullishCoalesce(_optionalChain([_chunkB3MHVZOKcjs.normalizeWindowsPath.call(void 0, filePath), 'optionalAccess', _ => _.split, 'call', _2 => _2(_optionalChain([filePath, 'optionalAccess', _3 => _3.includes, 'call', _4 => _4("\\")]) ? "\\" : "/"), 'optionalAccess', _5 => _5.pop, 'call', _6 => _6()]), () => ( ""));
|
|
17
|
+
if (requireExtension === true && !result.includes(".")) {
|
|
18
|
+
return "";
|
|
19
|
+
}
|
|
20
|
+
if (withExtension === false && result.includes(".")) {
|
|
21
|
+
return result.split(".").slice(-1).join(".") || "";
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
function findFilePath(filePath) {
|
|
26
|
+
const normalizedPath = _chunkB3MHVZOKcjs.normalizeWindowsPath.call(void 0, filePath);
|
|
27
|
+
return normalizedPath.replace(
|
|
28
|
+
findFileName(normalizedPath, { requireExtension: true }),
|
|
29
|
+
""
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// src/plugins/resolve-paths.ts
|
|
34
|
+
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
35
|
+
function resolvePathsConfig(options, cwd, projectRoot) {
|
|
36
|
+
if (_optionalChain([options, 'optionalAccess', _7 => _7.compilerOptions, 'optionalAccess', _8 => _8.paths])) {
|
|
37
|
+
const paths = Object.entries(options.compilerOptions.paths);
|
|
38
|
+
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
39
|
+
return [key, paths2.map((v) => _path2.default.resolve(cwd, v))];
|
|
40
|
+
});
|
|
41
|
+
return Object.fromEntries(resolvedPaths);
|
|
42
|
+
}
|
|
43
|
+
if (options.extends) {
|
|
44
|
+
const extendsPath = _path2.default.resolve(
|
|
45
|
+
projectRoot ? _chunkB3MHVZOKcjs.joinPaths.call(void 0, cwd, projectRoot, options.extends) : _chunkB3MHVZOKcjs.joinPaths.call(void 0, cwd, options.extends)
|
|
46
|
+
);
|
|
47
|
+
const extendsDir = _path2.default.dirname(extendsPath);
|
|
48
|
+
const extendsConfig = _chunkJCICRU7Kcjs.__require.call(void 0, extendsPath);
|
|
49
|
+
return resolvePathsConfig(extendsConfig, extendsDir);
|
|
50
|
+
}
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
var resolvePathsPlugin = (context) => ({
|
|
54
|
+
name: "storm:resolve-paths",
|
|
55
|
+
setup(build) {
|
|
56
|
+
const parentTsConfig = build.initialOptions.tsconfig ? _chunkJCICRU7Kcjs.__require.call(void 0, _chunkB3MHVZOKcjs.joinPaths.call(void 0,
|
|
57
|
+
context.workspaceConfig.workspaceRoot,
|
|
58
|
+
build.initialOptions.tsconfig.replace(
|
|
59
|
+
context.workspaceConfig.workspaceRoot,
|
|
60
|
+
""
|
|
61
|
+
)
|
|
62
|
+
)) : _chunkJCICRU7Kcjs.__require.call(void 0, _chunkB3MHVZOKcjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, "tsconfig.json"));
|
|
63
|
+
const resolvedTsPaths = resolvePathsConfig(
|
|
64
|
+
parentTsConfig,
|
|
65
|
+
context.workspaceConfig.workspaceRoot,
|
|
66
|
+
context.options.projectRoot
|
|
67
|
+
);
|
|
68
|
+
const packagesRegex = new RegExp(
|
|
69
|
+
`^(${Object.keys(resolvedTsPaths).join("|")})$`
|
|
70
|
+
);
|
|
71
|
+
build.onResolve({ filter: packagesRegex }, (args) => {
|
|
72
|
+
if (_optionalChain([build, 'access', _9 => _9.initialOptions, 'access', _10 => _10.external, 'optionalAccess', _11 => _11.includes, 'call', _12 => _12(args.path)])) {
|
|
73
|
+
return { path: args.path, external: true };
|
|
74
|
+
}
|
|
75
|
+
let resolvedPath = resolvedTsPaths[args.path][0];
|
|
76
|
+
if (resolvedPath.endsWith(".ts") || resolvedPath.endsWith(".tsx")) {
|
|
77
|
+
resolvedPath = findFilePath(resolvedPath);
|
|
78
|
+
}
|
|
79
|
+
return { path: _chunkB3MHVZOKcjs.joinPaths.call(void 0, resolvedPath, "index.ts") };
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
exports.resolvePathsPlugin = resolvePathsPlugin;
|
|
@@ -1,8 +1,85 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
2
|
+
joinPaths,
|
|
3
|
+
normalizeWindowsPath
|
|
4
|
+
} from "../chunk-KV6GNLVF.js";
|
|
5
|
+
import {
|
|
6
|
+
__require,
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "../chunk-72UBXZRO.js";
|
|
9
|
+
|
|
10
|
+
// src/plugins/resolve-paths.ts
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
|
|
13
|
+
// ../config-tools/src/utilities/file-path-utils.ts
|
|
14
|
+
init_esm_shims();
|
|
15
|
+
function findFileName(filePath, { requireExtension, withExtension } = {}) {
|
|
16
|
+
const result = normalizeWindowsPath(filePath)?.split(filePath?.includes("\\") ? "\\" : "/")?.pop() ?? "";
|
|
17
|
+
if (requireExtension === true && !result.includes(".")) {
|
|
18
|
+
return "";
|
|
19
|
+
}
|
|
20
|
+
if (withExtension === false && result.includes(".")) {
|
|
21
|
+
return result.split(".").slice(-1).join(".") || "";
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
function findFilePath(filePath) {
|
|
26
|
+
const normalizedPath = normalizeWindowsPath(filePath);
|
|
27
|
+
return normalizedPath.replace(
|
|
28
|
+
findFileName(normalizedPath, { requireExtension: true }),
|
|
29
|
+
""
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// src/plugins/resolve-paths.ts
|
|
34
|
+
import path from "node:path";
|
|
35
|
+
function resolvePathsConfig(options, cwd, projectRoot) {
|
|
36
|
+
if (options?.compilerOptions?.paths) {
|
|
37
|
+
const paths = Object.entries(options.compilerOptions.paths);
|
|
38
|
+
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
39
|
+
return [key, paths2.map((v) => path.resolve(cwd, v))];
|
|
40
|
+
});
|
|
41
|
+
return Object.fromEntries(resolvedPaths);
|
|
42
|
+
}
|
|
43
|
+
if (options.extends) {
|
|
44
|
+
const extendsPath = path.resolve(
|
|
45
|
+
projectRoot ? joinPaths(cwd, projectRoot, options.extends) : joinPaths(cwd, options.extends)
|
|
46
|
+
);
|
|
47
|
+
const extendsDir = path.dirname(extendsPath);
|
|
48
|
+
const extendsConfig = __require(extendsPath);
|
|
49
|
+
return resolvePathsConfig(extendsConfig, extendsDir);
|
|
50
|
+
}
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
var resolvePathsPlugin = (context) => ({
|
|
54
|
+
name: "storm:resolve-paths",
|
|
55
|
+
setup(build) {
|
|
56
|
+
const parentTsConfig = build.initialOptions.tsconfig ? __require(joinPaths(
|
|
57
|
+
context.workspaceConfig.workspaceRoot,
|
|
58
|
+
build.initialOptions.tsconfig.replace(
|
|
59
|
+
context.workspaceConfig.workspaceRoot,
|
|
60
|
+
""
|
|
61
|
+
)
|
|
62
|
+
)) : __require(joinPaths(context.workspaceConfig.workspaceRoot, "tsconfig.json"));
|
|
63
|
+
const resolvedTsPaths = resolvePathsConfig(
|
|
64
|
+
parentTsConfig,
|
|
65
|
+
context.workspaceConfig.workspaceRoot,
|
|
66
|
+
context.options.projectRoot
|
|
67
|
+
);
|
|
68
|
+
const packagesRegex = new RegExp(
|
|
69
|
+
`^(${Object.keys(resolvedTsPaths).join("|")})$`
|
|
70
|
+
);
|
|
71
|
+
build.onResolve({ filter: packagesRegex }, (args) => {
|
|
72
|
+
if (build.initialOptions.external?.includes(args.path)) {
|
|
73
|
+
return { path: args.path, external: true };
|
|
74
|
+
}
|
|
75
|
+
let resolvedPath = resolvedTsPaths[args.path][0];
|
|
76
|
+
if (resolvedPath.endsWith(".ts") || resolvedPath.endsWith(".tsx")) {
|
|
77
|
+
resolvedPath = findFilePath(resolvedPath);
|
|
78
|
+
}
|
|
79
|
+
return { path: joinPaths(resolvedPath, "index.ts") };
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
6
83
|
export {
|
|
7
84
|
resolvePathsPlugin
|
|
8
85
|
};
|
package/dist/tsup.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkC25ALB4Jcjs = require('./chunk-C25ALB4J.cjs');
|
|
4
|
+
require('./chunk-RBXXACL5.cjs');
|
|
5
|
+
require('./chunk-B3MHVZOK.cjs');
|
|
6
6
|
require('./chunk-JCICRU7K.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.executeTsup =
|
|
9
|
+
exports.executeTsup = _chunkC25ALB4Jcjs.executeTsup;
|
package/dist/tsup.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeTsup
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-KXZCIMKJ.js";
|
|
4
|
+
import "./chunk-NACKZM5D.js";
|
|
5
|
+
import "./chunk-KV6GNLVF.js";
|
|
6
6
|
import "./chunk-72UBXZRO.js";
|
|
7
7
|
export {
|
|
8
8
|
executeTsup
|
package/dist/watch.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunkRBXXACL5cjs = require('./chunk-RBXXACL5.cjs');
|
|
5
|
+
require('./chunk-B3MHVZOK.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkJCICRU7Kcjs = require('./chunk-JCICRU7K.cjs');
|
|
@@ -93,9 +93,9 @@ var watch = (context, options) => {
|
|
|
93
93
|
return context.rebuild();
|
|
94
94
|
});
|
|
95
95
|
if (rebuildResult instanceof Error) {
|
|
96
|
-
|
|
96
|
+
_chunkRBXXACL5cjs.writeError.call(void 0, rebuildResult.message);
|
|
97
97
|
}
|
|
98
|
-
|
|
98
|
+
_chunkRBXXACL5cjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
99
99
|
}, 10);
|
|
100
100
|
changeWatcher.on("change", fastRebuild);
|
|
101
101
|
return void 0;
|
package/dist/watch.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/esbuild",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing `esbuild` utilities for building Storm Software libraries and applications",
|
|
6
6
|
"repository": {
|
|
@@ -186,9 +186,9 @@
|
|
|
186
186
|
"dependencies": {
|
|
187
187
|
"@nx/devkit": "20.8.0",
|
|
188
188
|
"@nx/js": "20.8.0",
|
|
189
|
-
"@storm-software/build-tools": "0.144.
|
|
190
|
-
"@storm-software/config": "1.113.
|
|
191
|
-
"@storm-software/config-tools": "1.163.
|
|
189
|
+
"@storm-software/build-tools": "0.144.22",
|
|
190
|
+
"@storm-software/config": "1.113.26",
|
|
191
|
+
"@storm-software/config-tools": "1.163.27",
|
|
192
192
|
"chokidar": "^4.0.3",
|
|
193
193
|
"commander": "^12.1.0",
|
|
194
194
|
"defu": "6.1.4",
|
package/dist/chunk-HPZXWRI7.cjs
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunk4PZGT5BHcjs = require('./chunk-4PZGT5BH.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunkJCICRU7Kcjs = require('./chunk-JCICRU7K.cjs');
|
|
8
|
-
|
|
9
|
-
// src/plugins/resolve-paths.ts
|
|
10
|
-
_chunkJCICRU7Kcjs.init_cjs_shims.call(void 0, );
|
|
11
|
-
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
12
|
-
function resolvePathsConfig(options, cwd, projectRoot) {
|
|
13
|
-
if (_optionalChain([options, 'optionalAccess', _ => _.compilerOptions, 'optionalAccess', _2 => _2.paths])) {
|
|
14
|
-
const paths = Object.entries(options.compilerOptions.paths);
|
|
15
|
-
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
16
|
-
return [key, paths2.map((v) => _path2.default.resolve(cwd, v))];
|
|
17
|
-
});
|
|
18
|
-
return Object.fromEntries(resolvedPaths);
|
|
19
|
-
}
|
|
20
|
-
if (options.extends) {
|
|
21
|
-
const extendsPath = _path2.default.resolve(
|
|
22
|
-
projectRoot ? _chunk4PZGT5BHcjs.joinPaths.call(void 0, cwd, projectRoot, options.extends) : _chunk4PZGT5BHcjs.joinPaths.call(void 0, cwd, options.extends)
|
|
23
|
-
);
|
|
24
|
-
const extendsDir = _path2.default.dirname(extendsPath);
|
|
25
|
-
const extendsConfig = _chunkJCICRU7Kcjs.__require.call(void 0, extendsPath);
|
|
26
|
-
return resolvePathsConfig(extendsConfig, extendsDir);
|
|
27
|
-
}
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
30
|
-
var resolvePathsPlugin = (context) => ({
|
|
31
|
-
name: "storm:resolve-paths",
|
|
32
|
-
setup(build) {
|
|
33
|
-
const parentTsConfig = build.initialOptions.tsconfig ? _chunkJCICRU7Kcjs.__require.call(void 0, _chunk4PZGT5BHcjs.joinPaths.call(void 0,
|
|
34
|
-
context.workspaceConfig.workspaceRoot,
|
|
35
|
-
build.initialOptions.tsconfig.replace(
|
|
36
|
-
context.workspaceConfig.workspaceRoot,
|
|
37
|
-
""
|
|
38
|
-
)
|
|
39
|
-
)) : _chunkJCICRU7Kcjs.__require.call(void 0, _chunk4PZGT5BHcjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, "tsconfig.json"));
|
|
40
|
-
const resolvedTsPaths = resolvePathsConfig(
|
|
41
|
-
parentTsConfig,
|
|
42
|
-
context.workspaceConfig.workspaceRoot,
|
|
43
|
-
context.options.projectRoot
|
|
44
|
-
);
|
|
45
|
-
const packagesRegex = new RegExp(
|
|
46
|
-
`^(${Object.keys(resolvedTsPaths).join("|")})$`
|
|
47
|
-
);
|
|
48
|
-
build.onResolve({ filter: packagesRegex }, (args) => {
|
|
49
|
-
if (_optionalChain([build, 'access', _3 => _3.initialOptions, 'access', _4 => _4.external, 'optionalAccess', _5 => _5.includes, 'call', _6 => _6(args.path)])) {
|
|
50
|
-
return { path: args.path, external: true };
|
|
51
|
-
}
|
|
52
|
-
return { path: `${resolvedTsPaths[args.path][0]}/index.ts` };
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
exports.resolvePathsPlugin = resolvePathsPlugin;
|
package/dist/chunk-KR4NRRPF.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
joinPaths
|
|
3
|
-
} from "./chunk-F3R5ZFGB.js";
|
|
4
|
-
import {
|
|
5
|
-
__require,
|
|
6
|
-
init_esm_shims
|
|
7
|
-
} from "./chunk-72UBXZRO.js";
|
|
8
|
-
|
|
9
|
-
// src/plugins/resolve-paths.ts
|
|
10
|
-
init_esm_shims();
|
|
11
|
-
import path from "node:path";
|
|
12
|
-
function resolvePathsConfig(options, cwd, projectRoot) {
|
|
13
|
-
if (options?.compilerOptions?.paths) {
|
|
14
|
-
const paths = Object.entries(options.compilerOptions.paths);
|
|
15
|
-
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
16
|
-
return [key, paths2.map((v) => path.resolve(cwd, v))];
|
|
17
|
-
});
|
|
18
|
-
return Object.fromEntries(resolvedPaths);
|
|
19
|
-
}
|
|
20
|
-
if (options.extends) {
|
|
21
|
-
const extendsPath = path.resolve(
|
|
22
|
-
projectRoot ? joinPaths(cwd, projectRoot, options.extends) : joinPaths(cwd, options.extends)
|
|
23
|
-
);
|
|
24
|
-
const extendsDir = path.dirname(extendsPath);
|
|
25
|
-
const extendsConfig = __require(extendsPath);
|
|
26
|
-
return resolvePathsConfig(extendsConfig, extendsDir);
|
|
27
|
-
}
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
30
|
-
var resolvePathsPlugin = (context) => ({
|
|
31
|
-
name: "storm:resolve-paths",
|
|
32
|
-
setup(build) {
|
|
33
|
-
const parentTsConfig = build.initialOptions.tsconfig ? __require(joinPaths(
|
|
34
|
-
context.workspaceConfig.workspaceRoot,
|
|
35
|
-
build.initialOptions.tsconfig.replace(
|
|
36
|
-
context.workspaceConfig.workspaceRoot,
|
|
37
|
-
""
|
|
38
|
-
)
|
|
39
|
-
)) : __require(joinPaths(context.workspaceConfig.workspaceRoot, "tsconfig.json"));
|
|
40
|
-
const resolvedTsPaths = resolvePathsConfig(
|
|
41
|
-
parentTsConfig,
|
|
42
|
-
context.workspaceConfig.workspaceRoot,
|
|
43
|
-
context.options.projectRoot
|
|
44
|
-
);
|
|
45
|
-
const packagesRegex = new RegExp(
|
|
46
|
-
`^(${Object.keys(resolvedTsPaths).join("|")})$`
|
|
47
|
-
);
|
|
48
|
-
build.onResolve({ filter: packagesRegex }, (args) => {
|
|
49
|
-
if (build.initialOptions.external?.includes(args.path)) {
|
|
50
|
-
return { path: args.path, external: true };
|
|
51
|
-
}
|
|
52
|
-
return { path: `${resolvedTsPaths[args.path][0]}/index.ts` };
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
export {
|
|
58
|
-
resolvePathsPlugin
|
|
59
|
-
};
|