@powerlines/plugin-capnp 0.1.79 → 0.1.81

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.
@@ -5,10 +5,10 @@ import { PluginContext } from "./context.cjs";
5
5
  import { Plugin } from "./plugin.cjs";
6
6
  import { MaybePromise } from "@stryke/types/base";
7
7
  import { PreviewOptions } from "vite";
8
+ import { TypeDefinitionParameter } from "@stryke/types/configuration";
8
9
  import { Format } from "@storm-software/build-tools/types";
9
10
  import { LogLevelLabel } from "@storm-software/config-tools/types";
10
11
  import { StormWorkspaceConfig } from "@storm-software/config/types";
11
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
12
12
  import { AssetGlob } from "@stryke/types/file";
13
13
 
14
14
  //#region ../powerlines/src/types/config.d.ts
@@ -7,9 +7,9 @@ import { Plugin } from "./plugin.mjs";
7
7
  import { LogLevelLabel } from "@storm-software/config-tools/types";
8
8
  import { MaybePromise } from "@stryke/types/base";
9
9
  import { PreviewOptions } from "vite";
10
+ import { TypeDefinitionParameter } from "@stryke/types/configuration";
10
11
  import { Format } from "@storm-software/build-tools/types";
11
12
  import { StormWorkspaceConfig } from "@storm-software/config/types";
12
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
13
13
  import { AssetGlob } from "@stryke/types/file";
14
14
 
15
15
  //#region ../powerlines/src/types/config.d.ts
@@ -1,4 +1,4 @@
1
- import { ResolveOptions, VirtualFile, VirtualFileSystemInterface } from "./fs.cjs";
1
+ import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.cjs";
2
2
  import { ParsedTypeScriptConfig } from "./tsconfig.cjs";
3
3
  import { InlineConfig, LogFn, UserConfig, WorkspaceConfig } from "./config.cjs";
4
4
  import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.cjs";
@@ -6,6 +6,7 @@ import { NonUndefined } from "@stryke/types/base";
6
6
  import { ExternalIdResult, UnpluginBuildContext, UnpluginContext, UnpluginMessage } from "unplugin";
7
7
  import { EnvPaths } from "@stryke/env/get-env-paths";
8
8
  import { FetchRequestOptions } from "@stryke/http/fetch";
9
+ import { TypeDefinition } from "@stryke/types/configuration";
9
10
  import { PackageJson } from "@stryke/types/package-json";
10
11
  import { Jiti } from "jiti";
11
12
  import { SourceMap } from "magic-string";
@@ -69,6 +70,15 @@ interface ParseOptions extends ParserOptions {
69
70
  */
70
71
  allowReturnOutsideFunction?: boolean;
71
72
  }
73
+ interface EmitEntryOptions extends WriteOptions {
74
+ /**
75
+ * The export name of the type definition in the file being emitted
76
+ *
77
+ * @remarks
78
+ * If no value is provided, we will attempt to infer the type definition from the module's `default` export.
79
+ */
80
+ name?: TypeDefinition["name"];
81
+ }
72
82
  /**
73
83
  * The unresolved Powerlines context.
74
84
  *
@@ -285,15 +295,17 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
285
295
  * @param code - The source code of the builtin file
286
296
  * @param id - The unique identifier of the builtin file
287
297
  * @param path - An optional path to write the builtin file to
298
+ * @param options - Additional options for writing the builtin file
288
299
  */
289
- emitBuiltin: (code: string, id: string, path?: string) => Promise<void>;
300
+ emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
290
301
  /**
291
302
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
292
303
  *
293
304
  * @param code - The source code of the entry file
294
305
  * @param path - An optional path to write the entry file to
306
+ * @param options - Additional options for writing the entry file
295
307
  */
296
- emitEntry: (code: string, path: string) => Promise<void>;
308
+ emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
297
309
  /**
298
310
  * A function to update the context fields using a new user configuration options
299
311
  */
@@ -1,4 +1,4 @@
1
- import { ResolveOptions, VirtualFile, VirtualFileSystemInterface } from "./fs.mjs";
1
+ import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
2
2
  import { ParsedTypeScriptConfig } from "./tsconfig.mjs";
3
3
  import { InlineConfig, LogFn, UserConfig, WorkspaceConfig } from "./config.mjs";
4
4
  import "./hooks.mjs";
@@ -8,6 +8,7 @@ import { NonUndefined } from "@stryke/types/base";
8
8
  import { ExternalIdResult, UnpluginBuildContext, UnpluginContext, UnpluginMessage } from "unplugin";
9
9
  import { EnvPaths } from "@stryke/env/get-env-paths";
10
10
  import { FetchRequestOptions } from "@stryke/http/fetch";
11
+ import { TypeDefinition } from "@stryke/types/configuration";
11
12
  import { PackageJson } from "@stryke/types/package-json";
12
13
  import { Jiti } from "jiti";
13
14
  import { SourceMap } from "magic-string";
@@ -71,6 +72,15 @@ interface ParseOptions extends ParserOptions {
71
72
  */
72
73
  allowReturnOutsideFunction?: boolean;
73
74
  }
75
+ interface EmitEntryOptions extends WriteOptions {
76
+ /**
77
+ * The export name of the type definition in the file being emitted
78
+ *
79
+ * @remarks
80
+ * If no value is provided, we will attempt to infer the type definition from the module's `default` export.
81
+ */
82
+ name?: TypeDefinition["name"];
83
+ }
74
84
  /**
75
85
  * The unresolved Powerlines context.
76
86
  *
@@ -287,15 +297,17 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
287
297
  * @param code - The source code of the builtin file
288
298
  * @param id - The unique identifier of the builtin file
289
299
  * @param path - An optional path to write the builtin file to
300
+ * @param options - Additional options for writing the builtin file
290
301
  */
291
- emitBuiltin: (code: string, id: string, path?: string) => Promise<void>;
302
+ emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
292
303
  /**
293
304
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
294
305
  *
295
306
  * @param code - The source code of the entry file
296
307
  * @param path - An optional path to write the entry file to
308
+ * @param options - Additional options for writing the entry file
297
309
  */
298
- emitEntry: (code: string, path: string) => Promise<void>;
310
+ emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
299
311
  /**
300
312
  * A function to update the context fields using a new user configuration options
301
313
  */
@@ -210,7 +210,7 @@ interface WriteOptions {
210
210
  /**
211
211
  * Additional metadata for the file.
212
212
  */
213
- meta?: VirtualFileMetadata;
213
+ meta?: Partial<VirtualFileMetadata>;
214
214
  }
215
215
  interface ResolveOptions$1 extends ResolveOptions {
216
216
  /**
@@ -455,4 +455,4 @@ interface VirtualFileSystemInterface {
455
455
  dispose: () => Promise<void>;
456
456
  }
457
457
  //#endregion
458
- export { ResolveOptions$1 as ResolveOptions, StoragePort, StoragePreset, VirtualFile, VirtualFileSystemInterface };
458
+ export { ResolveOptions$1 as ResolveOptions, StoragePort, StoragePreset, VirtualFile, VirtualFileSystemInterface, WriteOptions };
@@ -210,7 +210,7 @@ interface WriteOptions {
210
210
  /**
211
211
  * Additional metadata for the file.
212
212
  */
213
- meta?: VirtualFileMetadata;
213
+ meta?: Partial<VirtualFileMetadata>;
214
214
  }
215
215
  interface ResolveOptions$1 extends ResolveOptions {
216
216
  /**
@@ -455,4 +455,4 @@ interface VirtualFileSystemInterface {
455
455
  dispose: () => Promise<void>;
456
456
  }
457
457
  //#endregion
458
- export { ResolveOptions$1 as ResolveOptions, StoragePort, StoragePreset, VirtualFile, VirtualFileSystemInterface };
458
+ export { ResolveOptions$1 as ResolveOptions, StoragePort, StoragePreset, VirtualFile, VirtualFileSystemInterface, WriteOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-capnp",
3
- "version": "0.1.79",
3
+ "version": "0.1.81",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from Cap'n Proto schemas.",
6
6
  "repository": {
@@ -117,19 +117,19 @@
117
117
  "files": ["dist/**/*"],
118
118
  "keywords": ["capnp", "powerlines", "storm-software", "powerlines-plugin"],
119
119
  "dependencies": {
120
- "@stryke/capnp": "^0.12.49",
121
- "@stryke/path": "^0.23.1",
120
+ "@stryke/capnp": "^0.12.50",
121
+ "@stryke/path": "^0.23.2",
122
122
  "@stryke/type-checks": "^0.5.13",
123
123
  "@stryke/types": "^0.10.27",
124
124
  "defu": "^6.1.4",
125
125
  "jiti": "^2.6.1",
126
- "powerlines": "^0.32.7"
126
+ "powerlines": "^0.33.0"
127
127
  },
128
128
  "devDependencies": {
129
- "@powerlines/nx": "^0.11.8",
130
- "@powerlines/plugin-plugin": "^0.12.29",
129
+ "@powerlines/nx": "^0.11.10",
130
+ "@powerlines/plugin-plugin": "^0.12.31",
131
131
  "@types/node": "^24.10.4"
132
132
  },
133
133
  "publishConfig": { "access": "public" },
134
- "gitHead": "b8a79bec8bf3c14bbd3b24a4becd8ce3a32891f4"
134
+ "gitHead": "bff4c5f6ffeb46bd4a985858b841ab1fde64c28f"
135
135
  }