Skip to content

Commit 8e2b97e

Browse files
authored
Merge branch 'main' into feature/AR-47597-wf-status-icon
2 parents 3fefc53 + 0558bf9 commit 8e2b97e

15 files changed

Lines changed: 1371 additions & 1320 deletions

File tree

.changeset/loud-worms-film.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@drivenets/eslint-plugin-design-system': patch
3+
---
4+
5+
Add support for ESLint 10

.changeset/old-kiwis-change.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@drivenets/design-system': patch
3+
---
4+
5+
Update dependencies

.github/scripts/generate-dependabot-changeset.ts

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,82 @@ import path from 'node:path';
22
import fs from 'node:fs/promises';
33
import { promisify } from 'node:util';
44
import { exec } from 'node:child_process';
5+
import * as oxfmt from 'oxfmt';
56
import * as git from '@changesets/git';
7+
import getChangesets from '@changesets/read';
68
import writeChangeset from '@changesets/write';
79
import { type Changeset } from '@changesets/types';
810
import { shouldSkipPackage } from '@changesets/should-skip-package';
11+
import oxfmtConfig from '../../.oxfmtrc.json' with { type: 'json' };
912
import changesetConfig from '../../.changeset/config.json' with { type: 'json' };
1013

1114
const execAsync = promisify(exec);
1215

1316
const BASE_BRANCH = 'origin/' + changesetConfig.baseBranch;
1417
const ROOT_DIR = path.resolve(import.meta.dirname, '../../');
1518

19+
const changedPackages = await getVersionableChangedPackages();
20+
21+
const newChangeset: Changeset = {
22+
summary: 'Update dependencies',
23+
releases: changedPackages.map((pkg) => ({
24+
name: pkg.packageJson.name,
25+
type: 'patch',
26+
})),
27+
};
28+
1629
const existingChangeset = await getExistingChangeset();
1730

1831
if (existingChangeset) {
19-
await fs.rm(existingChangeset);
20-
}
32+
if (changesetsAreEqual(existingChangeset, newChangeset)) {
33+
console.log('Changeset is already up to date');
34+
process.exit(0);
35+
}
2136

22-
const changedPackages = await getVersionableChangedPackages();
37+
await removeChangeset(existingChangeset.id);
38+
39+
console.log('Removed outdated changeset');
40+
}
2341

2442
if (changedPackages.length === 0) {
2543
console.log('No changed packages found');
2644
process.exit(0);
2745
}
2846

29-
const changeset: Changeset = {
30-
summary: 'Update dependencies',
31-
releases: changedPackages.map((pkg) => ({
32-
name: pkg.packageJson.name,
33-
type: 'patch',
34-
})),
35-
};
47+
const changesetId = await writeChangeset(newChangeset, ROOT_DIR);
48+
49+
await formatChangeset(changesetId);
3650

37-
await writeChangeset(changeset, ROOT_DIR);
51+
console.log('Added new changeset');
3852

3953
await git.add('-A', ROOT_DIR);
4054
await git.commit('chore: update changeset', ROOT_DIR);
4155

4256
await execAsync('git push', { cwd: ROOT_DIR });
4357

4458
async function getExistingChangeset() {
45-
const changedFiles = await git.getChangedFilesSince({
46-
cwd: ROOT_DIR,
47-
ref: BASE_BRANCH,
48-
});
59+
return (await getChangesets(ROOT_DIR, BASE_BRANCH)).find(
60+
(changeset) => changeset.summary === newChangeset.summary,
61+
);
62+
}
4963

50-
return changedFiles.find((file) => file.startsWith('.changeset/') && file.endsWith('.md'));
64+
async function removeChangeset(changesetId: string) {
65+
const changesetPath = getChangesetPath(changesetId);
66+
67+
await fs.rm(changesetPath);
68+
}
69+
70+
async function formatChangeset(changesetId: string) {
71+
const changesetPath = getChangesetPath(changesetId);
72+
73+
const changeset = await fs.readFile(changesetPath, 'utf8');
74+
const formattedChangeset = await oxfmt.format(changesetPath, changeset, oxfmtConfig as oxfmt.FormatOptions);
75+
76+
await fs.writeFile(changesetPath, formattedChangeset.code);
77+
}
78+
79+
function getChangesetPath(changesetId: string) {
80+
return path.resolve(ROOT_DIR, '.changeset', changesetId + '.md');
5181
}
5282

5383
// Inspired by:
@@ -66,3 +96,10 @@ async function getVersionableChangedPackages() {
6696
}),
6797
);
6898
}
99+
100+
function changesetsAreEqual(changeset1: Changeset, changeset2: Changeset) {
101+
return (
102+
changeset1.summary === changeset2.summary &&
103+
JSON.stringify(changeset1.releases) === JSON.stringify(changeset2.releases)
104+
);
105+
}

