Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): fix TS errors that appear when users Go to Source in VSCode #281

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ We are keen for your feedback; please open an [issue](https://www.github.com/ope

## Requirements

TypeScript >= 4.5 is supported.

The following runtimes are supported:

- Node.js 16 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
Expand Down
10 changes: 5 additions & 5 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ node scripts/fix-index-exports.cjs
# index.d.mts the default import will work (even though both files have
# the same export default statement)
cp dist/index.d.ts dist/index.d.mts

SED=(sed -i)
if [[ "$OSTYPE" == "darwin"* ]]; then SED=(sed -i ''); fi
cp tsconfig.dist-src.json dist/src/tsconfig.json

# strip out lib="dom" and types="node" references; these are needed at build time,
# but would pollute the user's TS environment
REFERENCE_SUBS='s/^ *\/\/\/ *<reference *lib="dom".*//g;s/^ *\/\/\/ *<reference *types="node".*//g'
find dist -type f -exec "${SED[@]}" "${REFERENCE_SUBS}" {} +
find dist -type f -exec node scripts/remove-triple-slash-references.js {} +
# strip out `unknown extends RequestInit ? never :` from dist/src/_shims;
# these cause problems when viewing the .ts source files in go to definition
find dist/src/_shims -type f -exec node scripts/replace-shim-guards.js {} +

npm exec prettier -- --loglevel=warn --write .

Expand Down
Binary file modified ecosystem-tests/bun/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion ecosystem-tests/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"devDependencies": {
"fastest-levenshtein": "^1.0.16",
"bun-types": "latest",
"typescript": "^5.1.0"
"typescript": "5.0.4"
}
}
7 changes: 5 additions & 2 deletions ecosystem-tests/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ const projects = {
await run('npm', ['test']);
}
},
'node-ts-cjs-ts4.5': async () => {
await installPackage();
await run('npm', ['run', 'tsc']);
},
'node-ts-cjs-dom': async () => {
await installPackage();
await run('npm', ['run', 'tsc']);
Expand Down Expand Up @@ -296,8 +300,7 @@ async function withRetry(fn: () => Promise<void>, identifier: string, retryAmoun
try {
return await fn();
} catch (err) {
retryAmount--;
if (retryAmount === 0) throw err;
if (--retryAmount <= 0) throw err;
console.error(`${identifier} failed due to ${err}; retries left ${retryAmount}`);
}
} while (retryAmount > 0);
Expand Down
Loading