@powerlines/plugin-openapi 0.2.23 → 0.2.25

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.
@@ -11,13 +11,11 @@ import { PreviewOptions, ResolvedPreviewOptions } from 'vite';
11
11
  import { EnvPaths } from '@stryke/env/get-env-paths';
12
12
  import { PackageJson } from '@stryke/types/package-json';
13
13
  import { Jiti } from 'jiti';
14
- import { ParserOptions, ParseResult } from 'oxc-parser';
15
14
  import { Range } from 'semver';
16
15
  import { UnpluginMessage, UnpluginContext, UnpluginBuildContext, TransformResult, ExternalIdResult, HookFilter, UnpluginOptions } from 'unplugin';
16
+ import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
17
17
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
18
18
  import ts from 'typescript';
19
- import { PrimitiveJsonValue } from '@stryke/json/types';
20
- import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
21
19
  import { ArrayValues } from '@stryke/types/array';
22
20
 
23
21
  type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
@@ -156,87 +154,20 @@ interface BuildConfig {
156
154
  }
157
155
  type BuildResolvedConfig = Omit<BuildConfig, "override">;
158
156
 
159
- type ReflectionMode = "default" | "explicit" | "never";
160
- type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
161
- /**
162
- * Defines the level of reflection to be used during the transpilation process.
163
- *
164
- * @remarks
165
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
166
- * - `minimal` - Only the essential type information is captured.
167
- * - `normal` - Additional type information is captured, including some contextual data.
168
- * - `verbose` - All available type information is captured, including detailed contextual data.
169
- */
170
- type ReflectionLevel = "minimal" | "normal" | "verbose";
171
- interface DeepkitOptions {
172
- /**
173
- * Either true to activate reflection for all files compiled using this tsconfig,
174
- * or a list of globs/file paths relative to this tsconfig.json.
175
- * Globs/file paths can be prefixed with a ! to exclude them.
176
- */
177
- reflection?: RawReflectionMode;
178
- /**
179
- * Defines the level of reflection to be used during the transpilation process.
180
- *
181
- * @remarks
182
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
183
- * - `minimal` - Only the essential type information is captured.
184
- * - `normal` - Additional type information is captured, including some contextual data.
185
- * - `verbose` - All available type information is captured, including detailed contextual data.
186
- */
187
- reflectionLevel?: ReflectionLevel;
188
- }
189
- type TSCompilerOptions = CompilerOptions & DeepkitOptions;
190
- /**
191
- * The TypeScript compiler configuration.
192
- *
193
- * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
194
- */
195
- interface TSConfig extends Omit<TsConfigJson, "reflection"> {
196
- /**
197
- * Either true to activate reflection for all files compiled using this tsconfig,
198
- * or a list of globs/file paths relative to this tsconfig.json.
199
- * Globs/file paths can be prefixed with a ! to exclude them.
200
- */
201
- reflection?: RawReflectionMode;
202
- /**
203
- * Defines the level of reflection to be used during the transpilation process.
204
- *
205
- * @remarks
206
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
207
- * - `minimal` - Only the essential type information is captured.
208
- * - `normal` - Additional type information is captured, including some contextual data.
209
- * - `verbose` - All available type information is captured, including detailed contextual data.
210
- */
211
- reflectionLevel?: ReflectionLevel;
212
- /**
213
- * Instructs the TypeScript compiler how to compile `.ts` files.
214
- */
215
- compilerOptions?: TSCompilerOptions;
216
- }
217
- type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
218
- originalTsconfigJson: TsConfigJson;
219
- tsconfigJson: TSConfig;
220
- tsconfigFilePath: string;
221
- };
222
-
223
157
  declare const __VFS_PATCH__ = "__VFS_PATCH__";
224
158
  declare const __VFS_REVERT__ = "__VFS_REVERT__";
225
159
  type OutputModeType = "fs" | "virtual";
