@powerlines/plugin-babel 0.12.231 → 0.12.232
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_logger = require('../powerlines/src/lib/logger.cjs');
|
|
2
3
|
let chalk = require("chalk");
|
|
3
4
|
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
4
5
|
let __babel_helper_plugin_utils = require("@babel/helper-plugin-utils");
|
|
5
6
|
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
6
|
-
let powerlines_lib_logger = require("powerlines/lib/logger");
|
|
7
7
|
|
|
8
8
|
//#region src/helpers/create-plugin.ts
|
|
9
9
|
/**
|
|
@@ -18,7 +18,7 @@ function createBabelPlugin(name, builder) {
|
|
|
18
18
|
return (0, __babel_helper_plugin_utils.declare)((api, options, dirname) => {
|
|
19
19
|
api.cache.using(() => context.meta.checksum);
|
|
20
20
|
api.assertVersion("^7.0.0-0");
|
|
21
|
-
const log =
|
|
21
|
+
const log = require_logger.extendLog(context.log, name);
|
|
22
22
|
log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Initializing the ${chalk.default.bold.cyanBright(name)} Babel plugin`);
|
|
23
23
|
const result = builder({
|
|
24
24
|
log,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { extendLog } from "../powerlines/src/lib/logger.mjs";
|
|
1
2
|
import chalk from "chalk";
|
|
2
3
|
import { declare } from "@babel/helper-plugin-utils";
|
|
3
4
|
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
4
|
-
import { extendLog } from "powerlines/lib/logger";
|
|
5
5
|
|
|
6
6
|
//#region src/helpers/create-plugin.ts
|
|
7
7
|
/**
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let chalk = require("chalk");
|
|
3
|
+
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
4
|
+
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
5
|
+
require("@storm-software/config-tools/logger");
|
|
6
|
+
require("@storm-software/config-tools/utilities/colors");
|
|
7
|
+
require("@stryke/helpers/noop");
|
|
8
|
+
require("@stryke/string-format/kebab-case");
|
|
9
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
10
|
+
|
|
11
|
+
//#region ../powerlines/src/lib/logger.ts
|
|
12
|
+
const BADGE_COLORS = [
|
|
13
|
+
"#00A0DD",
|
|
14
|
+
"#6FCE4E",
|
|
15
|
+
"#FBBF24",
|
|
16
|
+
"#F43F5E",
|
|
17
|
+
"#3B82F6",
|
|
18
|
+
"#A855F7",
|
|
19
|
+
"#469592",
|
|
20
|
+
"#288EDF",
|
|
21
|
+
"#D8B4FE",
|
|
22
|
+
"#10B981",
|
|
23
|
+
"#EF4444",
|
|
24
|
+
"#F0EC56",
|
|
25
|
+
"#F472B6",
|
|
26
|
+
"#22D3EE",
|
|
27
|
+
"#EAB308",
|
|
28
|
+
"#84CC16",
|
|
29
|
+
"#F87171",
|
|
30
|
+
"#0EA5E9",
|
|
31
|
+
"#D946EF",
|
|
32
|
+
"#FACC15",
|
|
33
|
+
"#34D399",
|
|
34
|
+
"#8B5CF6"
|
|
35
|
+
];
|
|
36
|
+
const extendLog = (logFn, name) => {
|
|
37
|
+
return (type, ...args) => logFn(type, ` ${chalk.default.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${(0, __stryke_string_format_title_case.titleCase)(name)} `)} ${args.join(" ")} `);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
exports.extendLog = extendLog;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
3
|
+
import "@storm-software/config-tools/logger";
|
|
4
|
+
import "@storm-software/config-tools/utilities/colors";
|
|
5
|
+
import "@stryke/helpers/noop";
|
|
6
|
+
import "@stryke/string-format/kebab-case";
|
|
7
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
8
|
+
|
|
9
|
+
//#region ../powerlines/src/lib/logger.ts
|
|
10
|
+
const BADGE_COLORS = [
|
|
11
|
+
"#00A0DD",
|
|
12
|
+
"#6FCE4E",
|
|
13
|
+
"#FBBF24",
|
|
14
|
+
"#F43F5E",
|
|
15
|
+
"#3B82F6",
|
|
16
|
+
"#A855F7",
|
|
17
|
+
"#469592",
|
|
18
|
+
"#288EDF",
|
|
19
|
+
"#D8B4FE",
|
|
20
|
+
"#10B981",
|
|
21
|
+
"#EF4444",
|
|
22
|
+
"#F0EC56",
|
|
23
|
+
"#F472B6",
|
|
24
|
+
"#22D3EE",
|
|
25
|
+
"#EAB308",
|
|
26
|
+
"#84CC16",
|
|
27
|
+
"#F87171",
|
|
28
|
+
"#0EA5E9",
|
|
29
|
+
"#D946EF",
|
|
30
|
+
"#FACC15",
|
|
31
|
+
"#34D399",
|
|
32
|
+
"#8B5CF6"
|
|
33
|
+
];
|
|
34
|
+
const extendLog = (logFn, name) => {
|
|
35
|
+
return (type, ...args) => logFn(type, ` ${chalk.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${titleCase(name)} `)} ${args.join(" ")} `);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { extendLog };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-babel",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.232",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"repository": {
|
|
@@ -166,9 +166,9 @@
|
|
|
166
166
|
"powerlines": "^0.37.95"
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
169
|
+
"@powerlines/plugin-plugin": "^0.12.174",
|
|
170
170
|
"@types/node": "^24.10.9"
|
|
171
171
|
},
|
|
172
172
|
"publishConfig": { "access": "public" },
|
|
173
|
-
"gitHead": "
|
|
173
|
+
"gitHead": "2852dab8ff7cad2d1aa4a44d7fd2479d62f65d47"
|
|
174
174
|
}
|