@powerlines/plugin-alloy 0.18.113 → 0.18.114
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/core/components/output.d.cts +2 -2
- package/dist/core/components/single-line-comment.d.cts +2 -2
- package/dist/core/components/single-line-comment.d.mts +2 -2
- package/dist/core/components/source-file.d.cts +2 -2
- package/dist/core/components/source-file.d.mts +2 -2
- package/dist/deepkit/src/utilities.cjs +114 -0
- package/dist/deepkit/src/utilities.mjs +110 -0
- package/dist/helpers/capnp.cjs +10 -10
- package/dist/helpers/capnp.mjs +6 -6
- package/dist/helpers/typescript.cjs +2 -2
- package/dist/helpers/typescript.mjs +1 -1
- package/dist/index.cjs +3 -4
- package/dist/index.mjs +3 -3
- package/dist/markdown/components/markdown-file.d.cts +3 -3
- package/dist/markdown/components/markdown-file.d.mts +3 -3
- package/dist/markdown/components/markdown-table.d.cts +4 -4
- package/dist/markdown/components/markdown-table.d.mts +4 -4
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -0
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -0
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +6 -0
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +6 -0
- package/dist/plugin-babel/src/helpers/filters.cjs +23 -0
- package/dist/plugin-babel/src/helpers/filters.mjs +21 -0
- package/dist/plugin-babel/src/helpers/index.cjs +5 -0
- package/dist/plugin-babel/src/helpers/index.mjs +7 -0
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +4 -0
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +5 -0
- package/dist/plugin-babel/src/helpers/options.cjs +49 -0
- package/dist/plugin-babel/src/helpers/options.mjs +46 -0
- package/dist/plugin-babel/src/index.cjs +83 -0
- package/dist/plugin-babel/src/index.mjs +81 -0
- package/dist/plugin-babel/src/types/plugin.d.mts +1 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +2 -0
- package/dist/powerlines/src/lib/logger.cjs +9 -0
- package/dist/powerlines/src/lib/logger.mjs +9 -0
- package/dist/powerlines/src/lib/utilities/file-header.cjs +13 -0
- package/dist/powerlines/src/lib/utilities/file-header.mjs +12 -0
- package/dist/powerlines/src/types/commands.d.mts +1 -0
- package/dist/powerlines/src/types/config.d.mts +2 -2
- package/dist/powerlines/src/types/unplugin.d.mts +1 -0
- package/dist/typescript/components/builtin-file.d.cts +2 -2
- package/dist/typescript/components/builtin-file.d.mts +2 -2
- package/dist/typescript/components/dynamic-import-statement.d.cts +2 -2
- package/dist/typescript/components/dynamic-import-statement.d.mts +2 -2
- package/dist/typescript/components/entry-file.d.cts +2 -2
- package/dist/typescript/components/tsdoc-reflection.cjs +2 -2
- package/dist/typescript/components/tsdoc-reflection.d.cts +4 -4
- package/dist/typescript/components/tsdoc-reflection.d.mts +4 -4
- package/dist/typescript/components/tsdoc-reflection.mjs +2 -2
- package/dist/typescript/components/tsdoc.cjs +3 -3
- package/dist/typescript/components/tsdoc.d.mts +1 -1
- package/dist/typescript/components/tsdoc.mjs +2 -2
- package/dist/typescript/components/typescript-file.cjs +1 -1
- package/dist/typescript/components/typescript-file.mjs +1 -1
- package/dist/typescript/components/typescript-interface.cjs +2 -2
- package/dist/typescript/components/typescript-interface.d.cts +3 -3
- package/dist/typescript/components/typescript-interface.d.mts +4 -4
- package/dist/typescript/components/typescript-interface.mjs +2 -2
- package/dist/typescript/components/typescript-object.cjs +3 -3
- package/dist/typescript/components/typescript-object.d.mts +1 -1
- package/dist/typescript/components/typescript-object.mjs +2 -2
- package/package.json +4 -4
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
require('../../../powerlines/src/lib/logger.cjs');
|
|
3
|
+
let chalk = require("chalk");
|
|
4
|
+
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
5
|
+
require("@babel/helper-plugin-utils");
|
|
6
|
+
require("@storm-software/config-tools/types");
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
3
|
+
let __stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
4
|
+
require("@stryke/type-checks/is-object");
|
|
5
|
+
|
|
6
|
+
//#region ../plugin-babel/src/helpers/filters.ts
|
|
7
|
+
function getPluginName(plugin) {
|
|
8
|
+
return (0, __stryke_type_checks_is_set_string.isSetString)(plugin) ? plugin : Array.isArray(plugin) && plugin.length > 0 ? getPluginName(plugin[0]) : plugin.$$name || plugin.name ? plugin.$$name || plugin.name : void 0;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Check if a Babel plugin is a duplicate of another plugin in the list.
|
|
12
|
+
*
|
|
13
|
+
* @param plugins - The list of existing Babel plugins.
|
|
14
|
+
* @param plugin - The Babel plugin to check for duplicates.
|
|
15
|
+
* @returns True if the plugin is a duplicate, false otherwise.
|
|
16
|
+
*/
|
|
17
|
+
function isDuplicatePlugin(plugins, plugin) {
|
|
18
|
+
return !!(getPluginName(plugin) && plugins.some((existing) => Array.isArray(existing) && getPluginName(existing[0]) === getPluginName(plugin)));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.getPluginName = getPluginName;
|
|
23
|
+
exports.isDuplicatePlugin = isDuplicatePlugin;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
2
|
+
import { isFunction } from "@stryke/type-checks/is-function";
|
|
3
|
+
import "@stryke/type-checks/is-object";
|
|
4
|
+
|
|
5
|
+
//#region ../plugin-babel/src/helpers/filters.ts
|
|
6
|
+
function getPluginName(plugin) {
|
|
7
|
+
return isSetString(plugin) ? plugin : Array.isArray(plugin) && plugin.length > 0 ? getPluginName(plugin[0]) : plugin.$$name || plugin.name ? plugin.$$name || plugin.name : void 0;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Check if a Babel plugin is a duplicate of another plugin in the list.
|
|
11
|
+
*
|
|
12
|
+
* @param plugins - The list of existing Babel plugins.
|
|
13
|
+
* @param plugin - The Babel plugin to check for duplicates.
|
|
14
|
+
* @returns True if the plugin is a duplicate, false otherwise.
|
|
15
|
+
*/
|
|
16
|
+
function isDuplicatePlugin(plugins, plugin) {
|
|
17
|
+
return !!(getPluginName(plugin) && plugins.some((existing) => Array.isArray(existing) && getPluginName(existing[0]) === getPluginName(plugin)));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { getPluginName, isDuplicatePlugin };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_filters = require('./filters.cjs');
|
|
3
|
+
let __stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
4
|
+
let chalk = require("chalk");
|
|
5
|
+
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
6
|
+
|
|
7
|
+
//#region ../plugin-babel/src/helpers/options.ts
|
|
8
|
+
function resolvePluginFunction(context, plugin) {
|
|
9
|
+
try {
|
|
10
|
+
return Array.isArray(plugin) && plugin.length > 0 && plugin[0] ? (0, __stryke_type_checks_is_function.isFunction)(plugin[0]) ? plugin[0](context) : plugin[0] : (0, __stryke_type_checks_is_function.isFunction)(plugin) ? plugin(context) : plugin;
|
|
11
|
+
} catch {
|
|
12
|
+
return plugin[0];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Resolve the [Babel](https://babeljs.io/) plugin.
|
|
17
|
+
*
|
|
18
|
+
* @param context - The context for the transformation.
|
|
19
|
+
* @param code - The code to be transformed.
|
|
20
|
+
* @param id - The ID of the source file.
|
|
21
|
+
* @param plugin - The Babel plugin to resolve.
|
|
22
|
+
* @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
|
|
23
|
+
*/
|
|
24
|
+
function resolveBabelPlugin(context, code, id, plugin) {
|
|
25
|
+
if (Array.isArray(plugin) && plugin.length > 0 && plugin[0]) {
|
|
26
|
+
if (plugin.length > 2 && plugin[2] && (0, __stryke_type_checks_is_function.isFunction)(plugin[2]) && !plugin[2](code, id)) {
|
|
27
|
+
context.trace(`Skipping filtered Babel plugin ${chalk.default.bold.cyanBright(require_filters.getPluginName(plugin) || "unnamed")} for ${id}`);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
return plugin.length > 2 ? [
|
|
31
|
+
resolvePluginFunction(context, plugin),
|
|
32
|
+
plugin[1],
|
|
33
|
+
plugin[2]
|
|
34
|
+
] : [
|
|
35
|
+
resolvePluginFunction(context, plugin),
|
|
36
|
+
plugin[1],
|
|
37
|
+
null
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
return [
|
|
41
|
+
resolvePluginFunction(context, plugin),
|
|
42
|
+
{},
|
|
43
|
+
null
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
exports.resolveBabelPlugin = resolveBabelPlugin;
|
|
49
|
+
exports.resolvePluginFunction = resolvePluginFunction;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { getPluginName } from "./filters.mjs";
|
|
2
|
+
import { isFunction } from "@stryke/type-checks/is-function";
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
|
|
5
|
+
//#region ../plugin-babel/src/helpers/options.ts
|
|
6
|
+
function resolvePluginFunction(context, plugin) {
|
|
7
|
+
try {
|
|
8
|
+
return Array.isArray(plugin) && plugin.length > 0 && plugin[0] ? isFunction(plugin[0]) ? plugin[0](context) : plugin[0] : isFunction(plugin) ? plugin(context) : plugin;
|
|
9
|
+
} catch {
|
|
10
|
+
return plugin[0];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolve the [Babel](https://babeljs.io/) plugin.
|
|
15
|
+
*
|
|
16
|
+
* @param context - The context for the transformation.
|
|
17
|
+
* @param code - The code to be transformed.
|
|
18
|
+
* @param id - The ID of the source file.
|
|
19
|
+
* @param plugin - The Babel plugin to resolve.
|
|
20
|
+
* @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
|
|
21
|
+
*/
|
|
22
|
+
function resolveBabelPlugin(context, code, id, plugin) {
|
|
23
|
+
if (Array.isArray(plugin) && plugin.length > 0 && plugin[0]) {
|
|
24
|
+
if (plugin.length > 2 && plugin[2] && isFunction(plugin[2]) && !plugin[2](code, id)) {
|
|
25
|
+
context.trace(`Skipping filtered Babel plugin ${chalk.bold.cyanBright(getPluginName(plugin) || "unnamed")} for ${id}`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
return plugin.length > 2 ? [
|
|
29
|
+
resolvePluginFunction(context, plugin),
|
|
30
|
+
plugin[1],
|
|
31
|
+
plugin[2]
|
|
32
|
+
] : [
|
|
33
|
+
resolvePluginFunction(context, plugin),
|
|
34
|
+
plugin[1],
|
|
35
|
+
null
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
return [
|
|
39
|
+
resolvePluginFunction(context, plugin),
|
|
40
|
+
{},
|
|
41
|
+
null
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { resolveBabelPlugin, resolvePluginFunction };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_filters = require('./helpers/filters.cjs');
|
|
3
|
+
const require_options = require('./helpers/options.cjs');
|
|
4
|
+
require('./helpers/index.cjs');
|
|
5
|
+
let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
6
|
+
let defu = require("defu");
|
|
7
|
+
defu = require_rolldown_runtime.__toESM(defu);
|
|
8
|
+
let __babel_core = require("@babel/core");
|
|
9
|
+
let __stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
10
|
+
let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
11
|
+
|
|
12
|
+
//#region ../plugin-babel/src/index.ts
|
|
13
|
+
/**
|
|
14
|
+
* Babel plugin for Powerlines.
|
|
15
|
+
*
|
|
16
|
+
* @param options - The Babel plugin user configuration options.
|
|
17
|
+
* @returns A Powerlines plugin that integrates Babel transformations.
|
|
18
|
+
*/
|
|
19
|
+
const plugin = (options = {}) => {
|
|
20
|
+
return {
|
|
21
|
+
name: "babel",
|
|
22
|
+
config() {
|
|
23
|
+
if (!(0, __stryke_type_checks_is_set_object.isSetObject)(options)) return;
|
|
24
|
+
return { transform: { babel: options } };
|
|
25
|
+
},
|
|
26
|
+
configResolved: {
|
|
27
|
+
order: "pre",
|
|
28
|
+
handler() {
|
|
29
|
+
this.config.transform.babel = (0, defu.default)(this.config.transform.babel ?? {}, {
|
|
30
|
+
plugins: [],
|
|
31
|
+
presets: []
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
async transform(code, id) {
|
|
36
|
+
if ((0, __stryke_path_is_parent_path.isParentPath)(id, this.powerlinesPath) || code.includes("/* @powerlines-ignore */") || code.includes("/* @powerlines-disable */")) {
|
|
37
|
+
this.trace(`Skipping Babel transformation for: ${id}`);
|
|
38
|
+
return {
|
|
39
|
+
code,
|
|
40
|
+
id
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
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));
|
|
44
|
+
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));
|
|
45
|
+
if (Array.isArray(plugins) && plugins.length === 0 && Array.isArray(presets) && presets.length === 0) return {
|
|
46
|
+
code,
|
|
47
|
+
id
|
|
48
|
+
};
|
|
49
|
+
if (/^(?:m|c)?tsx?$/.test((0, __stryke_path_file_path_fns.findFileExtensionSafe)(id, { fullExtension: true })) && !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" }]);
|
|
50
|
+
this.trace(`Running babel transformations with ${plugins.length} plugins and ${presets.length} presets for file: ${id}`);
|
|
51
|
+
const result = await (0, __babel_core.transformAsync)(code, {
|
|
52
|
+
highlightCode: true,
|
|
53
|
+
code: true,
|
|
54
|
+
ast: false,
|
|
55
|
+
cloneInputAst: false,
|
|
56
|
+
comments: true,
|
|
57
|
+
sourceType: "module",
|
|
58
|
+
configFile: false,
|
|
59
|
+
babelrc: false,
|
|
60
|
+
envName: this.config.mode,
|
|
61
|
+
caller: { name: this.config.framework },
|
|
62
|
+
...this.config.transform.babel ?? {},
|
|
63
|
+
filename: id,
|
|
64
|
+
plugins: plugins.map((plugin$1) => {
|
|
65
|
+
return Array.isArray(plugin$1) && plugin$1.length >= 2 ? [plugin$1[0], (0, defu.default)(plugin$1.length > 1 && plugin$1[1] ? plugin$1[1] : {}, { options })] : plugin$1;
|
|
66
|
+
}).filter(Boolean),
|
|
67
|
+
presets: presets.map((preset) => {
|
|
68
|
+
return Array.isArray(preset) && preset.length >= 2 ? [preset[0], (0, defu.default)(preset.length > 1 && preset[1] ? preset[1] : {}, { options })] : preset;
|
|
69
|
+
}).filter(Boolean)
|
|
70
|
+
});
|
|
71
|
+
if (!result?.code) throw new Error(`Powerlines - Babel plugin failed to compile ${id}`);
|
|
72
|
+
this.trace(`Completed babel transformations for file: ${id}`);
|
|
73
|
+
return {
|
|
74
|
+
code: result.code,
|
|
75
|
+
id
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
var src_default = plugin;
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
exports.default = src_default;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { getPluginName, isDuplicatePlugin } from "./helpers/filters.mjs";
|
|
2
|
+
import { resolveBabelPlugin, resolvePluginFunction } from "./helpers/options.mjs";
|
|
3
|
+
import "./helpers/index.mjs";
|
|
4
|
+
import { findFileExtension, findFileExtensionSafe } from "@stryke/path/file-path-fns";
|
|
5
|
+
import defu from "defu";
|
|
6
|
+
import { transformAsync } from "@babel/core";
|
|
7
|
+
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
8
|
+
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
9
|
+
|
|
10
|
+
//#region ../plugin-babel/src/index.ts
|
|
11
|
+
/**
|
|
12
|
+
* Babel plugin for Powerlines.
|
|
13
|
+
*
|
|
14
|
+
* @param options - The Babel plugin user configuration options.
|
|
15
|
+
* @returns A Powerlines plugin that integrates Babel transformations.
|
|
16
|
+
*/
|
|
17
|
+
const plugin = (options = {}) => {
|
|
18
|
+
return {
|
|
19
|
+
name: "babel",
|
|
20
|
+
config() {
|
|
21
|
+
if (!isSetObject(options)) return;
|
|
22
|
+
return { transform: { babel: options } };
|
|
23
|
+
},
|
|
24
|
+
configResolved: {
|
|
25
|
+
order: "pre",
|
|
26
|
+
handler() {
|
|
27
|
+
this.config.transform.babel = defu(this.config.transform.babel ?? {}, {
|
|
28
|
+
plugins: [],
|
|
29
|
+
presets: []
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
async transform(code, id) {
|
|
34
|
+
if (isParentPath(id, this.powerlinesPath) || code.includes("/* @powerlines-ignore */") || code.includes("/* @powerlines-disable */")) {
|
|
35
|
+
this.trace(`Skipping Babel transformation for: ${id}`);
|
|
36
|
+
return {
|
|
37
|
+
code,
|
|
38
|
+
id
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
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));
|
|
42
|
+
const presets = this.config.transform.babel.presets.map((preset) => resolveBabelPlugin(this, code, id, preset)).filter((preset, _, arr) => preset && !isDuplicatePlugin(arr, preset));
|
|
43
|
+
if (Array.isArray(plugins) && plugins.length === 0 && Array.isArray(presets) && presets.length === 0) return {
|
|
44
|
+
code,
|
|
45
|
+
id
|
|
46
|
+
};
|
|
47
|
+
if (/^(?:m|c)?tsx?$/.test(findFileExtensionSafe(id, { fullExtension: true })) && !isDuplicatePlugin(plugins, "@babel/plugin-syntax-typescript") && !isDuplicatePlugin(presets, "@babel/preset-typescript")) plugins.unshift(["@babel/plugin-syntax-typescript", { isTSX: findFileExtension(id) === "tsx" }]);
|
|
48
|
+
this.trace(`Running babel transformations with ${plugins.length} plugins and ${presets.length} presets for file: ${id}`);
|
|
49
|
+
const result = await transformAsync(code, {
|
|
50
|
+
highlightCode: true,
|
|
51
|
+
code: true,
|
|
52
|
+
ast: false,
|
|
53
|
+
cloneInputAst: false,
|
|
54
|
+
comments: true,
|
|
55
|
+
sourceType: "module",
|
|
56
|
+
configFile: false,
|
|
57
|
+
babelrc: false,
|
|
58
|
+
envName: this.config.mode,
|
|
59
|
+
caller: { name: this.config.framework },
|
|
60
|
+
...this.config.transform.babel ?? {},
|
|
61
|
+
filename: id,
|
|
62
|
+
plugins: plugins.map((plugin$1) => {
|
|
63
|
+
return Array.isArray(plugin$1) && plugin$1.length >= 2 ? [plugin$1[0], defu(plugin$1.length > 1 && plugin$1[1] ? plugin$1[1] : {}, { options })] : plugin$1;
|
|
64
|
+
}).filter(Boolean),
|
|
65
|
+
presets: presets.map((preset) => {
|
|
66
|
+
return Array.isArray(preset) && preset.length >= 2 ? [preset[0], defu(preset.length > 1 && preset[1] ? preset[1] : {}, { options })] : preset;
|
|
67
|
+
}).filter(Boolean)
|
|
68
|
+
});
|
|
69
|
+
if (!result?.code) throw new Error(`Powerlines - Babel plugin failed to compile ${id}`);
|
|
70
|
+
this.trace(`Completed babel transformations for file: ${id}`);
|
|
71
|
+
return {
|
|
72
|
+
code: result.code,
|
|
73
|
+
id
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
var src_default = plugin;
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
export { src_default as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BabelResolvedConfig, ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
|
|
2
2
|
import { UserConfig } from "../../../powerlines/src/types/config.mjs";
|
|
3
|
+
import "../../../powerlines/src/types/context.mjs";
|
|
3
4
|
|
|
4
5
|
//#region ../plugin-babel/src/types/plugin.d.ts
|
|
5
6
|
type BabelPluginUserConfig = UserConfig;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
3
|
+
let chalk = require("chalk");
|
|
4
|
+
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
5
|
+
require("@storm-software/config-tools/types");
|
|
6
|
+
require("@storm-software/config-tools/logger");
|
|
7
|
+
require("@storm-software/config-tools/utilities/colors");
|
|
8
|
+
require("@stryke/helpers/noop");
|
|
9
|
+
require("@stryke/string-format/kebab-case");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
4
|
+
import "@storm-software/config-tools/logger";
|
|
5
|
+
import "@storm-software/config-tools/utilities/colors";
|
|
6
|
+
import "@stryke/helpers/noop";
|
|
7
|
+
import "@stryke/string-format/kebab-case";
|
|
8
|
+
|
|
9
|
+
export { };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
3
|
+
|
|
4
|
+
//#region ../powerlines/src/lib/utilities/file-header.ts
|
|
5
|
+
function getBaseFileHeader(context) {
|
|
6
|
+
return `
|
|
7
|
+
// Generated with ${(0, __stryke_string_format_title_case.titleCase)(context.config.framework)}
|
|
8
|
+
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
9
|
+
`;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.getBaseFileHeader = getBaseFileHeader;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
2
|
+
|
|
3
|
+
//#region ../powerlines/src/lib/utilities/file-header.ts
|
|
4
|
+
function getBaseFileHeader(context) {
|
|
5
|
+
return `
|
|
6
|
+
// Generated with ${titleCase(context.config.framework)}
|
|
7
|
+
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
8
|
+
`;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { getBaseFileHeader };
|
|
@@ -4,10 +4,10 @@ import { StoragePort, StoragePreset } from "./fs.mjs";
|
|
|
4
4
|
import { Plugin } from "./plugin.mjs";
|
|
5
5
|
import { TSConfig } from "./tsconfig.mjs";
|
|
6
6
|
import { PluginContext } from "./context.mjs";
|
|
7
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
8
7
|
import { transformAsync } from "@babel/core";
|
|
9
|
-
import { Format } from "@storm-software/build-tools/types";
|
|
10
8
|
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
9
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
10
|
+
import { Format } from "@storm-software/build-tools/types";
|
|
11
11
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
12
12
|
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
13
13
|
import { AssetGlob } from "@stryke/types/file";
|
|
@@ -2,6 +2,7 @@ import { BuilderVariant, InferUnpluginVariant, UnpluginBuilderVariant } from "./
|
|
|
2
2
|
import { InferResolvedConfig } from "./resolved.mjs";
|
|
3
3
|
import { API } from "./api.mjs";
|
|
4
4
|
import { PluginHook } from "./plugin.mjs";
|
|
5
|
+
import "./config.mjs";
|
|
5
6
|
import { Context } from "./context.mjs";
|
|
6
7
|
import { MaybePromise } from "@stryke/types/base";
|
|
7
8
|
import { HookFilter, UnpluginOptions } from "unplugin";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TSDocModuleProps } from "./tsdoc.cjs";
|
|
2
2
|
import { TypescriptFileProps } from "./typescript-file.cjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core5 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/typescript/components/builtin-file.d.ts
|
|
6
6
|
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
@@ -28,7 +28,7 @@ type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProp
|
|
|
28
28
|
* @param props - The properties for the source file.
|
|
29
29
|
* @returns The rendered source file component.
|
|
30
30
|
*/
|
|
31
|
-
declare function BuiltinFile(props: BuiltinFileProps):
|
|
31
|
+
declare function BuiltinFile(props: BuiltinFileProps): _alloy_js_core5.Children;
|
|
32
32
|
declare type __ΩBuiltinFileProps = any[];
|
|
33
33
|
//#endregion
|
|
34
34
|
export { BuiltinFile, BuiltinFileProps, __ΩBuiltinFileProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TSDocModuleProps } from "./tsdoc.mjs";
|
|
2
2
|
import { TypescriptFileProps } from "./typescript-file.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core7 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/typescript/components/builtin-file.d.ts
|
|
6
6
|
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
@@ -28,7 +28,7 @@ type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProp
|
|
|
28
28
|
* @param props - The properties for the source file.
|
|
29
29
|
* @returns The rendered source file component.
|
|
30
30
|
*/
|
|
31
|
-
declare function BuiltinFile(props: BuiltinFileProps):
|
|
31
|
+
declare function BuiltinFile(props: BuiltinFileProps): _alloy_js_core7.Children;
|
|
32
32
|
declare type __ΩBuiltinFileProps = any[];
|
|
33
33
|
//#endregion
|
|
34
34
|
export { BuiltinFile, BuiltinFileProps, __ΩBuiltinFileProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
2
2
|
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/components/dynamic-import-statement.d.ts
|
|
@@ -26,7 +26,7 @@ interface DynamicImportStatementProps extends Omit<VarDeclarationProps, "initial
|
|
|
26
26
|
* @param props - The properties for the dynamic import statement.
|
|
27
27
|
* @returns A `VarDeclaration` component representing the dynamic import statement.
|
|
28
28
|
*/
|
|
29
|
-
declare function DynamicImportStatement(props: DynamicImportStatementProps):
|
|
29
|
+
declare function DynamicImportStatement(props: DynamicImportStatementProps): _alloy_js_core1.Children;
|
|
30
30
|
declare type __ΩDynamicImportStatementProps = any[];
|
|
31
31
|
//#endregion
|
|
32
32
|
export { DynamicImportStatement, DynamicImportStatementProps, __ΩDynamicImportStatementProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core8 from "@alloy-js/core";
|
|
2
2
|
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/components/dynamic-import-statement.d.ts
|
|
@@ -26,7 +26,7 @@ interface DynamicImportStatementProps extends Omit<VarDeclarationProps, "initial
|
|
|
26
26
|
* @param props - The properties for the dynamic import statement.
|
|
27
27
|
* @returns A `VarDeclaration` component representing the dynamic import statement.
|
|
28
28
|
*/
|
|
29
|
-
declare function DynamicImportStatement(props: DynamicImportStatementProps):
|
|
29
|
+
declare function DynamicImportStatement(props: DynamicImportStatementProps): _alloy_js_core8.Children;
|
|
30
30
|
declare type __ΩDynamicImportStatementProps = any[];
|
|
31
31
|
//#endregion
|
|
32
32
|
export { DynamicImportStatement, DynamicImportStatementProps, __ΩDynamicImportStatementProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResolvedEntryTypeDefinition } from "../../powerlines/src/types/resolved.cjs";
|
|
2
2
|
import { TypescriptFileProps } from "./typescript-file.cjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core16 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/typescript/components/entry-file.d.ts
|
|
6
6
|
type EntryFileProps = TypescriptFileProps & {
|
|
@@ -21,7 +21,7 @@ type EntryFileProps = TypescriptFileProps & {
|
|
|
21
21
|
* @param props - The properties for the source file.
|
|
22
22
|
* @returns The rendered source file component.
|
|
23
23
|
*/
|
|
24
|
-
declare function EntryFile(props: EntryFileProps):
|
|
24
|
+
declare function EntryFile(props: EntryFileProps): _alloy_js_core16.Children;
|
|
25
25
|
declare type __ΩEntryFileProps = any[];
|
|
26
26
|
//#endregion
|
|
27
27
|
export { EntryFile, EntryFileProps, __ΩEntryFileProps };
|
|
@@ -3,10 +3,10 @@ const require_typescript_components_tsdoc = require('./tsdoc.cjs');
|
|
|
3
3
|
const require_core_contexts_reflection = require('../../core/contexts/reflection.cjs');
|
|
4
4
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
5
|
let __alloy_js_core = require("@alloy-js/core");
|
|
6
|
-
let
|
|
6
|
+
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
7
7
|
let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
8
|
+
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
8
9
|
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
9
|
-
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
10
10
|
|
|
11
11
|
//#region src/typescript/components/tsdoc-reflection.tsx
|
|
12
12
|
/**
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { TSDocProps } from "./tsdoc.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core6 from "@alloy-js/core";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/components/tsdoc-reflection.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Generates a TypeScript interface property for the given reflection class.
|
|
7
7
|
*/
|
|
8
|
-
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps):
|
|
8
|
+
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): _alloy_js_core6.Children;
|
|
9
9
|
/**
|
|
10
10
|
* Generates a TypeScript interface property for the given reflection class.
|
|
11
11
|
*/
|
|
12
|
-
declare function TSDocReflectionProperty(props: TSDocProps):
|
|
12
|
+
declare function TSDocReflectionProperty(props: TSDocProps): _alloy_js_core6.Children;
|
|
13
13
|
/**
|
|
14
14
|
* Generates a TypeScript interface property for the given reflection class.
|
|
15
15
|
*/
|
|
16
|
-
declare function TSDocReflectionMethod(props: TSDocProps):
|
|
16
|
+
declare function TSDocReflectionMethod(props: TSDocProps): _alloy_js_core6.Children;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { TSDocReflectionClass, TSDocReflectionMethod, TSDocReflectionProperty };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { TSDocProps } from "./tsdoc.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/components/tsdoc-reflection.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Generates a TypeScript interface property for the given reflection class.
|
|
7
7
|
*/
|
|
8
|
-
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps):
|
|
8
|
+
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): _alloy_js_core1.Children;
|
|
9
9
|
/**
|
|
10
10
|
* Generates a TypeScript interface property for the given reflection class.
|
|
11
11
|
*/
|
|
12
|
-
declare function TSDocReflectionProperty(props: TSDocProps):
|
|
12
|
+
declare function TSDocReflectionProperty(props: TSDocProps): _alloy_js_core1.Children;
|
|
13
13
|
/**
|
|
14
14
|
* Generates a TypeScript interface property for the given reflection class.
|
|
15
15
|
*/
|
|
16
|
-
declare function TSDocReflectionMethod(props: TSDocProps):
|
|
16
|
+
declare function TSDocReflectionMethod(props: TSDocProps): _alloy_js_core1.Children;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { TSDocReflectionClass, TSDocReflectionMethod, TSDocReflectionProperty };
|
|
@@ -2,10 +2,10 @@ import { TSDoc, TSDocAttributesTags } from "./tsdoc.mjs";
|
|
|
2
2
|
import { useReflectionClass, useReflectionMethod, useReflectionProperty } from "../../core/contexts/reflection.mjs";
|
|
3
3
|
import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
4
4
|
import { List, Show, childrenArray, code, computed, splitProps } from "@alloy-js/core";
|
|
5
|
-
import {
|
|
5
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
6
6
|
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
7
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
7
8
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
8
|
-
import { isString } from "@stryke/type-checks/is-string";
|
|
9
9
|
|
|
10
10
|
//#region src/typescript/components/tsdoc-reflection.tsx
|
|
11
11
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_core_contexts_context = require('../../core/contexts/context.cjs');
|
|
3
|
+
const require_utilities = require('../../deepkit/src/utilities.cjs');
|
|
3
4
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
5
|
let __alloy_js_core = require("@alloy-js/core");
|
|
5
|
-
let __powerlines_deepkit_utilities = require("@powerlines/deepkit/utilities");
|
|
6
|
-
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
7
6
|
let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
7
|
+
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
8
8
|
|
|
9
9
|
//#region src/typescript/components/tsdoc.tsx
|
|
10
10
|
/**
|
|
@@ -158,7 +158,7 @@ function TSDocDefaultValue(props) {
|
|
|
158
158
|
width: 2,
|
|
159
159
|
get children() {
|
|
160
160
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Prose, { get children() {
|
|
161
|
-
return
|
|
161
|
+
return require_utilities.stringifyDefaultValue(type, defaultValue);
|
|
162
162
|
} });
|
|
163
163
|
}
|
|
164
164
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
2
|
import { Children } from "@alloy-js/core";
|
|
3
|
-
import { JSDocExampleProps, ParameterDescriptor } from "@alloy-js/typescript";
|
|
4
3
|
import { ReflectionKind, ReflectionParameter, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
import { JSDocExampleProps, ParameterDescriptor } from "@alloy-js/typescript";
|
|
5
5
|
|
|
6
6
|
//#region src/typescript/components/tsdoc.d.ts
|
|
7
7
|
interface TSDocProps extends ComponentProps {
|