1
0
mirror of synced 2026-02-05 06:00:08 -05:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Dillon Raphael
01f3a03ea9 alpha.16 2022-04-29 18:21:07 -04:00
Dillon Raphael
36e26193b7 alpha.15 2022-04-29 18:13:17 -04:00
Dillon Raphael
4a9aa9f7ff alpha.14 2022-04-29 18:08:06 -04:00
Dillon Raphael
1e1bb73b2d alpha.13 2022-04-29 16:25:20 -04:00
28 changed files with 656 additions and 348 deletions

View File

@@ -0,0 +1,7 @@
---
"blitz": patch
"@blitzjs/next": patch
"@blitzjs/generator": patch
---
Fix codegen and postinstall to make work with pnpm

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
set default enviornment variable to development unless build and start command

View File

@@ -16,7 +16,9 @@
"toolkit-app": "1.0.0"
},
"changesets": [
"breezy-cameras-double",
"dirty-monkeys-greet",
"flat-bees-approve",
"great-months-train",
"lovely-colts-share",
"nine-onions-admire",
@@ -27,6 +29,8 @@
"swift-drinks-dress",
"ten-rivers-burn",
"thirty-countries-build",
"twenty-beans-pump"
"twenty-beans-pump",
"unlucky-papayas-sleep",
"wicked-ghosts-cough"
]
}

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
remove console logs inside onPostInstall in the new cli command

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/generator": patch
---
fix template sourcepath because of new env variable

View File

