@powerlines/plugin-babel 0.12.169 → 0.12.170
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/helpers/ast-utils.d.cts +2 -2
- package/dist/helpers/ast-utils.d.mts +2 -2
- package/dist/helpers/create-plugin.d.cts +1 -1
- package/dist/helpers/create-plugin.d.mts +1 -1
- package/dist/helpers/filters.d.cts +1 -1
- package/dist/helpers/filters.d.mts +1 -1
- package/dist/helpers/index.cjs +5 -22
- package/dist/helpers/index.d.mts +1 -2
- package/dist/helpers/index.mjs +1 -1
- package/dist/helpers/module-helpers.cjs +2 -2
- package/dist/helpers/module-helpers.d.cts +1 -1
- package/dist/helpers/options.cjs +2 -2
- package/dist/helpers/options.d.cts +1 -1
- package/dist/helpers/options.d.mts +1 -1
- package/dist/index.cjs +24 -24
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +1 -1
- package/dist/powerlines/src/types/api.d.cts +3 -3
- package/dist/powerlines/src/types/api.d.mts +3 -3
- package/dist/powerlines/src/types/babel.d.cts +1 -1
- package/dist/powerlines/src/types/babel.d.mts +1 -1
- package/dist/powerlines/src/types/build.d.cts +10 -10
- package/dist/powerlines/src/types/build.d.mts +10 -10
- package/dist/powerlines/src/types/commands.d.cts +1 -1
- package/dist/powerlines/src/types/commands.d.mts +1 -1
- package/dist/powerlines/src/types/config.d.cts +7 -7
- package/dist/powerlines/src/types/config.d.mts +7 -7
- package/dist/powerlines/src/types/context.d.cts +4 -4
- package/dist/powerlines/src/types/context.d.mts +4 -4
- package/dist/powerlines/src/types/hooks.d.cts +1 -1
- package/dist/powerlines/src/types/hooks.d.mts +1 -1
- package/dist/powerlines/src/types/index.d.mts +7 -7
- package/dist/powerlines/src/types/plugin.d.cts +4 -4
- package/dist/powerlines/src/types/plugin.d.mts +4 -4
- package/dist/powerlines/src/types/resolved.d.cts +1 -1
- package/dist/powerlines/src/types/resolved.d.mts +1 -1
- package/dist/powerlines/src/types/unplugin.d.cts +1 -1
- package/dist/powerlines/src/types/unplugin.d.mts +2 -2
- package/dist/types/index.d.mts +1 -2
- package/dist/types/plugin.d.cts +1 -1
- package/dist/types/plugin.d.mts +1 -1
- package/package.json +4 -4
- package/dist/helpers/index.d.cts +0 -6
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +0 -2
- package/dist/types/index.mjs +0 -1
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.mjs +0 -1
|
@@ -13,7 +13,7 @@ import * as t from "@babel/types";
|
|
|
13
13
|
*/
|
|
14
14
|
declare function parseAst(code: string, opts?: ParserOptions): ParseResult<t.File>;
|
|
15
15
|
type GenerateFromAstOptions = GeneratorOptions & Required<Pick<GeneratorOptions, "sourceFileName" | "filename">>;
|
|
16
|
-
declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult
|
|
16
|
+
declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult;
|
|
17
17
|
declare type __ΩGenerateFromAstOptions = any[];
|
|
18
18
|
//#endregion
|
|
19
|
-
export { GenerateFromAstOptions, type GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst };
|
|
19
|
+
export { GenerateFromAstOptions, type GeneratorResult$1 as GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst };
|
|
@@ -13,7 +13,7 @@ import * as t from "@babel/types";
|
|
|
13
13
|
*/
|
|
14
14
|
declare function parseAst(code: string, opts?: ParserOptions): ParseResult<t.File>;
|
|
15
15
|
type GenerateFromAstOptions = GeneratorOptions & Required<Pick<GeneratorOptions, "sourceFileName" | "filename">>;
|
|
16
|
-
declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult
|
|
16
|
+
declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult;
|
|
17
17
|
declare type __ΩGenerateFromAstOptions = any[];
|
|
18
18
|
//#endregion
|
|
19
|
-
export { GenerateFromAstOptions, type GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst };
|
|
19
|
+
export { GenerateFromAstOptions, type GeneratorResult$1 as GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from "../powerlines/src/types/context.cjs";
|
|
2
1
|
import { BabelTransformPluginBuilder, DeclareBabelTransformPluginReturn } from "../powerlines/src/types/babel.cjs";
|
|
2
|
+
import { Context } from "../powerlines/src/types/context.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/create-plugin.d.ts
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from "../powerlines/src/types/context.mjs";
|
|
2
1
|
import { BabelTransformPluginBuilder, DeclareBabelTransformPluginReturn } from "../powerlines/src/types/babel.mjs";
|
|
2
|
+
import { Context } from "../powerlines/src/types/context.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/create-plugin.d.ts
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from "../powerlines/src/types/context.cjs";
|
|
2
1
|
import { BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, ResolvedBabelTransformPluginOptions } from "../powerlines/src/types/babel.cjs";
|
|
2
|
+
import { Context } from "../powerlines/src/types/context.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/filters.d.ts
|
|
5
5
|
declare function getPluginName(plugin: BabelTransformPluginOptions): string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from "../powerlines/src/types/context.mjs";
|
|
2
1
|
import { BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, ResolvedBabelTransformPluginOptions } from "../powerlines/src/types/babel.mjs";
|
|
2
|
+
import { Context } from "../powerlines/src/types/context.mjs";
|
|
3
3
|
import "../powerlines/src/types/index.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/helpers/filters.d.ts
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
exports.addImport = require_helpers_module_helpers.addImport;
|
|
8
|
-
exports.addImportsToProgram = require_helpers_module_helpers.addImportsToProgram;
|
|
9
|
-
exports.addPluginFilter = require_helpers_filters.addPluginFilter;
|
|
10
|
-
exports.createBabelPlugin = require_helpers_create_plugin.createBabelPlugin;
|
|
11
|
-
exports.filterPluginByFileId = require_helpers_filters.filterPluginByFileId;
|
|
12
|
-
exports.findExport = require_helpers_module_helpers.findExport;
|
|
13
|
-
exports.generateFromAst = require_helpers_ast_utils.generateFromAst;
|
|
14
|
-
exports.getImport = require_helpers_module_helpers.getImport;
|
|
15
|
-
exports.getPluginName = require_helpers_filters.getPluginName;
|
|
16
|
-
exports.isDuplicatePlugin = require_helpers_filters.isDuplicatePlugin;
|
|
17
|
-
exports.isImportCall = require_helpers_module_helpers.isImportCall;
|
|
18
|
-
exports.listExports = require_helpers_module_helpers.listExports;
|
|
19
|
-
exports.listImports = require_helpers_module_helpers.listImports;
|
|
20
|
-
exports.parseAst = require_helpers_ast_utils.parseAst;
|
|
21
|
-
exports.resolveBabelPlugin = require_helpers_options.resolveBabelPlugin;
|
|
22
|
-
exports.resolvePluginFunction = require_helpers_options.resolvePluginFunction;
|
|
1
|
+
const require_filters = require('./filters.cjs');
|
|
2
|
+
const require_options = require('./options.cjs');
|
|
3
|
+
const require_ast_utils = require('./ast-utils.cjs');
|
|
4
|
+
const require_create_plugin = require('./create-plugin.cjs');
|
|
5
|
+
const require_module_helpers = require('./module-helpers.cjs');
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -2,5 +2,4 @@ import { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, ge
|
|
|
2
2
|
import { createBabelPlugin } from "./create-plugin.mjs";
|
|
3
3
|
import { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin } from "./filters.mjs";
|
|
4
4
|
import { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from "./module-helpers.mjs";
|
|
5
|
-
import { resolveBabelPlugin, resolvePluginFunction } from "./options.mjs";
|
|
6
|
-
export { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, addImport, addImportsToProgram, addPluginFilter, createBabelPlugin, filterPluginByFileId, findExport, generateFromAst, getImport, getPluginName, isDuplicatePlugin, isImportCall, listExports, listImports, parseAst, resolveBabelPlugin, resolvePluginFunction };
|
|
5
|
+
import { resolveBabelPlugin, resolvePluginFunction } from "./options.mjs";
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -4,4 +4,4 @@ import { generateFromAst, parseAst } from "./ast-utils.mjs";
|
|
|
4
4
|
import { createBabelPlugin } from "./create-plugin.mjs";
|
|
5
5
|
import { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from "./module-helpers.mjs";
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const
|
|
2
|
+
const require_ast_utils = require('./ast-utils.cjs');
|
|
3
3
|
let __babel_types = require("@babel/types");
|
|
4
4
|
__babel_types = require_rolldown_runtime.__toESM(__babel_types);
|
|
5
5
|
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
@@ -29,7 +29,7 @@ function findExport(ast, key) {
|
|
|
29
29
|
* @returns An array of export names, including "default" for default exports.
|
|
30
30
|
*/
|
|
31
31
|
function listExports(codeOrAst) {
|
|
32
|
-
return ((0, __stryke_type_checks_is_string.isString)(codeOrAst) ?
|
|
32
|
+
return ((0, __stryke_type_checks_is_string.isString)(codeOrAst) ? require_ast_utils.parseAst(codeOrAst) : codeOrAst).program.body.flatMap((i) => {
|
|
33
33
|
if (i.type === "ExportDefaultDeclaration") return ["default"];
|
|
34
34
|
if (i.type === "ExportNamedDeclaration" && i.declaration && "declarations" in i.declaration) return i.declaration.declarations.map((d) => "name" in d.id ? d.id.name : "");
|
|
35
35
|
return [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ImportSpecifier } from "../powerlines/src/types/babel.cjs";
|
|
2
|
+
import { NodePath } from "@babel/core";
|
|
2
3
|
import { ParseResult } from "@babel/parser";
|
|
3
4
|
import * as t from "@babel/types";
|
|
4
|
-
import { NodePath } from "@babel/core";
|
|
5
5
|
|
|
6
6
|
//#region src/helpers/module-helpers.d.ts
|
|
7
7
|
|
package/dist/helpers/options.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const
|
|
2
|
+
const require_filters = require('./filters.cjs');
|
|
3
3
|
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
4
4
|
let __stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
5
5
|
let chalk = require("chalk");
|
|
@@ -25,7 +25,7 @@ function resolvePluginFunction(context, plugin) {
|
|
|
25
25
|
function resolveBabelPlugin(context, code, id, plugin) {
|
|
26
26
|
if (Array.isArray(plugin) && plugin.length > 0 && plugin[0]) {
|
|
27
27
|
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(
|
|
28
|
+
context.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Skipping filtered Babel plugin ${chalk.default.bold.cyanBright(require_filters.getPluginName(plugin) || "unnamed")} for ${id}`);
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
return plugin.length > 2 ? [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from "../powerlines/src/types/context.cjs";
|
|
2
1
|
import { BabelTransformPluginOptions, ResolvedBabelTransformPluginOptions } from "../powerlines/src/types/babel.cjs";
|
|
2
|
+
import { Context } from "../powerlines/src/types/context.cjs";
|
|
3
3
|
import { PluginOptions, PluginTarget } from "@babel/core";
|
|
4
4
|
|
|
5
5
|
//#region src/helpers/options.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from "../powerlines/src/types/context.mjs";
|
|
2
1
|
import { BabelTransformPluginOptions, ResolvedBabelTransformPluginOptions } from "../powerlines/src/types/babel.mjs";
|
|
2
|
+
import { Context } from "../powerlines/src/types/context.mjs";
|
|
3
3
|
import { PluginOptions, PluginTarget } from "@babel/core";
|
|
4
4
|
|
|
5
5
|
//#region src/helpers/options.d.ts
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
3
|
+
const require_filters = require('./helpers/filters.cjs');
|
|
4
|
+
const require_options = require('./helpers/options.cjs');
|
|
5
|
+
const require_ast_utils = require('./helpers/ast-utils.cjs');
|
|
6
|
+
const require_create_plugin = require('./helpers/create-plugin.cjs');
|
|
7
|
+
const require_module_helpers = require('./helpers/module-helpers.cjs');
|
|
8
8
|
require('./helpers/index.cjs');
|
|
9
9
|
let __babel_core = require("@babel/core");
|
|
10
10
|
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
@@ -47,8 +47,8 @@ const plugin = (options = {}) => {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Babel transforming file: ${id}`);
|
|
50
|
-
const plugins = this.config.transform.babel.plugins.map((plugin$1) =>
|
|
51
|
-
const presets = this.config.transform.babel.presets.map((preset) =>
|
|
50
|
+
const plugins = this.config.transform.babel.plugins.map((plugin$1) => require_options.resolveBabelPlugin(this, code, id, plugin$1)).filter((plugin$1, _, arr) => plugin$1 && !require_filters.isDuplicatePlugin(arr, plugin$1));
|
|
51
|
+
const presets = this.config.transform.babel.presets.map((preset) => require_options.resolveBabelPlugin(this, code, id, preset)).filter((preset, _, arr) => preset && !require_filters.isDuplicatePlugin(arr, preset));
|
|
52
52
|
if (Array.isArray(plugins) && plugins.length === 0 && Array.isArray(presets) && presets.length === 0) return {
|
|
53
53
|
code,
|
|
54
54
|
id
|
|
@@ -58,7 +58,7 @@ const plugin = (options = {}) => {
|
|
|
58
58
|
"cts",
|
|
59
59
|
"mts",
|
|
60
60
|
"tsx"
|
|
61
|
-
].includes((0, __stryke_path_file_path_fns.findFileExtensionSafe)(id)) && !
|
|
61
|
+
].includes((0, __stryke_path_file_path_fns.findFileExtensionSafe)(id)) && !require_filters.isDuplicatePlugin(plugins, "@babel/plugin-syntax-typescript") && !require_filters.isDuplicatePlugin(presets, "@babel/preset-typescript")) plugins.unshift(["@babel/plugin-syntax-typescript", { isTSX: (0, __stryke_path_file_path_fns.findFileExtension)(id) === ".tsx" }]);
|
|
62
62
|
const result = await (0, __babel_core.transformAsync)(code, {
|
|
63
63
|
highlightCode: true,
|
|
64
64
|
code: true,
|
|
@@ -90,21 +90,21 @@ const plugin = (options = {}) => {
|
|
|
90
90
|
var src_default = plugin;
|
|
91
91
|
|
|
92
92
|
//#endregion
|
|
93
|
-
exports.addImport =
|
|
94
|
-
exports.addImportsToProgram =
|
|
95
|
-
exports.addPluginFilter =
|
|
96
|
-
exports.createBabelPlugin =
|
|
93
|
+
exports.addImport = require_module_helpers.addImport;
|
|
94
|
+
exports.addImportsToProgram = require_module_helpers.addImportsToProgram;
|
|
95
|
+
exports.addPluginFilter = require_filters.addPluginFilter;
|
|
96
|
+
exports.createBabelPlugin = require_create_plugin.createBabelPlugin;
|
|
97
97
|
exports.default = src_default;
|
|
98
|
-
exports.filterPluginByFileId =
|
|
99
|
-
exports.findExport =
|
|
100
|
-
exports.generateFromAst =
|
|
101
|
-
exports.getImport =
|
|
102
|
-
exports.getPluginName =
|
|
103
|
-
exports.isDuplicatePlugin =
|
|
104
|
-
exports.isImportCall =
|
|
105
|
-
exports.listExports =
|
|
106
|
-
exports.listImports =
|
|
107
|
-
exports.parseAst =
|
|
98
|
+
exports.filterPluginByFileId = require_filters.filterPluginByFileId;
|
|
99
|
+
exports.findExport = require_module_helpers.findExport;
|
|
100
|
+
exports.generateFromAst = require_ast_utils.generateFromAst;
|
|
101
|
+
exports.getImport = require_module_helpers.getImport;
|
|
102
|
+
exports.getPluginName = require_filters.getPluginName;
|
|
103
|
+
exports.isDuplicatePlugin = require_filters.isDuplicatePlugin;
|
|
104
|
+
exports.isImportCall = require_module_helpers.isImportCall;
|
|
105
|
+
exports.listExports = require_module_helpers.listExports;
|
|
106
|
+
exports.listImports = require_module_helpers.listImports;
|
|
107
|
+
exports.parseAst = require_ast_utils.parseAst;
|
|
108
108
|
exports.plugin = plugin;
|
|
109
|
-
exports.resolveBabelPlugin =
|
|
110
|
-
exports.resolvePluginFunction =
|
|
109
|
+
exports.resolveBabelPlugin = require_options.resolveBabelPlugin;
|
|
110
|
+
exports.resolvePluginFunction = require_options.resolvePluginFunction;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst } from "./helpers/ast-utils.cjs";
|
|
2
1
|
import { Plugin } from "./powerlines/src/types/plugin.cjs";
|
|
2
|
+
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "./types/plugin.cjs";
|
|
3
|
+
import { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst } from "./helpers/ast-utils.cjs";
|
|
3
4
|
import { createBabelPlugin } from "./helpers/create-plugin.cjs";
|
|
4
5
|
import { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin } from "./helpers/filters.cjs";
|
|
5
6
|
import { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from "./helpers/module-helpers.cjs";
|
|
6
7
|
import { resolveBabelPlugin, resolvePluginFunction } from "./helpers/options.cjs";
|
|
7
|
-
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "./types/plugin.cjs";
|
|
8
8
|
|
|
9
9
|
//#region src/index.d.ts
|
|
10
10
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst } from "./helpers/ast-utils.mjs";
|
|
2
1
|
import { Plugin } from "./powerlines/src/types/plugin.mjs";
|
|
2
|
+
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "./types/plugin.mjs";
|
|
3
|
+
import { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst } from "./helpers/ast-utils.mjs";
|
|
3
4
|
import { createBabelPlugin } from "./helpers/create-plugin.mjs";
|
|
4
5
|
import { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin } from "./helpers/filters.mjs";
|
|
5
6
|
import { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from "./helpers/module-helpers.mjs";
|
|
6
7
|
import { resolveBabelPlugin, resolvePluginFunction } from "./helpers/options.mjs";
|
|
7
8
|
import "./helpers/index.mjs";
|
|
8
|
-
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "./types/plugin.mjs";
|
|
9
9
|
import "./types/index.mjs";
|
|
10
10
|
|
|
11
11
|
//#region src/index.d.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CallHookOptions } from "../internal/helpers/hooks.cjs";
|
|
1
|
+
import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig } from "./config.cjs";
|
|
3
2
|
import { InferHookParameters, InferHookReturnType } from "./hooks.cjs";
|
|
3
|
+
import { ResolvedConfig } from "./resolved.cjs";
|
|
4
4
|
import { APIContext, EnvironmentContext, PluginContext } from "./context.cjs";
|
|
5
|
-
import {
|
|
5
|
+
import { CallHookOptions } from "../internal/helpers/hooks.cjs";
|
|
6
6
|
|
|
7
7
|
//#region ../powerlines/src/types/api.d.ts
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CallHookOptions } from "../internal/helpers/hooks.mjs";
|
|
1
|
+
import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig } from "./config.mjs";
|
|
3
2
|
import { InferHookParameters, InferHookReturnType } from "./hooks.mjs";
|
|
3
|
+
import { ResolvedConfig } from "./resolved.mjs";
|
|
4
4
|
import { APIContext, EnvironmentContext, PluginContext } from "./context.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { CallHookOptions } from "../internal/helpers/hooks.mjs";
|
|
6
6
|
|
|
7
7
|
//#region ../powerlines/src/types/api.d.ts
|
|
8
8
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { UserConfig
|
|
1
|
+
import { OutputOptions, RollupOptions } from "rollup";
|
|
2
|
+
import { UserConfig } from "@farmfe/core";
|
|
3
3
|
import { Configuration } from "@rspack/core";
|
|
4
4
|
import { BuildOptions } from "@storm-software/tsup/types";
|
|
5
5
|
import { UnbuildOptions } from "@storm-software/unbuild/types";
|
|
6
6
|
import { BuildOptions as BuildOptions$1 } from "esbuild";
|
|
7
7
|
import { RolldownOptions } from "rolldown";
|
|
8
|
-
import {
|
|
9
|
-
import { UserConfig as UserConfig$2 } from "
|
|
8
|
+
import { UserConfig as UserConfig$1 } from "tsdown";
|
|
9
|
+
import { DepOptimizationOptions, UserConfig as UserConfig$2 } from "vite";
|
|
10
10
|
import { Configuration as Configuration$1 } from "webpack";
|
|
11
11
|
|
|
12
12
|
//#region ../powerlines/src/types/build.d.ts
|
|
@@ -155,13 +155,13 @@ interface BuildConfig {
|
|
|
155
155
|
type BuildResolvedConfig = Omit<BuildConfig, "override">;
|
|
156
156
|
type ESBuildBuildConfig = Omit<BuildOptions$1, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
|
|
157
157
|
type ESBuildResolvedBuildConfig = Omit<BuildOptions$1, "inject"> & BuildResolvedConfig;
|
|
158
|
-
type ViteBuildConfig = Omit<UserConfig, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig & {
|
|
158
|
+
type ViteBuildConfig = Omit<UserConfig$2, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig & {
|
|
159
159
|
/**
|
|
160
160
|
* Optimize deps config
|
|
161
161
|
*/
|
|
162
162
|
optimizeDeps?: Omit<DepOptimizationOptions, "extensions">;
|
|
163
163
|
};
|
|
164
|
-
type ViteResolvedBuildConfig = UserConfig & BuildResolvedConfig;
|
|
164
|
+
type ViteResolvedBuildConfig = UserConfig$2 & BuildResolvedConfig;
|
|
165
165
|
type WebpackBuildConfig = Omit<Configuration$1, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw"> & BuildConfig;
|
|
166
166
|
type WebpackResolvedBuildConfig = Configuration$1 & BuildResolvedConfig;
|
|
167
167
|
type RspackBuildConfig = Omit<Configuration, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw"> & BuildConfig;
|
|
@@ -175,11 +175,11 @@ type RolldownBuildConfig = Omit<RolldownOptions, "input" | "external" | "tsconfi
|
|
|
175
175
|
type RolldownResolvedBuildConfig = RolldownOptions & BuildResolvedConfig;
|
|
176
176
|
type TsupBuildConfig = Partial<Omit<BuildOptions, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
|
|
177
177
|
type TsupResolvedBuildConfig = BuildOptions & BuildResolvedConfig;
|
|
178
|
-
type TsdownBuildConfig = Partial<Omit<UserConfig$
|
|
179
|
-
type TsdownResolvedBuildConfig = UserConfig$
|
|
178
|
+
type TsdownBuildConfig = Partial<Omit<UserConfig$1, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
|
|
179
|
+
type TsdownResolvedBuildConfig = UserConfig$1 & BuildResolvedConfig;
|
|
180
180
|
type UnbuildBuildConfig = Partial<Omit<UnbuildOptions, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
|
|
181
181
|
type UnbuildResolvedBuildConfig = UnbuildOptions & BuildResolvedConfig;
|
|
182
|
-
type FarmBuildConfig = Partial<Omit<UserConfig
|
|
183
|
-
type FarmResolvedBuildConfig = UserConfig
|
|
182
|
+
type FarmBuildConfig = Partial<Omit<UserConfig, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
|
|
183
|
+
type FarmResolvedBuildConfig = UserConfig & BuildResolvedConfig;
|
|
184
184
|
//#endregion
|
|
185
185
|
export { BuildConfig, BuildResolvedConfig, BuilderVariant, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, InferUnpluginVariant, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, UnpluginBuilderVariant, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { UserConfig
|
|
1
|
+
import { OutputOptions, RollupOptions } from "rollup";
|
|
2
|
+
import { UserConfig } from "@farmfe/core";
|
|
3
3
|
import { Configuration } from "@rspack/core";
|
|
4
4
|
import { BuildOptions } from "@storm-software/tsup/types";
|
|
5
5
|
import { UnbuildOptions } from "@storm-software/unbuild/types";
|
|
6
6
|
import { BuildOptions as BuildOptions$1 } from "esbuild";
|
|
7
7
|
import { RolldownOptions } from "rolldown";
|
|
8
|
-
import {
|
|
9
|
-
import { UserConfig as UserConfig$2 } from "
|
|
8
|
+
import { UserConfig as UserConfig$1 } from "tsdown";
|
|
9
|
+
import { DepOptimizationOptions, UserConfig as UserConfig$2 } from "vite";
|
|
10
10
|
import { Configuration as Configuration$1 } from "webpack";
|
|
11
11
|
|
|
12
12
|
//#region ../powerlines/src/types/build.d.ts
|
|
@@ -155,13 +155,13 @@ interface BuildConfig {
|
|
|
155
155
|
type BuildResolvedConfig = Omit<BuildConfig, "override">;
|
|
156
156
|
type ESBuildBuildConfig = Omit<BuildOptions$1, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
|
|
157
157
|
type ESBuildResolvedBuildConfig = Omit<BuildOptions$1, "inject"> & BuildResolvedConfig;
|
|
158
|
-
type ViteBuildConfig = Omit<UserConfig, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig & {
|
|
158
|
+
type ViteBuildConfig = Omit<UserConfig$2, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig & {
|
|
159
159
|
/**
|
|
160
160
|
* Optimize deps config
|
|
161
161
|
*/
|
|
162
162
|
optimizeDeps?: Omit<DepOptimizationOptions, "extensions">;
|
|
163
163
|
};
|
|
164
|
-
type ViteResolvedBuildConfig = UserConfig & BuildResolvedConfig;
|
|
164
|
+
type ViteResolvedBuildConfig = UserConfig$2 & BuildResolvedConfig;
|
|
165
165
|
type WebpackBuildConfig = Omit<Configuration$1, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw"> & BuildConfig;
|
|
166
166
|
type WebpackResolvedBuildConfig = Configuration$1 & BuildResolvedConfig;
|
|
167
167
|
type RspackBuildConfig = Omit<Configuration, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw"> & BuildConfig;
|
|
@@ -175,11 +175,11 @@ type RolldownBuildConfig = Omit<RolldownOptions, "input" | "external" | "tsconfi
|
|
|
175
175
|
type RolldownResolvedBuildConfig = RolldownOptions & BuildResolvedConfig;
|
|
176
176
|
type TsupBuildConfig = Partial<Omit<BuildOptions, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
|
|
177
177
|
type TsupResolvedBuildConfig = BuildOptions & BuildResolvedConfig;
|
|
178
|
-
type TsdownBuildConfig = Partial<Omit<UserConfig$
|
|
179
|
-
type TsdownResolvedBuildConfig = UserConfig$
|
|
178
|
+
type TsdownBuildConfig = Partial<Omit<UserConfig$1, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
|
|
179
|
+
type TsdownResolvedBuildConfig = UserConfig$1 & BuildResolvedConfig;
|
|
180
180
|
type UnbuildBuildConfig = Partial<Omit<UnbuildOptions, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
|
|
181
181
|
type UnbuildResolvedBuildConfig = UnbuildOptions & BuildResolvedConfig;
|
|
182
|
-
type FarmBuildConfig = Partial<Omit<UserConfig
|
|
183
|
-
type FarmResolvedBuildConfig = UserConfig
|
|
182
|
+
type FarmBuildConfig = Partial<Omit<UserConfig, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
|
|
183
|
+
type FarmResolvedBuildConfig = UserConfig & BuildResolvedConfig;
|
|
184
184
|
//#endregion
|
|
185
185
|
export { BuildConfig, BuildResolvedConfig, BuilderVariant, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, InferUnpluginVariant, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupBuildOutputConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, UnpluginBuilderVariant, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
2
1
|
import { ArrayValues } from "@stryke/types/array";
|
|
2
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
3
3
|
|
|
4
4
|
//#region ../powerlines/src/types/commands.d.ts
|
|
5
5
|
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./context.mjs";
|
|
2
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
3
2
|
import { ArrayValues } from "@stryke/types/array";
|
|
3
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
4
4
|
|
|
5
5
|
//#region ../powerlines/src/types/commands.d.ts
|
|
6
6
|
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { BuildConfig, BuildResolvedConfig, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig } from "./build.cjs";
|
|
2
|
+
import { BabelTransformPluginOptions } from "./babel.cjs";
|
|
2
3
|
import { StoragePort, StoragePreset } from "./fs.cjs";
|
|
3
|
-
import { Plugin } from "./plugin.cjs";
|
|
4
4
|
import { TSConfig } from "./tsconfig.cjs";
|
|
5
5
|
import { PluginContext } from "./context.cjs";
|
|
6
|
-
import {
|
|
6
|
+
import { Plugin } from "./plugin.cjs";
|
|
7
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
8
|
+
import { PreviewOptions } from "vite";
|
|
7
9
|
import { transformAsync } from "@babel/core";
|
|
8
10
|
import { Format } from "@storm-software/build-tools/types";
|
|
9
11
|
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
10
12
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
11
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
12
13
|
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
13
14
|
import { AssetGlob } from "@stryke/types/file";
|
|
14
15
|
import { DateString } from "compatx";
|
|
15
|
-
import { PreviewOptions } from "vite";
|
|
16
16
|
|
|
17
17
|
//#region ../powerlines/src/types/config.d.ts
|
|
18
18
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
@@ -308,14 +308,14 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
308
308
|
*/
|
|
309
309
|
configFile?: string;
|
|
310
310
|
/**
|
|
311
|
-
* Should the Powerlines
|
|
311
|
+
* Should the Powerlines processes automatically install missing package dependencies?
|
|
312
312
|
*
|
|
313
313
|
* @remarks
|
|
314
|
-
* This
|
|
314
|
+
* When set to `true`, Powerlines will attempt to install any missing dependencies using the package manager detected in the project (e.g., npm, yarn, pnpm). This can be useful for ensuring that all required packages are available during the build and preparation phases.
|
|
315
315
|
*
|
|
316
316
|
* @defaultValue false
|
|
317
317
|
*/
|
|
318
|
-
|
|
318
|
+
autoInstall?: boolean;
|
|
319
319
|
/**
|
|
320
320
|
* Should the compiler processes skip any improvements that make use of cache?
|
|
321
321
|
*
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { BuildConfig, BuildResolvedConfig, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig } from "./build.mjs";
|
|
2
|
+
import { BabelTransformPluginOptions } from "./babel.mjs";
|
|
2
3
|
import { StoragePort, StoragePreset } from "./fs.mjs";
|
|
3
|
-
import { Plugin } from "./plugin.mjs";
|
|
4
4
|
import { TSConfig } from "./tsconfig.mjs";
|
|
5
5
|
import { PluginContext } from "./context.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { Plugin } from "./plugin.mjs";
|
|
7
7
|
import { transformAsync } from "@babel/core";
|
|
8
8
|
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
9
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
10
|
+
import { PreviewOptions } from "vite";
|
|
9
11
|
import { Format } from "@storm-software/build-tools/types";
|
|
10
12
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
11
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
12
13
|
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
13
14
|
import { AssetGlob } from "@stryke/types/file";
|
|
14
15
|
import { DateString } from "compatx";
|
|
15
|
-
import { PreviewOptions } from "vite";
|
|
16
16
|
|
|
17
17
|
//#region ../powerlines/src/types/config.d.ts
|
|
18
18
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
@@ -308,14 +308,14 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
308
308
|
*/
|
|
309
309
|
configFile?: string;
|
|
310
310
|
/**
|
|
311
|
-
* Should the Powerlines
|
|
311
|
+
* Should the Powerlines processes automatically install missing package dependencies?
|
|
312
312
|
*
|
|
313
313
|
* @remarks
|
|
314
|
-
* This
|
|
314
|
+
* When set to `true`, Powerlines will attempt to install any missing dependencies using the package manager detected in the project (e.g., npm, yarn, pnpm). This can be useful for ensuring that all required packages are available during the build and preparation phases.
|
|
315
315
|
*
|
|
316
316
|
* @defaultValue false
|
|
317
317
|
*/
|
|
318
|
-
|
|
318
|
+
autoInstall?: boolean;
|
|
319
319
|
/**
|
|
320
320
|
* Should the compiler processes skip any improvements that make use of cache?
|
|
321
321
|
*
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.cjs";
|
|
2
|
-
import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.cjs";
|
|
3
|
-
import { Plugin } from "./plugin.cjs";
|
|
4
|
-
import { HooksList, InferHooksListItem } from "./hooks.cjs";
|
|
5
2
|
import { ParsedTypeScriptConfig } from "./tsconfig.cjs";
|
|
6
3
|
import { InlineConfig, LogFn, UserConfig, WorkspaceConfig } from "./config.cjs";
|
|
4
|
+
import { HooksList, InferHooksListItem } from "./hooks.cjs";
|
|
5
|
+
import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.cjs";
|
|
6
|
+
import { Plugin } from "./plugin.cjs";
|
|
7
7
|
import { NonUndefined } from "@stryke/types/base";
|
|
8
|
+
import { ExternalIdResult, UnpluginBuildContext, UnpluginContext, UnpluginMessage } from "unplugin";
|
|
8
9
|
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
9
10
|
import { FetchRequestOptions } from "@stryke/http/fetch";
|
|
10
11
|
import { PackageJson } from "@stryke/types/package-json";
|
|
@@ -14,7 +15,6 @@ import { ParseResult, ParserOptions } from "oxc-parser";
|
|
|
14
15
|
import { Range } from "semver";
|
|
15
16
|
import { Project } from "ts-morph";
|
|
16
17
|
import { RequestInfo, Response } from "undici";
|
|
17
|
-
import { ExternalIdResult, UnpluginBuildContext, UnpluginContext, UnpluginMessage } from "unplugin";
|
|
18
18
|
|
|
19
19
|
//#region ../powerlines/src/types/context.d.ts
|
|
20
20
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
|
|
2
|
-
import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.mjs";
|
|
3
|
-
import { Plugin } from "./plugin.mjs";
|
|
4
|
-
import { HooksList, InferHooksListItem } from "./hooks.mjs";
|
|
5
2
|
import { ParsedTypeScriptConfig } from "./tsconfig.mjs";
|
|
6
3
|
import { InlineConfig, LogFn, UserConfig, WorkspaceConfig } from "./config.mjs";
|
|
4
|
+
import { HooksList, InferHooksListItem } from "./hooks.mjs";
|
|
5
|
+
import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.mjs";
|
|
6
|
+
import { Plugin } from "./plugin.mjs";
|
|
7
7
|
import { NonUndefined } from "@stryke/types/base";
|
|
8
|
+
import { ExternalIdResult, UnpluginBuildContext, UnpluginContext, UnpluginMessage } from "unplugin";
|
|
8
9
|
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
9
10
|
import { FetchRequestOptions } from "@stryke/http/fetch";
|
|
10
11
|
import { PackageJson } from "@stryke/types/package-json";
|
|
@@ -14,7 +15,6 @@ import { ParseResult, ParserOptions } from "oxc-parser";
|
|
|
14
15
|
import { Range } from "semver";
|
|
15
16
|
import { Project } from "ts-morph";
|
|
16
17
|
import { RequestInfo, Response } from "undici";
|
|
17
|
-
import { ExternalIdResult, UnpluginBuildContext, UnpluginContext, UnpluginMessage } from "unplugin";
|
|
18
18
|
|
|
19
19
|
//#region ../powerlines/src/types/context.d.ts
|
|
20
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnpluginBuilderVariant } from "./build.cjs";
|
|
2
|
-
import { Plugin, PluginHookFields, PluginHookFunctions } from "./plugin.cjs";
|
|
3
2
|
import { PluginContext, WithUnpluginBuildContext } from "./context.cjs";
|
|
3
|
+
import { Plugin, PluginHookFields, PluginHookFunctions } from "./plugin.cjs";
|
|
4
4
|
import { UnpluginOptions } from "unplugin";
|
|
5
5
|
|
|
6
6
|
//#region ../powerlines/src/types/hooks.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnpluginBuilderVariant } from "./build.mjs";
|
|
2
|
-
import { Plugin, PluginHookFields, PluginHookFunctions } from "./plugin.mjs";
|
|
3
2
|
import { PluginContext, WithUnpluginBuildContext } from "./context.mjs";
|
|
3
|
+
import { Plugin, PluginHookFields, PluginHookFunctions } from "./plugin.mjs";
|
|
4
4
|
import { UnpluginOptions } from "unplugin";
|
|
5
5
|
|
|
6
6
|
//#region ../powerlines/src/types/hooks.d.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BuildConfig, BuildResolvedConfig, BuilderVariant, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, InferUnpluginVariant, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupBuildOutputConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, UnpluginBuilderVariant, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig } from "./build.mjs";
|
|
2
|
+
import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginBuilder, BabelTransformPluginBuilderParams, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn, ImportSpecifier, ResolvedBabelTransformPluginOptions } from "./babel.mjs";
|
|
2
3
|
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
|
|
3
|
-
import {
|
|
4
|
+
import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig } from "./tsconfig.mjs";
|
|
5
|
+
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";
|
|
6
|
+
import { HookFields, HookListOrders, HooksList, InferHookFunction, InferHookParameters, InferHookReturnType, InferHooksListItem, PluginHooksList, PluginHooksListItem, UnpluginHookFunctions, UnpluginHookList, UnpluginHookVariant, UnpluginHookVariantField, UnpluginHooksListItem } from "./hooks.mjs";
|
|
4
7
|
import { BabelResolvedConfig, ESBuildResolvedConfig, EnvironmentResolvedConfig, FarmResolvedConfig, InferResolvedConfig, OutputResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, RolldownResolvedConfig, RollupResolvedConfig, RspackResolvedConfig, TsdownResolvedConfig, TsupResolvedConfig, UnbuildResolvedConfig, ViteResolvedConfig, WebpackResolvedConfig } from "./resolved.mjs";
|
|
8
|
+
import { APIContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EnvironmentContext, EnvironmentContextPlugin, FetchOptions, InitContextOptions, MetaInfo, ParseOptions, PluginContext, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, TransformResult, UnresolvedContext, WithUnpluginBuildContext } from "./context.mjs";
|
|
9
|
+
import { CommandType, SUPPORTED_COMMANDS } from "./commands.mjs";
|
|
5
10
|
import { API } from "./api.mjs";
|
|
6
11
|
import { InferUnpluginOptions, UnpluginOptions } from "./unplugin.mjs";
|
|
7
|
-
import { Plugin, PluginHook, PluginHookFields, PluginHookFunctions, PluginHookObject, PluginHooks, TypesResult } from "./plugin.mjs";
|
|
8
|
-
import { HookFields, HookListOrders, HooksList, InferHookFunction, InferHookParameters, InferHookReturnType, InferHooksListItem, PluginHooksList, PluginHooksListItem, UnpluginHookFunctions, UnpluginHookList, UnpluginHookVariant, UnpluginHookVariantField, UnpluginHooksListItem } from "./hooks.mjs";
|
|
9
|
-
import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig } from "./tsconfig.mjs";
|
|
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";
|
|
12
|
-
import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginBuilder, BabelTransformPluginBuilderParams, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn, ImportSpecifier, ResolvedBabelTransformPluginOptions } from "./babel.mjs";
|
|
12
|
+
import { Plugin, PluginHook, PluginHookFields, PluginHookFunctions, PluginHookObject, PluginHooks, TypesResult } from "./plugin.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BuilderVariant } from "./build.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { EnvironmentConfig, PluginConfig } from "./config.cjs";
|
|
3
3
|
import { EnvironmentResolvedConfig, ResolvedConfig } from "./resolved.cjs";
|
|
4
|
-
import { InferUnpluginOptions } from "./unplugin.cjs";
|
|
5
4
|
import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.cjs";
|
|
6
|
-
import {
|
|
5
|
+
import { CommandType } from "./commands.cjs";
|
|
6
|
+
import { InferUnpluginOptions } from "./unplugin.cjs";
|
|
7
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
7
8
|
import { AnyFunction, MaybePromise } from "@stryke/types/base";
|
|
8
9
|
import { LoadResult } from "rollup";
|
|
9
10
|
import { ExternalIdResult, HookFilter, TransformResult } from "unplugin";
|
|
10
|
-
import { ArrayValues } from "@stryke/types/array";
|
|
11
11
|
|
|
12
12
|
//#region ../powerlines/src/types/plugin.d.ts
|
|
13
13
|
interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BuilderVariant } from "./build.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { EnvironmentConfig, PluginConfig } from "./config.mjs";
|
|
3
3
|
import { EnvironmentResolvedConfig, ResolvedConfig } from "./resolved.mjs";
|
|
4
|
-
import { InferUnpluginOptions } from "./unplugin.mjs";
|
|
5
4
|
import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.mjs";
|
|
6
|
-
import {
|
|
5
|
+
import { CommandType } from "./commands.mjs";
|
|
6
|
+
import { InferUnpluginOptions } from "./unplugin.mjs";
|
|
7
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
7
8
|
import { AnyFunction, MaybePromise } from "@stryke/types/base";
|
|
8
9
|
import { LoadResult } from "rollup";
|
|
9
10
|
import { ExternalIdResult, HookFilter, TransformResult } from "unplugin";
|
|
10
|
-
import { ArrayValues } from "@stryke/types/array";
|
|
11
11
|
|
|
12
12
|
//#region ../powerlines/src/types/plugin.d.ts
|
|
13
13
|
interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BuilderVariant } from "./build.cjs";
|
|
2
2
|
import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, 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
|
+
import { ResolvedPreviewOptions } from "vite";
|
|
4
5
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
5
6
|
import { AssetGlob } from "@stryke/types/file";
|
|
6
|
-
import { ResolvedPreviewOptions } from "vite";
|
|
7
7
|
|
|
8
8
|
//#region ../powerlines/src/types/resolved.d.ts
|
|
9
9
|
interface ResolvedEntryTypeDefinition extends TypeDefinition {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BuilderVariant } from "./build.mjs";
|
|
2
2
|
import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, 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
|
+
import { ResolvedPreviewOptions } from "vite";
|
|
4
5
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
5
6
|
import { AssetGlob } from "@stryke/types/file";
|
|
6
|
-
import { ResolvedPreviewOptions } from "vite";
|
|
7
7
|
|
|
8
8
|
//#region ../powerlines/src/types/resolved.d.ts
|
|
9
9
|
interface ResolvedEntryTypeDefinition extends TypeDefinition {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BuilderVariant, InferUnpluginVariant, UnpluginBuilderVariant } from "./build.cjs";
|
|
2
2
|
import { InferResolvedConfig } from "./resolved.cjs";
|
|
3
|
+
import { Context } from "./context.cjs";
|
|
3
4
|
import { API } from "./api.cjs";
|
|
4
5
|
import { PluginHook } from "./plugin.cjs";
|
|
5
|
-
import { Context } from "./context.cjs";
|
|
6
6
|
import { MaybePromise } from "@stryke/types/base";
|
|
7
7
|
import { HookFilter, UnpluginOptions } from "unplugin";
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BuilderVariant, InferUnpluginVariant, UnpluginBuilderVariant } from "./build.mjs";
|
|
2
|
+
import "./config.mjs";
|
|
2
3
|
import { InferResolvedConfig } from "./resolved.mjs";
|
|
4
|
+
import { Context } from "./context.mjs";
|
|
3
5
|
import { API } from "./api.mjs";
|
|
4
6
|
import { PluginHook } from "./plugin.mjs";
|
|
5
|
-
import { Context } from "./context.mjs";
|
|
6
|
-
import "./config.mjs";
|
|
7
7
|
import { MaybePromise } from "@stryke/types/base";
|
|
8
8
|
import { HookFilter, UnpluginOptions } from "unplugin";
|
|
9
9
|
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "./plugin.mjs";
|
|
2
|
-
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig };
|
|
1
|
+
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "./plugin.mjs";
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { BabelUserConfig, UserConfig } from "../powerlines/src/types/config.cjs";
|
|
1
2
|
import { BabelResolvedConfig, ResolvedConfig } from "../powerlines/src/types/resolved.cjs";
|
|
2
3
|
import { PluginContext } from "../powerlines/src/types/context.cjs";
|
|
3
|
-
import { BabelUserConfig, UserConfig } from "../powerlines/src/types/config.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/types/plugin.d.ts
|
|
6
6
|
type BabelPluginOptions = Partial<BabelUserConfig>;
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { BabelUserConfig, UserConfig } from "../powerlines/src/types/config.mjs";
|
|
1
2
|
import { BabelResolvedConfig, ResolvedConfig } from "../powerlines/src/types/resolved.mjs";
|
|
2
3
|
import { PluginContext } from "../powerlines/src/types/context.mjs";
|
|
3
|
-
import { BabelUserConfig, UserConfig } from "../powerlines/src/types/config.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/types/plugin.d.ts
|
|
6
6
|
type BabelPluginOptions = Partial<BabelUserConfig>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-babel",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.170",
|
|
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.
|
|
166
|
+
"powerlines": "^0.37.35"
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
169
|
+
"@powerlines/plugin-plugin": "^0.12.113",
|
|
170
170
|
"@types/node": "^24.10.8"
|
|
171
171
|
},
|
|
172
172
|
"publishConfig": { "access": "public" },
|
|
173
|
-
"gitHead": "
|
|
173
|
+
"gitHead": "65656903e05b8a85e4d46f7449a8c2bd8f90332e"
|
|
174
174
|
}
|
package/dist/helpers/index.d.cts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst } from "./ast-utils.cjs";
|
|
2
|
-
import { createBabelPlugin } from "./create-plugin.cjs";
|
|
3
|
-
import { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin } from "./filters.cjs";
|
|
4
|
-
import { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from "./module-helpers.cjs";
|
|
5
|
-
import { resolveBabelPlugin, resolvePluginFunction } from "./options.cjs";
|
|
6
|
-
export { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, addImport, addImportsToProgram, addPluginFilter, createBabelPlugin, filterPluginByFileId, findExport, generateFromAst, getImport, getPluginName, isDuplicatePlugin, isImportCall, listExports, listImports, parseAst, resolveBabelPlugin, resolvePluginFunction };
|
package/dist/types/index.cjs
DELETED
|
File without changes
|
package/dist/types/index.d.cts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "./plugin.cjs";
|
|
2
|
-
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig };
|
package/dist/types/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/types/plugin.cjs
DELETED
|
File without changes
|
package/dist/types/plugin.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|