@powerlines/plugin-babel 0.12.427 → 0.12.429
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.
|
@@ -4,7 +4,6 @@ let chalk = require("chalk");
|
|
|
4
4
|
chalk = require_runtime.__toESM(chalk, 1);
|
|
5
5
|
let _babel_helper_plugin_utils = require("@babel/helper-plugin-utils");
|
|
6
6
|
let _powerlines_core_lib_logger = require("@powerlines/core/lib/logger");
|
|
7
|
-
let _storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
8
7
|
|
|
9
8
|
//#region src/helpers/create-plugin.ts
|
|
10
9
|
/**
|
|
@@ -19,8 +18,11 @@ function createBabelPlugin(name, builder) {
|
|
|
19
18
|
return (0, _babel_helper_plugin_utils.declare)((api, options, dirname) => {
|
|
20
19
|
api.cache.using(() => context.meta.checksum);
|
|
21
20
|
api.assertVersion("^8.0.0-0");
|
|
22
|
-
const log = (0, _powerlines_core_lib_logger.
|
|
23
|
-
|
|
21
|
+
const log = (0, _powerlines_core_lib_logger.extendLogFn)(context.log, {
|
|
22
|
+
source: name,
|
|
23
|
+
category: "babel"
|
|
24
|
+
});
|
|
25
|
+
log("trace", `Initializing the ${chalk.default.bold.cyanBright(name)} Babel plugin`);
|
|
24
26
|
const result = builder({
|
|
25
27
|
log,
|
|
26
28
|
name,
|
|
@@ -30,7 +32,7 @@ function createBabelPlugin(name, builder) {
|
|
|
30
32
|
dirname
|
|
31
33
|
});
|
|
32
34
|
result.name = name;
|
|
33
|
-
log(
|
|
35
|
+
log("trace", `Completed initialization of the ${chalk.default.bold.cyanBright(name)} Babel plugin`);
|
|
34
36
|
return result;
|
|
35
37
|
});
|
|
36
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-plugin.d.cts","names":[],"sources":["../../src/helpers/create-plugin.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"create-plugin.d.cts","names":[],"sources":["../../src/helpers/create-plugin.ts"],"mappings":";;;;;;AAkCA;;;;;iBAAgB,iBAAA,kBACG,OAAA,GAAU,OAAA,mCAAA,CAG3B,IAAA,UACA,OAAA,EAAS,2BAAA,CAA4B,QAAA,EAAU,QAAA,IAC9C,iCAAA,CAAkC,QAAA,EAAU,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-plugin.d.mts","names":[],"sources":["../../src/helpers/create-plugin.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"create-plugin.d.mts","names":[],"sources":["../../src/helpers/create-plugin.ts"],"mappings":";;;;;;AAkCA;;;;;iBAAgB,iBAAA,kBACG,OAAA,GAAU,OAAA,mCAAA,CAG3B,IAAA,UACA,OAAA,EAAS,2BAAA,CAA4B,QAAA,EAAU,QAAA,IAC9C,iCAAA,CAAkC,QAAA,EAAU,QAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { declare } from "@babel/helper-plugin-utils";
|
|
3
|
-
import {
|
|
4
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
3
|
+
import { extendLogFn } from "@powerlines/core/lib/logger";
|
|
5
4
|
|
|
6
5
|
//#region src/helpers/create-plugin.ts
|
|
7
6
|
/**
|
|
@@ -16,8 +15,11 @@ function createBabelPlugin(name, builder) {
|
|
|
16
15
|
return declare((api, options, dirname) => {
|
|
17
16
|
api.cache.using(() => context.meta.checksum);
|
|
18
17
|
api.assertVersion("^8.0.0-0");
|
|
19
|
-
const log =
|
|
20
|
-
|
|
18
|
+
const log = extendLogFn(context.log, {
|
|
19
|
+
source: name,
|
|
20
|
+
category: "babel"
|
|
21
|
+
});
|
|
22
|
+
log("trace", `Initializing the ${chalk.bold.cyanBright(name)} Babel plugin`);
|
|
21
23
|
const result = builder({
|
|
22
24
|
log,
|
|
23
25
|
name,
|
|
@@ -27,7 +29,7 @@ function createBabelPlugin(name, builder) {
|
|
|
27
29
|
dirname
|
|
28
30
|
});
|
|
29
31
|
result.name = name;
|
|
30
|
-
log(
|
|
32
|
+
log("trace", `Completed initialization of the ${chalk.bold.cyanBright(name)} Babel plugin`);
|
|
31
33
|
return result;
|
|
32
34
|
});
|
|
33
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-plugin.mjs","names":[],"sources":["../../src/helpers/create-plugin.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 { declare } from \"@babel/helper-plugin-utils\";\nimport type { Context } from \"@powerlines/core\";\nimport {
|
|
1
|
+
{"version":3,"file":"create-plugin.mjs","names":[],"sources":["../../src/helpers/create-plugin.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 { declare } from \"@babel/helper-plugin-utils\";\nimport type { Context } from \"@powerlines/core\";\nimport { extendLogFn } from \"@powerlines/core/lib/logger\";\nimport chalk from \"chalk\";\nimport type {\n BabelTransformPluginBuilder,\n DeclareBabelTransformPluginReturn\n} from \"../types/config\";\n\n/**\n * Create a Babel plugin using the provided builder function.\n *\n * @param name - The name of the plugin.\n * @param builder - The builder function that defines the plugin behavior.\n * @returns A Babel plugin declaration.\n */\nexport function createBabelPlugin<\n TContext extends Context = Context,\n TOptions extends object = object\n>(\n name: string,\n builder: BabelTransformPluginBuilder<TContext, TOptions>\n): DeclareBabelTransformPluginReturn<TContext, TOptions> {\n const plugin = (context: TContext) => {\n return declare<TOptions>((api, options, dirname) => {\n api.cache.using(() => context.meta.checksum);\n api.assertVersion(\"^8.0.0-0\");\n\n const log = extendLogFn(context.log, { source: name, category: \"babel\" });\n log(\n \"trace\",\n `Initializing the ${chalk.bold.cyanBright(name)} Babel plugin`\n );\n\n const result = builder({\n log,\n name,\n api,\n options: options as TOptions,\n context,\n dirname\n });\n result.name = name;\n\n log(\n \"trace\",\n `Completed initialization of the ${chalk.bold.cyanBright(name)} Babel plugin`\n );\n\n return result;\n });\n };\n plugin.$$name = name;\n\n return plugin;\n}\n"],"mappings":";;;;;;;;;;;;AAkCA,SAAgB,kBAId,MACA,SACuD;CACvD,MAAM,UAAU,YAAsB;AACpC,SAAO,SAAmB,KAAK,SAAS,YAAY;AAClD,OAAI,MAAM,YAAY,QAAQ,KAAK,SAAS;AAC5C,OAAI,cAAc,WAAW;GAE7B,MAAM,MAAM,YAAY,QAAQ,KAAK;IAAE,QAAQ;IAAM,UAAU;IAAS,CAAC;AACzE,OACE,SACA,oBAAoB,MAAM,KAAK,WAAW,KAAK,CAAC,eACjD;GAED,MAAM,SAAS,QAAQ;IACrB;IACA;IACA;IACS;IACT;IACA;IACD,CAAC;AACF,UAAO,OAAO;AAEd,OACE,SACA,mCAAmC,MAAM,KAAK,WAAW,KAAK,CAAC,eAChE;AAED,UAAO;IACP;;AAEJ,QAAO,SAAS;AAEhB,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-babel",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.429",
|
|
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.3",
|
|
91
91
|
"@babel/parser": "8.0.0-rc.3",
|
|
92
92
|
"@babel/types": "8.0.0-rc.3",
|
|
93
|
-
"@powerlines/core": "^0.
|
|
93
|
+
"@powerlines/core": "^0.44.0",
|
|
94
94
|
"@storm-software/config-tools": "^1.189.78",
|
|
95
95
|
"@stryke/fs": "^0.33.69",
|
|
96
96
|
"@stryke/path": "^0.28.1",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"@babel/plugin-syntax-typescript": { "optional": true }
|
|
114
114
|
},
|
|
115
115
|
"publishConfig": { "access": "public" },
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "0c0e8330c47e0ba315ba3367a13a51a576fd9811"
|
|
117
117
|
}
|