226
- interface VirtualFile {
160
+ interface VirtualFileMetadata {
227
161
  /**
228
- * The unique identifier for the virtual file.
229
- *
230
- * @remarks
231
- * If no specific id is provided, it defaults to the file's {@link path}.
162
+ * The identifier for the file data.
232
163
  */
233
164
  id: string;
234
165
  /**
235
- * Additional metadata associated with the virtual file.
166
+ * The timestamp of the virtual file.
236
167
  */
237
- details: Record<string, PrimitiveJsonValue>;
168
+ timestamp: number;
238
169
  /**
239
- * The variant of the file.
170
+ * The type of the file.
240
171
  *
241
172
  * @remarks
242
173
  * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
@@ -244,52 +175,72 @@ interface VirtualFile {
244
175
  * - `entry`: Indicates that the file is an entry point for execution.
245
176
  * - `normal`: Indicates that the file is a standard file without any special role.
246
177
  */
247
- variant: string;
178
+ type: string;
248
179
  /**
249
180
  * The output mode of the file.
250
- *
251
- * @remarks
252
- * This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).
253
181
  */
254
- mode: OutputModeType;
255
- /**
256
- * A virtual (or actual) path to the file in the file system.
257
- */
258
- path: string;
182
+ mode: string;
259
183
  /**
260
- * The contents of the file.
184
+ * Additional metadata associated with the file.
261
185
  */
262
- code: string | NodeJS.ArrayBufferView;
186
+ properties: Record<string, string>;
263
187
  }
264
- interface VirtualFileMetadata {
188
+ interface VirtualFileData {
265
189
  /**
266
190
  * The identifier for the file data.
267
191
  */
268
- id: string;
192
+ id?: string;
269
193
  /**
270
- * The variant of the file.
194
+ * The contents of the virtual file.
195
+ */
196
+ code: string;
197
+ /**
198
+ * The type of the file.
199
+ *
200
+ * @remarks
201
+ * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
202
+ * - `builtin`: Indicates that the file is a built-in module provided by the system.
203
+ * - `entry`: Indicates that the file is an entry point for execution.
204
+ * - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
205
+ * - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
206
+ * - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
207
+ * - `normal`: Indicates that the file is a standard file without any special role.
271
208
  */
272
- variant: string;
209
+ type?: string;
273
210
  /**
274
211
  * The output mode of the file.
275
212
  */
276
- mode: string;
213
+ mode?: string;
277
214
  /**
278
215
  * Additional metadata associated with the file.
279
216
  */
280
- properties: Record<string, string>;
217
+ properties?: Record<string, string>;
218
+ }
219
+ interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
220
+ /**
221
+ * An additional name for the file.
222
+ */
223
+ path: string;
224
+ /**
225
+ * The timestamp of the virtual file.
226
+ */
227
+ timestamp: number;
281
228
  }
282
229
  interface ResolveFSOptions {
283
230
  mode?: OutputModeType;
284
231
  }
285
232
  type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
286
233
  interface PowerlinesWriteFileOptions extends ResolveFSOptions {
234
+ /**
235
+ * Should the file skip formatting before being written?
236
+ *
237
+ * @defaultValue false
238
+ */
287
239
  skipFormat?: boolean;
288
240
  }
289
241
  type NodeWriteFileOptions = WriteFileOptions$1;
290
242
  type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
291
- type PowerLinesWriteFileData = Partial<Omit<VirtualFile, "path" | "mode" | "code">> & Pick<VirtualFile, "code">;
292
- type WriteFileData = string | NodeJS.ArrayBufferView | PowerLinesWriteFileData;
243
+ type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
293
244
  interface ResolvePathOptions extends ResolveFSOptions {
294
245
  /**
295
246
  * Should the resolved path include the file extension?
@@ -304,7 +255,7 @@ interface ResolvePathOptions extends ResolveFSOptions {
304
255
  /**
305
256
  * The type of the path to resolve.
306
257
  */
307
- type?: "file" | "directory";
258
+ pathType?: "file" | "directory";
308
259
  }
309
260
  interface VirtualFileSystemInterface {
310
261
  /**
@@ -593,6 +544,70 @@ interface VirtualFileSystemInterface {
593
544
  dispose: () => Promise<void>;
594
545
  }
595
546
 
547
+ type ReflectionMode = "default" | "explicit" | "never";
548
+ type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
549
+ /**
550
+ * Defines the level of reflection to be used during the transpilation process.
551
+ *
552
+ * @remarks
553
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
554
+ * - `minimal` - Only the essential type information is captured.
555
+ * - `normal` - Additional type information is captured, including some contextual data.
556
+ * - `verbose` - All available type information is captured, including detailed contextual data.
557
+ */
558
+ type ReflectionLevel = "minimal" | "normal" | "verbose";
559
+ interface DeepkitOptions {
560
+ /**
561
+ * Either true to activate reflection for all files compiled using this tsconfig,
562
+ * or a list of globs/file paths relative to this tsconfig.json.
563
+ * Globs/file paths can be prefixed with a ! to exclude them.
564
+ */
565
+ reflection?: RawReflectionMode;
566
+ /**
567
+ * Defines the level of reflection to be used during the transpilation process.
568
+ *
569
+ * @remarks
570
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
571
+ * - `minimal` - Only the essential type information is captured.
572
+ * - `normal` - Additional type information is captured, including some contextual data.
573
+ * - `verbose` - All available type information is captured, including detailed contextual data.
574
+ */
575
+ reflectionLevel?: ReflectionLevel;
576
+ }
577
+ type TSCompilerOptions = CompilerOptions & DeepkitOptions;
578
+ /**
579
+ * The TypeScript compiler configuration.
580
+ *
581
+ * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
582
+ */
583
+ interface TSConfig extends Omit<TsConfigJson, "reflection"> {
584
+ /**
585
+ * Either true to activate reflection for all files compiled using this tsconfig,
586
+ * or a list of globs/file paths relative to this tsconfig.json.
587
+ * Globs/file paths can be prefixed with a ! to exclude them.
588
+ */
589
+ reflection?: RawReflectionMode;
590
+ /**
591
+ * Defines the level of reflection to be used during the transpilation process.
592
+ *
593
+ * @remarks
594
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
595
+ * - `minimal` - Only the essential type information is captured.
596
+ * - `normal` - Additional type information is captured, including some contextual data.
597
+ * - `verbose` - All available type information is captured, including detailed contextual data.
598
+ */
599
+ reflectionLevel?: ReflectionLevel;
600
+ /**
601
+ * Instructs the TypeScript compiler how to compile `.ts` files.
602
+ */
603
+ compilerOptions?: TSCompilerOptions;
604
+ }
605
+ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
606
+ originalTsconfigJson: TsConfigJson;
607
+ tsconfigJson: TSConfig;
608
+ tsconfigFilePath: string;
609
+ };
610
+
596
611
  type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
597
612
  /**
598
613
  * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
@@ -1140,7 +1155,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1140
1155
  * @param path - An optional path to write the builtin file to
1141
1156
  * @param options - Options for writing the file
1142
1157
  */
1143
- writeBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1158
+ emitBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1144
1159
  /**
1145
1160
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
1146
1161
  *
@@ -1148,11 +1163,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1148
1163
  * @param path - An optional path to write the entry file to
1149
1164
  * @param options - Options for writing the file
1150
1165
  */
1151
- writeEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1152
- /**
1153
- * Parses the source code and returns a {@link ParseResult} object.
1154
- */
1155
- parse: (code: string, id: string, options?: ParserOptions | null) => Promise<ParseResult>;
1166
+ emitEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1156
1167
  /**
1157
1168
  * A function to update the context fields using a new user configuration options
1158
1169
  */
@@ -1374,6 +1385,12 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
1374
1385
  resolveId: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
1375
1386
  isEntry: boolean;
1376
1387
  }) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
