@dword-design/base 14.1.0 → 14.1.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.
@@ -1,6 +1,6 @@
1
1
  import type { StdoutStderrOptionCommon } from 'execa';
2
2
 
3
- export type CommandOptionsInput = {
3
+ export type PartialCommandOptions = {
4
4
  log?: boolean;
5
5
  stderr?: StdoutStderrOptionCommon<false>;
6
6
  env?: Record<string, string>;
@@ -1,2 +1,2 @@
1
- import type { CommandOptionsInput } from '@/src/commands/command-options-input';
2
- export default function (optionsInput?: CommandOptionsInput): Promise<import("execa").Result<any>>;
1
+ import type { PartialCommandOptions } from '@/src/commands/command-options-input';
2
+ export default function (partialOptions?: PartialCommandOptions): Promise<import("execa").Result<any>>;
@@ -1,10 +1,10 @@
1
1
  import { execaCommand } from "execa";
2
2
  import parsePackagejsonName from "parse-packagejson-name";
3
- export default async function (optionsInput) {
3
+ export default async function (partialOptions) {
4
4
  const options = {
5
5
  log: process.env.NODE_ENV !== "test",
6
6
  stderr: "inherit",
7
- ...optionsInput
7
+ ...partialOptions
8
8
  };
9
9
  this.lintPackagejson();
10
10
  const packageName = parsePackagejsonName(this.packageConfig.name).fullName;
@@ -1,2 +1,2 @@
1
- import type { CommandOptionsInput } from '@/src/commands/command-options-input';
2
- export default function (optionsInput?: CommandOptionsInput): Promise<import("execa").Result<any> | undefined>;
1
+ import type { PartialCommandOptions } from '@/src/commands/command-options-input';
2
+ export default function (partialOptions?: PartialCommandOptions): Promise<import("execa").Result<any> | undefined>;
@@ -2,11 +2,11 @@ import pathLib from "node:path";
2
2
  import { execaCommand } from "execa";
3
3
  import { globby } from "globby";
4
4
  import ts from "typescript";
5
- export default async function (optionsInput) {
5
+ export default async function (partialOptions) {
6
6
  const options = {
7
7
  log: process.env.NODE_ENV !== "test",
8
8
  stderr: "inherit",
9
- ...optionsInput
9
+ ...partialOptions
10
10
  };
11
11
  const {
12
12
  config
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: string;
2
2
  export default _default;
@@ -3,8 +3,8 @@ export default function (): {
3
3
  file: string;
4
4
  };
5
5
  tasks: {
6
- before: any;
7
- init: any;
6
+ before: string;
7
+ init: string;
8
8
  }[];
9
9
  vscode: {
10
10
  extensions: string[];
@@ -1 +1 @@
1
- export default function (): any;
1
+ export default function (): string;
@@ -1 +1 @@
1
- export default function (): any;
1
+ export default function (): string;
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- badges(): any;
2
+ badges(): string;
3
3
  description(): any;
4
4
  install(): any;
5
5
  license(): string;
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: string;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: string;
2
2
  export default _default;
@@ -2,9 +2,9 @@ export default function (): {
2
2
  '.commitlintrc.json': string;
3
3
  '.cz.json': string;
4
4
  '.devcontainer/devcontainer.json': string;
5
- '.editorconfig': any;
6
- '.gitattributes': any;
7
- '.github/DEPRECATED_DEPENDENCIES_ISSUE_TEMPLATE.md': any;
5
+ '.editorconfig': string;
6
+ '.gitattributes': string;
7
+ '.github/DEPRECATED_DEPENDENCIES_ISSUE_TEMPLATE.md': string;
8
8
  '.github/FUNDING.yml': string;
9
9
  '.github/labels.yml': string;
10
10
  '.github/workflows/build.yml': string;
package/dist/index.d.ts CHANGED
@@ -1,15 +1,20 @@
1
1
  import type { Options as DepcheckOptions } from 'depcheck';
2
2
  import { type ResultPromise } from 'execa';
3
3
  import type GitHost from 'hosted-git-info';
4
- import type { CommandInObjectInput, CommandObjectInObjectInput } from 'make-cli';
4
+ import type { PartialCommandObjectInObject } from 'make-cli';
5
5
  import type { RenovateConfig } from 'renovate/dist/config/types';
6
6
  import type { PackageJson, TsConfigJson } from 'type-fest';
7
- import type { CommandOptionsInput } from './commands/command-options-input';
7
+ import type { PartialCommandOptions } from './commands/command-options-input';
8
+ type HandlerWithBase = (this: Base, ...args: unknown[]) => unknown;
9
+ type PartialCommandObjectInObjectWithBase = Omit<PartialCommandObjectInObject, 'handler'> & {
10
+ handler: (this: Base, ...args: unknown[]) => unknown;
11
+ };
12
+ type PartialCommandInObjectWithBase = PartialCommandObjectInObjectWithBase | HandlerWithBase;
8
13
  type Config = {
9
14
  name?: string;
10
15
  global: boolean;
11
16
  allowedMatches: string[];
12
- commands: Record<string, CommandObjectInObjectInput>;
17
+ commands: Record<string, PartialCommandObjectInObjectWithBase>;
13
18
  depcheckConfig: Omit<DepcheckOptions, 'package'>;
14
19
  deployAssets: Array<{
15
20
  label: string;
@@ -22,12 +27,12 @@ type Config = {
22
27
  git?: GitHost;
23
28
  gitignore: string[];
24
29
  hasTypescriptConfigRootAlias: boolean;
25
- lint: (optionsInput?: CommandOptionsInput) => unknown;
30
+ lint: (partialOptions?: PartialCommandOptions) => unknown;
26
31
  macos: boolean;
27
32
  minNodeVersion: number;
28
33
  nodeVersion: number;
29
34
  preDeploySteps: string[];
30
- prepare: (optionsInput?: CommandOptionsInput) => unknown;
35
+ prepare: (partialOptions?: PartialCommandOptions) => unknown;
31
36
  readmeInstallString: string;
32
37
  seeAlso: Array<{
33
38
  description: string;
@@ -44,12 +49,12 @@ type Config = {
44
49
  renovateConfig: RenovateConfig;
45
50
  isLockFileFixCommitType: boolean;
46
51
  };
47
- type ConfigObjectInput = Omit<Partial<Config>, 'commands'> & {
48
- commands?: Record<string, CommandInObjectInput>;
52
+ type PartialConfigObject = Omit<Partial<Config>, 'commands'> & {
53
+ commands?: Record<string, PartialCommandInObjectWithBase>;
49
54
  };
50
- type ConfigObjectOrFunctionInput = ConfigObjectInput | ((this: Base, Config: any) => ConfigObjectInput);
51
- type ConfigInput = ConfigObjectOrFunctionInput | string | null;
52
- export declare const defineBaseConfig: (configInput: ConfigInput) => ConfigInput;
55
+ type PartialConfigOrFunction = PartialConfigObject | ((this: Base, config: Config) => PartialConfigObject);
56
+ type PartialConfig = PartialConfigOrFunction | string | null;
57
+ export declare const defineBaseConfig: (configInput: PartialConfig) => PartialConfig;
53
58
  declare class Base {
54
59
  config: Config;
55
60
  packageConfig: PackageJson;
@@ -84,7 +89,7 @@ declare class Base {
84
89
  getRenovateConfig(...args: any[]): any;
85
90
  getVscodeConfig(...args: any[]): any;
86
91
  getTypescriptConfig(...args: any[]): any;
87
- constructor(configInput?: ConfigInput, { cwd }?: {
92
+ constructor(configInput?: PartialConfig, { cwd }?: {
88
93
  cwd?: string | undefined;
89
94
  });
90
95
  run(name: any, ...args: any[]): any;
@@ -92,5 +97,5 @@ declare class Base {
92
97
  export { default as loadConfig } from './load-config';
93
98
  export { default as loadConfigSync } from './load-config-sync';
94
99
  export { Base };
95
- export type { Config, ConfigInput };
96
- export { type CommandOptionsInput } from './commands/command-options-input';
100
+ export type { Config, PartialConfig as ConfigInput };
101
+ export { type PartialCommandOptions as CommandOptionsInput } from './commands/command-options-input';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base",
3
- "version": "14.1.0",
3
+ "version": "14.1.1",
4
4
  "description": "Base package for projects.",
5
5
  "repository": "dword-design/base",
6
6
  "funding": "https://github.com/sponsors/dword-design",
@@ -66,7 +66,7 @@
66
66
  "is-ci": "^3.0.1",
67
67
  "jiti": "^2.4.2",
68
68
  "lodash-es": "^4.17.21",
69
- "make-cli": "^4.0.6",
69
+ "make-cli": "^4.0.8",
70
70
  "output-files": "^3.0.0",
71
71
  "package-name-regex": "^4.0.3",
72
72
  "parse-git-config": "npm:@dword-design/parse-git-config@^0.0.1",