@powerlines/plugin-tsdown 0.1.245 → 0.1.247
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/src/lib/unplugin/helpers.mjs +1 -1
- package/dist/core/src/lib/utilities/source-file.mjs +1 -0
- package/dist/core/src/lib/utilities/source-file.mjs.map +1 -1
- package/dist/{helpers → core/src/plugin-utils}/format-package-json.mjs +3 -3
- package/dist/core/src/plugin-utils/format-package-json.mjs.map +1 -0
- package/dist/core/src/plugin-utils/index.mjs +1 -0
- package/dist/core/src/plugin-utils/merge.mjs +1 -1
- package/dist/helpers/index.d.mts +1 -2
- package/dist/helpers/index.mjs +1 -2
- package/dist/helpers/resolve-options.mjs +2 -2
- package/dist/index.d.mts +2 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/dist/helpers/format-package-json.d.mts +0 -13
- package/dist/helpers/format-package-json.d.mts.map +0 -1
- package/dist/helpers/format-package-json.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-file.mjs","names":[],"sources":["../../../../../../core/src/lib/utilities/source-file.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 { readFileIfExistingSync } from \"@stryke/fs/read-file\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport MagicString from \"magic-string\";\nimport { TransformResult } from \"unplugin\";\nimport { SourceFile } from \"../../types/context\";\n\n/**\n * Get the string from the source.\n *\n * @param code - The source string or magic string.\n * @returns The source string.\n */\nexport function getString(\n code: string | MagicString | TransformResult\n): string {\n if (!code) {\n return \"\";\n }\n\n if (isString(code)) {\n return code;\n }\n\n if (isSetObject(code) && \"code\" in code) {\n return code.code;\n }\n\n return code.toString();\n}\n\n/**\n * Get the magic string.\n *\n * @param code - The source string or magic string.\n * @returns The magic string.\n */\nexport function getMagicString(code: string | MagicString): MagicString {\n if (isString(code)) {\n return new MagicString(code);\n }\n\n return code;\n}\n\n/**\n * Get the source file.\n *\n * @param code - The source code.\n * @param id - The name of the file.\n * @returns The source file.\n */\nexport function getSourceFile(\n code: string | MagicString,\n id: string\n): SourceFile {\n const content = code ?? readFileIfExistingSync(id);\n\n return {\n id,\n code: getMagicString(content),\n env: []\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"source-file.mjs","names":[],"sources":["../../../../../../core/src/lib/utilities/source-file.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 { readFileIfExistingSync } from \"@stryke/fs/read-file\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport MagicString from \"magic-string\";\nimport { TransformResult } from \"unplugin\";\nimport { SourceFile } from \"../../types/context\";\n\n/**\n * Get the string from the source.\n *\n * @param code - The source string or magic string.\n * @returns The source string.\n */\nexport function getString(\n code: string | MagicString | TransformResult\n): string {\n if (!code) {\n return \"\";\n }\n\n if (isString(code)) {\n return code;\n }\n\n if (isSetObject(code) && \"code\" in code) {\n return code.code;\n }\n\n return code.toString();\n}\n\n/**\n * Get the magic string.\n *\n * @param code - The source string or magic string.\n * @returns The magic string.\n */\nexport function getMagicString(code: string | MagicString): MagicString {\n if (isString(code)) {\n return new MagicString(code);\n }\n\n return code;\n}\n\n/**\n * Get the source file.\n *\n * @param code - The source code.\n * @param id - The name of the file.\n * @returns The source file.\n */\nexport function getSourceFile(\n code: string | MagicString,\n id: string\n): SourceFile {\n const content = code ?? readFileIfExistingSync(id);\n\n return {\n id,\n code: getMagicString(content),\n env: []\n };\n}\n"],"mappings":";;;;;;;;;;;;AA+BA,SAAgB,UACd,MACQ;AACR,KAAI,CAAC,KACH,QAAO;AAGT,KAAI,SAAS,KAAK,CAChB,QAAO;AAGT,KAAI,YAAY,KAAK,IAAI,UAAU,KACjC,QAAO,KAAK;AAGd,QAAO,KAAK,UAAU"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { format } from "../
|
|
1
|
+
import { format } from "../lib/utilities/format.mjs";
|
|
2
2
|
import { joinPaths } from "@stryke/path/join";
|
|
3
3
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
4
4
|
|
|
5
|
-
//#region src/
|
|
5
|
+
//#region ../core/src/plugin-utils/format-package-json.ts
|
|
6
6
|
/**
|
|
7
7
|
* Formats the `package.json` file in the project root.
|
|
8
8
|
*
|
|
9
|
-
* @param context - The
|
|
9
|
+
* @param context - The powerlines context.
|
|
10
10
|
*/
|
|
11
11
|
async function formatPackageJson(context) {
|
|
12
12
|
const packageJsonPath = joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, "package.json");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-package-json.mjs","names":[],"sources":["../../../../../core/src/plugin-utils/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 \"../lib/utilities/format\";\nimport { Context } from \"../types/context\";\n\n/**\n * Formats the `package.json` file in the project root.\n *\n * @param context - The powerlines context.\n */\nexport async function formatPackageJson(context: Context) {\n const packageJsonPath = joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n \"package.json\"\n );\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,SAAkB;CACxD,MAAM,kBAAkB,UACtB,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,MACf,eACD;CAED,MAAM,kBAAkB,MAAM,QAAQ,GAAG,KAAK,gBAAgB;AAC9D,KAAI,YAAY,gBAAgB,CAC9B,OAAM,QAAQ,GAAG,MACf,iBACA,MAAM,OAAO,SAAS,iBAAiB,gBAAgB,CACxD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getHookHandler, isPluginHook } from "./helpers.mjs";
|
|
2
|
-
import defu$1, { createDefu } from "defu";
|
|
3
2
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
3
|
+
import defu$1, { createDefu } from "defu";
|
|
4
4
|
import { isString } from "@stryke/type-checks/is-string";
|
|
5
5
|
|
|
6
6
|
//#region ../core/src/plugin-utils/merge.ts
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { formatPackageJson } from "./format-package-json.mjs";
|
|
2
1
|
import { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions } from "./resolve-options.mjs";
|
|
3
2
|
import { createTsdownPlugin } from "./unplugin.mjs";
|
|
4
|
-
export { DEFAULT_TSDOWN_CONFIG, createTsdownPlugin,
|
|
3
|
+
export { DEFAULT_TSDOWN_CONFIG, createTsdownPlugin, resolveFormat, resolveFromFormat, resolveOptions };
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { formatPackageJson } from "./format-package-json.mjs";
|
|
2
1
|
import { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions } from "./resolve-options.mjs";
|
|
3
2
|
import { createTsdownPlugin } from "./unplugin.mjs";
|
|
4
3
|
|
|
5
|
-
export { DEFAULT_TSDOWN_CONFIG, createTsdownPlugin,
|
|
4
|
+
export { DEFAULT_TSDOWN_CONFIG, createTsdownPlugin, resolveFormat, resolveFromFormat, resolveOptions };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getDependencyConfig } from "../core/src/plugin-utils/build-helpers.mjs";
|
|
2
2
|
import "../core/src/plugin-utils/index.mjs";
|
|
3
|
-
import defu$1 from "defu";
|
|
4
|
-
import { appendPath } from "@stryke/path/append";
|
|
5
3
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
4
|
+
import { appendPath } from "@stryke/path/append";
|
|
5
|
+
import defu$1 from "defu";
|
|
6
6
|
import { toArray } from "@stryke/convert/to-array";
|
|
7
7
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
8
8
|
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Plugin } from "./core/src/types/plugin.mjs";
|
|
2
2
|
import "./core/src/types/index.mjs";
|
|
3
|
+
import { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions } from "./helpers/resolve-options.mjs";
|
|
3
4
|
import { TsdownOptions, __ΩTsdownOptions } from "./types/build.mjs";
|
|
4
5
|
import { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig } from "./types/plugin.mjs";
|
|
5
|
-
import { formatPackageJson } from "./helpers/format-package-json.mjs";
|
|
6
|
-
import { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions } from "./helpers/resolve-options.mjs";
|
|
7
6
|
import { createTsdownPlugin } from "./helpers/unplugin.mjs";
|
|
8
7
|
import "./helpers/index.mjs";
|
|
9
8
|
import "./types/index.mjs";
|
|
@@ -14,5 +13,5 @@ import "./types/index.mjs";
|
|
|
14
13
|
*/
|
|
15
14
|
declare const plugin: <TContext extends TsdownPluginContext = TsdownPluginContext>(options?: TsdownPluginOptions) => Plugin<TContext>;
|
|
16
15
|
//#endregion
|
|
17
|
-
export { DEFAULT_TSDOWN_CONFIG, TsdownOptions, TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownOptions, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig, createTsdownPlugin, plugin as default, plugin,
|
|
16
|
+
export { DEFAULT_TSDOWN_CONFIG, TsdownOptions, TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownOptions, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig, createTsdownPlugin, plugin as default, plugin, resolveFormat, resolveFromFormat, resolveOptions };
|
|
18
17
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;cAoCa,0BACM,sBAAsB,+BAE9B,wBACR,OAAO"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatPackageJson } from "./
|
|
1
|
+
import { formatPackageJson } from "./core/src/plugin-utils/format-package-json.mjs";
|
|
2
2
|
import { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions } from "./helpers/resolve-options.mjs";
|
|
3
3
|
import { createTsdownPlugin } from "./helpers/unplugin.mjs";
|
|
4
4
|
import "./helpers/index.mjs";
|
|
@@ -32,5 +32,5 @@ const plugin = (options = {}) => {
|
|
|
32
32
|
var src_default = plugin;
|
|
33
33
|
|
|
34
34
|
//#endregion
|
|
35
|
-
export { DEFAULT_TSDOWN_CONFIG, createTsdownPlugin, src_default as default,
|
|
35
|
+
export { DEFAULT_TSDOWN_CONFIG, createTsdownPlugin, src_default as default, plugin, resolveFormat, resolveFromFormat, resolveOptions };
|
|
36
36
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["defu"],"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 {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["defu"],"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 { formatPackageJson } from \"@powerlines/core/plugin-utils/format-package-json\";\nimport { Plugin } from \"@powerlines/core/types\";\nimport defu from \"defu\";\nimport { build } from \"tsdown\";\nimport { resolveOptions } from \"./helpers/resolve-options\";\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 tsdown: {\n ...options\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 resolveOptions(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,QAAQ,EACN,GAAG,SACJ;IACF;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,mCAAmC;AAE9C,SAAM,MACJA,OACE;IACE,QAAQ;IACR,SAAS,CAAC,mBAAmB,KAAK,CAAC;IACpC,EACD,eAAe,KAAK,CACrB,CACF;AAED,SAAM,kBAAkB,KAAK;;EAEhC;;AAGH,kBAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-tsdown",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.247",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"keywords": ["tsdown", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"exports": {
|
|
43
43
|
".": "./dist/index.mjs",
|
|
44
44
|
"./helpers": "./dist/helpers/index.mjs",
|
|
45
|
-
"./helpers/format-package-json": "./dist/helpers/format-package-json.mjs",
|
|
46
45
|
"./helpers/resolve-options": "./dist/helpers/resolve-options.mjs",
|
|
47
46
|
"./helpers/unplugin": "./dist/helpers/unplugin.mjs",
|
|
48
47
|
"./types": "./dist/types/index.mjs",
|
|
@@ -55,13 +54,14 @@
|
|
|
55
54
|
"types": "./dist/index.d.mts",
|
|
56
55
|
"typings": "dist/index.d.mts",
|
|
57
56
|
"files": ["dist/**/*"],
|
|
57
|
+
"peerDependencies": { "tsdown": ">=0.16.0" },
|
|
58
|
+
"peerDependenciesMeta": { "tsdown": { "optional": false } },
|
|
58
59
|
"dependencies": {
|
|
59
|
-
"@powerlines/plugin-rolldown": "^0.7.
|
|
60
|
+
"@powerlines/plugin-rolldown": "^0.7.304",
|
|
60
61
|
"defu": "^6.1.4",
|
|
61
|
-
"tsdown": "0.17.0-beta.5",
|
|
62
62
|
"unplugin": "3.0.0-beta.3"
|
|
63
63
|
},
|
|
64
|
-
"devDependencies": { "@types/node": "^25.3.3" },
|
|
64
|
+
"devDependencies": { "tsdown": "0.17.0-beta.5", "@types/node": "^25.3.3" },
|
|
65
65
|
"publishConfig": { "access": "public" },
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "b4ba0b4904f7e4b6da2705b1678505387f1a8d0f"
|
|
67
67
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { TsdownPluginContext } from "../types/plugin.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/format-package-json.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Formats the `package.json` file in the project root.
|
|
7
|
-
*
|
|
8
|
-
* @param context - The Tsdown plugin context.
|
|
9
|
-
*/
|
|
10
|
-
declare function formatPackageJson(context: TsdownPluginContext): Promise<void>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { formatPackageJson };
|
|
13
|
-
//# sourceMappingURL=format-package-json.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-package-json.d.mts","names":[],"sources":["../../src/helpers/format-package-json.ts"],"sourcesContent":[],"mappings":";;;;;;AA4BA;;;iBAAsB,iBAAA,UAA2B,sBAAmB"}
|
|
@@ -1 +0,0 @@
|
|
|
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 { format } from \"@powerlines/core/lib/utilities/format\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\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.root,\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,MACf,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"}
|