1388
+ /**
1389
+ * An API object that can be used for inter-plugin communication.
1390
+ *
1391
+ * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
1392
+ */
1393
+ api?: Record<string, any>;
1377
1394
  };
1378
1395
  type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = {
1379
1396
  [TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant>;
@@ -1450,5 +1467,9 @@ type OpenAPIPluginResolvedConfig = ResolvedConfig & {
1450
1467
  openapi: Omit<OpenAPIPluginOptions, "schema"> & Required<Pick<OpenAPIPluginOptions, "schema">> & Pick<OpenAPITSOptions, "cwd">;
1451
1468
  };
1452
1469
  type OpenAPIPluginContext<TResolvedConfig extends OpenAPIPluginResolvedConfig = OpenAPIPluginResolvedConfig> = PluginContext<TResolvedConfig>;
1470
+ declare type __ΩOpenAPIPluginOptions = any[];
1471
+ declare type __ΩOpenAPIPluginUserConfig = any[];
1472
+ declare type __ΩOpenAPIPluginResolvedConfig = any[];
1473
+ declare type __ΩOpenAPIPluginContext = any[];
1453
1474
 
1454
- export type { OpenAPIPluginContext as O, Plugin as P, OpenAPIPluginOptions as a, OpenAPIPluginUserConfig as b, OpenAPIPluginResolvedConfig as c };
1475
+ export type { OpenAPIPluginContext as O, Plugin as P, __ΩOpenAPIPluginOptions as _, OpenAPIPluginOptions as a, OpenAPIPluginUserConfig as b, OpenAPIPluginResolvedConfig as c, __ΩOpenAPIPluginUserConfig as d, __ΩOpenAPIPluginResolvedConfig as e, __ΩOpenAPIPluginContext as f };
@@ -11,13 +11,11 @@ import { PreviewOptions, ResolvedPreviewOptions } from 'vite';
11
11
  import { EnvPaths } from '@stryke/env/get-env-paths';
12
12
  import { PackageJson } from '@stryke/types/package-json';
13
13
  import { Jiti } from 'jiti';
14
- import { ParserOptions, ParseResult } from 'oxc-parser';
15
14
  import { Range } from 'semver';
16
15
  import { UnpluginMessage, UnpluginContext, UnpluginBuildContext, TransformResult, ExternalIdResult, HookFilter, UnpluginOptions } from 'unplugin';
16
+ import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
17
17
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
18
18
  import ts from 'typescript';
19
- import { PrimitiveJsonValue } from '@stryke/json/types';
20
- import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
21
19
  import { ArrayValues } from '@stryke/types/array';
22
20
 
23
21
  type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
@@ -156,87 +154,20 @@ interface BuildConfig {
156
154
  }
157
155
  type BuildResolvedConfig = Omit<BuildConfig, "override">;
158
156
 
159
- type ReflectionMode = "default" | "explicit" | "never";
160
- type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
161
- /**
162
- * Defines the level of reflection to be used during the transpilation process.
163
- *
164
- * @remarks
165
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
166
- * - `minimal` - Only the essential type information is captured.
167
- * - `normal` - Additional type information is captured, including some contextual data.
168
- * - `verbose` - All available type information is captured, including detailed contextual data.
169
- */
170
- type ReflectionLevel = "minimal" | "normal" | "verbose";
171
- interface DeepkitOptions {
172
- /**
173
- * Either true to activate reflection for all files compiled using this tsconfig,
174
- * or a list of globs/file paths relative to this tsconfig.json.
175
- * Globs/file paths can be prefixed with a ! to exclude them.
176
- */
177
- reflection?: RawReflectionMode;
178
- /**
179
- * Defines the level of reflection to be used during the transpilation process.
180
- *
181
- * @remarks
182
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
183
- * - `minimal` - Only the essential type information is captured.
184
- * - `normal` - Additional type information is captured, including some contextual data.
185
- * - `verbose` - All available type information is captured, including detailed contextual data.
186
- */
187
- reflectionLevel?: ReflectionLevel;
188
- }
189
- type TSCompilerOptions = CompilerOptions & DeepkitOptions;
190
- /**
191
- * The TypeScript compiler configuration.
192
- *
193
- * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
194
- */
195
- interface TSConfig extends Omit<TsConfigJson, "reflection"> {
196
- /**
197
- * Either true to activate reflection for all files compiled using this tsconfig,
198
- * or a list of globs/file paths relative to this tsconfig.json.
199
- * Globs/file paths can be prefixed with a ! to exclude them.
200
- */
201
- reflection?: RawReflectionMode;
202
- /**
203
- * Defines the level of reflection to be used during the transpilation process.
204
- *
205
- * @remarks
206
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
207
- * - `minimal` - Only the essential type information is captured.
208
- * - `normal` - Additional type information is captured, including some contextual data.
209
- * - `verbose` - All available type information is captured, including detailed contextual data.
210
- */
211
- reflectionLevel?: ReflectionLevel;
212
- /**
213
- * Instructs the TypeScript compiler how to compile `.ts` files.
214
- */
215
- compilerOptions?: TSCompilerOptions;
216
- }
217
- type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
218
- originalTsconfigJson: TsConfigJson;
219
- tsconfigJson: TSConfig;
220
- tsconfigFilePath: string;
221
- };
222
-
223
157
  declare const __VFS_PATCH__ = "__VFS_PATCH__";
224
158
  declare const __VFS_REVERT__ = "__VFS_REVERT__";
225
159
  type OutputModeType = "fs" | "virtual";
226
- interface VirtualFile {
160
+ interface VirtualFileMetadata {
227
161
  /**
228
- * The unique identifier for the virtual file.
229
- *
230
- * @remarks
231
- * If no specific id is provided, it defaults to the file's {@link path}.
162
+ * The identifier for the file data.
232
163
  */
233
164
  id: string;
234
165
  /**
235
- * Additional metadata associated with the virtual file.
166
+ * The timestamp of the virtual file.
236
167
  */
237
- details: Record<string, PrimitiveJsonValue>;
168
+ timestamp: number;
238
169
  /**
239
- * The variant of the file.
170
+ * The type of the file.
240
171
  *
241
172
  * @remarks
242
173
  * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
@@ -244,52 +175,72 @@ interface VirtualFile {
244
175
  * - `entry`: Indicates that the file is an entry point for execution.
245
176
  * - `normal`: Indicates that the file is a standard file without any special role.
246
177
  */
247
- variant: string;
178
+ type: string;
248
179
  /**
249
180
  * The output mode of the file.
250
- *
251
- * @remarks
252
- * This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).
253
181
  */
254
- mode: OutputModeType;
255
- /**
256
- * A virtual (or actual) path to the file in the file system.
257
- */
258
- path: string;
182
+ mode: string;
259
183
  /**
260
- * The contents of the file.
184
+ * Additional metadata associated with the file.
261
185
  */
262
- code: string | NodeJS.ArrayBufferView;
186
+ properties: Record<string, string>;
263
187
  }
264
- interface VirtualFileMetadata {
188
+ interface VirtualFileData {
265
189
  /**
266
190
  * The identifier for the file data.
267
191
  */
268
- id: string;
192
+ id?: string;
269
193
  /**
270
- * The variant of the file.
194
+ * The contents of the virtual file.
195
+ */
196
+ code: string;
197
+ /**
198
+ * The type of the file.
199
+ *
200
+ * @remarks
201
+ * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
202
+ * - `builtin`: Indicates that the file is a built-in module provided by the system.
203
+ * - `entry`: Indicates that the file is an entry point for execution.
204
+ * - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
205
+ * - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
206
+ * - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
207
+ * - `normal`: Indicates that the file is a standard file without any special role.
271
208
  */
272
- variant: string;
209
+ type?: string;
273
210
  /**
274
211
  * The output mode of the file.
275
212
  */
276
- mode: string;
213
+ mode?: string;
277
214
  /**
278
215
  * Additional metadata associated with the file.
279
216
  */
280
- properties: Record<string, string>;
217
+ properties?: Record<string, string>;
218
+ }
219
+ interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
220
+ /**
221
+ * An additional name for the file.
222
+ */
223
+ path: string;
224
+ /**
225
+ * The timestamp of the virtual file.
226
+ */
227
+ timestamp: number;
281
228
  }
282
229
  interface ResolveFSOptions {
283
230
  mode?: OutputModeType;
284
231
  }
285
232
  type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
286
233
  interface PowerlinesWriteFileOptions extends ResolveFSOptions {
234
+ /**
235
+ * Should the file skip formatting before being written?
236
+ *
237
+ * @defaultValue false
238
+ */
287
239
  skipFormat?: boolean;
288
240
  }
289
241
  type NodeWriteFileOptions = WriteFileOptions$1;
290
242
  type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
291
- type PowerLinesWriteFileData = Partial<Omit<VirtualFile, "path" | "mode" | "code">> & Pick<VirtualFile, "code">;
292
- type WriteFileData = string | NodeJS.ArrayBufferView | PowerLinesWriteFileData;
243
+ type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
293
244
  interface ResolvePathOptions extends ResolveFSOptions {
294
245
  /**
295
246
  * Should the resolved path include the file extension?
@@ -304,7 +255,7 @@ interface ResolvePathOptions extends ResolveFSOptions {
304
255
  /**
305
256
  * The type of the path to resolve.
306
257
  */
307
- type?: "file" | "directory";
258
+ pathType?: "file" | "directory";
308
259
  }
309
260
  interface VirtualFileSystemInterface {
310
261
  /**
@@ -593,6 +544,70 @@ interface VirtualFileSystemInterface {
593
544
  dispose: () => Promise<void>;
594
545
  }
595
546
 
547
+ type ReflectionMode = "default" | "explicit" | "never";
548
+ type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
549
+ /**
550
+ * Defines the level of reflection to be used during the transpilation process.
551
+ *
552
+ * @remarks
553
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
554
+ * - `minimal` - Only the essential type information is captured.
555
+ * - `normal` - Additional type information is captured, including some contextual data.
556
+ * - `verbose` - All available type information is captured, including detailed contextual data.
557
+ */
558
+ type ReflectionLevel = "minimal" | "normal" | "verbose";
559
+ interface DeepkitOptions {
560
+ /**
561
+ * Either true to activate reflection for all files compiled using this tsconfig,
562
+ * or a list of globs/file paths relative to this tsconfig.json.
563
+ * Globs/file paths can be prefixed with a ! to exclude them.
564
+ */
565
+ reflection?: RawReflectionMode;
566
+ /**
567
+ * Defines the level of reflection to be used during the transpilation process.
568
+ *
569
+ * @remarks
570
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
571
+ * - `minimal` - Only the essential type information is captured.
572
+ * - `normal` - Additional type information is captured, including some contextual data.
573
+ * - `verbose` - All available type information is captured, including detailed contextual data.
574
+ */
575
+ reflectionLevel?: ReflectionLevel;
576
+ }
577
+ type TSCompilerOptions = CompilerOptions & DeepkitOptions;
578
+ /**
579
+ * The TypeScript compiler configuration.
580
+ *
581
+ * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
582
+ */
583
+ interface TSConfig extends Omit<TsConfigJson, "reflection"> {
584
+ /**
585
+ * Either true to activate reflection for all files compiled using this tsconfig,
586
+ * or a list of globs/file paths relative to this tsconfig.json.
587
+ * Globs/file paths can be prefixed with a ! to exclude them.
588
+ */
589
+ reflection?: RawReflectionMode;
590
+ /**
591
+ * Defines the level of reflection to be used during the transpilation process.
592
+ *
593
+ * @remarks
594
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
595
+ * - `minimal` - Only the essential type information is captured.
596
+ * - `normal` - Additional type information is captured, including some contextual data.
597
+ * - `verbose` - All available type information is captured, including detailed contextual data.
598
+ */
599
+ reflectionLevel?: ReflectionLevel;
600
+ /**
601
+ * Instructs the TypeScript compiler how to compile `.ts` files.
602
+ */
603
+ compilerOptions?: TSCompilerOptions;
604
+ }
605
+ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
606
+ originalTsconfigJson: TsConfigJson;
607
+ tsconfigJson: TSConfig;
608
+ tsconfigFilePath: string;
609
+ };
610
+
596
611
  type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
597
612
  /**
598
613
  * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
@@ -1140,7 +1155,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1140
1155
  * @param path - An optional path to write the builtin file to
1141
1156
  * @param options - Options for writing the file
1142
1157
  */
1143
- writeBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1158
+ emitBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1144
1159
  /**
1145
1160
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
1146
1161
  *
@@ -1148,11 +1163,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1148
1163
  * @param path - An optional path to write the entry file to
1149
1164
  * @param options - Options for writing the file
1150
1165
  */
1151
- writeEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1152
- /**
1153
- * Parses the source code and returns a {@link ParseResult} object.
1154
- */
1155
- parse: (code: string, id: string, options?: ParserOptions | null) => Promise<ParseResult>;
1166
+ emitEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1156
1167
  /**
1157
1168
  * A function to update the context fields using a new user configuration options
1158
1169
  */
@@ -1374,6 +1385,12 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
1374
1385
  resolveId: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
1375
1386
  isEntry: boolean;
1376
1387
  }) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
