@powerlines/plugin-content-collections 0.1.78 → 0.1.80

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,9 @@
1
- import { ResolveOptions, VirtualFile, VirtualFileSystemInterface } from "./fs.cjs";
1
+ import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.cjs";
2
2
  import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.cjs";
3
3
  import { ParsedTypeScriptConfig } from "./tsconfig.cjs";
4
4
  import { InlineConfig, LogFn, UserConfig, WorkspaceConfig } from "./config.cjs";
5
5
  import { NonUndefined } from "@stryke/types/base";
6
+ import { TypeDefinition } from "@stryke/types/configuration";
6
7
  import { EnvPaths } from "@stryke/env/get-env-paths";
7
8
  import { FetchRequestOptions } from "@stryke/http/fetch";
8
9
  import { PackageJson } from "@stryke/types/package-json";
@@ -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,8 +1,9 @@
1
- import { ResolveOptions, VirtualFile, VirtualFileSystemInterface } from "./fs.mjs";
1
+ import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
2
2
  import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.mjs";
3
3
  import { ParsedTypeScriptConfig } from "./tsconfig.mjs";
4
4
  import { InlineConfig, LogFn, UserConfig, WorkspaceConfig } from "./config.mjs";
5
5
  import { NonUndefined } from "@stryke/types/base";
6
+ import { TypeDefinition } from "@stryke/types/configuration";
6
7
  import { EnvPaths } from "@stryke/env/get-env-paths";
7
8
  import { FetchRequestOptions } from "@stryke/http/fetch";
8
9
  import { PackageJson } from "@stryke/types/package-json";
@@ -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
  */
@@ -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-content-collections",
3
- "version": "0.1.78",
3
+ "version": "0.1.80",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code using Content Collections.",
6
6
  "repository": {
@@ -130,15 +130,15 @@
130
130
  "@stryke/types": "^0.10.27",
131
131
  "defu": "^6.1.4",
132
132
  "pluralize": "^8.0.0",
133
- "powerlines": "^0.32.8"
133
+ "powerlines": "^0.33.1"
134
134
  },
135
135
  "devDependencies": {
136
- "@powerlines/nx": "^0.11.9",
137
- "@powerlines/plugin-plugin": "^0.12.30",
136
+ "@powerlines/nx": "^0.11.11",
137
+ "@powerlines/plugin-plugin": "^0.12.32",
138
138
  "@standard-schema/spec": "^1.1.0",
139
139
  "@types/node": "^24.10.4",
140
140
  "@types/pluralize": "^0.0.33"
141
141
  },
142
142
  "publishConfig": { "access": "public" },
143
- "gitHead": "c60c10150a8013808fb4582b3cc3aef878860c0b"
143
+ "gitHead": "62d69003529024ae533a5885904fa16dce400a57"
144
144
  }