@powerlines/plugin-tsdown 0.1.206 → 0.1.208

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  2. package/dist/helpers/format-package-json.cjs +18 -2
  3. package/dist/helpers/format-package-json.d.cts +1 -1
  4. package/dist/helpers/format-package-json.d.mts +1 -1
  5. package/dist/helpers/format-package-json.mjs +18 -2
  6. package/dist/helpers/format-package-json.mjs.map +1 -0
  7. package/dist/helpers/index.cjs +2 -3
  8. package/dist/helpers/index.d.cts +1 -3
  9. package/dist/helpers/index.d.mts +1 -3
  10. package/dist/helpers/index.mjs +1 -2
  11. package/dist/helpers/unplugin.cjs +10 -2
  12. package/dist/helpers/unplugin.d.cts +8 -3
  13. package/dist/helpers/unplugin.d.cts.map +1 -0
  14. package/dist/helpers/unplugin.d.mts +8 -3
  15. package/dist/helpers/unplugin.d.mts.map +1 -0
  16. package/dist/helpers/unplugin.mjs +10 -2
  17. package/dist/helpers/unplugin.mjs.map +1 -0
  18. package/dist/index.cjs +8 -37
  19. package/dist/index.d.cts +4 -4
  20. package/dist/index.d.mts +4 -4
  21. package/dist/index.mjs +3 -5
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-type.cjs +28 -0
  24. package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs +29 -0
  25. package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs.map +1 -0
  26. package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.cjs +122 -0
  27. package/dist/{format-package-json-DrnPQ10f.mjs → node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs} +5 -134
  28. package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs.map +1 -0
  29. package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/regex.cjs +12 -0
  30. package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/regex.mjs +9 -0
  31. package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/regex.mjs.map +1 -0
  32. package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/slash.cjs +15 -0
  33. package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/slash.mjs +15 -0
  34. package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/slash.mjs.map +1 -0
  35. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-empty.cjs +20 -0
  36. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-empty.mjs +21 -0
  37. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-empty.mjs.map +1 -0
  38. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-null.cjs +12 -0
  39. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-null.mjs +12 -0
  40. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-null.mjs.map +1 -0
  41. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-string.cjs +20 -0
  42. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-string.mjs +21 -0
  43. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-string.mjs.map +1 -0
  44. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set.cjs +19 -0
  45. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set.mjs +20 -0
  46. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set.mjs.map +1 -0
  47. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-string.cjs +12 -0
  48. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-string.mjs +12 -0
  49. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-string.mjs.map +1 -0
  50. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-undefined.cjs +8 -0
  51. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-undefined.mjs +8 -0
  52. package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-undefined.mjs.map +1 -0
  53. package/dist/types/index.cjs +0 -2
  54. package/dist/types/index.d.cts +1 -2
  55. package/dist/types/index.d.mts +1 -2
  56. package/dist/types/index.mjs +0 -3
  57. package/dist/types/plugin.cjs +0 -1
  58. package/dist/types/plugin.d.cts +17 -2
  59. package/dist/types/plugin.d.cts.map +1 -0
  60. package/dist/types/plugin.d.mts +17 -2
  61. package/dist/types/plugin.d.mts.map +1 -0
  62. package/dist/types/plugin.mjs +0 -2
  63. package/package.json +4 -4
  64. package/dist/format-package-json-BfJL_TJm.cjs +0 -257
  65. package/dist/format-package-json-DrnPQ10f.mjs.map +0 -1
  66. package/dist/helpers-y2jvHwgF.mjs +0 -1
  67. package/dist/helpers-yB1XkvQI.cjs +0 -0
  68. package/dist/index-BR1oNnaF.d.cts +0 -1
  69. package/dist/index-DEHBdV_z.d.mts +0 -1
  70. package/dist/index-DNLi60D-.d.mts +0 -1
  71. package/dist/index-_wQ5ClJU.d.cts +0 -1
  72. package/dist/plugin-B0q2kj8i.mjs +0 -1
  73. package/dist/plugin-CZEJ9SKF.d.mts +0 -17
  74. package/dist/plugin-CZEJ9SKF.d.mts.map +0 -1
  75. package/dist/plugin-C_NYHEM5.d.cts +0 -17
  76. package/dist/plugin-C_NYHEM5.d.cts.map +0 -1
  77. package/dist/plugin-Ckx8qAq8.cjs +0 -0
  78. package/dist/types--fVOUYBq.mjs +0 -1
  79. package/dist/types-a8gm_IaQ.cjs +0 -0
  80. package/dist/unplugin-0Zevy5n4.mjs +0 -11
  81. package/dist/unplugin-0Zevy5n4.mjs.map +0 -1
  82. package/dist/unplugin-DAxS5ZTK.d.cts +0 -8
  83. package/dist/unplugin-DAxS5ZTK.d.cts.map +0 -1
  84. package/dist/unplugin-DWU1VqQz.cjs +0 -16
  85. package/dist/unplugin-YSgWz6zp.d.mts +0 -8
  86. package/dist/unplugin-YSgWz6zp.d.mts.map +0 -1
