@powerlines/plugin-babel 0.12.207 → 0.12.208

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,8 +1,8 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
3
2
  let chalk = require("chalk");
4
3
  chalk = require_rolldown_runtime.__toESM(chalk);
5
4
  let __babel_helper_plugin_utils = require("@babel/helper-plugin-utils");
5
+ let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
6
6
  let powerlines_lib_logger = require("powerlines/lib/logger");
7
7
 
8
8
  //#region src/helpers/create-plugin.ts
@@ -1,6 +1,6 @@
1
- import { LogLevelLabel } from "@storm-software/config-tools/types";
2
1
  import chalk from "chalk";
3
2
  import { declare } from "@babel/helper-plugin-utils";
3
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
4
4
  import { extendLog } from "powerlines/lib/logger";
5
5
 
6
6
  //#region src/helpers/create-plugin.ts
@@ -1,6 +1,5 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_helpers_filters = require('./filters.cjs');
3
- let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
4
3
  let __stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
5
4
  let chalk = require("chalk");
6
5
  chalk = require_rolldown_runtime.__toESM(chalk);
@@ -25,7 +24,7 @@ function resolvePluginFunction(context, plugin) {
25
24
  function resolveBabelPlugin(context, code, id, plugin) {
26
25
  if (Array.isArray(plugin) && plugin.length > 0 && plugin[0]) {
27
26
  if (plugin.length > 2 && plugin[2] && (0, __stryke_type_checks_is_function.isFunction)(plugin[2]) && !plugin[2](code, id)) {
28
- context.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Skipping filtered Babel plugin ${chalk.default.bold.cyanBright(require_helpers_filters.getPluginName(plugin) || "unnamed")} for ${id}`);
27
+ context.trace(`Skipping filtered Babel plugin ${chalk.default.bold.cyanBright(require_helpers_filters.getPluginName(plugin) || "unnamed")} for ${id}`);
29
28
  return;
30
29
  }
31
30
  return plugin.length > 2 ? [
@@ -1,5 +1,4 @@
1
1
  import { getPluginName } from "./filters.mjs";
2
- import { LogLevelLabel } from "@storm-software/config-tools/types";
3
2
  import { isFunction } from "@stryke/type-checks/is-function";
4
3
  import chalk from "chalk";
5
4
 
@@ -23,7 +22,7 @@ function resolvePluginFunction(context, plugin) {
23
22
  function resolveBabelPlugin(context, code, id, plugin) {
24
23
  if (Array.isArray(plugin) && plugin.length > 0 && plugin[0]) {
25
24
  if (plugin.length > 2 && plugin[2] && isFunction(plugin[2]) && !plugin[2](code, id)) {
26
- context.log(LogLevelLabel.TRACE, `Skipping filtered Babel plugin ${chalk.bold.cyanBright(getPluginName(plugin) || "unnamed")} for ${id}`);
25
+ context.trace(`Skipping filtered Babel plugin ${chalk.bold.cyanBright(getPluginName(plugin) || "unnamed")} for ${id}`);
27
26
  return;
28
27
  }
29
28
  return plugin.length > 2 ? [
package/dist/index.cjs CHANGED
@@ -7,7 +7,6 @@ const require_helpers_create_plugin = require('./helpers/create-plugin.cjs');
7
7
  const require_helpers_module_helpers = require('./helpers/module-helpers.cjs');
8
8
  require('./helpers/index.cjs');
9
9
  let __babel_core = require("@babel/core");
10
- let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
11
10
  let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
12
11
  let __stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
13
12
  let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
@@ -40,13 +39,13 @@ const plugin = (options = {}) => {
40
39
  },
41
40
  async transform(code, id) {
42
41
  if ((0, __stryke_path_is_parent_path.isParentPath)(id, this.powerlinesPath) || code.includes("/* @storm-ignore */") || code.includes("/* @storm-disable */")) {
43
- this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Skipping Babel transformation for: ${id}`);
42
+ this.trace(`Skipping Babel transformation for: ${id}`);
44
43
  return {
45
44
  code,
46
45
  id
47
46
  };
48
47
  }
49
- this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Babel transforming file: ${id}`);
48
+ this.debug(`Babel transforming file: ${id}`);
50
49
  const plugins = this.config.transform.babel.plugins.map((plugin$1) => require_helpers_options.resolveBabelPlugin(this, code, id, plugin$1)).filter((plugin$1, _, arr) => plugin$1 && !require_helpers_filters.isDuplicatePlugin(arr, plugin$1));
51
50
  const presets = this.config.transform.babel.presets.map((preset) => require_helpers_options.resolveBabelPlugin(this, code, id, preset)).filter((preset, _, arr) => preset && !require_helpers_filters.isDuplicatePlugin(arr, preset));
52
51
  if (Array.isArray(plugins) && plugins.length === 0 && Array.isArray(presets) && presets.length === 0) return {
package/dist/index.mjs CHANGED
@@ -5,7 +5,6 @@ import { createBabelPlugin } from "./helpers/create-plugin.mjs";
5
5
  import { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from "./helpers/module-helpers.mjs";
6
6
  import "./helpers/index.mjs";
7
7
  import { transformAsync } from "@babel/core";
8
- import { LogLevelLabel } from "@storm-software/config-tools/types";
9
8
  import { findFileExtension, findFileExtensionSafe } from "@stryke/path/file-path-fns";
10
9
  import { isParentPath } from "@stryke/path/is-parent-path";
11
10
  import { isSetObject } from "@stryke/type-checks/is-set-object";
@@ -37,13 +36,13 @@ const plugin = (options = {}) => {
37
36
  },
38
37
  async transform(code, id) {
39
38
  if (isParentPath(id, this.powerlinesPath) || code.includes("/* @storm-ignore */") || code.includes("/* @storm-disable */")) {
40
- this.log(LogLevelLabel.TRACE, `Skipping Babel transformation for: ${id}`);
39
+ this.trace(`Skipping Babel transformation for: ${id}`);
41
40
  return {
42
41
  code,
43
42
  id
44
43
  };
45
44
  }
46
- this.log(LogLevelLabel.TRACE, `Babel transforming file: ${id}`);
45
+ this.debug(`Babel transforming file: ${id}`);
47
46
  const plugins = this.config.transform.babel.plugins.map((plugin$1) => resolveBabelPlugin(this, code, id, plugin$1)).filter((plugin$1, _, arr) => plugin$1 && !isDuplicatePlugin(arr, plugin$1));
48
47
  const presets = this.config.transform.babel.presets.map((preset) => resolveBabelPlugin(this, code, id, preset)).filter((preset, _, arr) => preset && !isDuplicatePlugin(arr, preset));
49
48
  if (Array.isArray(plugins) && plugins.length === 0 && Array.isArray(presets) && presets.length === 0) return {
@@ -15,6 +15,7 @@ import { DateString } from "compatx";
15
15
  import { PreviewOptions } from "vite";
16
16
 
17
17
  //#region ../powerlines/src/types/config.d.ts
18
+ type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
18
19
  type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
19
20
  /**
20
21
  * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
@@ -264,7 +265,7 @@ interface CommonUserConfig extends BaseConfig {
264
265
  *
265
266
  * @defaultValue "info"
266
267
  */
267
- logLevel?: LogLevelLabel | null;
268
+ logLevel?: LogLevel | null;
268
269
  /**
269
270
  * A custom logger function to use for logging messages
270
271
  */
@@ -431,4 +432,4 @@ type DeployInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Inlin
431
432
  command: "deploy";
432
433
  };
433
434
  //#endregion
434
- export { BabelUserConfig, BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, NewInlineConfig, OutputConfig, PluginConfig, PrepareInlineConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
435
+ export { BabelUserConfig, BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, NewInlineConfig, OutputConfig, PluginConfig, PrepareInlineConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
@@ -15,6 +15,7 @@ import { DateString } from "compatx";
15
15
  import { PreviewOptions } from "vite";
16
16
 
17
17
  //#region ../powerlines/src/types/config.d.ts
18
+ type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
18
19
  type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
19
20
  /**
20
21
  * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
@@ -264,7 +265,7 @@ interface CommonUserConfig extends BaseConfig {
264
265
  *
265
266
  * @defaultValue "info"
266
267
  */
267
- logLevel?: LogLevelLabel | null;
268
+ logLevel?: LogLevel | null;
268
269
  /**
269
270
  * A custom logger function to use for logging messages
270
271
  */
@@ -431,4 +432,4 @@ type DeployInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Inlin
431
432
  command: "deploy";
432
433
  };
433
434
  //#endregion
434
- export { BabelUserConfig, BaseConfig, BuildInlineConfig, CleanInlineConfig, CommonUserConfig, DeployConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, NewInlineConfig, OutputConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
435
+ export { BabelUserConfig, BaseConfig, BuildInlineConfig, CleanInlineConfig, CommonUserConfig, DeployConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, NewInlineConfig, OutputConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
@@ -8,5 +8,5 @@ import { Plugin, PluginHook, PluginHookFields, PluginHookFunctions, PluginHookOb
8
8
  import { HookFields, HookListOrders, HooksList, InferHookFunction, InferHookParameters, InferHookReturnType, InferHooksListItem, PluginHooksList, PluginHooksListItem, UnpluginHookFunctions, UnpluginHookList, UnpluginHookVariant, UnpluginHookVariantField, UnpluginHooksListItem } from "./hooks.mjs";
9
9
  import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig } from "./tsconfig.mjs";
10
10
  import { APIContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EnvironmentContext, EnvironmentContextPlugin, FetchOptions, InitContextOptions, MetaInfo, ParseOptions, PluginContext, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, TransformResult, UnresolvedContext, WithUnpluginBuildContext } from "./context.mjs";
11
- import { BabelUserConfig, BaseConfig, BuildInlineConfig, CleanInlineConfig, CommonUserConfig, DeployConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, NewInlineConfig, OutputConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig } from "./config.mjs";
11
+ import { BabelUserConfig, BaseConfig, BuildInlineConfig, CleanInlineConfig, CommonUserConfig, DeployConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, NewInlineConfig, OutputConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig } from "./config.mjs";
12
12
  import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginBuilder, BabelTransformPluginBuilderParams, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn, ImportSpecifier, ResolvedBabelTransformPluginOptions } from "./babel.mjs";
@@ -1,5 +1,5 @@
1
1
  import { BuilderVariant } from "./build.cjs";
2
- import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.cjs";
2
+ import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LogLevel, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.cjs";
3
3
  import { NonUndefined } from "@stryke/types/base";
4
4
  import { TypeDefinition } from "@stryke/types/configuration";
5
5
  import { AssetGlob } from "@stryke/types/file";
@@ -77,7 +77,7 @@ type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUse
77
77
  *
78
78
  * @defaultValue "info"
79
79
  */
80
- logLevel: "error" | "warn" | "info" | "debug" | "trace" | null;
80
+ logLevel: LogLevel | null;
81
81
  };
82
82
  type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
83
83
  type WebpackResolvedConfig = ResolvedConfig<WebpackUserConfig>;
@@ -1,5 +1,5 @@
1
1
  import { BuilderVariant } from "./build.mjs";
2
- import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.mjs";
2
+ import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LogLevel, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.mjs";
3
3
  import { NonUndefined } from "@stryke/types/base";
4
4
  import { TypeDefinition } from "@stryke/types/configuration";
5
5
  import { AssetGlob } from "@stryke/types/file";
@@ -77,7 +77,7 @@ type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUse
77
77
  *
78
78
  * @defaultValue "info"
79
79
  */
80
- logLevel: "error" | "warn" | "info" | "debug" | "trace" | null;
80
+ logLevel: LogLevel | null;
81
81
  };
82
82
  type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
83
83
  type WebpackResolvedConfig = ResolvedConfig<WebpackUserConfig>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-babel",
3
- "version": "0.12.207",
3
+ "version": "0.12.208",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -163,12 +163,12 @@
163
163
  "chalk": "5.6.2",
164
164
  "defu": "^6.1.4",
165
165
  "jiti": "^2.6.1",
166
- "powerlines": "^0.37.72"
166
+ "powerlines": "^0.37.73"
167
167
  },
168
168
  "devDependencies": {
169
- "@powerlines/plugin-plugin": "^0.12.150",
169
+ "@powerlines/plugin-plugin": "^0.12.151",
170
170
  "@types/node": "^24.10.9"
171
171
  },
172
172
  "publishConfig": { "access": "public" },
173
- "gitHead": "458556ca7def9536d1c1fbd770e005a004d0a513"
173
+ "gitHead": "df743ef7ebac849eb4ce90899884df4758b61172"
174
174
  }