Skip to content

Commit

Permalink
refactor: replace shell script with node for type fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Jul 12, 2024
1 parent 7b509eb commit d17a4a6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ jobs:
run: npm run lint

- name: npm types
if: runner.os != 'Windows' # because of ./fixup.sh
run: npm run types

- name: npm test
if: runner.os != 'Windows'
run: npm test

- name: npm test
if: runner.os == 'Windows'
run: npm run test:unit
12 changes: 12 additions & 0 deletions fixup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import fs from 'node:fs';
import path from 'node:path';

let podium = path.join(process.cwd(), 'types', 'podium.d.ts');
let module = path.join(process.cwd(), 'types', 'layout-plugin.d.ts');

fs.writeFileSync(
module,
`${fs.readFileSync(podium, 'utf-8')}
${fs.readFileSync(module, 'utf-8')}`,
'utf-8',
);
2 changes: 0 additions & 2 deletions fixup.sh

This file was deleted.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"test:unit": "tap --disable-coverage --allow-empty-coverage",
"test:types": "tsc --project tsconfig.test.json",
"test:coverage": "tap",
"types": "tsc --declaration --emitDeclarationOnly && ./fixup.sh"
"types": "run-s types:tsc types:fixup",
"types:tsc": "tsc --declaration --emitDeclarationOnly",
"types:fixup": "node ./fixup.js"
},
"author": "Trygve Lie",
"dependencies": {
Expand Down

0 comments on commit d17a4a6

Please sign in to comment.