mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
meta: simplify build:ts script (#5262)
This commit is contained in:
parent
ee4c860418
commit
c8d16f6a55
3 changed files with 120 additions and 39 deletions
|
|
@ -1,38 +0,0 @@
|
|||
#!/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))
|
||||
|
||||
const locations = []
|
||||
|
||||
for await (const line of readLines(stdin)) {
|
||||
const { location } = JSON.parse(line)
|
||||
if (existsSync(path.join(cwd, location, 'tsconfig.json'))) {
|
||||
locations.unshift(location)
|
||||
}
|
||||
const tsConfigBuildPath = path.join(cwd, location, 'tsconfig.build.json')
|
||||
if (existsSync(tsConfigBuildPath)) {
|
||||
locations.push(tsConfigBuildPath)
|
||||
}
|
||||
}
|
||||
|
||||
const cp = spawn(exe, [...argv0, 'tsc', '--build', ...locations], {
|
||||
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 TS projects: ${code}`)))),
|
||||
])
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
"build:angular": "yarn workspace angular build",
|
||||
"build:js:typeless": "npm-run-all build:lib build:companion build:svelte",
|
||||
"build:js": "npm-run-all build:js:typeless build:locale-pack build:angular build:bundle",
|
||||
"build:ts": "yarn workspaces list --no-private --json | yarn node ./bin/build-ts.mjs && yarn workspace @uppy/svelte validate",
|
||||
"build:ts": "yarn workspaces list --no-private --json | yarn tsc -b && yarn workspace @uppy/svelte validate",
|
||||
"build:lib": "yarn node ./bin/build-lib.js",
|
||||
"build:locale-pack": "yarn workspace @uppy-dev/locale-pack build && eslint packages/@uppy/locales/src/en_US.js --fix && yarn workspace @uppy-dev/locale-pack test unused",
|
||||
"build": "npm-run-all --serial build:ts --parallel build:js build:css --serial size",
|
||||
|
|
|
|||
119
tsconfig.json
Normal file
119
tsconfig.json
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./packages/@uppy/audio/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/aws-s3/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/box/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/companion-client/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/compressor/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/core/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/dashboard/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/drag-drop/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/drop-target/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/dropbox/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/facebook/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/file-input/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/form/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/golden-retriever/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/google-drive/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/google-photos/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/image-editor/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/informer/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/instagram/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/locales/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/onedrive/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/progress-bar/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/provider-views/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/react/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/remote-sources/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/screen-capture/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/status-bar/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/store-default/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/thumbnail-generator/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/transloadit/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/tus/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/unsplash/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/url/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/utils/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/vue/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/webcam/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/xhr-upload/tsconfig.build.json",
|
||||
},
|
||||
{
|
||||
"path": "./packages/@uppy/zoom/tsconfig.build.json",
|
||||
},
|
||||
],
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue