@powerlines/plugin-untyped 0.2.410 → 0.2.412

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/index.cjs CHANGED
@@ -1 +1,44 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require(`@storm-software/untyped/generate`),t=require(`@stryke/convert/to-array`),n=require(`powerlines/plugin-utils`);const r=(r={})=>({name:`untyped`,config(){return{untyped:{schema:`{root}/**/{untyped.ts,*.untyped.ts}`,...r}}},async configResolved(){if(!this.config.untyped.schema)throw Error(`Untyped plugin requires a schema path or glob pattern to be specified in the configuration.`);this.config.untyped.schema=(0,t.toArray)(this.config.untyped.schema).map(e=>(0,n.replacePathTokens)(this,e)),this.untyped=(0,e.getGenerateAction)({workspaceRoot:this.config.cwd??process.cwd(),skipCache:this.config.skipCache,directories:{cache:this.cachePath},logLevel:this.config.logLevel})},async prepare(){return this.untyped({entry:this.config.untyped.schema,outputPath:this.config.untyped.outputPath,generatedBy:this.config.framework})}});exports.default=r,exports.plugin=r;
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ let _storm_software_untyped_generate = require("@storm-software/untyped/generate");
3
+ let _stryke_convert_to_array = require("@stryke/convert/to-array");
4
+ let powerlines_plugin_utils = require("powerlines/plugin-utils");
5
+
6
+ //#region src/index.ts
7
+ /**
8
+ * A Powerlines plugin to use Untyped for code generation based on user-defined schemas.
9
+ *
10
+ * @param options - The plugin options.
11
+ * @returns A Powerlines plugin instance.
12
+ */
13
+ const plugin = (options = {}) => {
14
+ return {
15
+ name: "untyped",
16
+ config() {
17
+ return { untyped: {
18
+ schema: "{root}/**/{untyped.ts,*.untyped.ts}",
19
+ ...options
20
+ } };
21
+ },
22
+ async configResolved() {
23
+ if (!this.config.untyped.schema) throw new Error("Untyped plugin requires a schema path or glob pattern to be specified in the configuration.");
24
+ this.config.untyped.schema = (0, _stryke_convert_to_array.toArray)(this.config.untyped.schema).map((path) => (0, powerlines_plugin_utils.replacePathTokens)(this, path));
25
+ this.untyped = (0, _storm_software_untyped_generate.getGenerateAction)({
26
+ workspaceRoot: this.config.cwd ?? process.cwd(),
27
+ skipCache: this.config.skipCache,
28
+ directories: { cache: this.cachePath },
29
+ logLevel: this.config.logLevel
30
+ });
31
+ },
32
+ async prepare() {
33
+ return this.untyped({
34
+ entry: this.config.untyped.schema,
35
+ outputPath: this.config.untyped.outputPath,
36
+ generatedBy: this.config.framework
37
+ });
38
+ }
39
+ };
40
+ };
41
+
42
+ //#endregion
43
+ exports.default = plugin;
44
+ exports.plugin = plugin;
package/dist/index.mjs CHANGED
@@ -1,2 +1,43 @@
1
- import{getGenerateAction as e}from"@storm-software/untyped/generate";import{toArray as t}from"@stryke/convert/to-array";import{replacePathTokens as n}from"powerlines/plugin-utils";const r=(r={})=>({name:`untyped`,config(){return{untyped:{schema:`{root}/**/{untyped.ts,*.untyped.ts}`,...r}}},async configResolved(){if(!this.config.untyped.schema)throw Error(`Untyped plugin requires a schema path or glob pattern to be specified in the configuration.`);this.config.untyped.schema=t(this.config.untyped.schema).map(e=>n(this,e)),this.untyped=e({workspaceRoot:this.config.cwd??process.cwd(),skipCache:this.config.skipCache,directories:{cache:this.cachePath},logLevel:this.config.logLevel})},async prepare(){return this.untyped({entry:this.config.untyped.schema,outputPath:this.config.untyped.outputPath,generatedBy:this.config.framework})}});export{r as default,r as plugin};
1
+ import { getGenerateAction } from "@storm-software/untyped/generate";
2
+ import { toArray } from "@stryke/convert/to-array";
3
+ import { replacePathTokens } from "powerlines/plugin-utils";
4
+
5
+ //#region src/index.ts
6
+ /**
7
+ * A Powerlines plugin to use Untyped for code generation based on user-defined schemas.
8
+ *
9
+ * @param options - The plugin options.
10
+ * @returns A Powerlines plugin instance.
11
+ */
12
+ const plugin = (options = {}) => {
13
+ return {
14
+ name: "untyped",
15
+ config() {
16
+ return { untyped: {
17
+ schema: "{root}/**/{untyped.ts,*.untyped.ts}",
18
+ ...options
19
+ } };
20
+ },
21
+ async configResolved() {
22
+ if (!this.config.untyped.schema) throw new Error("Untyped plugin requires a schema path or glob pattern to be specified in the configuration.");
23
+ this.config.untyped.schema = toArray(this.config.untyped.schema).map((path) => replacePathTokens(this, path));
24
+ this.untyped = getGenerateAction({
25
+ workspaceRoot: this.config.cwd ?? process.cwd(),
26
+ skipCache: this.config.skipCache,
27
+ directories: { cache: this.cachePath },
28
+ logLevel: this.config.logLevel
29
+ });
30
+ },
31
+ async prepare() {
32
+ return this.untyped({
33
+ entry: this.config.untyped.schema,
34
+ outputPath: this.config.untyped.outputPath,
35
+ generatedBy: this.config.framework
36
+ });
37
+ }
38
+ };
39
+ };
40
+
41
+ //#endregion
42
+ export { plugin as default, plugin };
2
43
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { StormWorkspaceConfig } from \"@storm-software/config/types\";\nimport { getGenerateAction } from \"@storm-software/untyped/generate\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport type { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport { UntypedPluginContext, UntypedPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n untyped?: UntypedPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to use Untyped for code generation based on user-defined schemas.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends UntypedPluginContext = UntypedPluginContext\n>(\n options: UntypedPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"untyped\",\n config() {\n return {\n untyped: {\n schema: \"{root}/**/{untyped.ts,*.untyped.ts}\",\n ...options\n }\n };\n },\n async configResolved() {\n if (!this.config.untyped.schema) {\n throw new Error(\n \"Untyped plugin requires a schema path or glob pattern to be specified in the configuration.\"\n );\n }\n\n this.config.untyped.schema = toArray(this.config.untyped.schema).map(\n path => replacePathTokens(this, path)\n );\n\n this.untyped = getGenerateAction({\n workspaceRoot: this.config.cwd ?? process.cwd(),\n skipCache: this.config.skipCache,\n directories: {\n cache: this.cachePath\n },\n logLevel: this.config.logLevel\n } as StormWorkspaceConfig);\n },\n async prepare() {\n return this.untyped({\n entry: this.config.untyped.schema,\n outputPath: this.config.untyped.outputPath,\n generatedBy: this.config.framework\n });\n }\n };\n};\n\nexport default plugin;\n"],"mappings":"oLAuCA,MAAa,GAGX,EAAgC,EAAE,IAE3B,CACL,KAAM,UACN,QAAS,CACP,MAAO,CACL,QAAS,CACP,OAAQ,sCACR,GAAG,EACJ,CACF,EAEH,MAAM,gBAAiB,CACrB,GAAI,CAAC,KAAK,OAAO,QAAQ,OACvB,MAAU,MACR,8FACD,CAGH,KAAK,OAAO,QAAQ,OAAS,EAAQ,KAAK,OAAO,QAAQ,OAAO,CAAC,IAC/D,GAAQ,EAAkB,KAAM,EAAK,CACtC,CAED,KAAK,QAAU,EAAkB,CAC/B,cAAe,KAAK,OAAO,KAAO,QAAQ,KAAK,CAC/C,UAAW,KAAK,OAAO,UACvB,YAAa,CACX,MAAO,KAAK,UACb,CACD,SAAU,KAAK,OAAO,SACvB,CAAyB,EAE5B,MAAM,SAAU,CACd,OAAO,KAAK,QAAQ,CAClB,MAAO,KAAK,OAAO,QAAQ,OAC3B,WAAY,KAAK,OAAO,QAAQ,WAChC,YAAa,KAAK,OAAO,UAC1B,CAAC,EAEL"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { StormWorkspaceConfig } from \"@storm-software/config/types\";\nimport { getGenerateAction } from \"@storm-software/untyped/generate\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport type { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport { UntypedPluginContext, UntypedPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n untyped?: UntypedPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to use Untyped for code generation based on user-defined schemas.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends UntypedPluginContext = UntypedPluginContext\n>(\n options: UntypedPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"untyped\",\n config() {\n return {\n untyped: {\n schema: \"{root}/**/{untyped.ts,*.untyped.ts}\",\n ...options\n }\n };\n },\n async configResolved() {\n if (!this.config.untyped.schema) {\n throw new Error(\n \"Untyped plugin requires a schema path or glob pattern to be specified in the configuration.\"\n );\n }\n\n this.config.untyped.schema = toArray(this.config.untyped.schema).map(\n path => replacePathTokens(this, path)\n );\n\n this.untyped = getGenerateAction({\n workspaceRoot: this.config.cwd ?? process.cwd(),\n skipCache: this.config.skipCache,\n directories: {\n cache: this.cachePath\n },\n logLevel: this.config.logLevel\n } as StormWorkspaceConfig);\n },\n async prepare() {\n return this.untyped({\n entry: this.config.untyped.schema,\n outputPath: this.config.untyped.outputPath,\n generatedBy: this.config.framework\n });\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AAuCA,MAAa,UAGX,UAAgC,EAAE,KACb;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,SAAS;IACP,QAAQ;IACR,GAAG;IACJ,EACF;;EAEH,MAAM,iBAAiB;AACrB,OAAI,CAAC,KAAK,OAAO,QAAQ,OACvB,OAAM,IAAI,MACR,8FACD;AAGH,QAAK,OAAO,QAAQ,SAAS,QAAQ,KAAK,OAAO,QAAQ,OAAO,CAAC,KAC/D,SAAQ,kBAAkB,MAAM,KAAK,CACtC;AAED,QAAK,UAAU,kBAAkB;IAC/B,eAAe,KAAK,OAAO,OAAO,QAAQ,KAAK;IAC/C,WAAW,KAAK,OAAO;IACvB,aAAa,EACX,OAAO,KAAK,WACb;IACD,UAAU,KAAK,OAAO;IACvB,CAAyB;;EAE5B,MAAM,UAAU;AACd,UAAO,KAAK,QAAQ;IAClB,OAAO,KAAK,OAAO,QAAQ;IAC3B,YAAY,KAAK,OAAO,QAAQ;IAChC,aAAa,KAAK,OAAO;IAC1B,CAAC;;EAEL"}
@@ -1 +1 @@
1
- export{};
1
+ export { };
@@ -1 +1 @@
1
- export{};
1
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-untyped",
3
- "version": "0.2.410",
3
+ "version": "0.2.412",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to use Untyped for code generation based on user-defined schemas.",
6
6
  "repository": {
@@ -91,14 +91,14 @@
91
91
  "dependencies": {
92
92
  "@storm-software/untyped": "^0.24.143",
93
93
  "@stryke/convert": "^0.7.3",
94
- "powerlines": "^0.46.3"
94
+ "powerlines": "^0.46.5"
95
95
  },
96
96
  "devDependencies": {
97
- "@powerlines/plugin-plugin": "^0.12.407",
97
+ "@powerlines/plugin-plugin": "^0.12.409",
98
98
  "@storm-software/config": "^1.137.34",
99
99
  "@types/node": "^25.6.0"
100
100
  },
101
101
  "publishConfig": { "access": "public" },
102
102
  "types": "./dist/index.d.cts",
103
- "gitHead": "9a51041e0817e438c49db05bb757b3bdbaf497ef"
103
+ "gitHead": "9af888c54e58a82744cc334a6b80da52429fa0ac"
104
104
  }