@powerlines/plugin-rollup 0.7.28 → 0.7.30

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.
@@ -1,12 +1,11 @@
1
1
  export { createRollupPlugin } from './unplugin.cjs';
2
2
  import 'esbuild';
3
- import '../index-BJeSdSxa.cjs';
3
+ import '../index-DkJ_BIY7.cjs';
4
4
  import 'rollup';
5
5
  import '@stryke/env/get-env-paths';
6
6
  import '@stryke/types/base';
7
7
  import '@stryke/types/package-json';
8
8
  import 'jiti';
9
- import 'oxc-parser';
10
9
  import 'semver';
11
10
  import 'unplugin';
12
11
  import '@storm-software/build-tools/types';
@@ -15,8 +14,7 @@ import '@storm-software/config/types';
15
14
  import '@stryke/types/configuration';
16
15
  import '@stryke/types/file';
17
16
  import 'vite';
17
+ import 'node:fs';
18
18
  import '@stryke/types/array';
19
19
  import '@stryke/types/tsconfig';
20
20
  import 'typescript';
21
- import '@stryke/json/types';
22
- import 'node:fs';
@@ -1,12 +1,11 @@
1
1
  export { createRollupPlugin } from './unplugin.js';
2
2
  import 'esbuild';
3
- import '../index-BJeSdSxa.js';
3
+ import '../index-DkJ_BIY7.js';
4
4
  import 'rollup';
5
5
  import '@stryke/env/get-env-paths';
6
6
  import '@stryke/types/base';
7
7
  import '@stryke/types/package-json';
8
8
  import 'jiti';
9
- import 'oxc-parser';
10
9
  import 'semver';
11
10
  import 'unplugin';
12
11
  import '@storm-software/build-tools/types';
@@ -15,8 +14,7 @@ import '@storm-software/config/types';
15
14
  import '@stryke/types/configuration';
16
15
  import '@stryke/types/file';
17
16
  import 'vite';
17
+ import 'node:fs';
18
18
  import '@stryke/types/array';
19
19
  import '@stryke/types/tsconfig';
20
20
  import 'typescript';
21
- import '@stryke/json/types';
22
- import 'node:fs';
@@ -1,11 +1,10 @@
1
1
  import * as esbuild from 'esbuild';
2
- import { R as RollupPluginContext } from '../index-BJeSdSxa.cjs';
2
+ import { R as RollupPluginContext } from '../index-DkJ_BIY7.cjs';
3
3
  import 'rollup';
4
4
  import '@stryke/env/get-env-paths';
5
5
  import '@stryke/types/base';
6
6
  import '@stryke/types/package-json';
7
7
  import 'jiti';
8
- import 'oxc-parser';
9
8
  import 'semver';
10
9
  import 'unplugin';
11
10
  import '@storm-software/build-tools/types';
@@ -14,11 +13,10 @@ import '@storm-software/config/types';
14
13
  import '@stryke/types/configuration';
15
14
  import '@stryke/types/file';
16
15
  import 'vite';
16
+ import 'node:fs';
17
17
  import '@stryke/types/array';
18
18
  import '@stryke/types/tsconfig';
19
19
  import 'typescript';
20
- import '@stryke/json/types';
21
- import 'node:fs';
22
20
 
23
21
  declare function createRollupPlugin(context: RollupPluginContext): esbuild.Plugin;
24
22
 
@@ -1,11 +1,10 @@
1
1
  import * as esbuild from 'esbuild';
2
- import { R as RollupPluginContext } from '../index-BJeSdSxa.js';
2
+ import { R as RollupPluginContext } from '../index-DkJ_BIY7.js';
3
3
  import 'rollup';
4
4
  import '@stryke/env/get-env-paths';
5
5
  import '@stryke/types/base';
6
6
  import '@stryke/types/package-json';
7
7
  import 'jiti';
8
- import 'oxc-parser';
9
8
  import 'semver';
10
9
  import 'unplugin';
11
10
  import '@storm-software/build-tools/types';
@@ -14,11 +13,10 @@ import '@storm-software/config/types';
14
13
  import '@stryke/types/configuration';
15
14
  import '@stryke/types/file';
16
15
  import 'vite';
16
+ import 'node:fs';
17
17
  import '@stryke/types/array';
18
18
  import '@stryke/types/tsconfig';
19
19
  import 'typescript';
20
- import '@stryke/json/types';
21
- import 'node:fs';
22
20
 
23
21
  declare function createRollupPlugin(context: RollupPluginContext): esbuild.Plugin;
24
22
 
@@ -3,7 +3,6 @@ import { EnvPaths } from '@stryke/env/get-env-paths';
3
3
  import { MaybePromise, NonUndefined, FunctionLike } from '@stryke/types/base';
4
4
  import { PackageJson } from '@stryke/types/package-json';
5
5
  import { Jiti } from 'jiti';
6
- import { ParserOptions, ParseResult } from 'oxc-parser';
7
6
  import { Range } from 'semver';
8
7
  import { UnpluginMessage, UnpluginContext, UnpluginBuildContext, TransformResult, ExternalIdResult, HookFilter, UnpluginOptions } from 'unplugin';