@@ -0,0 +1,29 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
@@ -1,3 +1,19 @@
1
- const require_format_package_json = require('../format-package-json-BfJL_TJm.cjs');
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_join_paths = require('../node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.cjs');
3
+ const require_is_set_string = require('../node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-string.cjs');
4
+ let powerlines_lib_utilities_format = require("powerlines/lib/utilities/format");
2
5
 
3
- exports.formatPackageJson = require_format_package_json.formatPackageJson;
6
+ //#region src/helpers/format-package-json.ts
7
+ /**
8
+ * Formats the `package.json` file in the project root.
9
+ *
10
+ * @param context - The Tsdown plugin context.
11
+ */
12
+ async function formatPackageJson(context) {
13
+ const packageJsonPath = require_join_paths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, "package.json");
14
+ const packageJsonFile = await context.fs.read(packageJsonPath);
15
+ if (require_is_set_string.isSetString(packageJsonFile)) await context.fs.write(packageJsonPath, await (0, powerlines_lib_utilities_format.format)(context, packageJsonPath, packageJsonFile));
16
+ }
17
+
18
+ //#endregion
19
+ exports.formatPackageJson = formatPackageJson;
@@ -1,4 +1,4 @@
1
- import { t as TsdownPluginContext } from "../plugin-C_NYHEM5.cjs";
1
+ import { TsdownPluginContext } from "../types/plugin.cjs";
2
2
 
3
3
  //#region src/helpers/format-package-json.d.ts
4
4
 
@@ -1,4 +1,4 @@
1
- import { t as TsdownPluginContext } from "../plugin-CZEJ9SKF.mjs";
1
+ import { TsdownPluginContext } from "../types/plugin.mjs";
2
2
 
3
3
  //#region src/helpers/format-package-json.d.ts
4
4
 
@@ -1,3 +1,19 @@
1
- import { t as formatPackageJson } from "../format-package-json-DrnPQ10f.mjs";
1
+ import { joinPaths } from "../node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs";
2
+ import { isSetString } from "../node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-string.mjs";
3
+ import { format } from "powerlines/lib/utilities/format";
2
4
 
