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

Compare commits

...

3 Commits

Author SHA1 Message Date
Brandon Bayer
fb32903bf9 2.0.0-alpha.4 fix more cli stuff 2022-04-14 21:13:57 -04:00
Brandon Bayer
8dedca1a29 2.0.0-alpha.3 - fix cli esm problem 2022-04-14 21:04:51 -04:00
Brandon Bayer
b1ef45bf28 2.0.0-alpha.2 - fix generator npm package dist 2022-04-14 20:44:45 -04:00
21 changed files with 224 additions and 117 deletions

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
downgrade pkg-dir to non-esm only version

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/generator": patch
---
fix generator npm package dist

View File

@@ -14,5 +14,5 @@
"@blitzjs/generator": "2.0.0-alpha.0",
"template": "0.0.0"
},
"changesets": ["ninety-pets-heal"]
"changesets": ["nine-onions-admire", "ninety-pets-heal", "poor-peas-lick", "ten-rivers-burn"]
}

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
fix more cli problems

View File

@@ -17,7 +17,8 @@
"test": "turbo run test",
"clean": "turbo run clean && rm -rf node_modules",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"release": "changeset publish && git push --follow-tags"
"pre-publish": "pnpm i && pnpm build && changeset add && changeset version",
"publish-release": "changeset publish && git push --follow-tags"
},
"dependencies": {
"@blitzjs/manypkg": "0.19.1",

View File

@@ -1,5 +1,25 @@
# @blitzjs/auth
## 2.0.0-alpha.4
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.4
## 2.0.0-alpha.3
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.3
## 2.0.0-alpha.2
### Patch Changes
- blitz@2.0.0-alpha.2
## 2.0.0-alpha.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/auth",
"version": "2.0.0-alpha.1",
"version": "2.0.0-alpha.4",
"scripts": {
"build": "unbuild",
"predev": "wait-on -d 250 ../blitz/dist/index-server.d.ts",

View File

@@ -1,5 +1,23 @@
# @blitzjs/next
## 2.0.0-alpha.4
### Patch Changes
- @blitzjs/rpc@2.0.0-alpha.4
## 2.0.0-alpha.3
### Patch Changes
- @blitzjs/rpc@2.0.0-alpha.3
## 2.0.0-alpha.2
### Patch Changes
- @blitzjs/rpc@2.0.0-alpha.2
## 2.0.0-alpha.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/next",
"version": "2.0.0-alpha.1",
"version": "2.0.0-alpha.4",
"scripts": {
"build": "unbuild",
"dev": "pnpm predev && pnpm watch unbuild src --wait=0.2",
@@ -20,7 +20,7 @@
"dist/**"
],
"dependencies": {
"@blitzjs/rpc": "2.0.0-alpha.1",
"@blitzjs/rpc": "2.0.0-alpha.4",
"debug": "4.3.3",
"fs-extra": "10.0.1",
"react-query": "3.21.1"

View File

@@ -1,5 +1,28 @@
# @blitzjs/rpc
## 2.0.0-alpha.4
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.4
- @blitzjs/auth@2.0.0-alpha.4
## 2.0.0-alpha.3
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.3
- @blitzjs/auth@2.0.0-alpha.3
## 2.0.0-alpha.2
### Patch Changes
- blitz@2.0.0-alpha.2
- @blitzjs/auth@2.0.0-alpha.2
## 2.0.0-alpha.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/rpc",
"version": "2.0.0-alpha.1",
"version": "2.0.0-alpha.4",
"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.1",
"@blitzjs/auth": "2.0.0-alpha.4",
"b64-lite": "1.4.0",
"bad-behavior": "1.0.1",
"chalk": "^4.1.0",
@@ -33,7 +33,7 @@
"@types/debug": "4.1.7",
"@types/react": "17.0.43",
"@types/react-dom": "17.0.14",
"blitz": "2.0.0-alpha.1",
"blitz": "2.0.0-alpha.4",
"next": "12.1.1",
"react": "18.0.0",
"react-dom": "18.0.0",
@@ -42,7 +42,7 @@
"watch": "1.0.2"
},
"peerDependencies": {
"blitz": "2.0.0-alpha.1",
"blitz": "2.0.0-alpha.4",
"next": "*"
},
"publishConfig": {

View File

@@ -1,5 +1,26 @@
# blitz
## 2.0.0-alpha.4
### Patch Changes
- fix more cli problems
- @blitzjs/generator@2.0.0-alpha.4
## 2.0.0-alpha.3
### Patch Changes
- downgrade pkg-dir to non-esm only version
- @blitzjs/generator@2.0.0-alpha.3
## 2.0.0-alpha.2
### Patch Changes
- Updated dependencies
- @blitzjs/generator@2.0.0-alpha.2
## 2.0.0-alpha.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "blitz",
"version": "2.0.0-alpha.1",
"version": "2.0.0-alpha.4",
"scripts": {
"build": "unbuild",
"dev": "watch unbuild src --wait=0.2",
@@ -38,7 +38,7 @@
"npm-which": "3.0.1",
"ora": "5.3.0",
"p-event": "4.2.0",
"pkg-dir": "6.0.1",
"pkg-dir": "5.0.0",
"prompts": "2.4.2",
"resolve-cwd": "3.0.0",
"superjson": "1.8.0",

View File

@@ -56,12 +56,15 @@ if (!foundCommand && args["--help"]) {
console.log(`
Usage
$ blitz <command>
Available commands
${Object.keys(commands).join(", ")}
Options
--env, -e App environment name
--version, -v Version number
--help, -h Displays this message
For more information run a command with the --help flag
$ blitz build --help
`)
@@ -71,20 +74,6 @@ if (!foundCommand && args["--help"]) {
const command = foundCommand ? (args._[0] as string) : defaultCommand
const forwardedArgs = foundCommand ? args._.slice(1) : args._
// Don't check for react or react-dom when running blitz new
if (command !== "new") {
;["react", "react-dom"].forEach((dependency) => {
try {
// When 'npm link' is used it checks the clone location. Not the project.
require.resolve(dependency)
} catch (err) {
console.warn(
`The module '${dependency}' was not found. Blitz.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install ${dependency}'`,
)
}
})
}
if (args["--help"]) {
forwardedArgs.push("--help")
}
@@ -117,21 +106,3 @@ commands[command]?.()
.catch((err) => {
console.log(err)
})
if (command === "dev") {
const {watchFile} = require("fs")
watchFile(`${process.cwd()}/blitz.config.js`, (cur: any, prev: any) => {
if (cur.size > 0 || prev.size > 0) {
console.log(
`\n> Found a change in blitz.config.js. Restart the server to see the changes in effect.`,
)
}
})
watchFile(`${process.cwd()}/blitz.config.ts`, (cur: any, prev: any) => {
if (cur.size > 0 || prev.size > 0) {
console.log(
`\n> Found a change in blitz.config.ts. Restart the server to see the changes in effect.`,
)
}
})
}

View File

@@ -2,12 +2,12 @@ import fs, {promises} from "fs"
import {join, resolve} from "path"
import {readJSON} from "fs-extra"
import path from "path"
import {packageDirectory} from "pkg-dir"
import pkgDir from "pkg-dir"
import resolveCwd from "resolve-cwd"
const debug = require("debug")("blitz:utils")
export async function resolveBinAsync(pkg: string, executable = pkg) {
const packageDir = await packageDirectory({cwd: resolveCwd(pkg)})
const packageDir = await pkgDir(resolveCwd(pkg))
if (!packageDir) throw new Error(`Could not find package.json for '${pkg}'`)
const {bin} = await readJSON(path.join(packageDir, "package.json"))

View File

@@ -4,7 +4,7 @@ import detect from "detect-port"
import path from "path"
import {existsSync, readJSONSync} from "fs-extra"
import * as esbuild from "esbuild"
import {packageDirectorySync} from "pkg-dir"
import pkgDir from "pkg-dir"
import type {ServerConfig} from "./config"
const debug = require("debug")("blitz:utils")
@@ -50,7 +50,7 @@ export function getCustomServerBuildPath() {
}
const getEsbuildOptions = (): esbuild.BuildOptions => {
const pkg = readJSONSync(path.join(packageDirectorySync()!, "package.json"))
const pkg = readJSONSync(path.join(pkgDir.sync()!, "package.json"))
return {
entryPoints: [getCustomServerPath()],
outfile: getCustomServerBuildPath(),

View File

@@ -1,3 +1,9 @@
# @blitzjs/config
## 2.0.0-alpha.4
## 2.0.0-alpha.3
## 2.0.0-alpha.2
## 2.0.0-alpha.1

View File

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

View File

@@ -1,5 +1,15 @@
# @blitzjs/generator
## 2.0.0-alpha.4
## 2.0.0-alpha.3
## 2.0.0-alpha.2
### Patch Changes
- fix generator npm package dist
## 2.0.0-alpha.1
### Patch Changes

View File

@@ -1,9 +1,10 @@
{
"name": "@blitzjs/generator",
"version": "2.0.0-alpha.1",
"version": "2.0.0-alpha.4",
"scripts": {
"build": "unbuild",
"dev": "watch unbuild src --wait=0.2",
"build": "unbuild && pnpm build:templates",
"build:templates": "cpx --clean --include-hidden \"templates/**\" dist/templates",
"lint": "eslint . --fix",
"test": "vitest run -r ./test --allowOnly",
"test-watch": "vitest",
@@ -42,6 +43,7 @@
},
"devDependencies": {
"@blitzjs/config": "workspace:*",
"@juanm04/cpx": "2.0.1",
"@types/babel__core": "7.1.19",
"@types/diff": "5.0.2",
"@types/fs-extra": "9.0.13",

154
pnpm-lock.yaml generated
View File

@@ -229,7 +229,7 @@ importers:
npm-which: 3.0.1
ora: 5.3.0
p-event: 4.2.0
pkg-dir: 6.0.1
pkg-dir: 5.0.0
prompts: 2.4.2
react: 18.0.0
resolve-cwd: 3.0.0
@@ -256,7 +256,7 @@ importers:
npm-which: 3.0.1
ora: 5.3.0
p-event: 4.2.0
pkg-dir: 6.0.1
pkg-dir: 5.0.0
prompts: 2.4.2
resolve-cwd: 3.0.0
superjson: 1.8.0
@@ -345,7 +345,7 @@ importers:
packages/blitz-next:
specifiers:
"@blitzjs/config": workspace:*
"@blitzjs/rpc": 2.0.0-alpha.1
"@blitzjs/rpc": 2.0.0-alpha.3
"@testing-library/dom": 8.13.0
"@testing-library/jest-dom": 5.16.3
"@testing-library/react": 13.0.0
@@ -397,14 +397,14 @@ importers:
packages/blitz-rpc:
specifiers:
"@blitzjs/auth": 2.0.0-alpha.1
"@blitzjs/auth": 2.0.0-alpha.3
"@blitzjs/config": workspace:*
"@types/debug": 4.1.7
"@types/react": 17.0.43
"@types/react-dom": 17.0.14
b64-lite: 1.4.0
bad-behavior: 1.0.1
blitz: 2.0.0-alpha.1
blitz: 2.0.0-alpha.3
chalk: ^4.1.0
debug: 4.3.3
next: 12.1.1
@@ -458,6 +458,7 @@ importers:
"@babel/preset-env": 7.12.10
"@babel/types": 7.12.10
"@blitzjs/config": workspace:*
"@juanm04/cpx": 2.0.1
"@mrleebo/prisma-ast": 0.2.6
"@types/babel__core": 7.1.19
"@types/diff": 5.0.2
@@ -516,6 +517,7 @@ importers:
vinyl: 2.2.1
devDependencies:
"@blitzjs/config": link:../config
"@juanm04/cpx": 2.0.1
"@types/babel__core": 7.1.19
"@types/diff": 5.0.2
"@types/fs-extra": 9.0.13
@@ -2922,6 +2924,30 @@ packages:
"@jridgewell/sourcemap-codec": 1.4.11
dev: false
/@juanm04/cpx/2.0.1:
resolution:
{
integrity: sha512-OaTjKI3ycQnF0Cb4KvLVycB/O8nki2wUYBstmMWW7ocrkFil+YzYO23C+zY321h4p9YxSXCA1Xeg30vtminh6A==,
}
engines: {node: ">=10"}
hasBin: true
dependencies:
co: 4.6.0
debounce: 1.2.1
debug: 4.3.4
duplexer: 0.1.2
fs-extra: 9.1.0
glob: 7.2.0
glob2base: 0.0.12
minimatch: 3.1.2
resolve: 1.22.0
safe-buffer: 5.2.1
shell-quote: 1.7.3
subarg: 1.0.0
transitivePeerDependencies:
- supports-color
dev: true
/@manypkg/find-root/1.1.0:
resolution:
{
@@ -4729,6 +4755,14 @@ packages:
/asynckit/0.4.0:
resolution: {integrity: sha1-x57Zf380y48robyXkLzDZkdLS3k=}
/at-least-node/1.0.0:
resolution:
{
integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==,
}
engines: {node: ">= 4.0.0"}
dev: true
/atob/2.1.2:
resolution:
{
@@ -5531,7 +5565,6 @@ packages:
/co/4.6.0:
resolution: {integrity: sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=}
engines: {iojs: ">= 1.0.0", node: ">= 0.12.0"}
dev: false
/collect-v8-coverage/1.0.1:
resolution:
@@ -5903,6 +5936,13 @@ packages:
whatwg-url: 10.0.0
dev: false
/debounce/1.2.1:
resolution:
{
integrity: sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==,
}
dev: true
/debug/2.6.9:
resolution:
{
@@ -7918,6 +7958,10 @@ packages:
pkg-dir: 3.0.0
dev: false
/find-index/0.1.1:
resolution: {integrity: sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=}
dev: true
/find-up/2.1.0:
resolution: {integrity: sha1-RdG35QbHF93UgndaK3eSCjwMV6c=}
engines: {node: ">=4"}
@@ -7957,17 +8001,6 @@ packages:
path-exists: 4.0.0
dev: false
/find-up/6.3.0:
resolution:
{
integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==,
}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
locate-path: 7.1.0
path-exists: 5.0.0
dev: false
/find-yarn-workspace-root/2.0.0:
resolution:
{
@@ -8123,6 +8156,19 @@ packages:
universalify: 0.1.2
dev: false
/fs-extra/9.1.0:
resolution:
{
integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==,
}
engines: {node: ">=10"}
dependencies:
at-least-node: 1.0.0
graceful-fs: 4.2.10
jsonfile: 6.1.0
universalify: 2.0.0
dev: true
/fs.realpath/1.0.0:
resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=}
@@ -8294,6 +8340,13 @@ packages:
once: 1.4.0
path-is-absolute: 1.0.1
/glob2base/0.0.12:
resolution: {integrity: sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=}
engines: {node: ">= 0.10"}
dependencies:
find-index: 0.1.1
dev: true
/globals/11.12.0:
resolution:
{
@@ -10407,16 +10460,6 @@ packages:
p-locate: 5.0.0
dev: false
/locate-path/7.1.0:
resolution:
{
integrity: sha512-HNx5uOnYeK4SxEoid5qnhRfprlJeGMzFRKPLCf/15N3/B4AiofNwC/yq7VBKdVk9dx7m+PiYCJOGg55JYTAqoQ==,
}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
p-locate: 6.0.0
dev: false
/lodash.clonedeep/4.5.0:
resolution: {integrity: sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=}
dev: false
@@ -11597,16 +11640,6 @@ packages:
yocto-queue: 0.1.0
dev: false
/p-limit/4.0.0:
resolution:
{
integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==,
}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
yocto-queue: 1.0.0
dev: false
/p-locate/2.0.0:
resolution: {integrity: sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=}
engines: {node: ">=4"}
@@ -11644,16 +11677,6 @@ packages:
p-limit: 3.1.0
dev: false
/p-locate/6.0.0:
resolution:
{
integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==,
}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
p-limit: 4.0.0
dev: false
/p-map/2.1.0:
resolution:
{
@@ -11805,14 +11828,6 @@ packages:
engines: {node: ">=8"}
dev: false
/path-exists/5.0.0:
resolution:
{
integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==,
}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dev: false
/path-is-absolute/1.0.1:
resolution: {integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18=}
engines: {node: ">=0.10.0"}
@@ -11940,14 +11955,14 @@ packages:
find-up: 4.1.0
dev: false
/pkg-dir/6.0.1:
/pkg-dir/5.0.0:
resolution:
{
integrity: sha512-C9R+PTCKGA32HG0n5I4JMYkdLL58ZpayVuncQHQrGeKa8o26A4o2x0u6BKekHG+Au0jv5ZW7Xfq1Cj6lm9Ag4w==,
integrity: sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==,
}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
engines: {node: ">=10"}
dependencies:
find-up: 6.3.0
find-up: 5.0.0
dev: false
/pkg-types/0.3.2:
@@ -13018,6 +13033,13 @@ packages:
}
engines: {node: ">=8"}
/shell-quote/1.7.3:
resolution:
{
integrity: sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==,
}
dev: true
/side-channel/1.0.4:
resolution:
{
@@ -13567,6 +13589,12 @@ packages:
dependencies:
react: 18.0.0
/subarg/1.0.0:
resolution: {integrity: sha1-9izxdYHplrSPyWVpn1TAauJouNI=}
dependencies:
minimist: 1.2.6
dev: true
/superjson/1.8.0:
resolution:
{
@@ -15108,14 +15136,6 @@ packages:
engines: {node: ">=10"}
dev: false
/yocto-queue/1.0.0:
resolution:
{
integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==,
}
engines: {node: ">=12.20"}
dev: false
/zod/3.10.1:
resolution:
{