@dword-design/base 13.0.9 → 13.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.
Files changed (69) hide show
  1. package/dist/cli.js +15 -15
  2. package/dist/commands/check-unknown-files/index.js +18 -18
  3. package/dist/commands/check-unknown-files/unknown-files-error.js +5 -5
  4. package/dist/commands/commit/index.d.ts +1 -5
  5. package/dist/commands/commit/index.js +5 -5
  6. package/dist/commands/depcheck/index.js +11 -11
  7. package/dist/commands/lint/index.d.ts +1 -5
  8. package/dist/commands/lint/index.js +32 -7
  9. package/dist/commands/prepare/index.js +13 -13
  10. package/dist/commands/test-docker/index.d.ts +1 -5
  11. package/dist/commands/test-docker/index.js +12 -12
  12. package/dist/commands/test-raw/index.d.ts +1 -8
  13. package/dist/commands/test-raw/index.js +12 -12
  14. package/dist/commands/test-raw/is-ci.d.ts +1 -1
  15. package/dist/commands/test-raw/is-ci.js +3 -3
  16. package/dist/commands/test-raw/package-json-schema.d.ts +1 -1
  17. package/dist/commands/test-raw/package-json-schema.js +20 -20
  18. package/dist/get-depcheck-special-base/index.js +2 -2
  19. package/dist/get-generated-files/commitizen.js +1 -1
  20. package/dist/get-generated-files/commitlint.js +3 -3
  21. package/dist/get-generated-files/common-editor-ignore.js +1 -1
  22. package/dist/get-generated-files/editorconfig.js +1 -1
  23. package/dist/get-generated-files/get-editor-ignore/index.js +1 -1
  24. package/dist/get-generated-files/get-eslint/index.js +3 -3
  25. package/dist/get-generated-files/get-github-sync-metadata/index.d.ts +3 -3
  26. package/dist/get-generated-files/get-github-sync-metadata/index.js +6 -6
  27. package/dist/get-generated-files/get-github-workflow/index.js +4 -4
  28. package/dist/get-generated-files/get-github-workflow/steps/cancel-existing.d.ts +1 -1
  29. package/dist/get-generated-files/get-github-workflow/steps/cancel-existing.js +2 -2
  30. package/dist/get-generated-files/get-github-workflow/steps/check-unknown-files.js +1 -1
  31. package/dist/get-generated-files/get-github-workflow/steps/coverage.d.ts +1 -1
  32. package/dist/get-generated-files/get-github-workflow/steps/coverage.js +2 -2
  33. package/dist/get-generated-files/get-github-workflow/steps/get-release.js +9 -9
  34. package/dist/get-generated-files/get-github-workflow/steps/get-test.d.ts +1 -1
  35. package/dist/get-generated-files/get-github-workflow/steps/get-test.js +14 -14
  36. package/dist/get-generated-files/get-github-workflow/strategies/job-matrix.js +16 -16
  37. package/dist/get-generated-files/get-github-workflow/strategies/simple.js +7 -7
  38. package/dist/get-generated-files/get-gitignore/index.js +2 -2
  39. package/dist/get-generated-files/get-gitpod/index.js +5 -5
  40. package/dist/get-generated-files/get-gitpod-dockerfile.js +1 -1
  41. package/dist/get-generated-files/get-license-string.js +3 -3
  42. package/dist/get-generated-files/get-package-config/index.js +12 -12
  43. package/dist/get-generated-files/get-readme-string/index.js +5 -5
  44. package/dist/get-generated-files/get-readme-string/replacements.js +12 -12
  45. package/dist/get-generated-files/get-release/index.js +3 -3
  46. package/dist/get-generated-files/get-renovate/index.d.ts +1 -27
  47. package/dist/get-generated-files/get-renovate/index.js +14 -14
  48. package/dist/get-generated-files/get-typescript.js +7 -8
  49. package/dist/get-generated-files/get-vscode/index.js +4 -4
  50. package/dist/get-generated-files/gitattributes.js +1 -1
  51. package/dist/get-generated-files/github-codespaces.js +1 -1
  52. package/dist/get-generated-files/github-deprecated-dependencies/index.d.ts +5 -5
  53. package/dist/get-generated-files/github-deprecated-dependencies/index.js +15 -15
  54. package/dist/get-generated-files/github-deprecated-dependencies-issue-template.js +1 -1
  55. package/dist/get-generated-files/github-funding.js +3 -3
  56. package/dist/get-generated-files/github-labels.js +5 -5
  57. package/dist/get-generated-files/github-sync-labels.d.ts +2 -2
  58. package/dist/get-generated-files/github-sync-labels.js +6 -6
  59. package/dist/get-generated-files/index.js +39 -29
  60. package/dist/get-generated-files/npmrc.js +1 -1
  61. package/dist/get-git-info/index.d.ts +1 -1
  62. package/dist/get-git-info/index.js +9 -9
  63. package/dist/index.d.ts +2 -2
  64. package/dist/index.js +25 -25
  65. package/dist/load-config/index.d.ts +1 -1
  66. package/dist/load-config/index.js +5 -5
  67. package/dist/load-config-sync/index.d.ts +1 -1
  68. package/dist/load-config-sync/index.js +5 -5
  69. package/package.json +18 -9
