Skip to content

Commit

Permalink
Make published type test work again (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli authored Nov 18, 2022
1 parent e23e4b1 commit 68fbc45
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ts-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
type-check:
uses: voxpelli/ghatemplates/.github/workflows/type-check.yml@main
with:
ts-versions: ${{ github.event.schedule && 'next' || '4.6,4.7,4.8,4.9,next' }}
ts-versions: ${{ github.event.schedule && 'next' || '4.9,next' }}
ts-libs: 'es2020'
3 changes: 2 additions & 1 deletion .github/workflows/ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ jobs:
type-check:
uses: voxpelli/ghatemplates/.github/workflows/type-check.yml@main
with:
ts-prebuild: true
ts-versions: ${{ github.event.schedule && 'next' || '4.5,4.6,4.7,4.8,4.9,next' }}
# Can add the "es2020,es2022.error,es2021.promise" once 4.5 isn't included
# ts-libs: 'es2020;esnext;es2020,es2022.error,es2021.promise'
ts-libs: 'es2020;esnext'
ts-projects: 'test-published-types'
ts-working-directory: 'test-published-types'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
*.mjs
!test/**/*.mjs
!*compat.d.ts
/test-published-types/node_modules
3 changes: 2 additions & 1 deletion declaration.tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
{
"extends": "./tsconfig",
"exclude": [
"test/**/*.js"
"test/**/*.js",
"test-published-types/**/*"
],
"compilerOptions": {
"declaration": true,
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
"types": "index.d.ts",
"typesVersions": {
"~4.6 || ~4.7": {
"index.d.ts": [
".": [
"compat.d.ts"
]
}
},
"exports": {
".": {
"types@<4.8": "./compat.d.ts",
"types@~4.6": "./compat.d.ts",
"types@~4.7": "./compat.d.ts",
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./index.js"
Expand Down Expand Up @@ -80,7 +81,7 @@
"@types/node": "^14.18.33",
"@types/verror": "^1.10.6",
"@voxpelli/eslint-config": "^15.2.0",
"@voxpelli/tsconfig": "^6.0.0",
"@voxpelli/tsconfig": "^6.1.0",
"c8": "^7.12.0",
"chai": "^4.3.7",
"chai-string": "^1.5.0",
Expand Down
1 change: 1 addition & 0 deletions test-published-types/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
2 changes: 1 addition & 1 deletion test-published-types/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const { ErrorWithCause } = require('..');
const { ErrorWithCause } = require('pony-cause');

throw new ErrorWithCause('Wow', { cause: new Error('Yay') });
13 changes: 13 additions & 0 deletions test-published-types/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "pony-cause",
"version": "0.0.0",
"scripts": {
"test": "tsc"
},
"dependencies": {
"pony-cause": "file:.."
},
"devDependencies": {
"typescript": "~4.6.0"
}
}
7 changes: 4 additions & 3 deletions test-published-types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"extends": "@voxpelli/tsconfig/node14.json",
"extends": "@voxpelli/tsconfig/legacy.json",

"files": [
"index.js",
"index.js"
],
"include": [],

"compilerOptions": {
"lib": ["esnext"],
"types": []
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
],
"include": [
"test/**/*.js",
],
"exclude": [
"test-published-types/**/*"
]
}

0 comments on commit 68fbc45

Please sign in to comment.