@powerlines/plugin-date 0.12.87 → 0.12.88

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.
@@ -6,11 +6,11 @@ import { PluginContext } from "./context.cjs";
6
6
  import { Plugin } from "./plugin.cjs";
7
7
  import { MaybePromise } from "@stryke/types/base";
8
8
  import { PreviewOptions } from "vite";
9
+ import { TypeDefinitionParameter } from "@stryke/types/configuration";
9
10
  import { transformAsync } from "@babel/core";
10
11
  import { Format } from "@storm-software/build-tools/types";
11
12
  import { LogLevelLabel } from "@storm-software/config-tools/types";
12
13
  import { StormWorkspaceConfig } from "@storm-software/config/types";
13
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
14
14
  import { AssetGlob } from "@stryke/types/file";
15
15
 
16
16
  //#region ../powerlines/src/types/config.d.ts
@@ -9,9 +9,9 @@ import { transformAsync } from "@babel/core";
9
9
  import "c12";
10
10
  import { MaybePromise } from "@stryke/types/base";
11
11
  import { PreviewOptions } from "vite";
12
+ import { TypeDefinitionParameter } from "@stryke/types/configuration";
12
13
  import { Format } from "@storm-software/build-tools/types";
13
14
  import { StormWorkspaceConfig } from "@storm-software/config/types";
14
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
15
15
  import { AssetGlob } from "@stryke/types/file";
16
16
 
17
17
  //#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";
@@ -80,6 +81,15 @@ interface ParseOptions extends ParserOptions {
80
81
  */
81
82
  allowReturnOutsideFunction?: boolean;
82
83
  }
84
+ interface EmitEntryOptions extends WriteOptions {
85
+ /**
86
+ * The export name of the type definition in the file being emitted
87
+ *
88
+ * @remarks
89
+ * If no value is provided, we will attempt to infer the type definition from the module's `default` export.
90
+ */
91
+ name?: TypeDefinition["name"];
92
+ }
83
93
  /**
84
94
  * The unresolved Powerlines context.
85
95
  *
@@ -296,15 +306,17 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
296
306
  * @param code - The source code of the builtin file
297
307
  * @param id - The unique identifier of the builtin file
298
308
  * @param path - An optional path to write the builtin file to
309
+ * @param options - Additional options for writing the builtin file
299
310
  */
300
- emitBuiltin: (code: string, id: string, path?: string) => Promise<void>;
311
+ emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
301
312
  /**
302
313
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
303
314
  *
304
315
  * @param code - The source code of the entry file
305
316
  * @param path - An optional path to write the entry file to
317
+ * @param options - Additional options for writing the entry file
306
318
  */
307
- emitEntry: (code: string, path: string) => Promise<void>;
319
+ emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
308
320
  /**
309
321
  * A function to update the context fields using a new user configuration options
310
322
  */
@@ -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";
@@ -82,6 +83,15 @@ interface ParseOptions extends ParserOptions {
82
83
  */
83
84
  allowReturnOutsideFunction?: boolean;
84
85
  }
86
+ interface EmitEntryOptions extends WriteOptions {
87
+ /**
88
+ * The export name of the type definition in the file being emitted
89
+ *
90
+ * @remarks
91
+ * If no value is provided, we will attempt to infer the type definition from the module's `default` export.
92
+ */
93
+ name?: TypeDefinition["name"];
94
+ }
85
95
  /**
86
96
  * The unresolved Powerlines context.
87
97
  *
@@ -298,15 +308,17 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
298
308
  * @param code - The source code of the builtin file
299
309
  * @param id - The unique identifier of the builtin file
300
310
  * @param path - An optional path to write the builtin file to
311
+ * @param options - Additional options for writing the builtin file
301
312
  */
302
- emitBuiltin: (code: string, id: string, path?: string) => Promise<void>;
313
+ emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
303
314
  /**
304
315
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
305
316
  *
306
317
  * @param code - The source code of the entry file
307
318
  * @param path - An optional path to write the entry file to
319
+ * @param options - Additional options for writing the entry file
308
320
  */
309
- emitEntry: (code: string, path: string) => Promise<void>;
321
+ emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
310
322
  /**
311
323
  * A function to update the context fields using a new user configuration options
312
324
  */
@@ -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-date",
3
- "version": "0.12.87",
3
+ "version": "0.12.88",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
6
6
  "repository": {
@@ -128,12 +128,15 @@
128
128
  "files": ["dist/**/*"],
129
129
  "keywords": ["powerlines", "storm-software", "powerlines-plugin"],
130
130
  "dependencies": {
131
- "@powerlines/plugin-env": "^0.13.84",
131
+ "@powerlines/plugin-env": "^0.13.85",
132
132
  "@storm-software/config-tools": "^1.188.73",
133
133
  "@stryke/path": "^0.23.2",
134
- "powerlines": "^0.32.8"
134
+ "powerlines": "^0.33.0"
135
+ },
136
+ "devDependencies": {
137
+ "@powerlines/nx": "^0.11.10",
138
+ "@types/node": "^24.10.4"
135
139
  },
136
- "devDependencies": { "@powerlines/nx": "^0.11.9", "@types/node": "^24.10.4" },
137
140
  "publishConfig": { "access": "public" },
138
- "gitHead": "c60c10150a8013808fb4582b3cc3aef878860c0b"
141
+ "gitHead": "bff4c5f6ffeb46bd4a985858b841ab1fde64c28f"
139
142
  }