@powerlines/plugin-plugin 0.12.53 → 0.12.55

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.
@@ -3,11 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var src_types_plugin = require('./types/plugin.cjs');
6
- var alloyPlugin = require('@alloy-js/rollup-plugin');
7
6
  var types = require('@storm-software/config-tools/types');
8
7
  var parseTypeDefinition = require('@stryke/convert/parse-type-definition');
9
8
  var toArray = require('@stryke/convert/to-array');
10
- var stormJson = require('@stryke/json/storm-json');
9
+ var join = require('@stryke/path/join');
11
10
  var titleCase = require('@stryke/string-format/title-case');
12
11
  var isSetString = require('@stryke/type-checks/is-set-string');
13
12
  var defu = require('defu');
@@ -35,28 +34,30 @@ const plugin = __assignType((options = {}) => {
35
34
  this.log(types.LogLevelLabel.TRACE, "Providing default configuration for the Powerlines plugin.");
36
35
  return {
37
36
  type: "library",
38
- entry: options.alloy ? ["src/index.tsx"] : ["src/index.ts"],
39
37
  output: {
40
38
  format: ["cjs", "esm"]
41
39
  },
42
40
  build: {
43
41
  variant: "tsdown",
44
42
  platform: "node",
43
+ nodeProtocol: true,
45
44
  unbundle: true,
46
45
  export: {
47
46
  all: true
48
47
  },
48
+ external: ["powerlines", "@powerlines/plugin-plugin"],
49
49
  skipNodeModulesBundle: true
50
50
  }
51
51
  };
52
52
  }, ['config', 'P"/!']),