@@ -1,8 +1,8 @@
1
1
  export default function () {
2
2
  return {
3
- 'editor.tabSize': 2,
4
- 'files.autoSave': 'off',
5
- 'files.exclude': Object.fromEntries(this.getEditorIgnoreConfig().map(entry => [entry, true])),
6
- 'workbench.editor.enablePreview': false
3
+ "editor.tabSize": 2,
4
+ "files.autoSave": "off",
5
+ "files.exclude": Object.fromEntries(this.getEditorIgnoreConfig().map(entry => [entry, true])),
6
+ "workbench.editor.enablePreview": false
7
7
  };
8
8
  }
@@ -1,4 +1,4 @@
1
- import endent from 'endent';
1
+ import endent from "endent";
2
2
  export default endent`
3
3
  * text=auto eol=lf
4
4
  *.glb filter=lfs diff=lfs merge=lfs -text
@@ -1,3 +1,3 @@
1
1
  export default {
2
- postCreateCommand: 'pnpm install --frozen-lockfile'
2
+ postCreateCommand: "pnpm install --frozen-lockfile"
3
3
  };
@@ -3,7 +3,7 @@ declare const _default: {
3
3
  run: {
4
4
  'runs-on': string;
5
5
  steps: ({
6
- uses: string;
6
+ uses: any;
7
7
  with: {
8
8
  lfs: boolean;
9
9
  filename?: undefined;
@@ -18,7 +18,7 @@ declare const _default: {
18
18
  } | {
19
19
  'continue-on-error': boolean;
20
20
  id: string;
21
- uses: string;
21
+ uses: any;
22
22
  with?: undefined;
23
23
  env?: undefined;
24
24
  if?: undefined;
@@ -30,7 +30,7 @@ declare const _default: {
30
30
  };
31
31
  id: string;
32
32
  if: string;
33
- uses: string;
33
+ uses: any;
34
34
  with: {
35
35
  filename: string;
36
36
  update_existing: boolean;
@@ -41,7 +41,7 @@ declare const _default: {
41
41
  'continue-on-error'?: undefined;
42
42
  } | {
43
43
  if: string;
44
- uses: string;
44
+ uses: any;
45
45
  with: {
46
46
  comment: string;
47
47
  'issue-number': string;
@@ -53,7 +53,7 @@ declare const _default: {
53
53
  id?: undefined;
54
54
  env?: undefined;
55
55
  } | {
56
- uses: string;
56
+ uses: any;
57
57
  with?: undefined;
58
58
  'continue-on-error'?: undefined;
59
59
  id?: undefined;
@@ -1,46 +1,46 @@
1
- import gitHubAction from 'tagged-template-noop';
1
+ import gitHubAction from "tagged-template-noop";
2
2
  export default {
3
3
  jobs: {
4
4
  run: {
5
- 'runs-on': 'ubuntu-latest',
5
+ "runs-on": "ubuntu-latest",
6
6
  steps: [{
7
7
  uses: gitHubAction`actions/checkout@v4`,
8
8
  with: {
9
9
  lfs: true
10
10
  }
11
11
  }, {
12
- 'continue-on-error': true,
13
- id: 'check-deprecated-js-deps',
12
+ "continue-on-error": true,
13
+ id: "check-deprecated-js-deps",
14
14
  uses: gitHubAction`tinovyatkin/action-check-deprecated-js-deps@v1`
15
15
  }, {
16
16
  env: {
17
- DEPRECATED: '${{ steps.check-deprecated-js-deps.outputs.deprecated }}',
18
- GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}',
19
- RUN_URL: 'https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}'
17
+ DEPRECATED: "${{ steps.check-deprecated-js-deps.outputs.deprecated }}",
18
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}",
19
+ RUN_URL: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
20
20
  },
21
- id: 'create-deprecation-issue',
22
- if: '${{ steps.check-deprecated-js-deps.outputs.deprecated }}',
21
+ id: "create-deprecation-issue",
22
+ if: "${{ steps.check-deprecated-js-deps.outputs.deprecated }}",
23
23
  uses: gitHubAction`JasonEtco/create-an-issue@v2`,
24
24
  with: {
25
- filename: '.github/DEPRECATED_DEPENDENCIES_ISSUE_TEMPLATE.md',
25
+ filename: ".github/DEPRECATED_DEPENDENCIES_ISSUE_TEMPLATE.md",
26
26
  update_existing: true
27
27
  }
28
28
  }, {
29
- if: '${{ !steps.check-deprecated-js-deps.outputs.deprecated && steps.create-deprecation-issue.outputs.number }}',
29
+ if: "${{ !steps.check-deprecated-js-deps.outputs.deprecated && steps.create-deprecation-issue.outputs.number }}",
30
30
  uses: gitHubAction`peter-evans/close-issue@v3`,
31
31
  with: {
32
- comment: 'Auto-closing the issue',
33
- 'issue-number': '${{ steps.create-deprecation-issue.outputs.number }}'
32
+ comment: "Auto-closing the issue",
33
+ "issue-number": "${{ steps.create-deprecation-issue.outputs.number }}"
34
34
  }
35
35
  }, {
36
36
  uses: gitHubAction`liskin/gh-workflow-keepalive@v1`
37
37
  }]
38
38
  }
39
39
  },
40
- name: 'deprecated-dependencies',
40
+ name: "deprecated-dependencies",
41
41
  on: {
42
42
  schedule: [{
43
- cron: '0 5 * * MON'
43
+ cron: "0 5 * * MON"
44
44
  }]
45
45
  }
46
46
  };
@@ -1,4 +1,4 @@
1
- import endent from 'endent';
1
+ import endent from "endent";
2
2
  export default endent`
3
3
  ---
4
4
  title: Deprecated dependencies
@@ -1,5 +1,5 @@
1
1
  export default {
2
- custom: ['buymeacoffee.com/dword', 'paypal.me/SebastianLandwehr'],
3
- github: 'dword-design',
4
- patreon: 'dworddesign'
2
+ custom: ["buymeacoffee.com/dword", "paypal.me/SebastianLandwehr"],
3
+ github: "dword-design",
4
+ patreon: "dworddesign"
5
5
  };
@@ -1,9 +1,9 @@
1
- import { mapValues, sortBy } from 'lodash-es';
1
+ import { mapValues, sortBy } from "lodash-es";
2
2
  export default sortBy(Object.values(mapValues({
3
- BFD4F2: ['blocking', 'breaking', 'important'],
4
- C2E0C6: ['active', 'blocked', 'maintenance', 'waiting-for'],
5
- EDEDED: ['released', 'semantic-release']
3
+ BFD4F2: ["blocking", "breaking", "important"],
4
+ C2E0C6: ["active", "blocked", "maintenance", "waiting-for"],
5
+ EDEDED: ["released", "semantic-release"]
6
6
  }, (names, color) => names.map(name => ({
7
7
  color,
8
8
  name
9
- })))).flat(), 'name');
9
+ })))).flat(), "name");
@@ -3,13 +3,13 @@ declare const _default: {
3
3
  build: {
4
4
  'runs-on': string;
5
5
  steps: ({
6
- uses: string;
6
+ uses: any;
7
7
  env?: undefined;
8
8
  } | {
9
9
  env: {
10
10
  GITHUB_TOKEN: string;
11
11
  };
12
- uses: string;
12
+ uses: any;
13
13
  })[];
14
14
  };
15
15
  };
