@storm-software/tsdown 0.43.11 → 0.44.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.43.8-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.43.11-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/tsdown.cjs CHANGED
@@ -132811,6 +132811,76 @@ var import_get_config = require("@storm-software/config-tools/get-config");
132811
132811
  var import_console2 = require("@storm-software/config-tools/logger/console");
132812
132812
  var import_correct_paths = require("@storm-software/config-tools/utilities/correct-paths");
132813
132813
  var import_find_workspace_root = require("@storm-software/config-tools/utilities/find-workspace-root");
132814
+
132815
+ // ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
132816
+ function isPlainObject(value) {
132817
+ if (value === null || typeof value !== "object") {
132818
+ return false;
132819
+ }
132820
+ const prototype = Object.getPrototypeOf(value);
132821
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
132822
+ return false;
132823
+ }
132824
+ if (Symbol.iterator in value) {
132825
+ return false;
132826
+ }
132827
+ if (Symbol.toStringTag in value) {
132828
+ return Object.prototype.toString.call(value) === "[object Module]";
132829
+ }
132830
+ return true;
132831
+ }
132832
+ function _defu(baseObject, defaults, namespace = ".", merger) {
132833
+ if (!isPlainObject(defaults)) {
132834
+ return _defu(baseObject, {}, namespace, merger);
132835
+ }
132836
+ const object = Object.assign({}, defaults);
132837
+ for (const key2 in baseObject) {
132838
+ if (key2 === "__proto__" || key2 === "constructor") {
132839
+ continue;
132840
+ }
132841
+ const value = baseObject[key2];
132842
+ if (value === null || value === void 0) {
132843
+ continue;
132844
+ }
132845
+ if (merger && merger(object, key2, value, namespace)) {
132846
+ continue;
132847
+ }
132848
+ if (Array.isArray(value) && Array.isArray(object[key2])) {
132849
+ object[key2] = [...value, ...object[key2]];
132850
+ } else if (isPlainObject(value) && isPlainObject(object[key2])) {
132851
+ object[key2] = _defu(
132852
+ value,
132853
+ object[key2],
132854
+ (namespace ? `${namespace}.` : "") + key2.toString(),
132855
+ merger
132856
+ );
132857
+ } else {
132858
+ object[key2] = value;
132859
+ }
132860
+ }
132861
+ return object;
132862
+ }
132863
+ function createDefu(merger) {
132864
+ return (...arguments_) => (
132865
+ // eslint-disable-next-line unicorn/no-array-reduce
132866
+ arguments_.reduce((p5, c5) => _defu(p5, c5, "", merger), {})
132867
+ );
132868
+ }
132869
+ var defu = createDefu();
132870
+ var defuFn = createDefu((object, key2, currentValue) => {
132871
+ if (object[key2] !== void 0 && typeof currentValue === "function") {
132872
+ object[key2] = currentValue(object[key2]);
132873
+ return true;
132874
+ }
132875
+ });
132876
+ var defuArrayFn = createDefu((object, key2, currentValue) => {
132877
+ if (Array.isArray(object[key2]) && typeof currentValue === "function") {
132878
+ object[key2] = currentValue(object[key2]);
132879
+ return true;
132880
+ }
132881
+ });
132882
+
132883
+ // src/build.ts
132814
132884
  var import_node_fs = require("fs");
132815
132885
  var import_promises3 = __toESM(require("fs/promises"), 1);
132816
132886
  var import_tsdown = require("tsdown");
@@ -132845,6 +132915,16 @@ function getDefaultOptions(config) {
132845
132915
  ...config
132846
132916
  };
132847
132917
  }
132918
+ function toTSDownFormat(format5) {
132919
+ if (!format5 || Array.isArray(format5) && format5.length === 0) {
132920
+ return ["cjs", "es"];
132921
+ } else if (format5 === "esm") {
132922
+ return "es";
132923
+ } else if (Array.isArray(format5)) {
132924
+ return format5.map((f5) => f5 === "esm" ? "es" : f5);
132925
+ }
132926
+ return format5;
132927
+ }
132848
132928
 
