@absolutejs/absolute 0.19.0-beta.672 → 0.19.0-beta.674
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/cli/index.js +84 -28
- package/dist/index.js +65 -12
- package/dist/index.js.map +4 -4
- package/dist/src/utils/defineConfig.d.ts +16 -2
- package/dist/src/utils/loadConfig.d.ts +5 -1
- package/dist/types/build.d.ts +4 -3
- package/package.json +1 -1
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { AbsoluteServiceConfig, CommandServiceConfig, ConfigInput, ReservedConfigKey } from '../../types/build';
|
|
2
|
+
type ServiceName<TConfig> = Extract<keyof TConfig, string>;
|
|
3
|
+
type HasReservedConfigKeys<TConfig> = Extract<ServiceName<TConfig>, ReservedConfigKey> extends never ? false : true;
|
|
4
|
+
type ServiceDependsOn<TConfig, TSelf extends string> = readonly Exclude<ServiceName<TConfig>, TSelf>[];
|
|
5
|
+
type TypedAbsoluteServiceConfig<TConfig, TSelf extends string> = Omit<AbsoluteServiceConfig, 'dependsOn'> & {
|
|
6
|
+
dependsOn?: ServiceDependsOn<TConfig, TSelf>;
|
|
7
|
+
};
|
|
8
|
+
type TypedCommandServiceConfig<TConfig, TSelf extends string> = Omit<CommandServiceConfig, 'dependsOn'> & {
|
|
9
|
+
dependsOn?: ServiceDependsOn<TConfig, TSelf>;
|
|
10
|
+
};
|
|
11
|
+
type TypedWorkspaceConfig<TConfig extends Record<string, unknown>> = {
|
|
12
|
+
[K in keyof TConfig]: K extends string ? TypedAbsoluteServiceConfig<TConfig, K> | TypedCommandServiceConfig<TConfig, K> : never;
|
|
13
|
+
};
|
|
14
|
+
type ValidateConfig<TConfig extends Record<string, unknown>> = HasReservedConfigKeys<TConfig> extends true ? TConfig extends AbsoluteServiceConfig ? TConfig : never : TypedWorkspaceConfig<TConfig>;
|
|
15
|
+
export declare const defineConfig: <const TConfig extends Record<string, unknown>>(config: TConfig & ValidateConfig<TConfig>) => TConfig & ConfigInput;
|
|
16
|
+
export {};
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import type { BuildConfig } from '../../types/build';
|
|
1
|
+
import type { BuildConfig, ConfigInput, WorkspaceConfig } from '../../types/build';
|
|
2
|
+
declare const isWorkspaceConfig: (config: ConfigInput) => config is WorkspaceConfig;
|
|
3
|
+
declare const getWorkspaceServices: (config: ConfigInput) => WorkspaceConfig;
|
|
4
|
+
export declare const loadRawConfig: (configPath?: string) => Promise<ConfigInput>;
|
|
2
5
|
export declare const loadConfig: (configPath?: string) => Promise<BuildConfig>;
|
|
6
|
+
export { getWorkspaceServices, isWorkspaceConfig };
|
package/dist/types/build.d.ts
CHANGED
|
@@ -90,9 +90,10 @@ export type CommandServiceConfig = {
|
|
|
90
90
|
config?: never;
|
|
91
91
|
};
|
|
92
92
|
export type ServiceConfig = AbsoluteServiceConfig | CommandServiceConfig;
|
|
93
|
-
export type
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
export type WorkspaceConfig = Record<string, ServiceConfig>;
|
|
94
|
+
export type BuildConfig = AbsoluteServiceConfig;
|
|
95
|
+
export type ConfigInput = BuildConfig | WorkspaceConfig;
|
|
96
|
+
export type ReservedConfigKey = keyof BuildConfig;
|
|
96
97
|
export type BuildResult = ReturnType<typeof build>;
|
|
97
98
|
export type DevBuildResult = ReturnType<typeof devBuild>;
|
|
98
99
|
export type Result = BuildResult | DevBuildResult;
|
package/package.json
CHANGED