1388
+ /**
1389
+ * An API object that can be used for inter-plugin communication.
1390
+ *
1391
+ * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
1392
+ */
1393
+ api?: Record<string, any>;
1377
1394
  };
1378
1395
  type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = {
1379
1396
  [TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant>;
@@ -1450,5 +1467,9 @@ type OpenAPIPluginResolvedConfig = ResolvedConfig & {
1450
1467
  openapi: Omit<OpenAPIPluginOptions, "schema"> & Required<Pick<OpenAPIPluginOptions, "schema">> & Pick<OpenAPITSOptions, "cwd">;
1451
1468
  };
1452
1469
  type OpenAPIPluginContext<TResolvedConfig extends OpenAPIPluginResolvedConfig = OpenAPIPluginResolvedConfig> = PluginContext<TResolvedConfig>;
1470
+ declare type __ΩOpenAPIPluginOptions = any[];
1471
+ declare type __ΩOpenAPIPluginUserConfig = any[];
1472
+ declare type __ΩOpenAPIPluginResolvedConfig = any[];
1473
+ declare type __ΩOpenAPIPluginContext = any[];
1453
1474
 
1454
- export type { OpenAPIPluginContext as O, Plugin as P, OpenAPIPluginOptions as a, OpenAPIPluginUserConfig as b, OpenAPIPluginResolvedConfig as c };
1475
+ export type { OpenAPIPluginContext as O, Plugin as P, __ΩOpenAPIPluginOptions as _, OpenAPIPluginOptions as a, OpenAPIPluginUserConfig as b, OpenAPIPluginResolvedConfig as c, __ΩOpenAPIPluginUserConfig as d, __ΩOpenAPIPluginResolvedConfig as e, __ΩOpenAPIPluginContext as f };
package/dist/index.cjs CHANGED
@@ -4,4 +4,4 @@
4
4
  *
5
5
  *****************************************/
6
6
 
7
- var p=Object.defineProperty;var t=(o,i)=>p(o,"name",{value:i,configurable:true});const r=t((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),silent:this.config.logLevel===null})}},async prepare(){const i=await s__default.default(this.config.openapi.schema,this.config.openapi);this.config.openapi.outputPath?await this.fs.writeFile(this.config.openapi.outputPath,s.astToString(i,{fileName:this.config.openapi.outputPath})):await this.writeBuiltin(s.astToString(i),"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 t=(o,i)=>p(o,"name",{value:i,configurable:true});const r=t((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),silent:this.config.logLevel===null})}},async prepare(){const i=await s__default.default(this.config.openapi.schema,this.config.openapi);this.config.openapi.outputPath?await this.fs.writeFile(this.config.openapi.outputPath,s.astToString(i,{fileName:this.config.openapi.outputPath})):await this.emitBuiltin(s.astToString(i),"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]}})});
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, P as Plugin } from './index-BxRdB_rW.cjs';
2
- export { c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig } from './index-BxRdB_rW.cjs';
1
+ import { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, P as Plugin } from './index-CoDOh5Um.cjs';
2
+ export { c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from './index-CoDOh5Um.cjs';
3
3
  import 'node:buffer';
4
4
  import 'node:stream';
5
5
  import 'openapi-typescript';
@@ -13,13 +13,11 @@ import 'vite';
13
13
  import '@stryke/env/get-env-paths';
14
14
  import '@stryke/types/package-json';
15
15
  import 'jiti';
16
- import 'oxc-parser';
17
16
  import 'semver';
18
17
  import 'unplugin';
18
+ import 'node:fs';
19
19
  import '@stryke/types/tsconfig';
20
20
  import 'typescript';
21
- import '@stryke/json/types';
22
- import 'node:fs';
23
21
  import '@stryke/types/array';
24
22
 
25
23
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, P as Plugin } from './index-BxRdB_rW.js';
2
- export { c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig } from './index-BxRdB_rW.js';
1
+ import { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, P as Plugin } from './index-CoDOh5Um.js';
2
+ export { c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig, f as __ΩOpenAPIPluginContext, _ as __ΩOpenAPIPluginOptions, e as __ΩOpenAPIPluginResolvedConfig, d as __ΩOpenAPIPluginUserConfig } from './index-CoDOh5Um.js';
3
3
  import 'node:buffer';
4
4
  import 'node:stream';
5
5
  import 'openapi-typescript';
@@ -13,13 +13,11 @@ import 'vite';
13
13
  import '@stryke/env/get-env-paths';
14
14
  import '@stryke/types/package-json';
15
15
  import 'jiti';
16
- import 'oxc-parser';
17
16
  import 'semver';
18
17
  import 'unplugin';
18
+ import 'node:fs';
19
19
  import '@stryke/types/tsconfig';
20
20
  import 'typescript';
21
- import '@stryke/json/types';
22
- import 'node:fs';
23
21
  import '@stryke/types/array';
24
22
 
25
23
  /**
package/dist/index.js CHANGED
@@ -4,4 +4,4 @@ import {joinPaths}from'@stryke/path/join-paths';import a from'defu';import s,{as
4
4
  *
5
5
  *****************************************/
6
6
 
7
- var p=Object.defineProperty;var t=(o,i)=>p(o,"name",{value:i,configurable:true});const r=t((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),silent:this.config.logLevel===null})}},async prepare(){const i=await s(this.config.openapi.schema,this.config.openapi);this.config.openapi.outputPath?await this.fs.writeFile(this.config.openapi.outputPath,astToString(i,{fileName:this.config.openapi.outputPath})):await this.writeBuiltin(astToString(i),"openapi");}}),"plugin");var A=r;export{A as default,r as plugin};
7
+ var p=Object.defineProperty;var t=(o,i)=>p(o,"name",{value:i,configurable:true});const r=t((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),silent:this.config.logLevel===null})}},async prepare(){const i=await s(this.config.openapi.schema,this.config.openapi);this.config.openapi.outputPath?await this.fs.writeFile(this.config.openapi.outputPath,astToString(i,{fileName:this.config.openapi.outputPath})):await this.emitBuiltin(astToString(i),"openapi");}}),"plugin");var A=r;export{A as default,r as plugin};
@@ -1,4 +1,4 @@
1
- export { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig } from '../index-BxRdB_rW.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-CoDOh5Um.cjs';
2
2
  import 'node:buffer';
3
3
  import 'node:stream';
4
4
  import 'openapi-typescript';
@@ -12,11 +12,9 @@ import 'vite';
12
12
  import '@stryke/env/get-env-paths';
13
13
  import '@stryke/types/package-json';
14
14
  import 'jiti';
15
- import 'oxc-parser';
16
15
  import 'semver';
17
16
  import 'unplugin';
17
+ import 'node:fs';
18
18
  import '@stryke/types/tsconfig';
19
19
  import 'typescript';
20
- import '@stryke/json/types';
21
- import 'node:fs';
22
20
  import '@stryke/types/array';
@@ -1,4 +1,4 @@
1
- export { O as OpenAPIPluginContext, a as OpenAPIPluginOptions, c as OpenAPIPluginResolvedConfig, b as OpenAPIPluginUserConfig } from '../index-BxRdB_rW.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-CoDOh5Um.js';
2
2
  import 'node:buffer';
3
3
  import 'node:stream';
4
4
  import 'openapi-typescript';
@@ -12,11 +12,9 @@ import 'vite';
12
12
  import '@stryke/env/get-env-paths';
13
13
  import '@stryke/types/package-json';
14
14
  import 'jiti';
15
- import 'oxc-parser';
16
15
  import 'semver';
17
16
  import 'unplugin';
17
+ import 'node:fs';
18
18
  import '@stryke/types/tsconfig';
19
19
  import 'typescript';
20
- import '@stryke/json/types';
21
- import 'node:fs';
22
20
  import '@stryke/types/array';
@@ -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 } from '../index-BxRdB_rW.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-CoDOh5Um.cjs';
5
5
  import '@storm-software/build-tools/types';
6
6
  import '@storm-software/config-tools/types';
7
7
  import '@storm-software/config/types';
@@ -12,11 +12,9 @@ import 'vite';
12
12
  import '@stryke/env/get-env-paths';
13
13
  import '@stryke/types/package-json';
14
14
  import 'jiti';
15
- import 'oxc-parser';
16
15
  import 'semver';
17
16
  import 'unplugin';
17
+ import 'node:fs';
18
18
  import '@stryke/types/tsconfig';
19
19
  import 'typescript';
20
- import '@stryke/json/types';
21
- import 'node:fs';
22
20
  import '@stryke/types/array';
@@ -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 } from '../index-BxRdB_rW.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-CoDOh5Um.js';
5
5
  import '@storm-software/build-tools/types';
6
6
  import '@storm-software/config-tools/types';
7
7
  import '@storm-software/config/types';
@@ -12,11 +12,9 @@ import 'vite';
12
12
  import '@stryke/env/get-env-paths';