132849
132929
  // src/build.ts
132850
132930
  var resolveOptions = async (userOptions) => {
@@ -132897,28 +132977,34 @@ var resolveOptions = async (userOptions) => {
132897
132977
  minify: !debug,
132898
132978
  plugins: [],
132899
132979
  assets: [],
132980
+ dts: true,
132981
+ shims: true,
132982
+ silent: !debug,
132983
+ logLevel: workspaceConfig.logLevel === "success" || workspaceConfig.logLevel === "debug" || workspaceConfig.logLevel === "trace" || workspaceConfig.logLevel === "all" ? "info" : workspaceConfig.logLevel === "fatal" ? "error" : workspaceConfig.logLevel,
132984
+ sourcemap: debug ? "inline" : false,
132985
+ clean: false,
132986
+ fixedExtension: true,
132987
+ nodeProtocol: true,
132988
+ tsconfig: (0, import_correct_paths.joinPaths)(options8.projectRoot, "tsconfig.json"),
132989
+ debug,
132900
132990
  sourceRoot,
132991
+ cwd: workspaceConfig.workspaceRoot,
132901
132992
  entry: {
132902
132993
  ["index"]: (0, import_correct_paths.joinPaths)(sourceRoot, "index.ts")
132903
132994
  },
132995
+ workspace: true,
132904
132996
  ...options8,
132997
+ treeshake: options8.treeShaking !== false,
132998
+ format: toTSDownFormat(options8.format),
132905
132999
  workspaceConfig,
132906
133000
  projectName,
132907
133001
  projectGraph,
132908
133002
  projectConfigurations
132909
133003
  };
132910
- const env = (0, import_build_tools.getEnv)("tsdown", {});
132911
- result.define = {
132912
- ...Object.keys(env || {}).reduce((res, key2) => {
132913
- const value = JSON.stringify(env[key2]);
132914
- return {
132915
- ...res,
132916
- [`process.env.${key2}`]: value,
132917
- [`import.meta.env.${key2}`]: value
132918
- };
132919
- }, {}),
132920
- ...options8.define ?? {}
132921
- };
133004
+ result.env = defu(
133005
+ options8.env,
133006
+ (0, import_build_tools.getEnv)("tsdown", result)
133007
+ );
132922
133008
  stopwatch();
132923
133009
  return result;
132924
133010
  };
@@ -132976,14 +133062,14 @@ async function generatePackageJson(options8) {
132976
133062
  const entry2 = split.join(".").replaceAll("\\", "/");
132977
133063
  packageJson.exports[`./${entry2}`] ??= (0, import_build_tools.addPackageJsonExport)(
132978
133064
  entry2,
132979
- packageJson.type,
133065
+ options8.fixedExtension ? "fixed" : packageJson.type,
132980
133066
  options8.sourceRoot
132981
133067
  );
132982
133068
  }
132983
133069
  }
132984
- packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
132985
- packageJson.module = packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
132986
- packageJson.types = "./dist/index.d.ts";
133070
+ packageJson.main = !options8.fixedExtension && packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
133071
+ packageJson.module = !options8.fixedExtension && packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
133072
+ packageJson.types = `./dist/index.d.${!options8.fixedExtension ? "ts" : "mts"}`;
132987
133073
  packageJson.exports = Object.keys(packageJson.exports).reduce(
132988
133074
  (ret, key2) => {
132989
133075
  if (key2.endsWith("/index") && !ret[key2.replace("/index", "")]) {
package/dist/build.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkI2OP3V7Ucjs = require('./chunk-I2OP3V7U.cjs');
4
+ var _chunkQZQGRRQScjs = require('./chunk-QZQGRRQS.cjs');
5
5
  require('./chunk-FCM7E2H2.cjs');
6
- require('./chunk-OAWZIGP6.cjs');
6
+ require('./chunk-DPNREUD4.cjs');
7
7
 
8
8
 
9
9
 
10
- exports.build = _chunkI2OP3V7Ucjs.build; exports.cleanOutputPath = _chunkI2OP3V7Ucjs.cleanOutputPath;
10
+ exports.build = _chunkQZQGRRQScjs.build; exports.cleanOutputPath = _chunkQZQGRRQScjs.cleanOutputPath;
package/dist/build.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  build,
3
3
  cleanOutputPath
4
- } from "./chunk-2C7TNDG3.js";
4
+ } from "./chunk-EUFVDDAJ.js";
5
5
  import "./chunk-ZHFSQ65J.js";
6
- import "./chunk-43SSFYCV.js";
6
+ import "./chunk-BMIIFT6J.js";
7
7
  export {
8
8
  build,
9
9
  cleanOutputPath
@@ -0,0 +1,32 @@
1
+ // src/config.ts
2
+ function getDefaultOptions(config) {
3
+ return {
4
+ entry: ["./src/*.ts"],
5
+ platform: "node",
6
+ target: "esnext",
7
+ mode: "production",
8
+ dts: true,
9
+ unused: {
10
+ level: "error",
11
+ ignore: ["typescript"]
12
+ },
13
+ publint: true,
14
+ fixedExtension: true,
15
+ ...config
16
+ };
17
+ }
18
+ function toTSDownFormat(format) {
19
+ if (!format || Array.isArray(format) && format.length === 0) {
20
+ return ["cjs", "es"];
21
+ } else if (format === "esm") {
22
+ return "es";
23
+ } else if (Array.isArray(format)) {
24
+ return format.map((f) => f === "esm" ? "es" : f);
25
+ }
26
+ return format;
27
+ }
28
+
29
+ export {
30
+ getDefaultOptions,
31
+ toTSDownFormat
32
+ };
@@ -15,7 +15,18 @@ function getDefaultOptions(config) {
15
15
  ...config
16
16
  };
17
17
  }
18
+ function toTSDownFormat(format) {
19
+ if (!format || Array.isArray(format) && format.length === 0) {
20
+ return ["cjs", "es"];
21
+ } else if (format === "esm") {
22
+ return "es";
23
+ } else if (Array.isArray(format)) {
24
+ return format.map((f) => f === "esm" ? "es" : f);
25
+ }
26
+ return format;
27
+ }
28
+
18
29
 
19
30
 
20
31
 
21
- exports.getDefaultOptions = getDefaultOptions;
32
+ exports.getDefaultOptions = getDefaultOptions; exports.toTSDownFormat = toTSDownFormat;
@@ -12,8 +12,9 @@ import {
12
12
  writeWarning
13
13
  } from "./chunk-ZHFSQ65J.js";
14
14
  import {
15
- getDefaultOptions
16
- } from "./chunk-43SSFYCV.js";
15
+ getDefaultOptions,
16
+ toTSDownFormat
17
+ } from "./chunk-BMIIFT6J.js";
17
18
 
18
19
  // src/build.ts
