diff --git a/.vscode/launch.json b/.vscode/launch.json index a4fd5ea..d4352b2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,34 +1,48 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { - "name": "Develop", + "name": "Web server", + "type": "node-terminal", "request": "launch", - "runtimeArgs": [ - "run", - "dev", + "command": "yarn run app:dev", + "presentation": { + "group": "Single", + } + }, + { + "name": "Web page", + "type": "firefox", + "request": "launch", + "url": "http://local.steffo.eu", + "pathMappings": [ + { + "url": "webpack://_n_e", + "path": "${workspaceFolder}" + } ], - "runtimeExecutable": "yarn", - "skipFiles": [ - "/**" - ], - "type": "node" + "presentation": { + "group": "Single", + } }, { "name": "Prisma Studio", + "type": "node-terminal", "request": "launch", - "runtimeArgs": [ - "run", - "studio", - ], - "runtimeExecutable": "yarn", - "skipFiles": [ - "/**" - ], - "type": "node" - }, + "command": "yarn run db:studio", + "presentation": { + "group": "Single", + } + } + ], + "compounds": [ + { + "name": "Everything!", + "configurations": ["Web server", "Web page", "Prisma Studio"], + "stopAll": true, + "presentation": { + "group": "Full", + } + } ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..06a1985 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "yarn", + "task": "db:generate", + "problemMatcher": [], + "label": "yarn db:generate" + }, + { + "type": "yarn", + "task": "db:push", + "problemMatcher": [], + "label": "yarn: db:push" + }, + { + "type": "yarn", + "task": "app:lint", + "problemMatcher": [], + "label": "yarn: app:lint" + } + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 43c5a8d..764cfd1 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,13 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "dotenv -e .env.local prisma db push && dotenv -e .env.local prisma generate && NODE_OPTIONS=--inspect dotenv -e .env.local next dev", - "build": "next build", - "start": "next start", - "lint": "next lint", - "studio": "dotenv -e .env.local prisma studio" + "db:push": "dotenv -e .env.local prisma db push", + "db:generate": "dotenv -e .env.local prisma generate", + "db:studio": "dotenv -e .env.local cross-env BROWSER=none prisma studio", + "app:dev": "cross-env NODE_OPTIONS='--inspect' next dev", + "app:build": "next build", + "app:start": "next start", + "app:lint": "next lint" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.1.1", @@ -31,6 +33,7 @@ "@types/node": "17.0.35", "@types/react": "18.0.9", "@types/react-dom": "18.0.4", + "cross-env": "^7.0.3", "dotenv-cli": "^5.1.0", "eslint": "8.15.0", "eslint-config-next": "12.1.6", diff --git a/yarn.lock b/yarn.lock index 14bf6c5..6cdd6f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -486,7 +486,14 @@ cors@^2.8.5: object-assign "^4" vary "^1" -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-env@^7.0.3: + version "7.0.3" + resolved "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" + integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== + dependencies: + cross-spawn "^7.0.1" + +cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==