@powerlines/plugin-plugin 0.11.7 → 0.11.9

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.
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var src_types_plugin = require('./types/plugin.cjs');
6
5
  var alloyBabelPreset = require('@alloy-js/babel-preset');
7
6
  var typescriptBabelPreset = require('@babel/preset-typescript');
8
7
  var types = require('@storm-software/config-tools/types');
@@ -16,18 +15,30 @@ var defu = require('defu');
16
15
  var index = require('../node_modules/.pnpm/esbuild-plugin-babel@0.2.3_@babel_core@7.28.5/node_modules/esbuild-plugin-babel/src/index.cjs');
17
16
  var tsup$1 = require('powerlines/lib/build/tsup');
18
17
 
19
- /*@ts-ignore*/
20
- function __assignType(fn, args) {
21
- fn.__type = args;
22
- return fn;
23
- }
18
+ /* -------------------------------------------------------------------
19
+
20
+ Storm Software - Powerlines
21
+
22
+ This code was released as part of the Powerlines project. Powerlines
23
+ is maintained by Storm Software under the Apache-2.0 license, and is
24
+ free for commercial and private use. For more information, please visit
25
+ our licensing page at https://stormsoftware.com/licenses/projects/powerlines.
26
+
27
+ Website: https://stormsoftware.com
28
+ Repository: https://github.com/storm-software/powerlines
29
+ Documentation: https://docs.stormsoftware.com/projects/powerlines
30
+ Contact: https://stormsoftware.com/contact
31
+
32
+ SPDX-License-Identifier: Apache-2.0
33
+
34
+ ------------------------------------------------------------------- */
24
35
  /**
25
36
  * A Powerlines plugin to assist in developing other Powerlines plugins.
26
37
  */
