Skip to content

Commit b58fdbd

Browse files
committed
fix: add TS unit test, pin to [email protected]
1 parent e426aaa commit b58fdbd

File tree

14 files changed

+42
-19
lines changed

14 files changed

+42
-19
lines changed

examples/benchmark/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"build": "true",
77
"start": "npm run build && npx http-server . -o",
8-
"pretest": "HUSKY=0 npm install --no-package-lock",
8+
"pretest": "rm -fr node_modules && npm install --no-package-lock",
99
"test": "node node.js"
1010
},
1111
"dependencies": {

examples/browser-rollup/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6-
"build": "npm install --no-package-lock && rm -rf dist && rollup -c",
6+
"build": "rm -fr node_modules && npm install --no-package-lock && rm -rf dist && rollup -c",
77
"start": "npm run build && npx http-server . -o"
88
},
99
"dependencies": {

examples/browser-webpack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6-
"build": "npm install --no-package-lock && rm -rf dist && webpack",
6+
"build": "rm -fr node_modules && npm install --no-package-lock && rm -rf dist && webpack",
77
"start": "npm run build && npx http-server . -o"
88
},
99
"dependencies": {

examples/node-commonjs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6-
"pretest": "npm install --no-package-lock",
6+
"pretest": "rm -fr node_modules && npm install --no-package-lock",
77
"test": "node example.js"
88
},
99
"dependencies": {

examples/node-esmodules/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"test:package": "( node --version | grep -vq 'v16' ) || ( node --experimental-json-modules package.mjs )",
77
"test:example": "node example.mjs",
8-
"pretest": "npm install --no-package-lock",
8+
"pretest": "rm -fr node_modules && npm install --no-package-lock",
99
"test": "npm-run-all test:*"
1010
},
1111
"dependencies": {

examples/node-jest/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6-
"pretest": "npm install --no-package-lock",
6+
"pretest": "rm -fr node_modules && npm install --no-package-lock",
77
"test": "jest"
88
},
99
"dependencies": {

examples/node-webpack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"build": "rm -rf dist && webpack",
7-
"pretest": "npm install --no-package-lock",
7+
"pretest": "rm -fr node_modules && npm install --no-package-lock",
88
"test": "npm run build && node dist/v1.js && node dist/v4.js && node dist/v7.js && node dist/all.js"
99
},
1010
"dependencies": {

examples/typescript/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# uuid test for typescript support (not really an example)
2+
3+
```
4+
npm install
5+
npm test
6+
```
7+
8+
This runs `tsc` using the oldest version of TypeScript supported by this project

examples/typescript/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { v4 } from 'uuid';
2+
// eslint-disable-next-line no-unused-expressions, @typescript-eslint/no-unused-expressions
3+
v4;

examples/typescript/package.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"dependencies": {
3+
"uuid": "file:../../.build/uuid.tgz"
4+
},
5+
"scripts": {
6+
"pretest": "rm -fr node_modules && npm install --no-package-lock",
7+
"test": "npx -y [email protected] -- tsc --noEmit"
8+
}
9+
}

examples/typescript/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

package-lock.json

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"release-please": "16.15.0",
6969
"runmd": "1.4.1",
7070
"standard-version": "9.5.0",
71-
"typescript": "5.7.2",
71+
"typescript": "5.0.4",
7272
"typescript-eslint": "8.18.2"
7373
},
7474
"optionalDevDependencies": {
@@ -92,21 +92,22 @@
9292
"examples:node:commonjs:test": "cd examples/node-commonjs && npm test",
9393
"examples:node:esmodules:test": "cd examples/node-esmodules && npm test",
9494
"examples:node:jest:test": "cd examples/node-jest && npm test",
95+
"examples:node:typescript:test": "cd examples/typescript && npm test",
9596
"lint": "npm run eslint:check && npm run prettier:check",
9697
"md": "runmd --watch --output=README.md README_js.md",
9798
"prepack": "npm run build -- --no-pack",
9899
"prepare": "husky",
99100
"prepublishOnly": "npm run build",
100101
"pretest:benchmark": "npm run build",
101-
"pretest:browser": "./scripts/iodd && npm run build && npm-run-all examples:browser:**",
102+
"pretest:browser": "./scripts/iodd && npm run build && npm-run-all --parallel examples:browser:**",
102103
"pretest:node": "npm run build",
103104
"pretest": "npm run build",
104105
"prettier:check": "prettier --check .",
105106
"prettier:fix": "prettier --write .",
106107
"release": "standard-version --no-verify",
107108
"test:benchmark": "cd examples/benchmark && npm test",
108109
"test:browser": "wdio run ./wdio.conf.js",
109-
"test:node": "npm-run-all examples:node:**",
110+
"test:node": "npm-run-all --parallel examples:node:**",
110111
"test:watch": "node --test --enable-source-maps --watch dist/esm/test/*.js",
111112
"test": "node --test --enable-source-maps dist/esm/test/*.js"
112113
},

tsconfig.base.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"skipLibCheck": true,
66
"strict": true,
77
"target": "ES2022"
8-
}
8+
},
9+
"exclude": ["dist", "examples"]
910
}

0 commit comments

Comments
 (0)