Skip to content

Commit

Permalink
fix: add TS unit test, pin to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
broofa committed Jan 9, 2025
1 parent e426aaa commit b58fdbd
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 19 deletions.
2 changes: 1 addition & 1 deletion examples/benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "true",
"start": "npm run build && npx http-server . -o",
"pretest": "HUSKY=0 npm install --no-package-lock",
"pretest": "rm -fr node_modules && npm install --no-package-lock",
"test": "node node.js"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/browser-rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"build": "npm install --no-package-lock && rm -rf dist && rollup -c",
"build": "rm -fr node_modules && npm install --no-package-lock && rm -rf dist && rollup -c",
"start": "npm run build && npx http-server . -o"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/browser-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"build": "npm install --no-package-lock && rm -rf dist && webpack",
"build": "rm -fr node_modules && npm install --no-package-lock && rm -rf dist && webpack",
"start": "npm run build && npx http-server . -o"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/node-commonjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"pretest": "npm install --no-package-lock",
"pretest": "rm -fr node_modules && npm install --no-package-lock",
"test": "node example.js"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/node-esmodules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"test:package": "( node --version | grep -vq 'v16' ) || ( node --experimental-json-modules package.mjs )",
"test:example": "node example.mjs",
"pretest": "npm install --no-package-lock",
"pretest": "rm -fr node_modules && npm install --no-package-lock",
"test": "npm-run-all test:*"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/node-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"pretest": "npm install --no-package-lock",
"pretest": "rm -fr node_modules && npm install --no-package-lock",
"test": "jest"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/node-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"build": "rm -rf dist && webpack",
"pretest": "npm install --no-package-lock",
"pretest": "rm -fr node_modules && npm install --no-package-lock",
"test": "npm run build && node dist/v1.js && node dist/v4.js && node dist/v7.js && node dist/all.js"
},
"dependencies": {
Expand Down
8 changes: 8 additions & 0 deletions examples/typescript/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# uuid test for typescript support (not really an example)

```
npm install
npm test
```

This runs `tsc` using the oldest version of TypeScript supported by this project
3 changes: 3 additions & 0 deletions examples/typescript/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { v4 } from 'uuid';
// eslint-disable-next-line no-unused-expressions, @typescript-eslint/no-unused-expressions
v4;
9 changes: 9 additions & 0 deletions examples/typescript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"dependencies": {
"uuid": "file:../../.build/uuid.tgz"
},
"scripts": {
"pretest": "rm -fr node_modules && npm install --no-package-lock",
"test": "npx -y [email protected] -- tsc --noEmit"
}
}
1 change: 1 addition & 0 deletions examples/typescript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"release-please": "16.15.0",
"runmd": "1.4.1",
"standard-version": "9.5.0",
"typescript": "5.7.2",
"typescript": "5.0.4",
"typescript-eslint": "8.18.2"
},
"optionalDevDependencies": {
Expand All @@ -92,21 +92,22 @@
"examples:node:commonjs:test": "cd examples/node-commonjs && npm test",
"examples:node:esmodules:test": "cd examples/node-esmodules && npm test",
"examples:node:jest:test": "cd examples/node-jest && npm test",
"examples:node:typescript:test": "cd examples/typescript && npm test",
"lint": "npm run eslint:check && npm run prettier:check",
"md": "runmd --watch --output=README.md README_js.md",
"prepack": "npm run build -- --no-pack",
"prepare": "husky",
"prepublishOnly": "npm run build",
"pretest:benchmark": "npm run build",
"pretest:browser": "./scripts/iodd && npm run build && npm-run-all examples:browser:**",
"pretest:browser": "./scripts/iodd && npm run build && npm-run-all --parallel examples:browser:**",
"pretest:node": "npm run build",
"pretest": "npm run build",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
"release": "standard-version --no-verify",
"test:benchmark": "cd examples/benchmark && npm test",
"test:browser": "wdio run ./wdio.conf.js",
"test:node": "npm-run-all examples:node:**",
"test:node": "npm-run-all --parallel examples:node:**",
"test:watch": "node --test --enable-source-maps --watch dist/esm/test/*.js",
"test": "node --test --enable-source-maps dist/esm/test/*.js"
},
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"skipLibCheck": true,
"strict": true,
"target": "ES2022"
}
},
"exclude": ["dist", "examples"]
}

0 comments on commit b58fdbd

Please sign in to comment.