@powerlines/plugin-react 0.1.10 → 0.1.11

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,8 +1,6 @@
1
1
  export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps } from './react-optimized.cjs';
2
2
  import '@alloy-js/core';
3
3
  import '@alloy-js/core/jsx-runtime';
4
- import '../vfs-Bl84Hw2V.cjs';
4
+ import '../vfs-BGmsy47f.cjs';
5
5
  import '@stryke/json/types';
6
- import 'memfs';
7
6
  import 'node:fs';
8
- import 'unionfs';
@@ -1,8 +1,6 @@
1
1
  export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps } from './react-optimized.js';
2
2
  import '@alloy-js/core';
3
3
  import '@alloy-js/core/jsx-runtime';
4
- import '../vfs-Bl84Hw2V.js';
4
+ import '../vfs-BGmsy47f.js';
5
5
  import '@stryke/json/types';
6
- import 'memfs';
7
6
  import 'node:fs';
8
- import 'unionfs';
@@ -1,11 +1,9 @@
1
1
  import * as _alloy_js_core from '@alloy-js/core';
2
2
  import { Children as Children$1, SourceFileProps as SourceFileProps$1 } from '@alloy-js/core';
3
3
  import { Children } from '@alloy-js/core/jsx-runtime';
4
- import { O as OutputModeType } from '../vfs-Bl84Hw2V.cjs';
4
+ import { O as OutputModeType } from '../vfs-BGmsy47f.cjs';
5
5
  import '@stryke/json/types';
6
- import 'memfs';
7
6
  import 'node:fs';
8
- import 'unionfs';
9
7
 
10
8
  /**
11
9
  * A type that represents the props of a component that can have children.
@@ -1,11 +1,9 @@
1
1
  import * as _alloy_js_core from '@alloy-js/core';
2
2
  import { Children as Children$1, SourceFileProps as SourceFileProps$1 } from '@alloy-js/core';
3
3
  import { Children } from '@alloy-js/core/jsx-runtime';
4
- import { O as OutputModeType } from '../vfs-Bl84Hw2V.js';
4
+ import { O as OutputModeType } from '../vfs-BGmsy47f.js';
5
5
  import '@stryke/json/types';
6
- import 'memfs';
7
6
  import 'node:fs';
8
- import 'unionfs';
9
7
 
10
8
  /**
11
9
  * A type that represents the props of a component that can have children.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as PluginContext, a as Plugin } from './runtime-BC7ENbDx.cjs';
1
+ import { P as PluginContext, a as Plugin } from './runtime-BKpao7nk.cjs';
2
2
  import { Children } from '@alloy-js/core/jsx-runtime';
3
3
  import { PrintTreeOptions } from '@alloy-js/core';
4
4
  import { ReactPluginContext } from './types/plugin.cjs';
@@ -23,11 +23,9 @@ import '@babel/helper-plugin-utils';
23
23
  import '@stryke/types/array';
24
24
  import '@stryke/types/tsconfig';
25
25
  import 'typescript';
26
- import './vfs-Bl84Hw2V.cjs';
26
+ import './vfs-BGmsy47f.cjs';
27
27
  import '@stryke/json/types';
28
- import 'memfs';
29
28
  import 'node:fs';
30
- import 'unionfs';
31
29
  import '@deepkit/type';
32
30
  import '@stryke/capnp';
33
31
  import '@stryke/env/types';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as PluginContext, a as Plugin } from './runtime-DCT7zK30.js';
1
+ import { P as PluginContext, a as Plugin } from './runtime-DNQO2Zr2.js';
2
2
  import { Children } from '@alloy-js/core/jsx-runtime';
3
3
  import { PrintTreeOptions } from '@alloy-js/core';
4
4
  import { ReactPluginContext } from './types/plugin.js';
@@ -23,11 +23,9 @@ import '@babel/helper-plugin-utils';
23
23
  import '@stryke/types/array';
24
24
  import '@stryke/types/tsconfig';
25
25
  import 'typescript';
26
- import './vfs-Bl84Hw2V.js';
26
+ import './vfs-BGmsy47f.js';
27
27
  import '@stryke/json/types';
28
- import 'memfs';
29
28
  import 'node:fs';
30
- import 'unionfs';
31
29
  import '@deepkit/type';
32
30
  import '@stryke/capnp';
33
31
  import '@stryke/env/types';
@@ -16,7 +16,7 @@ import { BabelAPI } from '@babel/helper-plugin-utils';
16
16
  import { ArrayValues } from '@stryke/types/array';
17
17
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
18
18
  import ts from 'typescript';
19
- import { O as OutputModeType, V as VirtualFileSystemInterface, a as VirtualFile, P as PowerlinesWriteFileOptions } from './vfs-Bl84Hw2V.js';
19
+ import { O as OutputModeType, V as VirtualFileSystemInterface, a as VirtualFile, P as PowerlinesWriteFileOptions } from './vfs-BGmsy47f.cjs';
20
20
 
21
21
  type BabelPluginPass<TState = unknown> = PluginPass & TState;
22
22
  type BabelTransformPluginFilter = (code: string, id: string) => boolean;
@@ -44,6 +44,20 @@ interface BuildConfig {
44
44
  * @defaultValue "neutral"
45
45
  */
