@powerlines/plugin-unimport 0.1.77 → 0.1.79

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";
@@ -70,6 +71,15 @@ interface ParseOptions extends ParserOptions {
70
71
  */
71
72
  allowReturnOutsideFunction?: boolean;
72
73
  }
74
+ interface EmitEntryOptions extends WriteOptions {
75
+ /**
76
+ * The export name of the type definition in the file being emitted
77
+ *
78
+ * @remarks
79
+ * If no value is provided, we will attempt to infer the type definition from the module's `default` export.
80
+ */
81
+ name?: TypeDefinition["name"];
82
+ }
73
83
  /**
74
84
  * The unresolved Powerlines context.
75
85
  *
@@ -286,15 +296,17 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
286
296
  * @param code - The source code of the builtin file
287
297
  * @param id - The unique identifier of the builtin file
288
298
  * @param path - An optional path to write the builtin file to
299
+ * @param options - Additional options for writing the builtin file
289
300
  */
290
- emitBuiltin: (code: string, id: string, path?: string) => Promise<void>;
301
+ emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
291
302
  /**
292
303
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
293
304
  *
294
305
  * @param code - The source code of the entry file
295
306
  * @param path - An optional path to write the entry file to
307
+ * @param options - Additional options for writing the entry file
296
308
  */
297
- emitEntry: (code: string, path: string) => Promise<void>;
309
+ emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
298
310
  /**
299
311
  * A function to update the context fields using a new user configuration options
300
312
  */
@@ -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";
@@ -9,6 +9,7 @@ import { NonUndefined } from "@stryke/types/base";
9
9
  import { ExternalIdResult, UnpluginBuildContext, UnpluginContext, UnpluginMessage } from "unplugin";
10
10
  import { EnvPaths } from "@stryke/env/get-env-paths";
11
11
  import { FetchRequestOptions } from "@stryke/http/fetch";
12
+ import { TypeDefinition } from "@stryke/types/configuration";
12
13
  import { PackageJson } from "@stryke/types/package-json";
13
14
  import { Jiti } from "jiti";
14
15
  import { SourceMap } from "magic-string";
@@ -72,6 +73,15 @@ interface ParseOptions extends ParserOptions {
72
73
  */
73
74
  allowReturnOutsideFunction?: boolean;
74
75
  }
76
+ interface EmitEntryOptions extends WriteOptions {
77
+ /**
78
+ * The export name of the type definition in the file being emitted
79
+ *
80
+ * @remarks
81
+ * If no value is provided, we will attempt to infer the type definition from the module's `default` export.
82
+ */
83
+ name?: TypeDefinition["name"];
84
+ }
75
85
  /**
76
86
  * The unresolved Powerlines context.
77
87
  *
@@ -288,15 +298,17 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
288
298
  * @param code - The source code of the builtin file
289
299
  * @param id - The unique identifier of the builtin file
290
300
  * @param path - An optional path to write the builtin file to
301
+ * @param options - Additional options for writing the builtin file
291
302
  */
292
- emitBuiltin: (code: string, id: string, path?: string) => Promise<void>;
303
+ emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
293
304
  /**
294
305
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
295
306
  *
296
307
  * @param code - The source code of the entry file
297
308
  * @param path - An optional path to write the entry file to
309
+ * @param options - Additional options for writing the entry file
298
310
  */
299
- emitEntry: (code: string, path: string) => Promise<void>;
311
+ emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
300
312
  /**
301
313
  * A function to update the context fields using a new user configuration options
302
314
  */
@@ -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-unimport",
3
- "version": "0.1.77",
3
+ "version": "0.1.79",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to add imports to source code automatically via unimport.",
6
6
  "repository": {
@@ -117,23 +117,23 @@
117
117
  "files": ["dist/**/*"],
118
118
  "keywords": ["unimport", "powerlines", "storm-software", "powerlines-plugin"],
119
119
  "dependencies": {
120
- "@stryke/path": "^0.23.1",
120
+ "@stryke/path": "^0.23.2",
121
121
  "@stryke/helpers": "^0.9.30",
122
- "@stryke/fs": "^0.33.24",
122
+ "@stryke/fs": "^0.33.25",
123
123
  "@stryke/json": "^0.9.31",
124
124
  "@stryke/type-checks": "^0.5.13",
125
125
  "@stryke/types": "^0.10.27",
126
126
  "defu": "^6.1.4",
127
127
  "jiti": "^2.6.1",
128
128
  "unimport": "^5.6.0",
129
- "powerlines": "^0.32.7",
129
+ "powerlines": "^0.33.0",
130
130
  "magic-string": "^0.30.21"
131
131
  },
132
132
  "devDependencies": {
133
- "@powerlines/nx": "^0.11.8",
134
- "@powerlines/plugin-plugin": "^0.12.29",
133
+ "@powerlines/nx": "^0.11.10",
134
+ "@powerlines/plugin-plugin": "^0.12.31",
135
135
  "@types/node": "^24.10.4"
136
136
  },
137
137
  "publishConfig": { "access": "public" },
138
- "gitHead": "b8a79bec8bf3c14bbd3b24a4becd8ce3a32891f4"
138
+ "gitHead": "bff4c5f6ffeb46bd4a985858b841ab1fde64c28f"
139
139
  }