@storm-software/unbuild 0.19.4 → 0.20.1
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/bin/unbuild.js +13554 -141
- package/bin/unbuild.mjs +13561 -148
- package/dist/build.js +9 -10
- package/dist/build.mjs +8 -9
- package/dist/{chunk-XI6ZXBUG.js → chunk-2345XTVS.js} +105 -108
- package/dist/{chunk-ZUXO7HQP.js → chunk-3OJD7CO4.js} +8 -5
- package/dist/chunk-AICX43E6.mjs +13496 -0
- package/dist/chunk-AYRYNROK.js +27 -0
- package/dist/{chunk-5SOSUWM3.mjs → chunk-B5GGHMTB.mjs} +9 -8
- package/dist/chunk-BIZYEBW3.mjs +38 -0
- package/dist/chunk-DFIGNXGY.js +13496 -0
- package/dist/{chunk-34DH32EF.mjs → chunk-FDF3FMZP.mjs} +1 -1
- package/dist/{chunk-AH7CDDC4.mjs → chunk-IIVTCNH5.mjs} +6 -3
- package/dist/{chunk-FP34RJ2B.mjs → chunk-OG2CKJQU.mjs} +1 -1
- package/dist/{chunk-2CDKPC2J.js → chunk-OQPSH7GE.js} +9 -8
- package/dist/chunk-RCEWRXM5.js +38 -0
- package/dist/{chunk-LMAVRNZF.mjs → chunk-T5NKX2EJ.mjs} +5 -9
- package/dist/{chunk-I24R5RY2.mjs → chunk-WGFWMGCJ.mjs} +26 -29
- package/dist/{chunk-QUQ5VOD7.js → chunk-WPOEGALQ.js} +3 -3
- package/dist/{chunk-JOAJEBTW.js → chunk-XEAFTDQ7.js} +2 -2
- package/dist/clean.js +3 -3
- package/dist/clean.mjs +2 -2
- package/dist/config.js +7 -8
- package/dist/config.mjs +6 -7
- package/dist/index.js +9 -10
- package/dist/index.mjs +8 -9
- package/package.json +1 -1
- package/dist/chunk-4REDJQMU.js +0 -35
- package/dist/chunk-ITLNJJHL.mjs +0 -65
- package/dist/chunk-KTRDC23G.mjs +0 -28
- package/dist/chunk-L73LP5QX.js +0 -31
- package/dist/chunk-TYJGNL6P.mjs +0 -35
- package/dist/chunk-V2LF4EEM.js +0 -28
- package/dist/chunk-YNOD6WE4.js +0 -65
package/dist/chunk-ITLNJJHL.mjs
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
writeTrace
|
|
3
|
-
} from "./chunk-5SOSUWM3.mjs";
|
|
4
|
-
import {
|
|
5
|
-
__name
|
|
6
|
-
} from "./chunk-LPEX4YW6.mjs";
|
|
7
|
-
|
|
8
|
-
// src/plugins/tsc.ts
|
|
9
|
-
import { createProjectGraphAsync } from "@nx/devkit";
|
|
10
|
-
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
11
|
-
import { getHelperDependency, HelperDependency } from "@nx/js/src/utils/compiler-helper-dependency";
|
|
12
|
-
import ts2Plugin from "rollup-plugin-typescript2";
|
|
13
|
-
|
|
14
|
-
// src/utilities/helpers.ts
|
|
15
|
-
import { joinPathFragments } from "@nx/devkit";
|
|
16
|
-
import { computeCompilerOptionsPaths } from "@nx/js/src/utils/buildable-libs-utils";
|
|
17
|
-
import { dirname, extname } from "node:path";
|
|
18
|
-
import { pathToFileURL } from "node:url";
|
|
19
|
-
import ts from "typescript";
|
|
20
|
-
async function loadConfig(configPath) {
|
|
21
|
-
if (!/\.(js|mjs)$/.test(extname(configPath))) {
|
|
22
|
-
throw new Error("Unsupported config file format");
|
|
23
|
-
}
|
|
24
|
-
return import(pathToFileURL(configPath).toString()).then((config) => config.default);
|
|
25
|
-
}
|
|
26
|
-
__name(loadConfig, "loadConfig");
|
|
27
|
-
async function createTsCompilerOptions(config, tsConfigPath, projectRoot, dependencies) {
|
|
28
|
-
const tsConfigFile = ts.readConfigFile(joinPathFragments(config.workspaceRoot, projectRoot, tsConfigPath), ts.sys.readFile);
|
|
29
|
-
const tsConfig = ts.parseJsonConfigFileContent(tsConfigFile.config, ts.sys, dirname(joinPathFragments(config.workspaceRoot, projectRoot, tsConfigPath)));
|
|
30
|
-
const compilerOptions = {
|
|
31
|
-
rootDir: projectRoot,
|
|
32
|
-
declaration: true,
|
|
33
|
-
paths: computeCompilerOptionsPaths(tsConfig, dependencies ?? [])
|
|
34
|
-
};
|
|
35
|
-
writeTrace(compilerOptions, config);
|
|
36
|
-
return compilerOptions;
|
|
37
|
-
}
|
|
38
|
-
__name(createTsCompilerOptions, "createTsCompilerOptions");
|
|
39
|
-
|
|
40
|
-
// src/plugins/tsc.ts
|
|
41
|
-
var tscPlugin = /* @__PURE__ */ __name(async (options, resolvedOptions) => {
|
|
42
|
-
const projectGraph = await createProjectGraphAsync({
|
|
43
|
-
exitOnError: true
|
|
44
|
-
});
|
|
45
|
-
const result = calculateProjectBuildableDependencies(void 0, projectGraph, resolvedOptions.config.workspaceRoot, resolvedOptions.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
46
|
-
let dependencies = result.dependencies;
|
|
47
|
-
const tsLibDependency = getHelperDependency(HelperDependency.tsc, resolvedOptions.tsconfig, dependencies, projectGraph, true);
|
|
48
|
-
if (tsLibDependency) {
|
|
49
|
-
dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
|
|
50
|
-
dependencies.push(tsLibDependency);
|
|
51
|
-
}
|
|
52
|
-
return ts2Plugin({
|
|
53
|
-
check: options.emitTypes !== false,
|
|
54
|
-
tsconfig: resolvedOptions.tsconfig,
|
|
55
|
-
tsconfigOverride: {
|
|
56
|
-
compilerOptions: await createTsCompilerOptions(resolvedOptions.config, resolvedOptions.tsconfig, resolvedOptions.projectRoot, dependencies)
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}, "tscPlugin");
|
|
60
|
-
|
|
61
|
-
export {
|
|
62
|
-
loadConfig,
|
|
63
|
-
createTsCompilerOptions,
|
|
64
|
-
tscPlugin
|
|
65
|
-
};
|
package/dist/chunk-KTRDC23G.mjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name,
|
|
3
|
-
__require
|
|
4
|
-
} from "./chunk-LPEX4YW6.mjs";
|
|
5
|
-
|
|
6
|
-
// src/plugins/swc.ts
|
|
7
|
-
var swcPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => {
|
|
8
|
-
const { transform } = __require("@swc/core");
|
|
9
|
-
return {
|
|
10
|
-
name: "storm:swc",
|
|
11
|
-
transform(code, filename) {
|
|
12
|
-
return transform(code, {
|
|
13
|
-
filename,
|
|
14
|
-
jsc: {
|
|
15
|
-
transform: {
|
|
16
|
-
react: {
|
|
17
|
-
runtime: "automatic"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}, "swcPlugin");
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
swcPlugin
|
|
28
|
-
};
|
package/dist/chunk-L73LP5QX.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkYNOD6WE4js = require('./chunk-YNOD6WE4.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunk4REDJQMUjs = require('./chunk-4REDJQMU.js');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkJOAJEBTWjs = require('./chunk-JOAJEBTW.js');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _chunkQUQ5VOD7js = require('./chunk-QUQ5VOD7.js');
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _chunkV2LF4EEMjs = require('./chunk-V2LF4EEM.js');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
19
|
-
|
|
20
|
-
// src/config.ts
|
|
21
|
-
var getDefaultBuildPlugins = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, resolvedOptions) => Promise.all([
|
|
22
|
-
_chunkJOAJEBTWjs.analyzePlugin.call(void 0, options, resolvedOptions),
|
|
23
|
-
_chunkV2LF4EEMjs.swcPlugin.call(void 0, options, resolvedOptions),
|
|
24
|
-
_chunk4REDJQMUjs.typeDefinitions.call(void 0, options, resolvedOptions),
|
|
25
|
-
_chunkYNOD6WE4js.tscPlugin.call(void 0, options, resolvedOptions),
|
|
26
|
-
_chunkQUQ5VOD7js.onErrorPlugin.call(void 0, options, resolvedOptions)
|
|
27
|
-
].map((plugin) => Promise.resolve(plugin))), "getDefaultBuildPlugins");
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
exports.getDefaultBuildPlugins = getDefaultBuildPlugins;
|
package/dist/chunk-TYJGNL6P.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "./chunk-LPEX4YW6.mjs";
|
|
4
|
-
|
|
5
|
-
// src/plugins/type-definitions.ts
|
|
6
|
-
import { relative } from "node:path";
|
|
7
|
-
var typeDefinitions = /* @__PURE__ */ __name((options, resolvedOptions) => ({
|
|
8
|
-
name: "storm:dts-bundle",
|
|
9
|
-
async generateBundle(_opts, bundle) {
|
|
10
|
-
for (const file of Object.values(bundle)) {
|
|
11
|
-
if (file.type === "asset" || !file.isEntry || file.facadeModuleId == null) {
|
|
12
|
-
continue;
|
|
13
|
-
}
|
|
14
|
-
const hasDefaultExport = file.exports.includes("default");
|
|
15
|
-
const entrySourceFileName = relative(options.projectRoot, file.facadeModuleId);
|
|
16
|
-
const entrySourceDtsName = entrySourceFileName.replace(/\.[cm]?[jt]sx?$/, "");
|
|
17
|
-
const dtsFileName = file.fileName.replace(/\.[cm]?js$/, ".d.ts");
|
|
18
|
-
const relativeSourceDtsName = JSON.stringify("./" + entrySourceDtsName);
|
|
19
|
-
const dtsFileSource = hasDefaultExport ? `
|
|
20
|
-
export * from ${relativeSourceDtsName};
|
|
21
|
-
export { default } from ${relativeSourceDtsName};
|
|
22
|
-
` : `export * from ${relativeSourceDtsName};
|
|
23
|
-
`;
|
|
24
|
-
this.emitFile({
|
|
25
|
-
type: "asset",
|
|
26
|
-
fileName: dtsFileName,
|
|
27
|
-
source: dtsFileSource
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}), "typeDefinitions");
|
|
32
|
-
|
|
33
|
-
export {
|
|
34
|
-
typeDefinitions
|
|
35
|
-
};
|
package/dist/chunk-V2LF4EEM.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
5
|
-
|
|
6
|
-
// src/plugins/swc.ts
|
|
7
|
-
var swcPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => {
|
|
8
|
-
const { transform } = _chunk3GQAWCBQjs.__require.call(void 0, "@swc/core");
|
|
9
|
-
return {
|
|
10
|
-
name: "storm:swc",
|
|
11
|
-
transform(code, filename) {
|
|
12
|
-
return transform(code, {
|
|
13
|
-
filename,
|
|
14
|
-
jsc: {
|
|
15
|
-
transform: {
|
|
16
|
-
react: {
|
|
17
|
-
runtime: "automatic"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}, "swcPlugin");
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
exports.swcPlugin = swcPlugin;
|
package/dist/chunk-YNOD6WE4.js
DELETED
|
@@ -1,65 +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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
-
|
|
3
|
-
var _chunk2CDKPC2Jjs = require('./chunk-2CDKPC2J.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
7
|
-
|
|
8
|
-
// src/plugins/tsc.ts
|
|
9
|
-
var _devkit = require('@nx/devkit');
|
|
10
|
-
var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
|
|
11
|
-
var _compilerhelperdependency = require('@nx/js/src/utils/compiler-helper-dependency');
|
|
12
|
-
var _rollupplugintypescript2 = require('rollup-plugin-typescript2'); var _rollupplugintypescript22 = _interopRequireDefault(_rollupplugintypescript2);
|
|
13
|
-
|
|
14
|
-
// src/utilities/helpers.ts
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _path = require('path');
|
|
18
|
-
var _url = require('url');
|
|
19
|
-
var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
|
|
20
|
-
async function loadConfig(configPath) {
|
|
21
|
-
if (!/\.(js|mjs)$/.test(_path.extname.call(void 0, configPath))) {
|
|
22
|
-
throw new Error("Unsupported config file format");
|
|
23
|
-
}
|
|
24
|
-
return Promise.resolve().then(() => _interopRequireWildcard(require(_url.pathToFileURL.call(void 0, configPath).toString()))).then((config) => config.default);
|
|
25
|
-
}
|
|
26
|
-
_chunk3GQAWCBQjs.__name.call(void 0, loadConfig, "loadConfig");
|
|
27
|
-
async function createTsCompilerOptions(config, tsConfigPath, projectRoot, dependencies) {
|
|
28
|
-
const tsConfigFile = _typescript2.default.readConfigFile(_devkit.joinPathFragments.call(void 0, config.workspaceRoot, projectRoot, tsConfigPath), _typescript2.default.sys.readFile);
|
|
29
|
-
const tsConfig = _typescript2.default.parseJsonConfigFileContent(tsConfigFile.config, _typescript2.default.sys, _path.dirname.call(void 0, _devkit.joinPathFragments.call(void 0, config.workspaceRoot, projectRoot, tsConfigPath)));
|
|
30
|
-
const compilerOptions = {
|
|
31
|
-
rootDir: projectRoot,
|
|
32
|
-
declaration: true,
|
|
33
|
-
paths: _buildablelibsutils.computeCompilerOptionsPaths.call(void 0, tsConfig, _nullishCoalesce(dependencies, () => ( [])))
|
|
34
|
-
};
|
|
35
|
-
_chunk2CDKPC2Jjs.writeTrace.call(void 0, compilerOptions, config);
|
|
36
|
-
return compilerOptions;
|
|
37
|
-
}
|
|
38
|
-
_chunk3GQAWCBQjs.__name.call(void 0, createTsCompilerOptions, "createTsCompilerOptions");
|
|
39
|
-
|
|
40
|
-
// src/plugins/tsc.ts
|
|
41
|
-
var tscPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, resolvedOptions) => {
|
|
42
|
-
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
43
|
-
exitOnError: true
|
|
44
|
-
});
|
|
45
|
-
const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, resolvedOptions.config.workspaceRoot, resolvedOptions.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
46
|
-
let dependencies = result.dependencies;
|
|
47
|
-
const tsLibDependency = _compilerhelperdependency.getHelperDependency.call(void 0, _compilerhelperdependency.HelperDependency.tsc, resolvedOptions.tsconfig, dependencies, projectGraph, true);
|
|
48
|
-
if (tsLibDependency) {
|
|
49
|
-
dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
|
|
50
|
-
dependencies.push(tsLibDependency);
|
|
51
|
-
}
|
|
52
|
-
return _rollupplugintypescript22.default.call(void 0, {
|
|
53
|
-
check: options.emitTypes !== false,
|
|
54
|
-
tsconfig: resolvedOptions.tsconfig,
|
|
55
|
-
tsconfigOverride: {
|
|
56
|
-
compilerOptions: await createTsCompilerOptions(resolvedOptions.config, resolvedOptions.tsconfig, resolvedOptions.projectRoot, dependencies)
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}, "tscPlugin");
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
exports.loadConfig = loadConfig; exports.createTsCompilerOptions = createTsCompilerOptions; exports.tscPlugin = tscPlugin;
|