Skip to content

Commit

Permalink
chore: Simplify type generation (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed May 22, 2024
1 parent d5a0496 commit 5f0d2e2
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 69 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,21 @@ jobs:
npm test
env:
CI: true

jsr_test:
name: Verify JSR Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Install Packages
run: npm install

- name: Run --dry-run
run: |
npm run build
npm run test:jsr
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"fmt": "prettier --write .",
"fmt:check": "prettier --check ."
"fmt:check": "prettier --check .",
"test:jsr": "npm run test:jsr --workspaces --if-present"
},
"workspaces": [
"packages/*"
Expand Down
5 changes: 3 additions & 2 deletions packages/compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
"test": "tests"
},
"scripts": {
"build:prepend-type-ref": "node ../../tools/prepend-type-ref.js dist/esm/index.js",
"build": "rollup -c && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && npm run build:prepend-type-ref",
"build:cts": "node -e \"fs.copyFileSync('dist/esm/index.d.ts', 'dist/cjs/index.d.cts')\"",
"build": "rollup -c && tsc -p tsconfig.esm.json && npm run build:cts",
"test:jsr": "npx jsr@latest publish --dry-run",
"test": "mocha tests/*.js"
},
"repository": {
Expand Down
1 change: 1 addition & 0 deletions packages/compat/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
{
file: "dist/esm/index.js",
format: "esm",
banner: '// @ts-self-types="./index.d.ts"',
},
],
plugins: [
Expand Down
9 changes: 0 additions & 9 deletions packages/compat/tsconfig.cjs.json

This file was deleted.

5 changes: 3 additions & 2 deletions packages/config-array/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
"homepage": "https://github.com/eslint/rewrite#readme",
"scripts": {
"build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js",
"build:prepend-type-ref": "node ../../tools/prepend-type-ref.js dist/esm/index.js",
"build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && npm run build:prepend-type-ref",
"build:cts": "node -e \"fs.copyFileSync('dist/esm/index.d.ts', 'dist/cjs/index.d.cts')\"",
"build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts",
"test:jsr": "npx jsr@latest publish --dry-run",
"pretest": "npm run build",
"test": "mocha tests/"
},
Expand Down
1 change: 1 addition & 0 deletions packages/config-array/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
{
file: "dist/esm/index.js",
format: "esm",
banner: '// @ts-self-types="./index.d.ts"',
},
],
plugins: [
Expand Down
9 changes: 0 additions & 9 deletions packages/config-array/tsconfig.cjs.json

This file was deleted.

5 changes: 3 additions & 2 deletions packages/object-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
"test": "tests"
},
"scripts": {
"build:prepend-type-ref": "node ../../tools/prepend-type-ref.js dist/esm/index.js",
"build": "rollup -c && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && npm run build:prepend-type-ref",
"build:cts": "node -e \"fs.copyFileSync('dist/esm/index.d.ts', 'dist/cjs/index.d.cts')\"",
"build": "rollup -c && tsc -p tsconfig.esm.json && npm run build:cts",
"test:jsr": "npx jsr@latest publish --dry-run",
"test": "mocha tests/"
},
"repository": {
Expand Down
1 change: 1 addition & 0 deletions packages/object-schema/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
{
file: "dist/esm/index.js",
format: "esm",
banner: '// @ts-self-types="./index.d.ts"',
},
],
plugins: [
Expand Down
9 changes: 0 additions & 9 deletions packages/object-schema/tsconfig.cjs.json

This file was deleted.

35 changes: 0 additions & 35 deletions tools/prepend-type-ref.js

This file was deleted.

0 comments on commit 5f0d2e2

Please sign in to comment.