19
20
  import {
@@ -501,8 +502,8 @@ var addPackageJsonExport = (file, type = "module", sourceRoot) => {
501
502
  default: `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
502
503
  },
503
504
  default: {
504
- types: `./dist/${entry}.d.ts`,
505
- default: `./dist/${entry}.js`
505
+ types: `./dist/${entry}.d.${type !== "fixed" ? "ts" : "mts"}`,
506
+ default: `./dist/${entry}.${type !== "fixed" ? "js" : "mjs"}`
506
507
  }
507
508
  };
508
509
  };
@@ -1985,6 +1986,7 @@ import {
1985
1986
  } from "nx/src/tasks-runner/create-task-graph";
1986
1987
 
1987
1988
  // src/build.ts
1989
+ import defu3 from "defu";
1988
1990
  import { existsSync as existsSync6 } from "node:fs";
1989
1991
  import hf from "node:fs/promises";
1990
1992
  import { build as tsdown } from "tsdown";
@@ -2038,28 +2040,34 @@ var resolveOptions = async (userOptions) => {
2038
2040
  minify: !debug,
2039
2041
  plugins: [],
2040
2042
  assets: [],
2043
+ dts: true,
2044
+ shims: true,
2045
+ silent: !debug,
2046
+ logLevel: workspaceConfig.logLevel === "success" || workspaceConfig.logLevel === "debug" || workspaceConfig.logLevel === "trace" || workspaceConfig.logLevel === "all" ? "info" : workspaceConfig.logLevel === "fatal" ? "error" : workspaceConfig.logLevel,
2047
+ sourcemap: debug ? "inline" : false,
2048
+ clean: false,
2049
+ fixedExtension: true,
2050
+ nodeProtocol: true,
2051
+ tsconfig: joinPaths(options.projectRoot, "tsconfig.json"),
2052
+ debug,
2041
2053
  sourceRoot,
2054
+ cwd: workspaceConfig.workspaceRoot,
2042
2055
  entry: {
2043
2056
  ["index"]: joinPaths(sourceRoot, "index.ts")
2044
2057
  },
2058
+ workspace: true,
2045
2059
  ...options,
2060
+ treeshake: options.treeShaking !== false,
2061
+ format: toTSDownFormat(options.format),
2046
2062
  workspaceConfig,
2047
2063
  projectName,
2048
2064
  projectGraph,
2049
2065
  projectConfigurations
2050
2066
  };
2051
- const env = getEnv("tsdown", {});
2052
- result.define = {
2053
- ...Object.keys(env || {}).reduce((res, key) => {
2054
- const value = JSON.stringify(env[key]);
2055
- return {
2056
- ...res,
2057
- [`process.env.${key}`]: value,
2058
- [`import.meta.env.${key}`]: value
2059
- };
2060
- }, {}),
2061
- ...options.define ?? {}
2062
- };
2067
+ result.env = defu3(
2068
+ options.env,
2069
+ getEnv("tsdown", result)
2070
+ );
2063
2071
  stopwatch();
2064
2072
  return result;
2065
2073
  };
@@ -2117,14 +2125,14 @@ async function generatePackageJson(options) {
2117
2125
  const entry2 = split.join(".").replaceAll("\\", "/");
2118
2126
  packageJson.exports[`./${entry2}`] ??= addPackageJsonExport(
2119
2127
  entry2,
2120
- packageJson.type,
2128
+ options.fixedExtension ? "fixed" : packageJson.type,
2121
2129
  options.sourceRoot
2122
2130
  );
2123
2131
  }
2124
2132
  }
2125
- packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
2126
- packageJson.module = packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
2127
- packageJson.types = "./dist/index.d.ts";
2133
+ packageJson.main = !options.fixedExtension && packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
2134
+ packageJson.module = !options.fixedExtension && packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
2135
+ packageJson.types = `./dist/index.d.${!options.fixedExtension ? "ts" : "mts"}`;
2128
2136
  packageJson.exports = Object.keys(packageJson.exports).reduce(
2129
2137
  (ret, key) => {
2130
2138
  if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
@@ -13,7 +13,8 @@
13
13
  var _chunkFCM7E2H2cjs = require('./chunk-FCM7E2H2.cjs');
14
14
 
15
15
 
16
- var _chunkOAWZIGP6cjs = require('./chunk-OAWZIGP6.cjs');
16
+
17
+ var _chunkDPNREUD4cjs = require('./chunk-DPNREUD4.cjs');
17
18
 
18
19
  // src/build.ts
19
20
 
@@ -501,8 +502,8 @@ var addPackageJsonExport = (file, type = "module", sourceRoot) => {
501
502
  default: `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
502
503
  },
503
504
  default: {
504
- types: `./dist/${entry}.d.ts`,
505
- default: `./dist/${entry}.js`
505
+ types: `./dist/${entry}.d.${type !== "fixed" ? "ts" : "mts"}`,
506
+ default: `./dist/${entry}.${type !== "fixed" ? "js" : "mjs"}`
506
507
  }
507
508
  };