@@ -1,23 +1,23 @@
1
- import gitHubAction from 'tagged-template-noop';
1
+ import gitHubAction from "tagged-template-noop";
2
2
  export default {
3
3
  jobs: {
4
4
  build: {
5
- 'runs-on': 'ubuntu-latest',
5
+ "runs-on": "ubuntu-latest",
6
6
  steps: [{
7
7
  uses: gitHubAction`actions/checkout@v4`
8
8
  }, {
9
9
  env: {
10
- GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
10
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
11
11
  },
12
12
  uses: gitHubAction`micnncim/action-label-syncer@v1`
13
13
  }]
14
14
  }
15
15
  },
16
- name: 'sync-labels',
16
+ name: "sync-labels",
17
17
  on: {
18
18
  push: {
19
- branches: ['master'],
20
- paths: ['.github/labels.yml', '.github/workflows/sync-labels.yml']
19
+ branches: ["master"],
20
+ paths: [".github/labels.yml", ".github/workflows/sync-labels.yml"]
21
21
  }
22
22
  }
23
23
  };
@@ -1,6 +1,6 @@
1
- import sortKeys from 'sort-keys';
2
- import sortPackageJson from 'sort-package-json';
3
- import { stringify as yamlStringify } from 'yaml';
1
+ import sortKeys from "sort-keys";
2
+ import sortPackageJson from "sort-package-json";
3
+ import { stringify as yamlStringify } from "yaml";
4
4
  import commitizenConfig from "./commitizen.js";
5
5
  import commitlintConfig from "./commitlint.js";
6
6
  import editorconfigConfig from "./editorconfig.js";
