@powerlines/plugin-openapi 0.2.49 → 0.2.51

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.
@@ -9,11 +9,14 @@ import { TypeDefinitionParameter, TypeDefinition } from '@stryke/types/configura
9
9
  import { AssetGlob } from '@stryke/types/file';
10
10
  import { PreviewOptions, ResolvedPreviewOptions } from 'vite';
11
11
  import { EnvPaths } from '@stryke/env/get-env-paths';
12
+ import { FetchRequestOptions } from '@stryke/http/fetch';
12
13
  import { PackageJson } from '@stryke/types/package-json';
13
14
  import { Jiti } from 'jiti';
14
15
  import { SourceMap } from 'magic-string';
16
+ import { ParserOptions, ParseResult } from 'oxc-parser';
15
17
  import { Range } from 'semver';
16
18
  import { Project } from 'ts-morph';
19
+ import { RequestInfo, Response } from 'undici';
17
20
  import { UnpluginMessage, ExternalIdResult, UnpluginContext, UnpluginBuildContext, TransformResult as TransformResult$1, HookFilter, UnpluginOptions } from 'unplugin';
18
21
  import { ResolveOptions as ResolveOptions$1 } from '@stryke/fs/resolve';
19
22
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
@@ -619,6 +622,22 @@ type PluginConfigObject<TContext extends PluginContext = PluginContext, TOptions
619
622
  */
620
623
  type PluginConfig<TContext extends PluginContext = PluginContext> = string | PluginFactory<TContext, void> | Plugin<TContext> | Promise<Plugin<TContext>> | PluginConfigTuple<TContext> | PluginConfigObject<TContext>;
621
624
  type ProjectType = "application" | "library";
625
+ interface DeployConfig {
626
+ /**
627
+ * The deployment variant being used by the Powerlines engine.
628
+ *
629
+ * @example
630
+ * ```ts
631
+ * export default defineConfig({
632
+ * deploy: {
633
+ * variant: "cloudflare"
634
+ * }
635
+ * });
636
+ *
637
+ * ```
638
+ */
639
+ variant?: string;
640
+ }
622
641
  interface OutputConfig {
623
642
  /**
624
643
  * The path to output the final compiled files to
@@ -741,7 +760,7 @@ interface BaseConfig {
741
760
  * @remarks
742
761
  * If set to `false`, the deployment will be disabled.
743
762
  */
744
- deploy?: Record<string, any> | false;
763
+ deploy?: DeployConfig | false;
745
764
  /**
746
765
  * The path to the tsconfig file to be used by the compiler
747
766
  *
@@ -868,7 +887,7 @@ interface CommonUserConfig extends BaseConfig {
868
887
  */
869
888
  framework?: string;
870
889
  }
871
- type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = Omit<CommonUserConfig, "build"> & {
890
+ interface UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> extends Omit<CommonUserConfig, "build"> {
872
891
  /**
873
892
  * Configuration provided to build processes
874
893
  *
@@ -888,7 +907,7 @@ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedCo
888
907
  */
889
908
  override?: Partial<TBuildResolvedConfig>;
890
909
  };
891
- };
910
+ }
892
911
  type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
893
912
  /**
894
913
  * The configuration provided while executing Powerlines commands.
@@ -927,7 +946,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> &
927
946
  /**
928
947
  * The resolved options for the Powerlines project configuration.
929
948
  */
930
- type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework">> & {
949
+ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
931
950
  /**
932
951
  * The configuration options that were provided inline to the Powerlines CLI.
933
952
  */
@@ -1014,6 +1033,18 @@ interface InitContextOptions {
1014
1033
  */
1015
1034
  isHighPriority: boolean;
1016
1035
  }