3
- export { formatPackageJson };
5
+ //#region src/helpers/format-package-json.ts
6
+ /**
7
+ * Formats the `package.json` file in the project root.
8
+ *
9
+ * @param context - The Tsdown plugin context.
10
+ */
11
+ async function formatPackageJson(context) {
12
+ const packageJsonPath = joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, "package.json");
13
+ const packageJsonFile = await context.fs.read(packageJsonPath);
14
+ if (isSetString(packageJsonFile)) await context.fs.write(packageJsonPath, await format(context, packageJsonPath, packageJsonFile));
15
+ }
16
+
17
+ //#endregion
18
+ export { formatPackageJson };
19
+ //# sourceMappingURL=format-package-json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-package-json.mjs","names":[],"sources":["../../src/helpers/format-package-json.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { format } from \"powerlines/lib/utilities/format\";\nimport { TsdownPluginContext } from \"../types/plugin\";\n\n/**\n * Formats the `package.json` file in the project root.\n *\n * @param context - The Tsdown plugin context.\n */\nexport async function formatPackageJson(context: TsdownPluginContext) {\n const packageJsonPath = joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n \"package.json\"\n );\n const packageJsonFile = await context.fs.read(packageJsonPath);\n if (isSetString(packageJsonFile)) {\n await context.fs.write(\n packageJsonPath,\n await format(context, packageJsonPath, packageJsonFile)\n );\n }\n}\n"],"mappings":";;;;;;;;;;AA4BA,eAAsB,kBAAkB,SAA8B;CACpE,MAAM,kBAAkB,UACtB,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,aACf,eACD;CACD,MAAM,kBAAkB,MAAM,QAAQ,GAAG,KAAK,gBAAgB;AAC9D,KAAI,YAAY,gBAAgB,CAC9B,OAAM,QAAQ,GAAG,MACf,iBACA,MAAM,OAAO,SAAS,iBAAiB,gBAAgB,CACxD"}
@@ -1,4 +1,3 @@
1
- const require_unplugin = require('../unplugin-DWU1VqQz.cjs');
2
- require('../helpers-yB1XkvQI.cjs');
1
+ const require_helpers_unplugin = require('./unplugin.cjs');
3
2
 
4
- exports.createTsdownPlugin = require_unplugin.createTsdownPlugin;
3
+ exports.createTsdownPlugin = require_helpers_unplugin.createTsdownPlugin;
@@ -1,4 +1,2 @@
1
- import "../plugin-C_NYHEM5.cjs";
2
- import { t as createTsdownPlugin } from "../unplugin-DAxS5ZTK.cjs";
3
- import "../index-_wQ5ClJU.cjs";
1
+ import { createTsdownPlugin } from "./unplugin.cjs";
4
2
  export { createTsdownPlugin };
@@ -1,4 +1,2 @@
1
- import "../plugin-CZEJ9SKF.mjs";
2
- import { t as createTsdownPlugin } from "../unplugin-YSgWz6zp.mjs";
3
- import "../index-DEHBdV_z.mjs";
1
+ import { createTsdownPlugin } from "./unplugin.mjs";
4
2
  export { createTsdownPlugin };
@@ -1,4 +1,3 @@
1
- import { t as createTsdownPlugin } from "../unplugin-0Zevy5n4.mjs";
2
- import "../helpers-y2jvHwgF.mjs";
1
+ import { createTsdownPlugin } from "./unplugin.mjs";
3
2
 
4
3
  export { createTsdownPlugin };
@@ -1,3 +1,11 @@
1
- const require_unplugin = require('../unplugin-DWU1VqQz.cjs');
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let powerlines_lib_unplugin = require("powerlines/lib/unplugin");
3
+ let unplugin = require("unplugin");
2
4
 
3
- exports.createTsdownPlugin = require_unplugin.createTsdownPlugin;
5
+ //#region src/helpers/unplugin.ts
6
+ function createTsdownPlugin(context) {
7
+ return (0, unplugin.createRolldownPlugin)((0, powerlines_lib_unplugin.createUnplugin)(context))({});
8
+ }
9
+
10
+ //#endregion
11
+ exports.createTsdownPlugin = createTsdownPlugin;
@@ -1,3 +1,8 @@
1
- import "../plugin-C_NYHEM5.cjs";
2
- import { t as createTsdownPlugin } from "../unplugin-DAxS5ZTK.cjs";
3
- export { createTsdownPlugin };
1
+ import { TsdownPluginContext } from "../types/plugin.cjs";
2
+ import * as rolldown0 from "rolldown";
3
+
4
+ //#region src/helpers/unplugin.d.ts
5
+ declare function createTsdownPlugin(context: TsdownPluginContext): rolldown0.Plugin<any> | rolldown0.Plugin<any>[];
6
+ //#endregion
7
+ export { createTsdownPlugin };
8
+ //# sourceMappingURL=unplugin.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,kBAAA,UAA4B,sBAAmB,SAAA,CAAA,cAAA,SAAA,CAAA"}
@@ -1,3 +1,8 @@
1
- import "../plugin-CZEJ9SKF.mjs";
2
- import { t as createTsdownPlugin } from "../unplugin-YSgWz6zp.mjs";
3
- export { createTsdownPlugin };
1
+ import { TsdownPluginContext } from "../types/plugin.mjs";
2
+ import * as rolldown0 from "rolldown";
3
+
4
+ //#region src/helpers/unplugin.d.ts
5
+ declare function createTsdownPlugin(context: TsdownPluginContext): rolldown0.Plugin<any> | rolldown0.Plugin<any>[];
6
+ //#endregion
7
+ export { createTsdownPlugin };
8
+ //# sourceMappingURL=unplugin.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,kBAAA,UAA4B,sBAAmB,SAAA,CAAA,cAAA,SAAA,CAAA"}
@@ -1,3 +1,11 @@
1
- import { t as createTsdownPlugin } from "../unplugin-0Zevy5n4.mjs";
1
+ import { createUnplugin } from "powerlines/lib/unplugin";
2
+ import { createRolldownPlugin } from "unplugin";
2
3
 
3
- export { createTsdownPlugin };
4
+ //#region src/helpers/unplugin.ts
5
+ function createTsdownPlugin(context) {
6
+ return createRolldownPlugin(createUnplugin(context))({});
7
+ }
8
+
9
+ //#endregion
10
+ export { createTsdownPlugin };
11
+ //# sourceMappingURL=unplugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin.mjs","names":[],"sources":["../../src/helpers/unplugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createUnplugin } from \"powerlines/lib/unplugin\";\nimport { createRolldownPlugin } from \"unplugin\";\nimport { TsdownPluginContext } from \"../types/plugin\";\n\nexport function createTsdownPlugin(context: TsdownPluginContext) {\n return createRolldownPlugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,mBAAmB,SAA8B;AAC/D,QAAO,qBAAqB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,38 +1,10 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- //#region rolldown:runtime
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
- key = keys[i];
13
- if (!__hasOwnProp.call(to, key) && key !== except) {
14
- __defProp(to, key, {
15
- get: ((k) => from[k]).bind(null, key),
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- }
19
- }
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
- value: mod,
25
- enumerable: true
26
- }) : target, mod));
27
-
28
- //#endregion
29
- const require_format_package_json = require('./format-package-json-BfJL_TJm.cjs');
30
- const require_unplugin = require('./unplugin-DWU1VqQz.cjs');
31
- require('./helpers-yB1XkvQI.cjs');
32
- require('./plugin-Ckx8qAq8.cjs');
33
- require('./types-a8gm_IaQ.cjs');
2
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
+ const require_helpers_format_package_json = require('./helpers/format-package-json.cjs');
4
+ const require_helpers_unplugin = require('./helpers/unplugin.cjs');
5
+ require('./helpers/index.cjs');
34
6
  let defu = require("defu");
35
- defu = __toESM(defu);
7
+ defu = require_rolldown_runtime.__toESM(defu);
36
8
  let powerlines_lib_build_tsdown = require("powerlines/lib/build/tsdown");
37
9
  let tsdown = require("tsdown");
38
10
 
@@ -57,16 +29,15 @@ const plugin = (options = {}) => {
57
29
  this.trace("Starting Tsdown build process...");
58
30
  await (0, tsdown.build)((0, defu.default)({
59
31
  config: false,
60
- plugins: [require_unplugin.createTsdownPlugin(this)]
32
+ plugins: [require_helpers_unplugin.createTsdownPlugin(this)]
61
33
  }, (0, powerlines_lib_build_tsdown.extractTsdownConfig)(this)));
62
- await require_format_package_json.formatPackageJson(this);
34
+ await require_helpers_format_package_json.formatPackageJson(this);
63
35
  }
64
36
  };
65
37
  };
66
38
  var src_default = plugin;
67
39
 
68
40
  //#endregion
69
- exports.__toESM = __toESM;
70
- exports.createTsdownPlugin = require_unplugin.createTsdownPlugin;
41
+ exports.createTsdownPlugin = require_helpers_unplugin.createTsdownPlugin;
71
42
  exports.default = src_default;
72
43
  exports.plugin = plugin;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "./plugin-C_NYHEM5.cjs";
2
- import { t as createTsdownPlugin } from "./unplugin-DAxS5ZTK.cjs";
3
- import "./index-_wQ5ClJU.cjs";
4
- import "./index-BR1oNnaF.cjs";
1
+ import { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig } from "./types/plugin.cjs";
2
+ import { createTsdownPlugin } from "./helpers/unplugin.cjs";
3
+ import "./helpers/index.cjs";
4
+ import "./types/index.cjs";
5
5
  import { Plugin } from "powerlines/types/plugin";
6
6
 
7
7
  //#region src/index.d.ts
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "./plugin-CZEJ9SKF.mjs";
2
- import { t as createTsdownPlugin } from "./unplugin-YSgWz6zp.mjs";
3
- import "./index-DEHBdV_z.mjs";
4
- import "./index-DNLi60D-.mjs";
1
+ import { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig } from "./types/plugin.mjs";
2
+ import { createTsdownPlugin } from "./helpers/unplugin.mjs";
3
+ import "./helpers/index.mjs";
4
+ import "./types/index.mjs";
5
5
  import { Plugin } from "powerlines/types/plugin";
6
6
 
7
7
  //#region src/index.d.ts
package/dist/index.mjs CHANGED
@@ -1,8 +1,6 @@
1
- import { t as formatPackageJson } from "./format-package-json-DrnPQ10f.mjs";
2
- import { t as createTsdownPlugin } from "./unplugin-0Zevy5n4.mjs";
3
- import "./helpers-y2jvHwgF.mjs";
4
- import "./plugin-B0q2kj8i.mjs";
5
- import "./types--fVOUYBq.mjs";
1
+ import { formatPackageJson } from "./helpers/format-package-json.mjs";
2
+ import { createTsdownPlugin } from "./helpers/unplugin.mjs";
3
+ import "./helpers/index.mjs";
6
4
  import defu from "defu";
7
5
  import { extractTsdownConfig } from "powerlines/lib/build/tsdown";
