Compare commits
3 Commits
@blitzjs/g
...
v2.0.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1010858446 | ||
|
|
ebd74b4e97 | ||
|
|
8870580710 |
@@ -102,6 +102,7 @@
|
||||
"red-badgers-retire",
|
||||
"rich-chairs-invent",
|
||||
"rich-queens-travel",
|
||||
"shaggy-carpets-brake",
|
||||
"sharp-falcons-begin",
|
||||
"shy-olives-hang",
|
||||
"shy-pumpkins-try",
|
||||
|
||||
5
.changeset/shaggy-carpets-brake.md
Normal file
5
.changeset/shaggy-carpets-brake.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Fix template path for the generator
|
||||
@@ -29,7 +29,7 @@
|
||||
"@blitzjs/rpc": "workspace:*",
|
||||
"@hookform/resolvers": "2.8.8",
|
||||
"@prisma/client": "4.0.0",
|
||||
"blitz": "workspace:2.0.0-alpha.66",
|
||||
"blitz": "workspace:2.0.0-alpha.67",
|
||||
"next": "12.2.0",
|
||||
"prisma": "4.0.0",
|
||||
"react": "18.0.0",
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"prettier": "^2.5.1",
|
||||
"prettier-plugin-prisma": "3.8.0",
|
||||
"pretty-quick": "3.1.3",
|
||||
"turbo": "1.1.5",
|
||||
"turbo": "1.4.2",
|
||||
"vitest": "0.8.2",
|
||||
"wait-on": "6.0.1"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @blitzjs/auth
|
||||
|
||||
## 2.0.0-alpha.67
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.67
|
||||
|
||||
## 2.0.0-alpha.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/auth",
|
||||
"version": "2.0.0-alpha.66",
|
||||
"version": "2.0.0-alpha.67",
|
||||
"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.66",
|
||||
"blitz": "2.0.0-alpha.67",
|
||||
"cookie": "0.4.1",
|
||||
"cookie-session": "2.0.0",
|
||||
"debug": "4.3.3",
|
||||
@@ -40,7 +40,7 @@
|
||||
"url": "0.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.66",
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.67",
|
||||
"@testing-library/react": "13.0.0",
|
||||
"@testing-library/react-hooks": "7.0.2",
|
||||
"@types/cookie": "0.4.1",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @blitzjs/next
|
||||
|
||||
## 2.0.0-alpha.67
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @blitzjs/rpc@2.0.0-alpha.67
|
||||
|
||||
## 2.0.0-alpha.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/next",
|
||||
"version": "2.0.0-alpha.66",
|
||||
"version": "2.0.0-alpha.67",
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "pnpm predev && pnpm watch unbuild src --wait=0.2",
|
||||
@@ -24,7 +24,7 @@
|
||||
"eslint.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@blitzjs/rpc": "2.0.0-alpha.66",
|
||||
"@blitzjs/rpc": "2.0.0-alpha.67",
|
||||
"@tanstack/react-query": "4.0.10",
|
||||
"@types/hoist-non-react-statics": "3.3.1",
|
||||
"debug": "4.3.3",
|
||||
@@ -34,7 +34,7 @@
|
||||
"supports-color": "8.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.66",
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.67",
|
||||
"@testing-library/dom": "8.13.0",
|
||||
"@testing-library/jest-dom": "5.16.3",
|
||||
"@testing-library/react": "13.0.0",
|
||||
@@ -44,7 +44,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.66",
|
||||
"blitz": "2.0.0-alpha.67",
|
||||
"cross-spawn": "7.0.3",
|
||||
"find-up": "4.1.0",
|
||||
"next": "12.2.0",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @blitzjs/rpc
|
||||
|
||||
## 2.0.0-alpha.67
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @blitzjs/auth@2.0.0-alpha.67
|
||||
|
||||
## 2.0.0-alpha.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/rpc",
|
||||
"version": "2.0.0-alpha.66",
|
||||
"version": "2.0.0-alpha.67",
|
||||
"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.66",
|
||||
"@blitzjs/auth": "2.0.0-alpha.67",
|
||||
"@tanstack/react-query": "4.0.10",
|
||||
"b64-lite": "1.4.0",
|
||||
"bad-behavior": "1.0.1",
|
||||
@@ -30,11 +30,11 @@
|
||||
"supports-color": "8.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.66",
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.67",
|
||||
"@types/debug": "4.1.7",
|
||||
"@types/react": "18.0.1",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"blitz": "2.0.0-alpha.66",
|
||||
"blitz": "2.0.0-alpha.67",
|
||||
"next": "12.2.0",
|
||||
"react": "18.0.0",
|
||||
"react-dom": "18.0.0",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# blitz
|
||||
|
||||
## 2.0.0-alpha.67
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [ebd74b4e]
|
||||
- @blitzjs/generator@2.0.0-alpha.67
|
||||
|
||||
## 2.0.0-alpha.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "blitz",
|
||||
"version": "2.0.0-alpha.66",
|
||||
"version": "2.0.0-alpha.67",
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "watch unbuild src --wait=0.2",
|
||||
@@ -23,7 +23,7 @@
|
||||
"blitz": "bin/blitz"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/generator": "2.0.0-alpha.66",
|
||||
"@blitzjs/generator": "2.0.0-alpha.67",
|
||||
"arg": "5.0.1",
|
||||
"boxen": "7.0.0",
|
||||
"chalk": "^4.1.0",
|
||||
@@ -55,7 +55,7 @@
|
||||
"watchpack": "2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.66",
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.67",
|
||||
"@types/cookie": "0.4.1",
|
||||
"@types/cross-spawn": "6.0.2",
|
||||
"@types/debug": "4.1.7",
|
||||
|
||||
@@ -1,276 +1,261 @@
|
||||
import {
|
||||
capitalize,
|
||||
FormGenerator,
|
||||
ModelGenerator,
|
||||
MutationGenerator,
|
||||
MutationsGenerator,
|
||||
PageGenerator,
|
||||
pluralCamel,
|
||||
pluralPascal,
|
||||
QueriesGenerator,
|
||||
QueryGenerator,
|
||||
singleCamel,
|
||||
singlePascal,
|
||||
uncapitalize,
|
||||
} from "@blitzjs/generator"
|
||||
import arg from "arg"
|
||||
import {CliCommand} from "../index"
|
||||
import prompts from "prompts"
|
||||
import chalk from "chalk"
|
||||
export {}
|
||||
// import arg from "arg"
|
||||
// import {CliCommand} from "../index"
|
||||
// import prompts from "prompts"
|
||||
|
||||
const getIsTypeScript = async () =>
|
||||
require("fs").existsSync(require("path").join(process.cwd(), "tsconfig.json"))
|
||||
// const getIsTypeScript = async () =>
|
||||
// require("fs").existsSync(require("path").join(process.cwd(), "tsconfig.json"))
|
||||
|
||||
enum ResourceType {
|
||||
All = "all",
|
||||
Crud = "crud",
|
||||
Model = "model",
|
||||
Pages = "pages",
|
||||
Queries = "queries",
|
||||
Query = "query",
|
||||
Mutations = "mutations",
|
||||
Mutation = "mutation",
|
||||
Resource = "resource",
|
||||
}
|
||||
// enum ResourceType {
|
||||
// All = "all",
|
||||
// Crud = "crud",
|
||||
// Model = "model",
|
||||
// Pages = "pages",
|
||||
// Queries = "queries",
|
||||
// Query = "query",
|
||||
// Mutations = "mutations",
|
||||
// Mutation = "mutation",
|
||||
// Resource = "resource",
|
||||
// }
|
||||
|
||||
function modelName(input: string = "") {
|
||||
return singleCamel(input)
|
||||
}
|
||||
function modelNames(input: string = "") {
|
||||
return pluralCamel(input)
|
||||
}
|
||||
function ModelName(input: string = "") {
|
||||
return singlePascal(input)
|
||||
}
|
||||
function ModelNames(input: string = "") {
|
||||
return pluralPascal(input)
|
||||
}
|
||||
// function modelName(input: string = "") {
|
||||
// return singleCamel(input)
|
||||
// }
|
||||
// function modelNames(input: string = "") {
|
||||
// return pluralCamel(input)
|
||||
// }
|
||||
// function ModelName(input: string = "") {
|
||||
// return singlePascal(input)
|
||||
// }
|
||||
// function ModelNames(input: string = "") {
|
||||
// return pluralPascal(input)
|
||||
// }
|
||||
|
||||
const generatorMap = {
|
||||
[ResourceType.All]: [
|
||||
PageGenerator,
|
||||
FormGenerator,
|
||||
QueriesGenerator,
|
||||
MutationsGenerator,
|
||||
ModelGenerator,
|
||||
],
|
||||
[ResourceType.Crud]: [MutationsGenerator, QueriesGenerator],
|
||||
[ResourceType.Model]: [ModelGenerator],
|
||||
[ResourceType.Pages]: [PageGenerator, FormGenerator],
|
||||
[ResourceType.Queries]: [QueriesGenerator],
|
||||
[ResourceType.Query]: [QueryGenerator],
|
||||
[ResourceType.Mutations]: [MutationsGenerator],
|
||||
[ResourceType.Mutation]: [MutationGenerator],
|
||||
[ResourceType.Resource]: [QueriesGenerator, MutationsGenerator, ModelGenerator],
|
||||
}
|
||||
// const generatorMap = {
|
||||
// [ResourceType.All]: [
|
||||
// PageGenerator,
|
||||
// FormGenerator,
|
||||
// QueriesGenerator,
|
||||
// MutationsGenerator,
|
||||
// ModelGenerator,
|
||||
// ],
|
||||
// [ResourceType.Crud]: [MutationsGenerator, QueriesGenerator],
|
||||
// [ResourceType.Model]: [ModelGenerator],
|
||||
// [ResourceType.Pages]: [PageGenerator, FormGenerator],
|
||||
// [ResourceType.Queries]: [QueriesGenerator],
|
||||
// [ResourceType.Query]: [QueryGenerator],
|
||||
// [ResourceType.Mutations]: [MutationsGenerator],
|
||||
// [ResourceType.Mutation]: [MutationGenerator],
|
||||
// [ResourceType.Resource]: [QueriesGenerator, MutationsGenerator, ModelGenerator],
|
||||
// }
|
||||
|
||||
const args = arg(
|
||||
{
|
||||
// Types
|
||||
"--help": Boolean,
|
||||
"--type": String,
|
||||
"--name": String,
|
||||
"--context": String,
|
||||
"--parent": String,
|
||||
"--dry-run": Boolean,
|
||||
"--env": String,
|
||||
// const args = arg(
|
||||
// {
|
||||
// // Types
|
||||
// "--help": Boolean,
|
||||
// "--type": String,
|
||||
// "--name": String,
|
||||
// "--context": String,
|
||||
// "--parent": String,
|
||||
// "--dry-run": Boolean,
|
||||
// "--env": String,
|
||||
|
||||
// Aliases
|
||||
"-e": "--env",
|
||||
"-n": "--name",
|
||||
"-t": "--type",
|
||||
"-c": "--context",
|
||||
"-p": "--dry-run",
|
||||
},
|
||||
{
|
||||
permissive: true,
|
||||
},
|
||||
)
|
||||
// // Aliases
|
||||
// "-e": "--env",
|
||||
// "-n": "--name",
|
||||
// "-t": "--type",
|
||||
// "-c": "--context",
|
||||
// "-p": "--dry-run",
|
||||
// },
|
||||
// {
|
||||
// permissive: true,
|
||||
// },
|
||||
// )
|
||||
|
||||
let selectedType: string | keyof typeof generatorMap
|
||||
let selectedModelName: string | undefined
|
||||
let selectedContext: string | undefined
|
||||
let selectedParent: string | undefined = args["--parent"] ?? undefined
|
||||
// let selectedType: string | keyof typeof generatorMap
|
||||
// let selectedModelName: string | undefined
|
||||
// let selectedContext: string | undefined
|
||||
// let selectedParent: string | undefined = args["--parent"] ?? undefined
|
||||
|
||||
const getModelNameAndContext = (
|
||||
modelName: string,
|
||||
context?: string,
|
||||
): {model: string; context?: string} => {
|
||||
const modelSegments = modelName.split(/[\\/]/)
|
||||
// const getModelNameAndContext = (
|
||||
// modelName: string,
|
||||
// context?: string,
|
||||
// ): {model: string; context?: string} => {
|
||||
// const modelSegments = modelName.split(/[\\/]/)
|
||||
|
||||
if (modelSegments.length > 1) {
|
||||
return {
|
||||
model: modelSegments[modelSegments.length - 1] as string,
|
||||
context: require("path").join(...modelSegments.slice(0, modelSegments.length - 1)),
|
||||
}
|
||||
}
|
||||
// if (modelSegments.length > 1) {
|
||||
// return {
|
||||
// model: modelSegments[modelSegments.length - 1] as string,
|
||||
// context: require("path").join(...modelSegments.slice(0, modelSegments.length - 1)),
|
||||
// }
|
||||
// }
|
||||
|
||||
if (Boolean(context)) {
|
||||
const contextSegments = (context as string).split(/[\\/]/)
|
||||
// if (Boolean(context)) {
|
||||
// const contextSegments = (context as string).split(/[\\/]/)
|
||||
|
||||
return {
|
||||
model: modelName,
|
||||
context: require("path").join(...contextSegments),
|
||||
}
|
||||
}
|
||||
// return {
|
||||
// model: modelName,
|
||||
// context: require("path").join(...contextSegments),
|
||||
// }
|
||||
// }
|
||||
|
||||
return {
|
||||
model: modelName,
|
||||
}
|
||||
}
|
||||
// return {
|
||||
// model: modelName,
|
||||
// }
|
||||
// }
|
||||
|
||||
const validateModelName = (modelName: string): void => {
|
||||
const RESERVED_MODEL_NAMES = ["page", "api", "query", "mutation"]
|
||||
if (RESERVED_MODEL_NAMES.includes(modelName)) {
|
||||
throw new Error(`Names ${RESERVED_MODEL_NAMES} or their plurals cannot be used as model names`)
|
||||
}
|
||||
if (!/^[A-Za-z][A-Za-z0-9_]*$/.test(modelName)) {
|
||||
throw new Error(
|
||||
`Invalid model name: "${modelName}". Model names need to adhere to this regular expression: [A-Za-z][A-Za-z0-9_]*`,
|
||||
)
|
||||
}
|
||||
}
|
||||
// const validateModelName = (modelName: string): void => {
|
||||
// const RESERVED_MODEL_NAMES = ["page", "api", "query", "mutation"]
|
||||
// if (RESERVED_MODEL_NAMES.includes(modelName)) {
|
||||
// throw new Error(`Names ${RESERVED_MODEL_NAMES} or their plurals cannot be used as model names`)
|
||||
// }
|
||||
// if (!/^[A-Za-z][A-Za-z0-9_]*$/.test(modelName)) {
|
||||
// throw new Error(
|
||||
// `Invalid model name: "${modelName}". Model names need to adhere to this regular expression: [A-Za-z][A-Za-z0-9_]*`,
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
|
||||
const determineType = async () => {
|
||||
if (
|
||||
!args["_"].slice(1)[0] ||
|
||||
(args["_"].slice(1)[0] &&
|
||||
!Object.keys(generatorMap).includes(args["_"].slice(1)[0]?.toLowerCase() as string))
|
||||
) {
|
||||
const res = await prompts({
|
||||
type: "select",
|
||||
name: "type",
|
||||
message: "Which files to generate",
|
||||
initial: 0,
|
||||
choices: Object.entries(generatorMap).map((c) => {
|
||||
return {title: c[0], value: c[0]}
|
||||
}),
|
||||
})
|
||||
// const determineType = async () => {
|
||||
// if (
|
||||
// !args["_"].slice(1)[0] ||
|
||||
// (args["_"].slice(1)[0] &&
|
||||
// !Object.keys(generatorMap).includes(args["_"].slice(1)[0]?.toLowerCase() as string))
|
||||
// ) {
|
||||
// const res = await prompts({
|
||||
// type: "select",
|
||||
// name: "type",
|
||||
// message: "Which files to generate",
|
||||
// initial: 0,
|
||||
// choices: Object.entries(generatorMap).map((c) => {
|
||||
// return {title: c[0], value: c[0]}
|
||||
// }),
|
||||
// })
|
||||
|
||||
selectedType = res.type
|
||||
} else {
|
||||
selectedType = args["_"].slice(1)[0]?.toLowerCase() as string
|
||||
}
|
||||
}
|
||||
// selectedType = res.type
|
||||
// } else {
|
||||
// selectedType = args["_"].slice(1)[0]?.toLowerCase() as string
|
||||
// }
|
||||
// }
|
||||
|
||||
const determineName = async () => {
|
||||
if (!args["_"].slice(1)[1]) {
|
||||
const res = await prompts({
|
||||
type: "text",
|
||||
name: "model",
|
||||
message: `The name of your model, like "user". Can be singular or plural - same result`,
|
||||
})
|
||||
// const determineName = async () => {
|
||||
// if (!args["_"].slice(1)[1]) {
|
||||
// const res = await prompts({
|
||||
// type: "text",
|
||||
// name: "model",
|
||||
// message: `The name of your model, like "user". Can be singular or plural - same result`,
|
||||
// })
|
||||
|
||||
const {model, context} = getModelNameAndContext(res.model)
|
||||
selectedModelName = model
|
||||
selectedContext = context
|
||||
} else {
|
||||
const {model, context} = getModelNameAndContext(args["_"].slice(1)[1]!)
|
||||
selectedModelName = model
|
||||
selectedContext = context
|
||||
}
|
||||
}
|
||||
// const {model, context} = getModelNameAndContext(res.model)
|
||||
// selectedModelName = model
|
||||
// selectedContext = context
|
||||
// } else {
|
||||
// const {model, context} = getModelNameAndContext(args["_"].slice(1)[1]!)
|
||||
// selectedModelName = model
|
||||
// selectedContext = context
|
||||
// }
|
||||
// }
|
||||
|
||||
const determineContext = async () => {
|
||||
if (args["--context"] && !selectedModelName) {
|
||||
if (args["--name"] && args["--name"].includes("/")) {
|
||||
throw new Error("Your model should not contain a context when supplying a context explicitly")
|
||||
}
|
||||
// const determineContext = async () => {
|
||||
// if (args["--context"] && !selectedModelName) {
|
||||
// if (args["--name"] && args["--name"].includes("/")) {
|
||||
// throw new Error("Your model should not contain a context when supplying a context explicitly")
|
||||
// }
|
||||
|
||||
const res = await prompts({
|
||||
type: "text",
|
||||
name: "model",
|
||||
message: `The name of your model, like "user". Can be singular or plural - same result`,
|
||||
})
|
||||
// const res = await prompts({
|
||||
// type: "text",
|
||||
// name: "model",
|
||||
// message: `The name of your model, like "user". Can be singular or plural - same result`,
|
||||
// })
|
||||
|
||||
if (res.model.includes("/")) {
|
||||
throw new Error("Your model should not contain a context when supplying a context explicitly")
|
||||
}
|
||||
const {model, context} = getModelNameAndContext(res.model, args["--context"])
|
||||
selectedModelName = model
|
||||
selectedContext = context
|
||||
}
|
||||
}
|
||||
// if (res.model.includes("/")) {
|
||||
// throw new Error("Your model should not contain a context when supplying a context explicitly")
|
||||
// }
|
||||
// const {model, context} = getModelNameAndContext(res.model, args["--context"])
|
||||
// selectedModelName = model
|
||||
// selectedContext = context
|
||||
// }
|
||||
// }
|
||||
|
||||
const getHelp = async () => {
|
||||
if (args["--help"]) {
|
||||
console.log(`
|
||||
# The 'crud' type will generate all queries & mutations for a model
|
||||
|
||||
> blitz generate --type crud --name productVariant
|
||||
// const getHelp = async () => {
|
||||
// if (args["--help"]) {
|
||||
// console.log(`
|
||||
// # The 'crud' type will generate all queries & mutations for a model
|
||||
|
||||
# The 'all' generator will scaffold out everything possible for a model
|
||||
|
||||
> blitz generate --type all --name products
|
||||
// > blitz generate --type crud --name productVariant
|
||||
|
||||
# The '--context' flag will allow you to generate files in a nested folder
|
||||
|
||||
> blitz generate --type pages --name projects --context admin
|
||||
// # The 'all' generator will scaffold out everything possible for a model
|
||||
|
||||
# Context can also be supplied in the model name directly
|
||||
|
||||
> blitz generate --type pages --name admin/projects
|
||||
// > blitz generate --type all --name products
|
||||
|
||||
# To generate nested routes for dependent models (e.g. Projects that contain Tasks), specify a parent model.
|
||||
For example, this command generates pages under app/tasks/pages/projects/[projectId]/tasks/
|
||||
|
||||
> blitz generate --type all --name tasks --parent=projects
|
||||
// # The '--context' flag will allow you to generate files in a nested folder
|
||||
|
||||
# Database models can also be generated directly from the CLI.
|
||||
Model fields can be specified with any generator that generates a database model ("all", "model", "resource").
|
||||
Both of the commands below will generate the proper database model for a Task.
|
||||
|
||||
> blitz generate --type model --name task name:string completed:boolean:default=false belongsTo:project?
|
||||
// > blitz generate --type pages --name projects --context admin
|
||||
|
||||
> blitz generate --type all --name tasks name:string completed:boolean:default=false belongsTo:project?
|
||||
// # Context can also be supplied in the model name directly
|
||||
|
||||
`)
|
||||
// > blitz generate --type pages --name admin/projects
|
||||
|
||||
process.exit(0)
|
||||
}
|
||||
}
|
||||
// # To generate nested routes for dependent models (e.g. Projects that contain Tasks), specify a parent model.
|
||||
// For example, this command generates pages under app/tasks/pages/projects/[projectId]/tasks/
|
||||
|
||||
const generate: CliCommand = async (argv) => {
|
||||
await getHelp()
|
||||
await determineType()
|
||||
await determineContext()
|
||||
if (!selectedModelName) {
|
||||
await determineName()
|
||||
}
|
||||
// > blitz generate --type all --name tasks --parent=projects
|
||||
|
||||
try {
|
||||
const singularRootContext = modelName(selectedModelName)
|
||||
validateModelName(singularRootContext)
|
||||
// # Database models can also be generated directly from the CLI.
|
||||
// Model fields can be specified with any generator that generates a database model ("all", "model", "resource").
|
||||
// Both of the commands below will generate the proper database model for a Task.
|
||||
|
||||
// const {loadConfigProduction} = await import("next/dist/server/config-shared")
|
||||
// const blitzConfig = loadConfigProduction(process.cwd())
|
||||
const generators = generatorMap[selectedType as keyof typeof generatorMap]
|
||||
// > blitz generate --type model --name task name:string completed:boolean:default=false belongsTo:project?
|
||||
|
||||
for (const GeneratorClass of generators) {
|
||||
const generator = new GeneratorClass({
|
||||
destinationRoot: require("path").resolve(),
|
||||
// templateDir: blitzConfig.codegen?.templateDir,
|
||||
extraArgs: args["_"].slice(3) as string[],
|
||||
modelName: singularRootContext,
|
||||
modelNames: modelNames(singularRootContext),
|
||||
ModelName: ModelName(singularRootContext),
|
||||
ModelNames: ModelNames(singularRootContext),
|
||||
parentModel: modelName(selectedParent),
|
||||
parentModels: modelNames(selectedParent),
|
||||
ParentModel: ModelName(selectedParent),
|
||||
ParentModels: ModelNames(selectedParent),
|
||||
name: uncapitalize(selectedModelName!),
|
||||
Name: capitalize(selectedModelName!),
|
||||
dryRun: args["--dry-run"],
|
||||
context: selectedContext,
|
||||
useTs: await getIsTypeScript(),
|
||||
})
|
||||
await generator.run()
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
// > blitz generate --type all --name tasks name:string completed:boolean:default=false belongsTo:project?
|
||||
|
||||
export {generate}
|
||||
// `)
|
||||
|
||||
// process.exit(0)
|
||||
// }
|
||||
// }
|
||||
|
||||
// const generate: CliCommand = async (argv) => {
|
||||
// await getHelp()
|
||||
// await determineType()
|
||||
// await determineContext()
|
||||
// if (!selectedModelName) {
|
||||
// await determineName()
|
||||
// }
|
||||
|
||||
// try {
|
||||
// const singularRootContext = modelName(selectedModelName)
|
||||
// validateModelName(singularRootContext)
|
||||
|
||||
// // const {loadConfigProduction} = await import("next/dist/server/config-shared")
|
||||
// // const blitzConfig = loadConfigProduction(process.cwd())
|
||||
// const generators = generatorMap[selectedType as keyof typeof generatorMap]
|
||||
|
||||
// for (const GeneratorClass of generators) {
|
||||
// const generator = new GeneratorClass({
|
||||
// destinationRoot: require("path").resolve(),
|
||||
// // templateDir: blitzConfig.codegen?.templateDir,
|
||||
// extraArgs: args["_"].slice(3) as string[],
|
||||
// modelName: singularRootContext,
|
||||
// modelNames: modelNames(singularRootContext),
|
||||
// ModelName: ModelName(singularRootContext),
|
||||
// ModelNames: ModelNames(singularRootContext),
|
||||
// parentModel: modelName(selectedParent),
|
||||
// parentModels: modelNames(selectedParent),
|
||||
// ParentModel: ModelName(selectedParent),
|
||||
// ParentModels: ModelNames(selectedParent),
|
||||
// name: uncapitalize(selectedModelName!),
|
||||
// Name: capitalize(selectedModelName!),
|
||||
// dryRun: args["--dry-run"],
|
||||
// context: selectedContext,
|
||||
// useTs: await getIsTypeScript(),
|
||||
// })
|
||||
// await generator.run()
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.log(error)
|
||||
// process.exit(1)
|
||||
// }
|
||||
// }
|
||||
|
||||
// export {generate}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import {loadEnvConfig} from "../../env-utils"
|
||||
import prompts from "prompts"
|
||||
import path from "path"
|
||||
import chalk from "chalk"
|
||||
@@ -6,8 +5,9 @@ import hasbin from "hasbin"
|
||||
import {CliCommand} from "../index"
|
||||
import arg from "arg"
|
||||
import {AppGenerator, AppGeneratorOptions, getLatestVersion} from "@blitzjs/generator"
|
||||
import {loadEnvConfig} from "../../utils/env"
|
||||
import {runPrisma} from "../../utils/run-prisma"
|
||||
import {checkLatestVersion} from "../utils/check-latest-version"
|
||||
import {runPrisma} from "../../run-prisma"
|
||||
|
||||
const forms: Record<AppGeneratorOptions["form"], string> = {
|
||||
finalform: "React Final Form (recommended)",
|
||||
|
||||
@@ -1,38 +1,6 @@
|
||||
import {Readable} from "stream"
|
||||
import {getCommandBin} from "../utils/config"
|
||||
import {CliCommand} from "../index"
|
||||
import arg from "arg"
|
||||
|
||||
let prismaBin: string
|
||||
|
||||
export const runPrisma = async (args: string[], silent = false) => {
|
||||
if (!prismaBin) {
|
||||
try {
|
||||
prismaBin = await getCommandBin("prisma")
|
||||
} catch (err) {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
const cp = require("cross-spawn").spawn(prismaBin, args, {
|
||||
stdio: silent ? "pipe" : "inherit",
|
||||
env: process.env,
|
||||
})
|
||||
|
||||
const cp_stderr: string[] = []
|
||||
if (silent) {
|
||||
cp.stderr.on("data", (chunk: Readable) => {
|
||||
cp_stderr.push(chunk.toString())
|
||||
})
|
||||
}
|
||||
|
||||
const code = await require("p-event")(cp, "exit", {rejectionEvents: []})
|
||||
|
||||
return {
|
||||
success: code === 0,
|
||||
stderr: silent ? cp_stderr.join("") : undefined,
|
||||
}
|
||||
}
|
||||
import {runPrisma} from "../../utils/run-prisma"
|
||||
|
||||
export const runPrismaExitOnError = async (...args: Parameters<typeof runPrisma>) => {
|
||||
const result = await runPrisma(...args)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import arg from "arg"
|
||||
import spawn from "cross-spawn"
|
||||
|
||||
import {loadEnvConfig} from "../env-utils"
|
||||
import {loadEnvConfig} from "../utils/env"
|
||||
import {NON_STANDARD_NODE_ENV} from "./utils/constants"
|
||||
import {getCommandBin} from "./utils/config"
|
||||
import {readVersions} from "./utils/read-versions"
|
||||
@@ -31,7 +31,7 @@ const commands = {
|
||||
build: () => import("./commands/next/build").then((i) => i.build),
|
||||
start: () => import("./commands/next/start").then((i) => i.start),
|
||||
new: () => import("./commands/new").then((i) => i.newApp),
|
||||
generate: () => import("./commands/generate").then((i) => i.generate),
|
||||
// generate: () => import("./commands/generate").then((i) => i.generate),
|
||||
codegen: () => import("./commands/codegen").then((i) => i.codegen),
|
||||
db: () => import("./commands/db").then((i) => i.db),
|
||||
}
|
||||
@@ -41,7 +41,7 @@ const aliases: Record<string, keyof typeof commands> = {
|
||||
b: "build",
|
||||
s: "start",
|
||||
n: "new",
|
||||
g: "generate",
|
||||
// g: "generate",
|
||||
}
|
||||
|
||||
type Command = keyof typeof commands
|
||||
|
||||
@@ -4,7 +4,7 @@ import resolveCwd from "resolve-cwd"
|
||||
import {join} from "path"
|
||||
import fs from "fs-extra"
|
||||
import {getPackageJson} from "./get-package-json"
|
||||
import {runPrisma} from "../../run-prisma"
|
||||
import {runPrisma} from "../../utils/run-prisma"
|
||||
|
||||
export const codegenTasks = async () => {
|
||||
try {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
buildCustomServer,
|
||||
} from "./next-utils"
|
||||
import {checkLatestVersion} from "./check-latest-version"
|
||||
import {readBlitzConfig} from "../../server-utils"
|
||||
import {readBlitzConfig} from "../../utils/server"
|
||||
import {codegenTasks} from "./codegen-tasks"
|
||||
|
||||
export async function build(config: ServerConfig) {
|
||||
|
||||
@@ -79,8 +79,7 @@ if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
|
||||
}
|
||||
|
||||
export * from "./utils"
|
||||
export * from "./ts-utils"
|
||||
export * from "./types"
|
||||
export * from "./errors"
|
||||
export * from "./zod-utils"
|
||||
export * from "./prisma-utils"
|
||||
export * from "./utils/zod"
|
||||
export * from "./utils/prisma"
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
import "./global"
|
||||
import {IncomingMessage, ServerResponse} from "http"
|
||||
import {Ctx} from "./types"
|
||||
// import {findBlitzConfigDirectory} from "./cli/utils/routes-manifest"
|
||||
// import {readFileSync} from "fs-extra"
|
||||
|
||||
export * from "./index-browser"
|
||||
export * from "./types"
|
||||
export * from "./prisma-utils"
|
||||
export * from "./run-prisma"
|
||||
export * from "./utils/run-prisma"
|
||||
export * from "./middleware"
|
||||
export * from "./paginate"
|
||||
export {baseLogger, newLine, log} from "./logging"
|
||||
export {startWatcher, stopWatcher} from "./cli/utils/routes-manifest"
|
||||
// const blitzConfig = findBlitzConfigDirectory() as string
|
||||
// const file = readFileSync(blitzConfig)
|
||||
// export const Routes = eval(file.toString())
|
||||
|
||||
export interface MiddlewareResponse<C extends Ctx = Ctx> extends ServerResponse {
|
||||
blitzCtx: C
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
export type AsyncFunc = (...args: any) => Promise<any>
|
||||
|
||||
/**
|
||||
* Infer the type of the parameter from function that takes a single argument
|
||||
*/
|
||||
export type FirstParam<F extends (...args: any) => Promise<any>> = Parameters<F>[0]
|
||||
|
||||
/**
|
||||
* If type has a Promise, unwrap it. Otherwise return the original type
|
||||
*/
|
||||
export type Await<T> = T extends PromiseLike<infer U> ? U : T
|
||||
|
||||
/**
|
||||
* Ensure the type is a promise
|
||||
*/
|
||||
export type EnsurePromise<T> = T extends PromiseLike<unknown> ? T : Promise<T>
|
||||
|
||||
/**
|
||||
* Get the return type of a function which returns a Promise.
|
||||
*/
|
||||
export type PromiseReturnType<T extends (...args: any) => Promise<any>> = Await<ReturnType<T>>
|
||||
|
||||
export interface CancellablePromise<T> extends Promise<T> {
|
||||
cancel?: Function
|
||||
}
|
||||
|
||||
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
|
||||
k: infer I,
|
||||
) => void
|
||||
? I
|
||||
: never
|
||||
|
||||
export type Simplify<T> = {[P in keyof T]: T[P]}
|
||||
|
||||
export type AddParameters<
|
||||
TFunction extends (...args: any) => any,
|
||||
TParameters extends [...args: any],
|
||||
> = (...args: [...Parameters<TFunction>, ...TParameters]) => ReturnType<TFunction>
|
||||
@@ -5,3 +5,42 @@ export interface Ctx {}
|
||||
export interface RouteUrlObject extends Pick<UrlObject, "pathname" | "query"> {
|
||||
pathname: string
|
||||
}
|
||||
|
||||
export type AsyncFunc = (...args: any) => Promise<any>
|
||||
|
||||
/**
|
||||
* Infer the type of the parameter from function that takes a single argument
|
||||
*/
|
||||
export type FirstParam<F extends (...args: any) => Promise<any>> = Parameters<F>[0]
|
||||
|
||||
/**
|
||||
* If type has a Promise, unwrap it. Otherwise return the original type
|
||||
*/
|
||||
export type Await<T> = T extends PromiseLike<infer U> ? U : T
|
||||
|
||||
/**
|
||||
* Ensure the type is a promise
|
||||
*/
|
||||
export type EnsurePromise<T> = T extends PromiseLike<unknown> ? T : Promise<T>
|
||||
|
||||
/**
|
||||
* Get the return type of a function which returns a Promise.
|
||||
*/
|
||||
export type PromiseReturnType<T extends (...args: any) => Promise<any>> = Await<ReturnType<T>>
|
||||
|
||||
export interface CancellablePromise<T> extends Promise<T> {
|
||||
cancel?: Function
|
||||
}
|
||||
|
||||
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
|
||||
k: infer I,
|
||||
) => void
|
||||
? I
|
||||
: never
|
||||
|
||||
export type Simplify<T> = {[P in keyof T]: T[P]}
|
||||
|
||||
export type AddParameters<
|
||||
TFunction extends (...args: any) => any,
|
||||
TParameters extends [...args: any],
|
||||
> = (...args: [...Parameters<TFunction>, ...TParameters]) => ReturnType<TFunction>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import {RequestMiddleware} from "./index-server"
|
||||
import * as path from "path"
|
||||
import * as fs from "fs"
|
||||
import {RequestMiddleware} from "../index-server"
|
||||
|
||||
export function assert(condition: any, message: string): asserts condition {
|
||||
if (!condition) throw new Error(message)
|
||||
@@ -3,8 +3,8 @@ import {createServer, IncomingMessage, ServerResponse} from "http"
|
||||
import fetch from "node-fetch"
|
||||
import listen from "test-listen"
|
||||
import {Stream} from "stream"
|
||||
import {Middleware} from "./index-server"
|
||||
import {handleRequestWithMiddleware} from "./middleware"
|
||||
import {Middleware} from "../src/index-server"
|
||||
import {handleRequestWithMiddleware} from "../src/middleware"
|
||||
|
||||
export function sendData(res: ServerResponse, body: any): void {
|
||||
if (body === null || body === undefined) {
|
||||
@@ -1,5 +1,5 @@
|
||||
import {describe, it, expect} from "vitest"
|
||||
import {paginate} from "./paginate"
|
||||
import {paginate} from "../src/paginate"
|
||||
|
||||
describe("paginate", () => {
|
||||
const dummyPaginationPromises = {
|
||||
@@ -1,6 +1,6 @@
|
||||
import {describe, it, expect} from "vitest"
|
||||
import {z} from "zod"
|
||||
import {formatZodError, validateZodSchema} from "./zod-utils"
|
||||
import {formatZodError, validateZodSchema} from "../src/utils/zod"
|
||||
|
||||
const validateSchema = (schema: any, input: any) => {
|
||||
const result = schema.safeParse(input)
|
||||
@@ -1,5 +1,13 @@
|
||||
# @blitzjs/codemod
|
||||
|
||||
## 2.0.0-alpha.67
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [ebd74b4e]
|
||||
- @blitzjs/generator@2.0.0-alpha.67
|
||||
- blitz@2.0.0-alpha.67
|
||||
|
||||
## 2.0.0-alpha.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/codemod",
|
||||
"version": "2.0.0-alpha.66",
|
||||
"version": "2.0.0-alpha.67",
|
||||
"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.66",
|
||||
"@blitzjs/generator": "2.0.0-alpha.67",
|
||||
"arg": "5.0.1",
|
||||
"blitz": "2.0.0-alpha.66",
|
||||
"blitz": "2.0.0-alpha.67",
|
||||
"chalk": "^4.1.0",
|
||||
"cross-spawn": "7.0.3",
|
||||
"debug": "4.3.3",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @blitzjs/config
|
||||
|
||||
## 2.0.0-alpha.67
|
||||
|
||||
## 2.0.0-alpha.66
|
||||
|
||||
## 2.0.0-alpha.65
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@blitzjs/config",
|
||||
"private": true,
|
||||
"version": "2.0.0-alpha.66",
|
||||
"version": "2.0.0-alpha.67",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "5.9.1",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @blitzjs/generator
|
||||
|
||||
## 2.0.0-alpha.67
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- ebd74b4e: Fix template path for the generator
|
||||
|
||||
## 2.0.0-alpha.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/generator",
|
||||
"version": "2.0.0-alpha.66",
|
||||
"version": "2.0.0-alpha.67",
|
||||
"scripts": {
|
||||
"dev": "watch unbuild src --wait=0.2",
|
||||
"build": "unbuild && pnpm build:templates",
|
||||
@@ -46,7 +46,7 @@
|
||||
"vinyl": "2.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-alpha.66",
|
||||
"@blitzjs/config": "2.0.0-alpha.67",
|
||||
"@juanm04/cpx": "2.0.1",
|
||||
"@types/babel__core": "7.1.19",
|
||||
"@types/diff": "5.0.2",
|
||||
|
||||
@@ -302,7 +302,7 @@ export abstract class Generator<
|
||||
return path.join(
|
||||
__dirname,
|
||||
"..",
|
||||
process.env.NODE_ENV === "test" ? "./templates" : "./templates",
|
||||
process.env.NODE_ENV === "test" ? "./templates" : "./dist/templates",
|
||||
this.sourceRoot.path,
|
||||
...paths,
|
||||
)
|
||||
|
||||
@@ -4,9 +4,9 @@ import {readJSONSync, writeJson} from "fs-extra"
|
||||
import {join} from "path"
|
||||
import username from "username"
|
||||
import {Generator, GeneratorOptions, SourceRootType} from "../generator"
|
||||
import {baseLogger, log} from "../utils/log"
|
||||
import {fetchLatestVersionsFor} from "../utils/fetch-latest-version-for"
|
||||
import {getBlitzDependencyVersion} from "../utils/get-blitz-dependency-version"
|
||||
import {baseLogger, log} from "../utils/log"
|
||||
|
||||
function assert(condition: any, message: string): asserts condition {
|
||||
if (!condition) throw new Error(message)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"@typescript-eslint/parser": "5.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-alpha.66",
|
||||
"@blitzjs/config": "2.0.0-alpha.67",
|
||||
"@types/react": "18.0.1",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"react": "18.0.0",
|
||||
|
||||
156
pnpm-lock.yaml
generated
156
pnpm-lock.yaml
generated
@@ -14,7 +14,7 @@ importers:
|
||||
prettier: ^2.5.1
|
||||
prettier-plugin-prisma: 3.8.0
|
||||
pretty-quick: 3.1.3
|
||||
turbo: 1.1.5
|
||||
turbo: 1.4.2
|
||||
vitest: 0.8.2
|
||||
wait-on: 6.0.1
|
||||
dependencies:
|
||||
@@ -29,7 +29,7 @@ importers:
|
||||
prettier: 2.6.2
|
||||
prettier-plugin-prisma: 3.8.0_prettier@2.6.2
|
||||
pretty-quick: 3.1.3_prettier@2.6.2
|
||||
turbo: 1.1.5
|
||||
turbo: 1.4.2
|
||||
vitest: 0.8.2_jsdom@19.0.0
|
||||
wait-on: 6.0.1
|
||||
|
||||
@@ -49,7 +49,7 @@ importers:
|
||||
"@types/preview-email": 2.0.1
|
||||
"@types/react": 18.0.1
|
||||
"@typescript-eslint/eslint-plugin": 5.9.1
|
||||
blitz: workspace:2.0.0-alpha.65
|
||||
blitz: workspace:2.0.0-alpha.66
|
||||
eslint: 7.32.0
|
||||
eslint-config-next: 12.2.0
|
||||
eslint-config-prettier: 8.5.0
|
||||
@@ -324,7 +324,7 @@ importers:
|
||||
"@vitejs/plugin-react": 1.3.0
|
||||
delay: 5.0.0
|
||||
eslint: 7.32.0
|
||||
eslint-config-next: 12.2.3_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
eslint-config-next: 12.2.4_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
eslint-plugin-testing-library: 5.0.1_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
jsdom: 19.0.0
|
||||
typescript: 4.6.3
|
||||
@@ -475,8 +475,8 @@ importers:
|
||||
|
||||
packages/blitz:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.65
|
||||
"@blitzjs/generator": 2.0.0-alpha.65
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.66
|
||||
"@blitzjs/generator": 2.0.0-alpha.66
|
||||
"@types/cookie": 0.4.1
|
||||
"@types/cross-spawn": 6.0.2
|
||||
"@types/debug": 4.1.7
|
||||
@@ -586,7 +586,7 @@ importers:
|
||||
|
||||
packages/blitz-auth:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.65
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.66
|
||||
"@testing-library/react": 13.0.0
|
||||
"@testing-library/react-hooks": 7.0.2
|
||||
"@types/b64-lite": 1.3.0
|
||||
@@ -600,7 +600,7 @@ importers:
|
||||
"@types/secure-password": 3.1.1
|
||||
b64-lite: 1.4.0
|
||||
bad-behavior: 1.0.1
|
||||
blitz: 2.0.0-alpha.65
|
||||
blitz: 2.0.0-alpha.66
|
||||
cookie: 0.4.1
|
||||
cookie-session: 2.0.0
|
||||
debug: 4.3.3
|
||||
@@ -653,8 +653,8 @@ importers:
|
||||
|
||||
packages/blitz-next:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.65
|
||||
"@blitzjs/rpc": 2.0.0-alpha.65
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.66
|
||||
"@blitzjs/rpc": 2.0.0-alpha.66
|
||||
"@tanstack/react-query": 4.0.10
|
||||
"@testing-library/dom": 8.13.0
|
||||
"@testing-library/jest-dom": 5.16.3
|
||||
@@ -666,7 +666,7 @@ importers:
|
||||
"@types/react": 18.0.1
|
||||
"@types/react-dom": 17.0.14
|
||||
"@types/testing-library__react-hooks": 4.0.0
|
||||
blitz: 2.0.0-alpha.65
|
||||
blitz: 2.0.0-alpha.66
|
||||
cross-spawn: 7.0.3
|
||||
debug: 4.3.3
|
||||
find-up: 4.1.0
|
||||
@@ -716,15 +716,15 @@ importers:
|
||||
|
||||
packages/blitz-rpc:
|
||||
specifiers:
|
||||
"@blitzjs/auth": 2.0.0-alpha.65
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.65
|
||||
"@blitzjs/auth": 2.0.0-alpha.66
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.66
|
||||
"@tanstack/react-query": 4.0.10
|
||||
"@types/debug": 4.1.7
|
||||
"@types/react": 18.0.1
|
||||
"@types/react-dom": 17.0.14
|
||||
b64-lite: 1.4.0
|
||||
bad-behavior: 1.0.1
|
||||
blitz: 2.0.0-alpha.65
|
||||
blitz: 2.0.0-alpha.66
|
||||
chalk: ^4.1.0
|
||||
debug: 4.3.3
|
||||
next: 12.2.0
|
||||
@@ -767,12 +767,12 @@ importers:
|
||||
"@babel/plugin-syntax-typescript": 7.17.12
|
||||
"@babel/preset-env": 7.12.10
|
||||
"@blitzjs/config": workspace:*
|
||||
"@blitzjs/generator": 2.0.0-alpha.65
|
||||
"@blitzjs/generator": 2.0.0-alpha.66
|
||||
"@types/jscodeshift": 0.11.2
|
||||
"@types/node": 17.0.16
|
||||
arg: 5.0.1
|
||||
ast-types: 0.14.2
|
||||
blitz: 2.0.0-alpha.65
|
||||
blitz: 2.0.0-alpha.66
|
||||
chalk: ^4.1.0
|
||||
cross-spawn: 7.0.3
|
||||
debug: 4.3.3
|
||||
@@ -827,7 +827,7 @@ importers:
|
||||
"@babel/plugin-transform-typescript": 7.12.1
|
||||
"@babel/preset-env": 7.12.10
|
||||
"@babel/types": 7.12.10
|
||||
"@blitzjs/config": 2.0.0-alpha.65
|
||||
"@blitzjs/config": 2.0.0-alpha.66
|
||||
"@juanm04/cpx": 2.0.1
|
||||
"@mrleebo/prisma-ast": 0.2.6
|
||||
"@types/babel__core": 7.1.19
|
||||
@@ -881,7 +881,7 @@ importers:
|
||||
diff: 5.0.0
|
||||
enquirer: 2.3.6
|
||||
fs-extra: 10.0.1
|
||||
got: 11.8.5
|
||||
got: 11.8.1
|
||||
jscodeshift: 0.13.0_slgjdbbopna4ebnpdn2nkn3v2a
|
||||
mem-fs: 1.2.0
|
||||
mem-fs-editor: 8.0.0
|
||||
@@ -920,7 +920,7 @@ importers:
|
||||
|
||||
packages/pkg-template:
|
||||
specifiers:
|
||||
"@blitzjs/config": 2.0.0-alpha.65
|
||||
"@blitzjs/config": 2.0.0-alpha.66
|
||||
"@types/react": 18.0.1
|
||||
"@types/react-dom": 17.0.14
|
||||
"@typescript-eslint/eslint-plugin": 5.9.1
|
||||
@@ -2182,7 +2182,7 @@ packages:
|
||||
peerDependencies:
|
||||
"@babel/core": ^7.0.0-0
|
||||
dependencies:
|
||||
"@babel/core": 7.12.10_supports-color@8.1.1
|
||||
"@babel/core": 7.12.10
|
||||
"@babel/helper-plugin-utils": 7.17.12
|
||||
dev: false
|
||||
|
||||
@@ -4033,10 +4033,10 @@ packages:
|
||||
dependencies:
|
||||
glob: 7.1.7
|
||||
|
||||
/@next/eslint-plugin-next/12.2.3:
|
||||
/@next/eslint-plugin-next/12.2.4:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-B2e8Yg1MpuLsGxhCx4rU8/Tcnr5wFmCx1O2eyLXBPnaCcsFXfGCo067ujagtDLtWASL3GNgzg78U1SB0dbc38A==,
|
||||
integrity: sha512-ChDkUIkJeYWKRx+FdF+EhUgvKtK1wF+Xew4Os7ef3iAjMch5GGBiezw2zGXTa/C0E6potz4j11EpX89mngffug==,
|
||||
}
|
||||
dependencies:
|
||||
glob: 7.1.7
|
||||
@@ -9317,10 +9317,10 @@ packages:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/eslint-config-next/12.2.3_hrkuebk64jiu2ut2d2sm4oylnu:
|
||||
/eslint-config-next/12.2.4_hrkuebk64jiu2ut2d2sm4oylnu:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-xAQqAqwa2bu9ZMRypz58ym4tNCo22Wc6LuoLpbpf3yW5c4ZkVib9934AgGDDvh2zKrP56Z6X0Pp6gNnuuZzcRw==,
|
||||
integrity: sha512-r3keSLY1Z+rN+ASN8nmWwZ+AsMl6IrPGRWgbQhKHcop4/fk1hJGxE9Xf/mYMkV07+1Q/catchw25lu525HFy5Q==,
|
||||
}
|
||||
peerDependencies:
|
||||
eslint: ^7.23.0 || ^8.0.0
|
||||
@@ -9329,7 +9329,7 @@ packages:
|
||||
typescript:
|
||||
optional: true
|
||||
dependencies:
|
||||
"@next/eslint-plugin-next": 12.2.3
|
||||
"@next/eslint-plugin-next": 12.2.4
|
||||
"@rushstack/eslint-patch": 1.1.3
|
||||
"@typescript-eslint/parser": 5.28.0_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
eslint: 7.32.0
|
||||
@@ -10836,10 +10836,10 @@ packages:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/got/11.8.5:
|
||||
/got/11.8.1:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ==,
|
||||
integrity: sha512-9aYdZL+6nHmvJwHALLwKSUZ0hMwGaJGYv3hoPLPgnT8BoBXm1SjnZeky+91tfwJaDzun2s4RsBRy48IEYv2q2Q==,
|
||||
}
|
||||
engines: {node: ">=10.19.0"}
|
||||
dependencies:
|
||||
@@ -17418,10 +17418,21 @@ packages:
|
||||
yargs: 15.4.1
|
||||
dev: false
|
||||
|
||||
/turbo-darwin-64/1.1.5:
|
||||
/turbo-android-arm64/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-qdGMylQ408NmYhzuMmx+25W0iHFyFMRPO4579tDEv+WBiVDfAEYEzjajE4c+CQOLhd1aVEaPdSa+YhngQUgoDQ==,
|
||||
integrity: sha512-h6PorJ+muKDQE3wETwrkx3NpqypAxjIFLP3b8RQaAoNvxYa1JTSC71VMtYxMbwuDk58A1KGbXLDteR4by8Lqew==,
|
||||
}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-darwin-64/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-HrXRwx+5FuKeR4r2ea2mWO5dImzxG7z987t4xZWytEWJ0gEujln1z1cjwotYU1l2pq8slJS8W3q9Qv3JRMrSkQ==,
|
||||
}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
@@ -17429,10 +17440,10 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-darwin-arm64/1.1.5:
|
||||
/turbo-darwin-arm64/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-mXU324d3vYzxRT9FSSkW9yG2BvFosd0f4DUvqy4qms8wzM6Yv9Aeo4zZTL86rF88UYGUkbiRaPQUeceb/QARVg==,
|
||||
integrity: sha512-/qkMqq1hdbM/I0gchx08/ZZucgnQVp6gd03tHHYnyG20z8a39f38MbX7+I5aLRpa3pQzBk8RgNx0o7G1T+KvzA==,
|
||||
}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
@@ -17440,10 +17451,10 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-freebsd-64/1.1.5:
|
||||
/turbo-freebsd-64/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-qjjPTnZKOxw2x1Ito3yZAYDcwsCEg/5kYJwbPVvDn1jyXoxr3pUxTHUohroxQ6EmyxQ28qL7QpCVWDoQpDwrOQ==,
|
||||
integrity: sha512-bZcjR7GxpuE/0qz/aKg4gWDa+6eiuoV0cRnqCJ/rae14/iSmBt0MsMa+lUH5gZUFj581Dj8fQRoBeE+EOau5CA==,
|
||||
}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
@@ -17451,10 +17462,10 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-freebsd-arm64/1.1.5:
|
||||
/turbo-freebsd-arm64/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-jYW+Th9Y6yEYevaFe7v3lFQoxyrpd8wX5KuuvqLazMRbNxvKgqTDmT7AbCOGJY5ejzqGnMlTGkQr8c3g3B8ndA==,
|
||||
integrity: sha512-dDx++7AELGAHuaMQjzNiKjSPu/xdDelUtRjWOzJWmwXzrgJlwNgQ93p+LYEA7LBWVZ8a32fpBE/VDait0alIJw==,
|
||||
}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
@@ -17462,10 +17473,10 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-linux-32/1.1.5:
|
||||
/turbo-linux-32/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-c5I8tdR1jD8L8pJWk+rlO734bpWI1gwGdvNOaA/IGZxzOfDSn4CGoUErnUPgOadT8azi7lT9UPQf/pLfEvjCOw==,
|
||||
integrity: sha512-AAxsEYhgv6x4UXwCoiRe+iL2pd+ArsJQDMgJGsJn+Tb09ca6+i1rTgdOTgcCSyvRwbXt0LYzqXN9zp6FwG6VHQ==,
|
||||
}
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
@@ -17473,10 +17484,10 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-linux-64/1.1.5:
|
||||
/turbo-linux-64/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-BZAxLfIkEtQa7u+VPYpdeVVJH6ab4WwXv4oCrUDaZf2BseDUxr57y2ASAWNFsg40T3oXXt4Kcbdc5LibjWQdtQ==,
|
||||
integrity: sha512-t7gGxp1ILmGwzymcf72Lw4Ca916Bi9j2C4xPnJ2CAqxMWQOJKCRvyOuUHC/uy1kFDjR2yszxMb+ZJL6P3nccfA==,
|
||||
}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
@@ -17484,10 +17495,10 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-linux-arm/1.1.5:
|
||||
/turbo-linux-arm/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-X6J05gQSWTc2c/TCkOQdFLhr35pUjEExY6K8yanYs2QKgd4GvDHmxYaBZ+6f90qcIUHYpe++adDPJcuAUv+8ug==,
|
||||
integrity: sha512-6Rri//bX3wPMa8D0sSie05Xuze+6jTUDt4qsKp+JoQVanUKkKmRaVDpyV4WuFfjDbC5iP4ocN20FeaXenMFxTA==,
|
||||
}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
@@ -17495,10 +17506,10 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-linux-arm64/1.1.5:
|
||||
/turbo-linux-arm64/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-8/yz5L0B6Jb0pNcvx/08LcPswizqggxQ0zlFEw+Oh9RAC+ZM5+X2YiMyKolvLCpkoRqrlKku0lmXH7mx6DWbig==,
|
||||
integrity: sha512-V7eBFUOrIvLvjrc81UE8C+NfqBRKADyKrrbKD9hMG5beE/piZZNGoHUwuEgLgsykCSfHjn1sQCidocVztuTMAw==,
|
||||
}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
@@ -17506,21 +17517,21 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-linux-mips64le/1.1.5:
|
||||
/turbo-linux-mips64le/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-K26bEFcLDGPkcaW7Eq4CMSxUbJf/x58aE92+0tONhrxXzamaBqTrSxPYlk/T8OoH7HxOvja2ctkpeI/NRAoIyw==,
|
||||
integrity: sha512-C0JpzpwyvhW5ChWr6S7ulUd8a+1SBLe2mLBepTWaXTh/5+sFDU/AMwPNkhpfV5o0gEtz03UPm7Y4G6dqU3UCAQ==,
|
||||
}
|
||||
cpu: [mips64el]
|
||||
cpu: [mipsel]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-linux-ppc64le/1.1.5:
|
||||
/turbo-linux-ppc64le/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-fr1/5yf8fe1BJiW/6Y9lmV+kxZZC3u3xvSBC5AXDSl9u3aJFZl96CRE9tOJbTZMaOVGxhplKD+EiHbjIxUnTrA==,
|
||||
integrity: sha512-ipxyQCj3NXq/2V6a4lKoNDt8CjcufICgHAvOhAUmoAxz4kIEKRvA/75xsPpt2Ih/a4fWGxsbWFK6oA+ac0l3jQ==,
|
||||
}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
@@ -17528,10 +17539,10 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-windows-32/1.1.5:
|
||||
/turbo-windows-32/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-K9LdIgQXJ7jL0aLJS0l2asJAH/vYBFP7qFzODiAcJ1EeKBjYqAVnIxFQrUN07lzNDtL9WK/aN5q0bJCDnhwTQw==,
|
||||
integrity: sha512-pCvsh8mPSw6ZFABQqeJzfercnsOwCj1LpbWTPW1QftDij6zw1OWU4jWU529Ub1f+GMBej+xm/ufJhT+8A3NhwA==,
|
||||
}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
@@ -17539,10 +17550,10 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo-windows-64/1.1.5:
|
||||
/turbo-windows-64/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-c2Jkmw8yGZVz4opzEvB5HAf9XkA8CZBnorie46s44ec0FaNbcP9SCuUNvgAHxqDIHTGWC4A5PoPn0owkD3ss6A==,
|
||||
integrity: sha512-GnvM8uGOA6idUloDDxiEgUpIx5o5ZJL0ARL7f+6r/vfwA+qlSe/F+4hDCmT3+Xkg7/7zDZix5ViKVoTDMBP/Ig==,
|
||||
}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
@@ -17550,26 +17561,39 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo/1.1.5:
|
||||
/turbo-windows-arm64/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-jXW8G4lr01/E/jS/66LYpEjwWFQAksC8TxR8gi3VGea7OeNj28l8zmXoY3IgT5H22MBnhmtOKV/GhsbPjI2Jrg==,
|
||||
integrity: sha512-2mCPiDnMLY924+M07mMo464cjOr0EITuIkK67IBm3EeEwSlunOmQk+LRc/Jq/Zx6Zuzp5XPZ2fZVvmmSFfogpQ==,
|
||||
}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/turbo/1.4.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-ry1vUs5oHCIM+Sef8HED2XsbL28YAeclCrOtDp9zbZZMUX1r5s01COqOJjFJZfDiv2zSlUge9IIQXprM8BfrtA==,
|
||||
}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
optionalDependencies:
|
||||
turbo-darwin-64: 1.1.5
|
||||
turbo-darwin-arm64: 1.1.5
|
||||
turbo-freebsd-64: 1.1.5
|
||||
turbo-freebsd-arm64: 1.1.5
|
||||
turbo-linux-32: 1.1.5
|
||||
turbo-linux-64: 1.1.5
|
||||
turbo-linux-arm: 1.1.5
|
||||
turbo-linux-arm64: 1.1.5
|
||||
turbo-linux-mips64le: 1.1.5
|
||||
turbo-linux-ppc64le: 1.1.5
|
||||
turbo-windows-32: 1.1.5
|
||||
turbo-windows-64: 1.1.5
|
||||
turbo-android-arm64: 1.4.2
|
||||
turbo-darwin-64: 1.4.2
|
||||
turbo-darwin-arm64: 1.4.2
|
||||
turbo-freebsd-64: 1.4.2
|
||||
turbo-freebsd-arm64: 1.4.2
|
||||
turbo-linux-32: 1.4.2
|
||||
turbo-linux-64: 1.4.2
|
||||
turbo-linux-arm: 1.4.2
|
||||
turbo-linux-arm64: 1.4.2
|
||||
turbo-linux-mips64le: 1.4.2
|
||||
turbo-linux-ppc64le: 1.4.2
|
||||
turbo-windows-32: 1.4.2
|
||||
turbo-windows-64: 1.4.2
|
||||
turbo-windows-arm64: 1.4.2
|
||||
dev: false
|
||||
|
||||
/type-check/0.3.2:
|
||||
|
||||
Reference in New Issue
Block a user