9
8
  import { Format } from '@storm-software/build-tools/types';
@@ -12,11 +11,10 @@ import { StormWorkspaceConfig } from '@storm-software/config/types';
12
11
  import { TypeDefinitionParameter, TypeDefinition } from '@stryke/types/configuration';
13
12
  import { AssetGlob } from '@stryke/types/file';
14
13
  import { PreviewOptions, ResolvedPreviewOptions } from 'vite';
14
+ import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
15
15
  import { ArrayValues } from '@stryke/types/array';
16
16
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
17
17
  import ts from 'typescript';
18
- import { PrimitiveJsonValue } from '@stryke/json/types';
19
- import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
20
18
 
21
19
  type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
22
20
  interface BuildConfig {
@@ -159,87 +157,20 @@ type RollupBuildConfig = Omit<RollupOptions, "entry" | "external" | "input" | "o
159
157
  } & BuildConfig;
160
158
  type RollupResolvedBuildConfig = RollupOptions & BuildResolvedConfig;
161
159
 
162
- type ReflectionMode = "default" | "explicit" | "never";
163
- type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
164
- /**
165
- * Defines the level of reflection to be used during the transpilation process.
166
- *
167
- * @remarks
168
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
169
- * - `minimal` - Only the essential type information is captured.
170
- * - `normal` - Additional type information is captured, including some contextual data.
171
- * - `verbose` - All available type information is captured, including detailed contextual data.
172
- */
173
- type ReflectionLevel = "minimal" | "normal" | "verbose";
174
- interface DeepkitOptions {
175
- /**
176
- * Either true to activate reflection for all files compiled using this tsconfig,
177
- * or a list of globs/file paths relative to this tsconfig.json.
178
- * Globs/file paths can be prefixed with a ! to exclude them.
179
- */
180
- reflection?: RawReflectionMode;
181
- /**
182
- * Defines the level of reflection to be used during the transpilation process.
183
- *
184
- * @remarks
185
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
186
- * - `minimal` - Only the essential type information is captured.
187
- * - `normal` - Additional type information is captured, including some contextual data.
188
- * - `verbose` - All available type information is captured, including detailed contextual data.
189
- */
190
- reflectionLevel?: ReflectionLevel;
191
- }
192
- type TSCompilerOptions = CompilerOptions & DeepkitOptions;
193
- /**
194
- * The TypeScript compiler configuration.
195
- *
196
- * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
197
- */
198
- interface TSConfig extends Omit<TsConfigJson, "reflection"> {
199
- /**
200
- * Either true to activate reflection for all files compiled using this tsconfig,
201
- * or a list of globs/file paths relative to this tsconfig.json.
202
- * Globs/file paths can be prefixed with a ! to exclude them.
203
- */
204
- reflection?: RawReflectionMode;
205
- /**
206
- * Defines the level of reflection to be used during the transpilation process.
207
- *
208
- * @remarks
209
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
210
- * - `minimal` - Only the essential type information is captured.
211
- * - `normal` - Additional type information is captured, including some contextual data.
212
- * - `verbose` - All available type information is captured, including detailed contextual data.
213
- */
214
- reflectionLevel?: ReflectionLevel;
215
- /**
216
- * Instructs the TypeScript compiler how to compile `.ts` files.
217
- */
218
- compilerOptions?: TSCompilerOptions;
219
- }
220
- type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
221
- originalTsconfigJson: TsConfigJson;
222
- tsconfigJson: TSConfig;
223
- tsconfigFilePath: string;
224
- };
225
-
226
160
  declare const __VFS_PATCH__ = "__VFS_PATCH__";
227
161
  declare const __VFS_REVERT__ = "__VFS_REVERT__";
228
162
  type OutputModeType = "fs" | "virtual";
