@powerlines/plugin-tsup 0.12.300 → 0.12.301

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 (70) hide show
  1. package/dist/core/src/lib/entry.mjs +22 -0
  2. package/dist/core/src/lib/entry.mjs.map +1 -0
  3. package/dist/core/src/lib/logger.mjs +40 -0
  4. package/dist/core/src/lib/logger.mjs.map +1 -0
  5. package/dist/core/src/lib/unplugin/helpers.mjs +19 -0
  6. package/dist/core/src/lib/unplugin/helpers.mjs.map +1 -0
  7. package/dist/core/src/lib/unplugin/index.mjs +5 -0
  8. package/dist/core/src/lib/unplugin/module-resolution.mjs +66 -0
  9. package/dist/core/src/lib/unplugin/module-resolution.mjs.map +1 -0
  10. package/dist/core/src/lib/unplugin/plugin.mjs +71 -0
  11. package/dist/core/src/lib/unplugin/plugin.mjs.map +1 -0
  12. package/dist/core/src/lib/utilities/source-file.mjs +22 -0
  13. package/dist/core/src/lib/utilities/source-file.mjs.map +1 -0
  14. package/dist/core/src/plugin-utils/paths.mjs +4 -0
  15. package/dist/core/src/types/api.d.mts +103 -0
  16. package/dist/core/src/types/api.d.mts.map +1 -0
  17. package/dist/core/src/types/commands.d.mts +10 -0
  18. package/dist/core/src/types/commands.d.mts.map +1 -0
  19. package/dist/core/src/types/config.d.mts +551 -0
  20. package/dist/core/src/types/config.d.mts.map +1 -0
  21. package/dist/core/src/types/context.d.mts +511 -0
  22. package/dist/core/src/types/context.d.mts.map +1 -0
  23. package/dist/core/src/types/fs.d.mts +487 -0
  24. package/dist/core/src/types/fs.d.mts.map +1 -0
  25. package/dist/core/src/types/hooks.d.mts +99 -0
  26. package/dist/core/src/types/hooks.d.mts.map +1 -0
  27. package/dist/core/src/types/index.d.mts +9 -0
  28. package/dist/core/src/types/plugin.d.mts +204 -0
  29. package/dist/core/src/types/plugin.d.mts.map +1 -0
  30. package/dist/core/src/types/tsconfig.d.mts +70 -0
  31. package/dist/core/src/types/tsconfig.d.mts.map +1 -0
  32. package/dist/core/src/types/unplugin.d.mts +25 -0
  33. package/dist/core/src/types/unplugin.d.mts.map +1 -0
  34. package/dist/core/src/types/unplugin.mjs +22 -0
  35. package/dist/core/src/types/unplugin.mjs.map +1 -0
  36. package/dist/helpers/index.d.mts +2 -1
  37. package/dist/helpers/index.mjs +2 -1
  38. package/dist/helpers/resolve-options.d.mts +28 -0
  39. package/dist/helpers/resolve-options.d.mts.map +1 -0
  40. package/dist/helpers/resolve-options.mjs +82 -0
  41. package/dist/helpers/resolve-options.mjs.map +1 -0
  42. package/dist/helpers/unplugin.mjs +2 -1
  43. package/dist/helpers/unplugin.mjs.map +1 -1
  44. package/dist/index.d.mts +6 -3
  45. package/dist/index.d.mts.map +1 -1
  46. package/dist/index.mjs +5 -27
  47. package/dist/index.mjs.map +1 -1
  48. package/dist/plugin-esbuild/src/helpers/resolve-options.mjs +26 -0
  49. package/dist/plugin-esbuild/src/helpers/resolve-options.mjs.map +1 -0
  50. package/dist/types/build.d.mts +8 -0
  51. package/dist/types/build.d.mts.map +1 -0
  52. package/dist/types/build.mjs +1 -0
  53. package/dist/types/index.d.mts +2 -1
  54. package/dist/types/plugin.d.mts +11 -7
  55. package/dist/types/plugin.d.mts.map +1 -1
  56. package/package.json +19 -81
  57. package/dist/_virtual/rolldown_runtime.cjs +0 -29
  58. package/dist/helpers/index.cjs +0 -3
  59. package/dist/helpers/index.d.cts +0 -2
  60. package/dist/helpers/unplugin.cjs +0 -11
  61. package/dist/helpers/unplugin.d.cts +0 -8
  62. package/dist/helpers/unplugin.d.cts.map +0 -1
  63. package/dist/index.cjs +0 -56
  64. package/dist/index.d.cts +0 -14
  65. package/dist/index.d.cts.map +0 -1
  66. package/dist/types/index.cjs +0 -0
  67. package/dist/types/index.d.cts +0 -2
  68. package/dist/types/plugin.cjs +0 -0
  69. package/dist/types/plugin.d.cts +0 -17
  70. package/dist/types/plugin.d.cts.map +0 -1