1036
+ interface FetchOptions extends FetchRequestOptions {
1037
+ /**
1038
+ * An indicator specifying that the request should bypass any caching
1039
+ */
1040
+ skipCache?: boolean;
1041
+ }
1042
+ interface ParseOptions extends ParserOptions {
1043
+ /**
1044
+ * When true this allows return statements to be outside functions to e.g. support parsing CommonJS code.
1045
+ */
1046
+ allowReturnOutsideFunction?: boolean;
1047
+ }
1017
1048
  /**
1018
1049
  * The unresolved Powerlines context.
1019
1050
  *
@@ -1030,6 +1061,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1030
1061
  */
1031
1062
  config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
1032
1063
  projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
1064
+ sourceRoot: NonUndefined<TResolvedConfig["userConfig"]["sourceRoot"]>;
1033
1065
  output: TResolvedConfig["output"];
1034
1066
  };
1035
1067
  /**
@@ -1149,6 +1181,44 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1149
1181
  * This instance is created lazily on first access.
1150
1182
  */
1151
1183
  program: Project;
1184
+ /**
1185
+ * A function to perform HTTP fetch requests
1186
+ *
1187
+ * @remarks
1188
+ * This function uses a caching layer to avoid duplicate requests during the Powerlines process.
1189
+ *
1190
+ * @example
1191
+ * ```ts
1192
+ * const response = await context.fetch("https://api.example.com/data");
1193
+ * const data = await response.json();
1194
+ * ```
1195
+ *
1196
+ * @see https://github.com/nodejs/undici
1197
+ *
1198
+ * @param input - The URL to fetch.
1199
+ * @param options - The fetch request options.
1200
+ * @returns A promise that resolves to a response returned by the fetch.
1201
+ */
1202
+ fetch: (input: RequestInfo, options?: FetchOptions) => Promise<Response>;
1203
+ /**
1204
+ * Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
1205
+ *
1206
+ * @remarks
1207
+ * This function can be used to parse TypeScript code into an AST for further analysis or transformation.
1208
+ *
1209
+ * @example
1210
+ * ```ts
1211
+ * const ast = context.parse("const x: number = 42;");
1212
+ * ```
1213
+ *
1214
+ * @see https://rollupjs.org/plugin-development/#this-parse
1215
+ * @see https://github.com/oxc/oxc
1216
+ *
1217
+ * @param code - The source code to parse.
1218
+ * @param options - The options to pass to the parser.
1219
+ * @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
1220
+ */
1221
+ parse: (code: string, options?: ParseOptions) => Promise<ParseResult>;
1152
1222
  /**
1153
1223
  * A helper function to resolve modules using the Jiti resolver
1154
1224
  *
@@ -1165,7 +1235,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1165
1235
  * @param options - Additional resolution options.
1166
1236
  * @returns A promise that resolves to the resolved module path.
1167
1237
  */
1168
- resolveId: (id: string, importer?: string, options?: ResolveOptions) => Promise<ExternalIdResult | undefined>;
1238
+ resolve: (id: string, importer?: string, options?: ResolveOptions) => Promise<ExternalIdResult | undefined>;
1169
1239
  /**
1170
1240
  * A helper function to load modules using the Jiti resolver
1171
1241
  *
@@ -1248,7 +1318,7 @@ interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedCon
1248
1318
  */
1249
1319
  logger: LogFn;
1250
1320
  }
1251
- type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = PluginContext<TResolvedConfig> & Omit<UnpluginBuildContext, "parse">;
1321
+ type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = UnpluginBuildContext & PluginContext<TResolvedConfig>;
1252
1322
 
1253
1323
  declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
1254
1324
  type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
@@ -1496,9 +1566,9 @@ type OpenAPIPluginOptions = Omit<OpenAPITSOptions, "cwd"> & {
1496
1566
  * The path to the output file generated by the plugin.
1497
1567
  *
1498
1568
  * @remarks
1499
- * If using the default value, the file can be imported from "powerlines:openapi". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
1569
+ * If using the default value, the file can be imported from "powerlines:api". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
1500
1570
  *
1501
- * @defaultValue "\{builtinPath\}/openapi.ts"
1571
+ * @defaultValue "\{builtinPath\}/api.ts"
1502
1572
  */
1503
1573
  outputPath?: string;
1504
1574
  };