229
- interface VirtualFile {
163
+ interface VirtualFileMetadata {
230
164
  /**
231
- * The unique identifier for the virtual file.
232
- *
233
- * @remarks
234
- * If no specific id is provided, it defaults to the file's {@link path}.
165
+ * The identifier for the file data.
235
166
  */
236
167
  id: string;
237
168
  /**
238
- * Additional metadata associated with the virtual file.
169
+ * The timestamp of the virtual file.
239
170
  */
240
- details: Record<string, PrimitiveJsonValue>;
171
+ timestamp: number;
241
172
  /**
242
- * The variant of the file.
173
+ * The type of the file.
243
174
  *
244
175
  * @remarks
245
176
  * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
@@ -247,52 +178,72 @@ interface VirtualFile {
247
178
  * - `entry`: Indicates that the file is an entry point for execution.
248
179
  * - `normal`: Indicates that the file is a standard file without any special role.
249
180
  */
250
- variant: string;
181
+ type: string;
251
182
  /**
252
183
  * The output mode of the file.
253
- *
254
- * @remarks
255
- * This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).
256
184
  */
257
- mode: OutputModeType;
258
- /**
259
- * A virtual (or actual) path to the file in the file system.
260
- */
261
- path: string;
185
+ mode: string;
262
186
  /**
263
- * The contents of the file.
187
+ * Additional metadata associated with the file.
264
188
  */
265
- code: string | NodeJS.ArrayBufferView;
189
+ properties: Record<string, string>;
266
190
  }
267
- interface VirtualFileMetadata {
191
+ interface VirtualFileData {
268
192
  /**
269
193
  * The identifier for the file data.
270
194
  */
271
- id: string;
195
+ id?: string;
272
196
  /**
273
- * The variant of the file.
197
+ * The contents of the virtual file.
198
+ */
199
+ code: string;
200
+ /**
201
+ * The type of the file.
202
+ *
203
+ * @remarks
204
+ * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
205
+ * - `builtin`: Indicates that the file is a built-in module provided by the system.
206
+ * - `entry`: Indicates that the file is an entry point for execution.
207
+ * - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
208
+ * - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
209
+ * - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
210
+ * - `normal`: Indicates that the file is a standard file without any special role.
274
211
  */
275
- variant: string;
212
+ type?: string;
276
213
  /**
277
214
  * The output mode of the file.
278
215
  */
279
- mode: string;
216
+ mode?: string;
280
217
  /**
281
218
  * Additional metadata associated with the file.
282
219
  */
283
- properties: Record<string, string>;
220
+ properties?: Record<string, string>;
221
+ }
222
+ interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
223
+ /**
224
+ * An additional name for the file.
225
+ */
226
+ path: string;
227
+ /**
228
+ * The timestamp of the virtual file.
229
+ */
230
+ timestamp: number;
284
231
  }
285
232
  interface ResolveFSOptions {
286
233
  mode?: OutputModeType;
287
234
  }
288
235
  type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
289
236
  interface PowerlinesWriteFileOptions extends ResolveFSOptions {
237
+ /**
238
+ * Should the file skip formatting before being written?
239
+ *
240
+ * @defaultValue false
241
+ */
290
242
  skipFormat?: boolean;
291
243
  }
292
244
  type NodeWriteFileOptions = WriteFileOptions$1;
293
245
  type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
294
- type PowerLinesWriteFileData = Partial<Omit<VirtualFile, "path" | "mode" | "code">> & Pick<VirtualFile, "code">;
295
- type WriteFileData = string | NodeJS.ArrayBufferView | PowerLinesWriteFileData;
246
+ type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
296
247
  interface ResolvePathOptions extends ResolveFSOptions {
297
248
  /**
298
249
  * Should the resolved path include the file extension?
@@ -307,7 +258,7 @@ interface ResolvePathOptions extends ResolveFSOptions {
307
258
  /**
308
259
  * The type of the path to resolve.
309
260
  */
310
- type?: "file" | "directory";
261
+ pathType?: "file" | "directory";
311
262
  }
312
263
  interface VirtualFileSystemInterface {
313
264
  /**
@@ -596,6 +547,70 @@ interface VirtualFileSystemInterface {
596
547
  dispose: () => Promise<void>;
597
548
  }
598
549
 
550
+ type ReflectionMode = "default" | "explicit" | "never";
551
+ type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
552
+ /**
553
+ * Defines the level of reflection to be used during the transpilation process.
554
+ *
555
+ * @remarks
556
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
557
+ * - `minimal` - Only the essential type information is captured.
558
+ * - `normal` - Additional type information is captured, including some contextual data.
559
+ * - `verbose` - All available type information is captured, including detailed contextual data.
560
+ */
561
+ type ReflectionLevel = "minimal" | "normal" | "verbose";
562
+ interface DeepkitOptions {
563
+ /**
564
+ * Either true to activate reflection for all files compiled using this tsconfig,
565
+ * or a list of globs/file paths relative to this tsconfig.json.
566
+ * Globs/file paths can be prefixed with a ! to exclude them.
567
+ */
568
+ reflection?: RawReflectionMode;
569
+ /**
570
+ * Defines the level of reflection to be used during the transpilation process.
571
+ *
572
+ * @remarks
573
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
574
+ * - `minimal` - Only the essential type information is captured.
575
+ * - `normal` - Additional type information is captured, including some contextual data.
576
+ * - `verbose` - All available type information is captured, including detailed contextual data.
577
+ */
578
+ reflectionLevel?: ReflectionLevel;
579
+ }
580
+ type TSCompilerOptions = CompilerOptions & DeepkitOptions;
581
+ /**
582
+ * The TypeScript compiler configuration.
583
+ *
584
+ * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
585
+ */
586
+ interface TSConfig extends Omit<TsConfigJson, "reflection"> {
587
+ /**
588
+ * Either true to activate reflection for all files compiled using this tsconfig,
589
+ * or a list of globs/file paths relative to this tsconfig.json.
590
+ * Globs/file paths can be prefixed with a ! to exclude them.
591
+ */
592
+ reflection?: RawReflectionMode;
593
+ /**
594
+ * Defines the level of reflection to be used during the transpilation process.
595
+ *
596
+ * @remarks
597
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
598
+ * - `minimal` - Only the essential type information is captured.
599
+ * - `normal` - Additional type information is captured, including some contextual data.
600
+ * - `verbose` - All available type information is captured, including detailed contextual data.
601
+ */
602
+ reflectionLevel?: ReflectionLevel;
603
+ /**
604
+ * Instructs the TypeScript compiler how to compile `.ts` files.
605
+ */
606
+ compilerOptions?: TSCompilerOptions;
607
+ }
608
+ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
609
+ originalTsconfigJson: TsConfigJson;
610
+ tsconfigJson: TSConfig;
611
+ tsconfigFilePath: string;
612
+ };
613
+
599
614
  type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
600
615
  /**
601
616
  * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
@@ -1145,7 +1160,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1145
1160
  * @param path - An optional path to write the builtin file to
1146
1161
  * @param options - Options for writing the file
1147
1162
  */
1148
- writeBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1163
+ emitBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1149
1164
  /**
1150
1165
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
1151
1166
  *
@@ -1153,11 +1168,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1153
1168
  * @param path - An optional path to write the entry file to
1154
1169
  * @param options - Options for writing the file
1155
1170
  */
1156
- writeEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1157
- /**
1158
- * Parses the source code and returns a {@link ParseResult} object.
1159
- */
1160
- parse: (code: string, id: string, options?: ParserOptions | null) => Promise<ParseResult>;
1171
+ emitEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1161
1172
  /**
1162
1173
  * A function to update the context fields using a new user configuration options
1163
1174
  */
@@ -1379,6 +1390,12 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
1379
1390
  resolveId: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
1380
1391
  isEntry: boolean;
1381
1392
  }) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
