@powerlines/plugin-babel 0.12.455 → 0.13.0
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/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts +22 -0
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +22 -0
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -93,7 +93,7 @@ const plugin = (options = {}) => {
|
|
|
93
93
|
if (!result?.code) throw new Error(`Powerlines - Babel plugin failed to compile ${id}`);
|
|
94
94
|
this.trace(`Completed babel transformations for file: ${id}`);
|
|
95
95
|
return {
|
|
96
|
-
code: result.code,
|
|
96
|
+
code: this.config.babel?.skipTransform ? code : result.code,
|
|
97
97
|
id
|
|
98
98
|
};
|
|
99
99
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -90,7 +90,7 @@ const plugin = (options = {}) => {
|
|
|
90
90
|
if (!result?.code) throw new Error(`Powerlines - Babel plugin failed to compile ${id}`);
|
|
91
91
|
this.trace(`Completed babel transformations for file: ${id}`);
|
|
92
92
|
return {
|
|
93
|
-
code: result.code,
|
|
93
|
+
code: this.config.babel?.skipTransform ? code : result.code,
|
|
94
94
|
id
|
|
95
95
|
};
|
|
96
96
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { PluginItem, PresetItem, transformAsync } from \"@babel/core\";\nimport type { Plugin } from \"@powerlines/core\";\nimport { removeVirtualPrefix } from \"@powerlines/core/plugin-utils\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { findFileExtensionSafe } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { isEmptyObject } from \"@stryke/type-checks/is-empty-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport defu from \"defu\";\nimport { isSet } from \"node:util/types\";\nimport { isDuplicatePlugin, isDuplicatePreset } from \"./helpers/filters\";\nimport {\n getUniquePlugins,\n getUniquePresets,\n resolveBabelPlugin,\n resolveBabelPreset\n} from \"./helpers/options\";\nimport {\n ResolvedBabelTransformPluginOptions,\n ResolvedBabelTransformPresetOptions\n} from \"./types/config\";\nimport { BabelPluginContext, BabelPluginOptions } from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n babel?: BabelPluginOptions;\n }\n}\n\n/**\n * Babel plugin for Powerlines.\n *\n * @param options - The Babel plugin user configuration options.\n * @returns A Powerlines plugin that integrates Babel transformations.\n */\nexport const plugin = <\n TContext extends BabelPluginContext = BabelPluginContext\n>(\n options: BabelPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"babel\",\n config() {\n if (!isSetObject(options)) {\n return undefined;\n }\n\n return {\n babel: options\n };\n },\n configResolved: {\n order: \"pre\",\n handler() {\n this.config.babel = defu(this.config.babel ?? {}, {\n plugins: [],\n presets: []\n });\n\n this.config.babel.plugins = getUniquePlugins(this.config.babel.plugins);\n this.config.babel.presets = getUniquePresets(this.config.babel.presets);\n }\n },\n async transform(code: string, id: string) {\n if (\n isParentPath(id, this.powerlinesPath) ||\n code.includes(\"/* @powerlines-ignore */\") ||\n code.includes(\"/* @powerlines-disable */\")\n ) {\n this.trace(`Skipping Babel transformation for: ${id}`);\n\n return { code, id };\n }\n\n const plugins = getUniquePlugins(\n this.config.babel.plugins\n .map(plugin => resolveBabelPlugin(this, code, id, plugin))\n .filter(Boolean) as ResolvedBabelTransformPluginOptions[]\n );\n const presets = getUniquePresets(\n this.config.babel.presets\n .map(preset => resolveBabelPreset(this, code, id, preset))\n .filter(Boolean) as ResolvedBabelTransformPresetOptions[]\n );\n\n if (\n Array.isArray(plugins) &&\n plugins.length === 0 &&\n Array.isArray(presets) &&\n presets.length === 0\n ) {\n return { code, id };\n }\n\n if (!this.config.babel?.skipConfigResolution) {\n if (\n /^(?:m|c)?tsx?$/.test(\n findFileExtensionSafe(id, {\n fullExtension: true\n })\n ) &&\n !isDuplicatePlugin(plugins, \"@babel/plugin-syntax-typescript\") &&\n !isDuplicatePreset(presets, \"@babel/preset-typescript\")\n ) {\n plugins.unshift(\"@babel/plugin-syntax-typescript\");\n }\n\n if (\n /^(?:t|j)sx$/.test(\n findFileExtensionSafe(id, {\n fullExtension: true\n })\n ) &&\n !isDuplicatePlugin(plugins, \"@babel/plugin-syntax-jsx\") &&\n !isDuplicatePreset(presets, \"@babel/preset-react\")\n ) {\n plugins.unshift(\"@babel/plugin-syntax-jsx\");\n }\n }\n\n this.trace(\n `Running babel transformations with ${plugins.length} plugins and ${\n presets.length\n } presets for file: ${id}`\n );\n\n const result = await transformAsync(code, {\n cwd: this.config.cwd,\n highlightCode: true,\n code: true,\n ast: false,\n cloneInputAst: false,\n comments: true,\n sourceType: \"module\",\n configFile: false,\n babelrc: false,\n envName: this.config.mode,\n caller: {\n name: this.config.framework\n },\n ...omit(this.config.babel ?? {}, [\"skipConfigResolution\"]),\n filename: removeVirtualPrefix(id),\n plugins: plugins\n .map(plugin => {\n if (Array.isArray(plugin) && plugin.length >= 2) {\n if (\n plugin\n .slice(1)\n .every(item => !isSet(item) || isEmptyObject(item))\n ) {\n return plugin[0];\n }\n\n return [\n plugin[0],\n plugin.length > 1 && plugin[1] ? plugin[1] : {}\n ];\n }\n\n return plugin;\n })\n .filter(Boolean) as PluginItem<object>[],\n presets: presets\n .map(preset => {\n if (Array.isArray(preset) && preset.length >= 2) {\n if (\n preset\n .slice(1)\n .every(item => !isSet(item) || isEmptyObject(item))\n ) {\n return preset[0];\n }\n\n return [\n preset[0],\n preset.length > 1 && preset[1] ? preset[1] : {}\n ];\n }\n\n return preset;\n })\n .filter(Boolean) as PresetItem<object>[]\n });\n if (!result?.code) {\n throw new Error(`Powerlines - Babel plugin failed to compile ${id}`);\n }\n\n this.trace(`Completed babel transformations for file: ${id}`);\n\n return { code: result.code
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { PluginItem, PresetItem, transformAsync } from \"@babel/core\";\nimport type { Plugin } from \"@powerlines/core\";\nimport { removeVirtualPrefix } from \"@powerlines/core/plugin-utils\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { findFileExtensionSafe } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { isEmptyObject } from \"@stryke/type-checks/is-empty-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport defu from \"defu\";\nimport { isSet } from \"node:util/types\";\nimport { isDuplicatePlugin, isDuplicatePreset } from \"./helpers/filters\";\nimport {\n getUniquePlugins,\n getUniquePresets,\n resolveBabelPlugin,\n resolveBabelPreset\n} from \"./helpers/options\";\nimport {\n ResolvedBabelTransformPluginOptions,\n ResolvedBabelTransformPresetOptions\n} from \"./types/config\";\nimport { BabelPluginContext, BabelPluginOptions } from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n babel?: BabelPluginOptions;\n }\n}\n\n/**\n * Babel plugin for Powerlines.\n *\n * @param options - The Babel plugin user configuration options.\n * @returns A Powerlines plugin that integrates Babel transformations.\n */\nexport const plugin = <\n TContext extends BabelPluginContext = BabelPluginContext\n>(\n options: BabelPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"babel\",\n config() {\n if (!isSetObject(options)) {\n return undefined;\n }\n\n return {\n babel: options\n };\n },\n configResolved: {\n order: \"pre\",\n handler() {\n this.config.babel = defu(this.config.babel ?? {}, {\n plugins: [],\n presets: []\n });\n\n this.config.babel.plugins = getUniquePlugins(this.config.babel.plugins);\n this.config.babel.presets = getUniquePresets(this.config.babel.presets);\n }\n },\n async transform(code: string, id: string) {\n if (\n isParentPath(id, this.powerlinesPath) ||\n code.includes(\"/* @powerlines-ignore */\") ||\n code.includes(\"/* @powerlines-disable */\")\n ) {\n this.trace(`Skipping Babel transformation for: ${id}`);\n\n return { code, id };\n }\n\n const plugins = getUniquePlugins(\n this.config.babel.plugins\n .map(plugin => resolveBabelPlugin(this, code, id, plugin))\n .filter(Boolean) as ResolvedBabelTransformPluginOptions[]\n );\n const presets = getUniquePresets(\n this.config.babel.presets\n .map(preset => resolveBabelPreset(this, code, id, preset))\n .filter(Boolean) as ResolvedBabelTransformPresetOptions[]\n );\n\n if (\n Array.isArray(plugins) &&\n plugins.length === 0 &&\n Array.isArray(presets) &&\n presets.length === 0\n ) {\n return { code, id };\n }\n\n if (!this.config.babel?.skipConfigResolution) {\n if (\n /^(?:m|c)?tsx?$/.test(\n findFileExtensionSafe(id, {\n fullExtension: true\n })\n ) &&\n !isDuplicatePlugin(plugins, \"@babel/plugin-syntax-typescript\") &&\n !isDuplicatePreset(presets, \"@babel/preset-typescript\")\n ) {\n plugins.unshift(\"@babel/plugin-syntax-typescript\");\n }\n\n if (\n /^(?:t|j)sx$/.test(\n findFileExtensionSafe(id, {\n fullExtension: true\n })\n ) &&\n !isDuplicatePlugin(plugins, \"@babel/plugin-syntax-jsx\") &&\n !isDuplicatePreset(presets, \"@babel/preset-react\")\n ) {\n plugins.unshift(\"@babel/plugin-syntax-jsx\");\n }\n }\n\n this.trace(\n `Running babel transformations with ${plugins.length} plugins and ${\n presets.length\n } presets for file: ${id}`\n );\n\n const result = await transformAsync(code, {\n cwd: this.config.cwd,\n highlightCode: true,\n code: true,\n ast: false,\n cloneInputAst: false,\n comments: true,\n sourceType: \"module\",\n configFile: false,\n babelrc: false,\n envName: this.config.mode,\n caller: {\n name: this.config.framework\n },\n ...omit(this.config.babel ?? {}, [\"skipConfigResolution\"]),\n filename: removeVirtualPrefix(id),\n plugins: plugins\n .map(plugin => {\n if (Array.isArray(plugin) && plugin.length >= 2) {\n if (\n plugin\n .slice(1)\n .every(item => !isSet(item) || isEmptyObject(item))\n ) {\n return plugin[0];\n }\n\n return [\n plugin[0],\n plugin.length > 1 && plugin[1] ? plugin[1] : {}\n ];\n }\n\n return plugin;\n })\n .filter(Boolean) as PluginItem<object>[],\n presets: presets\n .map(preset => {\n if (Array.isArray(preset) && preset.length >= 2) {\n if (\n preset\n .slice(1)\n .every(item => !isSet(item) || isEmptyObject(item))\n ) {\n return preset[0];\n }\n\n return [\n preset[0],\n preset.length > 1 && preset[1] ? preset[1] : {}\n ];\n }\n\n return preset;\n })\n .filter(Boolean) as PresetItem<object>[]\n });\n if (!result?.code) {\n throw new Error(`Powerlines - Babel plugin failed to compile ${id}`);\n }\n\n this.trace(`Completed babel transformations for file: ${id}`);\n\n return {\n code: this.config.babel?.skipTransform ? code : result.code,\n id\n };\n }\n } as Plugin<TContext>;\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwDA,MAAa,UAGX,UAA8B,EA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AAO,OAAO,gBAAgB,OAAO,OAAO;IACvD;IACD;;EAEJ"}
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -3,14 +3,36 @@ import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
|
3
3
|
|
|
4
4
|
//#region src/types/plugin.d.ts
|
|
5
5
|
type BabelPluginOptions = Partial<BabelUserConfig> & {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to skip resolving the Babel configuration. If true, the plugin will use the provided options as-is without attempting to resolve them against the file system or environment. This can be useful for performance optimization if you already have a fully resolved configuration or want to provide a custom configuration object directly.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue false
|
|
10
|
+
*/
|
|
6
11
|
skipConfigResolution?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to only run the babel plugin without actually transforming the code. This can be useful for performance optimization if you only want to use the plugin's features without modifying the code, such as for collecting metadata or performing side effects.
|
|
14
|
+
*
|
|
15
|
+
* @defaultValue false
|
|
16
|
+
*/
|
|
17
|
+
skipTransform?: boolean;
|
|
7
18
|
};
|
|
8
19
|
type BabelPluginUserConfig = UserConfig & {
|
|
9
20
|
babel?: BabelPluginOptions;
|
|
10
21
|
};
|
|
11
22
|
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
12
23
|
babel: BabelResolvedConfig & {
|
|
24
|
+
/**
|
|
25
|
+
* Whether to skip resolving the Babel configuration. If true, the plugin will use the provided options as-is without attempting to resolve them against the file system or environment. This can be useful for performance optimization if you already have a fully resolved configuration or want to provide a custom configuration object directly.
|
|
26
|
+
*
|
|
27
|
+
* @defaultValue false
|
|
28
|
+
*/
|
|
13
29
|
skipConfigResolution?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to only run the babel plugin without actually transforming the code. This can be useful for performance optimization if you only want to use the plugin's features without modifying the code, such as for collecting metadata or performing side effects.
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue false
|
|
34
|
+
*/
|
|
35
|
+
skipTransform?: boolean;
|
|
14
36
|
};
|
|
15
37
|
}
|
|
16
38
|
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAyBY,kBAAA,GAAqB,OAAA,CAAQ,eAAA
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAyBY,kBAAA,GAAqB,OAAA,CAAQ,eAAA;;AAAzC;;;;EAME,oBAAA;EANuC;;;;;EAavC,aAAA;AAAA;AAAA,KAGU,qBAAA,GAAwB,UAAA;EAClC,KAAA,GAAQ,kBAAA;AAAA;AAAA,UAGO,yBAAA,SAAkC,cAAA;EACjD,KAAA,EAAO,mBAAA;IAJmB;;AAG5B;;;IAOI,oBAAA;IAP+C;;;;;IAc/C,aAAA;EAAA;AAAA;AAAA,KAIQ,kBAAA,yBACc,yBAAA,GAA4B,yBAAA,IAClD,aAAA,CAAc,eAAA;AAAA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -3,14 +3,36 @@ import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
|
3
3
|
|
|
4
4
|
//#region src/types/plugin.d.ts
|
|
5
5
|
type BabelPluginOptions = Partial<BabelUserConfig> & {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to skip resolving the Babel configuration. If true, the plugin will use the provided options as-is without attempting to resolve them against the file system or environment. This can be useful for performance optimization if you already have a fully resolved configuration or want to provide a custom configuration object directly.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue false
|
|
10
|
+
*/
|
|
6
11
|
skipConfigResolution?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to only run the babel plugin without actually transforming the code. This can be useful for performance optimization if you only want to use the plugin's features without modifying the code, such as for collecting metadata or performing side effects.
|
|
14
|
+
*
|
|
15
|
+
* @defaultValue false
|
|
16
|
+
*/
|
|
17
|
+
skipTransform?: boolean;
|
|
7
18
|
};
|
|
8
19
|
type BabelPluginUserConfig = UserConfig & {
|
|
9
20
|
babel?: BabelPluginOptions;
|
|
10
21
|
};
|
|
11
22
|
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
12
23
|
babel: BabelResolvedConfig & {
|
|
24
|
+
/**
|
|
25
|
+
* Whether to skip resolving the Babel configuration. If true, the plugin will use the provided options as-is without attempting to resolve them against the file system or environment. This can be useful for performance optimization if you already have a fully resolved configuration or want to provide a custom configuration object directly.
|
|
26
|
+
*
|
|
27
|
+
* @defaultValue false
|
|
28
|
+
*/
|
|
13
29
|
skipConfigResolution?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to only run the babel plugin without actually transforming the code. This can be useful for performance optimization if you only want to use the plugin's features without modifying the code, such as for collecting metadata or performing side effects.
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue false
|
|
34
|
+
*/
|
|
35
|
+
skipTransform?: boolean;
|
|
14
36
|
};
|
|
15
37
|
}
|
|
16
38
|
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAyBY,kBAAA,GAAqB,OAAA,CAAQ,eAAA
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAyBY,kBAAA,GAAqB,OAAA,CAAQ,eAAA;;AAAzC;;;;EAME,oBAAA;EANuC;;;;;EAavC,aAAA;AAAA;AAAA,KAGU,qBAAA,GAAwB,UAAA;EAClC,KAAA,GAAQ,kBAAA;AAAA;AAAA,UAGO,yBAAA,SAAkC,cAAA;EACjD,KAAA,EAAO,mBAAA;IAJmB;;AAG5B;;;IAOI,oBAAA;IAP+C;;;;;IAc/C,aAAA;EAAA;AAAA;AAAA,KAIQ,kBAAA,yBACc,yBAAA,GAA4B,yBAAA,IAClD,aAAA,CAAc,eAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-babel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"keywords": ["babel", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@babel/helper-plugin-utils": "8.0.0-rc.4",
|
|
91
91
|
"@babel/parser": "8.0.0-rc.4",
|
|
92
92
|
"@babel/types": "8.0.0-rc.4",
|
|
93
|
-
"@powerlines/core": "^0.47.
|
|
93
|
+
"@powerlines/core": "^0.47.3",
|
|
94
94
|
"@storm-software/config-tools": "^1.190.1",
|
|
95
95
|
"@stryke/fs": "^0.33.70",
|
|
96
96
|
"@stryke/path": "^0.28.2",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"@babel/plugin-syntax-typescript": { "optional": true }
|
|
114
114
|
},
|
|
115
115
|
"publishConfig": { "access": "public" },
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "9c4b3c8956edda9e5f0f3354226077b0c25b09a2"
|
|
117
117
|
}
|