508
509
  };
@@ -1987,9 +1988,10 @@ var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
1987
1988
  // src/build.ts
1988
1989
 
1989
1990
 
1991
+
1990
1992
  var _tsdown = require('tsdown');
1991
1993
  var resolveOptions = async (userOptions) => {
1992
- const options = _chunkOAWZIGP6cjs.getDefaultOptions.call(void 0, userOptions);
1994
+ const options = _chunkDPNREUD4cjs.getDefaultOptions.call(void 0, userOptions);
1993
1995
  const workspaceRoot = findWorkspaceRoot(options.projectRoot);
1994
1996
  if (!workspaceRoot) {
1995
1997
  throw new Error("Cannot find Nx workspace root");
@@ -2038,28 +2040,34 @@ var resolveOptions = async (userOptions) => {
2038
2040
  minify: !debug,
2039
2041
  plugins: [],
2040
2042
  assets: [],
2043
+ dts: true,
2044
+ shims: true,
2045
+ silent: !debug,
2046
+ logLevel: workspaceConfig.logLevel === "success" || workspaceConfig.logLevel === "debug" || workspaceConfig.logLevel === "trace" || workspaceConfig.logLevel === "all" ? "info" : workspaceConfig.logLevel === "fatal" ? "error" : workspaceConfig.logLevel,
2047
+ sourcemap: debug ? "inline" : false,
2048
+ clean: false,
2049
+ fixedExtension: true,
2050
+ nodeProtocol: true,
2051
+ tsconfig: joinPaths(options.projectRoot, "tsconfig.json"),
2052
+ debug,
2041
2053
  sourceRoot,
2054
+ cwd: workspaceConfig.workspaceRoot,
2042
2055
  entry: {
2043
2056
  ["index"]: joinPaths(sourceRoot, "index.ts")
2044
2057
  },
2058
+ workspace: true,
2045
2059
  ...options,
2060
+ treeshake: options.treeShaking !== false,
2061
+ format: _chunkDPNREUD4cjs.toTSDownFormat.call(void 0, options.format),
2046
2062
  workspaceConfig,
2047
2063
  projectName,
2048
2064
  projectGraph,
2049
2065
  projectConfigurations
2050
2066
  };
2051
- const env = getEnv("tsdown", {});
2052
- result.define = {
2053
- ...Object.keys(env || {}).reduce((res, key) => {
2054
- const value = JSON.stringify(env[key]);
2055
- return {
2056
- ...res,
2057
- [`process.env.${key}`]: value,
2058
- [`import.meta.env.${key}`]: value
2059
- };
2060
- }, {}),
2061
- ..._nullishCoalesce(options.define, () => ( {}))
2062
- };
2067
+ result.env = _defu2.default.call(void 0,
2068
+ options.env,
2069
+ getEnv("tsdown", result)
2070
+ );
2063
2071
  stopwatch();
2064
2072
  return result;
2065
2073
  };
@@ -2117,14 +2125,14 @@ async function generatePackageJson(options) {
2117
2125
  const entry2 = split.join(".").replaceAll("\\", "/");
2118
2126
  packageJson.exports[`./${entry2}`] ??= addPackageJsonExport(
2119
2127
  entry2,
2120
- packageJson.type,
2128
+ options.fixedExtension ? "fixed" : packageJson.type,
2121
2129
  options.sourceRoot
2122
2130
  );
2123
2131
  }
2124
2132
  }
