@powerlines/plugin-react 0.1.121 → 0.1.123

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.
Files changed (110) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +37 -1
  2. package/dist/_virtual/rolldown_runtime.mjs +29 -1
  3. package/dist/components/index.cjs +3 -1
  4. package/dist/components/index.mjs +3 -1
  5. package/dist/components/react-optimized.cjs +45 -1
  6. package/dist/components/react-optimized.d.cts +2 -1
  7. package/dist/components/react-optimized.mjs +43 -1
  8. package/dist/deepkit/schemas/reflection.cjs +3940 -1
  9. package/dist/deepkit/schemas/reflection.mjs +3938 -1
  10. package/dist/deepkit/schemas/reflection2.cjs +4112 -1
  11. package/dist/deepkit/schemas/reflection2.mjs +4110 -1
  12. package/dist/deepkit/src/capnp.cjs +913 -1
  13. package/dist/deepkit/src/capnp.mjs +911 -1
  14. package/dist/deepkit/src/esbuild-plugin.cjs +47 -4
  15. package/dist/deepkit/src/esbuild-plugin.mjs +46 -4
  16. package/dist/deepkit/src/reflect-type.cjs +22 -1
  17. package/dist/deepkit/src/reflect-type.mjs +20 -1
  18. package/dist/deepkit/src/resolve-reflections.cjs +16 -1
  19. package/dist/deepkit/src/resolve-reflections.mjs +15 -1
  20. package/dist/deepkit/src/transformer.cjs +52 -1
  21. package/dist/deepkit/src/transformer.mjs +49 -1
  22. package/dist/deepkit/src/transpile.cjs +29 -1
  23. package/dist/deepkit/src/transpile.mjs +27 -1
  24. package/dist/deepkit/src/utilities.cjs +66 -1
  25. package/dist/deepkit/src/utilities.mjs +65 -1
  26. package/dist/deepkit/src/vendor/type-compiler/index.cjs +38 -1
  27. package/dist/deepkit/src/vendor/type-compiler/index.mjs +19 -1
  28. package/dist/deepkit/src/vendor/type.cjs +20 -1
  29. package/dist/deepkit/src/vendor/type.mjs +11 -1
  30. package/dist/index.cjs +104 -1
  31. package/dist/index.mjs +98 -1
  32. package/dist/plugin-alloy/src/core/components/output.cjs +45 -1
  33. package/dist/plugin-alloy/src/core/components/output.mjs +44 -1
  34. package/dist/plugin-alloy/src/core/contexts/context.cjs +11 -1
  35. package/dist/plugin-alloy/src/core/contexts/context.mjs +10 -1
  36. package/dist/plugin-alloy/src/index.cjs +93 -2
  37. package/dist/plugin-alloy/src/index.mjs +91 -2
  38. package/dist/plugin-alloy/src/types/components.d.mts +1 -1
  39. package/dist/plugin-alloy/src/types/plugin.d.cts +1 -0
  40. package/dist/plugin-alloy/src/types/plugin.d.mts +3 -3
  41. package/dist/plugin-automd/src/index.cjs +101 -1
  42. package/dist/plugin-automd/src/index.mjs +98 -1
  43. package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -1
  44. package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -1
  45. package/dist/plugin-babel/src/helpers/create-plugin.cjs +41 -1
  46. package/dist/plugin-babel/src/helpers/create-plugin.mjs +39 -1
  47. package/dist/plugin-babel/src/helpers/filters.cjs +23 -1
  48. package/dist/plugin-babel/src/helpers/filters.mjs +21 -1
  49. package/dist/plugin-babel/src/helpers/index.cjs +5 -1
  50. package/dist/plugin-babel/src/helpers/index.mjs +7 -1
  51. package/dist/plugin-babel/src/helpers/module-helpers.cjs +38 -1
  52. package/dist/plugin-babel/src/helpers/module-helpers.mjs +35 -1
  53. package/dist/plugin-babel/src/helpers/options.cjs +50 -1
  54. package/dist/plugin-babel/src/helpers/options.mjs +47 -1
  55. package/dist/plugin-babel/src/index.cjs +91 -1
  56. package/dist/plugin-babel/src/index.mjs +89 -1
  57. package/dist/plugin-env/src/babel/index.cjs +1 -1
  58. package/dist/plugin-env/src/babel/index.mjs +3 -1
  59. package/dist/plugin-env/src/babel/plugin.cjs +120 -4
  60. package/dist/plugin-env/src/babel/plugin.mjs +118 -4
  61. package/dist/plugin-env/src/components/docs.cjs +9 -1
  62. package/dist/plugin-env/src/components/docs.mjs +11 -1
  63. package/dist/plugin-env/src/components/env.cjs +432 -11
  64. package/dist/plugin-env/src/components/env.mjs +430 -9
  65. package/dist/plugin-env/src/components/index.cjs +2 -1
  66. package/dist/plugin-env/src/components/index.mjs +4 -1
  67. package/dist/plugin-env/src/helpers/automd-generator.cjs +22 -1
  68. package/dist/plugin-env/src/helpers/automd-generator.mjs +21 -1
  69. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +55 -1
  70. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +54 -1
  71. package/dist/plugin-env/src/helpers/index.cjs +6 -1
  72. package/dist/plugin-env/src/helpers/index.mjs +8 -1
  73. package/dist/plugin-env/src/helpers/load.cjs +83 -1
  74. package/dist/plugin-env/src/helpers/load.mjs +80 -1
  75. package/dist/plugin-env/src/helpers/persistence.cjs +200 -1
  76. package/dist/plugin-env/src/helpers/persistence.mjs +189 -1
  77. package/dist/plugin-env/src/helpers/reflect.cjs +111 -1
  78. package/dist/plugin-env/src/helpers/reflect.mjs +103 -1
  79. package/dist/plugin-env/src/helpers/source-file-env.cjs +24 -1
  80. package/dist/plugin-env/src/helpers/source-file-env.mjs +23 -1
  81. package/dist/plugin-env/src/helpers/template-helpers.cjs +2 -1
  82. package/dist/plugin-env/src/helpers/template-helpers.mjs +4 -1
  83. package/dist/plugin-env/src/index.cjs +170 -5
  84. package/dist/plugin-env/src/index.mjs +168 -5
  85. package/dist/plugin-env/src/types/plugin.d.cts +1 -0
  86. package/dist/powerlines/src/lib/build/esbuild.cjs +102 -14
  87. package/dist/powerlines/src/lib/build/esbuild.mjs +100 -14
  88. package/dist/powerlines/src/lib/entry.cjs +12 -1
  89. package/dist/powerlines/src/lib/entry.mjs +14 -1
  90. package/dist/powerlines/src/lib/logger.cjs +41 -1
  91. package/dist/powerlines/src/lib/logger.mjs +39 -1
  92. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +38 -1
  93. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +35 -1
  94. package/dist/powerlines/src/lib/utilities/bundle.cjs +35 -1
  95. package/dist/powerlines/src/lib/utilities/bundle.mjs +34 -1
  96. package/dist/powerlines/src/lib/utilities/resolve.cjs +30 -1
  97. package/dist/powerlines/src/lib/utilities/resolve.mjs +29 -1
  98. package/dist/powerlines/src/plugin-utils/paths.cjs +1 -1
  99. package/dist/powerlines/src/plugin-utils/paths.mjs +3 -1
  100. package/dist/powerlines/src/types/context.d.cts +43 -2
  101. package/dist/powerlines/src/types/context.d.mts +43 -2
  102. package/dist/powerlines/src/types/fs.d.cts +14 -0
  103. package/dist/powerlines/src/types/fs.d.mts +14 -0
  104. package/dist/types/index.mjs +1 -1
  105. package/dist/types/plugin.mjs +1 -1
  106. package/dist/types/runtime.mjs +1 -1
  107. package/package.json +10 -10
  108. package/dist/plugin-alloy/src/vendor/index.cjs +0 -1
  109. package/dist/plugin-alloy/src/vendor/index.d.mts +0 -7
  110. package/dist/plugin-alloy/src/vendor/index.mjs +0 -1
@@ -1 +1,35 @@
1
- import e from"defu";import{appendPath as t}from"@stryke/path/append";import{joinPaths as n}from"@stryke/path/join-paths";import{existsSync as r}from"@stryke/fs/exists";import i from"typescript";import"@stryke/fs/json";function a(e,t,n=[`.ts`,`.tsx`,`.d.ts`]){return t.find(t=>e?.toString().toLowerCase()===t?.toString().toLowerCase()||e?.toString().toLowerCase()===`./${t?.toString().toLowerCase()}`||`./${e?.toString().toLowerCase()}`===t?.toString().toLowerCase()||n.some(n=>`${e?.toString().toLowerCase()}${n}`===t?.toString().toLowerCase()||`${e?.toString().toLowerCase()}${n}`==`./${t?.toString().toLowerCase()}`||`${t?.toString().toLowerCase()}${n}`==`./${e?.toString().toLowerCase()}`||e?.toString().toLowerCase()===`${t?.toString().toLowerCase()}${n}`||e?.toString().toLowerCase()===`./${t?.toString().toLowerCase()}${n}`||t?.toString().toLowerCase()===`./${e?.toString().toLowerCase()}${n}`))}function o(e,t){return a(e,t)!==void 0}export{o as isMatchFound};
1
+ import defu from "defu";
2
+ import { appendPath } from "@stryke/path/append";
3
+ import { joinPaths } from "@stryke/path/join-paths";
4
+ import { existsSync } from "@stryke/fs/exists";
5
+ import ts from "typescript";
6
+ import "@stryke/fs/json";
7
+
8
+ //#region ../powerlines/src/lib/typescript/tsconfig.ts
9
+ /**
10
+ * Check if the TypeScript configuration type matches any of the provided types.
11
+ *
12
+ * @param tsconfigType - The type from the TypeScript configuration.
13
+ * @param types - An array of type names to check against.
14
+ * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
15
+ */
16
+ function findMatch(tsconfigType, types, extensions = [
17
+ ".ts",
18
+ ".tsx",
19
+ ".d.ts"
20
+ ]) {
21
+ return types.find((type) => tsconfigType?.toString().toLowerCase() === type?.toString().toLowerCase() || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}` || `./${tsconfigType?.toString().toLowerCase()}` === type?.toString().toLowerCase() || extensions.some((ext) => `${tsconfigType?.toString().toLowerCase()}${ext}` === type?.toString().toLowerCase() || `${tsconfigType?.toString().toLowerCase()}${ext}` === `./${type?.toString().toLowerCase()}` || `${type?.toString().toLowerCase()}${ext}` === `./${tsconfigType?.toString().toLowerCase()}` || tsconfigType?.toString().toLowerCase() === `${type?.toString().toLowerCase()}${ext}` || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}${ext}` || type?.toString().toLowerCase() === `./${tsconfigType?.toString().toLowerCase()}${ext}`));
22
+ }
23
+ /**
24
+ * Check if the TypeScript configuration type matches any of the provided types.
25
+ *
26
+ * @param tsconfigType - The type from the TypeScript configuration.
27
+ * @param types - An array of type names to check against.
28
+ * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
29
+ */
30
+ function isMatchFound(tsconfigType, types) {
31
+ return findMatch(tsconfigType, types) !== void 0;
32
+ }
33
+
34
+ //#endregion
35
+ export { isMatchFound };
@@ -1 +1,35 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../build/esbuild.cjs`);let n=require(`@storm-software/config-tools/types`),r=require(`esbuild`);async function i(e,i,a={}){let o=await e.fs.resolve(i);if(!o||!e.fs.existsSync(o))throw Error(`Module not found: "${i}". Please check the path and try again.`);let s=await(0,r.build)({...t.extractESBuildConfig(e),entryPoints:[o],write:!1,sourcemap:!1,splitting:!1,treeShaking:!1,bundle:!0,...a});if(s.errors.length>0)throw Error(`Failed to transpile ${i}: ${s.errors.map(e=>e.text).join(`, `)}`);if(s.warnings.length>0&&e.log(n.LogLevelLabel.WARN,`Warnings while transpiling ${i}: ${s.warnings.map(e=>e.text).join(`, `)}`),!s.outputFiles||s.outputFiles.filter(Boolean).length===0)throw Error(`No output files generated for ${i}. Please check the configuration and try again.`);return s.outputFiles.filter(Boolean)[0]}exports.bundle=i;
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_esbuild = require('../build/esbuild.cjs');
3
+ let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
4
+ let esbuild = require("esbuild");
5
+
6
+ //#region ../powerlines/src/lib/utilities/bundle.ts
7
+ /**
8
+ * Bundle a type definition to a module.
9
+ *
10
+ * @param context - The context object containing the environment paths.
11
+ * @param file - The file path to bundle.
12
+ * @param overrides - Optional overrides for the ESBuild configuration.
13
+ * @returns A promise that resolves to the bundled module.
14
+ */
15
+ async function bundle(context, file, overrides = {}) {
16
+ const path = await context.fs.resolve(file);
17
+ if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
18
+ const result = await (0, esbuild.build)({
19
+ ...require_esbuild.extractESBuildConfig(context),
20
+ entryPoints: [path],
21
+ write: false,
22
+ sourcemap: false,
23
+ splitting: false,
24
+ treeShaking: false,
25
+ bundle: true,
26
+ ...overrides
27
+ });
28
+ if (result.errors.length > 0) throw new Error(`Failed to transpile ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
29
+ if (result.warnings.length > 0) context.log(__storm_software_config_tools_types.LogLevelLabel.WARN, `Warnings while transpiling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
30
+ if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
31
+ return result.outputFiles.filter(Boolean)[0];
32
+ }
33
+
34
+ //#endregion
35
+ exports.bundle = bundle;
@@ -1 +1,34 @@
1
- import{extractESBuildConfig as e}from"../build/esbuild.mjs";import{LogLevelLabel as t}from"@storm-software/config-tools/types";import{build as n}from"esbuild";async function r(r,i,a={}){let o=await r.fs.resolve(i);if(!o||!r.fs.existsSync(o))throw Error(`Module not found: "${i}". Please check the path and try again.`);let s=await n({...e(r),entryPoints:[o],write:!1,sourcemap:!1,splitting:!1,treeShaking:!1,bundle:!0,...a});if(s.errors.length>0)throw Error(`Failed to transpile ${i}: ${s.errors.map(e=>e.text).join(`, `)}`);if(s.warnings.length>0&&r.log(t.WARN,`Warnings while transpiling ${i}: ${s.warnings.map(e=>e.text).join(`, `)}`),!s.outputFiles||s.outputFiles.filter(Boolean).length===0)throw Error(`No output files generated for ${i}. Please check the configuration and try again.`);return s.outputFiles.filter(Boolean)[0]}export{r as bundle};
1
+ import { extractESBuildConfig } from "../build/esbuild.mjs";
2
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
3
+ import { build } from "esbuild";
4
+
5
+ //#region ../powerlines/src/lib/utilities/bundle.ts
6
+ /**
7
+ * Bundle a type definition to a module.
8
+ *
9
+ * @param context - The context object containing the environment paths.
10
+ * @param file - The file path to bundle.
11
+ * @param overrides - Optional overrides for the ESBuild configuration.
12
+ * @returns A promise that resolves to the bundled module.
13
+ */
14
+ async function bundle(context, file, overrides = {}) {
15
+ const path = await context.fs.resolve(file);
16
+ if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
17
+ const result = await build({
18
+ ...extractESBuildConfig(context),
19
+ entryPoints: [path],
20
+ write: false,
21
+ sourcemap: false,
22
+ splitting: false,
23
+ treeShaking: false,
24
+ bundle: true,
25
+ ...overrides
26
+ });
27
+ if (result.errors.length > 0) throw new Error(`Failed to transpile ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
28
+ if (result.warnings.length > 0) context.log(LogLevelLabel.WARN, `Warnings while transpiling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
29
+ if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
30
+ return result.outputFiles.filter(Boolean)[0];
31
+ }
32
+
33
+ //#endregion
34
+ export { bundle };
@@ -1 +1,30 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`./bundle.cjs`);let n=require(`@stryke/type-checks/is-set-string`),r=require(`@stryke/convert/parse-type-definition`);async function i(e,i,a={}){let o;o=(0,n.isSetString)(i)?(0,r.parseTypeDefinition)(i):i;let s=await t.bundle(e,o.file,a),c=await e.resolver.evalModule(s.text,{filename:s.path,forceTranspile:!0}),l=o.name;return l||=`default`,c[l]??c[`__Ω${l}`]}exports.resolve=i;
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_bundle = require('./bundle.cjs');
3
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
4
+ let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
5
+
6
+ //#region ../powerlines/src/lib/utilities/resolve.ts
7
+ /**
8
+ * Compiles a type definition to a module.
9
+ *
10
+ * @param context - The context object containing the environment paths.
11
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
12
+ * @param overrides - Optional overrides for the ESBuild configuration.
13
+ * @returns A promise that resolves to the compiled module.
14
+ */
15
+ async function resolve(context, type, overrides = {}) {
16
+ let typeDefinition;
17
+ if ((0, __stryke_type_checks_is_set_string.isSetString)(type)) typeDefinition = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(type);
18
+ else typeDefinition = type;
19
+ const result = await require_bundle.bundle(context, typeDefinition.file, overrides);
20
+ const resolved = await context.resolver.evalModule(result.text, {
21
+ filename: result.path,
22
+ forceTranspile: true
23
+ });
24
+ let exportName = typeDefinition.name;
25
+ if (!exportName) exportName = "default";
26
+ return resolved[exportName] ?? resolved[`__Ω${exportName}`];
27
+ }
28
+
29
+ //#endregion
30
+ exports.resolve = resolve;
@@ -1 +1,29 @@
1
- import{bundle as e}from"./bundle.mjs";import{isSetString as t}from"@stryke/type-checks/is-set-string";import{parseTypeDefinition as n}from"@stryke/convert/parse-type-definition";async function r(r,i,a={}){let o;o=t(i)?n(i):i;let s=await e(r,o.file,a),c=await r.resolver.evalModule(s.text,{filename:s.path,forceTranspile:!0}),l=o.name;return l||=`default`,c[l]??c[`__Ω${l}`]}export{r as resolve};
1
+ import { bundle } from "./bundle.mjs";
2
+ import { isSetString } from "@stryke/type-checks/is-set-string";
3
+ import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
4
+
5
+ //#region ../powerlines/src/lib/utilities/resolve.ts
6
+ /**
7
+ * Compiles a type definition to a module.
8
+ *
9
+ * @param context - The context object containing the environment paths.
10
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
11
+ * @param overrides - Optional overrides for the ESBuild configuration.
12
+ * @returns A promise that resolves to the compiled module.
13
+ */
14
+ async function resolve(context, type, overrides = {}) {
15
+ let typeDefinition;
16
+ if (isSetString(type)) typeDefinition = parseTypeDefinition(type);
17
+ else typeDefinition = type;
18
+ const result = await bundle(context, typeDefinition.file, overrides);
19
+ const resolved = await context.resolver.evalModule(result.text, {
20
+ filename: result.path,
21
+ forceTranspile: true
22
+ });
23
+ let exportName = typeDefinition.name;
24
+ if (!exportName) exportName = "default";
25
+ return resolved[exportName] ?? resolved[`__Ω${exportName}`];
26
+ }
27
+
28
+ //#endregion
29
+ export { resolve };
@@ -1 +1 @@
1
- let e=require(`@stryke/path/replace`);
1
+ let __stryke_path_replace = require("@stryke/path/replace");
@@ -1 +1,3 @@
1
- import{replacePath as e}from"@stryke/path/replace";export{};
1
+ import { replacePath } from "@stryke/path/replace";
2
+
3
+ export { };
@@ -89,10 +89,18 @@ interface ParseOptions extends ParserOptions {
89
89
  */
90
90
  allowReturnOutsideFunction?: boolean;
91
91
  }
92
+ interface EmitOptions extends WriteOptions {
93
+ /**
94
+ * If true, will emit the file using {@link UnpluginBuildContext.emitFile | the bundler's emit function}.
95
+ */
96
+ emitWithBundler?: boolean;
97
+ needsCodeReference?: Parameters<UnpluginBuildContext["emitFile"]>[0]["needsCodeReference"];
98
+ originalFileName?: Parameters<UnpluginBuildContext["emitFile"]>[0]["originalFileName"];
99
+ }
92
100
  /**
93
101
  * Options for emitting entry virtual files
94
102
  */
95
- type EmitEntryOptions = WriteOptions & Omit<ResolvedEntryTypeDefinition, "file">;
103
+ type EmitEntryOptions = EmitOptions & Omit<ResolvedEntryTypeDefinition, "file">;
96
104
  /**
97
105
  * The unresolved Powerlines context.
98
106
  *
@@ -303,6 +311,22 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
303
311
  * The Powerlines builtin virtual files
304
312
  */
305
313
  getBuiltins: () => Promise<VirtualFile[]>;
314
+ /**
315
+ * Resolves a file and writes it to the VFS if it does not already exist
316
+ *
317
+ * @param code - The source code of the file
318
+ * @param path - The path to write the file to
319
+ * @param options - Additional options for writing the file
320
+ */
321
+ emit: (code: string, path: string, options?: EmitOptions) => Promise<void>;
322
+ /**
323
+ * Synchronously resolves a file and writes it to the VFS if it does not already exist
324
+ *
325
+ * @param code - The source code of the file
326
+ * @param path - The path to write the file to
327
+ * @param options - Additional options for writing the file
328
+ */
329
+ emitSync: (code: string, path: string, options?: EmitOptions) => void;
306
330
  /**
307
331
  * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
308
332
  *
@@ -311,7 +335,16 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
311
335
  * @param path - An optional path to write the builtin file to
312
336
  * @param options - Additional options for writing the builtin file
313
337
  */
314
- emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
338
+ emitBuiltin: (code: string, id: string, path?: string, options?: EmitOptions) => Promise<void>;
339
+ /**
340
+ * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
341
+ *
342
+ * @param code - The source code of the builtin file
343
+ * @param id - The unique identifier of the builtin file
344
+ * @param path - An optional path to write the builtin file to
345
+ * @param options - Additional options for writing the builtin file
346
+ */
347
+ emitBuiltinSync: (code: string, id: string, path?: string, options?: EmitOptions) => void;
315
348
  /**
316
349
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
317
350
  *
@@ -320,6 +353,14 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
320
353
  * @param options - Additional options for writing the entry file
321
354
  */
322
355
  emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
356
+ /**
357
+ * Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
358
+ *
359
+ * @param code - The source code of the entry file
360
+ * @param path - An optional path to write the entry file to
361
+ * @param options - Additional options for writing the entry file
362
+ */
363
+ emitEntrySync: (code: string, path: string, options?: EmitEntryOptions) => void;
323
364
  /**
324
365
  * A function to update the context fields using a new user configuration options
325
366
  */
@@ -91,10 +91,18 @@ interface ParseOptions extends ParserOptions {
91
91
  */
92
92
  allowReturnOutsideFunction?: boolean;
93
93
  }
94
+ interface EmitOptions extends WriteOptions {
95
+ /**
96
+ * If true, will emit the file using {@link UnpluginBuildContext.emitFile | the bundler's emit function}.
97
+ */
98
+ emitWithBundler?: boolean;
99
+ needsCodeReference?: Parameters<UnpluginBuildContext["emitFile"]>[0]["needsCodeReference"];
100
+ originalFileName?: Parameters<UnpluginBuildContext["emitFile"]>[0]["originalFileName"];
101
+ }
94
102
  /**
95
103
  * Options for emitting entry virtual files
96
104
  */
97
- type EmitEntryOptions = WriteOptions & Omit<ResolvedEntryTypeDefinition, "file">;
105
+ type EmitEntryOptions = EmitOptions & Omit<ResolvedEntryTypeDefinition, "file">;
98
106
  /**
99
107
  * The unresolved Powerlines context.
100
108
  *
@@ -305,6 +313,22 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
305
313
  * The Powerlines builtin virtual files
306
314
  */
307
315
  getBuiltins: () => Promise<VirtualFile[]>;
316
+ /**
317
+ * Resolves a file and writes it to the VFS if it does not already exist
318
+ *
319
+ * @param code - The source code of the file
320
+ * @param path - The path to write the file to
321
+ * @param options - Additional options for writing the file
322
+ */
323
+ emit: (code: string, path: string, options?: EmitOptions) => Promise<void>;
324
+ /**
325
+ * Synchronously resolves a file and writes it to the VFS if it does not already exist
326
+ *
327
+ * @param code - The source code of the file
328
+ * @param path - The path to write the file to
329
+ * @param options - Additional options for writing the file
330
+ */
331
+ emitSync: (code: string, path: string, options?: EmitOptions) => void;
308
332
  /**
309
333
  * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
310
334
  *
@@ -313,7 +337,16 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
313
337
  * @param path - An optional path to write the builtin file to
314
338
  * @param options - Additional options for writing the builtin file
315
339
  */
316
- emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
340
+ emitBuiltin: (code: string, id: string, path?: string, options?: EmitOptions) => Promise<void>;
341
+ /**
342
+ * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
343
+ *
344
+ * @param code - The source code of the builtin file
345
+ * @param id - The unique identifier of the builtin file
346
+ * @param path - An optional path to write the builtin file to
347
+ * @param options - Additional options for writing the builtin file
348
+ */
349
+ emitBuiltinSync: (code: string, id: string, path?: string, options?: EmitOptions) => void;
317
350
  /**
318
351
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
319
352
  *
@@ -322,6 +355,14 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
322
355
  * @param options - Additional options for writing the entry file
323
356
  */
324
357
  emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
358
+ /**
359
+ * Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
360
+ *
361
+ * @param code - The source code of the entry file
362
+ * @param path - An optional path to write the entry file to
363
+ * @param options - Additional options for writing the entry file
364
+ */
365
+ emitEntrySync: (code: string, path: string, options?: EmitEntryOptions) => void;
325
366
  /**
326
367
  * A function to update the context fields using a new user configuration options
327
368
  */
@@ -13,6 +13,13 @@ interface StorageAdapter {
13
13
  * A name identifying the storage adapter type.
14
14
  */
15
15
  name: string;
16
+ /**
17
+ * The storage preset for the adapter.
18
+ *
19
+ * @remarks
20
+ * This can be used as an alternate way to identify the type of storage being used.
21
+ */
22
+ preset?: StoragePreset | null;
16
23
  /**
17
24
  * Checks if a key exists in the storage.
18
25
  *
@@ -207,6 +214,13 @@ interface WriteOptions {
207
214
  * @defaultValue false
208
215
  */
209
216
  skipFormat?: boolean;
217
+ /**
218
+ * The storage preset or adapter name for the output file.
219
+ *
220
+ * @remarks
221
+ * If not specified, the output mode will be determined by the provided `output.mode` value.
222
+ */
223
+ storage?: StoragePreset | string;
210
224
  /**
211
225
  * Additional metadata for the file.
212
226
  */
@@ -13,6 +13,13 @@ interface StorageAdapter {
13
13
  * A name identifying the storage adapter type.
14
14
  */
15
15
  name: string;
16
+ /**
17
+ * The storage preset for the adapter.
18
+ *
19
+ * @remarks
20
+ * This can be used as an alternate way to identify the type of storage being used.
21
+ */
22
+ preset?: StoragePreset | null;
16
23
  /**
17
24
  * Checks if a key exists in the storage.
18
25
  *
@@ -207,6 +214,13 @@ interface WriteOptions {
207
214
  * @defaultValue false
208
215
  */
209
216
  skipFormat?: boolean;
217
+ /**
218
+ * The storage preset or adapter name for the output file.
219
+ *
220
+ * @remarks
221
+ * If not specified, the output mode will be determined by the provided `output.mode` value.
222
+ */
223
+ storage?: StoragePreset | string;
210
224
  /**
211
225
  * Additional metadata for the file.
212
226
  */
@@ -1 +1 @@
1
- export{};
1
+ export { };
@@ -1 +1 @@
1
- export{};
1
+ export { };
@@ -1 +1 @@
1
- export{};
1
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-react",
3
- "version": "0.1.121",
3
+ "version": "0.1.123",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for building a React application.",
6
6
  "repository": {
@@ -140,18 +140,18 @@
140
140
  "@alloy-js/json": "^0.22.0",
141
141
  "@alloy-js/markdown": "^0.22.0",
142
142
  "@alloy-js/typescript": "^0.22.0",
143
- "@powerlines/plugin-alloy": "^0.16.3",
144
- "@powerlines/plugin-babel": "^0.12.125",
145
- "@powerlines/plugin-env": "^0.14.20",
143
+ "@powerlines/plugin-alloy": "^0.17.1",
144
+ "@powerlines/plugin-babel": "^0.12.127",
145
+ "@powerlines/plugin-env": "^0.14.22",
146
146
  "@storm-software/config-tools": "^1.188.74",
147
- "@stryke/cli": "^0.12.36",
148
- "@stryke/convert": "^0.6.29",
149
- "@stryke/fs": "^0.33.26",
150
- "@stryke/path": "^0.24.0",
147
+ "@stryke/cli": "^0.12.37",
148
+ "@stryke/convert": "^0.6.30",
149
+ "@stryke/fs": "^0.33.27",
150
+ "@stryke/path": "^0.24.1",
151
151
  "@vitejs/plugin-react": "^5.1.2",
152
152
  "babel-plugin-react-compiler": "^1.0.0",
153
153
  "defu": "^6.1.4",
154
- "powerlines": "^0.36.21"
154
+ "powerlines": "^0.36.23"
155
155
  },
156
156
  "devDependencies": {
157
157
  "@babel/core": "^7.28.5",
@@ -162,5 +162,5 @@
162
162
  "react-dom": "^19.2.3"
163
163
  },
164
164
  "publishConfig": { "access": "public" },
165
- "gitHead": "b16324cf857ea5743fd7ad06e18607b1ba32abe0"
165
+ "gitHead": "be47e546b48b9a82e460b5c5d4f02fb66e821f18"
166
166
  }
@@ -1 +0,0 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`);var t={};e.__reExport(t,require(`@alloy-js/core`)),Object.defineProperty(exports,`vendor_exports`,{enumerable:!0,get:function(){return t}});var n=require(`@alloy-js/core`);Object.keys(n).forEach(function(e){e!==`default`&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})});
@@ -1,7 +0,0 @@
1
- export * from "@alloy-js/core";
2
-
3
- //#region ../plugin-alloy/src/vendor/index.d.ts
4
-
5
- import * as import___alloy_js_core from "@alloy-js/core";
6
- //#endregion
7
- export { import___alloy_js_core as index_d_exports };
@@ -1 +0,0 @@
1
- import{__reExport as e}from"../../../_virtual/rolldown_runtime.mjs";export*from"@alloy-js/core";var t={};import*as n from"@alloy-js/core";e(t,n);export{t as vendor_exports};