.github/workflows/dependabot-changeset.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ jobs:
1616
# NEVER REMOVE THIS CONDITION!
1717
# We're using `pull_request_target` in order to have write access to the base repository
1818
# so we'll be able to commit the changeset file.
19-
# Removing this condition could give privileged access to a potential attacker.
20-
if: github.event.pull_request.user.login == 'dependabot[bot]'
19+
# Removing the user check could give privileged access to a potential attacker.
20+
if: |
21+
github.event.pull_request.user.login == 'dependabot[bot]' &&
22+
! contains(github.event.pull_request.title, 'development group')
2123
2224
runs-on: ubuntu-latest
2325

.github/workflows/security.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ jobs:
4747
persist-credentials: false
4848

4949
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
50+
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
5151
with:
5252
languages: ${{ matrix.language }}
5353
queries: +security-extended
5454

5555
- name: Perform CodeQL Analysis
56-
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
56+
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
5757
with:
5858
category: '/language:${{matrix.language}}'

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"recommendations": ["oxc.oxc-vscode"]
2+
"recommendations": ["oxc.oxc-vscode", "dbaeumer.vscode-eslint", "streetsidesoftware.code-spell-checker"]
33
}

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
2+
// This matches the value configured on .oxfmtrc.json
3+
"editor.rulers": [110],
4+
25
"oxc.fmt.configPath": ".oxfmtrc.json",
3-
"editor.defaultFormatter": "oxc.oxc-vscode"
6+
"editor.defaultFormatter": "oxc.oxc-vscode",
7+
8+
"typescript.tsdk": "node_modules/typescript/lib"
49
}

cspell.json

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
33
"enableGlobDot": true,
44
"useGitignore": true,
5+
"dictionaries": ["typescript", "npm", "filetypes", "softwareTerms"],
56
"words": [
67
"attw",
78
"autoboot",
@@ -23,26 +24,11 @@
2324
"Oxfmt",
2425
"reorderable",
2526
"retryable",
26-
"stylesheet",
2727
"subcomponents",
2828
"syncpack",
2929
"tosorted",
3030
"Turborepo",
31-
"unhover",
32-
"vite",
33-
"Vitest"
31+
"unhover"
3432
],
35-
"ignorePaths": [
36-
".cursor",
37-
".git",
38-
".github",
39-
".idea",
40-
".vscode",
41-
".cspell",
42-
".turbo",
43-
".DS_Store",
44-
"**/dist/**",
45-
"**/node_modules/**",
46-
"pnpm-lock.yaml"
47-
]
33+
"ignorePaths": [".cursor", ".git", ".github", ".vscode", ".cspell", "pnpm-lock.yaml"]
4834
}

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,28 @@
2929
"devDependencies": {
3030
"@changesets/cli": "^2.29.8",
3131
"@changesets/git": "^3.0.4",
32+
"@changesets/read": "^0.6.6",
3233
"@changesets/should-skip-package": "^0.1.2",
3334
"@changesets/types": "^6.1.0",
3435
"@changesets/write": "^0.4.0",
35-
"@commitlint/cli": "^20.4.1",
36-
"@commitlint/config-conventional": "^20.4.1",
36+
"@commitlint/cli": "^20.4.2",
37+
"@commitlint/config-conventional": "^20.4.2",
3738
"@commitlint/types": "^20.4.0",
3839
"@drivenets/commitlint-plugin-design-system": "workspace:*",
3940
"@eslint/core": "^1.1.0",
40-
"@eslint/js": "^9.39.2",
41+
"@eslint/js": "^10.0.1",
4142
"@types/node": "^25.3.0",
4243
"@vitest/eslint-plugin": "^1.6.9",
4344
"cspell": "^9.6.4",
44-
"eslint": "^9.39.2",
45+
"eslint": "^10.0.1",
4546
"eslint-import-resolver-typescript": "^4.4.4",
4647
"eslint-plugin-import-x": "^4.16.1",
4748
"eslint-plugin-unicorn": "^63.0.0",
4849
"globals": "^17.3.0",
4950
"husky": "^9.1.7",
50-
"knip": "^5.84.1",
51+
"knip": "^5.85.0",
5152
"lint-staged": "^16.2.7",
52-
"oxfmt": "^0.33.0",
53+
"oxfmt": "^0.34.0",
5354
"playwright": "^1.58.2",
5455
"syncpack": "^14.0.0",
5556
"turbo": "^2.8.10",
@@ -76,7 +77,8 @@
7677
"string.prototype.includes": "npm:@nolyfill/string.prototype.includes@^1",
7778
"string.prototype.matchall": "npm:@nolyfill/string.prototype.matchall@^1",
7879
"string.prototype.repeat": "npm:@nolyfill/string.prototype.repeat@^1",
79-
"esbuild@<=0.24.2": ">=0.25.0"
80+
"esbuild@<=0.24.2": ">=0.25.0",
81+
"eslint": "^10.0.1"
8082
}
8183
}
8284
}

packages/commitlint-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@commitlint/types": "^20.2.0"
2626
},
2727
"devDependencies": {
28-
"eslint": "^9.39.2",
28+
"eslint": "^10.0.1",
2929
"typescript": "^5.9.3"
3030
}
3131
}

0 commit comments

Comments
 (0)