@dword-design/base 15.2.4 → 15.3.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.
@@ -11,12 +11,12 @@ export default async function () {
11
11
  ".husky/post-checkout": true,
12
12
  ".husky/post-commit": true,
13
13
  ".husky/post-merge": true,
14
+ ".husky/pre-commit": true,
14
15
  ".husky/pre-push": true,
15
16
  "CHANGELOG.md": true,
16
17
  PRCHECKLIST: true,
17
18
  demo: true,
18
19
  doc: true,
19
- "eslint.config.ts": true,
20
20
  fixtures: true,
21
21
  "pnpm-lock.yaml": true,
22
22
  "pnpm-workspace.yaml": true
@@ -28,6 +28,13 @@ export default async function (options) {
28
28
  }),
29
29
  stderr: options.stderr
30
30
  });
31
+ await execa("husky", ["set", ".husky/pre-commit", `npx ${packageName`lint-staged`}`], {
32
+ cwd: this.cwd,
33
+ ...(options.log && {
34
+ stdout: "inherit"
35
+ }),
36
+ stderr: options.stderr
37
+ });
31
38
  }
32
39
  await this.config.prepare.call(this, options);
33
40
  }
@@ -1 +1 @@
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", "codecov", "codecov.SHA256SUM", "codecov.SHA256SUM.sig", "coverage", "LICENSE.md", "node_modules", "pnpm-lock.yaml"];
1
+ export default [".commitlintrc.json", ".cz.json", ".devcontainer", ".editorconfig", "eslint.config.ts", "eslint.lint-staged.config.ts", ".gitattributes", ".github", ".gitignore", ".gitpod.Dockerfile", ".gitpod.yml", ".husky", ".npmrc", ".nyc_output", ".releaserc.json", ".renovaterc.json", ".vscode", "CHANGELOG.md", "codecov", "codecov.SHA256SUM", "codecov.SHA256SUM.sig", "coverage", "LICENSE.md", "node_modules", "pnpm-lock.yaml"];
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import packageName from "depcheck-package-name";
2
+ import endent from "endent";
3
+ export default endent`
4
+ import { defineConfig } from '${packageName`eslint`}/config';
5
+ import parent from './eslint.config';
6
+
7
+ export default defineConfig([
8
+ parent,
9
+ {
10
+ files: ['**/*.spec.ts'],
11
+ rules: { 'playwright/no-focused-test': 'error' },
12
+ },
13
+ ]);\n
14
+ `;
@@ -12,7 +12,7 @@ export default function () {
12
12
  `}
13
13
 
14
14
  export default defineConfig([
15
- globalIgnores(['eslint.config.ts']),
15
+ globalIgnores(['eslint.config.ts', 'eslint.lint-staged.config.ts']),
16
16
  config,
17
17
  ]);\n
18
18
  `;
@@ -20,7 +20,6 @@ export default function () {
20
20
  RUN brew install gh
21
21
 
22
22
  # Puppeteer dependencies
23
- RUN sudo apt-get update && sudo apt-get install -y libgtk-3-0 libx11-xcb1 libnss3 libxss1 libasound2 libgbm1 libxshmfence1
24
-
23
+ RUN sudo apt-get update && sudo apt-get install -y libgtk-3-0 libx11-xcb1 libnss3 libxss1 libasound2 libgbm1 libxshmfence1\n
25
24
  `;
26
25
  }
@@ -0,0 +1,2 @@
1
+ import type { Configuration as LintStagedConfig } from 'lint-staged';
2
+ export default function (): LintStagedConfig;
@@ -0,0 +1,6 @@
1
+ export default function () {
2
+ return {
3
+ "*.{json,ts,vue}": "eslint --fix --config eslint.lint-staged.config.ts",
4
+ ...this.config.lintStaged
5
+ };
6
+ }
@@ -17,13 +17,15 @@ export default function (): {
17
17
  '.gitignore': any;
18
18
  '.gitpod.Dockerfile': any;
19
19
  '.gitpod.yml': string;
20
- '.npmrc': string;
20
+ '.lintstagedrc.json': string;
21
+ '.npmrc': any;
21
22
  '.releaserc.json': string;
22
23
  '.renovaterc.json': string;
23
24
  '.vscode/settings.json': string;
24
25
  'LICENSE.md': any;
25
26
  'README.md': any;
26
27
  'eslint.config.ts': any;
28
+ 'eslint.lint-staged.config.ts': string;
27
29
  'package.json': string;
28
30
  'tsconfig.json': string;
29
31
  };
@@ -1,9 +1,11 @@
1
+ import { stringify as stringifyIni } from "ini";
1
2
  import sortKeys from "sort-keys";
2
3
  import sortPackageJson from "sort-package-json";
3
4
  import { stringify as yamlStringify } from "yaml";
4
5
  import commitizenConfig from "./commitizen.js";
5
6
  import commitlintConfig from "./commitlint.js";
6
7
  import editorconfigConfig from "./editorconfig.js";
8
+ import eslintLintStaged from "./eslint-lint-staged.js";
7
9
  import gitattributesConfig from "./gitattributes.js";
8
10
  import githubCodespacesPostcreate from "./github-codespaces-postcreate.js";
9
11
  import githubDeprecatedDependenciesConfig from "./github-deprecated-dependencies/index.js";
@@ -47,8 +49,9 @@ export default function () {
47
49
  `).join(""),
48
50
  ".gitpod.Dockerfile": this.getGitpodDockerfile(),
49
51
  ".gitpod.yml": yamlStringify(this.getGitpodConfig()),
50
- ".npmrc": `${npmrc}
52
+ ".lintstagedrc.json": `${JSON.stringify(this.getLintStaged(), void 0, 2)}
51
53
  `,
54
+ ".npmrc": stringifyIni(npmrc),
52
55
  ".releaserc.json": `${JSON.stringify(this.getReleaseConfig(), void 0, 2)}
53
56
  `,
54
57
  ".renovaterc.json": `${JSON.stringify(sortKeys(this.getRenovateConfig(), {
@@ -60,6 +63,7 @@ export default function () {
60
63
  "LICENSE.md": this.getLicenseString(),
61
64
  "README.md": this.getReadmeString(),
62
65
  "eslint.config.ts": this.getEslintConfig(),
66
+ "eslint.lint-staged.config.ts": eslintLintStaged,
63
67
  "package.json": `${JSON.stringify(sortPackageJson(packageConfig), void 0, 2)}
64
68
  `,
65
69
  "tsconfig.json": `${JSON.stringify(sortKeys(this.getTypescriptConfig(), {
@@ -1,2 +1,5 @@
1
- declare const _default: "node-linker=hoisted";
1
+ declare const _default: {
2
+ 'auto-install-peers': boolean;
3
+ 'node-linker': string;
4
+ };
2
5
  export default _default;
@@ -1 +1,4 @@
1
- export default "node-linker=hoisted";
1
+ export default {
2
+ "auto-install-peers": false,
3
+ "node-linker": "hoisted"
4
+ };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
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 { Configuration as LintStagedConfig } from 'lint-staged';
4
5
  import type { PartialCommandObjectInObject } from 'make-cli';
5
6
  import type { RenovateConfig } from 'renovate/dist/config/types';
6
7
  import type { PackageJson, TsConfigJson } from 'type-fest';
@@ -27,6 +28,7 @@ type Config = {
27
28
  git?: GitHost;
28
29
  gitignore: string[];
29
30
  hasTypescriptConfigRootAlias: boolean;
31
+ lintStagedConfig: LintStagedConfig;
30
32
  lint: (options?: PartialCommandOptions) => unknown;
31
33
  typecheck: (options?: PartialCommandOptions) => unknown;
32
34
  macos: boolean;
@@ -91,6 +93,7 @@ declare class Base<TConfig extends Config = Config> {
91
93
  getRenovateConfig(...args: any[]): any;
92
94
  getVscodeConfig(...args: any[]): any;
93
95
  getTypescriptConfig(...args: any[]): any;
96
+ getLintStaged(): any;
94
97
  constructor(configInput?: PartialConfig<TConfig>, { cwd }?: {
95
98
  cwd?: string | undefined;
96
99
  });
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ import getGitignoreConfig from "./get-generated-files/get-gitignore/index.js";
31
31
  import getGitpodConfig from "./get-generated-files/get-gitpod/index.js";
32
32
  import getGitpodDockerfile from "./get-generated-files/get-gitpod-dockerfile.js";
33
33
  import getLicenseString from "./get-generated-files/get-license-string.js";
34
+ import getLintStaged from "./get-generated-files/get-lint-staged.js";
34
35
  import getPackageConfig from "./get-generated-files/get-package-config/index.js";
35
36
  import getReadmeString from "./get-generated-files/get-readme-string/index.js";
36
37
  import getReleaseConfig from "./get-generated-files/get-release/index.js";
@@ -131,6 +132,9 @@ class Base {
131
132
  getTypescriptConfig(...args) {
132
133
  return getTypescriptConfig.call(this, ...args);
133
134
  }
135
+ getLintStaged() {
136
+ return getLintStaged.call(this);
137
+ }
134
138
  constructor(configInput = null, {
135
139
  cwd = "."
136
140
  } = {}) {
@@ -180,6 +184,7 @@ class Base {
180
184
  hasTypescriptConfigRootAlias: true,
181
185
  isLockFileFixCommitType: false,
182
186
  lint: () => {},
187
+ lintStagedConfig: {},
183
188
  macos: true,
184
189
  minNodeVersion: null,
185
190
  nodeVersion: 20,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base",
3
- "version": "15.2.4",
3
+ "version": "15.3.0",
4
4
  "description": "Base package for projects.",
5
5
  "repository": "dword-design/base",
6
6
  "funding": "https://github.com/sponsors/dword-design",
@@ -38,7 +38,7 @@
38
38
  "@dword-design/base-config-node": "^4.0.0",
39
39
  "@dword-design/ci": "^5.0.0",
40
40
  "@dword-design/defu": "^1.0.3",
41
- "@dword-design/eslint-config": "^8.0.0",
41
+ "@dword-design/eslint-config": "^8.0.3",
42
42
  "@dword-design/personal-data": "^3.0.0",
43
43
  "@semantic-release/changelog": "^6.0.3",
44
44
  "@semantic-release/git": "^10.0.1",
@@ -63,6 +63,7 @@
63
63
  "hosted-git-info": "^8.0.0",
64
64
  "husky": "^8.0.3",
65
65
  "ignore": "^7.0.0",
66
+ "ini": "^5.0.0",
66
67
  "is-ci": "^4.0.0",
67
68
  "jiti": "^2.4.2",
68
69
  "lodash-es": "^4.17.21",
@@ -90,6 +91,7 @@
90
91
  "@playwright/test": "^1.54.1",
91
92
  "@types/hosted-git-info": "^3.0.5",
92
93
  "@types/parse-git-config": "^3.0.4",
94
+ "lint-staged": "^16.1.2",
93
95
  "p-event": "^6.0.1",
94
96
  "renovate": "^39.264.1",
95
97
  "sharp": "^0.34.3",