1393
+ /**
1394
+ * An API object that can be used for inter-plugin communication.
1395
+ *
1396
+ * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
1397
+ */
1398
+ api?: Record<string, any>;
1382
1399
  };
1383
1400
  type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = {
1384
1401
  [TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant>;
@@ -1431,5 +1448,8 @@ interface Plugin<in out TContext extends PluginContext<ResolvedConfig> = PluginC
1431
1448
  type RollupPluginOptions = Partial<RollupBuildConfig>;
1432
1449
  type RollupPluginResolvedConfig = RollupResolvedConfig;
1433
1450
  type RollupPluginContext<TResolvedConfig extends RollupPluginResolvedConfig = RollupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
1451
+ declare type __ΩRollupPluginOptions = any[];
1452
+ declare type __ΩRollupPluginResolvedConfig = any[];
1453
+ declare type __ΩRollupPluginContext = any[];
1434
1454
 
1435
- export type { Plugin as P, RollupPluginContext as R, RollupPluginOptions as a, RollupPluginResolvedConfig as b };
1455
+ export type { Plugin as P, RollupPluginContext as R, __ΩRollupPluginOptions as _, RollupPluginOptions as a, RollupPluginResolvedConfig as b, __ΩRollupPluginResolvedConfig as c, __ΩRollupPluginContext as d };
@@ -3,7 +3,6 @@ import { EnvPaths } from '@stryke/env/get-env-paths';
3
3
  import { MaybePromise, NonUndefined, FunctionLike } from '@stryke/types/base';
4
4
  import { PackageJson } from '@stryke/types/package-json';
5
5
  import { Jiti } from 'jiti';
6
- import { ParserOptions, ParseResult } from 'oxc-parser';
7
6
  import { Range } from 'semver';
8
7
  import { UnpluginMessage, UnpluginContext, UnpluginBuildContext, TransformResult, ExternalIdResult, HookFilter, UnpluginOptions } from 'unplugin';
9
8
  import { Format } from '@storm-software/build-tools/types';
@@ -12,11 +11,10 @@ import { StormWorkspaceConfig } from '@storm-software/config/types';
12
11
  import { TypeDefinitionParameter, TypeDefinition } from '@stryke/types/configuration';
13
12
  import { AssetGlob } from '@stryke/types/file';
14
13
  import { PreviewOptions, ResolvedPreviewOptions } from 'vite';
14
+ import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
15
15
  import { ArrayValues } from '@stryke/types/array';
16
16
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
17
17
  import ts from 'typescript';
18
- import { PrimitiveJsonValue } from '@stryke/json/types';
19
- import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
20
18
 
21
19
  type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
22
20
  interface BuildConfig {
@@ -159,87 +157,20 @@ type RollupBuildConfig = Omit<RollupOptions, "entry" | "external" | "input" | "o
159
157
  } & BuildConfig;
160
158
  type RollupResolvedBuildConfig = RollupOptions & BuildResolvedConfig;
161
159
 
162
- type ReflectionMode = "default" | "explicit" | "never";
163
- type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
164
- /**
165
- * Defines the level of reflection to be used during the transpilation process.
166
- *
167
- * @remarks
168
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
169
- * - `minimal` - Only the essential type information is captured.
170
- * - `normal` - Additional type information is captured, including some contextual data.
171
- * - `verbose` - All available type information is captured, including detailed contextual data.
172
- */
173
- type ReflectionLevel = "minimal" | "normal" | "verbose";
174
- interface DeepkitOptions {
175
- /**
176
- * Either true to activate reflection for all files compiled using this tsconfig,
177
- * or a list of globs/file paths relative to this tsconfig.json.
178
- * Globs/file paths can be prefixed with a ! to exclude them.
179
- */
180
- reflection?: RawReflectionMode;
181
- /**
182
- * Defines the level of reflection to be used during the transpilation process.
183
- *
184
- * @remarks
185
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
186
- * - `minimal` - Only the essential type information is captured.
187
- * - `normal` - Additional type information is captured, including some contextual data.
188
- * - `verbose` - All available type information is captured, including detailed contextual data.
189
- */
190
- reflectionLevel?: ReflectionLevel;
191
- }
192
- type TSCompilerOptions = CompilerOptions & DeepkitOptions;
193
- /**
194
- * The TypeScript compiler configuration.
195
- *
196
- * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
197
- */
198
- interface TSConfig extends Omit<TsConfigJson, "reflection"> {
199
- /**
200
- * Either true to activate reflection for all files compiled using this tsconfig,
201
- * or a list of globs/file paths relative to this tsconfig.json.
202
- * Globs/file paths can be prefixed with a ! to exclude them.
203
- */
204
- reflection?: RawReflectionMode;
205
- /**
206
- * Defines the level of reflection to be used during the transpilation process.
207
- *
208
- * @remarks
209
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
210
- * - `minimal` - Only the essential type information is captured.
211
- * - `normal` - Additional type information is captured, including some contextual data.
212
- * - `verbose` - All available type information is captured, including detailed contextual data.
213
- */
214
- reflectionLevel?: ReflectionLevel;
215
- /**
216
- * Instructs the TypeScript compiler how to compile `.ts` files.
217
- */
218
- compilerOptions?: TSCompilerOptions;
219
- }
220
- type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
221
- originalTsconfigJson: TsConfigJson;
222
- tsconfigJson: TSConfig;
223
- tsconfigFilePath: string;
224
- };
225
-
226
160
  declare const __VFS_PATCH__ = "__VFS_PATCH__";
227
161
  declare const __VFS_REVERT__ = "__VFS_REVERT__";
228
162
  type OutputModeType = "fs" | "virtual";
229
- interface VirtualFile {
163
+ interface VirtualFileMetadata {
230
164
  /**
231
- * The unique identifier for the virtual file.
232
- *
233
- * @remarks
234
- * If no specific id is provided, it defaults to the file's {@link path}.
165
+ * The identifier for the file data.
235
166
  */
236
167
  id: string;
237
168
  /**
238
- * Additional metadata associated with the virtual file.
169
+ * The timestamp of the virtual file.
239
170
  */
240
- details: Record<string, PrimitiveJsonValue>;
171
+ timestamp: number;
241
172
  /**
242
- * The variant of the file.
173
+ * The type of the file.
243
174
  *
244
175
  * @remarks
245
176
  * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
@@ -247,52 +178,72 @@ interface VirtualFile {
247
178
  * - `entry`: Indicates that the file is an entry point for execution.
248
179
  * - `normal`: Indicates that the file is a standard file without any special role.
249
180
  */
250
- variant: string;
181
+ type: string;
251
182
  /**
252
183
  * The output mode of the file.
253
- *
254
- * @remarks
255
- * This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).
256
184
  */
257
- mode: OutputModeType;
258
- /**
259
- * A virtual (or actual) path to the file in the file system.
260
- */
261
- path: string;
185
+ mode: string;
262
186
  /**
263
- * The contents of the file.
187
+ * Additional metadata associated with the file.
264
188
  */
265
- code: string | NodeJS.ArrayBufferView;
189
+ properties: Record<string, string>;
266
190
  }
267
- interface VirtualFileMetadata {
191
+ interface VirtualFileData {
268
192
  /**
269
193
  * The identifier for the file data.
270
194
  */
271
- id: string;
195
+ id?: string;
272
196
  /**
273
- * The variant of the file.
197
+ * The contents of the virtual file.
198
+ */
199
+ code: string;
200
+ /**
201
+ * The type of the file.
202
+ *
203
+ * @remarks
204
+ * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
205
+ * - `builtin`: Indicates that the file is a built-in module provided by the system.
206
+ * - `entry`: Indicates that the file is an entry point for execution.
207
+ * - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
208
+ * - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
209
+ * - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
210
+ * - `normal`: Indicates that the file is a standard file without any special role.
274
211
  */
275
- variant: string;
212
+ type?: string;
276
213
  /**
277
214
  * The output mode of the file.
278
215
  */
279
- mode: string;
216
+ mode?: string;
280
217
  /**
281
218
  * Additional metadata associated with the file.
282
219
  */
283
- properties: Record<string, string>;
220
+ properties?: Record<string, string>;
221
+ }
222
+ interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
223
+ /**
224
+ * An additional name for the file.
225
+ */
226
+ path: string;
227
+ /**
228
+ * The timestamp of the virtual file.
229
+ */
230
+ timestamp: number;
284
231
  }
285
232
  interface ResolveFSOptions {
286
233
  mode?: OutputModeType;
287
234
  }
288
235
  type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
289
236
  interface PowerlinesWriteFileOptions extends ResolveFSOptions {
237
+ /**
238
+ * Should the file skip formatting before being written?
239
+ *
240
+ * @defaultValue false
241
+ */
290
242
  skipFormat?: boolean;
291
243
  }
292
244
  type NodeWriteFileOptions = WriteFileOptions$1;
293
245
  type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
294
- type PowerLinesWriteFileData = Partial<Omit<VirtualFile, "path" | "mode" | "code">> & Pick<VirtualFile, "code">;
295
- type WriteFileData = string | NodeJS.ArrayBufferView | PowerLinesWriteFileData;
246
+ type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
296
247
  interface ResolvePathOptions extends ResolveFSOptions {
297
248
  /**
298
249
  * Should the resolved path include the file extension?
@@ -307,7 +258,7 @@ interface ResolvePathOptions extends ResolveFSOptions {
307
258
  /**
308
259
  * The type of the path to resolve.
309
260
  */
310
- type?: "file" | "directory";
261
+ pathType?: "file" | "directory";
311
262
  }
312
263
  interface VirtualFileSystemInterface {
313
264
  /**
@@ -596,6 +547,70 @@ interface VirtualFileSystemInterface {
596
547
  dispose: () => Promise<void>;
597
548
  }
598
549
 
550
+ type ReflectionMode = "default" | "explicit" | "never";
551
+ type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
552
+ /**
553
+ * Defines the level of reflection to be used during the transpilation process.
554
+ *
555
+ * @remarks
556
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
557
+ * - `minimal` - Only the essential type information is captured.
558
+ * - `normal` - Additional type information is captured, including some contextual data.
559
+ * - `verbose` - All available type information is captured, including detailed contextual data.
560
+ */
561
+ type ReflectionLevel = "minimal" | "normal" | "verbose";
562
+ interface DeepkitOptions {
563
+ /**
564
+ * Either true to activate reflection for all files compiled using this tsconfig,
565
+ * or a list of globs/file paths relative to this tsconfig.json.
566
+ * Globs/file paths can be prefixed with a ! to exclude them.
567
+ */
568
+ reflection?: RawReflectionMode;
569
+ /**
570
+ * Defines the level of reflection to be used during the transpilation process.
571
+ *
572
+ * @remarks
573
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
574
+ * - `minimal` - Only the essential type information is captured.
575
+ * - `normal` - Additional type information is captured, including some contextual data.
576
+ * - `verbose` - All available type information is captured, including detailed contextual data.
577
+ */
578
+ reflectionLevel?: ReflectionLevel;
579
+ }
580
+ type TSCompilerOptions = CompilerOptions & DeepkitOptions;
581
+ /**
582
+ * The TypeScript compiler configuration.
583
+ *
584
+ * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
585
+ */
586
+ interface TSConfig extends Omit<TsConfigJson, "reflection"> {
587
+ /**
588
+ * Either true to activate reflection for all files compiled using this tsconfig,
589
+ * or a list of globs/file paths relative to this tsconfig.json.
590
+ * Globs/file paths can be prefixed with a ! to exclude them.
591
+ */
592
+ reflection?: RawReflectionMode;
593
+ /**
594
+ * Defines the level of reflection to be used during the transpilation process.
595
+ *
596
+ * @remarks
597
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
598
+ * - `minimal` - Only the essential type information is captured.
599
+ * - `normal` - Additional type information is captured, including some contextual data.
600
+ * - `verbose` - All available type information is captured, including detailed contextual data.
601
+ */
602
+ reflectionLevel?: ReflectionLevel;
603
+ /**
604
+ * Instructs the TypeScript compiler how to compile `.ts` files.
605
+ */
606
+ compilerOptions?: TSCompilerOptions;
607
+ }
608
+ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
609
+ originalTsconfigJson: TsConfigJson;
610
+ tsconfigJson: TSConfig;
611
+ tsconfigFilePath: string;
612
+ };
613
+
599
614
  type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
600
615
  /**
601
616
  * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
@@ -1145,7 +1160,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1145
1160
  * @param path - An optional path to write the builtin file to
1146
1161
  * @param options - Options for writing the file
1147
1162
  */
1148
- writeBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1163
+ emitBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1149
1164
  /**
1150
1165
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
1151
1166
  *
@@ -1153,11 +1168,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1153
1168
  * @param path - An optional path to write the entry file to
1154
1169
  * @param options - Options for writing the file
1155
1170
  */
1156
- writeEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1157
- /**
1158
- * Parses the source code and returns a {@link ParseResult} object.
1159
- */
1160
- parse: (code: string, id: string, options?: ParserOptions | null) => Promise<ParseResult>;
1171
+ emitEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1161
1172
  /**
1162
1173
  * A function to update the context fields using a new user configuration options
1163
1174
  */
@@ -1379,6 +1390,12 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
1379
1390
  resolveId: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
1380
1391
  isEntry: boolean;
1381
1392
  }) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