@@ -0,0 +1,26 @@
1
+ import { resolveEntryOutput } from "../../../core/src/lib/entry.mjs";
2
+ import defu from "defu";
3
+ import { joinPaths } from "@stryke/path/join-paths";
4
+ import { replaceExtension, replacePath } from "@stryke/path/replace";
5
+ import { isString } from "@stryke/type-checks/is-string";
6
+ import "@stryke/string-format/camel-case";
7
+
8
+ //#region ../plugin-esbuild/src/helpers/resolve-options.ts
9
+ /**
10
+ * Resolves the entry options for esbuild.
11
+ *
12
+ * @param context - The build context.
13
+ * @param entryPoints - The entry points to resolve.
14
+ * @returns The resolved entry options.
15
+ */
16
+ function resolveEntry(context, entryPoints = []) {
17
+ return entryPoints.reduce((ret, entry) => {
18
+ if (isString(entry)) ret[replaceExtension(replacePath(entry, context.config.root))] = replacePath(entry, context.config.root);
19
+ else ret[entry.output || resolveEntryOutput(context, entry)] = entry.file;
20
+ return ret;
21
+ }, {});
22
+ }
23
+
24
+ //#endregion
25
+ export { resolveEntry };
26
+ //# sourceMappingURL=resolve-options.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options.mjs","names":[],"sources":["../../../../../plugin-esbuild/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 { resolveEntryOutput } from \"@powerlines/core/lib/entry\";\nimport type {\n Context,\n ResolvedEntryTypeDefinition\n} from \"@powerlines/core/types\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { BuildOptions, Format, LogLevel, Platform } from \"esbuild\";\nimport { EsbuildPluginContext } from \"../types/plugin\";\n\nexport const DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions> = {\n target: \"esnext\",\n platform: \"neutral\" as Platform,\n format: \"esm\" as Format,\n write: true,\n minify: true,\n sourcemap: false,\n bundle: true,\n treeShaking: true,\n keepNames: true,\n splitting: true,\n logLevel: \"silent\" as LogLevel\n};\n\n/**\n * Resolves the entry options for esbuild.\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): BuildOptions[\"entryPoints\"] {\n return entryPoints.reduce(\n (ret, entry) => {\n if (isString(entry)) {\n ret[replaceExtension(replacePath(entry, context.config.root))] =\n replacePath(entry, context.config.root);\n } else {\n ret[entry.output || resolveEntryOutput(context, entry)] = entry.file;\n }\n\n return ret;\n },\n {} as Record<string, string>\n );\n}\n\n/**\n * Resolves the esbuild options.\n *\n * @param context - The build context.\n * @returns The resolved esbuild options.\n */\nexport function resolveOptions(context: Context): BuildOptions {\n if (context.config.inject && Object.keys(context.config.inject).length > 0) {\n context.fs.writeSync(\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n ),\n Object.entries(context.config.inject)\n .map(([key, value]) => {\n if (value) {\n if (Array.isArray(value)) {\n if (camelCase(key) !== key) {\n if (value.length === 1) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n }\n } else if (value.length === 1) {\n return `\nimport ${key} from \"${value[0]}\";\nexport { ${key} };`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from \"${value[0]}\";\nexport { ${key} };`;\n }\n } else if (camelCase(key) !== key) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else {\n return `\nimport ${key} from \"${value}\";\nexport { ${key} };`;\n }\n }\n\n return \"\";\n })\n .join(\"\\n\")\n );\n }\n\n return defu(\n {\n alias: context.alias,\n inject:\n context.config.inject && Object.keys(context.config.inject).length > 0\n ? [\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n )\n ]\n : undefined\n },\n (context as EsbuildPluginContext).config?.esbuild\n ? (context as EsbuildPluginContext).config.esbuild\n : {},\n {\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n define: context.config.define,\n resolveExtensions: context.config.resolve.extensions,\n packages: context.config.resolve.skipNodeModulesBundle\n ? \"external\"\n : (context as EsbuildPluginContext).config?.esbuild\n ? ((context as EsbuildPluginContext).config?.esbuild as BuildOptions)\n .packages\n : undefined,\n format: (Array.isArray(context.config.output.format)\n ? context.config.output.format[0]\n : context.config.output.format) as Format,\n platform: context.config.platform,\n outdir: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\"\n },\n DEFAULT_ESBUILD_CONFIG\n ) as BuildOptions;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoDA,SAAgB,aACd,SACA,cAAwD,EAAE,EAC7B;AAC7B,QAAO,YAAY,QAChB,KAAK,UAAU;AACd,MAAI,SAAS,MAAM,CACjB,KAAI,iBAAiB,YAAY,OAAO,QAAQ,OAAO,KAAK,CAAC,IAC3D,YAAY,OAAO,QAAQ,OAAO,KAAK;MAEzC,KAAI,MAAM,UAAU,mBAAmB,SAAS,MAAM,IAAI,MAAM;AAGlE,SAAO;IAET,EAAE,CACH"}
@@ -0,0 +1,8 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.mts","names":[],"sources":["../../src/types/build.ts"],"sourcesContent":[],"mappings":";;;KAoBY,WAAA,GAAc,QACxB,KACE"}
@@ -0,0 +1 @@
1
+ export { };
@@ -1,2 +1,3 @@
1
+ import { TsupOptions, __ΩTsupOptions } from "./build.mjs";
1
2
  import { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig } from "./plugin.mjs";
