fix: re-enable CYPRESS_INTERNAL_VITE_DEV development (#25364)

This commit is contained in:
Zachary Williams
2023-01-17 19:47:08 -06:00
committed by GitHub
parent 0d48199132
commit 991c532447
5 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
"scripts": {
"check-ts": "vue-tsc --noEmit",
"build-prod-ui": "cross-env NODE_ENV=production vite build",
"clean": "rimraf dist && rimraf ./node_modules/.vite && echo 'cleaned'",
"clean": "rimraf dist && echo 'cleaned'",
"clean-deps": "rimraf node_modules",
"test": "echo 'ok'",
"cypress:run-cypress-in-cypress": "cross-env CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=1 HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS=http://localhost:4455 CYPRESS_REMOTE_DEBUGGING_PORT=6666 TZ=America/New_York",
+1 -1
View File
@@ -5,7 +5,7 @@
"scripts": {
"check-ts": "vue-tsc --noEmit",
"build-prod-ui": "cross-env NODE_ENV=production vite build",
"clean": "rimraf dist && rimraf ./node_modules/.vite && rimraf dist-e2e && echo 'cleaned'",
"clean": "rimraf dist && rimraf dist-e2e && echo 'cleaned'",
"clean-deps": "rimraf node_modules",
"test": "yarn cypress:run:ct && yarn types",
"windi": "yarn windicss-analysis",
+1 -1
View File
@@ -3,7 +3,7 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
CYPRESS_INTERNAL_ENV: 'staging' | 'development' | 'production'
CYPRESS_INTERNAL_ENV?: 'staging' | 'development' | 'production'
}
}
}
+1 -1
View File
@@ -75,7 +75,7 @@ function spawnViteDevServer (
) {
return spawnUntilMatch(prefix, {
command,
match: 'dev server running at',
match: /VITE v(\d+.)+ ready in \d+/,
options,
})
}
+5 -1
View File
@@ -10,6 +10,7 @@ import util from 'util'
import { prefixLog, prefixStream } from './prefixStream'
import { addChildProcess } from '../tasks/gulpRegistry'
import stripAnsi from 'strip-ansi'
export type AllSpawnableApps =
| `cmd-${string}`
@@ -45,7 +46,7 @@ export async function spawnUntilMatch (
spawned(prefix, config.command, {
...config.options,
tapOut (chunk, enc, cb) {
if (!ready && String(chunk).match(config.match)) {
if (!ready && stripAnsi(String(chunk)).match(config.match)) {
ready = true
setTimeout(() => dfd.resolve(), 20) // flush the rest of the chunks
}
@@ -172,16 +173,19 @@ export const execAsync = async (
const { silent } = options
if (!silent) {
// eslint-disable-next-line no-console
console.log(command)
}
const result = await execAsyncLocal(command, options)
if (!silent && typeof result.stdout === 'string' && result.stdout.length) {
// eslint-disable-next-line no-console
console.log(result.stdout)
}
if (!silent && typeof result.stderr === 'string' && result.stderr.length) {
// eslint-disable-next-line no-console
console.error(result.stderr)
}