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

Compare commits

...

3 Commits

Author SHA1 Message Date
beerose
30bb474abb Update pnpm-lock.yaml 2022-06-23 13:32:30 +02:00
github-actions[bot]
135b30efde Version Packages (alpha) (#3456)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-23 13:31:59 +02:00
Aleksandra
527e48ac3e Fix running bin commands with Blitz CLI (#3455) 2022-06-23 13:29:22 +02:00
20 changed files with 557 additions and 450 deletions

View File

@@ -70,6 +70,7 @@
"thirty-countries-build",
"twenty-beans-pump",
"two-kiwis-help",
"two-tigers-type",
"unlucky-papayas-sleep",
"violet-bags-leave",
"violet-lions-help",

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Fix running bin commands with Blitz CLI

View File

@@ -29,7 +29,7 @@
"@blitzjs/rpc": "workspace:*",
"@hookform/resolvers": "2.8.8",
"@prisma/client": "3.9.0",
"blitz": "workspace:2.0.0-alpha.42",
"blitz": "workspace:2.0.0-alpha.43",
"next": "12.1.6-canary.17",
"prisma": "3.9.0",
"react": "18.0.0",

View File

@@ -1,5 +1,12 @@
# @blitzjs/auth
## 2.0.0-alpha.43
### Patch Changes
- Updated dependencies [527e48ac]
- blitz@2.0.0-alpha.43
## 2.0.0-alpha.42
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/auth",
"version": "2.0.0-alpha.42",
"version": "2.0.0-alpha.43",
"scripts": {
"build": "unbuild",
"predev": "wait-on -d 250 ../blitz/dist/index-server.d.ts",
@@ -26,7 +26,7 @@
"@types/secure-password": "3.1.1",
"b64-lite": "1.4.0",
"bad-behavior": "1.0.1",
"blitz": "2.0.0-alpha.42",
"blitz": "2.0.0-alpha.43",
"cookie": "0.4.1",
"cookie-session": "2.0.0",
"debug": "4.3.3",
@@ -39,7 +39,7 @@
"url": "0.11.0"
},
"devDependencies": {
"@blitzjs/config": "workspace:2.0.0-alpha.42",
"@blitzjs/config": "workspace:2.0.0-alpha.43",
"@testing-library/react": "13.0.0",
"@testing-library/react-hooks": "7.0.2",
"@types/cookie": "0.4.1",

View File

@@ -1,5 +1,11 @@
# @blitzjs/next
## 2.0.0-alpha.43
### Patch Changes
- @blitzjs/rpc@2.0.0-alpha.43
## 2.0.0-alpha.42
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/next",
"version": "2.0.0-alpha.42",
"version": "2.0.0-alpha.43",
"scripts": {
"build": "unbuild",
"dev": "pnpm predev && pnpm watch unbuild src --wait=0.2",
@@ -23,7 +23,7 @@
"eslint.js"
],
"dependencies": {
"@blitzjs/rpc": "2.0.0-alpha.42",
"@blitzjs/rpc": "2.0.0-alpha.43",
"@types/hoist-non-react-statics": "3.3.1",
"debug": "4.3.3",
"fs-extra": "10.0.1",
@@ -32,7 +32,7 @@
"superjson": "1.8.0"
},
"devDependencies": {
"@blitzjs/config": "workspace:2.0.0-alpha.42",
"@blitzjs/config": "workspace:2.0.0-alpha.43",
"@testing-library/dom": "8.13.0",
"@testing-library/jest-dom": "5.16.3",
"@testing-library/react": "13.0.0",
@@ -42,7 +42,7 @@
"@types/react": "18.0.1",
"@types/react-dom": "17.0.14",
"@types/testing-library__react-hooks": "4.0.0",
"blitz": "2.0.0-alpha.42",
"blitz": "2.0.0-alpha.43",
"cross-spawn": "7.0.3",
"find-up": "4.1.0",
"next": "12.1.6-canary.17",

View File

@@ -1,5 +1,13 @@
# @blitzjs/rpc
## 2.0.0-alpha.43
### Patch Changes
- Updated dependencies [527e48ac]
- blitz@2.0.0-alpha.43
- @blitzjs/auth@2.0.0-alpha.43
## 2.0.0-alpha.42
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/rpc",
"version": "2.0.0-alpha.42",
"version": "2.0.0-alpha.43",
"scripts": {
"build": "unbuild",
"predev": "wait-on -d 250 ../blitz/dist/index-server.d.ts && wait-on -d 250 ../blitz-auth/dist/index-browser.d.ts",
@@ -20,7 +20,7 @@
"dist/**"
],
"dependencies": {
"@blitzjs/auth": "2.0.0-alpha.42",
"@blitzjs/auth": "2.0.0-alpha.43",
"b64-lite": "1.4.0",
"bad-behavior": "1.0.1",
"chalk": "^4.1.0",
@@ -30,11 +30,11 @@
"zod": "3.10.1"
},
"devDependencies": {
"@blitzjs/config": "workspace:2.0.0-alpha.42",
"@blitzjs/config": "workspace:2.0.0-alpha.43",
"@types/debug": "4.1.7",
"@types/react": "18.0.1",
"@types/react-dom": "17.0.14",
"blitz": "2.0.0-alpha.42",
"blitz": "2.0.0-alpha.43",
"next": "12.1.6-canary.17",
"react": "18.0.0",
"react-dom": "18.0.0",
@@ -43,7 +43,7 @@
"watch": "1.0.2"
},
"peerDependencies": {
"blitz": "2.0.0-alpha.42",
"blitz": "2.0.0-alpha.43",
"next": "*"
},
"publishConfig": {

View File

@@ -1,5 +1,12 @@
# blitz
## 2.0.0-alpha.43
### Patch Changes
- 527e48ac: Fix running bin commands with Blitz CLI
- @blitzjs/generator@2.0.0-alpha.43
## 2.0.0-alpha.42
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "blitz",
"version": "2.0.0-alpha.42",
"version": "2.0.0-alpha.43",
"scripts": {
"build": "unbuild",
"dev": "watch unbuild src --wait=0.2",
@@ -23,7 +23,7 @@
"blitz": "bin/blitz"
},
"dependencies": {
"@blitzjs/generator": "2.0.0-alpha.42",
"@blitzjs/generator": "2.0.0-alpha.43",
"arg": "5.0.1",
"chalk": "^4.1.0",
"console-table-printer": "2.10.0",
@@ -52,7 +52,7 @@
"watchpack": "2.1.1"
},
"devDependencies": {
"@blitzjs/config": "workspace:2.0.0-alpha.42",
"@blitzjs/config": "workspace:2.0.0-alpha.43",
"@types/cookie": "0.4.1",
"@types/cross-spawn": "6.0.2",
"@types/debug": "4.1.7",

View File

@@ -46,26 +46,28 @@ const aliases: Record<string, keyof typeof commands> = {
type Command = keyof typeof commands
type Alias = keyof typeof aliases
const defaultCommand: Command = "dev"
const foundCommand = Boolean(commands[args._[0] as Command])
const foundAlias = Boolean(aliases[args._[0] as Alias])
let command: Command = defaultCommand
if (foundCommand) {
command = args._[0] as Command
let blitzCommand: Command | undefined
if (commands[args._[0] as Command]) {
blitzCommand = args._[0] as Command
}
if (foundAlias) {
command = aliases[args._[0] as Alias] as Command
if (aliases[args._[0] as Alias]) {
blitzCommand = aliases[args._[0] as Alias]
}
const forwardedArgs = foundCommand || foundAlias ? args._.slice(1) : args._
const forwardedArgs = blitzCommand ? args._.slice(1) : args._
const globalBlitzPath = resolveFrom(__dirname, "blitz")
const localBlitzPath = resolveFrom.silent(process.cwd(), "blitz")
async function runCommandFromBin() {
if (!args._[0]) {
console.log("No command specified")
process.exit(1)
}
let commandBin: string | null = null
try {
commandBin = await getCommandBin(command)
commandBin = await getCommandBin(args._[0])
} catch (e: any) {
console.error(`Error: ${e.message}`)
}
@@ -143,7 +145,8 @@ async function main() {
}
// env variable should default to dev unless the command is build or start
const defaultEnv = command === "build" || command === "start" ? "production" : "development"
const defaultEnv =
blitzCommand === "build" || blitzCommand === "start" ? "production" : "development"
const standardEnv = ["production", "development", "test"]
if (process.env.NODE_ENV && !standardEnv.includes(process.env.NODE_ENV)) {
@@ -156,12 +159,12 @@ async function main() {
process.on("SIGTERM", () => process.exit(0))
process.on("SIGINT", () => process.exit(0))
if (foundCommand || foundAlias) {
const commandFn = commands[command] || aliases[command]
if (blitzCommand) {
const commandFn = commands[blitzCommand]
commandFn?.()
.then((exec: any) => exec(forwardedArgs))
.then(() => {
if (command === "build") {
if (blitzCommand === "build") {
// ensure process exits after build completes so open handles/connections
// don't cause process to hang
process.exit(0)

View File

@@ -1,5 +1,13 @@
# @blitzjs/codemod
## 2.0.0-alpha.43
### Patch Changes
- Updated dependencies [527e48ac]
- blitz@2.0.0-alpha.43
- @blitzjs/generator@2.0.0-alpha.43
## 2.0.0-alpha.42
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/codemod",
"version": "2.0.0-alpha.42",
"version": "2.0.0-alpha.43",
"scripts": {
"build": "unbuild",
"dev": "watch unbuild src --wait=0.2",
@@ -25,9 +25,9 @@
"@babel/plugin-proposal-class-properties": "7.17.12",
"@babel/plugin-syntax-jsx": "7.17.12",
"@babel/plugin-syntax-typescript": "7.17.12",
"@blitzjs/generator": "2.0.0-alpha.42",
"@blitzjs/generator": "2.0.0-alpha.43",
"arg": "5.0.1",
"blitz": "2.0.0-alpha.42",
"blitz": "2.0.0-alpha.43",
"chalk": "^4.1.0",
"cross-spawn": "7.0.3",
"debug": "4.3.3",

View File

@@ -1,5 +1,7 @@
# @blitzjs/config
## 2.0.0-alpha.43
## 2.0.0-alpha.42
## 2.0.0-alpha.41

View File

@@ -1,7 +1,7 @@
{
"name": "@blitzjs/config",
"private": true,
"version": "2.0.0-alpha.42",
"version": "2.0.0-alpha.43",
"license": "MIT",
"dependencies": {
"@typescript-eslint/eslint-plugin": "5.9.1",

View File

@@ -1,5 +1,7 @@
# @blitzjs/generator
## 2.0.0-alpha.43
## 2.0.0-alpha.42
## 2.0.0-alpha.41

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/generator",
"version": "2.0.0-alpha.42",
"version": "2.0.0-alpha.43",
"scripts": {
"dev": "watch unbuild src --wait=0.2",
"build": "unbuild && pnpm build:templates",
@@ -45,7 +45,7 @@
"vinyl": "2.2.1"
},
"devDependencies": {
"@blitzjs/config": "2.0.0-alpha.42",
"@blitzjs/config": "2.0.0-alpha.43",
"@juanm04/cpx": "2.0.1",
"@types/babel__core": "7.1.19",
"@types/diff": "5.0.2",

View File

@@ -25,7 +25,7 @@
"@typescript-eslint/parser": "5.9.1"
},
"devDependencies": {
"@blitzjs/config": "2.0.0-alpha.42",
"@blitzjs/config": "2.0.0-alpha.43",
"@types/react": "18.0.1",
"@types/react-dom": "17.0.14",
"react": "18.0.0",

884
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff