@storm-software/unbuild 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md 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.25.3-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.27.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/bin/unbuild.cjs CHANGED
@@ -1170,27 +1170,23 @@ var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
1170
1170
  // ../build-tools/src/utilities/copy-assets.ts
1171
1171
  var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, projectRoot, projectName, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
1172
1172
  const pendingAssets = Array.from(assets ?? []);
1173
- if (!pendingAssets?.some((asset) => asset?.glob === "*.md")) {
1174
- pendingAssets.push({
1175
- input: projectRoot,
1176
- glob: "*.md",
1177
- output: "/"
1178
- });
1179
- }
1173
+ pendingAssets.push({
1174
+ input: projectRoot,
1175
+ glob: "*.md",
1176
+ output: "."
1177
+ });
1178
+ pendingAssets.push({
1179
+ input: config.workspaceRoot,
1180
+ glob: "LICENSE",
1181
+ output: "."
1182
+ });
1180
1183
  if (generatePackageJson2 === false) {
1181
1184
  pendingAssets.push({
1182
- input: sourceRoot,
1185
+ input: projectRoot,
1183
1186
  glob: "package.json",
1184
1187
  output: "."
1185
1188
  });
1186
1189
  }
1187
- if (!pendingAssets?.some((asset) => asset?.glob === "LICENSE")) {
1188
- pendingAssets.push({
1189
- input: "",
1190
- glob: "LICENSE",
1191
- output: "."
1192
- });
1193
- }
1194
1190
  if (includeSrc === true) {
1195
1191
  pendingAssets.push({
1196
1192
  input: sourceRoot,
@@ -1336,54 +1332,6 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (config, projec
1336
1332
  packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
1337
1333
  return packageJson;
1338
1334
  }, "addWorkspacePackageJsonFields");
1339
- var addPackageJsonExport = /* @__PURE__ */ __name((file, type = "module", sourceRoot) => {
1340
- let entry = file.replaceAll("\\", "/");
1341
- if (sourceRoot) {
1342
- entry = entry.replace(sourceRoot, "");
1343
- }
1344
- return {
1345
- "import": {
1346
- "types": `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
1347
- "default": `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
1348
- },
1349
- "require": {
1350
- "types": `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
1351
- "default": `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
1352
- },
1353
- "default": {
1354
- "types": `./dist/${entry}.d.ts`,
1355
- "default": `./dist/${entry}.js`
1356
- }
1357
- };
1358
- }, "addPackageJsonExport");
1359
- var addPackageJsonExports = /* @__PURE__ */ __name(async (sourceRoot, packageJson) => {
1360
- packageJson.exports ??= {};
1361
- const files = await new import_glob2.Glob("**/*.{ts,tsx}", {
1362
- absolute: false,
1363
- cwd: sourceRoot,
1364
- root: sourceRoot
1365
- }).walk();
1366
- files.forEach((file) => {
1367
- addPackageJsonExport(file, packageJson.type, sourceRoot);
1368
- const split = file.split(".");
1369
- split.pop();
1370
- const entry = split.join(".").replaceAll("\\", "/");
1371
- packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry, packageJson.type, sourceRoot);
1372
- });
1373
- packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
1374
- packageJson.module = packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
1375
- packageJson.types = "./dist/index.d.ts";
1376
- packageJson.exports ??= {};
1377
- packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
1378
- if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
1379
- ret[key.replace("/index", "")] = packageJson.exports[key];
1380
- }
1381
- return ret;
1382
- }, packageJson.exports);
1383
- packageJson.exports["./package.json"] ??= "./package.json";
1384
- packageJson.exports["."] = packageJson.exports["."] ?? addPackageJsonExport("index", packageJson.type, sourceRoot);
1385
- return packageJson;
1386
- }, "addPackageJsonExports");
1387
1335
 
1388
1336
  // ../build-tools/src/utilities/get-entry-points.ts
1389
1337
  var import_glob3 = require("glob");
@@ -1393,6 +1341,7 @@ var import_create_task_graph = require("nx/src/tasks-runner/create-task-graph");
1393
1341
 
1394
1342
  // src/build.ts
1395
1343
  var import_defu5 = __toESM(require("defu"), 1);
1344
+ var import_glob4 = require("glob");
1396
1345
  var import_node_fs8 = require("fs");
1397
1346
  var import_promises7 = require("fs/promises");
1398
1347
  var import_node_path6 = require("path");
@@ -3028,6 +2977,9 @@ async function resolveOptions(options, config) {
3028
2977
  dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
3029
2978
  dependencies.push(tsLibDependency);
3030
2979
  }
2980
+ const entries = options.entry ?? [
2981
+ sourceRoot
2982
+ ];
3031
2983
  const resolvedOptions = {
3032
2984
  name: projectName,
3033
2985
  config,
@@ -3036,23 +2988,25 @@ async function resolveOptions(options, config) {
3036
2988
  projectName,
3037
2989
  tsconfig,
3038
2990
  clean: false,
3039
- entries: [
3040
- {
2991
+ entries: entries.reduce((ret, entry) => {
2992
+ const entryPath = (0, import_node_path6.dirname)(entry);
2993
+ ret.push({
3041
2994
  builder: "mkdist",
3042
- input: `.${sourceRoot.replace(options.projectRoot, "")}`,
2995
+ input: `.${entryPath.replace(options.projectRoot, "")}`,
3043
2996
  outDir: joinPaths((0, import_node_path6.relative)(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
3044
- declaration: options.emitTypes !== false,
2997
+ declaration: options.emitTypes !== false ? "compatible" : false,
3045
2998
  format: "esm"
3046
- },
3047
- {
2999
+ });
3000
+ ret.push({
3048
3001
  builder: "mkdist",
3049
- input: `.${sourceRoot.replace(options.projectRoot, "")}`,
3002
+ input: `.${entryPath.replace(options.projectRoot, "")}`,
3050
3003
  outDir: joinPaths((0, import_node_path6.relative)(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
3051
- declaration: options.emitTypes !== false,
3004
+ declaration: options.emitTypes !== false ? "compatible" : false,
3052
3005
  format: "cjs",
3053
3006
  ext: "cjs"
3054
- }
3055
- ],
3007
+ });
3008
+ return ret;
3009
+ }, []),
3056
3010
  declaration: options.emitTypes !== false ? "compatible" : false,
3057
3011
  failOnWarn: false,
3058
3012
  sourcemap: options.sourcemap ?? !!options.debug,
@@ -3101,7 +3055,8 @@ async function resolveOptions(options, config) {
3101
3055
  ]
3102
3056
  },
3103
3057
  esbuild: {
3104
- minify: options.minify !== false,
3058
+ minify: options.minify || !options.debug,
3059
+ sourceMap: options.sourcemap || !!options.debug,
3105
3060
  splitting: options.splitting !== false,
3106
3061
  treeShaking: options.treeShaking !== false,
3107
3062
  color: true,
@@ -3140,6 +3095,26 @@ async function resolveOptions(options, config) {
3140
3095
  return resolvedOptions;
3141
3096
  }
3142
3097
  __name(resolveOptions, "resolveOptions");
3098
+ var addPackageJsonExport = /* @__PURE__ */ __name((file, type = "module", sourceRoot) => {
3099
+ let entry = file.replaceAll("\\", "/");
3100
+ if (sourceRoot) {
3101
+ entry = entry.replace(sourceRoot, "");
3102
+ }
3103
+ return {
3104
+ "import": {
3105
+ "types": `./dist/${entry}.d.ts`,
3106
+ "default": `./dist/${entry}.mjs`
3107
+ },
3108
+ "require": {
3109
+ "types": `./dist/${entry}.d.ts`,
3110
+ "default": `./dist/${entry}.cjs`
3111
+ },
3112
+ "default": {
3113
+ "types": `./dist/${entry}.d.ts`,
3114
+ "default": type === "commonjs" ? `./dist/${entry}.cjs` : `./dist/${entry}.mjs`
3115
+ }
3116
+ };
3117
+ }, "addPackageJsonExport");
3143
3118
  async function generatePackageJson(options) {
3144
3119
  if (options.generatePackageJson !== false && (0, import_node_fs8.existsSync)(joinPaths(options.projectRoot, "package.json"))) {
3145
3120
  writeDebug(" \u270D\uFE0F Writing package.json file", options.config);
@@ -3155,7 +3130,32 @@ async function generatePackageJson(options) {
3155
3130
  let packageJson = JSON.parse(packageJsonContent);
3156
3131
  packageJson = await addPackageDependencies(options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
3157
3132
  packageJson = await addWorkspacePackageJsonFields(options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
3158
- await (0, import_devkit6.writeJsonFile)(joinPaths(options.outDir, "package.json"), await addPackageJsonExports(options.sourceRoot, packageJson));
3133
+ packageJson.exports ??= {};
3134
+ const files = await new import_glob4.Glob("**/*.{ts,tsx}", {
3135
+ absolute: false,
3136
+ cwd: options.sourceRoot,
3137
+ root: options.sourceRoot
3138
+ }).walk();
3139
+ files.forEach((file) => {
3140
+ addPackageJsonExport(file, packageJson.type, options.sourceRoot);
3141
+ const split = file.split(".");
3142
+ split.pop();
3143
+ const entry = split.join(".").replaceAll("\\", "/");
3144
+ packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry, packageJson.type, options.sourceRoot);
3145
+ });
3146
+ packageJson.main ??= "./dist/index.cjs";
3147
+ packageJson.module ??= "./dist/index.mjs";
3148
+ packageJson.types ??= "./dist/index.d.ts";
3149
+ packageJson.exports ??= {};
3150
+ packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
3151
+ if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
3152
+ ret[key.replace("/index", "")] = packageJson.exports[key];
3153
+ }
3154
+ return ret;
3155
+ }, packageJson.exports);
3156
+ packageJson.exports["./package.json"] ??= "./package.json";
3157
+ packageJson.exports["."] ??= addPackageJsonExport("index", packageJson.type, options.sourceRoot);
3158
+ await (0, import_devkit6.writeJsonFile)(joinPaths(options.outDir, "package.json"), packageJson);
3159
3159
  stopwatch();
3160
3160
  }
3161
3161
  return options;
package/bin/unbuild.js CHANGED
@@ -1145,27 +1145,23 @@ var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
1145
1145
  // ../build-tools/src/utilities/copy-assets.ts
1146
1146
  var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, projectRoot, projectName, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
1147
1147
  const pendingAssets = Array.from(assets ?? []);
1148
- if (!pendingAssets?.some((asset) => asset?.glob === "*.md")) {
1149
- pendingAssets.push({
1150
- input: projectRoot,
1151
- glob: "*.md",
1152
- output: "/"
1153
- });
1154
- }
1148
+ pendingAssets.push({
1149
+ input: projectRoot,
1150
+ glob: "*.md",
1151
+ output: "."
1152
+ });
1153
+ pendingAssets.push({
1154
+ input: config.workspaceRoot,
1155
+ glob: "LICENSE",
1156
+ output: "."
1157
+ });
1155
1158
  if (generatePackageJson2 === false) {
1156
1159
  pendingAssets.push({
1157
- input: sourceRoot,
1160
+ input: projectRoot,
1158
1161
  glob: "package.json",
1159
1162
  output: "."
1160
1163
  });
1161
1164
  }
1162
- if (!pendingAssets?.some((asset) => asset?.glob === "LICENSE")) {
1163
- pendingAssets.push({
1164
- input: "",
1165
- glob: "LICENSE",
1166
- output: "."
1167
- });
1168
- }
1169
1165
  if (includeSrc === true) {
1170
1166
  pendingAssets.push({
1171
1167
  input: sourceRoot,
@@ -1311,54 +1307,6 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (config, projec
1311
1307
  packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
1312
1308
  return packageJson;
1313
1309
  }, "addWorkspacePackageJsonFields");
1314
- var addPackageJsonExport = /* @__PURE__ */ __name((file, type = "module", sourceRoot) => {
1315
- let entry = file.replaceAll("\\", "/");
1316
- if (sourceRoot) {
1317
- entry = entry.replace(sourceRoot, "");
1318
- }
1319
- return {
1320
- "import": {
1321
- "types": `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
1322
- "default": `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
1323
- },
1324
- "require": {
1325
- "types": `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
1326
- "default": `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
1327
- },
1328
- "default": {
1329
- "types": `./dist/${entry}.d.ts`,
1330
- "default": `./dist/${entry}.js`
1331
- }
1332
- };
1333
- }, "addPackageJsonExport");
1334
- var addPackageJsonExports = /* @__PURE__ */ __name(async (sourceRoot, packageJson) => {
1335
- packageJson.exports ??= {};
1336
- const files = await new Glob("**/*.{ts,tsx}", {
1337
- absolute: false,
1338
- cwd: sourceRoot,
1339
- root: sourceRoot
1340
- }).walk();
1341
- files.forEach((file) => {
1342
- addPackageJsonExport(file, packageJson.type, sourceRoot);
1343
- const split = file.split(".");
1344
- split.pop();
1345
- const entry = split.join(".").replaceAll("\\", "/");
1346
- packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry, packageJson.type, sourceRoot);
1347
- });
1348
- packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
1349
- packageJson.module = packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
1350
- packageJson.types = "./dist/index.d.ts";
1351
- packageJson.exports ??= {};
1352
- packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
1353
- if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
1354
- ret[key.replace("/index", "")] = packageJson.exports[key];
1355
- }
1356
- return ret;
1357
- }, packageJson.exports);
1358
- packageJson.exports["./package.json"] ??= "./package.json";
1359
- packageJson.exports["."] = packageJson.exports["."] ?? addPackageJsonExport("index", packageJson.type, sourceRoot);
1360
- return packageJson;
1361
- }, "addPackageJsonExports");
1362
1310
 
1363
1311
  // ../build-tools/src/utilities/get-entry-points.ts
1364
1312
  import { glob as glob2 } from "glob";
@@ -1368,9 +1316,10 @@ import { createTaskGraph, mapTargetDefaultsToDependencies } from "nx/src/tasks-r
1368
1316
 
1369
1317
  // src/build.ts
1370
1318
  import defu4 from "defu";
1319
+ import { Glob as Glob2 } from "glob";
1371
1320
  import { existsSync as existsSync6 } from "node:fs";
1372
1321
  import { readFile as readFile4 } from "node:fs/promises";
1373
- import { relative as relative4 } from "node:path";
1322
+ import { dirname as dirname3, relative as relative4 } from "node:path";
1374
1323
  import { findWorkspaceRoot as findWorkspaceRoot2 } from "nx/src/utils/find-workspace-root";
1375
1324
 
1376
1325
  // ../../node_modules/.pnpm/unbuild@3.3.1_sass@1.83.4_typescript@5.7.3/node_modules/unbuild/dist/shared/unbuild.B2_7OVir.mjs
@@ -3003,6 +2952,9 @@ async function resolveOptions(options, config) {
3003
2952
  dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
3004
2953
  dependencies.push(tsLibDependency);
3005
2954
  }
2955
+ const entries = options.entry ?? [
2956
+ sourceRoot
2957
+ ];
3006
2958
  const resolvedOptions = {
3007
2959
  name: projectName,
3008
2960
  config,
@@ -3011,23 +2963,25 @@ async function resolveOptions(options, config) {
3011
2963
  projectName,
3012
2964
  tsconfig,
3013
2965
  clean: false,
3014
- entries: [
3015
- {
2966
+ entries: entries.reduce((ret, entry) => {
2967
+ const entryPath = dirname3(entry);
2968
+ ret.push({
3016
2969
  builder: "mkdist",
3017
- input: `.${sourceRoot.replace(options.projectRoot, "")}`,
2970
+ input: `.${entryPath.replace(options.projectRoot, "")}`,
3018
2971
  outDir: joinPaths(relative4(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
3019
- declaration: options.emitTypes !== false,
2972
+ declaration: options.emitTypes !== false ? "compatible" : false,
3020
2973
  format: "esm"
3021
- },
3022
- {
2974
+ });
2975
+ ret.push({
3023
2976
  builder: "mkdist",
3024
- input: `.${sourceRoot.replace(options.projectRoot, "")}`,
2977
+ input: `.${entryPath.replace(options.projectRoot, "")}`,
3025
2978
  outDir: joinPaths(relative4(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
3026
- declaration: options.emitTypes !== false,
2979
+ declaration: options.emitTypes !== false ? "compatible" : false,
3027
2980
  format: "cjs",
3028
2981
  ext: "cjs"
3029
- }
3030
- ],
2982
+ });
2983
+ return ret;
2984
+ }, []),
3031
2985
  declaration: options.emitTypes !== false ? "compatible" : false,
3032
2986
  failOnWarn: false,
3033
2987
  sourcemap: options.sourcemap ?? !!options.debug,
@@ -3076,7 +3030,8 @@ async function resolveOptions(options, config) {
3076
3030
  ]
3077
3031
  },
3078
3032
  esbuild: {
3079
- minify: options.minify !== false,
3033
+ minify: options.minify || !options.debug,
3034
+ sourceMap: options.sourcemap || !!options.debug,
3080
3035
  splitting: options.splitting !== false,
3081
3036
  treeShaking: options.treeShaking !== false,
3082
3037
  color: true,
@@ -3115,6 +3070,26 @@ async function resolveOptions(options, config) {
3115
3070
  return resolvedOptions;
3116
3071
  }
3117
3072
  __name(resolveOptions, "resolveOptions");
3073
+ var addPackageJsonExport = /* @__PURE__ */ __name((file, type = "module", sourceRoot) => {
3074
+ let entry = file.replaceAll("\\", "/");
3075
+ if (sourceRoot) {
3076
+ entry = entry.replace(sourceRoot, "");
3077
+ }
3078
+ return {
3079
+ "import": {
3080
+ "types": `./dist/${entry}.d.ts`,
3081
+ "default": `./dist/${entry}.mjs`
3082
+ },
3083
+ "require": {
3084
+ "types": `./dist/${entry}.d.ts`,
3085
+ "default": `./dist/${entry}.cjs`
3086
+ },
3087
+ "default": {
3088
+ "types": `./dist/${entry}.d.ts`,
3089
+ "default": type === "commonjs" ? `./dist/${entry}.cjs` : `./dist/${entry}.mjs`
3090
+ }
3091
+ };
3092
+ }, "addPackageJsonExport");
3118
3093
  async function generatePackageJson(options) {
3119
3094
  if (options.generatePackageJson !== false && existsSync6(joinPaths(options.projectRoot, "package.json"))) {
3120
3095
  writeDebug(" \u270D\uFE0F Writing package.json file", options.config);
@@ -3130,7 +3105,32 @@ async function generatePackageJson(options) {
3130
3105
  let packageJson = JSON.parse(packageJsonContent);
3131
3106
  packageJson = await addPackageDependencies(options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
3132
3107
  packageJson = await addWorkspacePackageJsonFields(options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
3133
- await writeJsonFile(joinPaths(options.outDir, "package.json"), await addPackageJsonExports(options.sourceRoot, packageJson));
3108
+ packageJson.exports ??= {};
3109
+ const files = await new Glob2("**/*.{ts,tsx}", {
3110
+ absolute: false,
3111
+ cwd: options.sourceRoot,
3112
+ root: options.sourceRoot
3113
+ }).walk();
3114
+ files.forEach((file) => {
3115
+ addPackageJsonExport(file, packageJson.type, options.sourceRoot);
3116
+ const split = file.split(".");
3117
+ split.pop();
3118
+ const entry = split.join(".").replaceAll("\\", "/");
3119
+ packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry, packageJson.type, options.sourceRoot);
3120
+ });
3121
+ packageJson.main ??= "./dist/index.cjs";
3122
+ packageJson.module ??= "./dist/index.mjs";
3123
+ packageJson.types ??= "./dist/index.d.ts";
3124
+ packageJson.exports ??= {};
3125
+ packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
3126
+ if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
3127
+ ret[key.replace("/index", "")] = packageJson.exports[key];
3128
+ }
3129
+ return ret;
3130
+ }, packageJson.exports);
3131
+ packageJson.exports["./package.json"] ??= "./package.json";
3132
+ packageJson.exports["."] ??= addPackageJsonExport("index", packageJson.type, options.sourceRoot);
3133
+ await writeJsonFile(joinPaths(options.outDir, "package.json"), packageJson);
3134
3134
  stopwatch();
3135
3135
  }
3136
3136
  return options;
package/dist/build.cjs CHANGED
@@ -1,6 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUECQBDR2cjs = require('./chunk-UECQBDR2.cjs');
3
+
4
+
5
+
6
+
7
+
8
+ var _chunkS2WZ2PGWcjs = require('./chunk-S2WZ2PGW.cjs');
4
9
  require('./chunk-5E3NJ26L.cjs');
5
10
  require('./chunk-Y2DOCJBE.cjs');
6
11
  require('./chunk-V627S7QU.cjs');
@@ -11,4 +16,9 @@ require('./chunk-FG6XQ26M.cjs');
11
16
  require('./chunk-YDYGZTJK.cjs');
12
17
 
13
18
 
14
- exports.build = _chunkUECQBDR2cjs.build;
19
+
20
+
21
+
22
+
23
+
24
+ exports.build = _chunkS2WZ2PGWcjs.build; exports.cleanOutputPath = _chunkS2WZ2PGWcjs.cleanOutputPath; exports.copyBuildAssets = _chunkS2WZ2PGWcjs.copyBuildAssets; exports.executeUnbuild = _chunkS2WZ2PGWcjs.executeUnbuild; exports.generatePackageJson = _chunkS2WZ2PGWcjs.generatePackageJson; exports.resolveOptions = _chunkS2WZ2PGWcjs.resolveOptions;
package/dist/build.d.cts CHANGED
@@ -1,7 +1,30 @@
1
- import { UnbuildOptions } from './types.cjs';
1
+ import { StormConfig } from '@storm-software/config/types';
2
+ import { UnbuildOptions, UnbuildResolvedOptions } from './types.cjs';
2
3
  import '@storm-software/build-tools';
3
4
  import 'unbuild';
4
5
 
6
+ /**
7
+ * Get the build options for the unbuild process
8
+ *
9
+ * @param options - the unbuild options
10
+ * @returns the resolved options
11
+ */
12
+ declare function resolveOptions(options: UnbuildOptions, config: StormConfig): Promise<UnbuildResolvedOptions>;
13
+ declare function generatePackageJson(options: UnbuildResolvedOptions): Promise<UnbuildResolvedOptions>;
14
+ /**
15
+ * Execute Unbuild with all the configurations we pass
16
+ */
17
+ declare function executeUnbuild(options: UnbuildResolvedOptions): Promise<UnbuildResolvedOptions>;
18
+ /**
19
+ * Copy the assets to the build directory
20
+ */
21
+ declare function copyBuildAssets(options: UnbuildResolvedOptions): Promise<UnbuildResolvedOptions>;
22
+ /**
23
+ * Clean the output path
24
+ *
25
+ * @param options - the build options
26
+ */
27
+ declare function cleanOutputPath(options: UnbuildResolvedOptions): Promise<UnbuildResolvedOptions>;
5
28
  /**
6
29
  * Execution pipeline that applies a set of actions
7
30
  *
@@ -10,4 +33,4 @@ import 'unbuild';
10
33
  */
11
34
  declare function build(options: UnbuildOptions): Promise<void>;
12
35
 
13
- export { build };
36
+ export { build, cleanOutputPath, copyBuildAssets, executeUnbuild, generatePackageJson, resolveOptions };
package/dist/build.d.ts CHANGED
@@ -1,7 +1,30 @@
1
- import { UnbuildOptions } from './types.js';
1
+ import { StormConfig } from '@storm-software/config/types';
2
+ import { UnbuildOptions, UnbuildResolvedOptions } from './types.js';
2
3
  import '@storm-software/build-tools';
3
4
  import 'unbuild';
4
5
 
6
+ /**
7
+ * Get the build options for the unbuild process
8
+ *
9
+ * @param options - the unbuild options
10
+ * @returns the resolved options
11
+ */
12
+ declare function resolveOptions(options: UnbuildOptions, config: StormConfig): Promise<UnbuildResolvedOptions>;
13
+ declare function generatePackageJson(options: UnbuildResolvedOptions): Promise<UnbuildResolvedOptions>;
14
+ /**
15
+ * Execute Unbuild with all the configurations we pass
16
+ */
17
+ declare function executeUnbuild(options: UnbuildResolvedOptions): Promise<UnbuildResolvedOptions>;
18
+ /**
19
+ * Copy the assets to the build directory
20
+ */
21
+ declare function copyBuildAssets(options: UnbuildResolvedOptions): Promise<UnbuildResolvedOptions>;
22
+ /**
23
+ * Clean the output path
24
+ *
25
+ * @param options - the build options
26
+ */
27
+ declare function cleanOutputPath(options: UnbuildResolvedOptions): Promise<UnbuildResolvedOptions>;
5
28
  /**
6
29
  * Execution pipeline that applies a set of actions
7
30
  *
@@ -10,4 +33,4 @@ import 'unbuild';
10
33
  */
11
34
  declare function build(options: UnbuildOptions): Promise<void>;
12
35
 
13
- export { build };
36
+ export { build, cleanOutputPath, copyBuildAssets, executeUnbuild, generatePackageJson, resolveOptions };
package/dist/build.js CHANGED
@@ -1,6 +1,11 @@
1
1
  import {
2
- build
3
- } from "./chunk-G4U2DNFU.js";
2
+ build,
3
+ cleanOutputPath,
4
+ copyBuildAssets,
5
+ executeUnbuild,
6
+ generatePackageJson,
7
+ resolveOptions
8
+ } from "./chunk-54R2TCTI.js";
4
9
  import "./chunk-VC7N2YVM.js";
5
10
  import "./chunk-K2D7TQ7G.js";
6
11
  import "./chunk-C5IHRWT3.js";
@@ -10,5 +15,10 @@ import "./chunk-5S4A4OEA.js";
10
15
  import "./chunk-TPFSDZCR.js";
11
16
  import "./chunk-3GQAWCBQ.js";
12
17
  export {
13
- build
18
+ build,
19
+ cleanOutputPath,
20
+ copyBuildAssets,
21
+ executeUnbuild,
22
+ generatePackageJson,
23
+ resolveOptions
14
24
  };
@@ -555,27 +555,23 @@ var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
555
555
  // ../build-tools/src/utilities/copy-assets.ts
556
556
  var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, projectRoot, projectName, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
557
557
  const pendingAssets = Array.from(assets ?? []);
558
- if (!pendingAssets?.some((asset) => asset?.glob === "*.md")) {
559
- pendingAssets.push({
560
- input: projectRoot,
561
- glob: "*.md",
562
- output: "/"
563
- });
564
- }
558
+ pendingAssets.push({
559
+ input: projectRoot,
560
+ glob: "*.md",
561
+ output: "."
562
+ });
563
+ pendingAssets.push({
564
+ input: config.workspaceRoot,
565
+ glob: "LICENSE",
566
+ output: "."
567
+ });
565
568
  if (generatePackageJson2 === false) {
566
569
  pendingAssets.push({
567
- input: sourceRoot,
570
+ input: projectRoot,
568
571
  glob: "package.json",
569
572
  output: "."
570
573
  });
571
574
  }
572
- if (!pendingAssets?.some((asset) => asset?.glob === "LICENSE")) {
573
- pendingAssets.push({
574
- input: "",
575
- glob: "LICENSE",
576
- output: "."
577
- });
578
- }
579
575
  if (includeSrc === true) {
580
576
  pendingAssets.push({
581
577
  input: sourceRoot,
@@ -721,54 +717,6 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (config, projec
721
717
  packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
722
718
  return packageJson;
723
719
  }, "addWorkspacePackageJsonFields");
724
- var addPackageJsonExport = /* @__PURE__ */ __name((file, type = "module", sourceRoot) => {
725
- let entry = file.replaceAll("\\", "/");
726
- if (sourceRoot) {
727
- entry = entry.replace(sourceRoot, "");
728
- }
729
- return {
730
- "import": {
731
- "types": `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
732
- "default": `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
733
- },
734
- "require": {
735
- "types": `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
736
- "default": `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
737
- },
738
- "default": {
739
- "types": `./dist/${entry}.d.ts`,
740
- "default": `./dist/${entry}.js`
741
- }
742
- };
743
- }, "addPackageJsonExport");
744
- var addPackageJsonExports = /* @__PURE__ */ __name(async (sourceRoot, packageJson) => {
745
- packageJson.exports ??= {};
746
- const files = await new Glob("**/*.{ts,tsx}", {
747
- absolute: false,
748
- cwd: sourceRoot,
749
- root: sourceRoot
750
- }).walk();
751
- files.forEach((file) => {
752
- addPackageJsonExport(file, packageJson.type, sourceRoot);
753
- const split = file.split(".");
754
- split.pop();
755
- const entry = split.join(".").replaceAll("\\", "/");
756
- packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry, packageJson.type, sourceRoot);
757
- });
758
- packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
759
- packageJson.module = packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
760
- packageJson.types = "./dist/index.d.ts";
761
- packageJson.exports ??= {};
762
- packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
763
- if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
764
- ret[key.replace("/index", "")] = packageJson.exports[key];
765
- }
766
- return ret;
767
- }, packageJson.exports);
768
- packageJson.exports["./package.json"] ??= "./package.json";
769
- packageJson.exports["."] = packageJson.exports["."] ?? addPackageJsonExport("index", packageJson.type, sourceRoot);
770
- return packageJson;
771
- }, "addPackageJsonExports");
772
720
 
773
721
  // ../build-tools/src/utilities/get-entry-points.ts
774
722
  import { glob as glob2 } from "glob";
@@ -778,9 +726,10 @@ import { createTaskGraph, mapTargetDefaultsToDependencies } from "nx/src/tasks-r
778
726
 
779
727
  // src/build.ts
780
728
  import defu4 from "defu";
729
+ import { Glob as Glob2 } from "glob";
781
730
  import { existsSync as existsSync4 } from "node:fs";
782
731
  import { readFile as readFile4 } from "node:fs/promises";
783
- import { relative as relative3 } from "node:path";
732
+ import { dirname as dirname2, relative as relative3 } from "node:path";
784
733
  import { findWorkspaceRoot as findWorkspaceRoot2 } from "nx/src/utils/find-workspace-root";
785
734
 
786
735
  // ../../node_modules/.pnpm/unbuild@3.3.1_sass@1.83.4_typescript@5.7.3/node_modules/unbuild/dist/shared/unbuild.B2_7OVir.mjs
@@ -2260,6 +2209,9 @@ async function resolveOptions(options, config) {
2260
2209
  dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
2261
2210
  dependencies.push(tsLibDependency);
2262
2211
  }
2212
+ const entries = options.entry ?? [
2213
+ sourceRoot
2214
+ ];
2263
2215
  const resolvedOptions = {
2264
2216
  name: projectName,
2265
2217
  config,
@@ -2268,23 +2220,25 @@ async function resolveOptions(options, config) {
2268
2220
  projectName,
2269
2221
  tsconfig,
2270
2222
  clean: false,
2271
- entries: [
2272
- {
2223
+ entries: entries.reduce((ret, entry) => {
2224
+ const entryPath = dirname2(entry);
2225
+ ret.push({
2273
2226
  builder: "mkdist",
2274
- input: `.${sourceRoot.replace(options.projectRoot, "")}`,
2227
+ input: `.${entryPath.replace(options.projectRoot, "")}`,
2275
2228
  outDir: joinPaths(relative3(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
2276
- declaration: options.emitTypes !== false,
2229
+ declaration: options.emitTypes !== false ? "compatible" : false,
2277
2230
  format: "esm"
2278
- },
2279
- {
2231
+ });
2232
+ ret.push({
2280
2233
  builder: "mkdist",
2281
- input: `.${sourceRoot.replace(options.projectRoot, "")}`,
2234
+ input: `.${entryPath.replace(options.projectRoot, "")}`,
2282
2235
  outDir: joinPaths(relative3(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
2283
- declaration: options.emitTypes !== false,
2236
+ declaration: options.emitTypes !== false ? "compatible" : false,
2284
2237
  format: "cjs",
2285
2238
  ext: "cjs"
2286
- }
2287
- ],
2239
+ });
2240
+ return ret;
2241
+ }, []),
2288
2242
  declaration: options.emitTypes !== false ? "compatible" : false,
2289
2243
  failOnWarn: false,
2290
2244
  sourcemap: options.sourcemap ?? !!options.debug,
@@ -2333,7 +2287,8 @@ async function resolveOptions(options, config) {
2333
2287
  ]
2334
2288
  },
2335
2289
  esbuild: {
2336
- minify: options.minify !== false,
2290
+ minify: options.minify || !options.debug,
2291
+ sourceMap: options.sourcemap || !!options.debug,
2337
2292
  splitting: options.splitting !== false,
2338
2293
  treeShaking: options.treeShaking !== false,
2339
2294
  color: true,
@@ -2372,6 +2327,26 @@ async function resolveOptions(options, config) {
2372
2327
  return resolvedOptions;
2373
2328
  }
2374
2329
  __name(resolveOptions, "resolveOptions");
2330
+ var addPackageJsonExport = /* @__PURE__ */ __name((file, type = "module", sourceRoot) => {
2331
+ let entry = file.replaceAll("\\", "/");
2332
+ if (sourceRoot) {
2333
+ entry = entry.replace(sourceRoot, "");
2334
+ }
2335
+ return {
2336
+ "import": {
2337
+ "types": `./dist/${entry}.d.ts`,
2338
+ "default": `./dist/${entry}.mjs`
2339
+ },
2340
+ "require": {
2341
+ "types": `./dist/${entry}.d.ts`,
2342
+ "default": `./dist/${entry}.cjs`
2343
+ },
2344
+ "default": {
2345
+ "types": `./dist/${entry}.d.ts`,
2346
+ "default": type === "commonjs" ? `./dist/${entry}.cjs` : `./dist/${entry}.mjs`
2347
+ }
2348
+ };
2349
+ }, "addPackageJsonExport");
2375
2350
  async function generatePackageJson(options) {
2376
2351
  if (options.generatePackageJson !== false && existsSync4(joinPaths(options.projectRoot, "package.json"))) {
2377
2352
  writeDebug(" \u270D\uFE0F Writing package.json file", options.config);
@@ -2387,7 +2362,32 @@ async function generatePackageJson(options) {
2387
2362
  let packageJson = JSON.parse(packageJsonContent);
2388
2363
  packageJson = await addPackageDependencies(options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
2389
2364
  packageJson = await addWorkspacePackageJsonFields(options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
2390
- await writeJsonFile(joinPaths(options.outDir, "package.json"), await addPackageJsonExports(options.sourceRoot, packageJson));
2365
+ packageJson.exports ??= {};
2366
+ const files = await new Glob2("**/*.{ts,tsx}", {
2367
+ absolute: false,
2368
+ cwd: options.sourceRoot,
2369
+ root: options.sourceRoot
2370
+ }).walk();
2371
+ files.forEach((file) => {
2372
+ addPackageJsonExport(file, packageJson.type, options.sourceRoot);
2373
+ const split = file.split(".");
2374
+ split.pop();
2375
+ const entry = split.join(".").replaceAll("\\", "/");
2376
+ packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry, packageJson.type, options.sourceRoot);
2377
+ });
2378
+ packageJson.main ??= "./dist/index.cjs";
2379
+ packageJson.module ??= "./dist/index.mjs";
2380
+ packageJson.types ??= "./dist/index.d.ts";
2381
+ packageJson.exports ??= {};
2382
+ packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
2383
+ if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
2384
+ ret[key.replace("/index", "")] = packageJson.exports[key];
2385
+ }
2386
+ return ret;
2387
+ }, packageJson.exports);
2388
+ packageJson.exports["./package.json"] ??= "./package.json";
2389
+ packageJson.exports["."] ??= addPackageJsonExport("index", packageJson.type, options.sourceRoot);
2390
+ await writeJsonFile(joinPaths(options.outDir, "package.json"), packageJson);
2391
2391
  stopwatch();
2392
2392
  }
2393
2393
  return options;
@@ -2460,5 +2460,10 @@ async function build2(options) {
2460
2460
  __name(build2, "build");
2461
2461
 
2462
2462
  export {
2463
+ resolveOptions,
2464
+ generatePackageJson,
2465
+ executeUnbuild,
2466
+ copyBuildAssets,
2467
+ cleanOutputPath,
2463
2468
  build2 as build
2464
2469
  };
@@ -556,27 +556,23 @@ var readNxConfig = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (
556
556
  // ../build-tools/src/utilities/copy-assets.ts
557
557
  var copyAssets = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (config, assets, outputPath, projectRoot, projectName, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
558
558
  const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
559
- if (!_optionalChain([pendingAssets, 'optionalAccess', _32 => _32.some, 'call', _33 => _33((asset) => _optionalChain([asset, 'optionalAccess', _34 => _34.glob]) === "*.md")])) {
560
- pendingAssets.push({
561
- input: projectRoot,
562
- glob: "*.md",
563
- output: "/"
564
- });
565
- }
559
+ pendingAssets.push({
560
+ input: projectRoot,
561
+ glob: "*.md",
562
+ output: "."
563
+ });
564
+ pendingAssets.push({
565
+ input: config.workspaceRoot,
566
+ glob: "LICENSE",
567
+ output: "."
568
+ });
566
569
  if (generatePackageJson2 === false) {
567
570
  pendingAssets.push({
568
- input: sourceRoot,
571
+ input: projectRoot,
569
572
  glob: "package.json",
570
573
  output: "."
571
574
  });
572
575
  }
573
- if (!_optionalChain([pendingAssets, 'optionalAccess', _35 => _35.some, 'call', _36 => _36((asset) => _optionalChain([asset, 'optionalAccess', _37 => _37.glob]) === "LICENSE")])) {
574
- pendingAssets.push({
575
- input: "",
576
- glob: "LICENSE",
577
- output: "."
578
- });
579
- }
580
576
  if (includeSrc === true) {
581
577
  pendingAssets.push({
582
578
  input: sourceRoot,
@@ -587,10 +583,10 @@ var copyAssets = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (co
587
583
  const nxJson = readNxConfig(config.workspaceRoot);
588
584
  const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
589
585
  const projectsConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
590
- if (!_optionalChain([projectsConfigurations, 'optionalAccess', _38 => _38.projects, 'optionalAccess', _39 => _39[projectName]])) {
586
+ if (!_optionalChain([projectsConfigurations, 'optionalAccess', _32 => _32.projects, 'optionalAccess', _33 => _33[projectName]])) {
591
587
  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.");
592
588
  }
593
- const buildTarget = _optionalChain([projectsConfigurations, 'access', _40 => _40.projects, 'access', _41 => _41[projectName], 'access', _42 => _42.targets, 'optionalAccess', _43 => _43.build]);
589
+ const buildTarget = _optionalChain([projectsConfigurations, 'access', _34 => _34.projects, 'access', _35 => _35[projectName], 'access', _36 => _36.targets, 'optionalAccess', _37 => _37.build]);
594
590
  if (!buildTarget) {
595
591
  throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${_chunkFG6XQ26Mcjs.joinPaths.call(void 0, projectRoot, "project.json")}`);
596
592
  }
@@ -722,54 +718,6 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.cal
722
718
  packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkFG6XQ26Mcjs.joinPaths.call(void 0, "packages", projectName);
723
719
  return packageJson;
724
720
  }, "addWorkspacePackageJsonFields");
725
- var addPackageJsonExport = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
726
- let entry = file.replaceAll("\\", "/");
727
- if (sourceRoot) {
728
- entry = entry.replace(sourceRoot, "");
729
- }
730
- return {
731
- "import": {
732
- "types": `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
733
- "default": `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
734
- },
735
- "require": {
736
- "types": `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
737
- "default": `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
738
- },
739
- "default": {
740
- "types": `./dist/${entry}.d.ts`,
741
- "default": `./dist/${entry}.js`
742
- }
743
- };
744
- }, "addPackageJsonExport");
745
- var addPackageJsonExports = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (sourceRoot, packageJson) => {
746
- packageJson.exports ??= {};
747
- const files = await new (0, _glob.Glob)("**/*.{ts,tsx}", {
748
- absolute: false,
749
- cwd: sourceRoot,
750
- root: sourceRoot
751
- }).walk();
752
- files.forEach((file) => {
753
- addPackageJsonExport(file, packageJson.type, sourceRoot);
754
- const split = file.split(".");
755
- split.pop();
756
- const entry = split.join(".").replaceAll("\\", "/");
757
- packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry, packageJson.type, sourceRoot);
758
- });
759
- packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
760
- packageJson.module = packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
761
- packageJson.types = "./dist/index.d.ts";
762
- packageJson.exports ??= {};
763
- packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
764
- if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
765
- ret[key.replace("/index", "")] = packageJson.exports[key];
766
- }
767
- return ret;
768
- }, packageJson.exports);
769
- packageJson.exports["./package.json"] ??= "./package.json";
770
- packageJson.exports["."] = _nullishCoalesce(packageJson.exports["."], () => ( addPackageJsonExport("index", packageJson.type, sourceRoot)));
771
- return packageJson;
772
- }, "addPackageJsonExports");
773
721
 
774
722
  // ../build-tools/src/utilities/get-entry-points.ts
775
723
 
@@ -782,6 +730,7 @@ var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
782
730
 
783
731
 
784
732
 
733
+
785
734
  var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
786
735
 
787
736
  // ../../node_modules/.pnpm/unbuild@3.3.1_sass@1.83.4_typescript@5.7.3/node_modules/unbuild/dist/shared/unbuild.B2_7OVir.mjs
@@ -900,7 +849,7 @@ function inferEntries(pkg, sourceFiles, rootDir) {
900
849
  const SOURCE_RE = new RegExp(
901
850
  `(?<=/|$)${d}${isDir ? "" : String.raw`\.\w+`}$`
902
851
  );
903
- return _optionalChain([sourceFiles, 'access', _44 => _44.find, 'call', _45 => _45((i) => SOURCE_RE.test(i)), 'optionalAccess', _46 => _46.replace, 'call', _47 => _47(/(\.d\.(m|c)?ts|\.\w+)$/, "")]);
852
+ return _optionalChain([sourceFiles, 'access', _38 => _38.find, 'call', _39 => _39((i) => SOURCE_RE.test(i)), 'optionalAccess', _40 => _40.replace, 'call', _41 => _41(/(\.d\.(m|c)?ts|\.\w+)$/, "")]);
904
853
  }, void 0);
905
854
  if (!input) {
906
855
  if (!_fs.existsSync.call(void 0, _pathe.resolve.call(void 0, rootDir || ".", output.file))) {
@@ -1160,7 +1109,7 @@ function shebangPlugin() {
1160
1109
  if (output.type !== "chunk") {
1161
1110
  continue;
1162
1111
  }
1163
- if (_optionalChain([output, 'access', _48 => _48.code, 'optionalAccess', _49 => _49.match, 'call', _50 => _50(SHEBANG_RE)])) {
1112
+ if (_optionalChain([output, 'access', _42 => _42.code, 'optionalAccess', _43 => _43.match, 'call', _44 => _44(SHEBANG_RE)])) {
1164
1113
  const outFile = _pathe.resolve.call(void 0, options.dir, fileName);
1165
1114
  await makeExecutable(outFile);
1166
1115
  }
@@ -1334,7 +1283,7 @@ function fixCJSExportTypePlugin() {
1334
1283
  return {
1335
1284
  name: "unbuild-fix-cjs-export-type",
1336
1285
  renderChunk(code, info, opts) {
1337
- if (info.type !== "chunk" || !info.fileName.endsWith(".d.cts") || !info.isEntry || _optionalChain([info, 'access', _51 => _51.exports, 'optionalAccess', _52 => _52.length]) !== 1 || info.exports[0] !== "default") {
1286
+ if (info.type !== "chunk" || !info.fileName.endsWith(".d.cts") || !info.isEntry || _optionalChain([info, 'access', _45 => _45.exports, 'optionalAccess', _46 => _46.length]) !== 1 || info.exports[0] !== "default") {
1338
1287
  return;
1339
1288
  }
1340
1289
  return code.replace(
@@ -1451,7 +1400,7 @@ function getRollupOptions(ctx) {
1451
1400
  ].filter(Boolean),
1452
1401
  external(originalId) {
1453
1402
  const resolvedId = _utils3.resolveAlias.call(void 0, originalId, _aliases);
1454
- const pkgName = _optionalChain([_mlly.parseNodeModulePath.call(void 0, resolvedId), 'optionalAccess', _53 => _53.name]) || _optionalChain([_mlly.parseNodeModulePath.call(void 0, originalId), 'optionalAccess', _54 => _54.name]) || getpkg(originalId);
1403
+ const pkgName = _optionalChain([_mlly.parseNodeModulePath.call(void 0, resolvedId), 'optionalAccess', _47 => _47.name]) || _optionalChain([_mlly.parseNodeModulePath.call(void 0, originalId), 'optionalAccess', _48 => _48.name]) || getpkg(originalId);
1455
1404
  if (arrayIncludes(ctx.options.externals, pkgName) || arrayIncludes(ctx.options.externals, originalId) || arrayIncludes(ctx.options.externals, resolvedId)) {
1456
1405
  return true;
1457
1406
  }
@@ -1512,7 +1461,7 @@ function getRollupOptions(ctx) {
1512
1461
  }
1513
1462
  _chunkYDYGZTJKcjs.__name.call(void 0, getRollupOptions, "getRollupOptions");
1514
1463
  async function rollupStub(ctx) {
1515
- const babelPlugins = _optionalChain([ctx, 'access', _55 => _55.options, 'access', _56 => _56.stubOptions, 'access', _57 => _57.jiti, 'access', _58 => _58.transformOptions, 'optionalAccess', _59 => _59.babel, 'optionalAccess', _60 => _60.plugins]);
1464
+ const babelPlugins = _optionalChain([ctx, 'access', _49 => _49.options, 'access', _50 => _50.stubOptions, 'access', _51 => _51.jiti, 'access', _52 => _52.transformOptions, 'optionalAccess', _53 => _53.babel, 'optionalAccess', _54 => _54.plugins]);
1516
1465
  const importedBabelPlugins = [];
1517
1466
  const serializedJitiOptions = JSON.stringify(
1518
1467
  {
@@ -1524,7 +1473,7 @@ async function rollupStub(ctx) {
1524
1473
  transformOptions: {
1525
1474
  ...ctx.options.stubOptions.jiti.transformOptions,
1526
1475
  babel: {
1527
- ..._optionalChain([ctx, 'access', _61 => _61.options, 'access', _62 => _62.stubOptions, 'access', _63 => _63.jiti, 'access', _64 => _64.transformOptions, 'optionalAccess', _65 => _65.babel]),
1476
+ ..._optionalChain([ctx, 'access', _55 => _55.options, 'access', _56 => _56.stubOptions, 'access', _57 => _57.jiti, 'access', _58 => _58.transformOptions, 'optionalAccess', _59 => _59.babel]),
1528
1477
  plugins: "__$BABEL_PLUGINS"
1529
1478
  }
1530
1479
  }
@@ -1919,7 +1868,7 @@ _chunkYDYGZTJKcjs.__name.call(void 0, copyBuild, "copyBuild");
1919
1868
  async function build(rootDir, stub, inputConfig = {}) {
1920
1869
  rootDir = _pathe.resolve.call(void 0, process.cwd(), rootDir || ".");
1921
1870
  const jiti = _jiti.createJiti.call(void 0, rootDir);
1922
- const _buildConfig = await jiti.import(_optionalChain([inputConfig, 'optionalAccess', _66 => _66.config]) || "./build.config", {
1871
+ const _buildConfig = await jiti.import(_optionalChain([inputConfig, 'optionalAccess', _60 => _60.config]) || "./build.config", {
1923
1872
  try: !inputConfig.config,
1924
1873
  default: true
1925
1874
  }) || {};
@@ -1946,7 +1895,7 @@ async function build(rootDir, stub, inputConfig = {}) {
1946
1895
  _chunkYDYGZTJKcjs.__name.call(void 0, build, "build");
1947
1896
  async function _build(rootDir, inputConfig = {}, buildConfig, pkg, cleanedDirs, _stubMode, _watchMode) {
1948
1897
  const preset = await resolvePreset(
1949
- buildConfig.preset || _optionalChain([pkg, 'access', _67 => _67.unbuild, 'optionalAccess', _68 => _68.preset]) || _optionalChain([pkg, 'access', _69 => _69.build, 'optionalAccess', _70 => _70.preset]) || inputConfig.preset || "auto",
1898
+ buildConfig.preset || _optionalChain([pkg, 'access', _61 => _61.unbuild, 'optionalAccess', _62 => _62.preset]) || _optionalChain([pkg, 'access', _63 => _63.build, 'optionalAccess', _64 => _64.preset]) || inputConfig.preset || "auto",
1950
1899
  rootDir
1951
1900
  );
1952
1901
  const options = _defu.defu.call(void 0,
@@ -1955,7 +1904,7 @@ async function _build(rootDir, inputConfig = {}, buildConfig, pkg, cleanedDirs,
1955
1904
  inputConfig,
1956
1905
  preset,
1957
1906
  {
1958
- name: (_optionalChain([pkg, 'optionalAccess', _71 => _71.name]) || "").split("/").pop() || "default",
1907
+ name: (_optionalChain([pkg, 'optionalAccess', _65 => _65.name]) || "").split("/").pop() || "default",
1959
1908
  rootDir,
1960
1909
  entries: [],
1961
1910
  clean: true,
@@ -2136,24 +2085,24 @@ async function _build(rootDir, inputConfig = {}, buildConfig, pkg, cleanedDirs,
2136
2085
  for (const entry of ctx.buildEntries.filter((e) => !e.chunk)) {
2137
2086
  let totalBytes = entry.bytes || 0;
2138
2087
  for (const chunk of entry.chunks || []) {
2139
- totalBytes += _optionalChain([ctx, 'access', _72 => _72.buildEntries, 'access', _73 => _73.find, 'call', _74 => _74((e) => e.path === chunk), 'optionalAccess', _75 => _75.bytes]) || 0;
2088
+ totalBytes += _optionalChain([ctx, 'access', _66 => _66.buildEntries, 'access', _67 => _67.find, 'call', _68 => _68((e) => e.path === chunk), 'optionalAccess', _69 => _69.bytes]) || 0;
2140
2089
  }
2141
2090
  let line = ` ${_utils.colors.bold(rPath(entry.path))} (` + [
2142
2091
  totalBytes && `total size: ${_utils.colors.cyan(_prettybytes2.default.call(void 0, totalBytes))}`,
2143
2092
  entry.bytes && `chunk size: ${_utils.colors.cyan(_prettybytes2.default.call(void 0, entry.bytes))}`,
2144
- _optionalChain([entry, 'access', _76 => _76.exports, 'optionalAccess', _77 => _77.length]) && `exports: ${_utils.colors.gray(entry.exports.join(", "))}`
2093
+ _optionalChain([entry, 'access', _70 => _70.exports, 'optionalAccess', _71 => _71.length]) && `exports: ${_utils.colors.gray(entry.exports.join(", "))}`
2145
2094
  ].filter(Boolean).join(", ") + ")";
2146
- if (_optionalChain([entry, 'access', _78 => _78.chunks, 'optionalAccess', _79 => _79.length])) {
2095
+ if (_optionalChain([entry, 'access', _72 => _72.chunks, 'optionalAccess', _73 => _73.length])) {
2147
2096
  line += "\n" + entry.chunks.map((p) => {
2148
2097
  const chunk = ctx.buildEntries.find((e) => e.path === p) || {};
2149
2098
  return _utils.colors.gray(
2150
2099
  " \u2514\u2500 " + rPath(p) + _utils.colors.bold(
2151
- chunk.bytes ? ` (${_prettybytes2.default.call(void 0, _optionalChain([chunk, 'optionalAccess', _80 => _80.bytes]))})` : ""
2100
+ chunk.bytes ? ` (${_prettybytes2.default.call(void 0, _optionalChain([chunk, 'optionalAccess', _74 => _74.bytes]))})` : ""
2152
2101
  )
2153
2102
  );
2154
2103
  }).join("\n");
2155
2104
  }
2156
- if (_optionalChain([entry, 'access', _81 => _81.modules, 'optionalAccess', _82 => _82.length])) {
2105
+ if (_optionalChain([entry, 'access', _75 => _75.modules, 'optionalAccess', _76 => _76.length])) {
2157
2106
  line += "\n" + entry.modules.filter((m) => m.id.includes("node_modules")).sort((a, b) => (b.bytes || 0) - (a.bytes || 0)).map((m) => {
2158
2107
  return _utils.colors.gray(
2159
2108
  " \u{1F4E6} " + rPath(m.id) + _utils.colors.bold(m.bytes ? ` (${_prettybytes2.default.call(void 0, m.bytes)})` : "")
@@ -2261,6 +2210,9 @@ async function resolveOptions(options, config) {
2261
2210
  dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
2262
2211
  dependencies.push(tsLibDependency);
2263
2212
  }
2213
+ const entries = _nullishCoalesce(options.entry, () => ( [
2214
+ sourceRoot
2215
+ ]));
2264
2216
  const resolvedOptions = {
2265
2217
  name: projectName,
2266
2218
  config,
@@ -2269,23 +2221,25 @@ async function resolveOptions(options, config) {
2269
2221
  projectName,
2270
2222
  tsconfig,
2271
2223
  clean: false,
2272
- entries: [
2273
- {
2224
+ entries: entries.reduce((ret, entry) => {
2225
+ const entryPath = _path.dirname.call(void 0, entry);
2226
+ ret.push({
2274
2227
  builder: "mkdist",
2275
- input: `.${sourceRoot.replace(options.projectRoot, "")}`,
2228
+ input: `.${entryPath.replace(options.projectRoot, "")}`,
2276
2229
  outDir: _chunkFG6XQ26Mcjs.joinPaths.call(void 0, _path.relative.call(void 0, _chunkFG6XQ26Mcjs.joinPaths.call(void 0, config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
2277
- declaration: options.emitTypes !== false,
2230
+ declaration: options.emitTypes !== false ? "compatible" : false,
2278
2231
  format: "esm"
2279
- },
2280
- {
2232
+ });
2233
+ ret.push({
2281
2234
  builder: "mkdist",
2282
- input: `.${sourceRoot.replace(options.projectRoot, "")}`,
2235
+ input: `.${entryPath.replace(options.projectRoot, "")}`,
2283
2236
  outDir: _chunkFG6XQ26Mcjs.joinPaths.call(void 0, _path.relative.call(void 0, _chunkFG6XQ26Mcjs.joinPaths.call(void 0, config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
2284
- declaration: options.emitTypes !== false,
2237
+ declaration: options.emitTypes !== false ? "compatible" : false,
2285
2238
  format: "cjs",
2286
2239
  ext: "cjs"
2287
- }
2288
- ],
2240
+ });
2241
+ return ret;
2242
+ }, []),
2289
2243
  declaration: options.emitTypes !== false ? "compatible" : false,
2290
2244
  failOnWarn: false,
2291
2245
  sourcemap: _nullishCoalesce(options.sourcemap, () => ( !!options.debug)),
@@ -2334,7 +2288,8 @@ async function resolveOptions(options, config) {
2334
2288
  ]
2335
2289
  },
2336
2290
  esbuild: {
2337
- minify: options.minify !== false,
2291
+ minify: options.minify || !options.debug,
2292
+ sourceMap: options.sourcemap || !!options.debug,
2338
2293
  splitting: options.splitting !== false,
2339
2294
  treeShaking: options.treeShaking !== false,
2340
2295
  color: true,
@@ -2373,6 +2328,26 @@ async function resolveOptions(options, config) {
2373
2328
  return resolvedOptions;
2374
2329
  }
2375
2330
  _chunkYDYGZTJKcjs.__name.call(void 0, resolveOptions, "resolveOptions");
2331
+ var addPackageJsonExport = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
2332
+ let entry = file.replaceAll("\\", "/");
2333
+ if (sourceRoot) {
2334
+ entry = entry.replace(sourceRoot, "");
2335
+ }
2336
+ return {
2337
+ "import": {
2338
+ "types": `./dist/${entry}.d.ts`,
2339
+ "default": `./dist/${entry}.mjs`
2340
+ },
2341
+ "require": {
2342
+ "types": `./dist/${entry}.d.ts`,
2343
+ "default": `./dist/${entry}.cjs`
2344
+ },
2345
+ "default": {
2346
+ "types": `./dist/${entry}.d.ts`,
2347
+ "default": type === "commonjs" ? `./dist/${entry}.cjs` : `./dist/${entry}.mjs`
2348
+ }
2349
+ };
2350
+ }, "addPackageJsonExport");
2376
2351
  async function generatePackageJson(options) {
2377
2352
  if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkFG6XQ26Mcjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
2378
2353
  _chunkFG6XQ26Mcjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
@@ -2388,7 +2363,32 @@ async function generatePackageJson(options) {
2388
2363
  let packageJson = JSON.parse(packageJsonContent);
2389
2364
  packageJson = await addPackageDependencies(options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
2390
2365
  packageJson = await addWorkspacePackageJsonFields(options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
2391
- await _devkit.writeJsonFile.call(void 0, _chunkFG6XQ26Mcjs.joinPaths.call(void 0, options.outDir, "package.json"), await addPackageJsonExports(options.sourceRoot, packageJson));
2366
+ packageJson.exports ??= {};
2367
+ const files = await new (0, _glob.Glob)("**/*.{ts,tsx}", {
2368
+ absolute: false,
2369
+ cwd: options.sourceRoot,
2370
+ root: options.sourceRoot
2371
+ }).walk();
2372
+ files.forEach((file) => {
2373
+ addPackageJsonExport(file, packageJson.type, options.sourceRoot);
2374
+ const split = file.split(".");
2375
+ split.pop();
2376
+ const entry = split.join(".").replaceAll("\\", "/");
2377
+ packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry, packageJson.type, options.sourceRoot);
2378
+ });
2379
+ packageJson.main ??= "./dist/index.cjs";
2380
+ packageJson.module ??= "./dist/index.mjs";
2381
+ packageJson.types ??= "./dist/index.d.ts";
2382
+ packageJson.exports ??= {};
2383
+ packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
2384
+ if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
2385
+ ret[key.replace("/index", "")] = packageJson.exports[key];
2386
+ }
2387
+ return ret;
2388
+ }, packageJson.exports);
2389
+ packageJson.exports["./package.json"] ??= "./package.json";
2390
+ packageJson.exports["."] ??= addPackageJsonExport("index", packageJson.type, options.sourceRoot);
2391
+ await _devkit.writeJsonFile.call(void 0, _chunkFG6XQ26Mcjs.joinPaths.call(void 0, options.outDir, "package.json"), packageJson);
2392
2392
  stopwatch();
2393
2393
  }
2394
2394
  return options;
@@ -2462,4 +2462,9 @@ _chunkYDYGZTJKcjs.__name.call(void 0, build2, "build");
2462
2462
 
2463
2463
 
2464
2464
 
2465
- exports.build = build2;
2465
+
2466
+
2467
+
2468
+
2469
+
2470
+ exports.resolveOptions = resolveOptions; exports.generatePackageJson = generatePackageJson; exports.executeUnbuild = executeUnbuild; exports.copyBuildAssets = copyBuildAssets; exports.cleanOutputPath = cleanOutputPath; exports.build = build2;
package/dist/index.cjs CHANGED
@@ -1,6 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUECQBDR2cjs = require('./chunk-UECQBDR2.cjs');
3
+
4
+
5
+
6
+
7
+
8
+ var _chunkS2WZ2PGWcjs = require('./chunk-S2WZ2PGW.cjs');
4
9
 
5
10
 
6
11
 
@@ -25,4 +30,9 @@ require('./chunk-YDYGZTJK.cjs');
25
30
 
26
31
 
27
32
 
28
- exports.build = _chunkUECQBDR2cjs.build; exports.clean = _chunk5E3NJ26Lcjs.clean; exports.cleanDirectories = _chunk5E3NJ26Lcjs.cleanDirectories; exports.createTsCompilerOptions = _chunkV627S7QUcjs.createTsCompilerOptions; exports.getDefaultBuildPlugins = _chunkY2DOCJBEcjs.getDefaultBuildPlugins; exports.loadConfig = _chunkV627S7QUcjs.loadConfig;
33
+
34
+
35
+
36
+
37
+
38
+ exports.build = _chunkS2WZ2PGWcjs.build; exports.clean = _chunk5E3NJ26Lcjs.clean; exports.cleanDirectories = _chunk5E3NJ26Lcjs.cleanDirectories; exports.cleanOutputPath = _chunkS2WZ2PGWcjs.cleanOutputPath; exports.copyBuildAssets = _chunkS2WZ2PGWcjs.copyBuildAssets; exports.createTsCompilerOptions = _chunkV627S7QUcjs.createTsCompilerOptions; exports.executeUnbuild = _chunkS2WZ2PGWcjs.executeUnbuild; exports.generatePackageJson = _chunkS2WZ2PGWcjs.generatePackageJson; exports.getDefaultBuildPlugins = _chunkY2DOCJBEcjs.getDefaultBuildPlugins; exports.loadConfig = _chunkV627S7QUcjs.loadConfig; exports.resolveOptions = _chunkS2WZ2PGWcjs.resolveOptions;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { build } from './build.cjs';
1
+ export { build, cleanOutputPath, copyBuildAssets, executeUnbuild, generatePackageJson, resolveOptions } from './build.cjs';
2
2
  export { clean, cleanDirectories } from './clean.cjs';
3
3
  export { getDefaultBuildPlugins } from './config.cjs';
4
4
  export { DeepPartial, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions } from './types.cjs';
@@ -6,6 +6,7 @@ import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-u
6
6
  import { StormConfig } from '@storm-software/config';
7
7
  import ts from 'typescript';
8
8
  import { RollupBuildOptions } from 'unbuild';
9
+ import '@storm-software/config/types';
9
10
  import 'rollup';
10
11
  import '@storm-software/build-tools';
11
12
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { build } from './build.js';
1
+ export { build, cleanOutputPath, copyBuildAssets, executeUnbuild, generatePackageJson, resolveOptions } from './build.js';
2
2
  export { clean, cleanDirectories } from './clean.js';
3
3
  export { getDefaultBuildPlugins } from './config.js';
4
4
  export { DeepPartial, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions } from './types.js';
@@ -6,6 +6,7 @@ import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-u
6
6
  import { StormConfig } from '@storm-software/config';
7
7
  import ts from 'typescript';
8
8
  import { RollupBuildOptions } from 'unbuild';
9
+ import '@storm-software/config/types';
9
10
  import 'rollup';
10
11
  import '@storm-software/build-tools';
11
12
 
package/dist/index.js CHANGED
@@ -1,6 +1,11 @@
1
1
  import {
2
- build
3
- } from "./chunk-G4U2DNFU.js";
2
+ build,
3
+ cleanOutputPath,
4
+ copyBuildAssets,
5
+ executeUnbuild,
6
+ generatePackageJson,
7
+ resolveOptions
8
+ } from "./chunk-54R2TCTI.js";
4
9
  import {
5
10
  clean,
6
11
  cleanDirectories
@@ -22,7 +27,12 @@ export {
22
27
  build,
23
28
  clean,
24
29
  cleanDirectories,
30
+ cleanOutputPath,
31
+ copyBuildAssets,
25
32
  createTsCompilerOptions,
33
+ executeUnbuild,
34
+ generatePackageJson,
26
35
  getDefaultBuildPlugins,
27
- loadConfig
36
+ loadConfig,
37
+ resolveOptions
28
38
  };
package/dist/types.d.cts CHANGED
@@ -5,6 +5,12 @@ type DeepPartial<T> = T extends object ? {
5
5
  [P in keyof T]?: DeepPartial<T[P]>;
6
6
  } : T;
7
7
  type UnbuildOptions = Omit<TypeScriptBuildOptions, "entry" | "format"> & Omit<BuildOptions, "entries" | "rootDir" | "externals" | "rollupConfig" | "outDir" | "declaration" | "format" | "parallel"> & {
8
+ /**
9
+ * The directories to run the build process out of
10
+ *
11
+ * @defaultValue ["{sourceRoot}"]
12
+ */
13
+ entry?: string[];
8
14
  /**
9
15
  * Path to a rollup configuration file relative to the project root
10
16
  */
package/dist/types.d.ts CHANGED
@@ -5,6 +5,12 @@ type DeepPartial<T> = T extends object ? {
5
5
  [P in keyof T]?: DeepPartial<T[P]>;
6
6
  } : T;
7
7
  type UnbuildOptions = Omit<TypeScriptBuildOptions, "entry" | "format"> & Omit<BuildOptions, "entries" | "rootDir" | "externals" | "rollupConfig" | "outDir" | "declaration" | "format" | "parallel"> & {
8
+ /**
9
+ * The directories to run the build process out of
10
+ *
11
+ * @defaultValue ["{sourceRoot}"]
12
+ */
13
+ entry?: string[];
8
14
  /**
9
15
  * Path to a rollup configuration file relative to the project root
10
16
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/unbuild",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "type": "module",
5
5
  "description": "A package containing `unbuild` utilities for building Storm Software libraries and applications",
6
6
  "repository": {
@@ -161,6 +161,7 @@
161
161
  "@rollup/plugin-node-resolve": "^16.0.0",
162
162
  "@rollup/plugin-replace": "^6.0.2",
163
163
  "defu": "6.1.4",
164
+ "glob": "^11.0.1",
164
165
  "jiti": "^2.4.2",
165
166
  "rollup": "^4.29.1",
166
167
  "rollup-plugin-typescript2": "0.36.0",
@@ -170,7 +171,7 @@
170
171
  "@nx/devkit": "^20.3.1",
171
172
  "@nx/js": "^20.3.1",
172
173
  "@rollup/pluginutils": "^5.1.4",
173
- "@storm-software/build-tools": "0.132.0",
174
+ "@storm-software/build-tools": "0.133.0",
174
175
  "@storm-software/config": "1.97.4",
175
176
  "@storm-software/config-tools": "1.140.0",
176
177
  "@swc/core": "1.7.26",