@storm-software/unbuild 0.4.0 → 0.14.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 (48) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -203
  3. package/dist/build.cjs +0 -12
  4. package/dist/build.cjs.map +0 -1
  5. package/dist/build.d.cts +0 -15
  6. package/dist/build.d.ts +0 -15
  7. package/dist/build.js +0 -12
  8. package/dist/build.js.map +0 -1
  9. package/dist/chunk-2D6P3CYT.js +0 -30
  10. package/dist/chunk-2D6P3CYT.js.map +0 -1
  11. package/dist/chunk-2RW67XSV.js +0 -35
  12. package/dist/chunk-2RW67XSV.js.map +0 -1
  13. package/dist/chunk-55SAPUWC.cjs +0 -287
  14. package/dist/chunk-55SAPUWC.cjs.map +0 -1
  15. package/dist/chunk-5O4CMGE3.js +0 -39
  16. package/dist/chunk-5O4CMGE3.js.map +0 -1
  17. package/dist/chunk-5TZKA5S2.cjs +0 -35
  18. package/dist/chunk-5TZKA5S2.cjs.map +0 -1
  19. package/dist/chunk-M363ZMBF.cjs +0 -33
  20. package/dist/chunk-M363ZMBF.cjs.map +0 -1
  21. package/dist/chunk-MUYXFAKB.cjs +0 -1
  22. package/dist/chunk-MUYXFAKB.cjs.map +0 -1
  23. package/dist/chunk-OEV7OJT7.cjs +0 -39
  24. package/dist/chunk-OEV7OJT7.cjs.map +0 -1
  25. package/dist/chunk-QNDLJ2W7.js +0 -1
  26. package/dist/chunk-QNDLJ2W7.js.map +0 -1
  27. package/dist/chunk-RPYRKRTK.js +0 -33
  28. package/dist/chunk-RPYRKRTK.js.map +0 -1
  29. package/dist/chunk-TOVAFM3V.js +0 -287
  30. package/dist/chunk-TOVAFM3V.js.map +0 -1
  31. package/dist/chunk-WCQVDF3K.js +0 -14
  32. package/dist/chunk-WCQVDF3K.js.map +0 -1
  33. package/dist/chunk-WGEGR3DF.cjs +0 -14
  34. package/dist/chunk-WGEGR3DF.cjs.map +0 -1
  35. package/dist/chunk-YII2QWOA.cjs +0 -30
  36. package/dist/chunk-YII2QWOA.cjs.map +0 -1
  37. package/dist/index.cjs +0 -13
  38. package/dist/index.cjs.map +0 -1
  39. package/dist/index.d.cts +0 -6
  40. package/dist/index.d.ts +0 -6
  41. package/dist/index.js +0 -13
  42. package/dist/index.js.map +0 -1
  43. package/dist/types.cjs +0 -2
  44. package/dist/types.cjs.map +0 -1
  45. package/dist/types.d.cts +0 -1229
  46. package/dist/types.d.ts +0 -1229
  47. package/dist/types.js +0 -2
  48. package/dist/types.js.map +0 -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.26.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.14.1-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/package.json CHANGED
