Skip to content

Commit 7299ae9

Browse files
ochafikclaude
andcommitted
fix: Windows compatibility for npm scripts and cross-platform CI
Fixes #142 - Windows PowerShell install bug Changes: - Replace single quotes with escaped double quotes in generate:schemas (cmd.exe passes single quotes literally, breaking prettier glob matching) - Simplify prettier scripts: remove redundant --ignore-path flags (prettier auto-loads .gitignore and .prettierignore by default) - Remove $(pwd) from prettier scripts (bash-only syntax) - Add cross-platform CI matrix: Linux x64, Windows x64, macOS ARM64, macOS x64 - Use shell: bash for grep commands in CI (not available in Windows cmd.exe) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 0408a6e commit 7299ae9

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,27 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
name: Linux x64
17+
- os: windows-latest
18+
name: Windows x64
19+
- os: macos-latest
20+
name: macOS ARM64
21+
- os: macos-13
22+
name: macOS x64
23+
24+
name: Build (${{ matrix.name }})
25+
runs-on: ${{ matrix.os }}
26+
1227
steps:
1328
- uses: actions/checkout@v4
1429

1530
- name: Verify no private URLs in package-lock.json
31+
shell: bash
1632
run: '! grep -E "\"resolved\": \"https?://" package-lock.json | grep -v registry.npmjs.org'
1733

1834
- uses: oven-sh/setup-bun@v2
@@ -28,6 +44,7 @@ jobs:
2844
- run: npm run build:all
2945

3046
- name: Verify generated schemas are up-to-date
47+
shell: bash
3148
run: |
3249
npm run generate:schemas
3350
git diff --exit-code src/generated/ || (echo "Generated schemas are out of date. Run 'npm run generate:schemas' and commit." && exit 1)

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"examples/*"
3333
],
3434
"scripts": {
35-
"generate:schemas": "tsx scripts/generate-schemas.ts && prettier --write 'src/generated/**/*'",
35+
"generate:schemas": "tsx scripts/generate-schemas.ts && prettier --write \"src/generated/**/*\"",
3636
"build": "npm run generate:schemas && bun build.bun.ts",
3737
"prepack": "npm run build",
3838
"build:all": "npm run build && npm run examples:build",
@@ -44,9 +44,8 @@
4444
"prepare": "npm run build && husky",
4545
"docs": "typedoc",
4646
"docs:watch": "typedoc --watch",
47-
"prettier:base-cmd": "prettier -u --ignore-path ./.gitignore --ignore-path ./.prettierignore",
48-
"prettier": "yarn prettier:base-cmd \"$(pwd)/**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --check",
49-
"prettier:fix": "yarn prettier:base-cmd \"$(pwd)/**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --write --list-different"
47+
"prettier": "prettier -u \"**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --check",
48+
"prettier:fix": "prettier -u \"**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --write"
5049
},
5150
"author": "Olivier Chafik",
5251
"devDependencies": {

0 commit comments

Comments
 (0)