Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2.5.2
with:
node-version: '20'
- name: enable corepack
run: corepack enable
- name: yarn install
run: yarn install

Expand All @@ -31,6 +33,8 @@ jobs:
- uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2.5.2
with:
node-version: '20'
- name: enable corepack
run: corepack enable
- name: yarn install
run: yarn install

Expand All @@ -44,6 +48,8 @@ jobs:
- uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2.5.2
with:
node-version: '20'
- name: enable corepack
run: corepack enable
- name: yarn install
run: yarn install

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules
# Generate defintions out of schemas by running `yarn generate`
lib/generated
*/.DS_Store

.yarn/*
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
"volta": {
"node": "20.10.0",
"yarn": "1.22.19"
}
"yarn": "4.10.3"
},
"packageManager": "[email protected]"
}
21 changes: 13 additions & 8 deletions scripts/generate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,21 @@ async function getJsonSchemaToTypescript() {

execSync(
`
set -eu
set -eux

cd ./node_modules/json-schema-to-typescript
rm -rf dist
# due to installation on node_modules, some of these steps can fail
# built version still behaves correctly though
set +e
yarn
yarn run clean
yarn run build:server
set -e

npm install
npm run clean

# With yarn 3, the 'test/' folder is not present, so all built files are put directly in the
# 'dist/' folder instead of 'dist/src/'.
#
# Using an explicit '--rootDir' fixes this issue.
#
# Also, tsc fails with type errors, but the built files are fine.
npm exec -- tsc --declaration --rootDir . || true
`,
{
stdio: 'inherit',
Expand Down
Loading
Loading