2125
- packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
2126
- packageJson.module = packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
2127
- packageJson.types = "./dist/index.d.ts";
2133
+ packageJson.main = !options.fixedExtension && packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
2134
+ packageJson.module = !options.fixedExtension && packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
2135
+ packageJson.types = `./dist/index.d.${!options.fixedExtension ? "ts" : "mts"}`;
2128
2136
  packageJson.exports = Object.keys(packageJson.exports).reduce(
2129
2137
  (ret, key) => {
2130
2138
  if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
package/dist/config.cjs CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkOAWZIGP6cjs = require('./chunk-OAWZIGP6.cjs');
4
3
 
4
+ var _chunkDPNREUD4cjs = require('./chunk-DPNREUD4.cjs');
5
5
 
6
- exports.getDefaultOptions = _chunkOAWZIGP6cjs.getDefaultOptions;
6
+
7
+
8
+ exports.getDefaultOptions = _chunkDPNREUD4cjs.getDefaultOptions; exports.toTSDownFormat = _chunkDPNREUD4cjs.toTSDownFormat;
package/dist/config.d.cts CHANGED
@@ -1,9 +1,16 @@
1
- import { TSDownOptions } from './types.cjs';
1
+ import { TSDownOptions, TSDownResolvedOptions } from './types.cjs';
2
2
  import '@nx/devkit';
3
3
  import '@storm-software/build-tools';
4
4
  import '@storm-software/config/types';
5
5
  import 'tsdown';
6
6
 
7
7
  declare function getDefaultOptions(config: Partial<TSDownOptions> & Pick<TSDownOptions, "projectRoot">): TSDownOptions;
8
+ /**
9
+ * Convert the format option to the format used by TSDown
10
+ *
11
+ * @param format - The format option provided by the user
12
+ * @returns The format used by TSDown
13
+ */
14
+ declare function toTSDownFormat(format: TSDownOptions["format"]): TSDownResolvedOptions["format"];
8
15
 
9
- export { getDefaultOptions };
16
+ export { getDefaultOptions, toTSDownFormat };
package/dist/config.d.ts CHANGED
@@ -1,9 +1,16 @@
1
- import { TSDownOptions } from './types.js';
1
+ import { TSDownOptions, TSDownResolvedOptions } from './types.js';
2
2
  import '@nx/devkit';
3
3
  import '@storm-software/build-tools';
4
4
  import '@storm-software/config/types';
5
5
  import 'tsdown';
6
6
 
7
7
  declare function getDefaultOptions(config: Partial<TSDownOptions> & Pick<TSDownOptions, "projectRoot">): TSDownOptions;
8
+ /**
9
+ * Convert the format option to the format used by TSDown
10
+ *
11
+ * @param format - The format option provided by the user
12
+ * @returns The format used by TSDown
13
+ */
14
+ declare function toTSDownFormat(format: TSDownOptions["format"]): TSDownResolvedOptions["format"];
8
15
 
9
- export { getDefaultOptions };
16
+ export { getDefaultOptions, toTSDownFormat };
package/dist/config.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import {
2
- getDefaultOptions
3
- } from "./chunk-43SSFYCV.js";
2
+ getDefaultOptions,
3
+ toTSDownFormat
4
+ } from "./chunk-BMIIFT6J.js";
4
5
  export {
5
- getDefaultOptions
6
+ getDefaultOptions,
7
+ toTSDownFormat
6
8
  };
package/dist/index.cjs CHANGED
@@ -1,14 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkI2OP3V7Ucjs = require('./chunk-I2OP3V7U.cjs');
4
+ var _chunkQZQGRRQScjs = require('./chunk-QZQGRRQS.cjs');
5
5
 
6
6
 
7
7
 
8
8
  var _chunkFCM7E2H2cjs = require('./chunk-FCM7E2H2.cjs');
9
9
 
10
10
 
11
- var _chunkOAWZIGP6cjs = require('./chunk-OAWZIGP6.cjs');
11
+
12
+ var _chunkDPNREUD4cjs = require('./chunk-DPNREUD4.cjs');
12
13
  require('./chunk-ZBPRDZS4.cjs');
13
14
 
14
15
 
@@ -16,4 +17,5 @@ require('./chunk-ZBPRDZS4.cjs');
16
17
 
17
18
 
18
19
 
19
- exports.build = _chunkI2OP3V7Ucjs.build; exports.clean = _chunkFCM7E2H2cjs.clean; exports.cleanDirectories = _chunkFCM7E2H2cjs.cleanDirectories; exports.cleanOutputPath = _chunkI2OP3V7Ucjs.cleanOutputPath; exports.getDefaultOptions = _chunkOAWZIGP6cjs.getDefaultOptions;
20
+
21
+ exports.build = _chunkQZQGRRQScjs.build; exports.clean = _chunkFCM7E2H2cjs.clean; exports.cleanDirectories = _chunkFCM7E2H2cjs.cleanDirectories; exports.cleanOutputPath = _chunkQZQGRRQScjs.cleanOutputPath; exports.getDefaultOptions = _chunkDPNREUD4cjs.getDefaultOptions; exports.toTSDownFormat = _chunkDPNREUD4cjs.toTSDownFormat;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { build, cleanOutputPath } from './build.cjs';
2
2
  export { clean, cleanDirectories } from './clean.cjs';
3
- export { getDefaultOptions } from './config.cjs';
3
+ export { getDefaultOptions, toTSDownFormat } from './config.cjs';
4
4
  export { MaybePromise, TSDownOptions, TSDownResolvedOptions } from './types.cjs';
5
5
  import '@storm-software/config';
6
6
  import '@nx/devkit';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { build, cleanOutputPath } from './build.js';
2
2
  export { clean, cleanDirectories } from './clean.js';
3
- export { getDefaultOptions } from './config.js';
3
+ export { getDefaultOptions, toTSDownFormat } from './config.js';
4
4
  export { MaybePromise, TSDownOptions, TSDownResolvedOptions } from './types.js';
5
5
  import '@storm-software/config';
6
6
  import '@nx/devkit';
package/dist/index.js CHANGED
@@ -1,19 +1,21 @@
1
1
  import {
2
2
  build,
3
3
  cleanOutputPath
4
- } from "./chunk-2C7TNDG3.js";
4
+ } from "./chunk-EUFVDDAJ.js";
5
5
  import {
6
6
  clean,
7
7
  cleanDirectories
8
8
  } from "./chunk-ZHFSQ65J.js";