@@ -9,11 +9,14 @@ import { TypeDefinitionParameter, TypeDefinition } from '@stryke/types/configura
9
9
  import { AssetGlob } from '@stryke/types/file';
10
10
  import { PreviewOptions, ResolvedPreviewOptions } from 'vite';
11
11
  import { EnvPaths } from '@stryke/env/get-env-paths';
12
+ import { FetchRequestOptions } from '@stryke/http/fetch';
12
13
  import { PackageJson } from '@stryke/types/package-json';
13
14
  import { Jiti } from 'jiti';
14
15
  import { SourceMap } from 'magic-string';
16
+ import { ParserOptions, ParseResult } from 'oxc-parser';
15
17
  import { Range } from 'semver';
16
18
  import { Project } from 'ts-morph';
19
+ import { RequestInfo, Response } from 'undici';
17
20
  import { UnpluginMessage, ExternalIdResult, UnpluginContext, UnpluginBuildContext, TransformResult as TransformResult$1, HookFilter, UnpluginOptions } from 'unplugin';
18
21
  import { ResolveOptions as ResolveOptions$1 } from '@stryke/fs/resolve';
19
22
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
@@ -619,6 +622,22 @@ type PluginConfigObject<TContext extends PluginContext = PluginContext, TOptions
619
622
  */
620
623
  type PluginConfig<TContext extends PluginContext = PluginContext> = string | PluginFactory<TContext, void> | Plugin<TContext> | Promise<Plugin<TContext>> | PluginConfigTuple<TContext> | PluginConfigObject<TContext>;
621
624
  type ProjectType = "application" | "library";
625
+ interface DeployConfig {
626
+ /**
627
+ * The deployment variant being used by the Powerlines engine.
628
+ *
629
+ * @example
630
+ * ```ts
631
+ * export default defineConfig({
632
+ * deploy: {
633
+ * variant: "cloudflare"
634
+ * }
635
+ * });
636
+ *
637
+ * ```
638
+ */
639
+ variant?: string;
640
+ }
622
641
  interface OutputConfig {
623
642
  /**
624
643
  * The path to output the final compiled files to
@@ -741,7 +760,7 @@ interface BaseConfig {
741
760
  * @remarks
742
761
  * If set to `false`, the deployment will be disabled.
743
762
  */
744
- deploy?: Record<string, any> | false;
763
+ deploy?: DeployConfig | false;
745
764
  /**
746
765
  * The path to the tsconfig file to be used by the compiler
747
766
  *
@@ -868,7 +887,7 @@ interface CommonUserConfig extends BaseConfig {
868
887
  */
869
888
  framework?: string;
870
889
  }
871
- type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = Omit<CommonUserConfig, "build"> & {
890
+ interface UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> extends Omit<CommonUserConfig, "build"> {
872
891
  /**
873
892
  * Configuration provided to build processes
874
893
  *
@@ -888,7 +907,7 @@ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedCo
888
907
  */
889
908
  override?: Partial<TBuildResolvedConfig>;
890
909
  };
891
- };
910
+ }
892
911
  type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
893
912
  /**
894
913
  * The configuration provided while executing Powerlines commands.
@@ -927,7 +946,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> &
927
946
  /**
928
947
  * The resolved options for the Powerlines project configuration.
929
948
  */
930
- type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework">> & {
949
+ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
931
950
  /**
932
951
  * The configuration options that were provided inline to the Powerlines CLI.
933
952
  */
@@ -1014,6 +1033,18 @@ interface InitContextOptions {
1014
1033
  */
1015
1034
  isHighPriority: boolean;
1016
1035
  }
