@dword-design/base 16.2.5 → 16.2.7

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.
@@ -2,6 +2,7 @@ import depcheck from "depcheck";
2
2
  import endent from "endent";
3
3
  import { isEmpty, mapValues, omit } from "lodash-es";
4
4
  export default async function () {
5
+ const dependenciesTypes = Object.keys(this.packageConfig.dependencies ?? {}).filter(dependency => dependency.startsWith("@types/"));
5
6
  const dependenciesResult = await depcheck(this.cwd, {
6
7
  package: omit(this.packageConfig, ["devDependencies"]),
7
8
  skipMissing: true,
@@ -22,7 +23,10 @@ export default async function () {
22
23
  ...devDependenciesResult.invalidFiles
23
24
  }
24
25
  };
25
- const errorMessage = [...(result.dependencies.length > 0 ? [endent`
26
+ const errorMessage = [...(dependenciesTypes.length > 0 ? [endent`
27
+ Types dependencies should be in devDependencies
28
+ ${dependenciesTypes.map(dep => `* ${dep}`).join("\n")}
29
+ `] : []), ...(result.dependencies.length > 0 ? [endent`
26
30
  Unused dependencies
27
31
  ${result.dependencies.map(dep => `* ${dep}`).join("\n")}
28
32
  `] : []), ...(result.devDependencies.length > 0 ? [endent`
@@ -1,12 +1,22 @@
1
1
  import jobMatrixStrategy from "./strategies/job-matrix.js";
2
2
  import simpleStrategy from "./strategies/simple.js";
3
3
  export default function () {
4
+ const environments = [...this.config.supportedNodeVersions.map(version => ({
5
+ node: version,
6
+ os: "ubuntu-latest"
7
+ })), ...(this.config.macos ? [{
8
+ node: this.config.nodeVersion,
9
+ os: "macos-latest"
10
+ }] : []), ...(this.config.windows ? [{
11
+ node: this.config.nodeVersion,
12
+ os: "windows-latest"
13
+ }] : [])];
4
14
  return {
5
15
  concurrency: {
6
16
  "cancel-in-progress": true,
7
17
  group: "${{ github.workflow }}-${{ github.ref }}"
8
18
  },
9
- jobs: (this.config.useJobMatrix && !this.config.testInContainer ? jobMatrixStrategy : simpleStrategy).call(this),
19
+ jobs: environments.length > 1 && !this.config.testInContainer ? jobMatrixStrategy.call(this, environments) : simpleStrategy.call(this),
10
20
  name: "build",
11
21
  on: {
12
22
  pull_request: {},
@@ -1,4 +1,7 @@
1
- export default function (): {
1
+ export default function (environments: Array<{
2
+ node: string;
3
+ os: string;
4
+ }>): {
2
5
  release: {
3
6
  needs: string;
4
7
  'runs-on': string;
@@ -9,7 +12,10 @@ export default function (): {
9
12
  steps: any[];
10
13
  strategy: {
11
14
  matrix: {
12
- include: any[];
15
+ include: {
16
+ node: string;
17
+ os: string;
18
+ }[];
13
19
  };
14
20
  };
15
21
  };
@@ -7,7 +7,7 @@ import gitHubAction from "tagged-template-noop";
7
7
  import coverageSteps from "../steps/coverage.js";
8
8
  import getReleaseSteps from "../steps/get-release.js";
9
9
  import getTestSteps from "../steps/get-test.js";
10
- export default function () {
10
+ export default function (environments) {
11
11
  const envSchemaPath = findUpSync(path => {
12
12
  if (fs.existsSync(pathLib.join(path, ".env.schema.json"))) {
13
13
  return ".env.schema.json";
@@ -79,21 +79,12 @@ export default function () {
79
79
  }, {
80
80
  run: "pnpm install --frozen-lockfile"
81
81
  }, ...getTestSteps.call(this), ...coverageSteps.map(step => ({
82
- if: `matrix.os == 'ubuntu-latest' && matrix.node == ${this.config.nodeVersion}`,
82
+ if: `matrix.os == 'ubuntu-latest'${this.config.supportedNodeVersions.length > 1 ? ` && matrix.node == ${this.config.nodeVersion}` : ""}`,
83
83
  ...step
84
84
  }))],
85
85
  strategy: {
86
86
  matrix: {
87
- include: [...this.config.supportedNodeVersions.map(version => ({
88
- node: version,
89
- os: "ubuntu-latest"
90
- })), ...(this.config.macos ? [{
91
- node: this.config.nodeVersion,
92
- os: "macos-latest"
93
- }] : []), ...(this.config.windows ? [{
94
- node: this.config.nodeVersion,
95
- os: "windows-latest"
96
- }] : [])]
87
+ include: environments
97
88
  }
98
89
  }
99
90
  }
package/dist/index.d.ts CHANGED
@@ -49,7 +49,6 @@ type Config = {
49
49
  windows: boolean;
50
50
  testInContainer: boolean;
51
51
  eslintConfig: string;
52
- useJobMatrix: boolean;
53
52
  packageConfig: PackageJson;
54
53
  renovateConfig: RenovateConfig;
55
54
  isLockFileFixCommitType: boolean;
package/dist/index.js CHANGED
@@ -205,12 +205,11 @@ class Base {
205
205
  `,
206
206
  renovateConfig: {},
207
207
  seeAlso: [],
208
- supportedNodeVersions: [22, 24],
208
+ supportedNodeVersions: [22],
209
209
  syncKeywords: true,
210
210
  testInContainer: false,
211
211
  typecheck: () => {},
212
212
  typescriptConfig: {},
213
- useJobMatrix: true,
214
213
  windows: true
215
214
  };
216
215
  const inheritedConfigPath = config.name && config.name === this.packageConfig.name ? pathLib.resolve(this.cwd, "src", "index.ts") : config.name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base",
3
- "version": "16.2.5",
3
+ "version": "16.2.7",
4
4
  "description": "Base package for projects.",
5
5
  "repository": "dword-design/base",
6
6
  "funding": "https://github.com/sponsors/dword-design",