@dword-design/base 13.0.8 → 13.1.0
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 +8 -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 +40 -28
- 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
package/dist/cli.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { mapValues } from
|
|
3
|
-
import makeCli from
|
|
2
|
+
import { mapValues } from "lodash-es";
|
|
3
|
+
import makeCli from "make-cli";
|
|
4
4
|
import { Base } from "./index.js";
|
|
5
5
|
import loadConfig from "./load-config/index.js";
|
|
6
6
|
const base = new Base(await loadConfig());
|
|
7
7
|
const testOptions = [{
|
|
8
|
-
description:
|
|
9
|
-
name:
|
|
8
|
+
description: "Only run tests matching this string or regexp",
|
|
9
|
+
name: "-g, --grep <grep>"
|
|
10
10
|
}, {
|
|
11
|
-
description:
|
|
12
|
-
name:
|
|
11
|
+
description: "Update snapshots",
|
|
12
|
+
name: "-u, --update-snapshots"
|
|
13
13
|
}, {
|
|
14
|
-
description:
|
|
15
|
-
name:
|
|
14
|
+
description: "Run tests in interactive UI mode",
|
|
15
|
+
name: "--ui-host <host>"
|
|
16
16
|
}, {
|
|
17
|
-
description:
|
|
18
|
-
name:
|
|
17
|
+
description: "Host to serve UI on; specifying this option opens UI in a browser tab",
|
|
18
|
+
name: "--ui"
|
|
19
19
|
}];
|
|
20
20
|
try {
|
|
21
21
|
await makeCli({
|
|
@@ -26,8 +26,8 @@ try {
|
|
|
26
26
|
commit: {
|
|
27
27
|
handler: () => base.commit(),
|
|
28
28
|
options: [{
|
|
29
|
-
description:
|
|
30
|
-
name:
|
|
29
|
+
description: "Allow empty commits",
|
|
30
|
+
name: "--allow-empty"
|
|
31
31
|
}]
|
|
32
32
|
},
|
|
33
33
|
depcheck: {
|
|
@@ -40,8 +40,8 @@ try {
|
|
|
40
40
|
handler: () => base.prepare()
|
|
41
41
|
},
|
|
42
42
|
...(base.config.testInContainer && {
|
|
43
|
-
|
|
44
|
-
arguments:
|
|
43
|
+
"test:raw": {
|
|
44
|
+
arguments: "[patterns...]",
|
|
45
45
|
handler: (patterns, options) => base.testRaw({
|
|
46
46
|
patterns,
|
|
47
47
|
...options
|
|
@@ -50,7 +50,7 @@ try {
|
|
|
50
50
|
}
|
|
51
51
|
}),
|
|
52
52
|
test: {
|
|
53
|
-
arguments:
|
|
53
|
+
arguments: "[patterns...]",
|
|
54
54
|
handler: (patterns, options) => base.test({
|
|
55
55
|
patterns,
|
|
56
56
|
...options
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { globby } from
|
|
2
|
-
import ignore from
|
|
1
|
+
import { globby } from "globby";
|
|
2
|
+
import ignore from "ignore";
|
|
3
3
|
import UnknownFilesError from "./unknown-files-error.js";
|
|
4
4
|
export default async function () {
|
|
5
5
|
const allowedMatches = [...Object.keys(this.generatedFiles), ...Object.keys({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
".baserc.json": true,
|
|
7
|
+
".env.schema.json": true,
|
|
8
|
+
".git": true,
|
|
9
|
+
".husky/_": true,
|
|
10
|
+
".husky/commit-msg": true,
|
|
11
|
+
".husky/post-checkout": true,
|
|
12
|
+
".husky/post-commit": true,
|
|
13
|
+
".husky/post-merge": true,
|
|
14
|
+
".husky/pre-push": true,
|
|
15
|
+
"CHANGELOG.md": true,
|
|
16
16
|
PRCHECKLIST: true,
|
|
17
17
|
demo: true,
|
|
18
18
|
doc: true,
|
|
19
|
-
|
|
19
|
+
"eslint.config.ts": true,
|
|
20
20
|
fixtures: true,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
"pnpm-lock.yaml": true,
|
|
22
|
+
"pnpm-workspace.yaml": true
|
|
23
23
|
}), ...Object.keys({
|
|
24
|
-
|
|
24
|
+
"**/*-snapshots/**": true,
|
|
25
25
|
// For some reason without the trailing ** didn't work
|
|
26
|
-
|
|
26
|
+
"playwright.config.ts": true
|
|
27
27
|
}), ...this.config.allowedMatches];
|
|
28
|
-
let unknownFiles = await globby(
|
|
28
|
+
let unknownFiles = await globby("**", {
|
|
29
29
|
cwd: this.cwd,
|
|
30
30
|
dot: true,
|
|
31
31
|
gitignore: true,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import endent from
|
|
2
|
-
import fs from
|
|
3
|
-
import { identity, sortBy } from
|
|
4
|
-
const packageConfig = fs.readJsonSync(new URL(
|
|
1
|
+
import endent from "endent";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import { identity, sortBy } from "lodash-es";
|
|
4
|
+
const packageConfig = fs.readJsonSync(new URL("../../../package.json", import.meta.url));
|
|
5
5
|
export default class extends Error {
|
|
6
6
|
constructor(files) {
|
|
7
7
|
super(endent`
|
|
8
8
|
There are files in this repository that are not known to ${packageConfig.name}. Let's discuss about them in a PR!
|
|
9
9
|
|
|
10
|
-
${sortBy(Object.keys(files).map(file => `* ${file}`), identity).join(
|
|
10
|
+
${sortBy(Object.keys(files).map(file => `* ${file}`), identity).join("\n")}
|
|
11
11
|
`);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { execaCommand } from
|
|
1
|
+
import { execaCommand } from "execa";
|
|
2
2
|
export default function (options) {
|
|
3
3
|
options = {
|
|
4
|
-
log: process.env.NODE_ENV !==
|
|
5
|
-
stderr:
|
|
4
|
+
log: process.env.NODE_ENV !== "test",
|
|
5
|
+
stderr: "inherit",
|
|
6
6
|
...options
|
|
7
7
|
};
|
|
8
|
-
return execaCommand(`git-cz${options.allowEmpty ?
|
|
8
|
+
return execaCommand(`git-cz${options.allowEmpty ? " --allow-empty" : ""}`, {
|
|
9
9
|
cwd: this.cwd,
|
|
10
10
|
...(options.log && {
|
|
11
|
-
stdout:
|
|
11
|
+
stdout: "inherit"
|
|
12
12
|
}),
|
|
13
13
|
stderr: options.stderr
|
|
14
14
|
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import depcheck from
|
|
2
|
-
import endent from
|
|
3
|
-
import { isEmpty, mapValues, omit } from
|
|
1
|
+
import depcheck from "depcheck";
|
|
2
|
+
import endent from "endent";
|
|
3
|
+
import { isEmpty, mapValues, omit } from "lodash-es";
|
|
4
4
|
export default async function () {
|
|
5
5
|
const dependenciesResult = await depcheck(this.cwd, {
|
|
6
|
-
package: omit(this.packageConfig, [
|
|
6
|
+
package: omit(this.packageConfig, ["devDependencies"]),
|
|
7
7
|
skipMissing: true,
|
|
8
8
|
...this.config.depcheckConfig,
|
|
9
|
-
ignorePatterns: [
|
|
9
|
+
ignorePatterns: ["*.spec.ts", "/fixtures", "/playwright.config.ts", "package.json", "eslint.config.ts"]
|
|
10
10
|
});
|
|
11
11
|
const devDependenciesResult = await depcheck(this.cwd, {
|
|
12
|
-
package: omit(this.packageConfig, [
|
|
12
|
+
package: omit(this.packageConfig, ["dependencies"]),
|
|
13
13
|
skipMissing: true,
|
|
14
14
|
...this.config.depcheckConfig,
|
|
15
|
-
ignorePatterns: [
|
|
15
|
+
ignorePatterns: ["!*.spec.ts", "!/fixtures", "!/playwright.config.ts", "eslint.config.ts"]
|
|
16
16
|
});
|
|
17
17
|
const result = {
|
|
18
18
|
dependencies: dependenciesResult.dependencies,
|
|
@@ -24,14 +24,14 @@ export default async function () {
|
|
|
24
24
|
};
|
|
25
25
|
const errorMessage = [...(result.dependencies.length > 0 ? [endent`
|
|
26
26
|
Unused dependencies
|
|
27
|
-
${result.dependencies.map(dep => `* ${dep}`).join(
|
|
27
|
+
${result.dependencies.map(dep => `* ${dep}`).join("\n")}
|
|
28
28
|
`] : []), ...(result.devDependencies.length > 0 ? [endent`
|
|
29
29
|
Unused devDependencies
|
|
30
|
-
${result.devDependencies.map(dep => `* ${dep}`).join(
|
|
30
|
+
${result.devDependencies.map(dep => `* ${dep}`).join("\n")}
|
|
31
31
|
`] : []), ...(isEmpty(result.invalidFiles) ? [] : [endent`
|
|
32
32
|
Invalid files
|
|
33
|
-
${Object.values(mapValues(result.invalidFiles, (error, name) => `* ${name}: ${error}`)).join(
|
|
34
|
-
`])].join(
|
|
33
|
+
${Object.values(mapValues(result.invalidFiles, (error, name) => `* ${name}: ${error}`)).join("\n")}
|
|
34
|
+
`])].join("\n\n");
|
|
35
35
|
if (errorMessage) {
|
|
36
36
|
throw new Error(errorMessage);
|
|
37
37
|
}
|
|
@@ -1,21 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import pathLib from "node:path";
|
|
2
|
+
import { execaCommand } from "execa";
|
|
3
|
+
import { globby } from "globby";
|
|
4
|
+
import parsePackagejsonName from "parse-packagejson-name";
|
|
5
|
+
import ts from "typescript";
|
|
3
6
|
export default async function (options) {
|
|
4
7
|
options = {
|
|
5
|
-
log: process.env.NODE_ENV !==
|
|
6
|
-
stderr:
|
|
8
|
+
log: process.env.NODE_ENV !== "test",
|
|
9
|
+
stderr: "inherit",
|
|
7
10
|
...options
|
|
8
11
|
};
|
|
9
12
|
const packageName = parsePackagejsonName(this.packageConfig.name).fullName;
|
|
10
|
-
if (this.config.git !==
|
|
13
|
+
if (this.config.git !== void 0 && packageName !== this.config.git.project) {
|
|
11
14
|
throw new Error(`Package name '${packageName}' has to be equal to repository name '${this.config.git.project}'`);
|
|
12
15
|
}
|
|
13
16
|
await this.config.lint.call(this, options);
|
|
14
|
-
|
|
17
|
+
const result = await execaCommand("eslint --fix --no-error-on-unmatched-pattern .", {
|
|
15
18
|
...(options.log && {
|
|
16
|
-
stdout:
|
|
19
|
+
stdout: "inherit"
|
|
17
20
|
}),
|
|
18
21
|
cwd: this.cwd,
|
|
19
22
|
stderr: options.stderr
|
|
20
23
|
});
|
|
24
|
+
const {
|
|
25
|
+
config
|
|
26
|
+
} = ts.readConfigFile(pathLib.join(this.cwd, "tsconfig.json"), ts.sys.readFile);
|
|
27
|
+
const {
|
|
28
|
+
fileNames
|
|
29
|
+
} = ts.parseJsonConfigFileContent(config, ts.sys, this.cwd);
|
|
30
|
+
const vueFiles = await globby("**/*.vue", {
|
|
31
|
+
cwd: this.cwd,
|
|
32
|
+
dot: true,
|
|
33
|
+
ignore: ["**/node_modules/**"]
|
|
34
|
+
});
|
|
35
|
+
const allFileNames = [...fileNames, ...vueFiles];
|
|
36
|
+
if (allFileNames.length > 0) {
|
|
37
|
+
await execaCommand("vue-tsc --noEmit", {
|
|
38
|
+
...(options.log && {
|
|
39
|
+
stdout: "inherit"
|
|
40
|
+
}),
|
|
41
|
+
cwd: this.cwd,
|
|
42
|
+
stderr: options.stderr
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
21
46
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { createRequire } from
|
|
2
|
-
import pathLib from
|
|
3
|
-
import packageName from
|
|
4
|
-
import { execa, execaCommand } from
|
|
5
|
-
import fs from
|
|
6
|
-
import outputFiles from
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import pathLib from "node:path";
|
|
3
|
+
import packageName from "depcheck-package-name";
|
|
4
|
+
import { execa, execaCommand } from "execa";
|
|
5
|
+
import fs from "fs-extra";
|
|
6
|
+
import outputFiles from "output-files";
|
|
7
7
|
const resolver = createRequire(import.meta.url);
|
|
8
8
|
const commitlintPackageConfig = resolver(packageName`@commitlint/cli/package.json`);
|
|
9
9
|
export default async function (options) {
|
|
10
10
|
options = {
|
|
11
|
-
log: process.env.NODE_ENV !==
|
|
12
|
-
stderr:
|
|
11
|
+
log: process.env.NODE_ENV !== "test",
|
|
12
|
+
stderr: "inherit",
|
|
13
13
|
...options
|
|
14
14
|
};
|
|
15
15
|
await outputFiles(this.cwd, this.generatedFiles);
|
|
16
|
-
if (await fs.exists(pathLib.join(this.cwd,
|
|
17
|
-
await execaCommand(
|
|
16
|
+
if (await fs.exists(pathLib.join(this.cwd, ".git"))) {
|
|
17
|
+
await execaCommand("husky install", {
|
|
18
18
|
cwd: this.cwd,
|
|
19
19
|
...(options.log && {
|
|
20
|
-
stdout:
|
|
20
|
+
stdout: "inherit"
|
|
21
21
|
}),
|
|
22
22
|
stderr: options.stderr
|
|
23
23
|
});
|
|
24
|
-
await execa(
|
|
24
|
+
await execa("husky", ["set", ".husky/commit-msg", `npx ${Object.keys(commitlintPackageConfig.bin)[0]} --edit "$1"`], {
|
|
25
25
|
cwd: this.cwd,
|
|
26
26
|
...(options.log && {
|
|
27
|
-
stdout:
|
|
27
|
+
stdout: "inherit"
|
|
28
28
|
}),
|
|
29
29
|
stderr: options.stderr
|
|
30
30
|
});
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { userInfo as getUserInfo } from
|
|
2
|
-
import { constantCase } from
|
|
3
|
-
import { execa } from
|
|
4
|
-
import { findUpSync } from
|
|
5
|
-
import fs from
|
|
1
|
+
import { userInfo as getUserInfo } from "node:os";
|
|
2
|
+
import { constantCase } from "change-case";
|
|
3
|
+
import { execa } from "execa";
|
|
4
|
+
import { findUpSync } from "find-up";
|
|
5
|
+
import fs from "fs-extra";
|
|
6
6
|
export default async function (options) {
|
|
7
7
|
options = {
|
|
8
|
-
log: process.env.NODE_ENV !==
|
|
8
|
+
log: process.env.NODE_ENV !== "test",
|
|
9
9
|
patterns: [],
|
|
10
|
-
stderr:
|
|
10
|
+
stderr: "inherit",
|
|
11
11
|
...options
|
|
12
12
|
};
|
|
13
|
-
const volumeName = this.packageConfig.name.replace(
|
|
14
|
-
const envSchemaPath = findUpSync(
|
|
13
|
+
const volumeName = this.packageConfig.name.replace("@", "").replace("/", "-");
|
|
14
|
+
const envSchemaPath = findUpSync(".env.schema.json", {
|
|
15
15
|
cwd: this.cwd
|
|
16
16
|
});
|
|
17
17
|
const envVariableNames = Object.keys(envSchemaPath ? await fs.readJson(envSchemaPath) : {}).map(name => `TEST_${constantCase(name)}`);
|
|
18
18
|
const userInfo = getUserInfo();
|
|
19
19
|
try {
|
|
20
|
-
return await execa(
|
|
20
|
+
return await execa("docker", ["run", "--rm", ...envVariableNames.filter(name => process.env[name] !== void 0).flatMap(name => ["--env", `${name}=${process.env[name]}`]), "-v", `${this.cwd}:/app`, "-v", `${volumeName}:/app/node_modules`, "dworddesign/testing:latest", "bash", "-c", ["pnpm install --frozen-lockfile", "&&", "pnpm test:raw", ...(options.updateSnapshots ? [" --update-snapshots"] : []), ...options.patterns.map(pattern => `"${pattern}"`), ...(options.grep ? [`-g "${options.grep}"`] : [])].join(" ")], {
|
|
21
21
|
cwd: this.cwd,
|
|
22
22
|
...(options.log && {
|
|
23
|
-
stdout:
|
|
23
|
+
stdout: "inherit"
|
|
24
24
|
}),
|
|
25
25
|
stderr: options.stderr
|
|
26
26
|
});
|
|
27
27
|
} finally {
|
|
28
|
-
await execa(
|
|
28
|
+
await execa("docker", ["run", "--rm", "--tty", "-v", `${this.cwd}:/app`, "-v", `${volumeName}:/app/node_modules`, "dworddesign/testing:latest", "bash", "-c", `chown -R ${userInfo.uid}:${userInfo.gid} /app`], {
|
|
29
29
|
cwd: this.cwd
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Ajv from
|
|
2
|
-
import packageName from
|
|
3
|
-
import endent from
|
|
4
|
-
import { execa } from
|
|
1
|
+
import Ajv from "ajv";
|
|
2
|
+
import packageName from "depcheck-package-name";
|
|
3
|
+
import endent from "endent";
|
|
4
|
+
import { execa } from "execa";
|
|
5
5
|
import isCI from "./is-ci.js";
|
|
6
6
|
import packageJsonSchema from "./package-json-schema.js";
|
|
7
7
|
const ajv = new Ajv({
|
|
@@ -10,9 +10,9 @@ const ajv = new Ajv({
|
|
|
10
10
|
const validatePackageJson = ajv.compile(packageJsonSchema);
|
|
11
11
|
export default async function (options) {
|
|
12
12
|
options = {
|
|
13
|
-
log: process.env.NODE_ENV !==
|
|
13
|
+
log: process.env.NODE_ENV !== "test",
|
|
14
14
|
patterns: [],
|
|
15
|
-
stderr:
|
|
15
|
+
stderr: "inherit",
|
|
16
16
|
...options
|
|
17
17
|
};
|
|
18
18
|
if (options.patterns.length === 0) {
|
|
@@ -27,21 +27,21 @@ export default async function (options) {
|
|
|
27
27
|
}
|
|
28
28
|
const runDockerTests = !isCI({
|
|
29
29
|
cwd: this.cwd
|
|
30
|
-
}) || ![
|
|
31
|
-
return execa(packageName`c8`, [
|
|
30
|
+
}) || !["win32", "darwin"].includes(process.platform);
|
|
31
|
+
return execa(packageName`c8`, ["playwright", "test", "--pass-with-no-tests", ...(runDockerTests ? [] : ["--grep-invert", "@usesdocker"]), ...(options.updateSnapshots ? ["--update-snapshots"] : []), ...(options.ui ? ["--ui"] : []), ...(options.uiHost ? ["--ui-host", options.uiHost] : []), ...(options.grep ? ["--grep", options.grep] : []), "--trace", "retain-on-failure", ...(isCI({
|
|
32
32
|
cwd: this.cwd
|
|
33
|
-
}) ? [
|
|
33
|
+
}) ? ["--forbid-only"] : []),
|
|
34
34
|
/**
|
|
35
35
|
* Reporter set to dot in CI environments by default.
|
|
36
36
|
* See https://github.com/microsoft/playwright/blob/42ade54975f6990c41cddc7b6e11c46a36648d0d/packages/playwright/src/common/config.ts#L301.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
"--reporter", "list", ...options.patterns], {
|
|
39
39
|
cwd: this.cwd,
|
|
40
40
|
env: {
|
|
41
|
-
NODE_ENV:
|
|
41
|
+
NODE_ENV: "test"
|
|
42
42
|
},
|
|
43
43
|
...(options.log && {
|
|
44
|
-
stdout:
|
|
44
|
+
stdout: "inherit"
|
|
45
45
|
}),
|
|
46
46
|
stderr: options.stderr
|
|
47
47
|
});
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import packageNameRegex from
|
|
1
|
+
import packageNameRegex from "package-name-regex";
|
|
2
2
|
const distPattern = /^\.\/dist\//;
|
|
3
3
|
export default {
|
|
4
4
|
properties: {
|
|
5
5
|
baseConfig: {
|
|
6
6
|
properties: {
|
|
7
7
|
depcheckConfig: {
|
|
8
|
-
type:
|
|
8
|
+
type: "object"
|
|
9
9
|
},
|
|
10
10
|
name: {
|
|
11
|
-
type:
|
|
11
|
+
type: "string"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
type: [
|
|
14
|
+
type: ["string", "object"]
|
|
15
15
|
},
|
|
16
16
|
bin: {
|
|
17
17
|
additionalProperties: {
|
|
18
18
|
pattern: distPattern.source,
|
|
19
|
-
type:
|
|
19
|
+
type: "string"
|
|
20
20
|
},
|
|
21
21
|
pattern: distPattern.source,
|
|
22
|
-
type: [
|
|
22
|
+
type: ["object", "string"]
|
|
23
23
|
},
|
|
24
24
|
dependencies: {
|
|
25
25
|
additionalProperties: {
|
|
26
|
-
type:
|
|
26
|
+
type: "string"
|
|
27
27
|
},
|
|
28
|
-
type:
|
|
28
|
+
type: "object"
|
|
29
29
|
},
|
|
30
30
|
description: {
|
|
31
|
-
type:
|
|
31
|
+
type: "string"
|
|
32
32
|
},
|
|
33
33
|
devDependencies: {
|
|
34
34
|
additionalProperties: {
|
|
35
|
-
type:
|
|
35
|
+
type: "string"
|
|
36
36
|
},
|
|
37
|
-
type:
|
|
37
|
+
type: "object"
|
|
38
38
|
},
|
|
39
39
|
keywords: {
|
|
40
40
|
items: {
|
|
41
|
-
type:
|
|
41
|
+
type: "string"
|
|
42
42
|
},
|
|
43
|
-
type:
|
|
43
|
+
type: "array"
|
|
44
44
|
},
|
|
45
45
|
name: {
|
|
46
46
|
pattern: packageNameRegex.source,
|
|
47
|
-
type:
|
|
47
|
+
type: "string"
|
|
48
48
|
},
|
|
49
49
|
packageManager: {
|
|
50
|
-
type:
|
|
50
|
+
type: "string"
|
|
51
51
|
},
|
|
52
52
|
pnpm: {
|
|
53
53
|
properties: {
|
|
54
54
|
overrides: {
|
|
55
55
|
additionalProperties: {
|
|
56
|
-
type:
|
|
56
|
+
type: "string"
|
|
57
57
|
},
|
|
58
|
-
type:
|
|
58
|
+
type: "object"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
-
type:
|
|
61
|
+
type: "object"
|
|
62
62
|
},
|
|
63
63
|
version: {
|
|
64
|
-
type:
|
|
64
|
+
type: "string"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
type:
|
|
67
|
+
type: "object"
|
|
68
68
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import pathLib from
|
|
2
|
-
export default name => filePath => pathLib.basename(filePath) ===
|
|
1
|
+
import pathLib from "node:path";
|
|
2
|
+
export default name => filePath => pathLib.basename(filePath) === "package.json" && name !== "@dword-design/base-config-node" ? [name] : [];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import packageName from
|
|
1
|
+
import packageName from "depcheck-package-name";
|
|
2
2
|
export default {
|
|
3
3
|
extends: [packageName`@commitlint/config-conventional`],
|
|
4
4
|
rules: {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
"body-max-line-length": [0],
|
|
6
|
+
"footer-max-line-length": [0]
|
|
7
7
|
}
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default [
|
|
1
|
+
export default [".commitlintrc.json", ".cz.json", ".devcontainer", ".editorconfig", "eslint.config.ts", ".gitattributes", ".github", ".gitignore", ".gitpod.Dockerfile", ".gitpod.yml", ".husky", ".npmrc", ".nyc_output", ".releaserc.json", ".renovaterc.json", ".vscode", "CHANGELOG.md", "coverage", "LICENSE.md", "node_modules", "pnpm-lock.yaml"];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import packageName from
|
|
2
|
-
import endent from
|
|
1
|
+
import packageName from "depcheck-package-name";
|
|
2
|
+
import endent from "endent";
|
|
3
3
|
export default function () {
|
|
4
4
|
return this.config.eslintConfig || endent`
|
|
5
|
-
${this.packageConfig.name ===
|
|
5
|
+
${this.packageConfig.name === "@dword-design/eslint-config" ? endent`
|
|
6
6
|
import { defineConfig, globalIgnores } from '${packageName`eslint`}/config';
|
|
7
7
|
|
|
8
8
|
import config from './src';
|
|
@@ -3,14 +3,14 @@ export default function (): {
|
|
|
3
3
|
build: {
|
|
4
4
|
'runs-on': string;
|
|
5
5
|
steps: ({
|
|
6
|
-
uses:
|
|
6
|
+
uses: any;
|
|
7
7
|
with?: undefined;
|
|
8
8
|
} | {
|
|
9
|
-
uses:
|
|
9
|
+
uses: any;
|
|
10
10
|
with: {
|
|
11
11
|
commitMessage: string;
|
|
12
12
|
githubToken: string;
|
|
13
|
-
syncKeywords
|
|
13
|
+
syncKeywords?: boolean | undefined;
|
|
14
14
|
approve: boolean;
|
|
15
15
|
};
|
|
16
16
|
})[];
|