13
13
  import '@stryke/types/package-json';
14
14
  import 'jiti';
15
- import 'oxc-parser';
16
15
  import 'semver';
17
16
  import 'unplugin';
17
+ import 'node:fs';
18
18
  import '@stryke/types/tsconfig';
19
19
  import 'typescript';
20
- import '@stryke/json/types';
21
- import 'node:fs';
22
20
  import '@stryke/types/array';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-openapi",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from OpenAPI specifications.",
6
6
  "repository": {
@@ -111,13 +111,13 @@
111
111
  "defu": "^6.1.4",
112
112
  "jiti": "^2.6.1",
113
113
  "openapi-typescript": "^7.10.1",
114
- "powerlines": "^0.23.2"
114
+ "powerlines": "^0.23.4"
115
115
  },
116
116
  "devDependencies": {
117
- "@powerlines/nx": "^0.10.19",
118
- "@powerlines/plugin-plugin": "^0.11.27",
119
- "@types/node": "^22.19.1"
117
+ "@powerlines/nx": "^0.10.21",
118
+ "@powerlines/plugin-plugin": "^0.11.29",
119
+ "@types/node": "^24.10.1"
120
120
  },
121
121
  "publishConfig": { "access": "public" },
122
- "gitHead": "628334bf5e96fa739c6a2b0a325f133ea928b530"
122
+ "gitHead": "3075c08893a66a4e8d359e37f8d0344b0a80322b"
123
123
  }