Skip to content
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
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ jobs:
[[ $RUNNER_OS != Windows ]] || listed=$(cygpath -m "$listed")
cd "$RUNNER_TEMP"
echo 'const x: number = "a";' > a.ts
"$dir/tsc$EXE" --listFilesOnly --lib es5 a.ts | grep -qx "$listed"
# Not grep -q: it can end before the tsc does, and the tsc then dies of SIGPIPE (exit 141 with
# pipefail; seen on darwin-x64).
"$dir/tsc$EXE" --listFilesOnly --lib es5 a.ts | grep -x "$listed" > /dev/null
set +e
"$dir/tsc$EXE" --noEmit a.ts > check.txt
rc=$?
Expand Down Expand Up @@ -432,7 +434,7 @@ jobs:
[[ $(npx tsc --version) == "Version $tsc_version" ]]
node -p 'require("typescript").version'
[[ $(node -p 'require("typescript").version') == "$tsc_version" ]]
node --input-type=module -e 'await import("typescript/unstable/sync")'
node --input-type=module -e 'await import("typescript/sync")'
echo 'const x: number = "a";' > bad.ts
set +e
npx tsc --noEmit bad.ts > check.txt
Expand Down
6 changes: 3 additions & 3 deletions npm/typescript-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[tsc-rs](https://www.npmjs.com/package/tsc-rs) as the `typescript` package. tsc-rs is a Rust port
of the TypeScript 7 compiler, which Microsoft writes in Go. This package has the layout of the
TypeScript 7 `typescript` package: the `tsc` bin, the JS API (`typescript/unstable/*`) and the
platform packages that VS Code finds. Install it under the name `typescript`, and the tools that
use `typescript` run tsc-rs.
TypeScript 7 `typescript` package: the `tsc` bin, the JS API (`typescript/sync`, `typescript/async`
and the other `typescript/*` modules) and the platform packages that VS Code finds. Install it
under the name `typescript`, and the tools that use `typescript` run tsc-rs.

This is an early release. Report problems at https://github.com/pingdotgg/ts-rust/issues.

Expand Down
6 changes: 3 additions & 3 deletions scripts/goport/npm-alias-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Checks, per install:
# - node_modules/.bin/tsc --version, and require("typescript").version: the tsc version.
# - bin/tsc is the sh and JS polyglot when the postinstall ran (npm/install.js).
# - import("typescript/unstable/sync") gives the API class.
# - import("typescript/sync") gives the API class.
# - tsc -p on a tiny project: exit 2 with TS2322 for bad.ts, and the emit of ok.ts.
# - VS Code's resolver (resolveTsdkPathToExe, the JS copy below) on node_modules/typescript/lib
# finds lib/tsc of @tsc-rs/linux-x64, with the npm version as the version it shows.
Expand Down Expand Up @@ -300,10 +300,10 @@ checks() {
[[ $v == "$tsc_version" ]]
r=$?
check "$tag require(\"typescript\").version: $tsc_version" $r "$v"
v=$(cd "$d" && node --input-type=module -e 'const m = await import("typescript/unstable/sync"); console.log(typeof m.API)' 2>&1)
v=$(cd "$d" && node --input-type=module -e 'const m = await import("typescript/sync"); console.log(typeof m.API)' 2>&1)
[[ $v == function ]]
r=$?
check "$tag import(\"typescript/unstable/sync\") gives the API class" $r "$v"
check "$tag import(\"typescript/sync\") gives the API class" $r "$v"
mkdir -p "$d/tiny"
echo 'export const x: number = 1;' > "$d/tiny/ok.ts"
echo 'const y: number = "a";' > "$d/tiny/bad.ts"
Expand Down
Loading