@powerlines/plugin-plugin 0.12.53 → 0.12.54

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,10 +93,7 @@ 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
  };
package/dist/src/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import { __ΩPluginPluginOptions as ___PluginPluginOptions, __ΩPluginPluginContext as ___PluginPluginContext } from './types/plugin.js';
2
2
  export { __ΩPluginPluginAlloyOptions, __ΩPluginPluginResolvedConfig, __ΩPluginPluginTypesOptions, __ΩPluginPluginUserConfig } from './types/plugin.js';
3
- import alloyPlugin from '@alloy-js/rollup-plugin';
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
  };
@@ -3,7 +3,7 @@
3
3
  const __ΩPartial = ['T', 'Partial', 'l+e#!e"!fRb!Pde"!gN#"w"y'];
4
4
  const __ΩPluginPluginAlloyOptions = [() => __ΩPartial, 'PrintTreeOptions', 'generatesJson', true, 'generatesMarkdown', 'PluginPluginAlloyOptions', 'P"w"o!"P)4#8>$)4%8>$MKw&y'];
5
5
  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'];
6
+ const __ΩPluginPluginOptions = [() => __ΩPluginPluginTypesOptions, 'types', 'PluginPluginOptions', 'Pn!4"8Mw#y'];
7
7
  const __ΩPluginPluginUserConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginUserConfig', 'P!Pn!4"MKw#y'];
8
8
  const __ΩPluginPluginResolvedConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginResolvedConfig', 'P!Pn!4"MKw#y'];
9
9
  const __ΩPluginPluginContext = [() => __ΩPluginPluginResolvedConfig, 'TResolvedConfig', 'PluginPluginContext', 'n!c"!w#y'];
@@ -29,15 +29,6 @@ export interface PluginPluginTypesOptions {
29
29
  userConfig?: TypeDefinitionParameter;
30
30
  }
31
31
  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
32
  /**
42
33
  * The type definitions for the Plugin plugin.
43
34
  */
@@ -1,7 +1,7 @@
1
1
  const __ΩPartial = ['T', 'Partial', 'l+e#!e"!fRb!Pde"!gN#"w"y'];
2
2
  const __ΩPluginPluginAlloyOptions = [() => __ΩPartial, 'PrintTreeOptions', 'generatesJson', true, 'generatesMarkdown', 'PluginPluginAlloyOptions', 'P"w"o!"P)4#8>$)4%8>$MKw&y'];
3
3
  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'];
4
+ const __ΩPluginPluginOptions = [() => __ΩPluginPluginTypesOptions, 'types', 'PluginPluginOptions', 'Pn!4"8Mw#y'];
5
5
  const __ΩPluginPluginUserConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginUserConfig', 'P!Pn!4"MKw#y'];
6
6
  const __ΩPluginPluginResolvedConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginResolvedConfig', 'P!Pn!4"MKw#y'];
7
7
  const __ΩPluginPluginContext = [() => __ΩPluginPluginResolvedConfig, 'TResolvedConfig', 'PluginPluginContext', 'n!c"!w#y'];
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.54",
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.7"
137
137
  },
138
138
  "devDependencies": {
139
- "@powerlines/nx": "^0.11.32",
139
+ "@powerlines/nx": "^0.11.33",
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": "abbf694ae460ab6f58ae645a000cabf4a4fdac80"
149
149
  }