@dword-design/base 17.0.0 → 17.0.1
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.d.ts +2 -0
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ type PartialConfigObject<TConfig extends Config = Config> = Omit<Partial<TConfig
|
|
|
88
88
|
type PartialConfigOrFunction<TConfig extends Config = Config> = PartialConfigObject<TConfig> | ((base: Base<TConfig>, config?: PartialConfigObject<TConfig>) => PartialConfigObject<TConfig>);
|
|
89
89
|
type PartialConfig<TConfig extends Config = Config> = PartialConfigOrFunction<TConfig> | string | null;
|
|
90
90
|
export declare const defineBaseConfig: <T>(configInput: T) => T;
|
|
91
|
+
declare const run: <TConfig extends Config, K extends keyof TConfig["commands"] & string>(base: Base<TConfig>, name: K, ...arguments_: ArrayTail<Parameters<TConfig["commands"][K]["handler"]>>) => ReturnType<TConfig["commands"][K]["handler"]>;
|
|
91
92
|
declare class Base<TConfig extends Config = Config> {
|
|
92
93
|
config: TConfig;
|
|
93
94
|
packageConfig: PackageJson;
|
|
@@ -290,3 +291,4 @@ export { default as testRaw } from './commands/test-raw';
|
|
|
290
291
|
export { default as testDocker } from './commands/test-docker';
|
|
291
292
|
export { default as verify } from './commands/verify';
|
|
292
293
|
export { default as typecheck } from './commands/typecheck';
|
|
294
|
+
export { run };
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ const mergeConfigs = createDefu((object, key, value) => {
|
|
|
47
47
|
}
|
|
48
48
|
return false;
|
|
49
49
|
});
|
|
50
|
+
const run = (base, name, ...arguments_) => base.config.commands[name].handler.call(base, base, ...arguments_);
|
|
50
51
|
class Base {
|
|
51
52
|
config;
|
|
52
53
|
packageConfig;
|
|
@@ -242,7 +243,7 @@ class Base {
|
|
|
242
243
|
return getLintStaged(this, ...arguments_);
|
|
243
244
|
}
|
|
244
245
|
run(name, ...arguments_) {
|
|
245
|
-
return
|
|
246
|
+
return run(this, name, ...arguments_);
|
|
246
247
|
}
|
|
247
248
|
}
|
|
248
249
|
export { default as loadConfig } from "./load-config/index.js";
|
|
@@ -274,4 +275,5 @@ export { default as prepare } from "./commands/prepare/index.js";
|
|
|
274
275
|
export { default as testRaw } from "./commands/test-raw/index.js";
|
|
275
276
|
export { default as testDocker } from "./commands/test-docker/index.js";
|
|
276
277
|
export { default as verify } from "./commands/verify/index.js";
|
|
277
|
-
export { default as typecheck } from "./commands/typecheck/index.js";
|
|
278
|
+
export { default as typecheck } from "./commands/typecheck/index.js";
|
|
279
|
+
export { run };
|