feat(root): streaming ensure tailwind deps output (#3232)
This commit is contained in:
Родитель
9195452cd6
Коммит
7d9c4c0935
|
@ -12,7 +12,7 @@
|
|||
"main": "./dist/commonjs/index.js",
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "NODE_ENV=production tshy",
|
||||
"build": "echo \"Building shared...\" && NODE_ENV=production tshy && echo \"Done building shared!\"",
|
||||
"dev": "tshy --watch",
|
||||
"prepack": "yarn build",
|
||||
"lint:eslint": "eslint .",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"version": "0.0.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "rimraf ./dist ./dist-cjs && tsc -p . && tsc -p ./tsconfig.cjs.json && tsconfig-to-dual-package",
|
||||
"build": "echo \"Building tailwind-theme\" && rimraf ./dist ./dist-cjs && tsc -p . && tsc -p ./tsconfig.cjs.json && tsconfig-to-dual-package && echo \"Done building tailwind-theme!\"",
|
||||
"viewer": "tailwind-config-viewer -o -c tailwind.test.config.cjs",
|
||||
"lint:js": "eslint .",
|
||||
"lint:tsc": "tsc --noEmit",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import mod from 'node:module'
|
||||
import { exec } from 'node:child_process'
|
||||
import { spawn } from 'node:child_process'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { dirname, resolve } from 'node:path'
|
||||
import { lock, unlock, check } from 'lockfile'
|
||||
|
@ -105,25 +105,15 @@ async function doWork() {
|
|||
const now = performance.now()
|
||||
logger.log('Building tailwind deps...')
|
||||
|
||||
const proc = exec(
|
||||
'yarn build:tailwind-deps',
|
||||
{ cwd: __dirname },
|
||||
(err, stdout, stderr) => {
|
||||
const logger = buildLogger(proc.pid)
|
||||
|
||||
if (stdout) {
|
||||
logger.log(stdout)
|
||||
}
|
||||
if (err) {
|
||||
logger.fatal(err)
|
||||
}
|
||||
if (stderr) {
|
||||
logger.fatal(stderr)
|
||||
}
|
||||
}
|
||||
const proc = spawn('yarn', ['build:tailwind-deps'], { cwd: __dirname })
|
||||
const childLogger = buildLogger(proc.pid)
|
||||
proc.stdout.on('data', (data) =>
|
||||
childLogger.log(data?.toString ? data.toString() : data)
|
||||
)
|
||||
|
||||
proc.on('exit', (code) => {
|
||||
proc.stderr.on('data', (data) =>
|
||||
childLogger.error(data?.toString ? data.toString() : data)
|
||||
)
|
||||
proc.on('close', (code) => {
|
||||
logger.log(
|
||||
`...done w/ status ${code} [${Math.round(performance.now() - now)}ms]`
|
||||
)
|
||||
|
|
Загрузка…
Ссылка в новой задаче