@powerlines/plugin-tsc 0.2.132 → 0.2.134
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.
- package/dist/index.cjs +1 -0
- package/dist/index.mjs +1 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.cts +47 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +49 -0
- package/dist/powerlines/src/types/api.d.cts +104 -0
- package/dist/powerlines/src/types/api.d.mts +104 -0
- package/dist/powerlines/src/types/build.d.cts +43 -3
- package/dist/powerlines/src/types/build.d.mts +43 -3
- package/dist/powerlines/src/types/config.d.cts +60 -4
- package/dist/powerlines/src/types/config.d.mts +61 -5
- package/dist/powerlines/src/types/context.d.cts +113 -1
- package/dist/powerlines/src/types/context.d.mts +113 -1
- package/dist/powerlines/src/types/hooks.d.cts +32 -0
- package/dist/powerlines/src/types/hooks.d.mts +32 -0
- package/dist/powerlines/src/types/plugin.d.cts +35 -61
- package/dist/powerlines/src/types/plugin.d.mts +35 -61
- package/dist/powerlines/src/types/resolved.d.cts +16 -4
- package/dist/powerlines/src/types/resolved.d.mts +16 -4
- package/dist/powerlines/src/types/unplugin.d.cts +22 -0
- package/dist/powerlines/src/types/unplugin.d.mts +23 -0
- package/package.json +4 -4
- package/dist/powerlines/src/types/babel.d.mts +0 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BuilderVariant } from "./build.cjs";
|
|
2
|
+
import { ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.cjs";
|
|
2
3
|
import { NonUndefined } from "@stryke/types/base";
|
|
3
4
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
4
5
|
import { AssetGlob } from "@stryke/types/file";
|
|
@@ -32,7 +33,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> &
|
|
|
32
33
|
/**
|
|
33
34
|
* The resolved options for the Powerlines project configuration.
|
|
34
35
|
*/
|
|
35
|
-
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
|
|
36
|
+
type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
|
|
36
37
|
/**
|
|
37
38
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
38
39
|
*/
|
|
@@ -67,7 +68,7 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
|
|
|
67
68
|
* Configuration provided to build processes
|
|
68
69
|
*
|
|
69
70
|
* @remarks
|
|
70
|
-
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link
|
|
71
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuilderVariant | build variant}.
|
|
71
72
|
*/
|
|
72
73
|
build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
|
|
73
74
|
/**
|
|
@@ -77,5 +78,16 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
|
|
|
77
78
|
*/
|
|
78
79
|
logLevel: "error" | "warn" | "info" | "debug" | "trace" | null;
|
|
79
80
|
};
|
|
81
|
+
type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
|
|
82
|
+
type WebpackResolvedConfig = ResolvedConfig<WebpackUserConfig>;
|
|
83
|
+
type RspackResolvedConfig = ResolvedConfig<RspackUserConfig>;
|
|
84
|
+
type ESBuildResolvedConfig = ResolvedConfig<ESBuildUserConfig>;
|
|
85
|
+
type RollupResolvedConfig = ResolvedConfig<RollupUserConfig>;
|
|
86
|
+
type RolldownResolvedConfig = ResolvedConfig<RolldownUserConfig>;
|
|
87
|
+
type TsupResolvedConfig = ResolvedConfig<TsupUserConfig>;
|
|
88
|
+
type TsdownResolvedConfig = ResolvedConfig<TsdownUserConfig>;
|
|
89
|
+
type UnbuildResolvedConfig = ResolvedConfig<UnbuildUserConfig>;
|
|
90
|
+
type FarmResolvedConfig = ResolvedConfig<FarmUserConfig>;
|
|
91
|
+
type InferResolvedConfig<TBuildVariant extends BuilderVariant | undefined> = TBuildVariant extends undefined ? ResolvedConfig : TBuildVariant extends "webpack" ? WebpackResolvedConfig : TBuildVariant extends "rspack" ? RspackResolvedConfig : TBuildVariant extends "vite" ? ViteResolvedConfig : TBuildVariant extends "esbuild" ? ESBuildResolvedConfig : TBuildVariant extends "unbuild" ? UnbuildResolvedConfig : TBuildVariant extends "tsup" ? TsupResolvedConfig : TBuildVariant extends "tsdown" ? TsdownResolvedConfig : TBuildVariant extends "rolldown" ? RolldownResolvedConfig : TBuildVariant extends "rollup" ? RollupResolvedConfig : TBuildVariant extends "farm" ? FarmResolvedConfig : ResolvedConfig;
|
|
80
92
|
//#endregion
|
|
81
|
-
export { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition };
|
|
93
|
+
export { EnvironmentResolvedConfig, InferResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BuilderVariant } from "./build.mjs";
|
|
2
|
+
import { ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.mjs";
|
|
2
3
|
import { NonUndefined } from "@stryke/types/base";
|
|
3
4
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
4
5
|
import { AssetGlob } from "@stryke/types/file";
|
|
@@ -32,7 +33,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> &
|
|
|
32
33
|
/**
|
|
33
34
|
* The resolved options for the Powerlines project configuration.
|
|
34
35
|
*/
|
|
35
|
-
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
|
|
36
|
+
type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
|
|
36
37
|
/**
|
|
37
38
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
38
39
|
*/
|
|
@@ -67,7 +68,7 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
|
|
|
67
68
|
* Configuration provided to build processes
|
|
68
69
|
*
|
|
69
70
|
* @remarks
|
|
70
|
-
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link
|
|
71
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuilderVariant | build variant}.
|
|
71
72
|
*/
|
|
72
73
|
build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
|
|
73
74
|
/**
|
|
@@ -77,5 +78,16 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
|
|
|
77
78
|
*/
|
|
78
79
|
logLevel: "error" | "warn" | "info" | "debug" | "trace" | null;
|
|
79
80
|
};
|
|
81
|
+
type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
|
|
82
|
+
type WebpackResolvedConfig = ResolvedConfig<WebpackUserConfig>;
|
|
83
|
+
type RspackResolvedConfig = ResolvedConfig<RspackUserConfig>;
|
|
84
|
+
type ESBuildResolvedConfig = ResolvedConfig<ESBuildUserConfig>;
|
|
85
|
+
type RollupResolvedConfig = ResolvedConfig<RollupUserConfig>;
|
|
86
|
+
type RolldownResolvedConfig = ResolvedConfig<RolldownUserConfig>;
|
|
87
|
+
type TsupResolvedConfig = ResolvedConfig<TsupUserConfig>;
|
|
88
|
+
type TsdownResolvedConfig = ResolvedConfig<TsdownUserConfig>;
|
|
89
|
+
type UnbuildResolvedConfig = ResolvedConfig<UnbuildUserConfig>;
|
|
90
|
+
type FarmResolvedConfig = ResolvedConfig<FarmUserConfig>;
|
|
91
|
+
type InferResolvedConfig<TBuildVariant extends BuilderVariant | undefined> = TBuildVariant extends undefined ? ResolvedConfig : TBuildVariant extends "webpack" ? WebpackResolvedConfig : TBuildVariant extends "rspack" ? RspackResolvedConfig : TBuildVariant extends "vite" ? ViteResolvedConfig : TBuildVariant extends "esbuild" ? ESBuildResolvedConfig : TBuildVariant extends "unbuild" ? UnbuildResolvedConfig : TBuildVariant extends "tsup" ? TsupResolvedConfig : TBuildVariant extends "tsdown" ? TsdownResolvedConfig : TBuildVariant extends "rolldown" ? RolldownResolvedConfig : TBuildVariant extends "rollup" ? RollupResolvedConfig : TBuildVariant extends "farm" ? FarmResolvedConfig : ResolvedConfig;
|
|
80
92
|
//#endregion
|
|
81
|
-
export { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition };
|
|
93
|
+
export { EnvironmentResolvedConfig, InferResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BuilderVariant, InferUnpluginVariant, UnpluginBuilderVariant } from "./build.cjs";
|
|
2
|
+
import { InferResolvedConfig } from "./resolved.cjs";
|
|
3
|
+
import { API } from "./api.cjs";
|
|
4
|
+
import { PluginHook } from "./plugin.cjs";
|
|
5
|
+
import { Context } from "./context.cjs";
|
|
6
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
7
|
+
import { HookFilter, UnpluginOptions } from "unplugin";
|
|
8
|
+
|
|
9
|
+
//#region ../powerlines/src/types/unplugin.d.ts
|
|
10
|
+
interface UnpluginOptions$1<TUnpluginBuilderVariant extends UnpluginBuilderVariant = UnpluginBuilderVariant> extends UnpluginOptions {
|
|
11
|
+
/**
|
|
12
|
+
* An API object that can be used for inter-plugin communication.
|
|
13
|
+
*
|
|
14
|
+
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
15
|
+
*/
|
|
16
|
+
api: API<InferResolvedConfig<TUnpluginBuilderVariant>>;
|
|
17
|
+
}
|
|
18
|
+
type InferUnpluginOptions<TContext extends Context = Context, TBuilderVariant extends BuilderVariant = BuilderVariant, TUnpluginVariant extends InferUnpluginVariant<TBuilderVariant> = InferUnpluginVariant<TBuilderVariant>> = { [TKey in keyof Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant]]?: Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] extends infer THandler | {
|
|
19
|
+
handler: infer THandler;
|
|
20
|
+
} ? THandler extends ((this: infer TOriginalContext, ...args: infer TArgs) => infer TReturn) ? PluginHook<(this: TOriginalContext & TContext, ...args: TArgs) => MaybePromise<TReturn>, keyof HookFilter> : Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] : Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] };
|
|
21
|
+
//#endregion
|
|
22
|
+
export { InferUnpluginOptions };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BuilderVariant, InferUnpluginVariant, UnpluginBuilderVariant } from "./build.mjs";
|
|
2
|
+
import { InferResolvedConfig } from "./resolved.mjs";
|
|
3
|
+
import { API } from "./api.mjs";
|
|
4
|
+
import { PluginHook } from "./plugin.mjs";
|
|
5
|
+
import "./config.mjs";
|
|
6
|
+
import { Context } from "./context.mjs";
|
|
7
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
8
|
+
import { HookFilter, UnpluginOptions } from "unplugin";
|
|
9
|
+
|
|
10
|
+
//#region ../powerlines/src/types/unplugin.d.ts
|
|
11
|
+
interface UnpluginOptions$1<TUnpluginBuilderVariant extends UnpluginBuilderVariant = UnpluginBuilderVariant> extends UnpluginOptions {
|
|
12
|
+
/**
|
|
13
|
+
* An API object that can be used for inter-plugin communication.
|
|
14
|
+
*
|
|
15
|
+
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
16
|
+
*/
|
|
17
|
+
api: API<InferResolvedConfig<TUnpluginBuilderVariant>>;
|
|
18
|
+
}
|
|
19
|
+
type InferUnpluginOptions<TContext extends Context = Context, TBuilderVariant extends BuilderVariant = BuilderVariant, TUnpluginVariant extends InferUnpluginVariant<TBuilderVariant> = InferUnpluginVariant<TBuilderVariant>> = { [TKey in keyof Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant]]?: Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] extends infer THandler | {
|
|
20
|
+
handler: infer THandler;
|
|
21
|
+
} ? THandler extends ((this: infer TOriginalContext, ...args: infer TArgs) => infer TReturn) ? PluginHook<(this: TOriginalContext & TContext, ...args: TArgs) => MaybePromise<TReturn>, keyof HookFilter> : Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] : Required<UnpluginOptions$1<TUnpluginVariant>>[TUnpluginVariant][TKey] };
|
|
22
|
+
//#endregion
|
|
23
|
+
export { InferUnpluginOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-tsc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.134",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing the TypeScript compiler plugin for Powerlines.",
|
|
6
6
|
"repository": {
|
|
@@ -147,13 +147,13 @@
|
|
|
147
147
|
"dependencies": {
|
|
148
148
|
"defu": "^6.1.4",
|
|
149
149
|
"@stryke/path": "^0.24.1",
|
|
150
|
-
"powerlines": "^0.
|
|
150
|
+
"powerlines": "^0.37.0",
|
|
151
151
|
"typescript": "^5.9.3"
|
|
152
152
|
},
|
|
153
153
|
"devDependencies": {
|
|
154
|
-
"@powerlines/nx": "^0.11.
|
|
154
|
+
"@powerlines/nx": "^0.11.56",
|
|
155
155
|
"@types/node": "^24.10.4"
|
|
156
156
|
},
|
|
157
157
|
"publishConfig": { "access": "public" },
|
|
158
|
-
"gitHead": "
|
|
158
|
+
"gitHead": "00141b82214ec2772cec7ec7873aba06f593289b"
|
|
159
159
|
}
|