Skip to content

Commit

Permalink
Add Prisma 'format' to command array requiring schema (#2061)
Browse files Browse the repository at this point in the history
* add 'format' to array requiring schema

* Update __fixtures__/example-todo-main/api/prisma/schema.prisma
  • Loading branch information
thedavidprice authored Mar 23, 2021
1 parent 8a83898 commit bfea427
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 16 deletions.
5 changes: 2 additions & 3 deletions __fixtures__/example-todo-main/api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ generator photonjs {

// Define your own models here and run `yarn rw db save` to create
// migrations for them.

model Todo {
id Int @id @default(autoincrement())
id Int @default(autoincrement()) @id
body String @unique
status String @default("off")
}
}
4 changes: 3 additions & 1 deletion packages/cli/src/commands/prisma.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export const builder = async (yargs) => {

if (
// `introspect` to be replaced by `db pull`; still valid as of [email protected]
['generate', 'introspect', 'db', 'migrate', 'studio'].includes(argv[0])
['generate', 'introspect', 'db', 'migrate', 'studio', 'format'].includes(
argv[0]
)
) {
if (!fs.existsSync(paths.api.dbSchema)) {
console.error(
Expand Down
41 changes: 29 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4068,7 +4068,7 @@
dependencies:
"@types/react" "*"

"@types/react@*", "@types/react@^17.0.2":
"@types/react@*", "@types/react@17.0.2", "@types/react@^17.0.2":
version "17.0.2"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.2.tgz#3de24c4efef902dd9795a49c75f760cbe4f7a5a8"
integrity sha512-Xt40xQsrkdvjn1EyWe1Bc0dJLcil/9x2vAuW7ya+PuQip4UYUaXyhzWmAbwRsdMgwOFHpfp7/FFZebDU6Y8VHA==
Expand Down Expand Up @@ -8504,11 +8504,28 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.3:
d "^1.0.1"
ext "^1.1.2"

esbuild-loader@^2.10.0:
version "2.10.0"
resolved "https://registry.yarnpkg.com/esbuild-loader/-/esbuild-loader-2.10.0.tgz#35b570187aee0036b2f4b37db66870f7407f3d40"
integrity sha512-BRWmc/7gU6/FmI+MP+E+9Zb/CE0BA1XMOQkdvJ7B/T2gad1Mlim8aMhvvRdS9on5S8JzkC+uNHGQmt/WmbbXbQ==
dependencies:
esbuild "^0.9.2"
joycon "^2.2.5"
json5 "^2.2.0"
loader-utils "^2.0.0"
type-fest "^0.21.3"
webpack-sources "^2.2.0"

[email protected]:
version "0.9.0"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.9.0.tgz#b8320df85048ed1637c6b59ee52abba248936d3c"
integrity sha512-IqYFO7ZKHf0y4uJpJfGqInmSRn8jMPMbyI1W0Y2PSjSjJcVP538tC8TleJAS4Y8QeqwajqBTwFKayWVzYlMIgg==

esbuild@^0.9.2:
version "0.9.6"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.9.6.tgz#2cae519e7ce2328ecf57ae738090d07ce7245850"
integrity sha512-F6vASxU0wT/Davt9aj2qtDwDNSkQxh9VbyO56M7PDWD+D/Vgq/rmUDGDQo7te76W5auauVojjnQr/wTu3vpaUA==

escalade@^3.0.2, escalade@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
Expand Down Expand Up @@ -12049,7 +12066,7 @@ json5@^1.0.1:
dependencies:
minimist "^1.2.0"

json5@^2.1.1, json5@^2.1.2:
json5@^2.1.1, json5@^2.1.2, json5@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3"
integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==
Expand Down Expand Up @@ -15175,7 +15192,7 @@ promzard@^0.3.0:
dependencies:
read "1"

prop-types@^15.5.10, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
Expand Down Expand Up @@ -15540,7 +15557,7 @@ react-docgen@^5.0.0:
node-dir "^0.1.10"
strip-indent "^3.0.0"

react-dom@^17.0.1:
react-dom@17.0.1, react-dom@^17.0.1:
version "17.0.1"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.1.tgz#1de2560474ec9f0e334285662ede52dbc5426fc6"
integrity sha512-6eV150oJZ9U2t9svnsspTMrWNyHc6chX0KzDeAOXftRa8bNeOKTTfCJ7KorIwenkHd2xqVTBTCZd79yk/lx/Ug==
Expand Down Expand Up @@ -15669,7 +15686,7 @@ react-textarea-autosize@^8.1.1:
use-composed-ref "^1.0.0"
use-latest "^1.0.0"

react@^17.0.1:
react@17.0.1, react@^17.0.1:
version "17.0.1"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.1.tgz#6e0600416bd57574e3f86d92edba3d9008726127"
integrity sha512-lG9c9UuMHdcAexXtigOZLX8exLWkW0Ku29qPRU8uhF2R9BN96dLCt0psvzPLlHc5OWkgymP3qwTRgbnw5BKx3w==
Expand Down Expand Up @@ -17941,6 +17958,11 @@ type-fest@^0.20.2:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==

type-fest@^0.21.3:
version "0.21.3"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37"
integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==

type-fest@^0.3.0:
version "0.3.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1"
Expand Down Expand Up @@ -17993,16 +18015,11 @@ typescript-transform-paths@^2.2.2:
dependencies:
minimatch "^3.0.4"

typescript@^4.1.3:
typescript@4.1.3, typescript@^4.1.3, typescript@~4.0.2:
version "4.1.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7"
integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==

typescript@~4.0.2:
version "4.0.7"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.7.tgz#7168032c43d2a2671c95c07812f69523c79590af"
integrity sha512-yi7M4y74SWvYbnazbn8/bmJmX4Zlej39ZOqwG/8dut/MYoSQ119GY9ZFbbGsD4PFZYWxqik/XsP3vk3+W5H3og==

uglify-js@^3.1.4:
version "3.13.1"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.1.tgz#2749d4b8b5b7d67460b4a418023ff73c3fefa60a"
Expand Down Expand Up @@ -18410,7 +18427,7 @@ vscode-jsonrpc@^5.0.1:
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-5.0.1.tgz#9bab9c330d89f43fc8c1e8702b5c36e058a01794"
integrity sha512-JvONPptw3GAQGXlVV2utDcHx0BiY34FupW/kI6mZ5x06ER5DdPG/tXWMVHjTNULF5uKPOUUD0SaXg5QaubJL0A==

vscode-languageserver-protocol@^3.15.3:
vscode-languageserver-protocol@3.15.3, vscode-languageserver-protocol@^3.15.3:
version "3.15.3"
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.3.tgz#3fa9a0702d742cf7883cb6182a6212fcd0a1d8bb"
integrity sha512-zrMuwHOAQRhjDSnflWdJG+O2ztMWss8GqUUB8dXLR/FPenwkiBNkMIJJYfSN6sgskvsF0rHAoBowNQfbyZnnvw==
Expand Down

0 comments on commit bfea427

Please sign in to comment.