46
46
  platform?: "node" | "browser" | "neutral";
47
+ /**
48
+ * Array of strings indicating the polyfills to include for the build.
49
+ *
50
+ * @remarks
51
+ * This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * {
56
+ * polyfill: ['{projectRoot}/custom-polyfill.ts']
57
+ * }
58
+ * ```
59
+ */
60
+ polyfill?: string[];
47
61
  /**
48
62
  * Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
49
63
  *
@@ -129,7 +143,10 @@ interface BuildConfig {
129
143
  *
130
144
  * @see https://github.com/rollup/plugins/tree/master/packages/alias
131
145
  */
132
- alias?: Record<string, string>;
146
+ alias?: Record<string, string> | Array<{
147
+ find: string | RegExp;
148
+ replacement: string;
149
+ }>;
133
150
  /**
134
151
  * A list of modules that should not be bundled, even if they are external dependencies.
135
152
  *
@@ -155,7 +172,7 @@ interface BuildConfig {
155
172
  }
156
173
  type BuildResolvedConfig = Omit<BuildConfig, "override">;
157
174
 
158
- declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "release", "finalize"];
175
+ declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
159
176
  type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
160
177
 
161
178
  interface ResolvedEntryTypeDefinition extends TypeDefinition {
@@ -186,7 +203,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
186
203
  /**
187
204
  * The resolved options for the Powerlines project configuration.
188
205
  */
