Skip to content

Commit 7e137b1

Browse files
committed
Merge remote-tracking branch 'origin/main' into loop
2 parents 7cd28f4 + b8584f3 commit 7e137b1

15 files changed

Lines changed: 166 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,10 @@ jobs:
3232

3333
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
3434
name: Install pnpm
35-
with:
36-
cache: true
37-
38-
- name: 📦 Install dependencies
39-
run: pnpm install
35+
# pnpm cache skipped deliberately as the project is not actually installed here
4036

4137
- name: 🔠 Lint project
42-
run: pnpm lint
38+
run: node scripts/lint.ts
4339

4440
test:
4541
runs-on: ubuntu-latest
File renamed without changes.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
"@vitest/coverage-v8": "4.0.18",
107107
"@vue/test-utils": "2.4.6",
108108
"axe-core": "4.11.1",
109+
"fast-check": "4.5.3",
109110
"fast-npm-meta": "1.0.0",
110111
"knip": "5.83.0",
111112
"lint-staged": "16.2.7",

pnpm-lock.yaml

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/lint.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* This script runs oxlint and oxfmt in a CI environment, without the need to install the entire
3+
* project. It reads the required version from pnpm-lock.yaml and executes the linters accordingly.
4+
* It's "stupid by design" so it could work in minimal Node.js environments.
5+
*/
6+
7+
import { spawnSync } from 'node:child_process'
8+
9+
function getDependencyVersion(dependencyName: string): string {
10+
const result = spawnSync('npm', ['pkg', 'get', `devDependencies.${dependencyName}`], {
11+
encoding: 'utf8',
12+
})
13+
14+
if (result.status) {
15+
throw new Error(`Command failed: pnpm info ${dependencyName} version`)
16+
}
17+
18+
return JSON.parse(result.stdout)
19+
}
20+
21+
function runCommand(command: string, args: string[]) {
22+
const result = spawnSync(command, args, { stdio: 'inherit' })
23+
24+
if (result.status) {
25+
throw new Error(`Command failed: ${command} ${args.join(' ')}`)
26+
}
27+
}
28+
29+
const oxlintVersion = getDependencyVersion('oxlint')
30+
const oxfmtVersion = getDependencyVersion('oxfmt')
31+
32+
runCommand('pnpx', [`oxlint@${oxlintVersion}`])
33+
runCommand('pnpx', [`oxfmt@${oxfmtVersion}`, '--check'])

test/nuxt/components/compare/ComparisonGrid.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from 'vitest'
22
import { mountSuspended } from '@nuxt/test-utils/runtime'
3-
import ComparisonGrid from '~/components/compare/ComparisonGrid.vue'
3+
import ComparisonGrid from '~/components/Compare/ComparisonGrid.vue'
44

55
describe('ComparisonGrid', () => {
66
describe('header rendering', () => {

0 commit comments

Comments
 (0)