@@ -1,203 +1 @@
1
- {
2
- "name": "@storm-software/unbuild",
3
- "version": "0.4.0",
4
- "type": "module",
5
- "description": "A package containing `unbuild` utilities for building Storm Software libraries and applications",
6
- "repository": {
7
- "type": "github",
8
- "url": "https://github.com/storm-software/storm-ops.git",
9
- "directory": "packages/unbuild"
10
- },
11
- "homepage": "https://stormsoftware.com",
12
- "bugs": {
13
- "url": "https://github.com/storm-software/storm-ops/issues",
14
- "email": "support@stormsoftware.com"
15
- },
16
- "author": {
17
- "name": "Storm Software",
18
- "email": "contact@stormsoftware.com",
19
- "url": "https://stormsoftware.com"
20
- },
21
- "maintainers": [
22
- {
23
- "name": "Storm Software",
24
- "email": "contact@stormsoftware.com",
25
- "url": "https://stormsoftware.com"
26
- },
27
- {
28
- "name": "Pat Sullivan",
29
- "email": "admin@stormsoftware.com",
30
- "url": "https://patsullivan.org"
31
- }
32
- ],
33
- "contributors": [
34
- {
35
- "name": "Storm Software",
36
- "email": "contact@stormsoftware.com",
37
- "url": "https://stormsoftware.com"
38
- }
39
- ],
40
- "funding": {
41
- "type": "github",
42
- "url": "https://github.com/sponsors/storm-software"
43
- },
44
- "license": "Apache-2.0",
45
- "private": false,
46
- "packageManager": "pnpm@9.10.0",
47
- "engines": {
48
- "node": ">=22.4.0",
49
- "pnpm": ">=9.10.0"
50
- },
51
- "main": "./dist/index.cjs",
52
- "module": "./dist/index.js",
53
- "exports": {
54
- "./package.json": "./package.json",
55
- "./index": {
56
- "import": {
57
- "types": "./dist/index.d.ts",
58
- "default": "./dist/index.js"
59
- },
60
- "require": {
61
- "types": "./dist/index.d.cts",
62
- "default": "./dist/index.cjs"
63
- },
64
- "default": {
65
- "types": "./dist/index.d.ts",
66
- "default": "./dist/index.js"
67
- }
68
- },
69
- "./build": {
70
- "import": {
71
- "types": "./dist/build.d.ts",
72
- "default": "./dist/build.js"
73
- },
74
- "require": {
75
- "types": "./dist/build.d.cts",
76
- "default": "./dist/build.cjs"
77
- },
78
- "default": {
79
- "types": "./dist/build.d.ts",
80
- "default": "./dist/build.js"
81
- }
82
- },
83
- "./types": {
84
- "import": {
85
- "types": "./dist/types.d.ts",
86
- "default": "./dist/types.js"
87
- },
88
- "require": {
89
- "types": "./dist/types.d.cts",
90
- "default": "./dist/types.cjs"
91
- },
92
- "default": {
93
- "types": "./dist/types.d.ts",
94
- "default": "./dist/types.js"
95
- }
96
- },
97
- "./plugins/*": {
98
- "import": {
99
- "types": "./dist/plugins/*.d.ts",
100
- "default": "./dist/plugins/*.js"
101
- },
102
- "require": {
103
- "types": "./dist/plugins/*.d.cts",
104
- "default": "./dist/plugins/*.cjs"
105
- },
106
- "default": {
107
- "types": "./dist/plugins/*.d.ts",
108
- "default": "./dist/plugins/*.js"
109
- }
110
- },
111
- ".": {
112
- "import": {
113
- "types": "./dist/index.d.ts",
114
- "default": "./dist/index.js"
115
- },
116
- "require": {
117
- "types": "./dist/index.d.cts",
118
- "default": "./dist/index.cjs"
119
- },
120
- "default": {
121
- "types": "./dist/index.d.ts",
122
- "default": "./dist/index.js"
123
- }
124
- }
125
- },
126
- "types": "./dist/index.d.ts",
127
- "files": [
128
- "dist/**/*"
129
- ],
130
- "keywords": [
131
- "storm",
132
- "storm-ops",
133
- "storm-stack",
134
- "acidic",
135
- "cyclone-ui",
136
- "unbuild",
137
- "sullivanpj",
138
- "monorepo"
139
- ],
140
- "peerDependencies": {
141
- "@nx/devkit": "^20.2.2",
142
- "@nx/js": "^20.2.2",
143
- "@storm-software/build-tools": "workspace:*",
144
- "@storm-software/config-tools": "workspace:*",
145
- "@swc/core": "^1.5.29",
146
- "nx": "^20.2.2",
147
- "rollup": "^4.29.1",
148
- "typescript": "^5.7.2",
149
- "unbuild": "^2.0.0"
150
- },
151
- "peerDependenciesMeta": {
152
- "@nx/devkit": {
153
- "optional": false
154
- },
155
- "@nx/js": {
156
- "optional": false
157
- },
158
- "@storm-software/build-tools": {
159
- "optional": false
160
- },
161
- "@storm-software/config-tools": {
162
- "optional": false
163
- },
164
- "@swc/core": {
165
- "optional": true
166
- },
167
- "nx": {
168
- "optional": false
169
- },
170
- "rollup": {
171
- "optional": false
172
- },
173
- "typescript": {
174
- "optional": false
175
- },
176
- "unbuild": {
177
- "optional": false
178
- }
179
- },
180
- "dependencies": {
181
- "@humanfs/node": "^0.16.6",
182
- "deepmerge": "4.3.1",
183
- "rollup": "^4.29.1",
184
- "rollup-plugin-typescript2": "0.36.0"
185
- },
186
- "devDependencies": {
187
- "@nx/devkit": "^20.2.2",
188
- "@nx/js": "^20.2.2",
189
- "@storm-software/build-tools": "workspace:*",
190
- "@storm-software/config": "workspace:*",
191
- "@storm-software/config-tools": "workspace:*",
192
- "@swc/core": "^1.5.29",
193
- "@types/rollup": "^0.54.0",
194
- "nx": "^20.2.2",
195
- "tsup": "^8.3.5",
196
- "typescript": "^5.7.2",
197
- "unbuild": "^2.0.0"
198
- },
199
- "publishConfig": {
200
- "access": "public"
201
- },
202
- "sideEffects": false
203
- }
1
+ {"name":"@storm-software/unbuild","version":"0.14.1","type":"module","description":"A package containing `unbuild` utilities for building Storm Software libraries and applications","repository":{"type":"github","url":"https://github.com/storm-software/storm-ops.git","directory":"packages/unbuild"},"homepage":"https://stormsoftware.com","bugs":"https://github.com/storm-software/storm-ops/issues","author":{"name":"Storm Software","email":"contact@stormsoftware.com","url":"https://stormsoftware.com"},"maintainers":[{"name":"Storm Software","email":"contact@stormsoftware.com","url":"https://stormsoftware.com"},{"name":"Pat Sullivan","email":"admin@stormsoftware.com","url":"https://patsullivan.org"}],"contributors":[{"name":"Storm Software","email":"contact@stormsoftware.com","url":"https://stormsoftware.com"}],"funding":{"type":"github","url":"https://github.com/sponsors/storm-software"},"license":"Apache-2.0","private":false,"packageManager":"pnpm@9.15.2","engines":{"node":">=22.4.0","pnpm":">=9.15.2"},"bin":{"storm-unbuild":"./bin/unbuild.js","storm-unbuild-cjs":"./bin/unbuild.cjs","storm-unbuild-esm":"./bin/unbuild.js"},"main":"./dist/index.cjs","module":"./dist/index.js","exports":{"./package.json":"./package.json","./types":{"import":{"types":"./dist/types.d.ts","default":"./dist/types.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/types.cjs"},"default":{"types":"./dist/types.d.ts","default":"./dist/types.js"}},"./index":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./config":{"import":{"types":"./dist/config.d.ts","default":"./dist/config.js"},"require":{"types":"./dist/config.d.cts","default":"./dist/config.cjs"},"default":{"types":"./dist/config.d.ts","default":"./dist/config.js"}},"./clean":{"import":{"types":"./dist/clean.d.ts","default":"./dist/clean.js"},"require":{"types":"./dist/clean.d.cts","default":"./dist/clean.cjs"},"default":{"types":"./dist/clean.d.ts","default":"./dist/clean.js"}},"./build":{"import":{"types":"./dist/build/index.d.ts","default":"./dist/build/index.js"},"require":{"types":"./dist/build/index.d.cts","default":"./dist/build/index.cjs"},"default":{"types":"./dist/build/index.d.ts","default":"./dist/build/index.js"}},"./plugins/*":{"import":{"types":"./dist/plugins/*.d.ts","default":"./dist/plugins/*.js"},"require":{"types":"./dist/plugins/*.d.cts","default":"./dist/plugins/*.cjs"},"default":{"types":"./dist/plugins/*.d.ts","default":"./dist/plugins/*.js"}}},"types":"./dist/index.d.ts","files":["dist/**/*"],"keywords":["acidic","cyclone-ui","monorepo","storm","storm-ops","storm-stack","sullivanpj","unbuild"],"peerDependencies":{"@nx/devkit":"^20.3.1","@nx/js":"^20.3.1","@storm-software/build-tools":"workspace:*","@storm-software/config-tools":"workspace:*","@swc/core":"1.7.26","nx":"^20.3.1","rollup":"^4.29.1","typescript":"^5.7.2","unbuild":"^3.2.0"},"peerDependenciesMeta":{"@nx/devkit":{"optional":false},"@nx/js":{"optional":false},"@storm-software/build-tools":{"optional":false},"@storm-software/config-tools":{"optional":false},"@swc/core":{"optional":true},"nx":{"optional":false},"rollup":{"optional":false},"typescript":{"optional":false},"unbuild":{"optional":false}},"dependencies":{"@humanfs/node":"^0.16.6","commander":"^12.1.0","defu":"6.1.4","rollup":"^4.29.1","rollup-plugin-typescript2":"0.36.0"},"devDependencies":{"@nx/devkit":"^20.3.1","@nx/js":"^20.3.1","@storm-software/build-tools":"0.122.1","@storm-software/config":"1.91.1","@storm-software/config-tools":"1.130.1","@swc/core":"1.7.26","@types/node":"^22.10.2","nx":"^20.3.1","tsup":"8.3.5","typescript":"^5.7.2","unbuild":"^3.2.0"},"publishConfig":{"access":"public"},"sideEffects":false}
package/dist/build.cjs DELETED
@@ -1,12 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunk55SAPUWCcjs = require('./chunk-55SAPUWC.cjs');
4
- require('./chunk-5TZKA5S2.cjs');
5
- require('./chunk-M363ZMBF.cjs');
6
- require('./chunk-YII2QWOA.cjs');
7
- require('./chunk-OEV7OJT7.cjs');
8
- require('./chunk-WGEGR3DF.cjs');
9
-
10
-
11
- exports.build = _chunk55SAPUWCcjs.build;
12
- //# sourceMappingURL=build.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/storm-ops/storm-ops/packages/unbuild/dist/build.cjs"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wCAAC","file":"/home/runner/work/storm-ops/storm-ops/packages/unbuild/dist/build.cjs"}
package/dist/build.d.cts DELETED
@@ -1,15 +0,0 @@
1
- import { UnbuildOptions } from './types.cjs';
2
- import '@storm-software/build-tools';
3
- import 'zod';
4
- import 'nx/src/utils/find-workspace-root';
5
- import 'unbuild';
6
-
7
- /**
8
- * Execution pipeline that applies a set of actions
9
- *
10
- * @param options - the build options
11
- * @returns the build result
12
- */
13
- declare function build(options: UnbuildOptions): Promise<void>;
14
-
15
- export { build };
package/dist/build.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { UnbuildOptions } from './types.js';
2
- import '@storm-software/build-tools';
3
- import 'zod';
4
- import 'nx/src/utils/find-workspace-root';
5
- import 'unbuild';
6
-
7
- /**
8
- * Execution pipeline that applies a set of actions
9
- *
10
- * @param options - the build options
11
- * @returns the build result
12
- */
13
- declare function build(options: UnbuildOptions): Promise<void>;
14
-
15
- export { build };
package/dist/build.js DELETED
@@ -1,12 +0,0 @@
1
- import {
2
- build
3
- } from "./chunk-TOVAFM3V.js";
4
- import "./chunk-2RW67XSV.js";
5
- import "./chunk-RPYRKRTK.js";
6
- import "./chunk-2D6P3CYT.js";
7
- import "./chunk-5O4CMGE3.js";
8
- import "./chunk-WCQVDF3K.js";
9
- export {
10
- build
11
- };
12
- //# sourceMappingURL=build.js.map
package/dist/build.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,30 +0,0 @@
1
- import {
2
- __name,
3
- __require
4
- } from "./chunk-WCQVDF3K.js";
5
-
6
- // src/plugins/swc-plugin.ts
7
- function swcPlugin() {
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
- }
25
- __name(swcPlugin, "swcPlugin");
26
-
27
- export {
28
- swcPlugin
29
- };
30
- //# sourceMappingURL=chunk-2D6P3CYT.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugins/swc-plugin.ts"],"sourcesContent":["import type { Plugin } from \"rollup\";\n\nexport function swcPlugin(): Plugin {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { transform } = require(\"@swc/core\");\n return {\n name: \"storm:swc\",\n transform(code, filename) {\n return transform(code, {\n filename,\n jsc: {\n transform: {\n react: { runtime: \"automatic\" }\n }\n }\n });\n }\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,YAAAA;AAEd,QAAM,EAAEC,UAAS,IAAKC,UAAQ,WAAA;AAC9B,SAAO;IACLC,MAAM;IACNF,UAAUG,MAAMC,UAAQ;AACtB,aAAOJ,UAAUG,MAAM;QACrBC;QACAC,KAAK;UACHL,WAAW;YACTM,OAAO;cAAEC,SAAS;YAAY;UAChC;QACF;MACF,CAAA;IACF;EACF;AACF;AAhBgBR;","names":["swcPlugin","transform","require","name","code","filename","jsc","react","runtime"]}
@@ -1,35 +0,0 @@
1
- import {
2
- __name
3
- } from "./chunk-WCQVDF3K.js";
4
-
5
- // src/plugins/analyze-plugin.ts
6
- import { writeInfo } from "@storm-software/config-tools";
7
- var formatBytes = /* @__PURE__ */ __name((bytes) => {
8
- if (bytes === 0) return "0 Byte";
9
- const k = 1e3;
10
- const dm = 3;
11
- const sizes = [
12
- "Bytes",
13
- "KB",
14
- "MB",
15
- "GB"
16
- ];
17
- const i = Math.floor(Math.log(bytes) / Math.log(k));
18
- return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
19
- }, "formatBytes");
20
- function analyzePlugin() {
21
- return {
22
- name: "storm:analyzer",
23
- renderChunk(source, chunk) {
24
- const sourceBytes = formatBytes(source.length);
25
- const fileName = chunk.fileName;
26
- writeInfo(` ${fileName} ${sourceBytes}`);
27
- }
28
- };
29
- }
30
- __name(analyzePlugin, "analyzePlugin");
31
-
32
- export {
33
- analyzePlugin
34
- };
35
- //# sourceMappingURL=chunk-2RW67XSV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugins/analyze-plugin.ts"],"sourcesContent":["import { writeInfo } from \"@storm-software/config-tools\";\n\nconst formatBytes = bytes => {\n if (bytes === 0) return \"0 Byte\";\n const k = 1000;\n const dm = 3;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;\n};\n\nexport function analyzePlugin() {\n return {\n name: \"storm:analyzer\",\n renderChunk(source, chunk) {\n const sourceBytes = formatBytes(source.length);\n const fileName = chunk.fileName;\n\n writeInfo(` ${fileName} ${sourceBytes}`);\n }\n };\n}\n"],"mappings":";;;;;AAAA,SAASA,iBAAiB;AAE1B,IAAMC,cAAcC,wBAAAA,UAAAA;AAClB,MAAIA,UAAU,EAAG,QAAO;AACxB,QAAMC,IAAI;AACV,QAAMC,KAAK;AACX,QAAMC,QAAQ;IAAC;IAAS;IAAM;IAAM;;AACpC,QAAMC,IAAIC,KAAKC,MAAMD,KAAKE,IAAIP,KAAAA,IAASK,KAAKE,IAAIN,CAAAA,CAAAA;AAChD,SAAO,GAAGO,YAAYR,QAAQC,KAAKG,GAAGK,QAAQP,EAAAA,CAAAA,CAAAA,IAAQC,MAAMC,CAAAA,CAAE;AAChE,GAPoBJ;AASb,SAASU,gBAAAA;AACd,SAAO;IACLC,MAAM;IACNC,YAAYC,QAAQC,OAAK;AACvB,YAAMC,cAAchB,YAAYc,OAAOG,MAAM;AAC7C,YAAMC,WAAWH,MAAMG;AAEvBC,gBAAU,KAAKD,QAAAA,IAAYF,WAAAA,EAAa;IAC1C;EACF;AACF;AAVgBL;","names":["writeInfo","formatBytes","bytes","k","dm","sizes","i","Math","floor","log","parseFloat","toFixed","analyzePlugin","name","renderChunk","source","chunk","sourceBytes","length","fileName","writeInfo"]}
@@ -1,287 +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(); } } 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 _chunk5TZKA5S2cjs = require('./chunk-5TZKA5S2.cjs');
4
-
5
-
6
- var _chunkM363ZMBFcjs = require('./chunk-M363ZMBF.cjs');
7
-
8
-
9
- var _chunkYII2QWOAcjs = require('./chunk-YII2QWOA.cjs');
10
-
11
-
12
- var _chunkOEV7OJT7cjs = require('./chunk-OEV7OJT7.cjs');
13
-
14
-
15
- var _chunkWGEGR3DFcjs = require('./chunk-WGEGR3DF.cjs');
16
-
17
- // src/build.ts
18
- var _node = require('@humanfs/node');
19
- var _devkit = require('@nx/devkit');
20
- var _js = require('@nx/js');
21
- var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
22
- var _buildtools = require('@storm-software/build-tools');
23
- var _configtools = require('@storm-software/config-tools');
24
- var _deepmerge = require('deepmerge'); var _deepmerge2 = _interopRequireDefault(_deepmerge);
25
- var _path = require('path');
26
- var _url = require('url');
27
- var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
28
- var _rollupplugintypescript2 = require('rollup-plugin-typescript2'); var _rollupplugintypescript22 = _interopRequireDefault(_rollupplugintypescript2);
29
- var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
30
- var _unbuild = require('unbuild');
31
- async function resolveOptions(options) {
32
- const projectRoot = options.projectRoot;
33
- const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
34
- if (!workspaceRoot) {
35
- throw new Error("Cannot find Nx workspace root");
36
- }
37
- if (options.configPath) {
38
- const configFile = await loadConfig(options.configPath);
39
- if (configFile) {
40
- options = _deepmerge2.default.call(void 0, options, configFile);
41
- }
42
- }
43
- const config = await _configtools.loadStormConfig.call(void 0, workspaceRoot.dir);
44
- const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
45
- exitOnError: true
46
- });
47
- const projectJsonPath = _devkit.joinPathFragments.call(void 0, workspaceRoot.dir, projectRoot, "project.json");
48
- if (!await _node.hfs.isFile(projectJsonPath)) {
49
- throw new Error("Cannot find project.json configuration");
50
- }
51
- const projectJson = await _node.hfs.json(projectJsonPath);
52
- const projectName = projectJson.name;
53
- const packageJsonPath = _devkit.joinPathFragments.call(void 0, workspaceRoot.dir, projectRoot, "package.json");
54
- if (!await _node.hfs.isFile(packageJsonPath)) {
55
- throw new Error("Cannot find package.json configuration");
56
- }
57
- const packageJson = await _node.hfs.json(packageJsonPath);
58
- let tsConfigPath = options.tsConfigPath;
59
- if (!tsConfigPath) {
60
- tsConfigPath = _devkit.joinPathFragments.call(void 0, workspaceRoot.dir, projectRoot, "tsconfig.json");
61
- }
62
- if (!await _node.hfs.isFile(tsConfigPath)) {
63
- throw new Error("Cannot find tsconfig.json configuration");
64
- }
65
- let sourceRoot = projectJson.sourceRoot;
66
- if (!sourceRoot) {
67
- sourceRoot = _devkit.joinPathFragments.call(void 0, projectRoot, "src");
68
- }
69
- if (!await _node.hfs.isDirectory(sourceRoot)) {
70
- throw new Error("Cannot find sourceRoot directory");
71
- }
72
- const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
73
- if (!_optionalChain([projectConfigurations, 'optionalAccess', _ => _.projects, 'optionalAccess', _2 => _2[projectName]])) {
74
- 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.");
75
- }
76
- const nxJsonPath = _devkit.joinPathFragments.call(void 0, config.workspaceRoot, "nx.json");
77
- if (!await _node.hfs.isFile(nxJsonPath)) {
78
- throw new Error("Cannot find Nx workspace configuration");
79
- }
80
- if (!_optionalChain([projectConfigurations, 'optionalAccess', _3 => _3.projects, 'optionalAccess', _4 => _4[projectName]])) {
81
- 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.");
82
- }
83
- const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot.dir, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
84
- let dependencies = result.dependencies;
85
- const tsLibDependency = _js.getHelperDependency.call(void 0, _js.HelperDependency.tsc, tsConfigPath, dependencies, projectGraph, true);
86
- if (tsLibDependency) {
87
- dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
88
- dependencies.push(tsLibDependency);
89
- }
90
- const resolvedOptions = {
91
- name: projectName,
92
- config,
93
- workspaceRoot,
94
- projectRoot,
95
- sourceRoot,
96
- projectName,
97
- tsConfigPath,
98
- clean: false,
99
- entries: [
100
- {
101
- builder: "mkdist",
102
- input: `.${sourceRoot.replace(projectRoot, "")}`,
103
- outDir: _path.join.call(void 0, _path.relative.call(void 0, _path.join.call(void 0, workspaceRoot.dir, projectRoot), workspaceRoot.dir).replaceAll("\\", "/"), options.outDir, "dist").replaceAll("\\", "/"),
104
- declaration: true,
105
- format: "esm"
106
- },
107
- {
108
- builder: "mkdist",
109
- input: `.${sourceRoot.replace(projectRoot, "")}`,
110
- outDir: _path.join.call(void 0, _path.relative.call(void 0, _path.join.call(void 0, workspaceRoot.dir, projectRoot), workspaceRoot.dir).replaceAll("\\", "/"), options.outDir, "dist").replaceAll("\\", "/"),
111
- declaration: true,
112
- format: "cjs",
113
- ext: "cjs"
114
- }
115
- ],
116
- declaration: "compatible",
117
- failOnWarn: false,
118
- hooks: {
119
- "rollup:options": /* @__PURE__ */ _chunkWGEGR3DFcjs.__name.call(void 0, async (ctx, opts) => {
120
- opts.plugins = [
121
- _chunk5TZKA5S2cjs.analyzePlugin.call(void 0, ),
122
- _chunkYII2QWOAcjs.swcPlugin.call(void 0, ),
123
- ..._nullishCoalesce(opts.plugins, () => ( [])),
124
- _rollupplugintypescript22.default.call(void 0, {
125
- check: true,
126
- tsconfig: tsConfigPath,
127
- tsconfigOverride: {
128
- compilerOptions: await createTsCompilerOptions(config, tsConfigPath, projectRoot, dependencies)
129
- }
130
- }),
131
- _chunkOEV7OJT7cjs.typeDefinitions.call(void 0, {
132
- projectRoot
133
- }),
134
- _chunkM363ZMBFcjs.onErrorPlugin.call(void 0, )
135
- ];
136
- }, "rollup:options")
137
- },
138
- sourcemap: _nullishCoalesce(options.sourcemap, () => ( true)),
139
- outDir: options.outDir,
140
- stub: false,
141
- stubOptions: {
142
- jiti: {}
143
- },
144
- externals: [],
145
- dependencies: [],
146
- peerDependencies: [],
147
- devDependencies: [],
148
- alias: {},
149
- replace: {},
150
- rollup: {
151
- replace: {},
152
- alias: {},
153
- json: {},
154
- commonjs: {
155
- sourceMap: _nullishCoalesce(options.sourcemap, () => ( true))
156
- },
157
- emitCJS: true,
158
- cjsBridge: true,
159
- dts: {
160
- respectExternal: true,
161
- tsconfig: tsConfigPath
162
- },
163
- output: {
164
- banner: options.banner,
165
- footer: options.footer
166
- },
167
- resolve: {
168
- preferBuiltins: true,
169
- extensions: [
170
- ".cjs",
171
- ".mjs",
172
- ".js",
173
- ".jsx",
174
- ".ts",
175
- ".tsx",
176
- ".json"
177
- ]
178
- },
179
- esbuild: {
180
- minify: !!options.minify,
181
- treeShaking: true,
182
- color: true,
183
- logLevel: config.logLevel === _configtools.LogLevelLabel.FATAL ? _configtools.LogLevelLabel.ERROR : config.logLevel === _configtools.LogLevelLabel.ALL || config.logLevel === _configtools.LogLevelLabel.TRACE ? "verbose" : config.logLevel
184
- }
185
- }
186
- };
187
- dependencies = dependencies.filter((dep) => dep.node.type === "npm" || dep.node.type === "lib" || dep.node.type === "app");
188
- if (dependencies.length > 0) {
189
- resolvedOptions.dependencies = dependencies.map((dep) => dep.name);
190
- }
191
- if (packageJson.devDependencies) {
192
- resolvedOptions.devDependencies = Object.keys(packageJson.devDependencies);
193
- }
194
- if (packageJson.peerDependencies) {
195
- resolvedOptions.peerDependencies = Object.keys(packageJson.peerDependencies);
196
- }
197
- if (options.rollup) {
198
- let rollup = {};
199
- if (typeof options.rollup === "string") {
200
- const rollupFile = await loadConfig(options.rollup);
201
- if (rollupFile) {
202
- rollup = rollupFile;
203
- }
204
- } else {
205
- rollup = options.rollup;
206
- }
207
- resolvedOptions.rollup = _deepmerge2.default.call(void 0, _nullishCoalesce(resolvedOptions.rollup, () => ( {})), rollup);
208
- }
209
- return resolvedOptions;
210
- }
211
- _chunkWGEGR3DFcjs.__name.call(void 0, resolveOptions, "resolveOptions");
212
- async function loadConfig(configPath) {
213
- if (!/\.(js|mjs)$/.test(_path.extname.call(void 0, configPath))) {
214
- throw new Error("Unsupported config file format");
215
- }
216
- return Promise.resolve().then(() => _interopRequireWildcard(require(_url.pathToFileURL.call(void 0, configPath).toString()))).then((config) => config.default);
217
- }
218
- _chunkWGEGR3DFcjs.__name.call(void 0, loadConfig, "loadConfig");
219
- async function createTsCompilerOptions(config, tsConfigPath, projectRoot, dependencies) {
220
- const tsConfigFile = _typescript2.default.readConfigFile(_devkit.joinPathFragments.call(void 0, config.workspaceRoot, projectRoot, tsConfigPath), _typescript2.default.sys.readFile);
221
- const tsConfig = _typescript2.default.parseJsonConfigFileContent(tsConfigFile.config, _typescript2.default.sys, _path.dirname.call(void 0, _devkit.joinPathFragments.call(void 0, config.workspaceRoot, projectRoot, tsConfigPath)));
222
- const compilerOptions = {
223
- rootDir: projectRoot,
224
- declaration: true,
225
- paths: _buildablelibsutils.computeCompilerOptionsPaths.call(void 0, tsConfig, _nullishCoalesce(dependencies, () => ( [])))
226
- };
227
- _configtools.writeTrace.call(void 0, compilerOptions, config);
228
- return compilerOptions;
229
- }
230
- _chunkWGEGR3DFcjs.__name.call(void 0, createTsCompilerOptions, "createTsCompilerOptions");
231
- var generatePackageJson = /* @__PURE__ */ _chunkWGEGR3DFcjs.__name.call(void 0, async (options) => {
232
- if (options.generatePackageJson !== false) {
233
- const packageJsonPath = _devkit.joinPathFragments.call(void 0, options.projectRoot, "project.json");
234
- if (!await _node.hfs.isFile(packageJsonPath)) {
235
- throw new Error("Cannot find package.json configuration");
236
- }
237
- let packageJson = await _node.hfs.json(_devkit.joinPathFragments.call(void 0, options.workspaceRoot.dir, options.projectRoot, "package.json"));
238
- if (!packageJson) {
239
- throw new Error("Cannot find package.json configuration file");
240
- }
241
- packageJson = await _buildtools.addPackageDependencies.call(void 0, options.workspaceRoot.dir, options.projectRoot, options.projectName, packageJson);
242
- packageJson = await _buildtools.addWorkspacePackageJsonFields.call(void 0, options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
243
- packageJson = await _buildtools.addPackageJsonExports.call(void 0, options.sourceRoot, packageJson);
244
- await _devkit.writeJsonFile.call(void 0, _devkit.joinPathFragments.call(void 0, options.outDir, "package.json"), packageJson);
245
- }
246
- return options;
247
- }, "generatePackageJson");
248
- async function executeUnbuild(options) {
249
- const stopwatch = _configtools.getStopwatch.call(void 0, `${options.projectRoot} build`);
250
- _configtools.writeInfo.call(void 0, `\u{1F4E6} Building ${options.name} (${options.projectRoot})...`, options.config);
251
- await _unbuild.build.call(void 0, options.projectRoot, false, {
252
- ...options,
253
- rootDir: options.projectRoot
254
- }).finally(() => {
255
- stopwatch();
256
- });
257
- return options;
258
- }
259
- _chunkWGEGR3DFcjs.__name.call(void 0, executeUnbuild, "executeUnbuild");
260
- async function copyBuildAssets(options) {
261
- await _buildtools.copyAssets.call(void 0, options.config, _nullishCoalesce(options.assets, () => ( [])), options.outDir, options.projectRoot, options.projectName, options.sourceRoot, options.generatePackageJson, options.includeSrc);
262
- return options;
263
- }
264
- _chunkWGEGR3DFcjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
265
- function reportResults(options) {
266
- _configtools.writeSuccess.call(void 0, `The ${options.name} build completed successfully`, options.config);
267
- }
268
- _chunkWGEGR3DFcjs.__name.call(void 0, reportResults, "reportResults");
269
- async function build(options) {
270
- const stopwatch = _configtools.getStopwatch.call(void 0, "full build");
271
- try {
272
- const resolvedOptions = await resolveOptions(options);
273
- await generatePackageJson(resolvedOptions);
274
- await executeUnbuild(resolvedOptions);
275
- await copyBuildAssets(resolvedOptions);
276
- reportResults(resolvedOptions);
277
- } catch (error) {
278
- _configtools.writeFatal.call(void 0, "Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
279
- }
280
- stopwatch();
281
- }
282
- _chunkWGEGR3DFcjs.__name.call(void 0, build, "build");
283
-
284
-
285
-
286
- exports.build = build;
287
- //# sourceMappingURL=chunk-55SAPUWC.cjs.map