@dword-design/base 16.2.5 → 16.2.6

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.
@@ -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.6",
4
4
  "description": "Base package for projects.",
5
5
  "repository": "dword-design/base",
6
6
  "funding": "https://github.com/sponsors/dword-design",