@storm-software/unbuild 0.17.0 → 0.17.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.
Files changed (46) hide show
  1. package/README.md +1 -1
  2. package/dist/build.cjs +15 -0
  3. package/dist/build.d.cts +13 -0
  4. package/dist/build.d.ts +13 -0
  5. package/dist/build.js +15 -0
  6. package/dist/chunk-3GQAWCBQ.js +13 -0
  7. package/dist/chunk-3VV4SMHK.js +65 -0
  8. package/dist/chunk-425BMCFI.cjs +31 -0
  9. package/dist/chunk-5N2TOSNK.cjs +21 -0
  10. package/dist/chunk-5RCA5OSO.cjs +35 -0
  11. package/dist/chunk-6G4AZLTO.cjs +28 -0
  12. package/dist/chunk-BGYQAVKQ.cjs +13 -0
  13. package/dist/chunk-C2GKE7R5.js +35 -0
  14. package/dist/chunk-D7L56O4W.js +1039 -0
  15. package/dist/chunk-DWREBCC4.cjs +557 -0
  16. package/dist/chunk-EES2DAYR.cjs +65 -0
  17. package/dist/chunk-FYSN6ZVI.js +21 -0
  18. package/dist/chunk-GGNOJ77I.js +0 -0
  19. package/dist/chunk-KVVGB74V.js +31 -0
  20. package/dist/chunk-LGSLDHM4.cjs +31 -0
  21. package/dist/chunk-OP52W2X6.cjs +35 -0
  22. package/dist/chunk-P5CSSAMQ.js +557 -0
  23. package/dist/chunk-REG7YZIZ.js +31 -0
  24. package/dist/chunk-SFZRYJZ2.cjs +1 -0
  25. package/dist/chunk-V3TNL7N7.cjs +1039 -0
  26. package/dist/chunk-VN5I7Q45.js +28 -0
  27. package/dist/chunk-X42DGJLB.js +35 -0
  28. package/dist/clean-DgUPedep.d.cts +1194 -0
  29. package/dist/clean-DgUPedep.d.ts +1194 -0
  30. package/dist/clean.cjs +8 -0
  31. package/dist/clean.d.cts +2 -0
  32. package/dist/clean.d.ts +2 -0
  33. package/dist/clean.js +8 -0
  34. package/dist/config.cjs +13 -0
  35. package/dist/config.d.cts +8 -0
  36. package/dist/config.d.ts +8 -0
  37. package/dist/config.js +13 -0
  38. package/dist/index.cjs +27 -0
  39. package/dist/index.d.cts +23 -0
  40. package/dist/index.d.ts +23 -0
  41. package/dist/index.js +27 -0
  42. package/dist/types.cjs +1 -0
  43. package/dist/types.d.cts +30 -0
  44. package/dist/types.d.ts +30 -0
  45. package/dist/types.js +1 -0
  46. package/package.json +1 -1
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-0.16.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-0.17.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
package/dist/build.cjs ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkV3TNL7N7cjs = require('./chunk-V3TNL7N7.cjs');
4
+ require('./chunk-5N2TOSNK.cjs');
5
+ require('./chunk-LGSLDHM4.cjs');
6
+ require('./chunk-EES2DAYR.cjs');
7
+ require('./chunk-5RCA5OSO.cjs');
8
+ require('./chunk-OP52W2X6.cjs');
9
+ require('./chunk-425BMCFI.cjs');
10
+ require('./chunk-DWREBCC4.cjs');
11
+ require('./chunk-6G4AZLTO.cjs');
12
+ require('./chunk-BGYQAVKQ.cjs');
13
+
14
+
15
+ exports.build = _chunkV3TNL7N7cjs.build;
@@ -0,0 +1,13 @@
1
+ import { UnbuildOptions } from './types.cjs';
2
+ import '@storm-software/build-tools';
3
+ import 'unbuild';
4
+
5
+ /**
6
+ * Execution pipeline that applies a set of actions
7
+ *
8
+ * @param options - the build options
9
+ * @returns the build result
10
+ */
11
+ declare function build(options: UnbuildOptions): Promise<void>;
12
+
13
+ export { build };
@@ -0,0 +1,13 @@
1
+ import { UnbuildOptions } from './types.js';
2
+ import '@storm-software/build-tools';
3
+ import 'unbuild';
4
+
5
+ /**
6
+ * Execution pipeline that applies a set of actions
7
+ *
8
+ * @param options - the build options
9
+ * @returns the build result
10
+ */
11
+ declare function build(options: UnbuildOptions): Promise<void>;
12
+
13
+ export { build };
package/dist/build.js ADDED
@@ -0,0 +1,15 @@
1
+ import {
2
+ build
3
+ } from "./chunk-D7L56O4W.js";
4
+ import "./chunk-FYSN6ZVI.js";
5
+ import "./chunk-KVVGB74V.js";
6
+ import "./chunk-3VV4SMHK.js";
7
+ import "./chunk-X42DGJLB.js";
8
+ import "./chunk-C2GKE7R5.js";
9
+ import "./chunk-REG7YZIZ.js";
10
+ import "./chunk-P5CSSAMQ.js";
11
+ import "./chunk-VN5I7Q45.js";
12
+ import "./chunk-3GQAWCBQ.js";
13
+ export {
14
+ build
15
+ };
@@ -0,0 +1,13 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
4
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
5
+ }) : x)(function(x) {
6
+ if (typeof require !== "undefined") return require.apply(this, arguments);
7
+ throw Error('Dynamic require of "' + x + '" is not supported');
8
+ });
9
+
10
+ export {
11
+ __name,
12
+ __require
13
+ };
@@ -0,0 +1,65 @@
1
+ import {
2
+ writeTrace
3
+ } from "./chunk-P5CSSAMQ.js";
4
+ import {
5
+ __name
6
+ } from "./chunk-3GQAWCBQ.js";
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
+ };
@@ -0,0 +1,31 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkDWREBCC4cjs = require('./chunk-DWREBCC4.cjs');
4
+
5
+
6
+ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
7
+
8
+ // src/plugins/on-error.ts
9
+ var onErrorPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (options, resolvedOptions) => ({
10
+ name: "storm:on-error",
11
+ buildEnd(error) {
12
+ if (error) {
13
+ _chunkDWREBCC4cjs.writeError.call(void 0, `The following errors occurred during the build:
14
+ ${error ? error.message : "Unknown build error"}
15
+
16
+ `, resolvedOptions.config);
17
+ throw new Error("Storm unbuild process failed with errors.");
18
+ }
19
+ },
20
+ renderError(error) {
21
+ _chunkDWREBCC4cjs.writeError.call(void 0, `The following errors occurred during the build:
22
+ ${error ? error.message : "Unknown build error"}
23
+
24
+ `, resolvedOptions.config);
25
+ throw new Error("Storm unbuild process failed with errors.");
26
+ }
27
+ }), "onErrorPlugin");
28
+
29
+
30
+
31
+ exports.onErrorPlugin = onErrorPlugin;
@@ -0,0 +1,21 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkDWREBCC4cjs = require('./chunk-DWREBCC4.cjs');
5
+
6
+
7
+ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
8
+
9
+ // src/clean.ts
10
+ var _node = require('@humanfs/node');
11
+ async function clean(name = "Unbuild", directory, config) {
12
+ _chunkDWREBCC4cjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
13
+ const stopwatch = _chunkDWREBCC4cjs.getStopwatch.call(void 0, `${name} output clean`);
14
+ await _node.hfs.deleteAll(directory);
15
+ stopwatch();
16
+ }
17
+ _chunkBGYQAVKQcjs.__name.call(void 0, clean, "clean");
18
+
19
+
20
+
21
+ exports.clean = clean;
@@ -0,0 +1,35 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
4
+
5
+ // src/plugins/type-definitions.ts
6
+ var _path = require('path');
7
+ var typeDefinitions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (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 = _path.relative.call(void 0, 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
+
34
+
35
+ exports.typeDefinitions = typeDefinitions;
@@ -0,0 +1,28 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
5
+
6
+ // src/plugins/swc.ts
7
+ var swcPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (options, resolvedOptions) => {
8
+ const { transform } = _chunkBGYQAVKQcjs.__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;
@@ -0,0 +1,13 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
4
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
5
+ }) : x)(function(x) {
6
+ if (typeof require !== "undefined") return require.apply(this, arguments);
7
+ throw Error('Dynamic require of "' + x + '" is not supported');
8
+ });
9
+
10
+
11
+
12
+
13
+ exports.__name = __name; exports.__require = __require;
@@ -0,0 +1,35 @@
1
+ import {
2
+ writeInfo
3
+ } from "./chunk-P5CSSAMQ.js";
4
+ import {
5
+ __name
6
+ } from "./chunk-3GQAWCBQ.js";
7
+
8
+ // src/plugins/analyze.ts
9
+ var formatBytes = /* @__PURE__ */ __name((bytes) => {
10
+ if (bytes === 0) return "0 Byte";
11
+ const k = 1e3;
12
+ const dm = 3;
13
+ const sizes = [
14
+ "Bytes",
15
+ "KB",
16
+ "MB",
17
+ "GB"
18
+ ];
19
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
20
+ return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
21
+ }, "formatBytes");
22
+ var analyzePlugin = /* @__PURE__ */ __name((options, resolvedOptions) => {
23
+ return {
24
+ name: "storm:analyzer",
25
+ renderChunk(source, chunk) {
26
+ const sourceBytes = formatBytes(source.length);
27
+ const fileName = chunk.fileName;
28
+ writeInfo(` - ${fileName} ${sourceBytes}`, resolvedOptions.config);
29
+ }
30
+ };
31
+ }, "analyzePlugin");
32
+
33
+ export {
34
+ analyzePlugin
35
+ };