8
6
  import { build } from "tsdown";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport defu from \"defu\";\nimport { extractTsdownConfig } from \"powerlines/lib/build/tsdown\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport { build } from \"tsdown\";\nimport { formatPackageJson } from \"./helpers/format-package-json\";\nimport { createTsdownPlugin } from \"./helpers/unplugin\";\nimport {\n TsdownPluginContext,\n TsdownPluginOptions,\n TsdownPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to use Tsdown to build the project.\n */\nexport const plugin = <\n TContext extends TsdownPluginContext = TsdownPluginContext\n>(\n options: TsdownPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"tsdown\",\n config() {\n this.trace(\n \"Providing default configuration for the Powerlines `tsdown` build plugin.\"\n );\n\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n build: {\n ...options,\n variant: \"tsdown\"\n }\n } as Partial<TsdownPluginResolvedConfig>;\n },\n async build() {\n this.trace(\"Starting Tsdown build process...\");\n\n await build(\n defu(\n {\n config: false,\n plugins: [createTsdownPlugin(this)]\n },\n extractTsdownConfig(this)\n )\n );\n\n await formatPackageJson(this);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;AAoCA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,4EACD;AAED,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,OAAO;KACL,GAAG;KACH,SAAS;KACV;IACF;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,mCAAmC;AAE9C,SAAM,MACJ,KACE;IACE,QAAQ;IACR,SAAS,CAAC,mBAAmB,KAAK,CAAC;IACpC,EACD,oBAAoB,KAAK,CAC1B,CACF;AAED,SAAM,kBAAkB,KAAK;;EAEhC;;AAGH,kBAAe"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport defu from \"defu\";\nimport { extractTsdownConfig } from \"powerlines/lib/build/tsdown\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport { build } from \"tsdown\";\nimport { formatPackageJson } from \"./helpers/format-package-json\";\nimport { createTsdownPlugin } from \"./helpers/unplugin\";\nimport {\n TsdownPluginContext,\n TsdownPluginOptions,\n TsdownPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to use Tsdown to build the project.\n */\nexport const plugin = <\n TContext extends TsdownPluginContext = TsdownPluginContext\n>(\n options: TsdownPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"tsdown\",\n config() {\n this.trace(\n \"Providing default configuration for the Powerlines `tsdown` build plugin.\"\n );\n\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n build: {\n ...options,\n variant: \"tsdown\"\n }\n } as Partial<TsdownPluginResolvedConfig>;\n },\n async build() {\n this.trace(\"Starting Tsdown build process...\");\n\n await build(\n defu(\n {\n config: false,\n plugins: [createTsdownPlugin(this)]\n },\n extractTsdownConfig(this)\n )\n );\n\n await formatPackageJson(this);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AAoCA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,4EACD;AAED,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,OAAO;KACL,GAAG;KACH,SAAS;KACV;IACF;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,mCAAmC;AAE9C,SAAM,MACJ,KACE;IACE,QAAQ;IACR,SAAS,CAAC,mBAAmB,KAAK,CAAC;IACpC,EACD,oBAAoB,KAAK,CAC1B,CACF;AAED,SAAM,kBAAkB,KAAK;;EAEhC;;AAGH,kBAAe"}
