-
Notifications
You must be signed in to change notification settings - Fork 2.1k
meta: add support for TypeScript plugins #4640
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
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
0124e35
meta: add support for TypeScript plugins
aduh95 d8a518a
fixup! meta: add support for TypeScript plugins
aduh95 4e8f732
fixup! meta: add support for TypeScript plugins
aduh95 f15b3e3
fixup! meta: add support for TypeScript plugins
aduh95 3985734
fix `yarn dev`
aduh95 f00dec9
resolve e2e build failure
aduh95 926effa
fixup! resolve e2e build failure
aduh95 ef5a87c
fixup! resolve e2e build failure
aduh95 7f8cda3
add `js2ts` script
aduh95 c1f69af
add `build:ts`
aduh95 da629a9
Merge branch 'main' of https://github.com/transloadit/uppy
aduh95 1ccdcfa
update tsconfig
aduh95 8ff4725
Merge branch 'main' of https://github.com/transloadit/uppy
aduh95 4980818
Update private/js2ts/index.mjs
mifi 57341b6
Update private/js2ts/index.mjs
aduh95 f7c2e57
Update private/js2ts/index.mjs
aduh95 2a80377
Merge branch 'main' of https://github.com/transloadit/uppy
aduh95 6c9586e
Update private/js2ts/index.mjs
aduh95 123c98d
5cd4e9b
enforce use of explicit return types in library code
aduh95 9e3acf6
Merge branch 'main' into ts-packages-support
aduh95 996c2af
add comment
aduh95 0909fea
Merge branch 'main' into ts-packages-support
aduh95 3b19a37
prettier
aduh95 b685754
Merge branch 'main' of https://github.com/transloadit/uppy
aduh95 d10929b
@uppy/svelte: fix TS build command
aduh95 1f70266
`allowSyntheticDefaultImports`
aduh95 c7f50be
Merge branch 'main' into ts-packages-support
aduh95 ba73746
add support for TS in test files
aduh95 e4eb8ef
Merge branch 'main' into ts-packages-support
aduh95 d1c289a
extend config, and match more files
aduh95 d398bcf
fix imports
aduh95 40ebb91
fixup! fix imports
aduh95 887b173
fixup! fixup! fix imports
aduh95 6ccc518
uppy: fix types
aduh95 eb1949f
use two TSConfig files per package
aduh95 e71ce8e
fixup! use two TSConfig files per package
aduh95 f5940c0
prettier
aduh95 e167e22
remove outdated ignore entries
aduh95 9863186
`skipLibCheck`
aduh95 5bdbda7
remove debug line
aduh95 75e4bc0
Merge branch 'main' into ts-packages-support
aduh95 74e3dc0
Merge branch 'main' of https://github.com/transloadit/uppy
aduh95 0bfdf16
disable a rule that conflicts with Prettier
aduh95 759ecbb
exclude test files from mandatory function return type
aduh95 05a1266
throw when trying to convert package before its deps
aduh95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ node_modules | |
yarn-error.log | ||
.idea | ||
.env | ||
tsconfig.tsbuildinfo | ||
tsconfig.build.tsbuildinfo | ||
|
||
dist/ | ||
lib/ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ node_modules/ | |
*.jsx | ||
*.cjs | ||
*.mjs | ||
!private/js2ts/* | ||
*.md | ||
*.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env node | ||
|
||
import { spawn } from 'node:child_process' | ||
import { once } from 'node:events' | ||
import { existsSync } from 'node:fs' | ||
import path from 'node:path' | ||
import { stdin, env } from 'node:process' | ||
import { createInterface as readLines } from 'node:readline' | ||
import { fileURLToPath } from 'node:url' | ||
|
||
const fromYarn = 'npm_execpath' in env | ||
const exe = fromYarn ? env.npm_execpath : 'corepack' | ||
const argv0 = fromYarn ? [] : ['yarn'] | ||
|
||
const cwd = fileURLToPath(new URL('../', import.meta.url)) | ||
|
||
for await (const line of readLines(stdin)) { | ||
const { location, name } = JSON.parse(line) | ||
if (existsSync(path.join(cwd, location, 'tsconfig.json'))) { | ||
const cp = spawn(exe, [...argv0, 'tsc', '-p', location], { | ||
stdio: 'inherit', | ||
cwd, | ||
}) | ||
await Promise.race([ | ||
once(cp, 'error').then(err => Promise.reject(err)), | ||
await once(cp, 'exit') | ||
.then(([code]) => (code && Promise.reject(new Error(`Non-zero exit code when building "${name}": ${code}`)))), | ||
]) | ||
} | ||
if (existsSync(path.join(cwd, location, 'tsconfig.build.json'))) { | ||
const cp = spawn(exe, [...argv0, 'tsc', '--build', path.join(cwd, location, 'tsconfig.build.json')], { | ||
stdio: 'inherit', | ||
cwd, | ||
}) | ||
await Promise.race([ | ||
once(cp, 'error').then(err => Promise.reject(err)), | ||
await once(cp, 'exit') | ||
.then(([code]) => (code && Promise.reject(new Error(`Non-zero exit code when building "${name}": ${code}`)))), | ||
]) | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.