1036
+ interface FetchOptions extends FetchRequestOptions {
1037
+ /**
1038
+ * An indicator specifying that the request should bypass any caching
1039
+ */
1040
+ skipCache?: boolean;
1041
+ }
1042
+ interface ParseOptions extends ParserOptions {
1043
+ /**
1044
+ * When true this allows return statements to be outside functions to e.g. support parsing CommonJS code.
1045
+ */
1046
+ allowReturnOutsideFunction?: boolean;
1047
+ }
1017
1048
  /**
1018
1049
  * The unresolved Powerlines context.
1019
1050
  *
@@ -1030,6 +1061,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1030
1061
  */
1031
1062
  config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
1032
1063
  projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
1064
+ sourceRoot: NonUndefined<TResolvedConfig["userConfig"]["sourceRoot"]>;
1033
1065
  output: TResolvedConfig["output"];
1034
1066
  };
1035
1067
  /**
@@ -1149,6 +1181,44 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1149
1181
  * This instance is created lazily on first access.
1150
1182
  */
1151
1183
  program: Project;
1184
+ /**
1185
+ * A function to perform HTTP fetch requests
1186
+ *
1187
+ * @remarks
1188
+ * This function uses a caching layer to avoid duplicate requests during the Powerlines process.
1189
+ *
1190
+ * @example
1191
+ * ```ts
1192
+ * const response = await context.fetch("https://api.example.com/data");
1193
+ * const data = await response.json();
1194
+ * ```
1195
+ *
1196
+ * @see https://github.com/nodejs/undici
1197
+ *
1198
+ * @param input - The URL to fetch.
1199
+ * @param options - The fetch request options.
1200
+ * @returns A promise that resolves to a response returned by the fetch.
1201
+ */
1202
+ fetch: (input: RequestInfo, options?: FetchOptions) => Promise<Response>;
1203
+ /**
1204
+ * Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
1205
+ *
1206
+ * @remarks
1207
+ * This function can be used to parse TypeScript code into an AST for further analysis or transformation.
1208
+ *
1209
+ * @example
1210
+ * ```ts
1211
+ * const ast = context.parse("const x: number = 42;");
1212
+ * ```
1213
+ *
1214
+ * @see https://rollupjs.org/plugin-development/#this-parse
1215
+ * @see https://github.com/oxc/oxc
1216
+ *
1217
+ * @param code - The source code to parse.
1218
+ * @param options - The options to pass to the parser.
1219
+ * @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
1220
+ */
1221
+ parse: (code: string, options?: ParseOptions) => Promise<ParseResult>;
1152
1222
  /**
1153
1223
  * A helper function to resolve modules using the Jiti resolver
1154
1224
  *
@@ -1165,7 +1235,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1165
1235
  * @param options - Additional resolution options.
1166
1236
  * @returns A promise that resolves to the resolved module path.
1167
1237
  */
1168
- resolveId: (id: string, importer?: string, options?: ResolveOptions) => Promise<ExternalIdResult | undefined>;
1238
+ resolve: (id: string, importer?: string, options?: ResolveOptions) => Promise<ExternalIdResult | undefined>;
1169
1239
  /**
1170
1240
  * A helper function to load modules using the Jiti resolver
1171
1241
  *
@@ -1248,7 +1318,7 @@ interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedCon
1248
1318
  */
1249
1319
  logger: LogFn;
1250
1320
  }
1251
- type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = PluginContext<TResolvedConfig> & Omit<UnpluginBuildContext, "parse">;
1321
+ type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = UnpluginBuildContext & PluginContext<TResolvedConfig>;
1252
1322
 
1253
1323
  declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
1254
1324
  type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