53
53
  configResolved: __assignType(async function configResolved() {
54
- this.log(types.LogLevelLabel.TRACE, "The Powerlines plugin has resolved the final configuration.");
55
- if (options.alloy) {
56
- if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== "preserve") {
57
- this.tsconfig.tsconfigJson.compilerOptions.jsx = "preserve";
54
+ if (!this.config.entry ||
55
+ (Array.isArray(this.config.entry) && this.config.entry.length === 0)) {
56
+ let entry = "src/index.tsx";
57
+ if (!this.fs.existsSync(join.joinPaths(this.config.projectRoot, entry))) {
58
+ entry = "src/index.ts";
58
59
  }
59
- await this.fs.write(this.tsconfig.tsconfigFilePath, stormJson.StormJSON.stringify(this.tsconfig.tsconfigJson));
60
+ this.config.entry = entry;
60
61
  }
61
62
  }, ['configResolved', 'P"/!']),
62
63
  types: __assignType(async function types$1(code) {
@@ -92,16 +93,12 @@ declare module "powerlines" {
92
93
  async build() {
93
94
  await tsdown.build(defu.defu({
94
95
  config: false,
95
- plugins: [
96
- (createPlugin.Ω = [[() => src_types_plugin.__ΩPluginPluginContext, 'n!']], createPlugin(this)),
97
- options.alloy && alloyPlugin()
98
- ].filter(Boolean)
96
+ plugins: [(createPlugin.Ω = [[() => src_types_plugin.__ΩPluginPluginContext, 'n!']], createPlugin(this))]
99
97
  }, tsdown$1.extractTsdownConfig(this)));
100
98
  }
101
99
  };
102
100
  }, [() => src_types_plugin.__ΩPluginPluginOptions, 'options', () => ({}), '', 'Pn!2">#!/$']);
103
101
 
104
- exports.__ΩPluginPluginAlloyOptions = src_types_plugin.__ΩPluginPluginAlloyOptions;
105
102
  exports.__ΩPluginPluginContext = src_types_plugin.__ΩPluginPluginContext;
106
103
  exports.__ΩPluginPluginOptions = src_types_plugin.__ΩPluginPluginOptions;
107
104
  exports.__ΩPluginPluginResolvedConfig = src_types_plugin.__ΩPluginPluginResolvedConfig;
package/dist/src/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import { __ΩPluginPluginOptions as ___PluginPluginOptions, __ΩPluginPluginContext as ___PluginPluginContext } from './types/plugin.js';
2
- export { __ΩPluginPluginAlloyOptions, __ΩPluginPluginResolvedConfig, __ΩPluginPluginTypesOptions, __ΩPluginPluginUserConfig } from './types/plugin.js';
3
- import alloyPlugin from '@alloy-js/rollup-plugin';
2
+ export { __ΩPluginPluginResolvedConfig, __ΩPluginPluginTypesOptions, __ΩPluginPluginUserConfig } from './types/plugin.js';
4
3
  import { LogLevelLabel } from '@storm-software/config-tools/types';
5
4
  import { parseTypeDefinition } from '@stryke/convert/parse-type-definition';
6
5
  import { toArray } from '@stryke/convert/to-array';
7
- import { StormJSON } from '@stryke/json/storm-json';
6
+ import { joinPaths } from '@stryke/path/join';
8
7
  import { titleCase } from '@stryke/string-format/title-case';
9
8
  import { isSetString } from '@stryke/type-checks/is-set-string';
10
9
  import { defu } from 'defu';
@@ -32,28 +31,30 @@ const plugin = __assignType((options = {}) => {
32
31
  this.log(LogLevelLabel.TRACE, "Providing default configuration for the Powerlines plugin.");
33
32
  return {
34
33
  type: "library",
35
- entry: options.alloy ? ["src/index.tsx"] : ["src/index.ts"],
36
34
  output: {
37
35
  format: ["cjs", "esm"]
38
36
  },
39
37
  build: {
40
38
  variant: "tsdown",
41
39
  platform: "node",
40
+ nodeProtocol: true,
42
41
  unbundle: true,
43
42
  export: {
44
43
  all: true
45
44
  },
45
+ external: ["powerlines", "@powerlines/plugin-plugin"],
46
46
  skipNodeModulesBundle: true
47
47
  }
48
48
  };
49
49
  }, ['config', 'P"/!']),
50
50
  configResolved: __assignType(async function configResolved() {
51
- this.log(LogLevelLabel.TRACE, "The Powerlines plugin has resolved the final configuration.");
52
- if (options.alloy) {
53
- if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== "preserve") {
54
- this.tsconfig.tsconfigJson.compilerOptions.jsx = "preserve";
51
+ if (!this.config.entry ||
52
+ (Array.isArray(this.config.entry) && this.config.entry.length === 0)) {
53
+ let entry = "src/index.tsx";
54
+ if (!this.fs.existsSync(joinPaths(this.config.projectRoot, entry))) {
55
+ entry = "src/index.ts";
55
56
  }
56
- await this.fs.write(this.tsconfig.tsconfigFilePath, StormJSON.stringify(this.tsconfig.tsconfigJson));
57
+ this.config.entry = entry;
57
58
  }
58
59
  }, ['configResolved', 'P"/!']),
59
60
  types: __assignType(async function types(code) {
@@ -89,10 +90,7 @@ declare module "powerlines" {
89
90
  async build() {
90
91
  await build(defu({
91
92
  config: false,
92
- plugins: [
93
- (createPlugin.Ω = [[() => ___PluginPluginContext, 'n!']], createPlugin(this)),
94
- options.alloy && alloyPlugin()
95
- ].filter(Boolean)
93
+ plugins: [(createPlugin.Ω = [[() => ___PluginPluginContext, 'n!']], createPlugin(this))]
96
94
  }, extractTsdownConfig(this)));
97
95
  }
98
96
  };
@@ -4,7 +4,6 @@ var src_types_plugin = require('./plugin.cjs');
4
4
 
5
5
 
6
6
 
7
- exports.__ΩPluginPluginAlloyOptions = src_types_plugin.__ΩPluginPluginAlloyOptions;
8
7
  exports.__ΩPluginPluginContext = src_types_plugin.__ΩPluginPluginContext;
9
8
  exports.__ΩPluginPluginOptions = src_types_plugin.__ΩPluginPluginOptions;
10
9
  exports.__ΩPluginPluginResolvedConfig = src_types_plugin.__ΩPluginPluginResolvedConfig;
@@ -1 +1 @@
1
- export { __ΩPluginPluginAlloyOptions, __ΩPluginPluginContext, __ΩPluginPluginOptions, __ΩPluginPluginResolvedConfig, __ΩPluginPluginTypesOptions, __ΩPluginPluginUserConfig } from './plugin.js';
1
+ export { __ΩPluginPluginContext, __ΩPluginPluginOptions, __ΩPluginPluginResolvedConfig, __ΩPluginPluginTypesOptions, __ΩPluginPluginUserConfig } from './plugin.js';
@@ -1,14 +1,28 @@
1
1
  'use strict';
2
2
 
3
- const __ΩPartial = ['T', 'Partial', 'l+e#!e"!fRb!Pde"!gN#"w"y'];
4
- const __ΩPluginPluginAlloyOptions = [() => __ΩPartial, 'PrintTreeOptions', 'generatesJson', true, 'generatesMarkdown', 'PluginPluginAlloyOptions', 'P"w"o!"P)4#8>$)4%8>$MKw&y'];
3
+ /* -------------------------------------------------------------------
4
+
5
+ ⚡ Storm Software - Powerlines
6
+
7
+ This code was released as part of the Powerlines project. Powerlines
8
+ is maintained by Storm Software under the Apache-2.0 license, and is
9
+ free for commercial and private use. For more information, please visit
10
+ our licensing page at https://stormsoftware.com/licenses/projects/powerlines.
11
+
12
+ Website: https://stormsoftware.com
13
+ Repository: https://github.com/storm-software/powerlines
14
+ Documentation: https://docs.stormsoftware.com/projects/powerlines
15
+ Contact: https://stormsoftware.com/contact
16
+
17
+ SPDX-License-Identifier: Apache-2.0
18
+
19
+ ------------------------------------------------------------------- */
5
20
  const __ΩPluginPluginTypesOptions = ['options', 'userConfig', 'PluginPluginTypesOptions', 'P!4!8!4"8Mw#y'];
6
- const __ΩPluginPluginOptions = [() => __ΩPluginPluginAlloyOptions, 'alloy', false, () => __ΩPluginPluginTypesOptions, 'types', 'PluginPluginOptions', 'PPn!)J4"8>#n$4%8Mw&y'];
21
+ const __ΩPluginPluginOptions = [() => __ΩPluginPluginTypesOptions, 'types', 'PluginPluginOptions', 'Pn!4"8Mw#y'];
7
22
  const __ΩPluginPluginUserConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginUserConfig', 'P!Pn!4"MKw#y'];
8
23
  const __ΩPluginPluginResolvedConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginResolvedConfig', 'P!Pn!4"MKw#y'];
9
24
  const __ΩPluginPluginContext = [() => __ΩPluginPluginResolvedConfig, 'TResolvedConfig', 'PluginPluginContext', 'n!c"!w#y'];
10
25
 
11
- exports.__ΩPluginPluginAlloyOptions = __ΩPluginPluginAlloyOptions;
12
26
  exports.__ΩPluginPluginContext = __ΩPluginPluginContext;
13
27
  exports.__ΩPluginPluginOptions = __ΩPluginPluginOptions;
14
28
  exports.__ΩPluginPluginResolvedConfig = __ΩPluginPluginResolvedConfig;
@@ -1,23 +1,8 @@
1
- import type { PrintTreeOptions } from "@alloy-js/core";
2
1
  import { TypeDefinitionParameter } from "@stryke/types/configuration";
3
2
  import type { TsdownBuildConfig, TsdownResolvedBuildConfig } from "powerlines/types/build";
4
3
  import type { UserConfig } from "powerlines/types/config";
5
4
  import type { PluginContext } from "powerlines/types/context";
6
5
  import type { ResolvedConfig } from "powerlines/types/resolved";
7
- export type PluginPluginAlloyOptions = Partial<PrintTreeOptions> & {
8
- /**
9
- * If true, the Alloy framework is used to generate JSON output files.
10
- *
11
- * @defaultValue false
12
- */
13
- generatesJson?: boolean;
14
- /**
15
- * If true, the Alloy framework is used to generate Markdown output files.
16
- *
17
- * @defaultValue false
18
- */
19
- generatesMarkdown?: boolean;
20
- };
21
6
  export interface PluginPluginTypesOptions {
22
7
  /**
23
8
  * The type definition for the plugin's options.
@@ -29,15 +14,6 @@ export interface PluginPluginTypesOptions {
29
14
  userConfig?: TypeDefinitionParameter;
30
15
  }
31
16
  export interface PluginPluginOptions {
32
- /**
33
- * The options applied to the [Alloy framework](https://alloy-framework.github.io/alloy/) for rendering templates.
34
- *
35
- * @remarks
36
- * If set to `false`, the Alloy processing step will be skipped. If set to `true`, the Alloy processing step will be enabled with its default settings.
37
- *
38
- * @defaultValue false
39
- */
40
- alloy?: PluginPluginAlloyOptions | boolean;
41
17
  /**
42
18
  * The type definitions for the Plugin plugin.
43
19
  */
@@ -50,7 +26,6 @@ export type PluginPluginResolvedConfig = ResolvedConfig<PluginPluginUserConfig>
50
26
  plugin: PluginPluginOptions;
51
27
  };
52
28
  export type PluginPluginContext<TResolvedConfig extends PluginPluginResolvedConfig = PluginPluginResolvedConfig> = PluginContext<TResolvedConfig>;
53
- export declare type __ΩPluginPluginAlloyOptions = any[];
54
29
  export declare type __ΩPluginPluginTypesOptions = any[];
55
30
  export declare type __ΩPluginPluginOptions = any[];
56
31
  export declare type __ΩPluginPluginUserConfig = any[];
@@ -1,9 +1,24 @@
1
- const __ΩPartial = ['T', 'Partial', 'l+e#!e"!fRb!Pde"!gN#"w"y'];
2
- const __ΩPluginPluginAlloyOptions = [() => __ΩPartial, 'PrintTreeOptions', 'generatesJson', true, 'generatesMarkdown', 'PluginPluginAlloyOptions', 'P"w"o!"P)4#8>$)4%8>$MKw&y'];
1
+ /* -------------------------------------------------------------------
2
+
3
+ ⚡ Storm Software - Powerlines
4
+
5
+ This code was released as part of the Powerlines project. Powerlines
6
+ is maintained by Storm Software under the Apache-2.0 license, and is
7
+ free for commercial and private use. For more information, please visit
8
+ our licensing page at https://stormsoftware.com/licenses/projects/powerlines.
9
+
10
+ Website: https://stormsoftware.com
11
+ Repository: https://github.com/storm-software/powerlines
12
+ Documentation: https://docs.stormsoftware.com/projects/powerlines
13
+ Contact: https://stormsoftware.com/contact
14
+
15
+ SPDX-License-Identifier: Apache-2.0
16
+
17
+ ------------------------------------------------------------------- */
3
18
  const __ΩPluginPluginTypesOptions = ['options', 'userConfig', 'PluginPluginTypesOptions', 'P!4!8!4"8Mw#y'];
4
- const __ΩPluginPluginOptions = [() => __ΩPluginPluginAlloyOptions, 'alloy', false, () => __ΩPluginPluginTypesOptions, 'types', 'PluginPluginOptions', 'PPn!)J4"8>#n$4%8Mw&y'];
19
+ const __ΩPluginPluginOptions = [() => __ΩPluginPluginTypesOptions, 'types', 'PluginPluginOptions', 'Pn!4"8Mw#y'];
5
20
  const __ΩPluginPluginUserConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginUserConfig', 'P!Pn!4"MKw#y'];
6
21
  const __ΩPluginPluginResolvedConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginResolvedConfig', 'P!Pn!4"MKw#y'];
7
22
  const __ΩPluginPluginContext = [() => __ΩPluginPluginResolvedConfig, 'TResolvedConfig', 'PluginPluginContext', 'n!c"!w#y'];
8
23
 
9
- export { __ΩPluginPluginAlloyOptions, __ΩPluginPluginContext, __ΩPluginPluginOptions, __ΩPluginPluginResolvedConfig, __ΩPluginPluginTypesOptions, __ΩPluginPluginUserConfig };
24
+ export { __ΩPluginPluginContext, __ΩPluginPluginOptions, __ΩPluginPluginResolvedConfig, __ΩPluginPluginTypesOptions, __ΩPluginPluginUserConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-plugin",
3
- "version": "0.12.53",
3
+ "version": "0.12.55",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -133,10 +133,10 @@
133
133
  "@stryke/convert": "^0.6.29",
134
134
  "defu": "^6.1.4",
135
135
  "jiti": "^2.6.1",
136
- "powerlines": "^0.36.6"
136
+ "powerlines": "^0.36.8"
137
137
  },
138
138
  "devDependencies": {
139
- "@powerlines/nx": "^0.11.32",
139
+ "@powerlines/nx": "^0.11.34",
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",
@@ -145,5 +145,5 @@
145
145
  "rollup-plugin-typescript2": "^0.36.0"
146
146
  },
147
147
  "publishConfig": { "access": "public" },
148
- "gitHead": "2175eec0f5ee1cd6cefd06526262dcdac0ddab09"
148
+ "gitHead": "8867c7bf5d0505b507b029ae191bfc2844478c0e"
149
149
  }