@storm-software/unbuild 0.35.0 → 0.35.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 -2
  2. package/bin/unbuild.cjs +26 -25
  3. package/bin/unbuild.js +26 -25
  4. package/dist/build.cjs +6 -7
  5. package/dist/build.js +5 -6
  6. package/dist/{chunk-WI52QJ54.js → chunk-3M7GEZDL.js} +7 -8
  7. package/dist/{chunk-GTRAQVBF.cjs → chunk-6BNX524O.cjs} +22 -5
  8. package/dist/{chunk-UELS4AUC.js → chunk-L3WYWYD4.js} +2 -2
  9. package/dist/{chunk-AGJ2KZ3K.cjs → chunk-N5KR37LU.cjs} +2 -2
  10. package/dist/{chunk-BDHZY5E7.cjs → chunk-OD3ULBE3.cjs} +4 -4
  11. package/dist/{chunk-ESRR2FD2.js → chunk-RBYYB7X2.js} +4 -4
  12. package/dist/{chunk-HHWS7REN.js → chunk-RFEZKCMQ.js} +3 -3
  13. package/dist/{chunk-TUGA3ADZ.js → chunk-TG57GPRS.js} +22 -5
  14. package/dist/{chunk-SEWO2Q7T.cjs → chunk-Y7PS2HJA.cjs} +3 -3
  15. package/dist/{chunk-NGL4NRBA.cjs → chunk-ZPWH22ZM.cjs} +7 -8
  16. package/dist/index.cjs +7 -11
  17. package/dist/index.d.cts +0 -2
  18. package/dist/index.d.ts +0 -2
  19. package/dist/index.js +6 -10
  20. package/dist/plugins/analyze.cjs +2 -2
  21. package/dist/plugins/analyze.d.cts +2 -2
  22. package/dist/plugins/analyze.d.ts +2 -2
  23. package/dist/plugins/analyze.js +1 -1
  24. package/dist/plugins/on-error.cjs +2 -2
  25. package/dist/plugins/on-error.d.cts +2 -2
  26. package/dist/plugins/on-error.d.ts +2 -2
  27. package/dist/plugins/on-error.js +1 -1
  28. package/dist/plugins/swc.cjs +1 -1
  29. package/dist/plugins/swc.d.cts +2 -2
  30. package/dist/plugins/swc.d.ts +2 -2
  31. package/dist/plugins/swc.js +1 -1
  32. package/dist/plugins/tsc.cjs +2 -2
  33. package/dist/plugins/tsc.d.cts +2 -2
  34. package/dist/plugins/tsc.d.ts +2 -2
  35. package/dist/plugins/tsc.js +1 -1
  36. package/dist/plugins/type-definitions.cjs +2 -2
  37. package/dist/plugins/type-definitions.d.cts +5 -2
  38. package/dist/plugins/type-definitions.d.ts +5 -2
  39. package/dist/plugins/type-definitions.js +3 -3
  40. package/package.json +1 -1
  41. package/dist/chunk-DL7OBOWN.cjs +0 -27
  42. package/dist/chunk-UYR662XD.js +0 -27
  43. package/dist/config.cjs +0 -12
  44. package/dist/config.d.cts +0 -8
  45. package/dist/config.d.ts +0 -8
  46. package/dist/config.js +0 -12
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.34.2-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.35.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 -->
@@ -40,7 +40,6 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
40
40
 
41
41
  <!-- START doctoc -->
42
42
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
43
-
44
43
  ## Table of Contents
45
44
 