27
- const plugin = __assignType((options = {}) => {
38
+ const plugin = (options = {}) => {
28
39
  return {
29
40
  name: "plugin",
30
- config: __assignType(function config() {
41
+ config() {
31
42
  this.log(types.LogLevelLabel.TRACE, "Providing default configuration for the Powerlines plugin.");
32
43
  return {
33
44
  type: "library",
@@ -38,14 +49,15 @@ const plugin = __assignType((options = {}) => {
38
49
  format: ["cjs", "esm"]
39
50
  },
40
51
  build: {
52
+ variant: "tsup",
41
53
  external: ["powerlines"],
42
54
  bundle: false,
43
55
  skipNodeModulesBundle: true,
44
56
  platform: "node"
45
57
  }
46
58
  };
47
- }, ['config', 'P"/!']),
48
- configResolved: __assignType(async function configResolved() {
59
+ },
60
+ async configResolved() {
49
61
  this.log(types.LogLevelLabel.TRACE, "The Powerlines plugin has resolved the final configuration.");
50
62
  if (options.alloy) {
51
63
  if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== "preserve") {
@@ -54,18 +66,18 @@ const plugin = __assignType((options = {}) => {
54
66
  await this.fs.writeFile(this.tsconfig.tsconfigFilePath, stormJson.StormJSON.stringify(this.tsconfig.tsconfigJson), { mode: "fs" });
55
67
  }
56
68
  if (this.config.output.projectDistPath) {
57
- this.config.override.outputPath ??= join.joinPaths(this.config.projectRoot, this.config.output.projectDistPath);
69
+ this.config.override.outputPath = join.joinPaths(this.config.projectRoot, this.config.output.projectDistPath);
58
70
  }
59
- }, ['configResolved', 'P"/!']),
71
+ },
60
72
  async build() {
61
- return tsup.build(await tsup.resolveOptions(defu.defu({
73
+ await tsup.build(await tsup.resolveOptions(defu.defu({
62
74
  config: false,
63
- entry: Object.fromEntries(Object.entries(tsup$1.resolveTsupEntry(this, this.entry)).map(__assignType(([key, value]) => [
75
+ entry: Object.fromEntries(Object.entries(tsup$1.resolveTsupEntry(this, this.entry)).map(([key, value]) => [
64
76
  key,
65
77
  isParentPath.isParentPath(value, this.config.projectRoot)
66
78
  ? value
67
79
  : join.joinPaths(this.config.projectRoot, value)
68
- ], ['param0', '', 'P"2!"/"'])))
80
+ ]))
69
81
  }, tsup$1.extractTsupConfig(this), {
70
82
  esbuildPlugins: options.alloy
71
83
  ? [
@@ -87,22 +99,17 @@ const plugin = __assignType((options = {}) => {
87
99
  ]
88
100
  : []
89
101
  })));
90
- },
91
- buildFinish: __assignType(async function buildFinish() {
92
- if (this.config.override.outputPath &&
93
- this.config.override.outputPath !== this.config.output.outputPath) {
94
- this.log(types.LogLevelLabel.INFO, `Copying built files from override output path (${this.config.override.outputPath}) to final output path (${this.config.output.outputPath}).`);
95
- await copyFile.copyFiles(append.appendPath(this.config.override.outputPath, this.workspaceConfig.workspaceRoot), join.joinPaths(append.appendPath(this.config.output.outputPath, this.workspaceConfig.workspaceRoot), "dist"));
102
+ if (this.config.override.outputPath) {
103
+ const sourcePath = append.appendPath(this.config.override.outputPath, this.workspaceConfig.workspaceRoot);
104
+ const destinationPath = join.joinPaths(append.appendPath(this.config.output.outputPath, this.workspaceConfig.workspaceRoot), "dist");
105
+ if (sourcePath !== destinationPath) {
106
+ this.log(types.LogLevelLabel.INFO, `Copying build output files from project directory (${this.config.override.outputPath}) to output directory (${this.config.output.outputPath}).`);
107
+ await copyFile.copyFiles({ input: sourcePath, glob: "**/*" }, destinationPath);
108
+ }
96
109
  }
97
- }, ['buildFinish', 'P"/!'])
110
+ }
98
111
  };
99
- }, [() => src_types_plugin.__ΩPluginPluginOptions, 'options', () => ({}), '', 'Pn!2">#!/$']);
112
+ };
100
113
 
101
- exports.__ΩPluginPluginAlloyOptions = src_types_plugin.__ΩPluginPluginAlloyOptions;
102
- exports.__ΩPluginPluginContext = src_types_plugin.__ΩPluginPluginContext;
103
- exports.__ΩPluginPluginOptions = src_types_plugin.__ΩPluginPluginOptions;
104
- exports.__ΩPluginPluginOutputConfig = src_types_plugin.__ΩPluginPluginOutputConfig;
105
- exports.__ΩPluginPluginResolvedConfig = src_types_plugin.__ΩPluginPluginResolvedConfig;
106
- exports.__ΩPluginPluginUserConfig = src_types_plugin.__ΩPluginPluginUserConfig;
107
114
  exports.default = plugin;
108
115
  exports.plugin = plugin;
package/dist/src/index.js CHANGED
@@ -1,5 +1,3 @@
1
- import { __ΩPluginPluginOptions as ___PluginPluginOptions } from './types/plugin.js';
2
- export { __ΩPluginPluginAlloyOptions, __ΩPluginPluginContext, __ΩPluginPluginOutputConfig, __ΩPluginPluginResolvedConfig, __ΩPluginPluginUserConfig } from './types/plugin.js';
3
1
  import alloyBabelPreset from '@alloy-js/babel-preset';
4
2
  import typescriptBabelPreset from '@babel/preset-typescript';
5
3
  import { LogLevelLabel } from '@storm-software/config-tools/types';
@@ -13,18 +11,30 @@ import { defu } from 'defu';
13
11
  import pluginBabel from '../node_modules/.pnpm/esbuild-plugin-babel@0.2.3_@babel_core@7.28.5/node_modules/esbuild-plugin-babel/src/index.js';
14
12
  import { resolveTsupEntry, extractTsupConfig } from 'powerlines/lib/build/tsup';
15
13
 
16
- /*@ts-ignore*/
17
- function __assignType(fn, args) {
18
- fn.__type = args;
19
- return fn;
20
- }
14
+ /* -------------------------------------------------------------------
15
+
16
+ Storm Software - Powerlines
17
+
18
+ This code was released as part of the Powerlines project. Powerlines
19
+ is maintained by Storm Software under the Apache-2.0 license, and is
20
+ free for commercial and private use. For more information, please visit
21
+ our licensing page at https://stormsoftware.com/licenses/projects/powerlines.
22
+
23
+ Website: https://stormsoftware.com
24
+ Repository: https://github.com/storm-software/powerlines
25
+ Documentation: https://docs.stormsoftware.com/projects/powerlines
26
+ Contact: https://stormsoftware.com/contact
27
+
28
+ SPDX-License-Identifier: Apache-2.0
29
+
30
+ ------------------------------------------------------------------- */
21
31
  /**
22
32
  * A Powerlines plugin to assist in developing other Powerlines plugins.
23
33
  */
24
- const plugin = __assignType((options = {}) => {
34
+ const plugin = (options = {}) => {
25
35
  return {
26
36
  name: "plugin",
27
- config: __assignType(function config() {
37
+ config() {
28
38
  this.log(LogLevelLabel.TRACE, "Providing default configuration for the Powerlines plugin.");
29
39
  return {
30
40
  type: "library",
@@ -35,14 +45,15 @@ const plugin = __assignType((options = {}) => {
35
45
  format: ["cjs", "esm"]
36
46
  },
37
47
  build: {
48
+ variant: "tsup",
38
49
  external: ["powerlines"],
39
50
  bundle: false,
40
51
  skipNodeModulesBundle: true,
41
52
  platform: "node"
42
53
  }
43
54
  };
44
- }, ['config', 'P"/!']),
45
- configResolved: __assignType(async function configResolved() {
55
+ },
56
+ async configResolved() {
46
57
  this.log(LogLevelLabel.TRACE, "The Powerlines plugin has resolved the final configuration.");
47
58
  if (options.alloy) {
48
59
  if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== "preserve") {
@@ -51,18 +62,18 @@ const plugin = __assignType((options = {}) => {
51
62
  await this.fs.writeFile(this.tsconfig.tsconfigFilePath, StormJSON.stringify(this.tsconfig.tsconfigJson), { mode: "fs" });
52
63
  }
53
64
  if (this.config.output.projectDistPath) {
54
- this.config.override.outputPath ??= joinPaths(this.config.projectRoot, this.config.output.projectDistPath);
65
+ this.config.override.outputPath = joinPaths(this.config.projectRoot, this.config.output.projectDistPath);
55
66
  }
56
- }, ['configResolved', 'P"/!']),
67
+ },
57
68
  async build() {
58
- return build(await resolveOptions(defu({
69
+ await build(await resolveOptions(defu({
59
70
  config: false,
60
- entry: Object.fromEntries(Object.entries(resolveTsupEntry(this, this.entry)).map(__assignType(([key, value]) => [
71
+ entry: Object.fromEntries(Object.entries(resolveTsupEntry(this, this.entry)).map(([key, value]) => [
61
72
  key,
62
73
  isParentPath(value, this.config.projectRoot)
63
74
  ? value
64
75
  : joinPaths(this.config.projectRoot, value)
65
- ], ['param0', '', 'P"2!"/"'])))
76
+ ]))
66
77
  }, extractTsupConfig(this), {
67
78
  esbuildPlugins: options.alloy
68
79
  ? [
@@ -84,15 +95,16 @@ const plugin = __assignType((options = {}) => {
84
95
  ]
85
96
  : []
86
97
  })));
87
- },
88
- buildFinish: __assignType(async function buildFinish() {
89
- if (this.config.override.outputPath &&
90
- this.config.override.outputPath !== this.config.output.outputPath) {
91
- this.log(LogLevelLabel.INFO, `Copying built files from override output path (${this.config.override.outputPath}) to final output path (${this.config.output.outputPath}).`);
92
- await copyFiles(appendPath(this.config.override.outputPath, this.workspaceConfig.workspaceRoot), joinPaths(appendPath(this.config.output.outputPath, this.workspaceConfig.workspaceRoot), "dist"));
98
+ if (this.config.override.outputPath) {
99
+ const sourcePath = appendPath(this.config.override.outputPath, this.workspaceConfig.workspaceRoot);
100
+ const destinationPath = joinPaths(appendPath(this.config.output.outputPath, this.workspaceConfig.workspaceRoot), "dist");
101
+ if (sourcePath !== destinationPath) {
102
+ this.log(LogLevelLabel.INFO, `Copying build output files from project directory (${this.config.override.outputPath}) to output directory (${this.config.output.outputPath}).`);
103
+ await copyFiles({ input: sourcePath, glob: "**/*" }, destinationPath);
104
+ }
93
105
  }
94
- }, ['buildFinish', 'P"/!'])
106
+ }
95
107
  };
96
- }, [() => ___PluginPluginOptions, 'options', () => ({}), '', 'Pn!2">#!/$']);
108
+ };
97
109
 
98
- export { ___PluginPluginOptions as __ΩPluginPluginOptions, plugin as default, plugin };
110
+ export { plugin as default, plugin };
@@ -1,12 +1,2 @@
1
1
  'use strict';
2
2
 
3
- var src_types_plugin = require('./plugin.cjs');
4
-
5
-
6
-
7
- exports.__ΩPluginPluginAlloyOptions = src_types_plugin.__ΩPluginPluginAlloyOptions;
8
- exports.__ΩPluginPluginContext = src_types_plugin.__ΩPluginPluginContext;
9
- exports.__ΩPluginPluginOptions = src_types_plugin.__ΩPluginPluginOptions;
10
- exports.__ΩPluginPluginOutputConfig = src_types_plugin.__ΩPluginPluginOutputConfig;
11
- exports.__ΩPluginPluginResolvedConfig = src_types_plugin.__ΩPluginPluginResolvedConfig;
12
- exports.__ΩPluginPluginUserConfig = src_types_plugin.__ΩPluginPluginUserConfig;
@@ -1 +1 @@
1
- export { __ΩPluginPluginAlloyOptions, __ΩPluginPluginContext, __ΩPluginPluginOptions, __ΩPluginPluginOutputConfig, __ΩPluginPluginResolvedConfig, __ΩPluginPluginUserConfig } from './plugin.js';
1
+
@@ -1,17 +1,2 @@
1
1
  'use strict';
2
2
 
3
- const __ΩPartial = ['T', 'Partial', 'l+e#!e"!fRb!Pde"!gN#"w"y'];
4
- const __ΩRequired = ['T', 'Required', 'l+e#!e"!fRb!Pde"!gN##w"y'];
5
- const __ΩPluginPluginAlloyOptions = [() => __ΩPartial, 'PrintTreeOptions', 'generatesJson', true, 'generatesMarkdown', 'PluginPluginAlloyOptions', 'P"w"o!"P)4#8>$)4%8>$MKw&y'];
6
- const __ΩPluginPluginOptions = [() => __ΩPluginPluginAlloyOptions, 'alloy', false, 'babel', 'PluginPluginOptions', 'PPn!)J4"8>#!4$8Mw%y'];
7
- const __ΩPluginPluginOutputConfig = ['projectDistPath', 'dist', 'PluginPluginOutputConfig', 'P!P&4!>"MKw#y'];
8
- const __ΩPluginPluginUserConfig = [false, () => __ΩPartial, () => __ΩPluginPluginAlloyOptions, 'alloy', () => __ΩPartial, () => __ΩPluginPluginOutputConfig, 'output', 'PluginPluginUserConfig', 'P!!PP.!n#o""J4$8n&o%"4\'8MKw(y'];
9
- const __ΩPluginPluginResolvedConfig = [false, () => __ΩRequired, () => __ΩPluginPluginAlloyOptions, 'alloy', () => __ΩPluginPluginOutputConfig, 'output', 'PluginPluginResolvedConfig', 'P!!PP.!n#o""J4$n%4&MKw\'y'];
10
- const __ΩPluginPluginContext = [() => __ΩPluginPluginResolvedConfig, 'TResolvedConfig', 'PluginPluginContext', 'n!c"P!!Kw#y'];
11
-
12
- exports.__ΩPluginPluginAlloyOptions = __ΩPluginPluginAlloyOptions;
13
- exports.__ΩPluginPluginContext = __ΩPluginPluginContext;
14
- exports.__ΩPluginPluginOptions = __ΩPluginPluginOptions;
15
- exports.__ΩPluginPluginOutputConfig = __ΩPluginPluginOutputConfig;
16
- exports.__ΩPluginPluginResolvedConfig = __ΩPluginPluginResolvedConfig;
17
- exports.__ΩPluginPluginUserConfig = __ΩPluginPluginUserConfig;
@@ -1,7 +1,8 @@
1
1
  import { PrintTreeOptions } from "@alloy-js/core";
2
- import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types/plugin";
3
- import { TsupPluginContext, TsupPluginResolvedConfig, TsupPluginUserConfig } from "@powerlines/plugin-tsup/types/plugin";
4
- import { OutputConfig } from "powerlines/types/config";
2
+ import { TsupBuildConfig, TsupResolvedBuildConfig } from "powerlines/types/build";
3
+ import { OutputConfig, UserConfig } from "powerlines/types/config";
4
+ import { PluginContext } from "powerlines/types/context";
5
+ import { ResolvedConfig } from "powerlines/types/resolved";
5
6
  export type PluginPluginAlloyOptions = Partial<PrintTreeOptions> & {
6
7
  /**
7
8
  * If true, the Alloy framework is used to generate JSON output files.
@@ -26,13 +27,6 @@ export interface PluginPluginOptions {
26
27
  * @defaultValue false
27
28
  */
28
29
  alloy?: PluginPluginAlloyOptions | boolean;
29
- /**
30
- * Babel configuration options to use during the transformation process.
31
- *
32
- * @remarks
33
- * This option allows you to customize the Babel transformation process used during the build. If not provided, the plugin will use default Babel settings.
34
- */
35
- babel?: BabelPluginOptions;
36
30
  }
37
31
  export type PluginPluginOutputConfig = OutputConfig & {
38
32
  /**
@@ -45,19 +39,17 @@ export type PluginPluginOutputConfig = OutputConfig & {
45
39
  */
46
40
  projectDistPath: string;
47
41
  };
48
- export type PluginPluginUserConfig = TsupPluginUserConfig & BabelPluginUserConfig & {
42
+ export interface PluginPluginUserConfig extends UserConfig {
49
43
  alloy?: false | Partial<PluginPluginAlloyOptions>;
50
44
  output?: Partial<PluginPluginOutputConfig>;
51
- };
52
- export type PluginPluginResolvedConfig = TsupPluginResolvedConfig & BabelPluginResolvedConfig & {
45
+ build?: Partial<TsupBuildConfig>;
46
+ override?: Partial<TsupResolvedBuildConfig>;
47
+ }
48
+ export type PluginPluginResolvedConfig = ResolvedConfig & {
53
49
  alloy: false | Required<PluginPluginAlloyOptions>;
54
50
  output: PluginPluginOutputConfig;
51
+ build: TsupResolvedBuildConfig;
52
+ override: TsupResolvedBuildConfig;
55
53
  };
56
- export type PluginPluginContext<TResolvedConfig extends PluginPluginResolvedConfig = PluginPluginResolvedConfig> = BabelPluginContext<TResolvedConfig> & TsupPluginContext<TResolvedConfig>;
57
- export declare type __ΩPluginPluginAlloyOptions = any[];
58
- export declare type __ΩPluginPluginOptions = any[];
59
- export declare type __ΩPluginPluginOutputConfig = any[];
60
- export declare type __ΩPluginPluginUserConfig = any[];
61
- export declare type __ΩPluginPluginResolvedConfig = any[];
62
- export declare type __ΩPluginPluginContext = any[];
54
+ export type PluginPluginContext<TResolvedConfig extends PluginPluginResolvedConfig = PluginPluginResolvedConfig> = PluginContext<TResolvedConfig>;
63
55
  //# sourceMappingURL=plugin.d.ts.map
@@ -1,10 +1 @@
1
- const __ΩPartial = ['T', 'Partial', 'l+e#!e"!fRb!Pde"!gN#"w"y'];
2
- const __ΩRequired = ['T', 'Required', 'l+e#!e"!fRb!Pde"!gN##w"y'];
3
- const __ΩPluginPluginAlloyOptions = [() => __ΩPartial, 'PrintTreeOptions', 'generatesJson', true, 'generatesMarkdown', 'PluginPluginAlloyOptions', 'P"w"o!"P)4#8>$)4%8>$MKw&y'];
4
- const __ΩPluginPluginOptions = [() => __ΩPluginPluginAlloyOptions, 'alloy', false, 'babel', 'PluginPluginOptions', 'PPn!)J4"8>#!4$8Mw%y'];
5
- const __ΩPluginPluginOutputConfig = ['projectDistPath', 'dist', 'PluginPluginOutputConfig', 'P!P&4!>"MKw#y'];
6
- const __ΩPluginPluginUserConfig = [false, () => __ΩPartial, () => __ΩPluginPluginAlloyOptions, 'alloy', () => __ΩPartial, () => __ΩPluginPluginOutputConfig, 'output', 'PluginPluginUserConfig', 'P!!PP.!n#o""J4$8n&o%"4\'8MKw(y'];
7
- const __ΩPluginPluginResolvedConfig = [false, () => __ΩRequired, () => __ΩPluginPluginAlloyOptions, 'alloy', () => __ΩPluginPluginOutputConfig, 'output', 'PluginPluginResolvedConfig', 'P!!PP.!n#o""J4$n%4&MKw\'y'];
8
- const __ΩPluginPluginContext = [() => __ΩPluginPluginResolvedConfig, 'TResolvedConfig', 'PluginPluginContext', 'n!c"P!!Kw#y'];
9
1
 
10
- export { __ΩPluginPluginAlloyOptions, __ΩPluginPluginContext, __ΩPluginPluginOptions, __ΩPluginPluginOutputConfig, __ΩPluginPluginResolvedConfig, __ΩPluginPluginUserConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-plugin",
3
- "version": "0.11.7",
3
+ "version": "0.11.9",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -123,28 +123,28 @@
123
123
  "@alloy-js/markdown": "^0.20.0",
124
124
  "@alloy-js/typescript": "^0.20.0",
125
125
  "@babel/preset-typescript": "^7.28.5",
126
- "@storm-software/tsup": "^0.2.11",
127
- "@stryke/fs": "^0.32.3",
126
+ "@storm-software/tsup": "^0.2.17",
127
+ "@stryke/fs": "^0.32.10",
128
128
  "@stryke/json": "^0.9.3",
129
- "@stryke/path": "^0.17.0",
129
+ "@stryke/path": "^0.18.5",
130
130
  "@stryke/type-checks": "^0.3.10",
131
131
  "@stryke/types": "^0.10.0",
132
132
  "defu": "^6.1.4",
133
133
  "esbuild-plugin-babel": "^0.2.3",
134
134
  "jiti": "^2.6.1",
135
- "powerlines": "^0.14.1"
135
+ "powerlines": "^0.16.0"
136
136
  },
137
137
  "devDependencies": {
138
138
  "@alloy-js/rollup-plugin": "^0.1.0",
139
- "@powerlines/nx": "^0.9.5",
139
+ "@powerlines/nx": "^0.10.1",
140
140
  "@rollup/plugin-commonjs": "^28.0.9",
141
141
  "@rollup/plugin-node-resolve": "^16.0.3",
142
142
  "@types/babel__helper-plugin-utils": "^7.10.3",
143
- "@types/node": "^22.18.12",
144
- "esbuild": "^0.25.11",
143
+ "@types/node": "^22.19.0",
144
+ "esbuild": "^0.25.12",
145
145
  "rollup": "^4.52.5",
146
146
  "rollup-plugin-typescript2": "^0.36.0"
147
147
  },
148
148
  "publishConfig": { "access": "public" },
149
- "gitHead": "284d279fb9c466a627d4506600e0d16315ec96ac"
149
+ "gitHead": "097e9f257b733719a3aead815ef79686f4c46f25"
150
150
  }