@@ -1496,9 +1566,9 @@ type OpenAPIPluginOptions = Omit<OpenAPITSOptions, "cwd"> & {
1496
1566
  * The path to the output file generated by the plugin.
1497
1567
  *
1498
1568
  * @remarks
1499
- * If using the default value, the file can be imported from "powerlines:openapi". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
1569
+ * If using the default value, the file can be imported from "powerlines:api". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
1500
1570
  *
1501
- * @defaultValue "\{builtinPath\}/openapi.ts"
1571
+ * @defaultValue "\{builtinPath\}/api.ts"
1502
1572
  */
1503
1573
  outputPath?: string;
1504
1574
  };
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var joinPaths=require('@stryke/path/join-paths'),a=require('defu'),s=require('openapi-typescript'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var a__default=/*#__PURE__*/_interopDefault(a);var s__default=/*#__PURE__*/_interopDefault(s);/*****************************************
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var joinPaths=require('@stryke/path/join-paths'),a=require('defu'),s=require('openapi-typescript'),paths=require('powerlines/plugin-utils/paths'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var a__default=/*#__PURE__*/_interopDefault(a);var s__default=/*#__PURE__*/_interopDefault(s);/*****************************************
2
2
  *
3
3
  * ⚡ Built by Storm Software
4
4
  *
5
5
  *****************************************/
6
6
 
7
- var p=Object.defineProperty;var i=(t,o)=>p(t,"name",{value:o,configurable:true});const r=i((t={})=>({name:"openapi",config(){return {openapi:a__default.default(t,{schema:joinPaths.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"schema.yaml"),cwd:joinPaths.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot),silent:this.config.logLevel===null})}},async prepare(){const o=await s__default.default(this.config.openapi.schema,this.config.openapi);this.config.openapi.outputPath?await this.fs.write(this.config.openapi.outputPath,s.astToString(o,{fileName:this.config.openapi.outputPath})):await this.emitBuiltin(s.astToString(o),"openapi");}}),"plugin");var O=r;exports.default=O;exports.plugin=r;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
7
+ var p=Object.defineProperty;var n=(o,t)=>p(o,"name",{value:t,configurable:true});const u=n((o={})=>({name:"openapi",config(){return {openapi:a__default.default(o,{schema:joinPaths.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"schema.yaml"),cwd:joinPaths.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot),outputPath:joinPaths.joinPaths("{builtinPath}","api"),silent:this.config.logLevel===null})}},async configResolved(){this.config.openapi.outputPath=paths.replacePathTokens(this,this.config.openapi.outputPath);},async prepare(){const t=await s__default.default(this.config.openapi.schema,this.config.openapi);this.config.openapi.outputPath?await this.fs.write(this.config.openapi.outputPath,s.astToString(t,{fileName:this.config.openapi.outputPath})):await this.emitBuiltin(s.astToString(t),"openapi");}}),"plugin");var I=u;exports.default=I;exports.plugin=u;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, P as Plugin } from './index-DGAbh3Os.cjs';
2
- export { c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from './index-DGAbh3Os.cjs';
1
+ import { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, P as Plugin } from './index-CuW3WxDf.cjs';
2
+ export { c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from './index-CuW3WxDf.cjs';
3
3
  import 'node:buffer';
4
4
  import 'node:stream';
5
5
  import 'openapi-typescript';
@@ -11,11 +11,14 @@ import '@stryke/types/configuration';
11
11
  import '@stryke/types/file';
12
12
  import 'vite';
13
13
  import '@stryke/env/get-env-paths';
14
+ import '@stryke/http/fetch';
14
15
  import '@stryke/types/package-json';
15
16
  import 'jiti';
16
17
  import 'magic-string';
18
+ import 'oxc-parser';
17
19
  import 'semver';
18
20
  import 'ts-morph';
21
+ import 'undici';
19
22
  import 'unplugin';
20
23
  import '@stryke/fs/resolve';
21
24
  import '@stryke/types/tsconfig';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, P as Plugin } from './index-DGAbh3Os.js';
2
- export { c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from './index-DGAbh3Os.js';
1
+ import { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, P as Plugin } from './index-CuW3WxDf.js';
2
+ export { c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from './index-CuW3WxDf.js';
3
3
  import 'node:buffer';
4
4
  import 'node:stream';
5
5
  import 'openapi-typescript';
@@ -11,11 +11,14 @@ import '@stryke/types/configuration';
11
11
  import '@stryke/types/file';
12
12
  import 'vite';
13
13
  import '@stryke/env/get-env-paths';
14
+ import '@stryke/http/fetch';
14
15
  import '@stryke/types/package-json';
15
16
  import 'jiti';
16
17
  import 'magic-string';
18
+ import 'oxc-parser';
17
19
  import 'semver';
18
20
  import 'ts-morph';
21
+ import 'undici';
19
22
  import 'unplugin';
20
23
  import '@stryke/fs/resolve';
21
24
  import '@stryke/types/tsconfig';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import {joinPaths}from'@stryke/path/join-paths';import a from'defu';import s,{astToString}from'openapi-typescript';export*from'./types';/*****************************************
1
+ import {joinPaths}from'@stryke/path/join-paths';import a from'defu';import s,{astToString}from'openapi-typescript';import {replacePathTokens}from'powerlines/plugin-utils/paths';export*from'./types';/*****************************************
2
2
  *
3
3
  * ⚡ Built by Storm Software
4
4
  *
5
5
  *****************************************/
6
6
 
7
- var p=Object.defineProperty;var i=(t,o)=>p(t,"name",{value:o,configurable:true});const r=i((t={})=>({name:"openapi",config(){return {openapi:a(t,{schema:joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"schema.yaml"),cwd:joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot),silent:this.config.logLevel===null})}},async prepare(){const o=await s(this.config.openapi.schema,this.config.openapi);this.config.openapi.outputPath?await this.fs.write(this.config.openapi.outputPath,astToString(o,{fileName:this.config.openapi.outputPath})):await this.emitBuiltin(astToString(o),"openapi");}}),"plugin");var A=r;export{A as default,r as plugin};
7
+ var p=Object.defineProperty;var n=(o,t)=>p(o,"name",{value:t,configurable:true});const u=n((o={})=>({name:"openapi",config(){return {openapi:a(o,{schema:joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"schema.yaml"),cwd:joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot),outputPath:joinPaths("{builtinPath}","api"),silent:this.config.logLevel===null})}},async configResolved(){this.config.openapi.outputPath=replacePathTokens(this,this.config.openapi.outputPath);},async prepare(){const t=await s(this.config.openapi.schema,this.config.openapi);this.config.openapi.outputPath?await this.fs.write(this.config.openapi.outputPath,astToString(t,{fileName:this.config.openapi.outputPath})):await this.emitBuiltin(astToString(t),"openapi");}}),"plugin");var d=u;export{d as default,u as plugin};
@@ -1,4 +1,4 @@
1
- export { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from '../index-DGAbh3Os.cjs';
1
+ export { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from '../index-CuW3WxDf.cjs';
2
2
  import 'node:buffer';
3
3
  import 'node:stream';
4
4
  import 'openapi-typescript';
@@ -10,11 +10,14 @@ import '@stryke/types/configuration';
10
10
  import '@stryke/types/file';
11
11
  import 'vite';
12
12
  import '@stryke/env/get-env-paths';
13
+ import '@stryke/http/fetch';
13
14
  import '@stryke/types/package-json';
14
15
  import 'jiti';
15
16
  import 'magic-string';
17
+ import 'oxc-parser';
16
18
  import 'semver';
17
19
  import 'ts-morph';
20
+ import 'undici';
18
21
  import 'unplugin';
19
22
  import '@stryke/fs/resolve';
20
23
  import '@stryke/types/tsconfig';
@@ -1,4 +1,4 @@
1
- export { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from '../index-DGAbh3Os.js';
1
+ export { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from '../index-CuW3WxDf.js';
2
2
  import 'node:buffer';
3
3
  import 'node:stream';
4
4
  import 'openapi-typescript';
@@ -10,11 +10,14 @@ import '@stryke/types/configuration';
10
10
  import '@stryke/types/file';
11
11
  import 'vite';
12
12
  import '@stryke/env/get-env-paths';
13
+ import '@stryke/http/fetch';
13
14
  import '@stryke/types/package-json';
14
15
  import 'jiti';
15
16
  import 'magic-string';
17
+ import 'oxc-parser';
16
18
  import 'semver';
17
19
  import 'ts-morph';
20
+ import 'undici';
18
21
  import 'unplugin';
19
22
  import '@stryke/fs/resolve';
20
23
  import '@stryke/types/tsconfig';
@@ -1,7 +1,7 @@
1
1
  import 'node:buffer';
2
2
  import 'node:stream';
3
3
  import 'openapi-typescript';
4
- export { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from '../index-DGAbh3Os.cjs';
4
+ export { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from '../index-CuW3WxDf.cjs';
5
5
  import '@storm-software/build-tools/types';
6
6
  import '@storm-software/config-tools/types';
7
7
  import '@storm-software/config/types';
@@ -10,11 +10,14 @@ import '@stryke/types/configuration';
10
10
  import '@stryke/types/file';
11
11
  import 'vite';
12
12
  import '@stryke/env/get-env-paths';
13
+ import '@stryke/http/fetch';
13
14
  import '@stryke/types/package-json';
14
15
  import 'jiti';
15
16
  import 'magic-string';
17
+ import 'oxc-parser';
16
18
  import 'semver';
17
19
  import 'ts-morph';
20
+ import 'undici';
18
21
  import 'unplugin';
19
22
  import '@stryke/fs/resolve';
20
23
  import '@stryke/types/tsconfig';
@@ -1,7 +1,7 @@
1
1
  import 'node:buffer';
2
2
  import 'node:stream';
3
3
  import 'openapi-typescript';
4
- export { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from '../index-DGAbh3Os.js';
4
+ export { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from '../index-CuW3WxDf.js';
5
5
  import '@storm-software/build-tools/types';
6
6
  import '@storm-software/config-tools/types';
7
7
  import '@storm-software/config/types';
@@ -10,11 +10,14 @@ import '@stryke/types/configuration';
10
10
  import '@stryke/types/file';
11
11
  import 'vite';
12
12
  import '@stryke/env/get-env-paths';
13
+ import '@stryke/http/fetch';
13
14
  import '@stryke/types/package-json';
14
15
  import 'jiti';
15
16
  import 'magic-string';
17
+ import 'oxc-parser';
16
18
  import 'semver';
17
19
  import 'ts-morph';
20
+ import 'undici';
18
21
  import 'unplugin';
19
22
  import '@stryke/fs/resolve';
20
23
  import '@stryke/types/tsconfig';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-openapi",
3
- "version": "0.2.49",
3
+ "version": "0.2.51",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from OpenAPI specifications.",
6
6
  "repository": {
@@ -105,19 +105,19 @@
105
105
  "powerlines-plugin"
106
106
  ],
107
107
  "dependencies": {
108
- "@stryke/path": "^0.21.2",
109
- "@stryke/type-checks": "^0.3.18",
110
- "@stryke/types": "^0.10.8",
108
+ "@stryke/path": "^0.21.6",
109
+ "@stryke/type-checks": "^0.4.3",
110
+ "@stryke/types": "^0.10.12",
111
111
  "defu": "^6.1.4",
112
112
  "jiti": "^2.6.1",
113
113
  "openapi-typescript": "^7.10.1",
114
- "powerlines": "^0.26.2"
114
+ "powerlines": "^0.28.0"
115
115
  },
116
116
  "devDependencies": {
117
- "@powerlines/nx": "^0.10.45",
118
- "@powerlines/plugin-plugin": "^0.11.53",
117
+ "@powerlines/nx": "^0.10.47",
118
+ "@powerlines/plugin-plugin": "^0.11.55",
119
119
  "@types/node": "^24.10.1"
120
120
  },
121
121
  "publishConfig": { "access": "public" },
122
- "gitHead": "87cac88dc83f4a3a723ff41d7db6388f235b75c5"
122
+ "gitHead": "3feaa815e117c46d827eee84c3521e54670abb9b"
123
123
  }