189
- type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "framework">> & {
206
+ 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">> & {
190
207
  /**
191
208
  * The configuration options that were provided inline to the Powerlines CLI.
192
209
  */
@@ -688,6 +705,13 @@ interface BaseConfig {
688
705
  * This configuration will be used by the documentation generation plugins during the `docs` command.
689
706
  */
690
707
  docs?: Record<string, any>;
708
+ /**
709
+ * Configuration for deploying the source code
710
+ *
711
+ * @remarks
712
+ * If set to `false`, the deployment will be disabled.
713
+ */
714
+ deploy?: Record<string, any> | false;
691
715
  /**
692
716
  * The path to the tsconfig file to be used by the compiler
693
717
  *
@@ -801,7 +825,7 @@ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedCo
801
825
  override?: Partial<TBuildResolvedConfig>;
802
826
  };
803
827
  };
804
- type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "release" | "clean";
828
+ type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
805
829
  /**
806
830
  * The configuration provided while executing Powerlines commands.
807
831
  */
@@ -848,14 +872,6 @@ interface MetaInfo {
848
872
  * A hash that represents the path to the project root directory
849
873
  */
850
874
  configHash: string;
851
- /**
852
- * A mapping of runtime ids to their corresponding file paths
853
- */
854
- builtinIdMap: Record<string, string>;
855
- /**
856
- * A mapping of virtual file paths to their corresponding file contents
857
- */
858
- virtualFiles: Record<string, string | null>;
859
875
  }
860
876
  interface Resolver extends Jiti {
861
877
  plugin: Jiti;
@@ -16,7 +16,7 @@ import { BabelAPI } from '@babel/helper-plugin-utils';
16
16
  import { ArrayValues } from '@stryke/types/array';
17
17
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
18
18
  import ts from 'typescript';
19
- import { O as OutputModeType, V as VirtualFileSystemInterface, a as VirtualFile, P as PowerlinesWriteFileOptions } from './vfs-Bl84Hw2V.cjs';
19
+ import { O as OutputModeType, V as VirtualFileSystemInterface, a as VirtualFile, P as PowerlinesWriteFileOptions } from './vfs-BGmsy47f.js';
20
20
 
21
21
  type BabelPluginPass<TState = unknown> = PluginPass & TState;
22
22
  type BabelTransformPluginFilter = (code: string, id: string) => boolean;
@@ -44,6 +44,20 @@ interface BuildConfig {
44
44
  * @defaultValue "neutral"
45
45
  */
46
46
  platform?: "node" | "browser" | "neutral";
47
+ /**
48
+ * Array of strings indicating the polyfills to include for the build.
49
+ *
50
+ * @remarks
51
+ * This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * {
56
+ * polyfill: ['{projectRoot}/custom-polyfill.ts']
57
+ * }
58
+ * ```
59
+ */
60
+ polyfill?: string[];
47
61
  /**
48
62
  * Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
49
63
  *
@@ -129,7 +143,10 @@ interface BuildConfig {
129
143
  *
130
144
  * @see https://github.com/rollup/plugins/tree/master/packages/alias
131
145
  */
132
- alias?: Record<string, string>;
146
+ alias?: Record<string, string> | Array<{
147
+ find: string | RegExp;
148
+ replacement: string;
149
+ }>;
133
150
  /**
134
151
  * A list of modules that should not be bundled, even if they are external dependencies.
135
152
  *
@@ -155,7 +172,7 @@ interface BuildConfig {
155
172
  }
156
173
  type BuildResolvedConfig = Omit<BuildConfig, "override">;
157
174
 
158
- declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "release", "finalize"];
175
+ declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
159
176
  type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
160
177
 
161
178
  interface ResolvedEntryTypeDefinition extends TypeDefinition {
@@ -186,7 +203,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
186
203
  /**
187
204
  * The resolved options for the Powerlines project configuration.
188
205
  */
189
- type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "framework">> & {
206
+ 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">> & {
190
207
  /**
191
208
  * The configuration options that were provided inline to the Powerlines CLI.
192
209
  */
@@ -688,6 +705,13 @@ interface BaseConfig {
688
705
  * This configuration will be used by the documentation generation plugins during the `docs` command.
689
706
  */
690
707
  docs?: Record<string, any>;
708
+ /**
709
+ * Configuration for deploying the source code
710
+ *
711
+ * @remarks
712
+ * If set to `false`, the deployment will be disabled.
713
+ */
714
+ deploy?: Record<string, any> | false;
691
715
  /**
692
716
  * The path to the tsconfig file to be used by the compiler
693
717
  *
@@ -801,7 +825,7 @@ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedCo
801
825
  override?: Partial<TBuildResolvedConfig>;
802
826
  };
803
827
  };
804
- type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "release" | "clean";
828
+ type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
805
829
  /**
806
830
  * The configuration provided while executing Powerlines commands.
807
831
  */
@@ -848,14 +872,6 @@ interface MetaInfo {
848
872
  * A hash that represents the path to the project root directory
849
873
  */
850
874
  configHash: string;
851
- /**
852
- * A mapping of runtime ids to their corresponding file paths
853
- */
854
- builtinIdMap: Record<string, string>;
855
- /**
856
- * A mapping of virtual file paths to their corresponding file contents
857
- */
858
- virtualFiles: Record<string, string | null>;
859
875
  }
860
876
  interface Resolver extends Jiti {
861
877
  plugin: Jiti;
@@ -1,6 +1,6 @@
1
1
  export { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig } from './plugin.cjs';
2
2
  export { ReactEnvInterface } from './runtime.cjs';
3
- import '../runtime-BC7ENbDx.cjs';
3
+ import '../runtime-BKpao7nk.cjs';
4
4
  import '@stryke/env/get-env-paths';
5
5
  import '@stryke/types/base';
6
6
  import '@stryke/types/package-json';
@@ -19,11 +19,9 @@ import '@babel/helper-plugin-utils';
19
19
  import '@stryke/types/array';
20
20
  import '@stryke/types/tsconfig';
21
21
  import 'typescript';
22
- import '../vfs-Bl84Hw2V.cjs';
22
+ import '../vfs-BGmsy47f.cjs';
23
23
  import '@stryke/json/types';
24
- import 'memfs';
25
24
  import 'node:fs';
26
- import 'unionfs';
27
25
  import '@alloy-js/core/jsx-runtime';
28
26
  import '@deepkit/type';
29
27
  import '@stryke/capnp';
@@ -1,6 +1,6 @@
1
1
  export { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig } from './plugin.js';
2
2
  export { ReactEnvInterface } from './runtime.js';
3
- import '../runtime-DCT7zK30.js';
3
+ import '../runtime-DNQO2Zr2.js';
4
4
  import '@stryke/env/get-env-paths';
5
5
  import '@stryke/types/base';
6
6
  import '@stryke/types/package-json';
@@ -19,11 +19,9 @@ import '@babel/helper-plugin-utils';
19
19
  import '@stryke/types/array';
20
20
  import '@stryke/types/tsconfig';
21
21
  import 'typescript';
22
- import '../vfs-Bl84Hw2V.js';
22
+ import '../vfs-BGmsy47f.js';
23
23
  import '@stryke/json/types';
24
- import 'memfs';
25
24
  import 'node:fs';
26
- import 'unionfs';
27
25
  import '@alloy-js/core/jsx-runtime';
28
26
  import '@deepkit/type';
29
27
  import '@stryke/capnp';
@@ -1,4 +1,4 @@
1
- import { B as BabelUserConfig, U as UserConfig, R as ResolvedConfig, b as BabelResolvedConfig, P as PluginContext, E as EnvInterface, S as SecretsInterface } from '../runtime-BC7ENbDx.cjs';
1
+ import { B as BabelUserConfig, U as UserConfig, R as ResolvedConfig, b as BabelResolvedConfig, P as PluginContext, E as EnvInterface, S as SecretsInterface } from '../runtime-BKpao7nk.cjs';
2
2
  import { Children } from '@alloy-js/core/jsx-runtime';
3
3
  import { ReflectionClass } from '@deepkit/type';
4
4
  import * as $ from '@stryke/capnp';
@@ -22,11 +22,9 @@ import '@babel/helper-plugin-utils';
22
22
  import '@stryke/types/array';
23
23
  import '@stryke/types/tsconfig';
24
24
  import 'typescript';
25
- import '../vfs-Bl84Hw2V.cjs';
25
+ import '../vfs-BGmsy47f.cjs';
26
26
  import '@stryke/json/types';
27
- import 'memfs';
28
27
  import 'node:fs';
29
- import 'unionfs';
30
28
 
31
29
  type BabelPluginOptions = Partial<BabelUserConfig>;
32
30
  type BabelPluginUserConfig = UserConfig;
@@ -1,4 +1,4 @@
1
- import { B as BabelUserConfig, U as UserConfig, R as ResolvedConfig, b as BabelResolvedConfig, P as PluginContext, E as EnvInterface, S as SecretsInterface } from '../runtime-DCT7zK30.js';
1
+ import { B as BabelUserConfig, U as UserConfig, R as ResolvedConfig, b as BabelResolvedConfig, P as PluginContext, E as EnvInterface, S as SecretsInterface } from '../runtime-DNQO2Zr2.js';
2
2
  import { Children } from '@alloy-js/core/jsx-runtime';
3
3
  import { ReflectionClass } from '@deepkit/type';
4
4
  import * as $ from '@stryke/capnp';
@@ -22,11 +22,9 @@ import '@babel/helper-plugin-utils';
22
22
  import '@stryke/types/array';
23
23
  import '@stryke/types/tsconfig';
24
24
  import 'typescript';
25
- import '../vfs-Bl84Hw2V.js';
25
+ import '../vfs-BGmsy47f.js';
26
26
  import '@stryke/json/types';
27
- import 'memfs';
28
27
  import 'node:fs';
29
- import 'unionfs';
30
28
 
31
29
  type BabelPluginOptions = Partial<BabelUserConfig>;
32
30
  type BabelPluginUserConfig = UserConfig;
@@ -1,4 +1,4 @@
1
- import { E as EnvInterface } from '../runtime-BC7ENbDx.cjs';
1
+ import { E as EnvInterface } from '../runtime-BKpao7nk.cjs';
2
2
  import '@stryke/env/get-env-paths';
3
3
  import '@stryke/types/base';
4
4
  import '@stryke/types/package-json';
@@ -17,11 +17,9 @@ import '@babel/helper-plugin-utils';
17
17
  import '@stryke/types/array';
18
18
  import '@stryke/types/tsconfig';
19
19
  import 'typescript';
20
- import '../vfs-Bl84Hw2V.cjs';
20
+ import '../vfs-BGmsy47f.cjs';
21
21
  import '@stryke/json/types';
22
- import 'memfs';
23
22
  import 'node:fs';
24
- import 'unionfs';
25
23
 
26
24
  interface ReactEnvInterface extends EnvInterface {
27
25
  /**
@@ -1,4 +1,4 @@
1
- import { E as EnvInterface } from '../runtime-DCT7zK30.js';
1
+ import { E as EnvInterface } from '../runtime-DNQO2Zr2.js';
2
2
  import '@stryke/env/get-env-paths';
3
3
  import '@stryke/types/base';
4
4
  import '@stryke/types/package-json';
@@ -17,11 +17,9 @@ import '@babel/helper-plugin-utils';
17
17
  import '@stryke/types/array';
18
18
  import '@stryke/types/tsconfig';
19
19
  import 'typescript';
20
- import '../vfs-Bl84Hw2V.js';
20
+ import '../vfs-BGmsy47f.js';
21
21
  import '@stryke/json/types';
22
- import 'memfs';
23
22
  import 'node:fs';
24
- import 'unionfs';
25
23
 
26
24
  interface ReactEnvInterface extends EnvInterface {
27
25
  /**
@@ -1,13 +1,8 @@
1
1
  import { PrimitiveJsonValue } from '@stryke/json/types';
2
- import { Volume } from 'memfs';
3
2
  import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
4
- import { IUnionFs } from 'unionfs';
5
3
 
6
- declare const __VFS_INIT__ = "__VFS_INIT__";
7
- declare const __VFS_REVERT__ = "__VFS_REVERT__";
8
- declare const __VFS_CACHE__ = "__VFS_CACHE__";
9
- declare const __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
10
- declare const __VFS_UNIFIED__ = "__VFS_UNIFIED__";
4
+ declare const __VFS_PATCH__: unique symbol;
5
+ declare const __VFS_REVERT__: unique symbol;
11
6
  type OutputModeType = "fs" | "virtual";
12
7
  interface VirtualFile {
13
8
  /**
@@ -47,7 +42,24 @@ interface VirtualFile {
47
42
  */
48
43
  code: string | NodeJS.ArrayBufferView;
49
44
  }
50
- type VirtualFileSystemMetadata = Pick<VirtualFile, "id" | "details" | "variant" | "mode">;
45
+ interface VirtualFileMetadata {
46
+ /**
47
+ * The identifier for the file data.
48
+ */
49
+ id: string;
50
+ /**
51
+ * The variant of the file.
52
+ */
53
+ variant: string;
54
+ /**
55
+ * The output mode of the file.
56
+ */
57
+ mode: string;
58
+ /**
59
+ * Additional metadata associated with the file.
60
+ */
61
+ properties: Record<string, string>;
62
+ }
51
63
  interface ResolveFSOptions {
52
64
  mode?: OutputModeType;
53
65
  }
@@ -76,12 +88,18 @@ interface ResolvePathOptions extends ResolveFSOptions {
76
88
  type?: "file" | "directory";
77
89
  }
78
90
  interface VirtualFileSystemInterface {
79
- [__VFS_INIT__]: () => void;
91
+ /**
92
+ * Patches the File System to include the virtual file system (VFS) contents.
93
+ */
94
+ [__VFS_PATCH__]: () => void;
95
+ /**
96
+ * Reverts the virtual file system (VFS) to its previous state.
97
+ */
80
98
  [__VFS_REVERT__]: () => void;
81
99
  /**
82
100
  * The underlying file metadata.
83
101
  */
84
- meta: Record<string, VirtualFileSystemMetadata | undefined>;
102
+ metadata: Record<string, VirtualFileMetadata | undefined>;
85
103
  /**
86
104
  * A map of module ids to their file paths.
87
105
  */
@@ -101,7 +119,7 @@ interface VirtualFileSystemInterface {
101
119
  * @param options - Optional parameters for resolving the path.
102
120
  * @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
103
121
  */
104
- isFs: (pathOrId: string, options?: ResolvePathOptions) => boolean;
122
+ isPhysical: (pathOrId: string, options?: ResolvePathOptions) => boolean;
105
123
  /**
106
124
  * Checks if a file exists in the virtual file system (VFS).
107
125
  *
@@ -116,15 +134,6 @@ interface VirtualFileSystemInterface {
116
134
  * @returns `true` if the directory exists, otherwise `false`.
117
135
  */
118
136
  isDirectory: (path: string) => boolean;
119
- /**
120
- * Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.
121
- *
122
- * @see https://www.typescriptlang.org/tsconfig#paths
123
- *
124
- * @param pathOrId - The path or id to check.
125
- * @returns Whether the path or id corresponds to a virtual file.
126
- */
127
- isTsconfigPath: (pathOrId: string) => boolean;
128
137
  /**
129
138
  * Checks if a file exists in the virtual file system (VFS).
130
139
  *
@@ -138,7 +147,7 @@ interface VirtualFileSystemInterface {
138
147
  * @param pathOrId - The path or id of the file.
139
148
  * @returns The metadata of the file if it exists, otherwise undefined.
140
149
  */
141
- getMetadata: (pathOrId: PathLike) => VirtualFileSystemMetadata | undefined;
150
+ getMetadata: (pathOrId: PathLike) => VirtualFileMetadata | undefined;
142
151
  /**
143
152
  * Gets the stats of a file in the virtual file system (VFS).
144
153
  *
@@ -346,23 +355,12 @@ interface VirtualFileSystemInterface {
346
355
  */
347
356
  resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;
348
357
  /**
349
- * Resolves a path based on TypeScript's `tsconfig.json` paths.
358
+ * Formats a path to match the virtual file system (VFS) structure.
350
359
  *
351
- * @see https://www.typescriptlang.org/tsconfig#paths
352
- *
353
- * @param path - The path to check.
354
- * @returns The resolved file path if it exists, otherwise undefined.
360
+ * @param path - The path to format.
361
+ * @returns The formatted path.
355
362
  */
356
- resolveTsconfigPath: (path: string) => string | false;
357
- /**
358
- * Resolves a package name based on TypeScript's `tsconfig.json` paths.
359
- *
360
- * @see https://www.typescriptlang.org/tsconfig#paths
361
- *
362
- * @param path - The path to check.
363
- * @returns The resolved package name if it exists, otherwise undefined.
364
- */
365
- resolveTsconfigPathPackage: (path: string) => string | false;
363
+ formatPath: (path: string) => string;
366
364
  /**
367
365
  * Resolves a path or id to a file path in the virtual file system.
368
366
  *
@@ -371,23 +369,9 @@ interface VirtualFileSystemInterface {
371
369
  */
372
370
  realpathSync: (pathOrId: string) => string;
373
371
  /**
374
- * Retrieves a partial metadata mapping of all files in the virtual file system (VFS).
375
- *
376
- * @returns A record mapping file paths to their partial metadata.
377
- */
378
- getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;
379
- /**
380
- * A map of cached file paths to their underlying file content.
381
- */
382
- [__VFS_CACHE__]: Map<string, string>;
383
- /**
384
- * A reference to the underlying virtual file system.
385
- */
386
- [__VFS_VIRTUAL__]: Volume;
387
- /**
388
- * A reference to the underlying unified file system.
372
+ * Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
389
373
  */
390
- [__VFS_UNIFIED__]: IUnionFs;
374
+ dispose: () => Promise<void>;
391
375
  }
392
376
 
393
377
  export type { OutputModeType as O, PowerlinesWriteFileOptions as P, VirtualFileSystemInterface as V, VirtualFile as a };
@@ -1,13 +1,8 @@
1
1
  import { PrimitiveJsonValue } from '@stryke/json/types';
2
- import { Volume } from 'memfs';
3
2
  import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
4
- import { IUnionFs } from 'unionfs';
5
3
 
6
- declare const __VFS_INIT__ = "__VFS_INIT__";
7
- declare const __VFS_REVERT__ = "__VFS_REVERT__";
8
- declare const __VFS_CACHE__ = "__VFS_CACHE__";
9
- declare const __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
10
- declare const __VFS_UNIFIED__ = "__VFS_UNIFIED__";
4
+ declare const __VFS_PATCH__: unique symbol;
5
+ declare const __VFS_REVERT__: unique symbol;
11
6
  type OutputModeType = "fs" | "virtual";
12
7
  interface VirtualFile {
13
8
  /**
@@ -47,7 +42,24 @@ interface VirtualFile {
47
42
  */
48
43
  code: string | NodeJS.ArrayBufferView;
49
44
  }
50
- type VirtualFileSystemMetadata = Pick<VirtualFile, "id" | "details" | "variant" | "mode">;
45
+ interface VirtualFileMetadata {
46
+ /**
47
+ * The identifier for the file data.
48
+ */
49
+ id: string;
50
+ /**
51
+ * The variant of the file.
52
+ */
53
+ variant: string;
54
+ /**
55
+ * The output mode of the file.
56
+ */
57
+ mode: string;
58
+ /**
59
+ * Additional metadata associated with the file.
60
+ */
61
+ properties: Record<string, string>;
62
+ }
51
63
  interface ResolveFSOptions {
52
64
  mode?: OutputModeType;
53
65
  }
@@ -76,12 +88,18 @@ interface ResolvePathOptions extends ResolveFSOptions {
76
88
  type?: "file" | "directory";
77
89
  }
78
90
  interface VirtualFileSystemInterface {
79
- [__VFS_INIT__]: () => void;
91
+ /**
92
+ * Patches the File System to include the virtual file system (VFS) contents.
93
+ */
94
+ [__VFS_PATCH__]: () => void;
95
+ /**
96
+ * Reverts the virtual file system (VFS) to its previous state.
97
+ */
80
98
  [__VFS_REVERT__]: () => void;
81
99
  /**
82
100
  * The underlying file metadata.
83
101
  */
84
- meta: Record<string, VirtualFileSystemMetadata | undefined>;
102
+ metadata: Record<string, VirtualFileMetadata | undefined>;
85
103
  /**
86
104
  * A map of module ids to their file paths.
87
105
  */
@@ -101,7 +119,7 @@ interface VirtualFileSystemInterface {
101
119
  * @param options - Optional parameters for resolving the path.
102
120
  * @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
103
121
  */
104
- isFs: (pathOrId: string, options?: ResolvePathOptions) => boolean;
122
+ isPhysical: (pathOrId: string, options?: ResolvePathOptions) => boolean;
105
123
  /**
106
124
  * Checks if a file exists in the virtual file system (VFS).
107
125
  *
@@ -116,15 +134,6 @@ interface VirtualFileSystemInterface {
116
134
  * @returns `true` if the directory exists, otherwise `false`.
117
135
  */
118
136
  isDirectory: (path: string) => boolean;
119
- /**
120
- * Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.
121
- *
122
- * @see https://www.typescriptlang.org/tsconfig#paths
123
- *
124
- * @param pathOrId - The path or id to check.
125
- * @returns Whether the path or id corresponds to a virtual file.
126
- */
127
- isTsconfigPath: (pathOrId: string) => boolean;
128
137
  /**
129
138
  * Checks if a file exists in the virtual file system (VFS).
130
139
  *
@@ -138,7 +147,7 @@ interface VirtualFileSystemInterface {
138
147
  * @param pathOrId - The path or id of the file.
139
148
  * @returns The metadata of the file if it exists, otherwise undefined.
140
149
  */
141
- getMetadata: (pathOrId: PathLike) => VirtualFileSystemMetadata | undefined;
150
+ getMetadata: (pathOrId: PathLike) => VirtualFileMetadata | undefined;
142
151
  /**
143
152
  * Gets the stats of a file in the virtual file system (VFS).
144
153
  *
@@ -346,23 +355,12 @@ interface VirtualFileSystemInterface {
346
355
  */
347
356
  resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;
348
357
  /**
349
- * Resolves a path based on TypeScript's `tsconfig.json` paths.
358
+ * Formats a path to match the virtual file system (VFS) structure.
350
359
  *
351
- * @see https://www.typescriptlang.org/tsconfig#paths
352
- *
353
- * @param path - The path to check.
354
- * @returns The resolved file path if it exists, otherwise undefined.
360
+ * @param path - The path to format.
361
+ * @returns The formatted path.
355
362
  */
356
- resolveTsconfigPath: (path: string) => string | false;
357
- /**
358
- * Resolves a package name based on TypeScript's `tsconfig.json` paths.
359
- *
360
- * @see https://www.typescriptlang.org/tsconfig#paths
361
- *
362
- * @param path - The path to check.
363
- * @returns The resolved package name if it exists, otherwise undefined.
364
- */
365
- resolveTsconfigPathPackage: (path: string) => string | false;
363
+ formatPath: (path: string) => string;
366
364
  /**
367
365
  * Resolves a path or id to a file path in the virtual file system.
368
366
  *
@@ -371,23 +369,9 @@ interface VirtualFileSystemInterface {
371
369
  */
372
370
  realpathSync: (pathOrId: string) => string;
373
371
  /**
374
- * Retrieves a partial metadata mapping of all files in the virtual file system (VFS).
375
- *
376
- * @returns A record mapping file paths to their partial metadata.
377
- */
378
- getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;
379
- /**
380
- * A map of cached file paths to their underlying file content.
381
- */
382
- [__VFS_CACHE__]: Map<string, string>;
383
- /**
384
- * A reference to the underlying virtual file system.
385
- */
386
- [__VFS_VIRTUAL__]: Volume;
387
- /**
388
- * A reference to the underlying unified file system.
372
+ * Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
389
373
  */
390
- [__VFS_UNIFIED__]: IUnionFs;
374
+ dispose: () => Promise<void>;
391
375
  }
392
376
 
393
377
  export type { OutputModeType as O, PowerlinesWriteFileOptions as P, VirtualFileSystemInterface as V, VirtualFile as a };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-react",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for building a React application.",
6
6
  "repository": {
@@ -130,19 +130,19 @@
130
130
  "@stryke/fs": "^0.32.13",
131
131
  "@stryke/path": "^0.19.2",
132
132
  "babel-plugin-react-compiler": "^1.0.0",
133
- "@powerlines/alloy": "^0.11.19",
134
- "@powerlines/plugin-babel": "^0.12.19",
135
- "@powerlines/plugin-env": "^0.13.16",
136
- "@powerlines/plugin-plugin": "^0.11.18",
133
+ "@powerlines/alloy": "^0.11.20",
134
+ "@powerlines/plugin-babel": "^0.12.20",
135
+ "@powerlines/plugin-env": "^0.13.17",
136
+ "@powerlines/plugin-plugin": "^0.11.19",
137
137
  "@vitejs/plugin-react": "^5.1.1",
138
138
  "defu": "^6.1.4",
139
- "powerlines": "^0.20.0"
139
+ "powerlines": "^0.21.0"
140
140
  },
141
141
  "devDependencies": {
142
- "@powerlines/nx": "^0.10.10",
142
+ "@powerlines/nx": "^0.10.11",
143
143
  "@storm-software/tsup": "^0.2.38",
144
144
  "@types/node": "^22.19.1"
145
145
  },
146
146
  "publishConfig": { "access": "public" },
147
- "gitHead": "e33924ab31dbf508b8983523edbaecffeebbee4f"
147
+ "gitHead": "c6ed2ca745c8f340a55758b3102933dc41e83428"
148
148
  }