@@ -1,5 +1,48 @@
# toolkit-app
## 1.0.1-alpha.11
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.16
- @blitzjs/auth@2.0.0-alpha.16
- @blitzjs/next@2.0.0-alpha.16
- @blitzjs/rpc@2.0.0-alpha.16
- @blitzjs/config@2.0.0-alpha.16
## 1.0.1-alpha.10
### Patch Changes
- blitz@2.0.0-alpha.15
- @blitzjs/auth@2.0.0-alpha.15
- @blitzjs/next@2.0.0-alpha.15
- @blitzjs/rpc@2.0.0-alpha.15
- @blitzjs/config@2.0.0-alpha.15
## 1.0.1-alpha.9
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.14
- @blitzjs/auth@2.0.0-alpha.14
- @blitzjs/next@2.0.0-alpha.14
- @blitzjs/rpc@2.0.0-alpha.14
- @blitzjs/config@2.0.0-alpha.14
## 1.0.1-alpha.8
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.13
- @blitzjs/next@2.0.0-alpha.13
- @blitzjs/auth@2.0.0-alpha.13
- @blitzjs/rpc@2.0.0-alpha.13
- @blitzjs/config@2.0.0-alpha.13
## 1.0.1-alpha.7
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "toolkit-app",
"version": "1.0.1-alpha.7",
"version": "1.0.1-alpha.11",
"scripts": {
"start:dev": "pnpm run prisma:start && next dev",
"buildapp": "prisma generate && next build",
@@ -29,7 +29,7 @@
"@blitzjs/rpc": "workspace:*",
"@hookform/resolvers": "2.8.8",
"@prisma/client": "3.9.0",
"blitz": "workspace:2.0.0-alpha.12",
"blitz": "workspace:2.0.0-alpha.16",
"next": "12.1.1",
"prisma": "3.9.0",
"react": "18.0.0",

View File

@@ -1,5 +1,32 @@
# @blitzjs/auth
## 2.0.0-alpha.16
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.16
## 2.0.0-alpha.15
### Patch Changes
- blitz@2.0.0-alpha.15
## 2.0.0-alpha.14
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.14
## 2.0.0-alpha.13
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.13
## 2.0.0-alpha.12
### Patch Changes

View File

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

View File

@@ -1,5 +1,30 @@
# @blitzjs/next
## 2.0.0-alpha.16
### Patch Changes
- @blitzjs/rpc@2.0.0-alpha.16
## 2.0.0-alpha.15
### Patch Changes
- @blitzjs/rpc@2.0.0-alpha.15
## 2.0.0-alpha.14
### Patch Changes
- @blitzjs/rpc@2.0.0-alpha.14
## 2.0.0-alpha.13
### Patch Changes
- Fix codegen and postinstall to make work with pnpm
- @blitzjs/rpc@2.0.0-alpha.13
## 2.0.0-alpha.12
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/next",
"version": "2.0.0-alpha.12",
"version": "2.0.0-alpha.16",
"scripts": {
"build": "unbuild",
"dev": "pnpm predev && pnpm watch unbuild src --wait=0.2",
@@ -23,13 +23,13 @@
"eslint.js"
],
"dependencies": {
"@blitzjs/rpc": "2.0.0-alpha.12",
"@blitzjs/rpc": "2.0.0-alpha.16",
"debug": "4.3.3",
"fs-extra": "10.0.1",
"react-query": "3.21.1"
},
"devDependencies": {
"@blitzjs/config": "workspace:2.0.0-alpha.12",
"@blitzjs/config": "workspace:2.0.0-alpha.16",
"@testing-library/dom": "8.13.0",
"@testing-library/jest-dom": "5.16.3",
"@testing-library/react": "13.0.0",
@@ -40,7 +40,7 @@
"@types/react": "17.0.43",
"@types/react-dom": "17.0.14",
"@types/testing-library__react-hooks": "4.0.0",
"blitz": "2.0.0-alpha.12",
"blitz": "2.0.0-alpha.16",
"cross-spawn": "7.0.3",
"find-up": "4.1.0",
"lodash.frompairs": "4.0.1",

View File

@@ -27,6 +27,16 @@ async function findNodeModulesRoot(src) {
let root
if (isInBlitzMonorepo) {
root = path.join(src, "node_modules")
} else if (src.includes(".pnpm")) {
const blitzPkgLocation = path.dirname(
(await findUp("package.json", {
cwd: resolveFrom(src, "blitz"),
})) || "",
)
if (!blitzPkgLocation) {
throw new Error("Internal Blitz Error: unable to find 'blitz' package location")
}
root = path.join(blitzPkgLocation, "../../../../")
} else {
const blitzPkgLocation = path.dirname(
(await findUp("package.json", {
@@ -96,7 +106,11 @@ function codegen() {
const packagePath = require.resolve("blitz/package.json")
if (packagePath) {
const blitzPkg = require.resolve("blitz/dist/index.cjs")
return path.join(blitzPkg)
if (blitzPkg.includes(".pnpm")) {
return path.join(blitzPkg, "../../../../../../blitz/dist/index.cjs")
} else {
return path.join(blitzPkg)
}
}
} catch (e) {
//
@@ -323,6 +337,6 @@ function codegen() {
const UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR = 'UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR'
}
if (!isInstalledGlobally) {
codegen()
}
// if (!isInstalledGlobally) {
codegen()
// }

View File

@@ -1,5 +1,36 @@
# @blitzjs/rpc
## 2.0.0-alpha.16
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.16
- @blitzjs/auth@2.0.0-alpha.16
## 2.0.0-alpha.15
### Patch Changes
- blitz@2.0.0-alpha.15
- @blitzjs/auth@2.0.0-alpha.15
## 2.0.0-alpha.14
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.14
- @blitzjs/auth@2.0.0-alpha.14
## 2.0.0-alpha.13
### Patch Changes
- Updated dependencies
- blitz@2.0.0-alpha.13
- @blitzjs/auth@2.0.0-alpha.13
## 2.0.0-alpha.12
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/rpc",
"version": "2.0.0-alpha.12",
"version": "2.0.0-alpha.16",
"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.12",
"@blitzjs/auth": "2.0.0-alpha.16",
"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.12",
"@blitzjs/config": "workspace:2.0.0-alpha.16",
"@types/debug": "4.1.7",
"@types/react": "17.0.43",
"@types/react-dom": "17.0.14",
"blitz": "2.0.0-alpha.12",
"blitz": "2.0.0-alpha.16",
"next": "12.1.1",
"react": "18.0.0",
"react-dom": "18.0.0",
@@ -43,7 +43,7 @@
"watch": "1.0.2"
},
"peerDependencies": {
"blitz": "2.0.0-alpha.12",
"blitz": "2.0.0-alpha.16",
"next": "*"
},
"publishConfig": {

View File

@@ -1,5 +1,34 @@
# blitz
## 2.0.0-alpha.16
### Patch Changes
- remove console logs inside onPostInstall in the new cli command
- @blitzjs/generator@2.0.0-alpha.16
## 2.0.0-alpha.15
### Patch Changes
- Updated dependencies
- @blitzjs/generator@2.0.0-alpha.15
## 2.0.0-alpha.14
### Patch Changes
- set default enviornment variable to development unless build and start command
- @blitzjs/generator@2.0.0-alpha.14
## 2.0.0-alpha.13
### Patch Changes
- Fix codegen and postinstall to make work with pnpm
- Updated dependencies
- @blitzjs/generator@2.0.0-alpha.13
## 2.0.0-alpha.12
### Patch Changes

View File

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

View File

@@ -193,12 +193,13 @@ const determinePkgManagerToInstallDeps = async () => {
message: "Install dependencies?",
initial: 0,
choices: [
{title: "npm"},
{title: "yarn", disabled: !IS_YARN_INSTALLED},
{title: "pnpm", disabled: !IS_PNPM_INSTALLED},
{title: "npm", value: "npm"},
{title: "yarn", value: "yarn", disabled: !IS_YARN_INSTALLED},
{title: "pnpm", value: "pnpm", disabled: !IS_PNPM_INSTALLED},
{title: "skip"},
],
})
projectPkgManger = res.pkgManager
if (res.pkgManager === "skip") {
@@ -263,7 +264,6 @@ const newApp: CliCommand = async (argv) => {
{ignoreCache: true},
)
const result = await runPrisma(["migrate", "dev", "--name", "Initial migration"], true)
console.log("primsa result", result)
if (!result.success) throw new Error()
} catch (error) {
postInstallSteps.push(

View File

@@ -58,7 +58,8 @@ if (args["--help"]) {
forwardedArgs.push("--help")
}
const defaultEnv = command === "dev" ? "development" : "production"
// env variable should default to dev unless the command is build or start
const defaultEnv = command === "build" || command === "start" ? "production" : "development"
const standardEnv = ["production", "development", "test"]
if (process.env.NODE_ENV && !standardEnv.includes(process.env.NODE_ENV)) {

View File

@@ -538,7 +538,11 @@ async function findNodeModulesRoot(src: string) {
throw new Error("Internal Blitz Error: unable to find 'blitz' package location")
}
root = join(blitzPkgLocation, "../")
if (blitzPkgLocation.includes(".pnpm")) {
root = join(blitzPkgLocation, "../../../../")
} else {
root = join(blitzPkgLocation, "../")
}
}
return root

View File

@@ -1,5 +1,13 @@
# @blitzjs/config
## 2.0.0-alpha.16
## 2.0.0-alpha.15
## 2.0.0-alpha.14
## 2.0.0-alpha.13
## 2.0.0-alpha.12
## 2.0.0-alpha.11

View File

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

View File

@@ -1,5 +1,21 @@
# @blitzjs/generator
## 2.0.0-alpha.16
## 2.0.0-alpha.15
### Patch Changes
- fix template sourcepath because of new env variable
## 2.0.0-alpha.14
## 2.0.0-alpha.13
### Patch Changes
- Fix codegen and postinstall to make work with pnpm
## 2.0.0-alpha.12
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/generator",
"version": "2.0.0-alpha.12",
"version": "2.0.0-alpha.16",
"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.12",
"@blitzjs/config": "2.0.0-alpha.16",
"@juanm04/cpx": "2.0.1",
"@types/babel__core": "7.1.19",
"@types/diff": "5.0.2",

View File

@@ -302,7 +302,7 @@ export abstract class Generator<
return path.join(
__dirname,
"..",
process.env.NODE_ENV === "test" ? "../templates" : "./dist/templates",
process.env.NODE_ENV === "test" ? "./templates" : "./dist/templates",
this.sourceRoot.path,
...paths,
)

View File

@@ -234,14 +234,6 @@ export class AppGenerator extends Generator<AppGeneratorOptions> {
}
}
// if(this.options.useTs) {
// if(templatedPathSuffix === "pages/api/rpc/blitzrpcroute.js") {
// this.fs.write(this.destinationPath("pages/api/rpc/[...blitz].js"), this.sourcePath("pages/api/rpc/blitzrpcroute.js"))
// } else {
// }
// }
if (!this.options.skipGit && gitInitSuccessful) {
this.commitChanges()
}

View File

@@ -6,9 +6,10 @@ export const getBlitzDependencyVersion = async (
cliVersion: string,
): Promise<Fallbackable<string>> => {
try {
// TODO: Need to update this to handle alpha, beta and major
const {alpha} = await fetchDistTags("blitz")
if (cliVersion.includes("alpha")) {
if (alpha) {
return {value: alpha}
}

View File

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

703
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff