@powerlines/plugin-tsup 0.12.307 → 0.12.309

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 (142) hide show
  1. package/dist/build-C-zKo4UO.d.cts +8 -0
  2. package/dist/build-C-zKo4UO.d.cts.map +1 -0
  3. package/dist/build-D6oFtT4i.d.mts +8 -0
  4. package/dist/build-D6oFtT4i.d.mts.map +1 -0
  5. package/dist/build-DJTI0ZMx.cjs +0 -0
  6. package/dist/build-XTM4L3VY.mjs +1 -0
  7. package/dist/helpers/index.cjs +7 -6
  8. package/dist/helpers/index.d.cts +6 -2
  9. package/dist/helpers/index.d.mts +6 -2
  10. package/dist/helpers/index.mjs +3 -2
  11. package/dist/helpers/resolve-options.cjs +4 -84
  12. package/dist/helpers/resolve-options.d.cts +5 -26
  13. package/dist/helpers/resolve-options.d.mts +5 -28
  14. package/dist/helpers/resolve-options.mjs +2 -81
  15. package/dist/helpers/unplugin.cjs +2 -11
  16. package/dist/helpers/unplugin.d.cts +4 -8
  17. package/dist/helpers/unplugin.d.mts +4 -8
  18. package/dist/helpers/unplugin.mjs +2 -11
  19. package/dist/helpers-C9XSjwSZ.mjs +1 -0
  20. package/dist/helpers-yB1XkvQI.cjs +0 -0
  21. package/dist/index-2Ag-54t8.d.mts +1 -0
  22. package/dist/index-B_e8BwCm.d.cts +1 -0
  23. package/dist/index-Cc7fCJU9.d.mts +1 -0
  24. package/dist/index-D4ELpJXS.d.cts +1 -0
  25. package/dist/index.cjs +12 -10
  26. package/dist/index.d.cts +7 -5
  27. package/dist/index.d.cts.map +1 -1
  28. package/dist/index.d.mts +7 -8
  29. package/dist/index.d.mts.map +1 -1
  30. package/dist/index.mjs +6 -3
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/plugin-BUuY_bKp.d.cts +19 -0
  33. package/dist/plugin-BUuY_bKp.d.cts.map +1 -0
  34. package/dist/plugin-D0kb_w4D.d.mts +19 -0
  35. package/dist/plugin-D0kb_w4D.d.mts.map +1 -0
  36. package/dist/plugin-D3B5E_Hg.mjs +1 -0
  37. package/dist/plugin-D5qyQPqC.cjs +0 -0
  38. package/dist/resolve-options-A50LA11B.d.mts +25 -0
  39. package/dist/resolve-options-A50LA11B.d.mts.map +1 -0
  40. package/dist/resolve-options-CaiF-bem.d.cts +25 -0
  41. package/dist/resolve-options-CaiF-bem.d.cts.map +1 -0
  42. package/dist/resolve-options-DPfS2t2w.cjs +132 -0
  43. package/dist/resolve-options-DvCBX8Wl.mjs +82 -0
  44. package/dist/resolve-options-DvCBX8Wl.mjs.map +1 -0
  45. package/dist/types/build.cjs +1 -0
  46. package/dist/types/build.d.cts +2 -8
  47. package/dist/types/build.d.mts +2 -8
  48. package/dist/types/build.mjs +2 -0
  49. package/dist/types/index.cjs +3 -0
  50. package/dist/types/index.d.cts +3 -2
  51. package/dist/types/index.d.mts +3 -2
  52. package/dist/types/index.mjs +4 -0
  53. package/dist/types/plugin.cjs +1 -0
  54. package/dist/types/plugin.d.cts +3 -20
  55. package/dist/types/plugin.d.mts +3 -21
  56. package/dist/types/plugin.mjs +2 -0
  57. package/dist/types-D208vOSb.cjs +0 -0
  58. package/dist/types-Dv2cgIDx.mjs +1 -0
  59. package/dist/unplugin-BNAHDEmx.d.cts +8 -0
  60. package/dist/unplugin-BNAHDEmx.d.cts.map +1 -0
  61. package/dist/unplugin-C0RKBWXe.cjs +16 -0
  62. package/dist/unplugin-D-dKnxUW.mjs +11 -0
  63. package/dist/unplugin-D-dKnxUW.mjs.map +1 -0
  64. package/dist/unplugin-DHNZtPIJ.d.mts +8 -0
  65. package/dist/unplugin-DHNZtPIJ.d.mts.map +1 -0
  66. package/package.json +4 -4
  67. package/dist/_virtual/rolldown_runtime.cjs +0 -29
  68. package/dist/core/src/lib/entry.cjs +0 -22
  69. package/dist/core/src/lib/entry.mjs +0 -22
  70. package/dist/core/src/lib/entry.mjs.map +0 -1
  71. package/dist/core/src/lib/logger.cjs +0 -41
  72. package/dist/core/src/lib/logger.mjs +0 -40
  73. package/dist/core/src/lib/logger.mjs.map +0 -1
  74. package/dist/core/src/lib/unplugin/helpers.cjs +0 -19
  75. package/dist/core/src/lib/unplugin/helpers.mjs +0 -19
  76. package/dist/core/src/lib/unplugin/helpers.mjs.map +0 -1
  77. package/dist/core/src/lib/unplugin/index.cjs +0 -3
  78. package/dist/core/src/lib/unplugin/index.mjs +0 -5
  79. package/dist/core/src/lib/unplugin/module-resolution.cjs +0 -66
  80. package/dist/core/src/lib/unplugin/module-resolution.mjs +0 -66
  81. package/dist/core/src/lib/unplugin/module-resolution.mjs.map +0 -1
  82. package/dist/core/src/lib/unplugin/plugin.cjs +0 -71
  83. package/dist/core/src/lib/unplugin/plugin.mjs +0 -71
  84. package/dist/core/src/lib/unplugin/plugin.mjs.map +0 -1
  85. package/dist/core/src/lib/utilities/source-file.cjs +0 -22
  86. package/dist/core/src/lib/utilities/source-file.mjs +0 -21
  87. package/dist/core/src/lib/utilities/source-file.mjs.map +0 -1
  88. package/dist/core/src/plugin-utils/paths.cjs +0 -2
  89. package/dist/core/src/plugin-utils/paths.mjs +0 -4
  90. package/dist/core/src/types/api.d.cts +0 -103
  91. package/dist/core/src/types/api.d.cts.map +0 -1
  92. package/dist/core/src/types/api.d.mts +0 -103
  93. package/dist/core/src/types/api.d.mts.map +0 -1
  94. package/dist/core/src/types/commands.d.cts +0 -9
  95. package/dist/core/src/types/commands.d.cts.map +0 -1
  96. package/dist/core/src/types/commands.d.mts +0 -10
  97. package/dist/core/src/types/commands.d.mts.map +0 -1
  98. package/dist/core/src/types/config.d.cts +0 -551
  99. package/dist/core/src/types/config.d.cts.map +0 -1
  100. package/dist/core/src/types/config.d.mts +0 -551
  101. package/dist/core/src/types/config.d.mts.map +0 -1
  102. package/dist/core/src/types/context.d.cts +0 -511
  103. package/dist/core/src/types/context.d.cts.map +0 -1
  104. package/dist/core/src/types/context.d.mts +0 -511
  105. package/dist/core/src/types/context.d.mts.map +0 -1
  106. package/dist/core/src/types/fs.d.cts +0 -487
  107. package/dist/core/src/types/fs.d.cts.map +0 -1
  108. package/dist/core/src/types/fs.d.mts +0 -487
  109. package/dist/core/src/types/fs.d.mts.map +0 -1
  110. package/dist/core/src/types/hooks.d.cts +0 -99
  111. package/dist/core/src/types/hooks.d.cts.map +0 -1
  112. package/dist/core/src/types/hooks.d.mts +0 -99
  113. package/dist/core/src/types/hooks.d.mts.map +0 -1
  114. package/dist/core/src/types/index.d.mts +0 -9
  115. package/dist/core/src/types/plugin.d.cts +0 -204
  116. package/dist/core/src/types/plugin.d.cts.map +0 -1
  117. package/dist/core/src/types/plugin.d.mts +0 -204
  118. package/dist/core/src/types/plugin.d.mts.map +0 -1
  119. package/dist/core/src/types/tsconfig.d.cts +0 -70
  120. package/dist/core/src/types/tsconfig.d.cts.map +0 -1
  121. package/dist/core/src/types/tsconfig.d.mts +0 -70
  122. package/dist/core/src/types/tsconfig.d.mts.map +0 -1
  123. package/dist/core/src/types/unplugin.cjs +0 -21
  124. package/dist/core/src/types/unplugin.d.cts +0 -24
  125. package/dist/core/src/types/unplugin.d.cts.map +0 -1
  126. package/dist/core/src/types/unplugin.d.mts +0 -25
  127. package/dist/core/src/types/unplugin.d.mts.map +0 -1
  128. package/dist/core/src/types/unplugin.mjs +0 -22
  129. package/dist/core/src/types/unplugin.mjs.map +0 -1
  130. package/dist/helpers/resolve-options.d.cts.map +0 -1
  131. package/dist/helpers/resolve-options.d.mts.map +0 -1
  132. package/dist/helpers/resolve-options.mjs.map +0 -1
  133. package/dist/helpers/unplugin.d.cts.map +0 -1
  134. package/dist/helpers/unplugin.d.mts.map +0 -1
  135. package/dist/helpers/unplugin.mjs.map +0 -1
  136. package/dist/plugin-esbuild/src/helpers/resolve-options.cjs +0 -27
  137. package/dist/plugin-esbuild/src/helpers/resolve-options.mjs +0 -26
  138. package/dist/plugin-esbuild/src/helpers/resolve-options.mjs.map +0 -1
  139. package/dist/types/build.d.cts.map +0 -1
  140. package/dist/types/build.d.mts.map +0 -1
  141. package/dist/types/plugin.d.cts.map +0 -1
  142. package/dist/types/plugin.d.mts.map +0 -1
@@ -0,0 +1,25 @@
1
+ import { t as TsupOptions } from "./build-C-zKo4UO.cjs";
2
+ import { Context, ResolvedEntryTypeDefinition } from "@powerlines/core/types";
3
+ import { Entry } from "@storm-software/build-tools/types";
4
+ import { resolveOptions } from "@storm-software/tsup";
5
+
6
+ //#region src/helpers/resolve-options.d.ts
7
+ declare const DEFAULT_TSUP_CONFIG: Partial<TsupOptions>;
8
+ /**
9
+ * Resolves the entry options for [tsup](https://github.com/egoist/tsup).
10
+ *
11
+ * @param context - The build context.
12
+ * @param entryPoints - The entry points to resolve.
13
+ * @returns The resolved entry options.
14
+ */
15
+ declare function resolveEntry(context: Context, entryPoints: ResolvedEntryTypeDefinition[] | string[]): Entry;
16
+ /**
17
+ * Resolves the options for [tsup](https://github.com/egoist/tsup).
18
+ *
19
+ * @param context - The build context.
20
+ * @returns The resolved options.
21
+ */
22
+ declare function resolveOptions$1(context: Context): Parameters<typeof resolveOptions>[0];
23
+ //#endregion
24
+ export { resolveEntry as n, resolveOptions$1 as r, DEFAULT_TSUP_CONFIG as t };
25
+ //# sourceMappingURL=resolve-options-CaiF-bem.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options-CaiF-bem.d.cts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;;;cA8Ba,qBAAqB,QAAQ;;AAA1C;AAwBA;;;;;AAyBgB,iBAzBA,YAAA,CAyBc,OAAA,EAxBnB,OAwBmB,EAAA,WAAA,EAvBf,2BAuBe,EAAA,GAAA,MAAA,EAAA,CAAA,EAtB3B,KAsB2B;;;;;;;iBAAd,gBAAA,UACL,UACR,kBAAkB"}
@@ -0,0 +1,132 @@
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
+ let defu = require("defu");
29
+ defu = __toESM(defu);
30
+ let __powerlines_plugin_esbuild_helpers_resolve_options = require("@powerlines/plugin-esbuild/helpers/resolve-options");
31
+ let __storm_software_tsup_constants = require("@storm-software/tsup/constants");
32
+ let __stryke_convert_to_array = require("@stryke/convert/to-array");
33
+ let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
34
+ let __stryke_path_append = require("@stryke/path/append");
35
+
36
+ //#region src/helpers/resolve-options.ts
37
+ const DEFAULT_TSUP_CONFIG = {
38
+ ...__storm_software_tsup_constants.DEFAULT_BUILD_OPTIONS,
39
+ target: "esnext",
40
+ config: false,
41
+ minify: true,
42
+ sourcemap: false,
43
+ cjsInterop: true,
44
+ bundle: true,
45
+ dts: true,
46
+ shims: true,
47
+ silent: true,
48
+ treeshake: true,
49
+ keepNames: true,
50
+ splitting: true,
51
+ banner: {}
52
+ };
53
+ /**
54
+ * Resolves the entry options for [tsup](https://github.com/egoist/tsup).
55
+ *
56
+ * @param context - The build context.
57
+ * @param entryPoints - The entry points to resolve.
58
+ * @returns The resolved entry options.
59
+ */
60
+ function resolveEntry(context, entryPoints) {
61
+ return (0, __powerlines_plugin_esbuild_helpers_resolve_options.resolveEntry)(context, entryPoints);
62
+ }
63
+ /**
64
+ * Resolves the options for [tsup](https://github.com/egoist/tsup).
65
+ *
66
+ * @param context - The build context.
67
+ * @returns The resolved options.
68
+ */
69
+ function resolveOptions(context) {
70
+ const result = (0, defu.default)({
71
+ entry: Object.fromEntries(Object.entries(resolveEntry(context, context.entry)).map(([key, value]) => [key, (0, __stryke_path_append.appendPath)(value, context.config.root)])),
72
+ esbuildOptions: ((options, ctx) => {
73
+ if (context.config.tsup?.esbuildOptions) context.config.tsup?.esbuildOptions?.(options, ctx);
74
+ options.alias = {
75
+ ...context.alias,
76
+ ...context.builtins.reduce((ret, id) => {
77
+ const path = context.fs.paths[id];
78
+ if (path) ret[id] = path;
79
+ return ret;
80
+ }, {}),
81
+ ...options.alias
82
+ };
83
+ }),
84
+ noExternal: context.builtins
85
+ }, context.config.tsup ? context.config.tsup : {}, {
86
+ name: context.config.name,
87
+ root: context.config.root,
88
+ projectRoot: context.config.root,
89
+ assets: context.config.output.assets,
90
+ resolveExtensions: context.config.resolve.extensions,
91
+ outputPath: context.config.output.buildPath,
92
+ tsconfig: context.tsconfig.tsconfigFilePath,
93
+ dts: context.config.tsup && !context.config.tsup?.experimentalDts ? { compilerOptions: context.tsconfig.tsconfigJson.compilerOptions } : void 0,
94
+ format: context.config.output.format,
95
+ mode: context.config.mode,
96
+ treeshake: context.config.tsup ? context.config.tsup?.treeshake : void 0,
97
+ minify: context.config.mode !== "development",
98
+ metafile: context.config.mode === "development",
99
+ sourcemap: context.config.mode === "development",
100
+ silent: context.config.logLevel === null || context.config.mode === "production",
101
+ verbose: context.config.logLevel === null || context.config.logLevel === "trace" || context.config.mode === "development",
102
+ workspaceConfig: { workspaceRoot: context.workspaceConfig.workspaceRoot }
103
+ }, DEFAULT_TSUP_CONFIG);
104
+ result.format = (0, __stryke_helpers_get_unique.getUnique)((0, __stryke_convert_to_array.toArray)(result.format));
105
+ return result;
106
+ }
107
+
108
+ //#endregion
109
+ Object.defineProperty(exports, 'DEFAULT_TSUP_CONFIG', {
110
+ enumerable: true,
111
+ get: function () {
112
+ return DEFAULT_TSUP_CONFIG;
113
+ }
114
+ });
115
+ Object.defineProperty(exports, '__toESM', {
116
+ enumerable: true,
117
+ get: function () {
118
+ return __toESM;
119
+ }
120
+ });
121
+ Object.defineProperty(exports, 'resolveEntry', {
122
+ enumerable: true,
123
+ get: function () {
124
+ return resolveEntry;
125
+ }
126
+ });
127
+ Object.defineProperty(exports, 'resolveOptions', {
128
+ enumerable: true,
129
+ get: function () {
130
+ return resolveOptions;
131
+ }
132
+ });
@@ -0,0 +1,82 @@
1
+ import defu from "defu";
2
+ import { resolveEntry } from "@powerlines/plugin-esbuild/helpers/resolve-options";
3
+ import { DEFAULT_BUILD_OPTIONS } from "@storm-software/tsup/constants";
4
+ import { toArray } from "@stryke/convert/to-array";
5
+ import { getUnique } from "@stryke/helpers/get-unique";
6
+ import { appendPath } from "@stryke/path/append";
7
+
8
+ //#region src/helpers/resolve-options.ts
9
+ const DEFAULT_TSUP_CONFIG = {
10
+ ...DEFAULT_BUILD_OPTIONS,
11
+ target: "esnext",
12
+ config: false,
13
+ minify: true,
14
+ sourcemap: false,
15
+ cjsInterop: true,
16
+ bundle: true,
17
+ dts: true,
18
+ shims: true,
19
+ silent: true,
20
+ treeshake: true,
21
+ keepNames: true,
22
+ splitting: true,
23
+ banner: {}
24
+ };
25
+ /**
26
+ * Resolves the entry options for [tsup](https://github.com/egoist/tsup).
27
+ *
28
+ * @param context - The build context.
29
+ * @param entryPoints - The entry points to resolve.
30
+ * @returns The resolved entry options.
31
+ */
32
+ function resolveEntry$1(context, entryPoints) {
33
+ return resolveEntry(context, entryPoints);
34
+ }
35
+ /**
36
+ * Resolves the options for [tsup](https://github.com/egoist/tsup).
37
+ *
38
+ * @param context - The build context.
39
+ * @returns The resolved options.
40
+ */
41
+ function resolveOptions(context) {
42
+ const result = defu({
43
+ entry: Object.fromEntries(Object.entries(resolveEntry$1(context, context.entry)).map(([key, value]) => [key, appendPath(value, context.config.root)])),
44
+ esbuildOptions: ((options, ctx) => {
45
+ if (context.config.tsup?.esbuildOptions) context.config.tsup?.esbuildOptions?.(options, ctx);
46
+ options.alias = {
47
+ ...context.alias,
48
+ ...context.builtins.reduce((ret, id) => {
49
+ const path = context.fs.paths[id];
50
+ if (path) ret[id] = path;
51
+ return ret;
52
+ }, {}),
53
+ ...options.alias
54
+ };
55
+ }),
56
+ noExternal: context.builtins
57
+ }, context.config.tsup ? context.config.tsup : {}, {
58
+ name: context.config.name,
59
+ root: context.config.root,
60
+ projectRoot: context.config.root,
61
+ assets: context.config.output.assets,
62
+ resolveExtensions: context.config.resolve.extensions,
63
+ outputPath: context.config.output.buildPath,
64
+ tsconfig: context.tsconfig.tsconfigFilePath,
65
+ dts: context.config.tsup && !context.config.tsup?.experimentalDts ? { compilerOptions: context.tsconfig.tsconfigJson.compilerOptions } : void 0,
66
+ format: context.config.output.format,
67
+ mode: context.config.mode,
68
+ treeshake: context.config.tsup ? context.config.tsup?.treeshake : void 0,
69
+ minify: context.config.mode !== "development",
70
+ metafile: context.config.mode === "development",
71
+ sourcemap: context.config.mode === "development",
72
+ silent: context.config.logLevel === null || context.config.mode === "production",
73
+ verbose: context.config.logLevel === null || context.config.logLevel === "trace" || context.config.mode === "development",
74
+ workspaceConfig: { workspaceRoot: context.workspaceConfig.workspaceRoot }
75
+ }, DEFAULT_TSUP_CONFIG);
76
+ result.format = getUnique(toArray(result.format));
77
+ return result;
78
+ }
79
+
80
+ //#endregion
81
+ export { resolveEntry$1 as n, resolveOptions as r, DEFAULT_TSUP_CONFIG as t };
82
+ //# sourceMappingURL=resolve-options-DvCBX8Wl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options-DvCBX8Wl.mjs","names":["DEFAULT_TSUP_CONFIG: Partial<TsupOptions>","resolveEntry","resolveEsbuildEntry"],"sources":["../src/helpers/resolve-options.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 { Context, ResolvedEntryTypeDefinition } from \"@powerlines/core/types\";\nimport { resolveEntry as resolveEsbuildEntry } from \"@powerlines/plugin-esbuild/helpers/resolve-options\";\nimport { AssetGlob, Entry } from \"@storm-software/build-tools/types\";\nimport { resolveOptions as resolveOptionsBase } from \"@storm-software/tsup\";\nimport { DEFAULT_BUILD_OPTIONS } from \"@storm-software/tsup/constants\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport defu from \"defu\";\nimport { Options } from \"tsup\";\nimport { TsupOptions, TsupPluginResolvedConfig } from \"../types\";\n\nexport const DEFAULT_TSUP_CONFIG: Partial<TsupOptions> = {\n ...DEFAULT_BUILD_OPTIONS,\n target: \"esnext\",\n config: false,\n minify: true,\n sourcemap: false,\n cjsInterop: true,\n bundle: true,\n dts: true,\n shims: true,\n silent: true,\n treeshake: true,\n keepNames: true,\n splitting: true,\n banner: {}\n};\n\n/**\n * Resolves the entry options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveEntry(\n context: Context,\n entryPoints: ResolvedEntryTypeDefinition[] | string[]\n): Entry {\n return resolveEsbuildEntry(context, entryPoints) as Entry;\n}\n\ntype TsupEsbuildOptionsHandler = NonNullable<Options[\"esbuildOptions\"]>;\ntype TsupEsbuildOptionsArgs = Parameters<TsupEsbuildOptionsHandler>;\ntype TsupEsbuildOptions = TsupEsbuildOptionsArgs[0];\ntype TsupEsbuildContext = TsupEsbuildOptionsArgs[1];\n\ninterface TsupResolvedBuildConfig extends Options {\n esbuildOptions?: TsupEsbuildOptionsHandler;\n workspaceConfig?: {\n workspaceRoot: string;\n };\n}\n\n/**\n * Resolves the options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(\n context: Context\n): Parameters<typeof resolveOptionsBase>[0] {\n const result = defu(\n {\n entry: Object.fromEntries(\n Object.entries(resolveEntry(context, context.entry)).map(\n ([key, value]) => [key, appendPath(value, context.config.root)]\n )\n ),\n esbuildOptions: ((\n options: TsupEsbuildOptions,\n ctx: TsupEsbuildContext\n ) => {\n if ((context.config as TsupPluginResolvedConfig).tsup?.esbuildOptions) {\n (context.config as TsupPluginResolvedConfig).tsup?.esbuildOptions?.(\n options,\n ctx\n );\n }\n\n options.alias = {\n ...context.alias,\n ...context.builtins.reduce(\n (ret, id) => {\n const path = context.fs.paths[id];\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n ),\n ...options.alias\n };\n }) as TsupResolvedBuildConfig[\"esbuildOptions\"],\n noExternal: context.builtins\n },\n (context.config as TsupPluginResolvedConfig).tsup\n ? (context.config as TsupPluginResolvedConfig).tsup\n : {},\n {\n name: context.config.name,\n root: context.config.root,\n projectRoot: context.config.root,\n assets: context.config.output.assets as (string | AssetGlob)[],\n resolveExtensions: context.config.resolve.extensions,\n outputPath: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n dts:\n (context.config as TsupPluginResolvedConfig).tsup &&\n !(context.config as TsupPluginResolvedConfig).tsup?.experimentalDts\n ? {\n compilerOptions: context.tsconfig.tsconfigJson.compilerOptions\n }\n : undefined,\n format: context.config.output.format,\n mode: context.config.mode,\n treeshake: (context.config as TsupPluginResolvedConfig).tsup\n ? (context.config as TsupPluginResolvedConfig).tsup?.treeshake\n : undefined,\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n silent:\n context.config.logLevel === null ||\n context.config.mode === \"production\",\n verbose:\n context.config.logLevel === null ||\n context.config.logLevel === \"trace\" ||\n context.config.mode === \"development\",\n workspaceConfig: { workspaceRoot: context.workspaceConfig.workspaceRoot }\n },\n DEFAULT_TSUP_CONFIG\n );\n\n result.format = getUnique(toArray(result.format));\n return result;\n}\n"],"mappings":";;;;;;;;AA8BA,MAAaA,sBAA4C;CACvD,GAAG;CACH,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,WAAW;CACX,YAAY;CACZ,QAAQ;CACR,KAAK;CACL,OAAO;CACP,QAAQ;CACR,WAAW;CACX,WAAW;CACX,WAAW;CACX,QAAQ,EAAE;CACX;;;;;;;;AASD,SAAgBC,eACd,SACA,aACO;AACP,QAAOC,aAAoB,SAAS,YAAY;;;;;;;;AAqBlD,SAAgB,eACd,SAC0C;CAC1C,MAAM,SAAS,KACb;EACE,OAAO,OAAO,YACZ,OAAO,QAAQD,eAAa,SAAS,QAAQ,MAAM,CAAC,CAAC,KAClD,CAAC,KAAK,WAAW,CAAC,KAAK,WAAW,OAAO,QAAQ,OAAO,KAAK,CAAC,CAChE,CACF;EACD,kBACE,SACA,QACG;AACH,OAAK,QAAQ,OAAoC,MAAM,eACrD,CAAC,QAAQ,OAAoC,MAAM,iBACjD,SACA,IACD;AAGH,WAAQ,QAAQ;IACd,GAAG,QAAQ;IACX,GAAG,QAAQ,SAAS,QACjB,KAAK,OAAO;KACX,MAAM,OAAO,QAAQ,GAAG,MAAM;AAC9B,SAAI,KACF,KAAI,MAAM;AAGZ,YAAO;OAET,EAAE,CACH;IACD,GAAG,QAAQ;IACZ;;EAEH,YAAY,QAAQ;EACrB,EACA,QAAQ,OAAoC,OACxC,QAAQ,OAAoC,OAC7C,EAAE,EACN;EACE,MAAM,QAAQ,OAAO;EACrB,MAAM,QAAQ,OAAO;EACrB,aAAa,QAAQ,OAAO;EAC5B,QAAQ,QAAQ,OAAO,OAAO;EAC9B,mBAAmB,QAAQ,OAAO,QAAQ;EAC1C,YAAY,QAAQ,OAAO,OAAO;EAClC,UAAU,QAAQ,SAAS;EAC3B,KACG,QAAQ,OAAoC,QAC7C,CAAE,QAAQ,OAAoC,MAAM,kBAChD,EACE,iBAAiB,QAAQ,SAAS,aAAa,iBAChD,GACD;EACN,QAAQ,QAAQ,OAAO,OAAO;EAC9B,MAAM,QAAQ,OAAO;EACrB,WAAY,QAAQ,OAAoC,OACnD,QAAQ,OAAoC,MAAM,YACnD;EACJ,QAAQ,QAAQ,OAAO,SAAS;EAChC,UAAU,QAAQ,OAAO,SAAS;EAClC,WAAW,QAAQ,OAAO,SAAS;EACnC,QACE,QAAQ,OAAO,aAAa,QAC5B,QAAQ,OAAO,SAAS;EAC1B,SACE,QAAQ,OAAO,aAAa,QAC5B,QAAQ,OAAO,aAAa,WAC5B,QAAQ,OAAO,SAAS;EAC1B,iBAAiB,EAAE,eAAe,QAAQ,gBAAgB,eAAe;EAC1E,EACD,oBACD;AAED,QAAO,SAAS,UAAU,QAAQ,OAAO,OAAO,CAAC;AACjD,QAAO"}
@@ -0,0 +1 @@
1
+ require('../build-DJTI0ZMx.cjs');
@@ -1,8 +1,2 @@
1
- import { BuildOptions } from "@storm-software/tsup/types";
2
-
3
- //#region src/types/build.d.ts
4
- type TsupOptions = Partial<Omit<BuildOptions, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">>;
5
- declare type __ΩTsupOptions = any[];
6
- //#endregion
7
- export { TsupOptions, __ΩTsupOptions };
8
- //# sourceMappingURL=build.d.cts.map
1
+ import { n as __ΩTsupOptions, t as TsupOptions } from "../build-C-zKo4UO.cjs";
2
+ export { TsupOptions, __ΩTsupOptions };
@@ -1,8 +1,2 @@
1
- import { BuildOptions } from "@storm-software/tsup/types";
2
-
3
- //#region src/types/build.d.ts
4
- type TsupOptions = Partial<Omit<BuildOptions, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">>;
5
- declare type __ΩTsupOptions = any[];
6
- //#endregion
7
- export { TsupOptions, __ΩTsupOptions };
8
- //# sourceMappingURL=build.d.mts.map
1
+ import { n as __ΩTsupOptions, t as TsupOptions } from "../build-D6oFtT4i.mjs";
2
+ export { TsupOptions, __ΩTsupOptions };
@@ -1 +1,3 @@
1
+ import "../build-XTM4L3VY.mjs";
2
+
1
3
  export { };