1393
+ /**
1394
+ * An API object that can be used for inter-plugin communication.
1395
+ *
1396
+ * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
1397
+ */
1398
+ api?: Record<string, any>;
1382
1399
  };
1383
1400
  type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = {
1384
1401
  [TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant>;
@@ -1431,5 +1448,8 @@ interface Plugin<in out TContext extends PluginContext<ResolvedConfig> = PluginC
1431
1448
  type RollupPluginOptions = Partial<RollupBuildConfig>;
1432
1449
  type RollupPluginResolvedConfig = RollupResolvedConfig;
1433
1450
  type RollupPluginContext<TResolvedConfig extends RollupPluginResolvedConfig = RollupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
1451
+ declare type __ΩRollupPluginOptions = any[];
1452
+ declare type __ΩRollupPluginResolvedConfig = any[];
1453
+ declare type __ΩRollupPluginContext = any[];
1434
1454
 
1435
- export type { Plugin as P, RollupPluginContext as R, RollupPluginOptions as a, RollupPluginResolvedConfig as b };
1455
+ export type { Plugin as P, RollupPluginContext as R, __ΩRollupPluginOptions as _, RollupPluginOptions as a, RollupPluginResolvedConfig as b, __ΩRollupPluginResolvedConfig as c, __ΩRollupPluginContext as d };
package/dist/index.d.cts CHANGED
@@ -1,12 +1,11 @@
1
- import { R as RollupPluginContext, a as RollupPluginOptions, P as Plugin } from './index-BJeSdSxa.cjs';
2
- export { b as RollupPluginResolvedConfig } from './index-BJeSdSxa.cjs';
1
+ import { R as RollupPluginContext, a as RollupPluginOptions, P as Plugin } from './index-DkJ_BIY7.cjs';
2
+ export { b as RollupPluginResolvedConfig, d as __ΩRollupPluginContext, _ as __ΩRollupPluginOptions, c as __ΩRollupPluginResolvedConfig } from './index-DkJ_BIY7.cjs';
3
3
  export { createRollupPlugin } from './helpers/unplugin.cjs';
4
4
  import 'rollup';
5
5
  import '@stryke/env/get-env-paths';
6
6
  import '@stryke/types/base';
7
7
  import '@stryke/types/package-json';
8
8
  import 'jiti';
9
- import 'oxc-parser';
10
9
  import 'semver';
11
10
  import 'unplugin';
12
11
  import '@storm-software/build-tools/types';
@@ -15,11 +14,10 @@ import '@storm-software/config/types';
15
14
  import '@stryke/types/configuration';
16
15
  import '@stryke/types/file';
17
16
  import 'vite';
17
+ import 'node:fs';
18
18
  import '@stryke/types/array';
19
19
  import '@stryke/types/tsconfig';
20
20
  import 'typescript';
21
- import '@stryke/json/types';
22
- import 'node:fs';
23
21
  import 'esbuild';
24
22
 
25
23
  /**
package/dist/index.d.ts CHANGED
@@ -1,12 +1,11 @@
1
- import { R as RollupPluginContext, a as RollupPluginOptions, P as Plugin } from './index-BJeSdSxa.js';
2
- export { b as RollupPluginResolvedConfig } from './index-BJeSdSxa.js';
1
+ import { R as RollupPluginContext, a as RollupPluginOptions, P as Plugin } from './index-DkJ_BIY7.js';
2
+ export { b as RollupPluginResolvedConfig, d as __ΩRollupPluginContext, _ as __ΩRollupPluginOptions, c as __ΩRollupPluginResolvedConfig } from './index-DkJ_BIY7.js';
3
3
  export { createRollupPlugin } from './helpers/unplugin.js';
4
4
  import 'rollup';
5
5
  import '@stryke/env/get-env-paths';
6
6
  import '@stryke/types/base';
7
7
  import '@stryke/types/package-json';
8
8
  import 'jiti';
9
- import 'oxc-parser';
10
9
  import 'semver';
11
10
  import 'unplugin';
12
11
  import '@storm-software/build-tools/types';
@@ -15,11 +14,10 @@ import '@storm-software/config/types';
15
14
  import '@stryke/types/configuration';
16
15
  import '@stryke/types/file';
17
16
  import 'vite';
17
+ import 'node:fs';
18
18
  import '@stryke/types/array';
19
19
  import '@stryke/types/tsconfig';
20
20
  import 'typescript';
21
- import '@stryke/json/types';
22
- import 'node:fs';
23
21
  import 'esbuild';
24
22
 
25
23
  /**
@@ -1,10 +1,9 @@
1
- export { R as RollupPluginContext, a as RollupPluginOptions, b as RollupPluginResolvedConfig } from '../index-BJeSdSxa.cjs';
1
+ export { R as RollupPluginContext, a as RollupPluginOptions, b as RollupPluginResolvedConfig, d as __ΩRollupPluginContext, _ as __ΩRollupPluginOptions, c as __ΩRollupPluginResolvedConfig } from '../index-DkJ_BIY7.cjs';
2
2
  import 'rollup';
3
3
  import '@stryke/env/get-env-paths';
4
4
  import '@stryke/types/base';
5
5
  import '@stryke/types/package-json';
6
6
  import 'jiti';
7
- import 'oxc-parser';
8
7
  import 'semver';
9
8
  import 'unplugin';
10
9
  import '@storm-software/build-tools/types';
@@ -13,8 +12,7 @@ import '@storm-software/config/types';
13
12
  import '@stryke/types/configuration';
14
13
  import '@stryke/types/file';
15
14
  import 'vite';
15
+ import 'node:fs';
16
16
  import '@stryke/types/array';
17
17
  import '@stryke/types/tsconfig';
18
18
  import 'typescript';
19
- import '@stryke/json/types';
20
- import 'node:fs';
@@ -1,10 +1,9 @@
1
- export { R as RollupPluginContext, a as RollupPluginOptions, b as RollupPluginResolvedConfig } from '../index-BJeSdSxa.js';
1
+ export { R as RollupPluginContext, a as RollupPluginOptions, b as RollupPluginResolvedConfig, d as __ΩRollupPluginContext, _ as __ΩRollupPluginOptions, c as __ΩRollupPluginResolvedConfig } from '../index-DkJ_BIY7.js';
2
2
  import 'rollup';
3
3
  import '@stryke/env/get-env-paths';
4
4
  import '@stryke/types/base';
5
5
  import '@stryke/types/package-json';
6
6
  import 'jiti';
7
- import 'oxc-parser';
8
7
  import 'semver';
9
8
  import 'unplugin';
10
9
  import '@storm-software/build-tools/types';
@@ -13,8 +12,7 @@ import '@storm-software/config/types';
13
12
  import '@stryke/types/configuration';
14
13
  import '@stryke/types/file';
15
14
  import 'vite';
15
+ import 'node:fs';
16
16
  import '@stryke/types/array';
17
17
  import '@stryke/types/tsconfig';
18
18
  import 'typescript';
19
- import '@stryke/json/types';
20
- import 'node:fs';
@@ -1,10 +1,9 @@
1
- export { R as RollupPluginContext, a as RollupPluginOptions, b as RollupPluginResolvedConfig } from '../index-BJeSdSxa.cjs';
1
+ export { R as RollupPluginContext, a as RollupPluginOptions, b as RollupPluginResolvedConfig, d as __ΩRollupPluginContext, _ as __ΩRollupPluginOptions, c as __ΩRollupPluginResolvedConfig } from '../index-DkJ_BIY7.cjs';
2
2
  import 'rollup';
3
3
  import '@stryke/env/get-env-paths';
4
4
  import '@stryke/types/base';
5
5
  import '@stryke/types/package-json';
6
6
  import 'jiti';
7
- import 'oxc-parser';
8
7
  import 'semver';
9
8
  import 'unplugin';
10
9
  import '@storm-software/build-tools/types';
@@ -13,8 +12,7 @@ import '@storm-software/config/types';
13
12
  import '@stryke/types/configuration';
14
13
  import '@stryke/types/file';
15
14
  import 'vite';
15
+ import 'node:fs';
16
16
  import '@stryke/types/array';
17
17
  import '@stryke/types/tsconfig';
18
18
  import 'typescript';
19
- import '@stryke/json/types';
20
- import 'node:fs';
@@ -1,10 +1,9 @@
1
- export { R as RollupPluginContext, a as RollupPluginOptions, b as RollupPluginResolvedConfig } from '../index-BJeSdSxa.js';
1
+ export { R as RollupPluginContext, a as RollupPluginOptions, b as RollupPluginResolvedConfig, d as __ΩRollupPluginContext, _ as __ΩRollupPluginOptions, c as __ΩRollupPluginResolvedConfig } from '../index-DkJ_BIY7.js';
2
2
  import 'rollup';
3
3
  import '@stryke/env/get-env-paths';
4
4
  import '@stryke/types/base';
5
5
  import '@stryke/types/package-json';
6
6
  import 'jiti';
7
- import 'oxc-parser';
8
7
  import 'semver';
9
8
  import 'unplugin';
10
9
  import '@storm-software/build-tools/types';
@@ -13,8 +12,7 @@ import '@storm-software/config/types';
13
12
  import '@stryke/types/configuration';
14
13
  import '@stryke/types/file';
15
14
  import 'vite';
15
+ import 'node:fs';
16
16
  import '@stryke/types/array';
17
17
  import '@stryke/types/tsconfig';
18
18
  import 'typescript';
19
- import '@stryke/json/types';
20
- import 'node:fs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-rollup",
3
- "version": "0.7.28",
3
+ "version": "0.7.30",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -134,15 +134,15 @@
134
134
  "@stryke/types": "^0.10.2",
135
135
  "defu": "^6.1.4",
136
136
  "jiti": "^2.6.1",
137
- "powerlines": "^0.23.2",
138
- "rollup": "^4.53.2",
137
+ "powerlines": "^0.23.4",
138
+ "rollup": "^4.53.3",
139
139
  "unplugin": "^2.3.10"
140
140
  },
141
141
  "devDependencies": {
142
- "@powerlines/nx": "^0.10.19",
143
- "@powerlines/plugin-plugin": "^0.11.27",
144
- "@types/node": "^22.19.1"
142
+ "@powerlines/nx": "^0.10.21",
143
+ "@powerlines/plugin-plugin": "^0.11.29",
144
+ "@types/node": "^24.10.1"
145
145
  },
146
146
  "publishConfig": { "access": "public" },
147
- "gitHead": "628334bf5e96fa739c6a2b0a325f133ea928b530"
147
+ "gitHead": "3075c08893a66a4e8d359e37f8d0344b0a80322b"
148
148
  }