46
45
  - [Storm Unbuild Package](#storm-unbuild-package)
package/bin/unbuild.cjs CHANGED
@@ -1502,26 +1502,26 @@ var formatBytes = /* @__PURE__ */ __name((bytes) => {
1502
1502
  const i = Math.floor(Math.log(bytes) / Math.log(k));
1503
1503
  return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
1504
1504
  }, "formatBytes");
1505
- var analyzePlugin = /* @__PURE__ */ __name((options, resolvedOptions) => {
1505
+ var analyzePlugin = /* @__PURE__ */ __name((options) => {
1506
1506
  return {
1507
1507
  name: "storm:analyzer",
1508
1508
  renderChunk(source, chunk) {
1509
1509
  const sourceBytes = formatBytes(source.length);
1510
1510
  const fileName = chunk.fileName;
1511
- writeInfo(` - ${fileName} ${sourceBytes}`, resolvedOptions.config);
1511
+ writeInfo(` - ${fileName} ${sourceBytes}`, options.config);
1512
1512
  }
1513
1513
  };
1514
1514
  }, "analyzePlugin");
1515
1515
 
1516
1516
  // src/plugins/on-error.ts
1517
- var onErrorPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => ({
1517
+ var onErrorPlugin = /* @__PURE__ */ __name((options) => ({
1518
1518
  name: "storm:on-error",
1519
1519
  buildEnd(error) {
1520
1520
  if (error) {
1521
1521
  writeError(`The following errors occurred during the build:
1522
1522
  ${error ? error.message : "Unknown build error"}
1523
1523
 
1524
- `, resolvedOptions.config);
1524
+ `, options.config);
1525
1525
  throw new Error("Storm unbuild process failed with errors.");
1526
1526
  }
1527
1527
  },
@@ -1529,7 +1529,7 @@ ${error ? error.message : "Unknown build error"}
1529
1529
  writeError(`The following errors occurred during the build:
1530
1530
  ${error ? error.message : "Unknown build error"}
1531
1531
 
1532
- `, resolvedOptions.config);
1532
+ `, options.config);
1533
1533
  throw new Error("Storm unbuild process failed with errors.");
1534
1534
  }
1535
1535
  }), "onErrorPlugin");
@@ -1567,27 +1567,26 @@ async function createTsCompilerOptions(config, tsConfigPath, projectRoot, depend
1567
1567
  __name(createTsCompilerOptions, "createTsCompilerOptions");
1568
1568
 
1569
1569
  // src/plugins/tsc.ts
1570
- var tscPlugin = /* @__PURE__ */ __name(async (options, resolvedOptions) => {
1570
+ var tscPlugin = /* @__PURE__ */ __name(async (options) => {
1571
1571
  const projectGraph = (0, import_devkit3.readCachedProjectGraph)();
1572
- const result = (0, import_buildable_libs_utils3.calculateProjectBuildableDependencies)(void 0, projectGraph, resolvedOptions.config.workspaceRoot, resolvedOptions.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
1572
+ const result = (0, import_buildable_libs_utils3.calculateProjectBuildableDependencies)(void 0, projectGraph, options.config.workspaceRoot, options.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
1573
1573
  let dependencies = result.dependencies;
1574
- const tsLibDependency = (0, import_compiler_helper_dependency.getHelperDependency)(import_compiler_helper_dependency.HelperDependency.tsc, resolvedOptions.tsconfig, dependencies, projectGraph, true);
1574
+ const tsLibDependency = (0, import_compiler_helper_dependency.getHelperDependency)(import_compiler_helper_dependency.HelperDependency.tsc, options.tsconfig, dependencies, projectGraph, true);
1575
1575
  if (tsLibDependency) {
1576
1576
  dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
1577
1577
  dependencies.push(tsLibDependency);
1578
1578
  }
1579
+ const compilerOptions = await createTsCompilerOptions(options.config, options.tsconfig, options.projectRoot, dependencies);
1579
1580
  return (0, import_rollup_plugin_typescript2.default)({
1580
- check: options.emitTypes !== false,
1581
- tsconfig: resolvedOptions.tsconfig,
1582
- tsconfigOverride: {
1583
- compilerOptions: await createTsCompilerOptions(resolvedOptions.config, resolvedOptions.tsconfig, resolvedOptions.projectRoot, dependencies)
1584
- }
1581
+ check: options.declaration !== false,
1582
+ tsconfig: options.tsconfig,
1583
+ tsconfigOverride: compilerOptions
1585
1584
  });
1586
1585
  }, "tscPlugin");
1587
1586
 
1588
1587
  // src/plugins/type-definitions.ts
1589
1588
  var import_node_path5 = require("path");
1590
- function typeDefinitions(projectRoot) {
1589
+ function typeDefinitionsPlugin(options) {
1591
1590
  return {
1592
1591
  name: "storm:dts-bundle",
1593
1592
  async generateBundle(_opts, bundle) {
@@ -1596,7 +1595,7 @@ function typeDefinitions(projectRoot) {
1596
1595
  continue;
1597
1596
  }
1598
1597
  const hasDefaultExport = file.exports.includes("default");
1599
- const entrySourceFileName = (0, import_node_path5.relative)(projectRoot, file.facadeModuleId);
1598
+ const entrySourceFileName = (0, import_node_path5.relative)(options.projectRoot, file.facadeModuleId);
1600
1599
  const entrySourceDtsName = entrySourceFileName.replace(/\.[cm]?[jt]sx?$/, "");
1601
1600
  const dtsFileName = file.fileName.replace(/\.[cm]?js$/, ".d.ts");
1602
1601
  const relativeSourceDtsName = JSON.stringify("./" + entrySourceDtsName);
@@ -1614,15 +1613,7 @@ export { default } from ${relativeSourceDtsName};
1614
1613
  }
1615
1614
  };
1616
1615
  }
1617
- __name(typeDefinitions, "typeDefinitions");
1618
-
1619
- // src/config.ts
1620
- var getDefaultBuildPlugins = /* @__PURE__ */ __name(async (options, resolvedOptions) => Promise.all([
1621
- analyzePlugin(options, resolvedOptions),
1622
- typeDefinitions(resolvedOptions.projectRoot),
1623
- tscPlugin(options, resolvedOptions),
1624
- onErrorPlugin(options, resolvedOptions)
1625
- ].map((plugin) => Promise.resolve(plugin))), "getDefaultBuildPlugins");
1616
+ __name(typeDefinitionsPlugin, "typeDefinitionsPlugin");
1626
1617
 
1627
1618
  // src/build.ts
1628
1619
  async function resolveOptions(options, config) {
@@ -1675,13 +1666,17 @@ async function resolveOptions(options, config) {
1675
1666
  sourceRoot
1676
1667
  ];
1677
1668
  const resolvedOptions = {
1669
+ ...options,
1678
1670
  name,
1679
1671
  config,
1680
1672
  projectRoot: options.projectRoot,
1681
1673
  sourceRoot,
1682
1674
  projectName,
1683
1675
  tsconfig,
1676
+ platform: options.platform ?? "neutral",
1677
+ generatePackageJson: true,
1684
1678
  clean: false,
1679
+ env: {},
1685
1680
  entries: entries.reduce((ret, entry) => {
1686
1681
  let entryPath = entry.replace(options.projectRoot, "");
1687
1682
  while (entryPath.startsWith(".")) {
@@ -1762,6 +1757,7 @@ async function resolveOptions(options, config) {
1762
1757
  sourceMap: options.sourcemap ?? !!options.debug,
1763
1758
  splitting: options.splitting !== false,
1764
1759
  treeShaking: options.treeShaking !== false,
1760
+ platform: options.platform ?? "neutral",
1765
1761
  color: true,
1766
1762
  logLevel: config.logLevel === LogLevelLabel.FATAL ? LogLevelLabel.ERROR : isVerbose() ? "verbose" : config.logLevel
1767
1763
  }
@@ -1796,7 +1792,12 @@ async function resolveOptions(options, config) {
1796
1792
  opts.plugins = options.plugins;
1797
1793
  } else {
1798
1794
  writeDebug(` \u{1F9E9} No plugins found in provided build options, using default plugins`, config);
1799
- opts.plugins = await getDefaultBuildPlugins(options, resolvedOptions);
1795
+ opts.plugins = await Promise.all([
1796
+ analyzePlugin(resolvedOptions),
1797
+ typeDefinitionsPlugin(resolvedOptions),
1798
+ tscPlugin(resolvedOptions),
1799
+ onErrorPlugin(resolvedOptions)
1800
+ ]);
1800
1801
  }
1801
1802
  }, "rollup:options")
1802
1803
  };
package/bin/unbuild.js CHANGED
@@ -1481,26 +1481,26 @@ var formatBytes = /* @__PURE__ */ __name((bytes) => {
1481
1481
  const i = Math.floor(Math.log(bytes) / Math.log(k));
1482
1482
  return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
1483
1483
  }, "formatBytes");
1484
- var analyzePlugin = /* @__PURE__ */ __name((options, resolvedOptions) => {
1484
+ var analyzePlugin = /* @__PURE__ */ __name((options) => {
1485
1485
  return {
1486
1486
  name: "storm:analyzer",
1487
1487
  renderChunk(source, chunk) {
1488
1488
  const sourceBytes = formatBytes(source.length);
1489
1489
  const fileName = chunk.fileName;
1490
- writeInfo(` - ${fileName} ${sourceBytes}`, resolvedOptions.config);
1490
+ writeInfo(` - ${fileName} ${sourceBytes}`, options.config);
1491
1491
  }
1492
1492
  };
1493
1493
  }, "analyzePlugin");
1494
1494
 
1495
1495
  // src/plugins/on-error.ts
1496
- var onErrorPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => ({
1496
+ var onErrorPlugin = /* @__PURE__ */ __name((options) => ({
1497
1497
  name: "storm:on-error",
1498
1498
  buildEnd(error) {
1499
1499
  if (error) {
1500
1500
  writeError(`The following errors occurred during the build:
1501
1501
  ${error ? error.message : "Unknown build error"}
1502
1502
 
1503
- `, resolvedOptions.config);
1503
+ `, options.config);
1504
1504
  throw new Error("Storm unbuild process failed with errors.");
1505
1505
  }
1506
1506
  },
@@ -1508,7 +1508,7 @@ ${error ? error.message : "Unknown build error"}
1508
1508
  writeError(`The following errors occurred during the build:
1509
1509
  ${error ? error.message : "Unknown build error"}
1510
1510
 
1511
- `, resolvedOptions.config);
1511
+ `, options.config);
1512
1512
  throw new Error("Storm unbuild process failed with errors.");
1513
1513
  }
1514
1514
  }), "onErrorPlugin");
@@ -1546,27 +1546,26 @@ async function createTsCompilerOptions(config, tsConfigPath, projectRoot, depend
1546
1546
  __name(createTsCompilerOptions, "createTsCompilerOptions");
1547
1547
 
1548
1548
  // src/plugins/tsc.ts
1549
- var tscPlugin = /* @__PURE__ */ __name(async (options, resolvedOptions) => {
1549
+ var tscPlugin = /* @__PURE__ */ __name(async (options) => {
1550
1550
  const projectGraph = readCachedProjectGraph2();
1551
- const result = calculateProjectBuildableDependencies2(void 0, projectGraph, resolvedOptions.config.workspaceRoot, resolvedOptions.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
1551
+ const result = calculateProjectBuildableDependencies2(void 0, projectGraph, options.config.workspaceRoot, options.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
1552
1552
  let dependencies = result.dependencies;
1553
- const tsLibDependency = getHelperDependency(HelperDependency.tsc, resolvedOptions.tsconfig, dependencies, projectGraph, true);
1553
+ const tsLibDependency = getHelperDependency(HelperDependency.tsc, options.tsconfig, dependencies, projectGraph, true);
1554
1554
  if (tsLibDependency) {
1555
1555
  dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
1556
1556
  dependencies.push(tsLibDependency);
1557
1557
  }
1558
+ const compilerOptions = await createTsCompilerOptions(options.config, options.tsconfig, options.projectRoot, dependencies);
1558
1559
  return ts2Plugin({
1559
- check: options.emitTypes !== false,
1560
- tsconfig: resolvedOptions.tsconfig,
1561
- tsconfigOverride: {
1562
- compilerOptions: await createTsCompilerOptions(resolvedOptions.config, resolvedOptions.tsconfig, resolvedOptions.projectRoot, dependencies)
1563
- }
1560
+ check: options.declaration !== false,
1561
+ tsconfig: options.tsconfig,
1562
+ tsconfigOverride: compilerOptions
1564
1563
  });
1565
1564
  }, "tscPlugin");
1566
1565
 
1567
1566
  // src/plugins/type-definitions.ts
1568
1567
  import { relative as relative2 } from "node:path";
1569
- function typeDefinitions(projectRoot) {
1568
+ function typeDefinitionsPlugin(options) {
1570
1569
  return {
1571
1570
  name: "storm:dts-bundle",
1572
1571
  async generateBundle(_opts, bundle) {
@@ -1575,7 +1574,7 @@ function typeDefinitions(projectRoot) {
1575
1574
  continue;
1576
1575
  }
1577
1576
  const hasDefaultExport = file.exports.includes("default");
1578
- const entrySourceFileName = relative2(projectRoot, file.facadeModuleId);
1577
+ const entrySourceFileName = relative2(options.projectRoot, file.facadeModuleId);
1579
1578
  const entrySourceDtsName = entrySourceFileName.replace(/\.[cm]?[jt]sx?$/, "");
1580
1579
  const dtsFileName = file.fileName.replace(/\.[cm]?js$/, ".d.ts");
1581
1580
  const relativeSourceDtsName = JSON.stringify("./" + entrySourceDtsName);
@@ -1593,15 +1592,7 @@ export { default } from ${relativeSourceDtsName};
1593
1592
  }
1594
1593
  };
1595
1594
  }
1596
- __name(typeDefinitions, "typeDefinitions");
1597
-
1598
- // src/config.ts
1599
- var getDefaultBuildPlugins = /* @__PURE__ */ __name(async (options, resolvedOptions) => Promise.all([
1600
- analyzePlugin(options, resolvedOptions),
1601
- typeDefinitions(resolvedOptions.projectRoot),
1602
- tscPlugin(options, resolvedOptions),
1603
- onErrorPlugin(options, resolvedOptions)
1604
- ].map((plugin) => Promise.resolve(plugin))), "getDefaultBuildPlugins");
1595
+ __name(typeDefinitionsPlugin, "typeDefinitionsPlugin");
1605
1596
 
1606
1597
  // src/build.ts
1607
1598
  async function resolveOptions(options, config) {
@@ -1654,13 +1645,17 @@ async function resolveOptions(options, config) {
1654
1645
  sourceRoot
1655
1646
  ];
1656
1647
  const resolvedOptions = {
1648
+ ...options,
1657
1649
  name,
1658
1650
  config,
1659
1651
  projectRoot: options.projectRoot,
1660
1652
  sourceRoot,
1661
1653
  projectName,
1662
1654
  tsconfig,
1655
+ platform: options.platform ?? "neutral",
1656
+ generatePackageJson: true,
1663
1657
  clean: false,
1658
+ env: {},
1664
1659
  entries: entries.reduce((ret, entry) => {
1665
1660
  let entryPath = entry.replace(options.projectRoot, "");
1666
1661
  while (entryPath.startsWith(".")) {
@@ -1741,6 +1736,7 @@ async function resolveOptions(options, config) {
1741
1736
  sourceMap: options.sourcemap ?? !!options.debug,
1742
1737
  splitting: options.splitting !== false,
1743
1738
  treeShaking: options.treeShaking !== false,
1739
+ platform: options.platform ?? "neutral",
1744
1740
  color: true,
1745
1741
  logLevel: config.logLevel === LogLevelLabel.FATAL ? LogLevelLabel.ERROR : isVerbose() ? "verbose" : config.logLevel
1746
1742
  }
@@ -1775,7 +1771,12 @@ async function resolveOptions(options, config) {
1775
1771
  opts.plugins = options.plugins;
1776
1772
  } else {
1777
1773
  writeDebug(` \u{1F9E9} No plugins found in provided build options, using default plugins`, config);
1778
- opts.plugins = await getDefaultBuildPlugins(options, resolvedOptions);
1774
+ opts.plugins = await Promise.all([
1775
+ analyzePlugin(resolvedOptions),
1776
+ typeDefinitionsPlugin(resolvedOptions),
1777
+ tscPlugin(resolvedOptions),
1778
+ onErrorPlugin(resolvedOptions)
1779
+ ]);
1779
1780
  }
1780
1781
  }, "rollup:options")
1781
1782
  };
package/dist/build.cjs CHANGED
@@ -5,13 +5,12 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkGTRAQVBFcjs = require('./chunk-GTRAQVBF.cjs');
8
+ var _chunk6BNX524Ocjs = require('./chunk-6BNX524O.cjs');
9
+ require('./chunk-OD3ULBE3.cjs');
9
10
  require('./chunk-3HGUCQU6.cjs');
10
- require('./chunk-DL7OBOWN.cjs');
11
- require('./chunk-NGL4NRBA.cjs');
12
- require('./chunk-BDHZY5E7.cjs');
13
- require('./chunk-AGJ2KZ3K.cjs');
14
- require('./chunk-SEWO2Q7T.cjs');
11
+ require('./chunk-N5KR37LU.cjs');
12
+ require('./chunk-Y7PS2HJA.cjs');
13
+ require('./chunk-ZPWH22ZM.cjs');
15
14
  require('./chunk-5FQVMM7I.cjs');
16
15
  require('./chunk-BGYQAVKQ.cjs');
17
16
 
@@ -21,4 +20,4 @@ require('./chunk-BGYQAVKQ.cjs');
21
20
 
22
21
 
23
22
 
24
- exports.build = _chunkGTRAQVBFcjs.build; exports.cleanOutputPath = _chunkGTRAQVBFcjs.cleanOutputPath; exports.copyBuildAssets = _chunkGTRAQVBFcjs.copyBuildAssets; exports.executeUnbuild = _chunkGTRAQVBFcjs.executeUnbuild; exports.generatePackageJson = _chunkGTRAQVBFcjs.generatePackageJson; exports.resolveOptions = _chunkGTRAQVBFcjs.resolveOptions;
23
+ exports.build = _chunk6BNX524Ocjs.build; exports.cleanOutputPath = _chunk6BNX524Ocjs.cleanOutputPath; exports.copyBuildAssets = _chunk6BNX524Ocjs.copyBuildAssets; exports.executeUnbuild = _chunk6BNX524Ocjs.executeUnbuild; exports.generatePackageJson = _chunk6BNX524Ocjs.generatePackageJson; exports.resolveOptions = _chunk6BNX524Ocjs.resolveOptions;
package/dist/build.js CHANGED
@@ -5,13 +5,12 @@ import {
5
5
  executeUnbuild,
6
6
  generatePackageJson,
7
7
  resolveOptions
8
- } from "./chunk-TUGA3ADZ.js";
8
+ } from "./chunk-TG57GPRS.js";
9
+ import "./chunk-RBYYB7X2.js";
9
10
  import "./chunk-2E6P5U5P.js";
10
- import "./chunk-UYR662XD.js";
11
- import "./chunk-WI52QJ54.js";
12
- import "./chunk-ESRR2FD2.js";
13
- import "./chunk-UELS4AUC.js";
14
- import "./chunk-HHWS7REN.js";
11
+ import "./chunk-L3WYWYD4.js";
12
+ import "./chunk-RFEZKCMQ.js";
13
+ import "./chunk-3M7GEZDL.js";
15
14
  import "./chunk-PLJQK2VX.js";
16
15
  import "./chunk-3GQAWCBQ.js";
17
16
  export {
@@ -38,21 +38,20 @@ async function createTsCompilerOptions(config, tsConfigPath, projectRoot, depend
38
38
  __name(createTsCompilerOptions, "createTsCompilerOptions");
39
39
 
40
40
  // src/plugins/tsc.ts
41
- var tscPlugin = /* @__PURE__ */ __name(async (options, resolvedOptions) => {
41
+ var tscPlugin = /* @__PURE__ */ __name(async (options) => {
42
42
  const projectGraph = readCachedProjectGraph();
43
- 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);
43
+ const result = calculateProjectBuildableDependencies(void 0, projectGraph, options.config.workspaceRoot, options.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
44
44
  let dependencies = result.dependencies;
45
- const tsLibDependency = getHelperDependency(HelperDependency.tsc, resolvedOptions.tsconfig, dependencies, projectGraph, true);
45
+ const tsLibDependency = getHelperDependency(HelperDependency.tsc, options.tsconfig, dependencies, projectGraph, true);
46
46
  if (tsLibDependency) {
47
47
  dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
48
48
  dependencies.push(tsLibDependency);
49
49
  }
50
+ const compilerOptions = await createTsCompilerOptions(options.config, options.tsconfig, options.projectRoot, dependencies);
50
51
  return ts2Plugin({
51
- check: options.emitTypes !== false,
52
- tsconfig: resolvedOptions.tsconfig,
53
- tsconfigOverride: {
54
- compilerOptions: await createTsCompilerOptions(resolvedOptions.config, resolvedOptions.tsconfig, resolvedOptions.projectRoot, dependencies)
55
- }
52
+ check: options.declaration !== false,
53
+ tsconfig: options.tsconfig,
54
+ tsconfigOverride: compilerOptions
56
55
  });
57
56
  }, "tscPlugin");
58
57
 
@@ -1,12 +1,19 @@
1
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 _chunkOD3ULBE3cjs = require('./chunk-OD3ULBE3.cjs');
4
+
5
+
3
6
  var _chunk3HGUCQU6cjs = require('./chunk-3HGUCQU6.cjs');
4
7
 
5
8
 
6
- var _chunkDL7OBOWNcjs = require('./chunk-DL7OBOWN.cjs');
9
+ var _chunkN5KR37LUcjs = require('./chunk-N5KR37LU.cjs');
10
+
11
+
12
+ var _chunkY7PS2HJAcjs = require('./chunk-Y7PS2HJA.cjs');
13
+
7
14
 
8
15
 
9
- var _chunkNGL4NRBAcjs = require('./chunk-NGL4NRBA.cjs');
16
+ var _chunkZPWH22ZMcjs = require('./chunk-ZPWH22ZM.cjs');
10
17
 
11
18
 
12
19
 
@@ -750,7 +757,7 @@ async function resolveOptions(options, config) {
750
757
  _chunk5FQVMM7Icjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
751
758
  const stopwatch = _chunk5FQVMM7Icjs.getStopwatch.call(void 0, "Build options resolution");
752
759
  if (options.configPath) {
753
- const configFile = await _chunkNGL4NRBAcjs.loadConfig.call(void 0, options.configPath);
760
+ const configFile = await _chunkZPWH22ZMcjs.loadConfig.call(void 0, options.configPath);
754
761
  if (configFile) {
755
762
  options = _defu2.default.call(void 0, options, configFile);
756
763
  }
@@ -796,13 +803,17 @@ async function resolveOptions(options, config) {
796
803
  sourceRoot
797
804
  ]));
798
805
  const resolvedOptions = {
806
+ ...options,
799
807
  name,
800
808
  config,
801
809
  projectRoot: options.projectRoot,
802
810
  sourceRoot,
803
811
  projectName,
804
812
  tsconfig,
813
+ platform: _nullishCoalesce(options.platform, () => ( "neutral")),
814
+ generatePackageJson: true,
805
815
  clean: false,
816
+ env: {},
806
817
  entries: entries.reduce((ret, entry) => {
807
818
  let entryPath = entry.replace(options.projectRoot, "");
808
819
  while (entryPath.startsWith(".")) {
@@ -883,6 +894,7 @@ async function resolveOptions(options, config) {
883
894
  sourceMap: _nullishCoalesce(options.sourcemap, () => ( !!options.debug)),
884
895
  splitting: options.splitting !== false,
885
896
  treeShaking: options.treeShaking !== false,
897
+ platform: _nullishCoalesce(options.platform, () => ( "neutral")),
886
898
  color: true,
887
899
  logLevel: config.logLevel === _chunk5FQVMM7Icjs.LogLevelLabel.FATAL ? _chunk5FQVMM7Icjs.LogLevelLabel.ERROR : _chunk5FQVMM7Icjs.isVerbose.call(void 0, ) ? "verbose" : config.logLevel
888
900
  }
@@ -901,7 +913,7 @@ async function resolveOptions(options, config) {
901
913
  if (options.rollup) {
902
914
  let rollup = {};
903
915
  if (typeof options.rollup === "string") {
904
- const rollupFile = await _chunkNGL4NRBAcjs.loadConfig.call(void 0, options.rollup);
916
+ const rollupFile = await _chunkZPWH22ZMcjs.loadConfig.call(void 0, options.rollup);
905
917
  if (rollupFile) {
906
918
  rollup = rollupFile;
907
919
  }
@@ -917,7 +929,12 @@ async function resolveOptions(options, config) {
917
929
  opts.plugins = options.plugins;
918
930
  } else {
919
931
  _chunk5FQVMM7Icjs.writeDebug.call(void 0, ` \u{1F9E9} No plugins found in provided build options, using default plugins`, config);
920
- opts.plugins = await _chunkDL7OBOWNcjs.getDefaultBuildPlugins.call(void 0, options, resolvedOptions);
932
+ opts.plugins = await Promise.all([
933
+ _chunkN5KR37LUcjs.analyzePlugin.call(void 0, resolvedOptions),
934
+ _chunkOD3ULBE3cjs.typeDefinitionsPlugin.call(void 0, resolvedOptions),
935
+ _chunkZPWH22ZMcjs.tscPlugin.call(void 0, resolvedOptions),
936
+ _chunkY7PS2HJAcjs.onErrorPlugin.call(void 0, resolvedOptions)
937
+ ]);
921
938
  }
922
939
  }, "rollup:options")
923
940
  };
@@ -19,13 +19,13 @@ var formatBytes = /* @__PURE__ */ __name((bytes) => {
19
19
  const i = Math.floor(Math.log(bytes) / Math.log(k));
20
20
  return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
21
21
  }, "formatBytes");
22
- var analyzePlugin = /* @__PURE__ */ __name((options, resolvedOptions) => {
22
+ var analyzePlugin = /* @__PURE__ */ __name((options) => {
23
23
  return {
24
24
  name: "storm:analyzer",
25
25
  renderChunk(source, chunk) {
26
26
  const sourceBytes = formatBytes(source.length);
27
27
  const fileName = chunk.fileName;
28
- writeInfo(` - ${fileName} ${sourceBytes}`, resolvedOptions.config);
28
+ writeInfo(` - ${fileName} ${sourceBytes}`, options.config);
29
29
  }
30
30
  };
31
31
  }, "analyzePlugin");
@@ -19,13 +19,13 @@ var formatBytes = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (bytes)
19
19
  const i = Math.floor(Math.log(bytes) / Math.log(k));
20
20
  return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
21
21
  }, "formatBytes");
22
- var analyzePlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (options, resolvedOptions) => {
22
+ var analyzePlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (options) => {
23
23
  return {
24
24
  name: "storm:analyzer",
25
25
  renderChunk(source, chunk) {
26
26
  const sourceBytes = formatBytes(source.length);
27
27
  const fileName = chunk.fileName;
28
- _chunk5FQVMM7Icjs.writeInfo.call(void 0, ` - ${fileName} ${sourceBytes}`, resolvedOptions.config);
28
+ _chunk5FQVMM7Icjs.writeInfo.call(void 0, ` - ${fileName} ${sourceBytes}`, options.config);
29
29
  }
30
30
  };
31
31
  }, "analyzePlugin");
@@ -4,7 +4,7 @@ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
4
4
 
5
5
  // src/plugins/type-definitions.ts
6
6
  var _path = require('path');
7
- function typeDefinitions(projectRoot) {
7
+ function typeDefinitionsPlugin(options) {
8
8
  return {
9
9
  name: "storm:dts-bundle",
10
10
  async generateBundle(_opts, bundle) {
@@ -13,7 +13,7 @@ function typeDefinitions(projectRoot) {
13
13
  continue;
14
14
  }
15
15
  const hasDefaultExport = file.exports.includes("default");
16
- const entrySourceFileName = _path.relative.call(void 0, projectRoot, file.facadeModuleId);
16
+ const entrySourceFileName = _path.relative.call(void 0, options.projectRoot, file.facadeModuleId);
17
17
  const entrySourceDtsName = entrySourceFileName.replace(/\.[cm]?[jt]sx?$/, "");
18
18
  const dtsFileName = file.fileName.replace(/\.[cm]?js$/, ".d.ts");
19
19
  const relativeSourceDtsName = JSON.stringify("./" + entrySourceDtsName);
@@ -31,8 +31,8 @@ export { default } from ${relativeSourceDtsName};
31
31
  }
32
32
  };
33
33
  }
34
- _chunkBGYQAVKQcjs.__name.call(void 0, typeDefinitions, "typeDefinitions");
34
+ _chunkBGYQAVKQcjs.__name.call(void 0, typeDefinitionsPlugin, "typeDefinitionsPlugin");
35
35
 
36
36
 
37
37
 
38
- exports.typeDefinitions = typeDefinitions;
38
+ exports.typeDefinitionsPlugin = typeDefinitionsPlugin;
@@ -4,7 +4,7 @@ import {
4
4
 
5
5
  // src/plugins/type-definitions.ts
6
6
  import { relative } from "node:path";
7
- function typeDefinitions(projectRoot) {
7
+ function typeDefinitionsPlugin(options) {
8
8
  return {
9
9
  name: "storm:dts-bundle",
10
10
  async generateBundle(_opts, bundle) {
@@ -13,7 +13,7 @@ function typeDefinitions(projectRoot) {
13
13
  continue;
14
14
  }
15
15
  const hasDefaultExport = file.exports.includes("default");
16
- const entrySourceFileName = relative(projectRoot, file.facadeModuleId);
16
+ const entrySourceFileName = relative(options.projectRoot, file.facadeModuleId);
17
17
  const entrySourceDtsName = entrySourceFileName.replace(/\.[cm]?[jt]sx?$/, "");
18
18
  const dtsFileName = file.fileName.replace(/\.[cm]?js$/, ".d.ts");
19
19
  const relativeSourceDtsName = JSON.stringify("./" + entrySourceDtsName);
@@ -31,8 +31,8 @@ export { default } from ${relativeSourceDtsName};
31
31
  }
32
32
  };
33
33
  }
34
- __name(typeDefinitions, "typeDefinitions");
34
+ __name(typeDefinitionsPlugin, "typeDefinitionsPlugin");
35
35
 
36
36
  export {
37
- typeDefinitions
37
+ typeDefinitionsPlugin
38
38
  };
@@ -6,14 +6,14 @@ import {
6
6
  } from "./chunk-3GQAWCBQ.js";
7
7
 
8
8
  // src/plugins/on-error.ts
9
- var onErrorPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => ({
9
+ var onErrorPlugin = /* @__PURE__ */ __name((options) => ({
10
10
  name: "storm:on-error",
11
11
  buildEnd(error) {
12
12
  if (error) {
13
13
  writeError(`The following errors occurred during the build:
14
14
  ${error ? error.message : "Unknown build error"}
15
15
 
16
- `, resolvedOptions.config);
16
+ `, options.config);
17
17
  throw new Error("Storm unbuild process failed with errors.");
18
18
  }
19
19
  },
@@ -21,7 +21,7 @@ ${error ? error.message : "Unknown build error"}
21
21
  writeError(`The following errors occurred during the build:
22
22
  ${error ? error.message : "Unknown build error"}
23
23
 
24
- `, resolvedOptions.config);
24
+ `, options.config);
25
25
  throw new Error("Storm unbuild process failed with errors.");
26
26
  }
27
27
  }), "onErrorPlugin");
@@ -1,12 +1,19 @@
1
+ import {
2
+ typeDefinitionsPlugin
3
+ } from "./chunk-RBYYB7X2.js";
1
4
  import {
2
5
  cleanDirectories
3
6
  } from "./chunk-2E6P5U5P.js";
4
7
  import {
5
- getDefaultBuildPlugins
6
- } from "./chunk-UYR662XD.js";
8
+ analyzePlugin
9
+ } from "./chunk-L3WYWYD4.js";
10
+ import {
11
+ onErrorPlugin
12
+ } from "./chunk-RFEZKCMQ.js";
7
13
  import {
8
- loadConfig
9
- } from "./chunk-WI52QJ54.js";
14
+ loadConfig,
15
+ tscPlugin
16
+ } from "./chunk-3M7GEZDL.js";
10
17
  import {
11
18
  COLOR_KEYS,
12
19
  LogLevel,
@@ -796,13 +803,17 @@ async function resolveOptions(options, config) {
796
803
  sourceRoot
797
804
  ];
798
805
  const resolvedOptions = {
806
+ ...options,
799
807
  name,
800
808
  config,
801
809
  projectRoot: options.projectRoot,
802
810
  sourceRoot,
803
811
  projectName,
804
812
  tsconfig,
813
+ platform: options.platform ?? "neutral",
814
+ generatePackageJson: true,
805
815
  clean: false,
816
+ env: {},
806
817
  entries: entries.reduce((ret, entry) => {
807
818
  let entryPath = entry.replace(options.projectRoot, "");
808
819
  while (entryPath.startsWith(".")) {
@@ -883,6 +894,7 @@ async function resolveOptions(options, config) {
883
894
  sourceMap: options.sourcemap ?? !!options.debug,
884
895
  splitting: options.splitting !== false,
885
896
  treeShaking: options.treeShaking !== false,
897
+ platform: options.platform ?? "neutral",
886
898
  color: true,
887
899
  logLevel: config.logLevel === LogLevelLabel.FATAL ? LogLevelLabel.ERROR : isVerbose() ? "verbose" : config.logLevel
888
900
  }
@@ -917,7 +929,12 @@ async function resolveOptions(options, config) {
917
929
  opts.plugins = options.plugins;
918
930
  } else {
919
931
  writeDebug(` \u{1F9E9} No plugins found in provided build options, using default plugins`, config);
920
- opts.plugins = await getDefaultBuildPlugins(options, resolvedOptions);
932
+ opts.plugins = await Promise.all([
933
+ analyzePlugin(resolvedOptions),
934
+ typeDefinitionsPlugin(resolvedOptions),
935
+ tscPlugin(resolvedOptions),
936
+ onErrorPlugin(resolvedOptions)
937
+ ]);
921
938
  }
922
939
  }, "rollup:options")
923
940
  };
@@ -6,14 +6,14 @@ var _chunk5FQVMM7Icjs = require('./chunk-5FQVMM7I.cjs');
6
6
  var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
7
7
 
8
8
  // src/plugins/on-error.ts
9
- var onErrorPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (options, resolvedOptions) => ({
9
+ var onErrorPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (options) => ({
10
10
  name: "storm:on-error",
11
11
  buildEnd(error) {
12
12
  if (error) {
13
13
  _chunk5FQVMM7Icjs.writeError.call(void 0, `The following errors occurred during the build:
14
14
  ${error ? error.message : "Unknown build error"}
15
15
 
16
- `, resolvedOptions.config);
16
+ `, options.config);
17
17
  throw new Error("Storm unbuild process failed with errors.");
18
18
  }
19
19
  },
@@ -21,7 +21,7 @@ ${error ? error.message : "Unknown build error"}
21
21
  _chunk5FQVMM7Icjs.writeError.call(void 0, `The following errors occurred during the build:
22
22
  ${error ? error.message : "Unknown build error"}
23
23
 
24
- `, resolvedOptions.config);
24
+ `, options.config);
25
25
  throw new Error("Storm unbuild process failed with errors.");
26
26
  }
27
27
  }), "onErrorPlugin");
@@ -38,21 +38,20 @@ async function createTsCompilerOptions(config, tsConfigPath, projectRoot, depend
38
38
  _chunkBGYQAVKQcjs.__name.call(void 0, createTsCompilerOptions, "createTsCompilerOptions");
39
39
 
40
40
  // src/plugins/tsc.ts
41
- var tscPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (options, resolvedOptions) => {
41
+ var tscPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (options) => {
42
42
  const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
43
- 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);
43
+ const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, options.config.workspaceRoot, options.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
44
44
  let dependencies = result.dependencies;
45
- const tsLibDependency = _compilerhelperdependency.getHelperDependency.call(void 0, _compilerhelperdependency.HelperDependency.tsc, resolvedOptions.tsconfig, dependencies, projectGraph, true);
45
+ const tsLibDependency = _compilerhelperdependency.getHelperDependency.call(void 0, _compilerhelperdependency.HelperDependency.tsc, options.tsconfig, dependencies, projectGraph, true);
46
46
  if (tsLibDependency) {
47
47
  dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
48
48
  dependencies.push(tsLibDependency);
49
49
  }
50
+ const compilerOptions = await createTsCompilerOptions(options.config, options.tsconfig, options.projectRoot, dependencies);
50
51
  return _rollupplugintypescript22.default.call(void 0, {
51
- check: options.emitTypes !== false,
52
- tsconfig: resolvedOptions.tsconfig,
53
- tsconfigOverride: {
54
- compilerOptions: await createTsCompilerOptions(resolvedOptions.config, resolvedOptions.tsconfig, resolvedOptions.projectRoot, dependencies)
55
- }
52
+ check: options.declaration !== false,
53
+ tsconfig: options.tsconfig,
54
+ tsconfigOverride: compilerOptions
56
55
  });
57
56
  }, "tscPlugin");
58
57
 
package/dist/index.cjs CHANGED
@@ -5,22 +5,19 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkGTRAQVBFcjs = require('./chunk-GTRAQVBF.cjs');
8
+ var _chunk6BNX524Ocjs = require('./chunk-6BNX524O.cjs');
9
+ require('./chunk-OD3ULBE3.cjs');
9
10
 
10
11
 
11
12
 
12
13
  var _chunk3HGUCQU6cjs = require('./chunk-3HGUCQU6.cjs');
13
-
14
-
15
- var _chunkDL7OBOWNcjs = require('./chunk-DL7OBOWN.cjs');
14
+ require('./chunk-ORA4UQMU.cjs');
15
+ require('./chunk-N5KR37LU.cjs');
16
+ require('./chunk-Y7PS2HJA.cjs');
16
17
 
17
18
 
18
19
 
19
- var _chunkNGL4NRBAcjs = require('./chunk-NGL4NRBA.cjs');
20
- require('./chunk-BDHZY5E7.cjs');
21
- require('./chunk-ORA4UQMU.cjs');
22
- require('./chunk-AGJ2KZ3K.cjs');
23
- require('./chunk-SEWO2Q7T.cjs');
20
+ var _chunkZPWH22ZMcjs = require('./chunk-ZPWH22ZM.cjs');
24
21
  require('./chunk-5FQVMM7I.cjs');
25
22
  require('./chunk-BGYQAVKQ.cjs');
26
23
 
@@ -34,5 +31,4 @@ require('./chunk-BGYQAVKQ.cjs');
34
31
 
35
32
 
36
33
 
37
-
38
- exports.build = _chunkGTRAQVBFcjs.build; exports.clean = _chunk3HGUCQU6cjs.clean; exports.cleanDirectories = _chunk3HGUCQU6cjs.cleanDirectories; exports.cleanOutputPath = _chunkGTRAQVBFcjs.cleanOutputPath; exports.copyBuildAssets = _chunkGTRAQVBFcjs.copyBuildAssets; exports.createTsCompilerOptions = _chunkNGL4NRBAcjs.createTsCompilerOptions; exports.executeUnbuild = _chunkGTRAQVBFcjs.executeUnbuild; exports.generatePackageJson = _chunkGTRAQVBFcjs.generatePackageJson; exports.getDefaultBuildPlugins = _chunkDL7OBOWNcjs.getDefaultBuildPlugins; exports.loadConfig = _chunkNGL4NRBAcjs.loadConfig; exports.resolveOptions = _chunkGTRAQVBFcjs.resolveOptions;
34
+ exports.build = _chunk6BNX524Ocjs.build; exports.clean = _chunk3HGUCQU6cjs.clean; exports.cleanDirectories = _chunk3HGUCQU6cjs.cleanDirectories; exports.cleanOutputPath = _chunk6BNX524Ocjs.cleanOutputPath; exports.copyBuildAssets = _chunk6BNX524Ocjs.copyBuildAssets; exports.createTsCompilerOptions = _chunkZPWH22ZMcjs.createTsCompilerOptions; exports.executeUnbuild = _chunk6BNX524Ocjs.executeUnbuild; exports.generatePackageJson = _chunk6BNX524Ocjs.generatePackageJson; exports.loadConfig = _chunkZPWH22ZMcjs.loadConfig; exports.resolveOptions = _chunk6BNX524Ocjs.resolveOptions;
package/dist/index.d.cts CHANGED
@@ -1,13 +1,11 @@
1
1
  export { build, cleanOutputPath, copyBuildAssets, executeUnbuild, generatePackageJson, resolveOptions } from './build.cjs';
2
2
  export { clean, cleanDirectories } from './clean.cjs';
3
- export { getDefaultBuildPlugins } from './config.cjs';
4
3
  export { DeepPartial, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions } from './types.cjs';
5
4
  import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils';
6
5
  import { StormConfig } from '@storm-software/config';
7
6
  import ts from 'typescript';
8
7
  import { RollupBuildOptions } from 'unbuild';
9
8
  import '@storm-software/config/types';
10
- import 'rollup';
11
9
  import '@storm-software/build-tools';
12
10
 
13
11
  /**
package/dist/index.d.ts CHANGED
@@ -1,13 +1,11 @@
1
1
  export { build, cleanOutputPath, copyBuildAssets, executeUnbuild, generatePackageJson, resolveOptions } from './build.js';
2
2
  export { clean, cleanDirectories } from './clean.js';
3
- export { getDefaultBuildPlugins } from './config.js';
4
3
  export { DeepPartial, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions } from './types.js';
5
4
  import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils';
6
5
  import { StormConfig } from '@storm-software/config';
7
6
  import ts from 'typescript';
8
7
  import { RollupBuildOptions } from 'unbuild';
9
8
  import '@storm-software/config/types';
10
- import 'rollup';
11
9
  import '@storm-software/build-tools';
12
10
 
13
11
  /**
package/dist/index.js CHANGED
@@ -5,22 +5,19 @@ import {
5
5
  executeUnbuild,
6
6
  generatePackageJson,
7
7
  resolveOptions
8
- } from "./chunk-TUGA3ADZ.js";
8
+ } from "./chunk-TG57GPRS.js";
9
+ import "./chunk-RBYYB7X2.js";
9
10
  import {
10
11
  clean,
11
12
  cleanDirectories
12
13
  } from "./chunk-2E6P5U5P.js";
13
- import {
14
- getDefaultBuildPlugins
15
- } from "./chunk-UYR662XD.js";
14
+ import "./chunk-OULCUN6I.js";
15
+ import "./chunk-L3WYWYD4.js";
16
+ import "./chunk-RFEZKCMQ.js";
16
17
  import {
17
18
  createTsCompilerOptions,
18
19
  loadConfig
19
- } from "./chunk-WI52QJ54.js";
20
- import "./chunk-ESRR2FD2.js";
21
- import "./chunk-OULCUN6I.js";
22
- import "./chunk-UELS4AUC.js";
23
- import "./chunk-HHWS7REN.js";
20
+ } from "./chunk-3M7GEZDL.js";
24
21
  import "./chunk-PLJQK2VX.js";
25
22
  import "./chunk-3GQAWCBQ.js";
26
23
  export {
@@ -32,7 +29,6 @@ export {
32
29
  createTsCompilerOptions,
33
30
  executeUnbuild,
34
31
  generatePackageJson,
35
- getDefaultBuildPlugins,
36
32
  loadConfig,
37
33
  resolveOptions
38
34
  };
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkAGJ2KZ3Kcjs = require('../chunk-AGJ2KZ3K.cjs');
3
+ var _chunkN5KR37LUcjs = require('../chunk-N5KR37LU.cjs');
4
4
  require('../chunk-5FQVMM7I.cjs');
5
5
  require('../chunk-BGYQAVKQ.cjs');
6
6
 
7
7
 
8
- exports.analyzePlugin = _chunkAGJ2KZ3Kcjs.analyzePlugin;
8
+ exports.analyzePlugin = _chunkN5KR37LUcjs.analyzePlugin;
@@ -1,8 +1,8 @@
1
1
  import { Plugin } from 'rollup';
2
- import { UnbuildOptions, UnbuildResolvedOptions } from '../types.cjs';
2
+ import { UnbuildResolvedOptions } from '../types.cjs';
3
3
  import '@storm-software/build-tools';
4
4
  import 'unbuild';
5
5
 
6
- declare const analyzePlugin: (options: UnbuildOptions, resolvedOptions: UnbuildResolvedOptions) => Plugin;
6
+ declare const analyzePlugin: (options: UnbuildResolvedOptions) => Plugin;
7
7
 
8
8
  export { analyzePlugin };
@@ -1,8 +1,8 @@
1
1
  import { Plugin } from 'rollup';
2
- import { UnbuildOptions, UnbuildResolvedOptions } from '../types.js';
2
+ import { UnbuildResolvedOptions } from '../types.js';
3
3
  import '@storm-software/build-tools';
4
4
  import 'unbuild';
5
5
 
6
- declare const analyzePlugin: (options: UnbuildOptions, resolvedOptions: UnbuildResolvedOptions) => Plugin;
6
+ declare const analyzePlugin: (options: UnbuildResolvedOptions) => Plugin;
7
7
 
8
8
  export { analyzePlugin };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  analyzePlugin
3
- } from "../chunk-UELS4AUC.js";
3
+ } from "../chunk-L3WYWYD4.js";
4
4
  import "../chunk-PLJQK2VX.js";
5
5
  import "../chunk-3GQAWCBQ.js";
6
6
  export {
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkSEWO2Q7Tcjs = require('../chunk-SEWO2Q7T.cjs');
3
+ var _chunkY7PS2HJAcjs = require('../chunk-Y7PS2HJA.cjs');
4
4
  require('../chunk-5FQVMM7I.cjs');
5
5
  require('../chunk-BGYQAVKQ.cjs');
6
6
 
7
7
 
8
- exports.onErrorPlugin = _chunkSEWO2Q7Tcjs.onErrorPlugin;
8
+ exports.onErrorPlugin = _chunkY7PS2HJAcjs.onErrorPlugin;
@@ -1,11 +1,11 @@
1
1
  import { Plugin } from 'rollup';
2
- import { UnbuildOptions, UnbuildResolvedOptions } from '../types.cjs';
2
+ import { UnbuildResolvedOptions } from '../types.cjs';
3
3
  import '@storm-software/build-tools';
4
4
  import 'unbuild';
5
5
 
6
6
  /**
7
7
  * Causes rollup to exit immediately with an error code.
8
8
  */
9
- declare const onErrorPlugin: (options: UnbuildOptions, resolvedOptions: UnbuildResolvedOptions) => Plugin;
9
+ declare const onErrorPlugin: (options: UnbuildResolvedOptions) => Plugin;
10
10
 
11
11
  export { onErrorPlugin };
@@ -1,11 +1,11 @@
1
1
  import { Plugin } from 'rollup';
2
- import { UnbuildOptions, UnbuildResolvedOptions } from '../types.js';
2
+ import { UnbuildResolvedOptions } from '../types.js';
3
3
  import '@storm-software/build-tools';
4
4
  import 'unbuild';
5
5
 
6
6
  /**
7
7
  * Causes rollup to exit immediately with an error code.
8
8
  */
9
- declare const onErrorPlugin: (options: UnbuildOptions, resolvedOptions: UnbuildResolvedOptions) => Plugin;
9
+ declare const onErrorPlugin: (options: UnbuildResolvedOptions) => Plugin;
10
10
 
11
11
  export { onErrorPlugin };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  onErrorPlugin
3
- } from "../chunk-HHWS7REN.js";
3
+ } from "../chunk-RFEZKCMQ.js";
4
4
  import "../chunk-PLJQK2VX.js";
5
5
  import "../chunk-3GQAWCBQ.js";
6
6
  export {
@@ -4,7 +4,7 @@
4
4
  var _chunkBGYQAVKQcjs = require('../chunk-BGYQAVKQ.cjs');
5
5
 
6
6
  // src/plugins/swc.ts
7
- var swcPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (options, resolvedOptions) => {
7
+ var swcPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (options) => {
8
8
  const { transform } = _chunkBGYQAVKQcjs.__require.call(void 0, "@swc/core");
9
9
  return {
10
10
  name: "storm:swc",
@@ -1,8 +1,8 @@
1
1
  import { Plugin } from 'rollup';
2
- import { UnbuildOptions, UnbuildResolvedOptions } from '../types.cjs';
2
+ import { UnbuildResolvedOptions } from '../types.cjs';
3
3
  import '@storm-software/build-tools';
4
4
  import 'unbuild';
5
5
 
6
- declare const swcPlugin: (options: UnbuildOptions, resolvedOptions: UnbuildResolvedOptions) => Plugin;
6
+ declare const swcPlugin: (options: UnbuildResolvedOptions) => Plugin;
7
7
 
8
8
  export { swcPlugin };
@@ -1,8 +1,8 @@
1
1
  import { Plugin } from 'rollup';
2
- import { UnbuildOptions, UnbuildResolvedOptions } from '../types.js';
2
+ import { UnbuildResolvedOptions } from '../types.js';
3
3
  import '@storm-software/build-tools';
4
4
  import 'unbuild';
5
5
 
6
- declare const swcPlugin: (options: UnbuildOptions, resolvedOptions: UnbuildResolvedOptions) => Plugin;
6
+ declare const swcPlugin: (options: UnbuildResolvedOptions) => Plugin;
7
7
 
8
8
  export { swcPlugin };
@@ -4,7 +4,7 @@ import {
4
4
  } from "../chunk-3GQAWCBQ.js";
5
5
 
6
6
  // src/plugins/swc.ts
7
- var swcPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => {
7
+ var swcPlugin = /* @__PURE__ */ __name((options) => {
8
8
  const { transform } = __require("@swc/core");
9
9
  return {
10
10
  name: "storm:swc",
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkNGL4NRBAcjs = require('../chunk-NGL4NRBA.cjs');
3
+ var _chunkZPWH22ZMcjs = require('../chunk-ZPWH22ZM.cjs');
4
4
  require('../chunk-5FQVMM7I.cjs');
5
5
  require('../chunk-BGYQAVKQ.cjs');
6
6
 
7
7
 
8
- exports.tscPlugin = _chunkNGL4NRBAcjs.tscPlugin;
8
+ exports.tscPlugin = _chunkZPWH22ZMcjs.tscPlugin;
@@ -1,8 +1,8 @@
1
1
  import { Plugin } from 'rollup';
2
- import { UnbuildOptions, UnbuildResolvedOptions } from '../types.cjs';
2
+ import { UnbuildResolvedOptions } from '../types.cjs';
3
3
  import '@storm-software/build-tools';
4
4
  import 'unbuild';
5
5
 
6
- declare const tscPlugin: (options: UnbuildOptions, resolvedOptions: UnbuildResolvedOptions) => Promise<Plugin<any>>;
6
+ declare const tscPlugin: (options: UnbuildResolvedOptions) => Promise<Plugin<any>>;
7
7
 
8
8
  export { tscPlugin };
@@ -1,8 +1,8 @@
1
1
  import { Plugin } from 'rollup';
2
- import { UnbuildOptions, UnbuildResolvedOptions } from '../types.js';
2
+ import { UnbuildResolvedOptions } from '../types.js';
3
3
  import '@storm-software/build-tools';
4
4
  import 'unbuild';
5
5
 
6
- declare const tscPlugin: (options: UnbuildOptions, resolvedOptions: UnbuildResolvedOptions) => Promise<Plugin<any>>;
6
+ declare const tscPlugin: (options: UnbuildResolvedOptions) => Promise<Plugin<any>>;
7
7
 
8
8
  export { tscPlugin };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tscPlugin
3
- } from "../chunk-WI52QJ54.js";
3
+ } from "../chunk-3M7GEZDL.js";
4
4
  import "../chunk-PLJQK2VX.js";
5
5
  import "../chunk-3GQAWCBQ.js";
6
6
  export {
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkBDHZY5E7cjs = require('../chunk-BDHZY5E7.cjs');
3
+ var _chunkOD3ULBE3cjs = require('../chunk-OD3ULBE3.cjs');
4
4
  require('../chunk-BGYQAVKQ.cjs');
5
5
 
6
6
 
7
- exports.typeDefinitions = _chunkBDHZY5E7cjs.typeDefinitions;
7
+ exports.typeDefinitionsPlugin = _chunkOD3ULBE3cjs.typeDefinitionsPlugin;
@@ -1,4 +1,7 @@
1
1
  import { Plugin } from 'rollup';
2
+ import { UnbuildResolvedOptions } from '../types.cjs';
3
+ import '@storm-software/build-tools';
4
+ import 'unbuild';
2
5
 
3
6
  /**
4
7
  * This plugin takes all entry-points from the generated bundle and creates a
@@ -14,6 +17,6 @@ import { Plugin } from 'rollup';
14
17
  * @param projectRoot - The root of the project.
15
18
  * @returns The Rollup plugin.
16
19
  */
17
- declare function typeDefinitions(projectRoot: string): Plugin;
20
+ declare function typeDefinitionsPlugin(options: UnbuildResolvedOptions): Plugin;
18
21
 
19
- export { typeDefinitions };
22
+ export { typeDefinitionsPlugin };
@@ -1,4 +1,7 @@
1
1
  import { Plugin } from 'rollup';
2
+ import { UnbuildResolvedOptions } from '../types.js';
3
+ import '@storm-software/build-tools';
4
+ import 'unbuild';
2
5
 
3
6
  /**
4
7
  * This plugin takes all entry-points from the generated bundle and creates a
@@ -14,6 +17,6 @@ import { Plugin } from 'rollup';
14
17
  * @param projectRoot - The root of the project.
15
18
  * @returns The Rollup plugin.
16
19
  */
17
- declare function typeDefinitions(projectRoot: string): Plugin;
20
+ declare function typeDefinitionsPlugin(options: UnbuildResolvedOptions): Plugin;
18
21
 
19
- export { typeDefinitions };
22
+ export { typeDefinitionsPlugin };
@@ -1,7 +1,7 @@
1
1
  import {
2
- typeDefinitions
3
- } from "../chunk-ESRR2FD2.js";
2
+ typeDefinitionsPlugin
3
+ } from "../chunk-RBYYB7X2.js";
4
4
  import "../chunk-3GQAWCBQ.js";
5
5
  export {
6
- typeDefinitions
6
+ typeDefinitionsPlugin
7
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/unbuild",
3
- "version": "0.35.0",
3
+ "version": "0.35.1",
4
4
  "type": "module",
5
5
  "description": "A package containing `unbuild` utilities for building Storm Software libraries and applications",
6
6
  "repository": {
@@ -1,27 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkNGL4NRBAcjs = require('./chunk-NGL4NRBA.cjs');
4
-
5
-
6
- var _chunkBDHZY5E7cjs = require('./chunk-BDHZY5E7.cjs');
7
-
8
-
9
- var _chunkAGJ2KZ3Kcjs = require('./chunk-AGJ2KZ3K.cjs');
10
-
11
-
12
- var _chunkSEWO2Q7Tcjs = require('./chunk-SEWO2Q7T.cjs');
13
-
14
-
15
- var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
16
-
17
- // src/config.ts
18
- var getDefaultBuildPlugins = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (options, resolvedOptions) => Promise.all([
19
- _chunkAGJ2KZ3Kcjs.analyzePlugin.call(void 0, options, resolvedOptions),
20
- _chunkBDHZY5E7cjs.typeDefinitions.call(void 0, resolvedOptions.projectRoot),
21
- _chunkNGL4NRBAcjs.tscPlugin.call(void 0, options, resolvedOptions),
22
- _chunkSEWO2Q7Tcjs.onErrorPlugin.call(void 0, options, resolvedOptions)
23
- ].map((plugin) => Promise.resolve(plugin))), "getDefaultBuildPlugins");
24
-
25
-
26
-
27
- exports.getDefaultBuildPlugins = getDefaultBuildPlugins;
@@ -1,27 +0,0 @@
1
- import {
2
- tscPlugin
3
- } from "./chunk-WI52QJ54.js";
4
- import {
5
- typeDefinitions
6
- } from "./chunk-ESRR2FD2.js";
7
- import {
8
- analyzePlugin
9
- } from "./chunk-UELS4AUC.js";
10
- import {
11
- onErrorPlugin
12
- } from "./chunk-HHWS7REN.js";
13
- import {
14
- __name
15
- } from "./chunk-3GQAWCBQ.js";
16
-
17
- // src/config.ts
18
- var getDefaultBuildPlugins = /* @__PURE__ */ __name(async (options, resolvedOptions) => Promise.all([
19
- analyzePlugin(options, resolvedOptions),
20
- typeDefinitions(resolvedOptions.projectRoot),
21
- tscPlugin(options, resolvedOptions),
22
- onErrorPlugin(options, resolvedOptions)
23
- ].map((plugin) => Promise.resolve(plugin))), "getDefaultBuildPlugins");
24
-
25
- export {
26
- getDefaultBuildPlugins
27
- };
package/dist/config.cjs DELETED
@@ -1,12 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkDL7OBOWNcjs = require('./chunk-DL7OBOWN.cjs');
4
- require('./chunk-NGL4NRBA.cjs');
5
- require('./chunk-BDHZY5E7.cjs');
6
- require('./chunk-AGJ2KZ3K.cjs');
7
- require('./chunk-SEWO2Q7T.cjs');
8
- require('./chunk-5FQVMM7I.cjs');
9
- require('./chunk-BGYQAVKQ.cjs');
10
-
11
-
12
- exports.getDefaultBuildPlugins = _chunkDL7OBOWNcjs.getDefaultBuildPlugins;
package/dist/config.d.cts DELETED
@@ -1,8 +0,0 @@
1
- import { InputPluginOption } from 'rollup';
2
- import { UnbuildOptions, UnbuildResolvedOptions } from './types.cjs';
3
- import '@storm-software/build-tools';
4
- import 'unbuild';
5
-
6
- declare const getDefaultBuildPlugins: (options: UnbuildOptions, resolvedOptions: UnbuildResolvedOptions) => Promise<InputPluginOption[]>;
7
-
8
- export { getDefaultBuildPlugins };
package/dist/config.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { InputPluginOption } from 'rollup';
2
- import { UnbuildOptions, UnbuildResolvedOptions } from './types.js';
3
- import '@storm-software/build-tools';
4
- import 'unbuild';
5
-
6
- declare const getDefaultBuildPlugins: (options: UnbuildOptions, resolvedOptions: UnbuildResolvedOptions) => Promise<InputPluginOption[]>;
7
-
8
- export { getDefaultBuildPlugins };
package/dist/config.js DELETED
@@ -1,12 +0,0 @@
1
- import {
2
- getDefaultBuildPlugins
3
- } from "./chunk-UYR662XD.js";
4
- import "./chunk-WI52QJ54.js";
5
- import "./chunk-ESRR2FD2.js";
6
- import "./chunk-UELS4AUC.js";
7
- import "./chunk-HHWS7REN.js";
8
- import "./chunk-PLJQK2VX.js";
9
- import "./chunk-3GQAWCBQ.js";
10
- export {
11
- getDefaultBuildPlugins
12
- };