@@ -0,0 +1,3 @@
1
+ require('../build-DJTI0ZMx.cjs');
2
+ require('../plugin-D5qyQPqC.cjs');
3
+ require('../types-D208vOSb.cjs');
@@ -1,3 +1,4 @@
1
- import { TsupOptions, __ΩTsupOptions } from "./build.cjs";
2
- import { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig } from "./plugin.cjs";
1
+ import { n as __ΩTsupOptions, t as TsupOptions } from "../build-C-zKo4UO.cjs";
2
+ import { a as __ΩTsupPluginContext, c as __ΩTsupPluginUserConfig, i as TsupPluginUserConfig, n as TsupPluginOptions, o as __ΩTsupPluginOptions, r as TsupPluginResolvedConfig, s as __ΩTsupPluginResolvedConfig, t as TsupPluginContext } from "../plugin-BUuY_bKp.cjs";
3
+ import "../index-D4ELpJXS.cjs";
3
4
  export { TsupOptions, TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupOptions, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig };
@@ -1,3 +1,4 @@
1
- import { TsupOptions, __ΩTsupOptions } from "./build.mjs";
2
- import { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig } from "./plugin.mjs";
1
+ import { n as __ΩTsupOptions, t as TsupOptions } from "../build-D6oFtT4i.mjs";
2
+ import { a as __ΩTsupPluginContext, c as __ΩTsupPluginUserConfig, i as TsupPluginUserConfig, n as TsupPluginOptions, o as __ΩTsupPluginOptions, r as TsupPluginResolvedConfig, s as __ΩTsupPluginResolvedConfig, t as TsupPluginContext } from "../plugin-D0kb_w4D.mjs";
3
+ import "../index-2Ag-54t8.mjs";
3
4
  export { TsupOptions, TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupOptions, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig };
@@ -1 +1,5 @@
1
+ import "../build-XTM4L3VY.mjs";
2
+ import "../plugin-D3B5E_Hg.mjs";
3
+ import "../types-Dv2cgIDx.mjs";
4
+
1
5
  export { };
@@ -0,0 +1 @@
1
+ require('../plugin-D5qyQPqC.cjs');
@@ -1,20 +1,3 @@
1
- import { PluginContext } from "../core/src/types/context.cjs";
2
- import { ResolvedConfig, UserConfig } from "../core/src/types/config.cjs";
3
- import { TsupOptions } from "./build.cjs";
4
-
5
- //#region src/types/plugin.d.ts
6
- type TsupPluginOptions = Partial<TsupOptions>;
7
- interface TsupPluginUserConfig extends UserConfig {
8
- tsup?: TsupPluginOptions;
9
- }
10
- interface TsupPluginResolvedConfig extends ResolvedConfig {
11
- tsup: TsupOptions;
12
- }
13
- type TsupPluginContext<TResolvedConfig extends TsupPluginResolvedConfig = TsupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
14
- declare type __ΩTsupPluginOptions = any[];
15
- declare type __ΩTsupPluginUserConfig = any[];
16
- declare type __ΩTsupPluginResolvedConfig = any[];
17
- declare type __ΩTsupPluginContext = any[];
18
- //#endregion
19
- export { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig };
20
- //# sourceMappingURL=plugin.d.cts.map
1
+ import "../build-C-zKo4UO.cjs";
2
+ import { a as __ΩTsupPluginContext, c as __ΩTsupPluginUserConfig, i as TsupPluginUserConfig, n as TsupPluginOptions, o as __ΩTsupPluginOptions, r as TsupPluginResolvedConfig, s as __ΩTsupPluginResolvedConfig, t as TsupPluginContext } from "../plugin-BUuY_bKp.cjs";
3
+ export { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig };
@@ -1,21 +1,3 @@
1
- import { PluginContext } from "../core/src/types/context.mjs";
2
- import { ResolvedConfig, UserConfig } from "../core/src/types/config.mjs";
3
- import "../core/src/types/index.mjs";
4
- import { TsupOptions } from "./build.mjs";
5
-
6
- //#region src/types/plugin.d.ts
7
- type TsupPluginOptions = Partial<TsupOptions>;
8
- interface TsupPluginUserConfig extends UserConfig {
9
- tsup?: TsupPluginOptions;
10
- }
11
- interface TsupPluginResolvedConfig extends ResolvedConfig {
12
- tsup: TsupOptions;
13
- }
14
- type TsupPluginContext<TResolvedConfig extends TsupPluginResolvedConfig = TsupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
15
- declare type __ΩTsupPluginOptions = any[];
16
- declare type __ΩTsupPluginUserConfig = any[];
17
- declare type __ΩTsupPluginResolvedConfig = any[];
18
- declare type __ΩTsupPluginContext = any[];
19
- //#endregion
20
- export { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig };
21
- //# sourceMappingURL=plugin.d.mts.map
1
+ import "../build-D6oFtT4i.mjs";
2
+ import { a as __ΩTsupPluginContext, c as __ΩTsupPluginUserConfig, i as TsupPluginUserConfig, n as TsupPluginOptions, o as __ΩTsupPluginOptions, r as TsupPluginResolvedConfig, s as __ΩTsupPluginResolvedConfig, t as TsupPluginContext } from "../plugin-D0kb_w4D.mjs";
3
+ export { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig };
@@ -1 +1,3 @@
1
+ import "../plugin-D3B5E_Hg.mjs";
2
+
1
3
  export { };
