@powerlines/plugin-tsup 0.12.428 → 0.12.430
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.
|
@@ -7,6 +7,7 @@ let _storm_software_tsup_constants = require("@storm-software/tsup/constants");
|
|
|
7
7
|
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
8
8
|
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
9
9
|
let _stryke_path_append = require("@stryke/path/append");
|
|
10
|
+
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
10
11
|
|
|
11
12
|
//#region src/helpers/resolve-options.ts
|
|
12
13
|
const DEFAULT_TSUP_CONFIG = {
|
|
@@ -63,7 +64,7 @@ function resolveOptions(context) {
|
|
|
63
64
|
projectRoot: context.config.root,
|
|
64
65
|
assets: context.config.output.copy ? context.config.output.copy.assets : void 0,
|
|
65
66
|
resolveExtensions: context.config.resolve.extensions,
|
|
66
|
-
outputPath: context.config.output.path,
|
|
67
|
+
outputPath: (0, _stryke_path_file_path_fns.relativePath)((0, _stryke_path_append.appendPath)(context.config.root, context.config.cwd), context.config.output.path),
|
|
67
68
|
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
68
69
|
dts: context.config.tsup && !context.config.tsup?.experimentalDts ? { compilerOptions: context.tsconfig.tsconfigJson.compilerOptions } : void 0,
|
|
69
70
|
format: context.config.output.format,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.d.cts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"resolve-options.d.cts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;;cA+Ba,mBAAA,EAAqB,OAAA,CAAQ,WAAA;;;AAA1C;;;;;iBAwBgB,YAAA,CACd,OAAA,EAAS,OAAA,EACT,WAAA,EAAa,2BAAA,gBACZ,KAAA;;;;;;;iBAea,cAAA,CACd,OAAA,EAAS,OAAA,GACR,UAAA,QAAkB,gBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.d.mts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"resolve-options.d.mts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;;cA+Ba,mBAAA,EAAqB,OAAA,CAAQ,WAAA;;;AAA1C;;;;;iBAwBgB,YAAA,CACd,OAAA,EAAS,OAAA,EACT,WAAA,EAAa,2BAAA,gBACZ,KAAA;;;;;;;iBAea,cAAA,CACd,OAAA,EAAS,OAAA,GACR,UAAA,QAAkB,gBAAA"}
|
|
@@ -4,6 +4,7 @@ import { DEFAULT_BUILD_OPTIONS } from "@storm-software/tsup/constants";
|
|
|
4
4
|
import { toArray } from "@stryke/convert/to-array";
|
|
5
5
|
import { getUnique } from "@stryke/helpers/get-unique";
|
|
6
6
|
import { appendPath } from "@stryke/path/append";
|
|
7
|
+
import { relativePath } from "@stryke/path/file-path-fns";
|
|
7
8
|
|
|
8
9
|
//#region src/helpers/resolve-options.ts
|
|
9
10
|
const DEFAULT_TSUP_CONFIG = {
|
|
@@ -60,7 +61,7 @@ function resolveOptions(context) {
|
|
|
60
61
|
projectRoot: context.config.root,
|
|
61
62
|
assets: context.config.output.copy ? context.config.output.copy.assets : void 0,
|
|
62
63
|
resolveExtensions: context.config.resolve.extensions,
|
|
63
|
-
outputPath: context.config.output.path,
|
|
64
|
+
outputPath: relativePath(appendPath(context.config.root, context.config.cwd), context.config.output.path),
|
|
64
65
|
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
65
66
|
dts: context.config.tsup && !context.config.tsup?.experimentalDts ? { compilerOptions: context.tsconfig.tsconfigJson.compilerOptions } : void 0,
|
|
66
67
|
format: context.config.output.format,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.mjs","names":["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\";\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\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 },\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.copy\n ? (context.config.output.copy.assets as (string | AssetGlob)[])\n : undefined,\n resolveExtensions: context.config.resolve.extensions,\n outputPath: context.config.output.path,\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:\n context.config.output.minify ?? context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap:\n context.config.output.sourceMap ??\n 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.config.cwd }\n },\n DEFAULT_TSUP_CONFIG\n );\n\n result.format = getUnique(toArray(result.format));\n return result as Parameters<typeof resolveOptionsBase>[0];\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-options.mjs","names":["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\";\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 { relativePath } from \"@stryke/path/file-path-fns\";\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\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 },\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.copy\n ? (context.config.output.copy.assets as (string | AssetGlob)[])\n : undefined,\n resolveExtensions: context.config.resolve.extensions,\n outputPath: relativePath(\n appendPath(context.config.root, context.config.cwd),\n context.config.output.path\n ),\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:\n context.config.output.minify ?? context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap:\n context.config.output.sourceMap ??\n 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.config.cwd }\n },\n DEFAULT_TSUP_CONFIG\n );\n\n result.format = getUnique(toArray(result.format));\n return result as Parameters<typeof resolveOptionsBase>[0];\n}\n"],"mappings":";;;;;;;;;AA+BA,MAAa,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,SAAgB,aACd,SACA,aACO;AACP,QAAOA,eAAoB,SAAS,YAAY;;;;;;;;AAclD,SAAgB,eACd,SAC0C;CAC1C,MAAM,SAAS,KACb;EACE,OAAO,OAAO,YACZ,OAAO,QAAQ,aAAa,SAAS,QAAQ,MAAM,CAAC,CAAC,KAClD,CAAC,KAAK,WAAW,CAAC,KAAK,WAAW,OAAO,QAAQ,OAAO,KAAK,CAAC,CAChE,CACF;EACD,iBACE,SACA,QACG;AACH,OAAK,QAAQ,OAAoC,MAAM,eACrD,CAAC,QAAQ,OAAo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C;AACjD,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-tsup",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.430",
|
|
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.43.
|
|
77
|
-
"@powerlines/plugin-esbuild": "^0.13.
|
|
76
|
+
"@powerlines/core": "^0.43.27",
|
|
77
|
+
"@powerlines/plugin-esbuild": "^0.13.428",
|
|
78
78
|
"@storm-software/build-tools": "^0.158.159",
|
|
79
79
|
"@stryke/convert": "^0.7.0",
|
|
80
80
|
"@stryke/helpers": "^0.10.9",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"tsup": { "optional": false }
|
|
96
96
|
},
|
|
97
97
|
"publishConfig": { "access": "public" },
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "ad851a239011b884c15b0444db518d74927fd13f"
|
|
99
99
|
}
|