9
9
  import {
10
- getDefaultOptions
11
- } from "./chunk-43SSFYCV.js";
10
+ getDefaultOptions,
11
+ toTSDownFormat
12
+ } from "./chunk-BMIIFT6J.js";
12
13
  import "./chunk-6F4PWJZI.js";
13
14
  export {
14
15
  build,
15
16
  clean,
16
17
  cleanDirectories,
17
18
  cleanOutputPath,
18
- getDefaultOptions
19
+ getDefaultOptions,
20
+ toTSDownFormat
19
21
  };
package/dist/types.d.cts CHANGED
@@ -4,12 +4,12 @@ import { StormWorkspaceConfig } from '@storm-software/config/types';
4
4
  import { Options } from 'tsdown';
5
5
 
6
6
  type ExternalTSDownOptions = Omit<Options, "treeshake" | "outDir" | "external">;
7
- type TSDownOptions = ExternalTSDownOptions & Partial<Pick<TypeScriptBuildOptions, "name" | "mode" | "outputPath" | "assets" | "treeShaking" | "sourceRoot" | "debug" | "generatePackageJson">> & Required<Pick<TypeScriptBuildOptions, "projectRoot">> & {
7
+ type TSDownOptions = ExternalTSDownOptions & Partial<Pick<TypeScriptBuildOptions, "name" | "mode" | "outputPath" | "assets" | "format" | "treeShaking" | "sourceRoot" | "debug" | "generatePackageJson">> & Required<Pick<TypeScriptBuildOptions, "projectRoot">> & {
8
8
  external?: string | RegExp | Array<string | RegExp>;
9
9
  noExternal?: string | RegExp | Array<string | RegExp>;
10
10
  distDir?: string;
11
11
  };
12
- type TSDownResolvedOptions = Options & Required<Pick<Options, "entry" | "outDir">> & Required<Pick<TSDownOptions, "name" | "mode" | "projectRoot" | "sourceRoot" | "assets" | "generatePackageJson">> & {
12
+ type TSDownResolvedOptions = Options & Required<Pick<Options, "entry" | "outDir" | "format">> & Required<Pick<TSDownOptions, "name" | "mode" | "projectRoot" | "sourceRoot" | "assets" | "generatePackageJson">> & {
13
13
  workspaceConfig: StormWorkspaceConfig;
14
14
  projectName: string;
15
15
  projectGraph?: ProjectGraph;
package/dist/types.d.ts CHANGED
@@ -4,12 +4,12 @@ import { StormWorkspaceConfig } from '@storm-software/config/types';
4
4
  import { Options } from 'tsdown';
5
5
 
6
6
  type ExternalTSDownOptions = Omit<Options, "treeshake" | "outDir" | "external">;
7
- type TSDownOptions = ExternalTSDownOptions & Partial<Pick<TypeScriptBuildOptions, "name" | "mode" | "outputPath" | "assets" | "treeShaking" | "sourceRoot" | "debug" | "generatePackageJson">> & Required<Pick<TypeScriptBuildOptions, "projectRoot">> & {
7
+ type TSDownOptions = ExternalTSDownOptions & Partial<Pick<TypeScriptBuildOptions, "name" | "mode" | "outputPath" | "assets" | "format" | "treeShaking" | "sourceRoot" | "debug" | "generatePackageJson">> & Required<Pick<TypeScriptBuildOptions, "projectRoot">> & {
8
8
  external?: string | RegExp | Array<string | RegExp>;
9
9
  noExternal?: string | RegExp | Array<string | RegExp>;
10
10
  distDir?: string;
11
11
  };
12
- type TSDownResolvedOptions = Options & Required<Pick<Options, "entry" | "outDir">> & Required<Pick<TSDownOptions, "name" | "mode" | "projectRoot" | "sourceRoot" | "assets" | "generatePackageJson">> & {
12
+ type TSDownResolvedOptions = Options & Required<Pick<Options, "entry" | "outDir" | "format">> & Required<Pick<TSDownOptions, "name" | "mode" | "projectRoot" | "sourceRoot" | "assets" | "generatePackageJson">> & {
13
13
  workspaceConfig: StormWorkspaceConfig;
14
14
  projectName: string;
15
15
  projectGraph?: ProjectGraph;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/tsdown",
3
- "version": "0.43.11",
3
+ "version": "0.44.0",
4
4
  "type": "module",
5
5
  "description": "A package containing `tsdown` utilities for building Storm Software libraries and applications",
6
6
  "repository": {
@@ -146,9 +146,9 @@
146
146
  "tsdown": { "optional": false }
147
147
  },
148
148
  "dependencies": {
149
- "@storm-software/build-tools": "^0.156.6",
150
- "@storm-software/config": "^1.133.2",
151
- "@storm-software/config-tools": "^1.187.5",
149
+ "@storm-software/build-tools": "^0.157.0",
150
+ "@storm-software/config": "^1.133.3",
151
+ "@storm-software/config-tools": "^1.187.7",
152
152
  "chokidar": "^4.0.3",
153
153
  "commander": "^12.1.0",
154
154
  "es-toolkit": "^1.39.10",
@@ -171,5 +171,5 @@
171
171
  },
172
172
  "publishConfig": { "access": "public" },
173
173
  "sideEffects": false,
174
- "gitHead": "0112f197ad21b1304edb4f3710640fb339ca07d1"
174
+ "gitHead": "a98883ba549e6a12ff4d6a2b15a22a65649c4600"
175
175
  }
@@ -1,21 +0,0 @@
1
- // src/config.ts
2
- function getDefaultOptions(config) {
3
- return {
4
- entry: ["./src/*.ts"],
5
- platform: "node",
6
- target: "esnext",
7
- mode: "production",
8
- dts: true,
9
- unused: {
10
- level: "error",
11
- ignore: ["typescript"]
12
- },
13
- publint: true,
14
- fixedExtension: true,
15
- ...config
16
- };
17
- }
18
-
19
- export {
20
- getDefaultOptions
21
- };