File without changes
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,8 @@
1
+ import { t as TsupPluginContext } from "./plugin-BUuY_bKp.cjs";
2
+ import * as esbuild0 from "esbuild";
3
+
4
+ //#region src/helpers/unplugin.d.ts
5
+ declare function createTsupPlugin(context: TsupPluginContext): esbuild0.Plugin;
6
+ //#endregion
7
+ export { createTsupPlugin as t };
8
+ //# sourceMappingURL=unplugin-BNAHDEmx.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin-BNAHDEmx.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,gBAAA,UAA0B,oBAAiB,QAAA,CAAA"}
@@ -0,0 +1,16 @@
1
+ const require_resolve_options = require('./resolve-options-DPfS2t2w.cjs');
2
+ let __powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
3
+ let unplugin = require("unplugin");
4
+
5
+ //#region src/helpers/unplugin.ts
6
+ function createTsupPlugin(context) {
7
+ return (0, unplugin.createEsbuildPlugin)((0, __powerlines_core_lib_unplugin.createUnplugin)(context))({});
8
+ }
9
+
10
+ //#endregion
11
+ Object.defineProperty(exports, 'createTsupPlugin', {
12
+ enumerable: true,
13
+ get: function () {
14
+ return createTsupPlugin;
15
+ }
16
+ });
@@ -0,0 +1,11 @@
1
+ import { createUnplugin } from "@powerlines/core/lib/unplugin";
2
+ import { createEsbuildPlugin } from "unplugin";
3
+
4
+ //#region src/helpers/unplugin.ts
5
+ function createTsupPlugin(context) {
6
+ return createEsbuildPlugin(createUnplugin(context))({});
7
+ }
8
+
9
+ //#endregion
10
+ export { createTsupPlugin as t };
11
+ //# sourceMappingURL=unplugin-D-dKnxUW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin-D-dKnxUW.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/core/lib/unplugin\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { TsupPluginContext } from \"../types/plugin\";\n\nexport function createTsupPlugin(context: TsupPluginContext) {\n return createEsbuildPlugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,iBAAiB,SAA4B;AAC3D,QAAO,oBAAoB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { t as TsupPluginContext } from "./plugin-D0kb_w4D.mjs";
2
+ import * as esbuild0 from "esbuild";
3
+
4
+ //#region src/helpers/unplugin.d.ts
5
+ declare function createTsupPlugin(context: TsupPluginContext): esbuild0.Plugin;
6
+ //#endregion
7
+ export { createTsupPlugin as t };
8
+ //# sourceMappingURL=unplugin-DHNZtPIJ.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin-DHNZtPIJ.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,gBAAA,UAA0B,oBAAiB,QAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-tsup",
3
- "version": "0.12.307",
3
+ "version": "0.12.309",
4
4
  "private": false,
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "keywords": ["tsup", "powerlines", "storm-software", "powerlines-plugin"],
@@ -73,8 +73,8 @@
73
73
  "typings": "dist/index.d.mts",
74
74
  "files": ["dist/**/*"],
75
75
  "dependencies": {
76
- "@powerlines/core": "^0.0.8",
77
- "@powerlines/plugin-esbuild": "^0.13.306",
76
+ "@powerlines/core": "^0.0.10",
77
+ "@powerlines/plugin-esbuild": "^0.13.308",
78
78
  "@storm-software/build-tools": "^0.158.91",
79
79
  "@stryke/convert": "^0.6.40",
80
80
  "@stryke/helpers": "^0.9.42",
@@ -95,5 +95,5 @@
95
95
  "tsup": { "optional": false }
96
96
  },
97
97
  "publishConfig": { "access": "public" },
98
- "gitHead": "2c6fd0cd3aad8656cedb9912f2b5894730be7dd7"
98
+ "gitHead": "c5eba2320a22122bbefaca9aba105dd8a98f19b9"
99
99
  }
@@ -1,29 +0,0 @@
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,22 +0,0 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- require('../plugin-utils/paths.cjs');
3
- require("@stryke/convert/parse-type-definition");
4
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
5
- require("@stryke/hash/murmurhash");
6
- let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
7
- let __stryke_path_append = require("@stryke/path/append");
8
- require("@stryke/path/is-type");
9
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
10
- let __stryke_path_replace = require("@stryke/path/replace");
11
- require("@stryke/type-checks/is-object");
12
- require("@stryke/type-checks/is-regexp");
13
- require("@stryke/type-checks/is-set-string");
14
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
15
-
16
- //#region ../core/src/lib/entry.ts
17
- function resolveEntryOutput(context, typeDefinition) {
18
- return (0, __stryke_path_replace.replaceExtension)((0, __stryke_path_replace.replacePath)((0, __stryke_path_replace.replacePath)((0, __stryke_path_replace.replacePath)((0, __stryke_path_replace.replacePath)((0, __stryke_path_replace.replacePath)(typeDefinition.file, (0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root, "src")), (0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root)), (0, __stryke_path_join_paths.joinPaths)(context.config.root, "src")), context.config.root), "src"));
19
- }
20
-
21
- //#endregion
22
- exports.resolveEntryOutput = resolveEntryOutput;
@@ -1,22 +0,0 @@
1
- import "../plugin-utils/paths.mjs";
2
- import "@stryke/convert/parse-type-definition";
3
- import { toArray } from "@stryke/convert/to-array";
4
- import "@stryke/hash/murmurhash";
5
- import "@stryke/helpers/get-unique";
6
- import { appendPath } from "@stryke/path/append";
7
- import "@stryke/path/is-type";
8
- import { joinPaths } from "@stryke/path/join-paths";
9
- import { replaceExtension, replacePath } from "@stryke/path/replace";
10
- import "@stryke/type-checks/is-object";
11
- import "@stryke/type-checks/is-regexp";
12
- import "@stryke/type-checks/is-set-string";
13
- import { isString } from "@stryke/type-checks/is-string";
14
-
15
- //#region ../core/src/lib/entry.ts
16
- function resolveEntryOutput(context, typeDefinition) {
17
- return replaceExtension(replacePath(replacePath(replacePath(replacePath(replacePath(typeDefinition.file, joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, "src")), joinPaths(context.workspaceConfig.workspaceRoot, context.config.root)), joinPaths(context.config.root, "src")), context.config.root), "src"));
18
- }
19
-
20
- //#endregion
21
- export { resolveEntryOutput };
22
- //# sourceMappingURL=entry.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.mjs","names":[],"sources":["../../../../../core/src/lib/entry.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 { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { murmurhash } from \"@stryke/hash/murmurhash\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isRegExp } from \"@stryke/type-checks/is-regexp\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport type {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { replacePathTokens } from \"../plugin-utils/paths\";\nimport { BaseConfig } from \"../types\";\nimport { ResolvedEntryTypeDefinition } from \"../types/config\";\nimport type { Context } from \"../types/context\";\n\nexport function resolveEntryOutput(\n context: Context,\n typeDefinition: TypeDefinition\n): string {\n return replaceExtension(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n typeDefinition.file,\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n \"src\"\n )\n ),\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root\n )\n ),\n joinPaths(context.config.root, \"src\")\n ),\n context.config.root\n ),\n \"src\"\n )\n );\n}\n\nexport function resolveInput(\n context: Context,\n typeDefinition: TypeDefinition,\n input?: string | RegExp | TypeDefinition | undefined,\n output?: string\n): ResolvedEntryTypeDefinition {\n return {\n ...typeDefinition,\n input:\n isSetString(input) || isRegExp(input)\n ? { file: String(input) }\n : typeDefinition,\n output: output || resolveEntryOutput(context, typeDefinition)\n };\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport async function resolveInputs(\n context: Context,\n typeDefinitions:\n | TypeDefinition\n | ResolvedEntryTypeDefinition\n | string\n | RegExp\n | (string | RegExp | TypeDefinition | ResolvedEntryTypeDefinition)[]\n | Record<\n string,\n string | RegExp | TypeDefinition | (string | RegExp | TypeDefinition)[]\n >\n): Promise<ResolvedEntryTypeDefinition[]> {\n return (\n await Promise.all(\n (isObject(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(async entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else if (isRegExp(entry)) {\n typeDefinition = { file: replacePathTokens(context, entry.source) };\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(\n context,\n typeDefinition.file\n );\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (await context.fs.isFile(filePath)) {\n return resolveInput(\n context,\n {\n file: replacePath(filePath, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n );\n }\n\n return (\n await context.fs.glob(\n appendPath(filePath, context.workspaceConfig.workspaceRoot)\n )\n ).map(file =>\n resolveInput(\n context,\n {\n file: replacePath(file, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n )\n );\n })\n .flat()\n .filter(Boolean)\n )\n ).flat();\n}\n\n/**\n * Checks if the provided entry is a type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a type definition, false otherwise.\n */\nexport function isTypeDefinition(\n entry: TypeDefinitionParameter\n): entry is TypeDefinition {\n return !isString(entry) && entry.file !== undefined;\n}\n\n/**\n * Checks if the provided entry is a resolved entry type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a resolved entry type definition, false otherwise.\n */\nexport function isResolvedEntryTypeDefinition(\n entry: TypeDefinitionParameter | ResolvedEntryTypeDefinition | RegExp\n): entry is ResolvedEntryTypeDefinition {\n return (\n !isRegExp(entry) &&\n isTypeDefinition(entry) &&\n (entry as ResolvedEntryTypeDefinition).output !== undefined\n );\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport function resolveInputsSync(\n context: Context,\n typeDefinitions:\n | TypeDefinition\n | ResolvedEntryTypeDefinition\n | string\n | RegExp\n | (string | RegExp | TypeDefinition | ResolvedEntryTypeDefinition)[]\n | Record<\n string,\n string | RegExp | TypeDefinition | (string | RegExp | TypeDefinition)[]\n >\n): ResolvedEntryTypeDefinition[] {\n return (\n isObject(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else if (isRegExp(entry)) {\n typeDefinition = { file: replacePathTokens(context, entry.source) };\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(context, typeDefinition.file);\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (context.fs.isFileSync(filePath)) {\n return resolveInput(context, {\n file: appendPath(filePath, context.workspaceConfig.workspaceRoot),\n name: typeDefinition.name\n });\n }\n\n return context.fs\n .globSync(appendPath(filePath, context.workspaceConfig.workspaceRoot))\n .map(file =>\n resolveInput(context, {\n file,\n name: typeDefinition.name\n })\n );\n })\n .flat()\n .filter(Boolean);\n}\n\n/**\n * Get unique inputs from the provided list.\n *\n * @param inputs - The entry points to process.\n * @returns An array of unique inputs (by file path or content hash).\n */\nexport function getUniqueInputs(\n inputs: BaseConfig[\"input\"] = []\n): BaseConfig[\"input\"] {\n return isObject(inputs)\n ? inputs\n : getUniqueBy(toArray(inputs), (item: TypeDefinitionParameter) =>\n isSetString(item) ? item : murmurhash(item ?? {}, { maxLength: 24 })\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAuCA,SAAgB,mBACd,SACA,gBACQ;AACR,QAAO,iBACL,YACE,YACE,YACE,YACE,YACE,eAAe,MACf,UACE,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,MACf,MACD,CACF,EACD,UACE,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,KAChB,CACF,EACD,UAAU,QAAQ,OAAO,MAAM,MAAM,CACtC,EACD,QAAQ,OAAO,KAChB,EACD,MACD,CACF"}
@@ -1,41 +0,0 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
3
- let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
4
- let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
5
- require("@storm-software/config-tools/logger");
6
- require("@storm-software/config-tools/utilities/colors");
7
- require("@stryke/helpers/noop");
8
- let chalk = require("chalk");
9
- chalk = require_rolldown_runtime.__toESM(chalk);
10
-
11
- //#region ../core/src/lib/logger.ts
12
- const BADGE_COLORS = [
13
- "#00A0DD",
14
- "#6FCE4E",
15
- "#FBBF24",
16
- "#F43F5E",
17
- "#3B82F6",
18
- "#A855F7",
19
- "#469592",
20
- "#288EDF",
21
- "#D8B4FE",
22
- "#10B981",
23
- "#EF4444",
24
- "#F0EC56",
25
- "#F472B6",
26
- "#22D3EE",
27
- "#EAB308",
28
- "#84CC16",
29
- "#F87171",
30
- "#0EA5E9",
31
- "#D946EF",
32
- "#FACC15",
33
- "#34D399",
34
- "#8B5CF6"
35
- ];
36
- const extendLog = (logFn, name) => {
37
- return (type, ...args) => logFn(type, ` ${chalk.default.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${(0, __stryke_string_format_title_case.titleCase)(name)} `)} ${args.join(" ")} `);
38
- };
39
-
40
- //#endregion
41
- exports.extendLog = extendLog;