@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.
- package/dist/cli.js +15 -15
- package/dist/commands/check-unknown-files/index.js +18 -18
- package/dist/commands/check-unknown-files/unknown-files-error.js +5 -5
- package/dist/commands/commit/index.d.ts +1 -5
- package/dist/commands/commit/index.js +5 -5
- package/dist/commands/depcheck/index.js +11 -11
- package/dist/commands/lint/index.d.ts +1 -5
- package/dist/commands/lint/index.js +32 -7
- package/dist/commands/prepare/index.js +13 -13
- package/dist/commands/test-docker/index.d.ts +1 -5
- package/dist/commands/test-docker/index.js +12 -12
- package/dist/commands/test-raw/index.d.ts +1 -8
- package/dist/commands/test-raw/index.js +12 -12
- package/dist/commands/test-raw/is-ci.d.ts +1 -1
- package/dist/commands/test-raw/is-ci.js +3 -3
- package/dist/commands/test-raw/package-json-schema.d.ts +1 -1
- package/dist/commands/test-raw/package-json-schema.js +20 -20
- package/dist/get-depcheck-special-base/index.js +2 -2
- package/dist/get-generated-files/commitizen.js +1 -1
- package/dist/get-generated-files/commitlint.js +3 -3
- package/dist/get-generated-files/common-editor-ignore.js +1 -1
- package/dist/get-generated-files/editorconfig.js +1 -1
- package/dist/get-generated-files/get-editor-ignore/index.js +1 -1
- package/dist/get-generated-files/get-eslint/index.js +3 -3
- package/dist/get-generated-files/get-github-sync-metadata/index.d.ts +3 -3
- package/dist/get-generated-files/get-github-sync-metadata/index.js +6 -6
- package/dist/get-generated-files/get-github-workflow/index.js +4 -4
- package/dist/get-generated-files/get-github-workflow/steps/cancel-existing.d.ts +1 -1
- package/dist/get-generated-files/get-github-workflow/steps/cancel-existing.js +2 -2
- package/dist/get-generated-files/get-github-workflow/steps/check-unknown-files.js +1 -1
- package/dist/get-generated-files/get-github-workflow/steps/coverage.d.ts +1 -1
- package/dist/get-generated-files/get-github-workflow/steps/coverage.js +2 -2
- package/dist/get-generated-files/get-github-workflow/steps/get-release.js +9 -9
- package/dist/get-generated-files/get-github-workflow/steps/get-test.d.ts +1 -1
- package/dist/get-generated-files/get-github-workflow/steps/get-test.js +14 -14
- package/dist/get-generated-files/get-github-workflow/strategies/job-matrix.js +16 -16
- package/dist/get-generated-files/get-github-workflow/strategies/simple.js +7 -7
- package/dist/get-generated-files/get-gitignore/index.js +2 -2
- package/dist/get-generated-files/get-gitpod/index.js +5 -5
- package/dist/get-generated-files/get-gitpod-dockerfile.js +1 -1
- package/dist/get-generated-files/get-license-string.js +3 -3
- package/dist/get-generated-files/get-package-config/index.js +12 -12
- package/dist/get-generated-files/get-readme-string/index.js +5 -5
- package/dist/get-generated-files/get-readme-string/replacements.js +12 -12
- package/dist/get-generated-files/get-release/index.js +3 -3
- package/dist/get-generated-files/get-renovate/index.d.ts +1 -27
- package/dist/get-generated-files/get-renovate/index.js +14 -14
- package/dist/get-generated-files/get-typescript.js +7 -8
- package/dist/get-generated-files/get-vscode/index.js +4 -4
- package/dist/get-generated-files/gitattributes.js +1 -1
- package/dist/get-generated-files/github-codespaces.js +1 -1
- package/dist/get-generated-files/github-deprecated-dependencies/index.d.ts +5 -5
- package/dist/get-generated-files/github-deprecated-dependencies/index.js +15 -15
- package/dist/get-generated-files/github-deprecated-dependencies-issue-template.js +1 -1
- package/dist/get-generated-files/github-funding.js +3 -3
- package/dist/get-generated-files/github-labels.js +5 -5
- package/dist/get-generated-files/github-sync-labels.d.ts +2 -2
- package/dist/get-generated-files/github-sync-labels.js +6 -6
- package/dist/get-generated-files/index.js +39 -29
- package/dist/get-generated-files/npmrc.js +1 -1
- package/dist/get-git-info/index.d.ts +1 -1
- package/dist/get-git-info/index.js +9 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.js +25 -25
- package/dist/load-config/index.d.ts +1 -1
- package/dist/load-config/index.js +5 -5
- package/dist/load-config-sync/index.d.ts +1 -1
- package/dist/load-config-sync/index.js +5 -5
- package/package.json +18 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default function () {
|
|
2
2
|
return {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
}
|
|
@@ -3,7 +3,7 @@ declare const _default: {
|
|
|
3
3
|
run: {
|
|
4
4
|
'runs-on': string;
|
|
5
5
|
steps: ({
|
|
6
|
-
uses:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
1
|
+
import gitHubAction from "tagged-template-noop";
|
|
2
2
|
export default {
|
|
3
3
|
jobs: {
|
|
4
4
|
run: {
|
|
5
|
-
|
|
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
|
-
|
|
13
|
-
id:
|
|
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:
|
|
18
|
-
GITHUB_TOKEN:
|
|
19
|
-
RUN_URL:
|
|
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:
|
|
22
|
-
if:
|
|
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:
|
|
25
|
+
filename: ".github/DEPRECATED_DEPENDENCIES_ISSUE_TEMPLATE.md",
|
|
26
26
|
update_existing: true
|
|
27
27
|
}
|
|
28
28
|
}, {
|
|
29
|
-
if:
|
|
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:
|
|
33
|
-
|
|
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:
|
|
40
|
+
name: "deprecated-dependencies",
|
|
41
41
|
on: {
|
|
42
42
|
schedule: [{
|
|
43
|
-
cron:
|
|
43
|
+
cron: "0 5 * * MON"
|
|
44
44
|
}]
|
|
45
45
|
}
|
|
46
46
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { mapValues, sortBy } from
|
|
1
|
+
import { mapValues, sortBy } from "lodash-es";
|
|
2
2
|
export default sortBy(Object.values(mapValues({
|
|
3
|
-
BFD4F2: [
|
|
4
|
-
C2E0C6: [
|
|
5
|
-
EDEDED: [
|
|
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(),
|
|
9
|
+
})))).flat(), "name");
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import gitHubAction from
|
|
1
|
+
import gitHubAction from "tagged-template-noop";
|
|
2
2
|
export default {
|
|
3
3
|
jobs: {
|
|
4
4
|
build: {
|
|
5
|
-
|
|
5
|
+
"runs-on": "ubuntu-latest",
|
|
6
6
|
steps: [{
|
|
7
7
|
uses: gitHubAction`actions/checkout@v4`
|
|
8
8
|
}, {
|
|
9
9
|
env: {
|
|
10
|
-
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:
|
|
16
|
+
name: "sync-labels",
|
|
17
17
|
on: {
|
|
18
18
|
push: {
|
|
19
|
-
branches: [
|
|
20
|
-
paths: [
|
|
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
|
|
2
|
-
import sortPackageJson from
|
|
3
|
-
import { stringify as yamlStringify } from
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
30
|
+
".github/workflows/build.yml": yamlStringify(sortKeys(this.getGithubWorkflowConfig(), {
|
|
28
31
|
deep: true
|
|
29
32
|
})),
|
|
30
|
-
|
|
33
|
+
".github/workflows/deprecated-dependencies.yml": yamlStringify(sortKeys(githubDeprecatedDependenciesConfig, {
|
|
31
34
|
deep: true
|
|
32
35
|
})),
|
|
33
|
-
|
|
36
|
+
".github/workflows/sync-labels.yml": yamlStringify(sortKeys(githubSyncLabelsConfig, {
|
|
34
37
|
deep: true
|
|
35
38
|
})),
|
|
36
|
-
|
|
39
|
+
".github/workflows/sync-metadata.yml": yamlStringify(sortKeys(this.getGithubSyncMetadataConfig(), {
|
|
37
40
|
deep: true
|
|
38
41
|
})),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
}),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
}),
|
|
63
|
+
}), void 0, 2)}
|
|
64
|
+
`
|
|
55
65
|
};
|
|
56
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default
|
|
1
|
+
export default "node-linker=hoisted";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import pathLib from
|
|
2
|
-
import fs from
|
|
3
|
-
import hostedGitInfo from
|
|
4
|
-
import parseGitConfig from
|
|
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,
|
|
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 ===
|
|
14
|
+
if (gitUrl === void 0) {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
const gitInfo = hostedGitInfo.fromUrl(gitUrl) || {};
|
|
18
|
-
if (gitInfo.type !==
|
|
19
|
-
throw new Error(
|
|
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?:
|
|
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
|
|
2
|
-
import deepmerge from
|
|
3
|
-
import depcheck from
|
|
4
|
-
import depcheckDetectorBinName from
|
|
5
|
-
import depcheckDetectorExeca from
|
|
6
|
-
import depcheckDetectorPackageName from
|
|
7
|
-
import packageName from
|
|
8
|
-
import endent from
|
|
9
|
-
import fs from
|
|
10
|
-
import { createJiti } from
|
|
11
|
-
import { identity, mapValues } from
|
|
12
|
-
import { transform as pluginNameToPackageName } from
|
|
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 ===
|
|
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 ===
|
|
130
|
+
if (typeof config === "function") {
|
|
131
131
|
config = config.call(this);
|
|
132
132
|
}
|
|
133
133
|
if (config.name) {
|
|
134
|
-
config.name = pluginNameToPackageName(config.name,
|
|
134
|
+
config.name = pluginNameToPackageName(config.name, "base-config");
|
|
135
135
|
}
|
|
136
|
-
this.packageConfig = fs.existsSync(pathLib.join(this.cwd,
|
|
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:
|
|
142
|
+
ignorePath: ".gitignore",
|
|
143
143
|
parsers: {
|
|
144
|
-
|
|
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 ?
|
|
169
|
+
$ npm install ${config.global ? "-g " : ""}${this.packageConfig.name}
|
|
170
170
|
|
|
171
171
|
# Yarn
|
|
172
|
-
$ yarn ${config.global ?
|
|
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,
|
|
184
|
-
let inheritedConfig = inheritedConfigPath ? jitiInstance(inheritedConfigPath) :
|
|
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 ===
|
|
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 ===
|
|
197
|
+
commands: mapValues(this.config.commands, command => typeof command === "function" ? {
|
|
198
198
|
handler: command
|
|
199
199
|
} : command)
|
|
200
200
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { cosmiconfig } from
|
|
1
|
+
import { cosmiconfig } from "cosmiconfig";
|
|
2
2
|
export default async ({
|
|
3
|
-
cwd =
|
|
3
|
+
cwd = "."
|
|
4
4
|
} = {}) => {
|
|
5
|
-
const explorer = cosmiconfig(
|
|
6
|
-
packageProp:
|
|
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 ===
|
|
10
|
+
if (typeof config === "string") {
|
|
11
11
|
config = {
|
|
12
12
|
name: config
|
|
13
13
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { cosmiconfigSync } from
|
|
1
|
+
import { cosmiconfigSync } from "cosmiconfig";
|
|
2
2
|
export default ({
|
|
3
|
-
cwd =
|
|
3
|
+
cwd = "."
|
|
4
4
|
} = {}) => {
|
|
5
|
-
const explorer = cosmiconfigSync(
|
|
6
|
-
packageProp:
|
|
5
|
+
const explorer = cosmiconfigSync("base", {
|
|
6
|
+
packageProp: "baseConfig"
|
|
7
7
|
});
|
|
8
8
|
let config = explorer.search(cwd)?.config ?? null;
|
|
9
|
-
if (typeof config ===
|
|
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.
|
|
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":
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
79
|
-
"@playwright/test": "^1.
|
|
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",
|