@powerlines/plugin-react 0.1.9 → 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.
- package/dist/components/index.d.cts +1 -3
- package/dist/components/index.d.ts +1 -3
- package/dist/components/react-optimized.d.cts +1 -3
- package/dist/components/react-optimized.d.ts +1 -3
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -5
- package/dist/index.d.ts +3 -5
- package/dist/index.js +2 -2
- package/dist/{runtime-Bb7JS9HT.d.ts → runtime-BKpao7nk.d.cts} +165 -63
- package/dist/{runtime-CXMswNNM.d.cts → runtime-DNQO2Zr2.d.ts} +165 -63
- package/dist/types/index.d.cts +3 -5
- package/dist/types/index.d.ts +3 -5
- package/dist/types/plugin.d.cts +3 -5
- package/dist/types/plugin.d.ts +3 -5
- package/dist/types/runtime.d.cts +3 -5
- package/dist/types/runtime.d.ts +3 -5
- package/dist/{vfs-Bl84Hw2V.d.cts → vfs-BGmsy47f.d.cts} +36 -52
- package/dist/{vfs-Bl84Hw2V.d.ts → vfs-BGmsy47f.d.ts} +36 -52
- package/package.json +8 -8
|
@@ -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
|
|
7
|
-
declare const __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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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) =>
|
|
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
|
-
*
|
|
358
|
+
* Formats a path to match the virtual file system (VFS) structure.
|
|
350
359
|
*
|
|
351
|
-
* @
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
|
7
|
-
declare const __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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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) =>
|
|
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
|
-
*
|
|
358
|
+
* Formats a path to match the virtual file system (VFS) structure.
|
|
350
359
|
*
|
|
351
|
-
* @
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
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.
|
|
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.
|
|
134
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
135
|
-
"@powerlines/plugin-env": "^0.13.
|
|
136
|
-
"@powerlines/plugin-plugin": "^0.11.
|
|
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.
|
|
139
|
+
"powerlines": "^0.21.0"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
|
-
"@powerlines/nx": "^0.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": "
|
|
147
|
+
"gitHead": "c6ed2ca745c8f340a55758b3102933dc41e83428"
|
|
148
148
|
}
|