2
- export { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig };
3
+ export { TsupOptions, TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupOptions, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig };
@@ -1,12 +1,16 @@
1
- import { TsupBuildConfig } from "powerlines/types/build";
2
- import { TsupUserConfig } from "powerlines/types/config";
3
- import { PluginContext } from "powerlines/types/context";
4
- import { TsupResolvedConfig } from "powerlines/types/resolved";
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
5
 
6
6
  //#region src/types/plugin.d.ts
7
- type TsupPluginOptions = Partial<TsupBuildConfig>;
8
- type TsupPluginUserConfig = TsupUserConfig;
9
- type TsupPluginResolvedConfig = TsupResolvedConfig;
7
+ type TsupPluginOptions = Partial<TsupOptions>;
8
+ interface TsupPluginUserConfig extends UserConfig {
9
+ tsup?: TsupPluginOptions;
10
+ }
11
+ interface TsupPluginResolvedConfig extends ResolvedConfig {
12
+ tsup: TsupOptions;
13
+ }
10
14
  type TsupPluginContext<TResolvedConfig extends TsupPluginResolvedConfig = TsupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
11
15
  declare type __ΩTsupPluginOptions = any[];
12
16
  declare type __ΩTsupPluginUserConfig = any[];
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAuBY,iBAAA,GAAoB,QAAQ;KAE5B,oBAAA,GAAuB;AAFvB,KAIA,wBAAA,GAA2B,kBAJP;AAEpB,KAIA,iBAJoB,CAAA,wBAKN,wBALuB,GAKI,wBALJ,CAAA,GAM7C,aAN6C,CAM/B,eAN+B,CAAA;AAErC,oCAA2B,GAAA,EAAA;AAE3B,uCAAiB,GAAA,EAAA;AACH,2CAAA,GAAA,EAAA;AAA2B,oCAAA,GAAA,EAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAyBY,iBAAA,GAAoB,QAAQ;UAEvB,oBAAA,SAA6B;SACrC;;AAHG,UAMK,wBAAA,SAAiC,cANX,CAAA;EAEtB,IAAA,EAKT,WALS;AAIjB;AAIY,KAAA,iBAAiB,CAAA,wBACH,wBADG,GACwB,wBADxB,CAAA,GAEzB,aAFyB,CAEX,eAFW,CAAA;AACH,oCAAA,GAAA,EAAA;AAA2B,uCAAA,GAAA,EAAA;AACnC,2CAAA,GAAA,EAAA;AAAd,oCAAA,GAAA,EAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-tsup",
3
- "version": "0.12.300",
3
+ "version": "0.12.301",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -38,98 +38,36 @@
38
38
  },
39
39
  "license": "Apache-2.0",
40
40
  "private": false,
41
- "main": "./dist/index.cjs",
41
+ "main": "./dist/index.mjs",
42
42
  "module": "./dist/index.mjs",
43
43
  "exports": {
44
- ".": {
45
- "require": {
46
- "types": "./dist/index.d.cts",
47
- "default": "./dist/index.cjs"
48
- },
49
- "import": {
50
- "types": "./dist/index.d.mts",
51
- "default": "./dist/index.mjs"
52
- },
53
- "default": {
54
- "types": "./dist/index.d.mts",
55
- "default": "./dist/index.mjs"
56
- }
57
- },
58
- "./helpers": {
59
- "require": {
60
- "types": "./dist/helpers/index.d.cts",
61
- "default": "./dist/helpers/index.cjs"
62
- },
63
- "import": {
64
- "types": "./dist/helpers/index.d.mts",
65
- "default": "./dist/helpers/index.mjs"
66
- },
67
- "default": {
68
- "types": "./dist/helpers/index.d.mts",
69
- "default": "./dist/helpers/index.mjs"
70
- }
71
- },
72
- "./helpers/unplugin": {
73
- "require": {
74
- "types": "./dist/helpers/unplugin.d.cts",
75
- "default": "./dist/helpers/unplugin.cjs"
76
- },
77
- "import": {
78
- "types": "./dist/helpers/unplugin.d.mts",
79
- "default": "./dist/helpers/unplugin.mjs"
80
- },
81
- "default": {
82
- "types": "./dist/helpers/unplugin.d.mts",
83
- "default": "./dist/helpers/unplugin.mjs"
84
- }
85
- },
86
- "./package.json": "./package.json",
87
- "./types": {
88
- "require": {
89
- "types": "./dist/types/index.d.cts",
90
- "default": "./dist/types/index.cjs"
91
- },
92
- "import": {
93
- "types": "./dist/types/index.d.mts",
94
- "default": "./dist/types/index.mjs"
95
- },
96
- "default": {
97
- "types": "./dist/types/index.d.mts",
98
- "default": "./dist/types/index.mjs"
99
- }
100
- },
101
- "./types/plugin": {
102
- "require": {
103
- "types": "./dist/types/plugin.d.cts",
104
- "default": "./dist/types/plugin.cjs"
105
- },
106
- "import": {
107
- "types": "./dist/types/plugin.d.mts",
108
- "default": "./dist/types/plugin.mjs"
109
- },
110
- "default": {
111
- "types": "./dist/types/plugin.d.mts",
112
- "default": "./dist/types/plugin.mjs"
113
- }
114
- }
44
+ ".": "./dist/index.mjs",
45
+ "./helpers": "./dist/helpers/index.mjs",
46
+ "./helpers/resolve-options": "./dist/helpers/resolve-options.mjs",
47
+ "./helpers/unplugin": "./dist/helpers/unplugin.mjs",
48
+ "./types": "./dist/types/index.mjs",
49
+ "./types/build": "./dist/types/build.mjs",
50
+ "./types/plugin": "./dist/types/plugin.mjs",
51
+ "./*": "./*"
115
52
  },
116
53
  "typings": "dist/index.d.mts",
117
54
  "files": ["dist/**/*"],
118
55
  "keywords": ["tsup", "powerlines", "storm-software", "powerlines-plugin"],
119
56
  "dependencies": {
120
- "@storm-software/tsup": "^0.2.88",
57
+ "@storm-software/tsup": "^0.2.89",
58
+ "@storm-software/build-tools": "^0.158.91",
59
+ "tsup": "8.4.0",
60
+ "@stryke/convert": "^0.6.40",
121
61
  "@stryke/path": "^0.26.6",
122
62
  "@stryke/type-checks": "^0.5.25",
123
63
  "@stryke/types": "^0.10.39",
64
+ "@stryke/helpers": "^0.9.42",
124
65
  "defu": "^6.1.4",
125
- "powerlines": "^0.38.57",
66
+ "@powerlines/plugin-esbuild": "^0.13.300",
126
67
  "unplugin": "3.0.0-beta.3"
127
68
  },
128
- "devDependencies": {
129
- "@powerlines/plugin-plugin": "^0.12.241",
130
- "@types/node": "^25.3.1"
131
- },
69
+ "devDependencies": { "@types/node": "^25.3.2" },
132
70
  "publishConfig": { "access": "public" },
133
- "types": "./dist/index.d.cts",
134
- "gitHead": "eb3dbd19bd153aa5a988bce09a1cf05d985cb04b"
71
+ "types": "./dist/index.d.mts",
72
+ "gitHead": "0dcb16f054b8a69915b074578e6d4dfa3ecc1529"
135
73
  }
@@ -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,3 +0,0 @@
1
- const require_helpers_unplugin = require('./unplugin.cjs');
2
-
3
- exports.createTsupPlugin = require_helpers_unplugin.createTsupPlugin;
@@ -1,2 +0,0 @@
1
- import { createTsupPlugin } from "./unplugin.cjs";
2
- export { createTsupPlugin };
@@ -1,11 +0,0 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let powerlines_lib_unplugin = require("powerlines/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_lib_unplugin.createUnplugin)(context))({});
8
- }
9
-
10
- //#endregion
11
- exports.createTsupPlugin = createTsupPlugin;
@@ -1,8 +0,0 @@
1
- import { TsupPluginContext } from "../types/plugin.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 };
8
- //# sourceMappingURL=unplugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,gBAAA,UAA0B,oBAAiB,QAAA,CAAA"}
package/dist/index.cjs DELETED
@@ -1,56 +0,0 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
- const require_helpers_unplugin = require('./helpers/unplugin.cjs');
4
- require('./helpers/index.cjs');
5
- let __storm_software_tsup = require("@storm-software/tsup");
6
- let __stryke_path_append = require("@stryke/path/append");
7
- let defu = require("defu");
8
- defu = require_rolldown_runtime.__toESM(defu);
9
- let powerlines_lib_build_tsup = require("powerlines/lib/build/tsup");
10
-
11
- //#region src/index.ts
12
- /**
13
- * A Powerlines plugin to use Tsup to build the project.
14
- */
15
- const plugin = (options = {}) => {
16
- return {
17
- name: "tsup",
18
- config() {
19
- this.debug("Providing default configuration for the Powerlines `tsup` build plugin.");
20
- return {
21
- output: { format: ["cjs", "esm"] },
22
- build: {
23
- ...options,
24
- variant: "tsup"
25
- }
26
- };
27
- },
28
- async build() {
29
- return (0, __storm_software_tsup.build)(await (0, __storm_software_tsup.resolveOptions)((0, defu.default)({
30
- config: false,
31
- entry: Object.fromEntries(Object.entries((0, powerlines_lib_build_tsup.resolveTsupEntry)(this, this.entry)).map(([key, value]) => [key, (0, __stryke_path_append.appendPath)(value, this.config.projectRoot)])),
32
- esbuildOptions: (options$1, ctx) => {
33
- if (this.config.build.variant === "tsup") {
34
- if (this.config.build.esbuildOptions) this.config.build.esbuildOptions?.(options$1, ctx);
35
- }
36
- options$1.alias = {
37
- ...this.builtins.reduce((ret, id) => {
38
- const path = this.fs.paths[id];
39
- if (path) ret[id] = path;
40
- return ret;
41
- }, {}),
42
- ...options$1.alias
43
- };
44
- },
45
- silent: false,
46
- verbose: true
47
- }, (0, powerlines_lib_build_tsup.extractTsupConfig)(this), { esbuildPlugins: [require_helpers_unplugin.createTsupPlugin(this)] })));
48
- }
49
- };
50
- };
51
- var src_default = plugin;
52
-
53
- //#endregion
54
- exports.createTsupPlugin = require_helpers_unplugin.createTsupPlugin;
55
- exports.default = src_default;
56
- exports.plugin = plugin;
package/dist/index.d.cts DELETED
@@ -1,14 +0,0 @@
1
- import { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig } from "./types/plugin.cjs";
2
- import { createTsupPlugin } from "./helpers/unplugin.cjs";
3
- import "./helpers/index.cjs";
4
- import "./types/index.cjs";
5
- import { Plugin } from "powerlines/types/plugin";
6
-
7
- //#region src/index.d.ts
8
- /**
9
- * A Powerlines plugin to use Tsup to build the project.
10
- */
11
- declare const plugin: <TContext extends TsupPluginContext = TsupPluginContext>(options?: TsupPluginOptions) => Plugin<TContext>;
12
- //#endregion
13
- export { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig, createTsupPlugin, plugin as default, plugin };
14
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAqCa,cAAA,MAgFZ,EAAA,CAAA,iBAhFuC,iBAgFvC,GAhF2D,iBAgF3D,CAAA,CAAA,OAAA,CAAA,EA/EU,iBA+EV,EAAA,GA9EE,MA8EF,CA9ES,QA8ET,CAAA"}
File without changes
@@ -1,2 +0,0 @@
1
- import { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig } from "./plugin.cjs";
2
- export { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig };
File without changes
@@ -1,17 +0,0 @@
1
- import { TsupBuildConfig } from "powerlines/types/build";
2
- import { TsupUserConfig } from "powerlines/types/config";
3
- import { PluginContext } from "powerlines/types/context";
4
- import { TsupResolvedConfig } from "powerlines/types/resolved";
5
-
6
- //#region src/types/plugin.d.ts
7
- type TsupPluginOptions = Partial<TsupBuildConfig>;
8
- type TsupPluginUserConfig = TsupUserConfig;
9
- type TsupPluginResolvedConfig = TsupResolvedConfig;
10
- type TsupPluginContext<TResolvedConfig extends TsupPluginResolvedConfig = TsupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
11
- declare type __ΩTsupPluginOptions = any[];
12
- declare type __ΩTsupPluginUserConfig = any[];
13
- declare type __ΩTsupPluginResolvedConfig = any[];
14
- declare type __ΩTsupPluginContext = any[];
15
- //#endregion
16
- export { TsupPluginContext, TsupPluginOptions, TsupPluginResolvedConfig, TsupPluginUserConfig, __ΩTsupPluginContext, __ΩTsupPluginOptions, __ΩTsupPluginResolvedConfig, __ΩTsupPluginUserConfig };
17
- //# sourceMappingURL=plugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAuBY,iBAAA,GAAoB,QAAQ;KAE5B,oBAAA,GAAuB;AAFvB,KAIA,wBAAA,GAA2B,kBAJP;AAEpB,KAIA,iBAJoB,CAAA,wBAKN,wBALuB,GAKI,wBALJ,CAAA,GAM7C,aAN6C,CAM/B,eAN+B,CAAA;AAErC,oCAA2B,GAAA,EAAA;AAE3B,uCAAiB,GAAA,EAAA;AACH,2CAAA,GAAA,EAAA;AAA2B,oCAAA,GAAA,EAAA"}