@@ -0,0 +1,28 @@
1
+ const require_regex = require('./regex.cjs');
2
+ const require_slash = require('./slash.cjs');
3
+
4
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs
5
+ /**
6
+ * Check if the path is an absolute path.
7
+ *
8
+ * @param path - The path to check
9
+ * @returns An indicator specifying if the path is an absolute path
10
+ */
11
+ function isAbsolutePath(path) {
12
+ return require_regex.ABSOLUTE_PATH_REGEX.test(require_slash.slash(path));
13
+ }
14
+ /**
15
+ * Check if the path is an absolute path.
16
+ *
17
+ * @remarks
18
+ * This is an alias for {@link isAbsolutePath}.
19
+ *
20
+ * @param path - The path to check
21
+ * @returns An indicator specifying if the path is an absolute path
22
+ */
23
+ function isAbsolute(path) {
24
+ return isAbsolutePath(path);
25
+ }
26
+
27
+ //#endregion
28
+ exports.isAbsolute = isAbsolute;
@@ -0,0 +1,29 @@
1
+ import { ABSOLUTE_PATH_REGEX } from "./regex.mjs";
2
+ import { slash } from "./slash.mjs";
3
+
4
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs
5
+ /**
6
+ * Check if the path is an absolute path.
7
+ *
8
+ * @param path - The path to check
9
+ * @returns An indicator specifying if the path is an absolute path
10
+ */
11
+ function isAbsolutePath(path) {
12
+ return ABSOLUTE_PATH_REGEX.test(slash(path));
13
+ }
14
+ /**
15
+ * Check if the path is an absolute path.
16
+ *
17
+ * @remarks
18
+ * This is an alias for {@link isAbsolutePath}.
19
+ *
20
+ * @param path - The path to check
21
+ * @returns An indicator specifying if the path is an absolute path
22
+ */
23
+ function isAbsolute(path) {
24
+ return isAbsolutePath(path);
25
+ }
26
+
27
+ //#endregion
28
+ export { isAbsolute };
29
+ //# sourceMappingURL=is-type.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-type.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs"],"sourcesContent":["import { ABSOLUTE_PATH_REGEX, NPM_SCOPED_PACKAGE_REGEX } from \"./regex.mjs\";\nimport { slash } from \"./slash.mjs\";\n\n//#region src/is-type.ts\n/**\n* Check if the path is an absolute path.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is an absolute path\n*/\nfunction isAbsolutePath(path) {\n\treturn ABSOLUTE_PATH_REGEX.test(slash(path));\n}\n/**\n* Check if the path is an absolute path.\n*\n* @remarks\n* This is an alias for {@link isAbsolutePath}.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is an absolute path\n*/\nfunction isAbsolute(path) {\n\treturn isAbsolutePath(path);\n}\n/**\n* Check if the path is a relative path.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a relative path\n*/\nfunction isRelativePath(path) {\n\treturn !isAbsolutePath(path);\n}\n/**\n* Check if the path is a relative path.\n*\n* @remarks\n* This is an alias for {@link isRelativePath}.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a relative path\n*/\nfunction isRelative(path) {\n\treturn isRelativePath(path);\n}\n/**\n* Check if the path is a npm package path.\n*\n* @remarks\n* This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackage}.\n*\n* @example\n* ```ts\n* isNpmScopedPackage(\"@stryke/path\"); // returns true\n* isNpmScopedPackage(\"lodash\"); // returns false\n* isNpmNamespacePackage(\"./src/index.ts\"); // returns false\n* ```\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a npm package path\n*/\nfunction isNpmScopedPackagePath(path) {\n\treturn NPM_SCOPED_PACKAGE_REGEX.test(slash(path));\n}\n/**\n* Check if the path is a npm package path.\n*\n* @remarks\n* This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackagePath}.\n*\n* @example\n* ```ts\n* isNpmScopedPackagePath(\"@stryke/path\"); // returns true\n* isNpmScopedPackagePath(\"lodash\"); // returns false\n* isNpmScopedPackagePath(\"./src/index.ts\"); // returns false\n* ```\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a npm package path\n*/\nfunction isNpmScopedPackage(path) {\n\treturn isNpmScopedPackagePath(path);\n}\n\n//#endregion\nexport { isAbsolute, isAbsolutePath, isNpmScopedPackage, isNpmScopedPackagePath, isRelative, isRelativePath };\n//# sourceMappingURL=is-type.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAUA,SAAS,eAAe,MAAM;AAC7B,QAAO,oBAAoB,KAAK,MAAM,KAAK,CAAC;;;;;;;;;;;AAW7C,SAAS,WAAW,MAAM;AACzB,QAAO,eAAe,KAAK"}
@@ -0,0 +1,122 @@
1
+ const require_regex = require('./regex.cjs');
2
+ const require_slash = require('./slash.cjs');
3
+ const require_is_type = require('./is-type.cjs');
4
+
5
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs
6
+ function normalizeWindowsPath(input = "") {
7
+ if (!input) return input;
8
+ return input.replace(/\\/g, "/").replace(require_regex.DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
9
+ }
10
+ function correctPaths(path) {
11
+ if (!path || path.length === 0) return ".";
12
+ path = normalizeWindowsPath(path);
13
+ const isUNCPath = path.match(require_regex.UNC_REGEX);
14
+ const isPathAbsolute = require_is_type.isAbsolute(path);
15
+ const trailingSeparator = path[path.length - 1] === "/";
16
+ path = normalizeString(path, !isPathAbsolute);
17
+ if (path.length === 0) {
18
+ if (isPathAbsolute) return "/";
19
+ return trailingSeparator ? "./" : ".";
20
+ }
21
+ if (trailingSeparator) path += "/";
22
+ if (require_regex.DRIVE_LETTER_REGEX.test(path)) path += "/";
23
+ if (isUNCPath) {
24
+ if (!isPathAbsolute) return `//./${path}`;
25
+ return `//${path}`;
26
+ }
27
+ return isPathAbsolute && !require_is_type.isAbsolute(path) ? `/${path}` : path;
28
+ }
29
+ /**
30
+ * Joins all given path segments together using the platform-specific separator as a delimiter.
31
+ *
32
+ * @remarks
33
+ * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { joinPaths } from 'stryke/path';
38
+ *
39
+ * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');
40
+ * console.log(fullPath); // Output: 'folder1/folder3/file.txt'
41
+ *
42
+ * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');
43
+ * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'
44
+ *
45
+ * const windowsPath = joinPaths('C:\\', 'Users', 'Public', '..', 'Documents', 'file.txt');
46
+ * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'
47
+ *
48
+ * const uncPath = joinPaths('\\\\Server\\Share', 'Folder', 'File.txt');
49
+ * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'
50
+ * ```
51
+ *
52
+ * @param segments - The path segments to join.
53
+ * @returns The joined and normalized path string.
54
+ */
55
+ function joinPaths(...segments) {
56
+ let result = "";
57
+ for (const segment of segments) if (segment && require_slash.slash(segment).replaceAll(/\//g, "") !== ".") {
58
+ if (result) if (require_slash.slash(segment).replaceAll(/\//g, "") === "..") result = require_slash.slash(result).replace(/\/+$/, "").replace(/\/*[^/]+$/, "");
59
+ else result = `${require_slash.slash(result).replace(/\/+$/, "")}/${require_slash.slash(segment).replace(/^\/+/, "")}`;
60
+ else if (require_slash.slash(segment).replaceAll(/\//g, "") !== "..") result = segment;
61
+ }
62
+ return correctPaths(result);
63
+ }
64
+ /**
65
+ * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
66
+ *
67
+ * @param path - The path to normalize.
68
+ * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
69
+ * @returns the normalized path string.
70
+ */
71
+ function normalizeString(path, allowAboveRoot) {
72
+ let res = "";
73
+ let lastSegmentLength = 0;
74
+ let lastSlash = -1;
75
+ let dots = 0;
76
+ let char = null;
77
+ for (let index = 0; index <= path.length; ++index) {
78
+ if (index < path.length) char = path[index];
79
+ else if (char === "/") break;
80
+ else char = "/";
81
+ if (char === "/") {
82
+ if (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {
83
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
84
+ if (res.length > 2) {
85
+ const lastSlashIndex = res.lastIndexOf("/");
86
+ if (lastSlashIndex === -1) {
87
+ res = "";
88
+ lastSegmentLength = 0;
89
+ } else {
90
+ res = res.slice(0, lastSlashIndex);
91
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
92
+ }
93
+ lastSlash = index;
94
+ dots = 0;
95
+ continue;
96
+ } else if (res.length > 0) {
97
+ res = "";
98
+ lastSegmentLength = 0;
99
+ lastSlash = index;
100
+ dots = 0;
101
+ continue;
102
+ }
103
+ }
104
+ if (allowAboveRoot) {
105
+ res += res.length > 0 ? "/.." : "..";
106
+ lastSegmentLength = 2;
107
+ }
108
+ } else {
109
+ if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
110
+ else res = path.slice(lastSlash + 1, index);
111
+ lastSegmentLength = index - lastSlash - 1;
112
+ }
113
+ lastSlash = index;
114
+ dots = 0;
115
+ } else if (char === "." && dots !== -1) ++dots;
116
+ else dots = -1;
117
+ }
118
+ return res;
119
+ }
120
+
121
+ //#endregion
122
+ exports.joinPaths = joinPaths;