1
0
mirror of synced 2026-02-03 18:01:02 -05:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Brandon Bayer
bbde65eb0a fix test 2020-12-02 16:35:51 -05:00
Brandon Bayer
0d343f5809 fix 2020-12-01 15:35:01 -05:00
Brandon Bayer
26f73e9e5c lazy require in display too 2020-12-01 13:15:41 -05:00
Brandon Bayer
6e2a90adab fix another blitz install issue because of peer dependencies in blitzjs/config 2020-12-01 13:08:34 -05:00
6 changed files with 16 additions and 3 deletions

View File

@@ -31,5 +31,8 @@
"type": "git",
"url": "https://github.com/blitz-js/blitz"
},
"dependencies": {
"pkg-dir": "4.2.0"
},
"gitHead": "d3b9fce0bdd251c2b1890793b0aa1cd77c1c0922"
}

View File

@@ -1,5 +1,4 @@
import {existsSync} from "fs"
import {PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_SERVER} from "next/constants"
import {join} from "path"
import pkgDir from "pkg-dir"
@@ -12,6 +11,16 @@ export const getConfig = (reload?: boolean): Record<string, unknown> => {
return global.blitzConfig
}
let PHASE_PRODUCTION_SERVER
let PHASE_DEVELOPMENT_SERVER
try {
const constants = require("next/constants")
PHASE_PRODUCTION_SERVER = constants.PHASE_PRODUCTION_SERVER
PHASE_DEVELOPMENT_SERVER = constants.PHASE_DEVELOPMENT_SERVER
} catch (error) {
if (!process.env.BLITZ_TEST_ENVIRONMENT) throw error
}
let blitzConfig = {}
const projectRoot = pkgDir.sync() || process.cwd()

View File

@@ -34,6 +34,7 @@
"url": "git+https://github.com/blitz-js/blitz.git"
},
"dependencies": {
"@blitzjs/config": "0.27.0-canary.1",
"chalk": "4.0.0",
"ora": "4.0.4",
"tslog": "2.9.1"

View File

@@ -1,4 +1,3 @@
import {getConfig} from "@blitzjs/config"
import c from "chalk"
import ora from "ora"
import readline from "readline"
@@ -13,6 +12,7 @@ const defaultConfig: LogConfig = {
}
const getLogConfig = (): LogConfig => {
const {getConfig} = require("@blitzjs/config")
const config = getConfig()
// TODO - validate log config and print helpfull error if invalid

View File

@@ -36,7 +36,6 @@
"dependencies": {
"@babel/core": "7.9.0",
"@babel/plugin-transform-typescript": "7.9.4",
"@blitzjs/config": "0.27.0-canary.1",
"@blitzjs/display": "0.27.0-canary.1",
"@blitzjs/generator": "0.27.0-canary.1",
"@types/jscodeshift": "0.7.1",

View File

@@ -0,0 +1 @@
process.env.BLITZ_TEST_ENVIRONMENT = true