Skip to content

Commit

Permalink
fix(client): fix TS errors that appear when users Go to Source in VSC…
Browse files Browse the repository at this point in the history
…ode (#281)

fix #249
  • Loading branch information
stainless-bot committed Sep 6, 2023
1 parent 16fe929 commit 8dc59bc
Show file tree
Hide file tree
Showing 33 changed files with 8,003 additions and 5,267 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,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

0 comments on commit 8dc59bc

Please sign in to comment.