@@ -14,43 +14,53 @@ import npmrc from "./npmrc.js";
14
14
  export default function () {
15
15
  const packageConfig = this.getPackageConfig();
16
16
  return {
17
- '.commitlintrc.json': `${JSON.stringify(commitlintConfig, undefined, 2)}\n`,
18
- '.cz.json': `${JSON.stringify(commitizenConfig, undefined, 2)}\n`,
19
- '.devcontainer/devcontainer.json': `${JSON.stringify(this.githubCodespacesConfig, undefined, 2)}\n`,
20
- '.editorconfig': editorconfigConfig,
21
- '.gitattributes': gitattributesConfig,
22
- '.github/DEPRECATED_DEPENDENCIES_ISSUE_TEMPLATE.md': deprecatedDependenciesIssueTemplate,
23
- '.github/FUNDING.yml': yamlStringify(githubFunding),
24
- '.github/labels.yml': yamlStringify(sortKeys(githubLabelsConfig, {
17
+ ".commitlintrc.json": `${JSON.stringify(commitlintConfig, void 0, 2)}
18
+ `,
19
+ ".cz.json": `${JSON.stringify(commitizenConfig, void 0, 2)}
20
+ `,
21
+ ".devcontainer/devcontainer.json": `${JSON.stringify(this.githubCodespacesConfig, void 0, 2)}
22
+ `,
23
+ ".editorconfig": editorconfigConfig,
24
+ ".gitattributes": gitattributesConfig,
25
+ ".github/DEPRECATED_DEPENDENCIES_ISSUE_TEMPLATE.md": deprecatedDependenciesIssueTemplate,
26
+ ".github/FUNDING.yml": yamlStringify(githubFunding),
27
+ ".github/labels.yml": yamlStringify(sortKeys(githubLabelsConfig, {
25
28
  deep: true
26
29
  })),
27
- '.github/workflows/build.yml': yamlStringify(sortKeys(this.getGithubWorkflowConfig(), {
30
+ ".github/workflows/build.yml": yamlStringify(sortKeys(this.getGithubWorkflowConfig(), {
28
31
  deep: true
29
32
  })),
30
- '.github/workflows/deprecated-dependencies.yml': yamlStringify(sortKeys(githubDeprecatedDependenciesConfig, {
33
+ ".github/workflows/deprecated-dependencies.yml": yamlStringify(sortKeys(githubDeprecatedDependenciesConfig, {
31
34
  deep: true
32
35
  })),
33
- '.github/workflows/sync-labels.yml': yamlStringify(sortKeys(githubSyncLabelsConfig, {
36
+ ".github/workflows/sync-labels.yml": yamlStringify(sortKeys(githubSyncLabelsConfig, {
34
37
  deep: true
35
38
  })),
36
- '.github/workflows/sync-metadata.yml': yamlStringify(sortKeys(this.getGithubSyncMetadataConfig(), {
39
+ ".github/workflows/sync-metadata.yml": yamlStringify(sortKeys(this.getGithubSyncMetadataConfig(), {
37
40
  deep: true
38
41
  })),
39
- '.gitignore': this.getGitignoreConfig().map(entry => `${entry}\n`).join(''),
40
- '.gitpod.Dockerfile': this.getGitpodDockerfile(),
41
- '.gitpod.yml': yamlStringify(this.getGitpodConfig()),
42
- '.npmrc': `${npmrc}\n`,
43
- '.releaserc.json': `${JSON.stringify(this.getReleaseConfig(), undefined, 2)}\n`,
44
- '.renovaterc.json': `${JSON.stringify(sortKeys(this.getRenovateConfig(), {
42
+ ".gitignore": this.getGitignoreConfig().map(entry => `${entry}
43
+ `).join(""),
44
+ ".gitpod.Dockerfile": this.getGitpodDockerfile(),
45
+ ".gitpod.yml": yamlStringify(this.getGitpodConfig()),
46
+ ".npmrc": `${npmrc}
47
+ `,
48
+ ".releaserc.json": `${JSON.stringify(this.getReleaseConfig(), void 0, 2)}
49
+ `,
50
+ ".renovaterc.json": `${JSON.stringify(sortKeys(this.getRenovateConfig(), {
45
51
  deep: true
46
- }), undefined, 2)}\n`,
47
- '.vscode/settings.json': `${JSON.stringify(this.getVscodeConfig(), undefined, 2)}\n`,
48
- 'LICENSE.md': this.getLicenseString(),
49
- 'README.md': this.getReadmeString(),
50
- 'eslint.config.ts': this.getEslintConfig(),
51
- 'package.json': `${JSON.stringify(sortPackageJson(packageConfig), undefined, 2)}\n`,
52
- 'tsconfig.json': `${JSON.stringify(sortKeys(this.getTypescriptConfig(), {
52
+ }), void 0, 2)}
53
+ `,
54
+ ".vscode/settings.json": `${JSON.stringify(this.getVscodeConfig(), void 0, 2)}
55
+ `,
56
+ "LICENSE.md": this.getLicenseString(),
57
+ "README.md": this.getReadmeString(),
58
+ "eslint.config.ts": this.getEslintConfig(),
59
+ "package.json": `${JSON.stringify(sortPackageJson(packageConfig), void 0, 2)}
60
+ `,
61
+ "tsconfig.json": `${JSON.stringify(sortKeys(this.getTypescriptConfig(), {
53
62
  deep: true
54
- }), undefined, 2)}\n`
63
+ }), void 0, 2)}
64
+ `
55
65
  };
56
66
  }
@@ -1 +1 @@
1
- export default 'node-linker=hoisted';
1
+ export default "node-linker=hoisted";
@@ -1,4 +1,4 @@
1
1
  declare const _default: ({ cwd }?: {
2
- cwd?: string;
2
+ cwd?: string | undefined;
3
3
  }) => any;
4
4
  export default _default;
@@ -1,22 +1,22 @@
1
- import pathLib from 'node:path';
2
- import fs from 'fs-extra';
3
- import hostedGitInfo from 'hosted-git-info';
4
- import parseGitConfig from 'parse-git-config';
1
+ import pathLib from "node:path";
2
+ import fs from "fs-extra";
3
+ import hostedGitInfo from "hosted-git-info";
4
+ import parseGitConfig from "parse-git-config";
5
5
  export default ({
6
- cwd = '.'
6
+ cwd = "."
7
7
  } = {}) => {
8
- if (!fs.existsSync(pathLib.join(cwd, '.git'))) {
8
+ if (!fs.existsSync(pathLib.join(cwd, ".git"))) {
9
9
  return;
10
10
  }
11
11
  const gitUrl = parseGitConfig.sync({
12
12
  cwd
13
13
  })['remote "origin"']?.url;
14
- if (gitUrl === undefined) {
14
+ if (gitUrl === void 0) {
15
15
  return;
16
16
  }
17
17
  const gitInfo = hostedGitInfo.fromUrl(gitUrl) || {};
18
- if (gitInfo.type !== 'github') {
19
- throw new Error('Only GitHub repositories are supported.');
18
+ if (gitInfo.type !== "github") {
19
+ throw new Error("Only GitHub repositories are supported.");
20
20
  }
21
21
  return gitInfo;
22
22
  };
package/dist/index.d.ts CHANGED
@@ -30,8 +30,8 @@ declare class Base {
30
30
  getRenovateConfig(...args: any[]): void;
31
31
  getVscodeConfig(...args: any[]): void;
32
32
  getTypescriptConfig(...args: any[]): void;
33
- constructor(config?: any, { cwd }?: {
34
- cwd?: string;
33
+ constructor(config?: null, { cwd }?: {
34
+ cwd?: string | undefined;
35
35
  });
36
36
  run(name: any, ...args: any[]): any;
37
37
  }
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import pathLib from 'node:path';
2
- import deepmerge from 'deepmerge';
3
- import depcheck from 'depcheck';
4
- import depcheckDetectorBinName from 'depcheck-detector-bin-name';
5
- import depcheckDetectorExeca from 'depcheck-detector-execa';
6
- import depcheckDetectorPackageName from 'depcheck-detector-package-name';
7
- import packageName from 'depcheck-package-name';
8
- import endent from 'endent';
9
- import fs from 'fs-extra';
10
- import { createJiti } from 'jiti';
11
- import { identity, mapValues } from 'lodash-es';
12
- import { transform as pluginNameToPackageName } from 'plugin-name-to-package-name';
1
+ import pathLib from "node:path";
2
+ import deepmerge from "deepmerge";
3
+ import depcheck from "depcheck";
4
+ import depcheckDetectorBinName from "depcheck-detector-bin-name";
5
+ import depcheckDetectorExeca from "depcheck-detector-execa";
6
+ import depcheckDetectorPackageName from "depcheck-detector-package-name";
7
+ import packageName from "depcheck-package-name";
8
+ import endent from "endent";
9
+ import fs from "fs-extra";
10
+ import { createJiti } from "jiti";
11
+ import { identity, mapValues } from "lodash-es";
12
+ import { transform as pluginNameToPackageName } from "plugin-name-to-package-name";
13
13
  import checkUnknownFiles from "./commands/check-unknown-files/index.js";
14
14
  import commit from "./commands/commit/index.js";
15
15
  import depcheckMethod from "./commands/depcheck/index.js";
@@ -38,7 +38,7 @@ import githubCodespacesConfig from "./get-generated-files/github-codespaces.js";
38
38
  import getGitInfo from "./get-git-info/index.js";
39
39
  const mergeConfigs = (...configs) => {
40
40
  const result = deepmerge.all(configs, {
41
- customMerge: key => key === 'supportedNodeVersions' ? (a, b) => b : undefined
41
+ customMerge: key => key === "supportedNodeVersions" ? (a, b) => b : void 0
42
42
  });
43
43
  return result;
44
44
  };
@@ -118,7 +118,7 @@ class Base {
118
118
  return getTypescriptConfig.call(this, ...args);
119
119
  }
120
120
  constructor(config = null, {
121
- cwd = '.'
121
+ cwd = "."
122
122
  } = {}) {
123
123
  this.cwd = cwd;
124
124
  const jitiInstance = createJiti(pathLib.resolve(this.cwd));
@@ -127,21 +127,21 @@ class Base {
127
127
  name: packageName`@dword-design/base-config-node`
128
128
  };
129
129
  }
130
- if (typeof config === 'function') {
130
+ if (typeof config === "function") {
131
131
  config = config.call(this);
132
132
  }
133
133
  if (config.name) {
134
- config.name = pluginNameToPackageName(config.name, 'base-config');
134
+ config.name = pluginNameToPackageName(config.name, "base-config");
135
135
  }
136
- this.packageConfig = fs.existsSync(pathLib.join(this.cwd, 'package.json')) ? fs.readJsonSync(pathLib.join(this.cwd, 'package.json')) : {};
136
+ this.packageConfig = fs.existsSync(pathLib.join(this.cwd, "package.json")) ? fs.readJsonSync(pathLib.join(this.cwd, "package.json")) : {};
137
137
  const defaultConfig = {
138
138
  allowedMatches: [],
139
139
  commands: {},
140
140
  depcheckConfig: {
141
141
  detectors: [depcheck.detector.importDeclaration, depcheck.detector.requireCallExpression, depcheck.detector.requireResolveCallExpression, depcheckDetectorExeca, depcheckDetectorPackageName, depcheckDetectorBinName],
142
- ignorePath: '.gitignore',
142
+ ignorePath: ".gitignore",
143
143
  parsers: {
144
- '**/*.ts': depcheck.parser.typescript
144
+ "**/*.ts": depcheck.parser.typescript
145
145
  },
146
146
  specials: [getDepcheckSpecialBase(config.name), depcheck.special.bin]
147
147
  },
@@ -166,10 +166,10 @@ class Base {
166
166
 
167
167
  \`\`\`bash
168
168
  # npm
169
- $ npm install ${config.global ? '-g ' : ''}${this.packageConfig.name}
169
+ $ npm install ${config.global ? "-g " : ""}${this.packageConfig.name}
170
170
 
171
171
  # Yarn
172
- $ yarn ${config.global ? 'global ' : ''}add ${this.packageConfig.name}
172
+ $ yarn ${config.global ? "global " : ""}add ${this.packageConfig.name}
173
173
  \`\`\`
174
174
  `,
175
175
  seeAlso: [],
@@ -180,12 +180,12 @@ class Base {
180
180
  };
181
181
  const configsToMerge = [defaultConfig];
182
182
  if (config.name) {
183
- const inheritedConfigPath = config.name === this.packageConfig.name ? pathLib.resolve(this.cwd, 'src', 'index.ts') : config.name;
184
- let inheritedConfig = inheritedConfigPath ? jitiInstance(inheritedConfigPath) : undefined;
183
+ const inheritedConfigPath = config.name === this.packageConfig.name ? pathLib.resolve(this.cwd, "src", "index.ts") : config.name;
184
+ let inheritedConfig = inheritedConfigPath ? jitiInstance(inheritedConfigPath) : void 0;
185
185
  if (inheritedConfig?.default) {
186
186
  inheritedConfig = inheritedConfig.default;
187
187
  }
188
- if (typeof inheritedConfig === 'function') {
188
+ if (typeof inheritedConfig === "function") {
189
189
  inheritedConfig = inheritedConfig.call(this, mergeConfigs(defaultConfig, config));
190
190
  }
191
191
  configsToMerge.push(inheritedConfig);
@@ -194,7 +194,7 @@ class Base {
194
194
  this.config = mergeConfigs(...configsToMerge);
195
195
  this.config = {
196
196
  ...this.config,
197
- commands: mapValues(this.config.commands, command => typeof command === 'function' ? {
197
+ commands: mapValues(this.config.commands, command => typeof command === "function" ? {
198
198
  handler: command
199
199
  } : command)
200
200
  };
@@ -1,4 +1,4 @@
1
1
  declare const _default: ({ cwd }?: {
2
- cwd?: string;
2
+ cwd?: string | undefined;
3
3
  }) => Promise<any>;
4
4
  export default _default;
@@ -1,13 +1,13 @@
1
- import { cosmiconfig } from 'cosmiconfig';
1
+ import { cosmiconfig } from "cosmiconfig";
2
2
  export default async ({
3
- cwd = '.'
3
+ cwd = "."
4
4
  } = {}) => {
5
- const explorer = cosmiconfig('base', {
6
- packageProp: 'baseConfig'
5
+ const explorer = cosmiconfig("base", {
6
+ packageProp: "baseConfig"
7
7
  });
8
8
  const result = await explorer.search(cwd);
9
9
  let config = result?.config ?? null;
10
- if (typeof config === 'string') {
10
+ if (typeof config === "string") {
11
11
  config = {
12
12
  name: config
13
13
  };
@@ -1,4 +1,4 @@
1
1
  declare const _default: ({ cwd }?: {
2
- cwd?: string;
2
+ cwd?: string | undefined;
3
3
  }) => any;
4
4
  export default _default;
@@ -1,12 +1,12 @@
1
- import { cosmiconfigSync } from 'cosmiconfig';
1
+ import { cosmiconfigSync } from "cosmiconfig";
2
2
  export default ({
3
- cwd = '.'
3
+ cwd = "."
4
4
  } = {}) => {
5
- const explorer = cosmiconfigSync('base', {
6
- packageProp: 'baseConfig'
5
+ const explorer = cosmiconfigSync("base", {
6
+ packageProp: "baseConfig"
7
7
  });
8
8
  let config = explorer.search(cwd)?.config ?? null;
9
- if (typeof config === 'string') {
9
+ if (typeof config === "string") {
10
10
  config = {
11
11
  name: config
12
12
  };
package/package.json CHANGED
@@ -1,13 +1,20 @@
1
1
  {
2
2
  "name": "@dword-design/base",
3
- "version": "13.0.9",
3
+ "version": "13.1.1",
4
4
  "description": "Base package for projects.",
5
5
  "repository": "dword-design/base",
6
6
  "funding": "https://github.com/sponsors/dword-design",
7
7
  "license": "MIT",
8
8
  "author": "Sebastian Landwehr <info@sebastianlandwehr.com>",
9
9
  "type": "module",
10
- "exports": "./dist/index.js",
10
+ "exports": {
11
+ ".": {
12
+ "import": {
13
+ "default": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ }
17
+ },
11
18
  "main": "dist/index.js",
12
19
  "bin": "./dist/cli.js",
13
20
  "files": [
@@ -26,10 +33,10 @@
26
33
  "dependencies": {
27
34
  "@commitlint/cli": "^18.6.1",
28
35
  "@commitlint/config-conventional": "^18.6.3",
29
- "@dword-design/base-config-node": "^3.0.7",
36
+ "@dword-design/base-config-node": "^3.0.16",
30
37
  "@dword-design/ci": "^4.0.6",
31
38
  "@dword-design/defu": "^1.0.0",
32
- "@dword-design/eslint-config": "^7.0.3",
39
+ "@dword-design/eslint-config": "^7.0.7",
33
40
  "@dword-design/personal-data": "^2.0.3",
34
41
  "@semantic-release/changelog": "^6.0.3",
35
42
  "@semantic-release/git": "^10.0.1",
@@ -46,7 +53,7 @@
46
53
  "depcheck-detector-package-name": "^3.0.4",
47
54
  "depcheck-package-name": "^3.0.1",
48
55
  "endent": "npm:@dword-design/endent@^1.4.1",
49
- "eslint": "^9.28.0",
56
+ "eslint": "^9.29.0",
50
57
  "execa": "^9.6.0",
51
58
  "find-up": "^7.0.0",
52
59
  "fs-extra": "^11.3.0",
@@ -60,7 +67,7 @@
60
67
  "lodash-es": "^4.17.21",
61
68
  "make-cli": "^4.0.0",
62
69
  "output-files": "^2.0.32",
63
- "package-name-regex": "^4.0.1",
70
+ "package-name-regex": "^4.0.3",
64
71
  "parse-git-config": "npm:@dword-design/parse-git-config@^0.0.1",
65
72
  "parse-packagejson-name": "^1.0.1",
66
73
  "plugin-name-to-package-name": "npm:@dword-design/plugin-name-to-package-name@^0.1.2",
@@ -71,12 +78,14 @@
71
78
  "spdx-expression-parse": "^4.0.0",
72
79
  "spdx-license-list": "^6.10.0",
73
80
  "tagged-template-noop": "^2.1.1",
74
- "tsx": "^4.19.4",
81
+ "tsx": "^4.20.3",
82
+ "typescript": "^5.8.3",
83
+ "vue-tsc": "^2.2.10",
75
84
  "yaml": "^2.8.0"
76
85
  },
77
86
  "devDependencies": {
78
- "@dword-design/dotenv-json-extended": "^3.0.0",
79
- "@playwright/test": "^1.52.0",
87
+ "@dword-design/dotenv-json-extended": "^3.0.3",
88
+ "@playwright/test": "^1.53.1",
80
89
  "p-event": "^6.0.1",
81
90
  "renovate": "^39.264.1",
82
91
  "sharp": "^0.34.2",