Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

feat: add .vscode/launch.json to common files #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ CLI for easily starting new Payload project
--no-deps Do not install any dependencies
--help Show help
```

## For development

You can run this in development using `npx ts-node src/index.ts`
15 changes: 15 additions & 0 deletions src/lib/common-files/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// 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": [
{
"command": "yarn run dev",
"name": "Run Dev",
"request": "launch",
"type": "node-terminal",
"cwd": "${workspaceFolder}"
}
]
}
5 changes: 5 additions & 0 deletions src/lib/write-common-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export async function writeCommonFiles(
const nodemonDest = path.resolve(projectDir, 'nodemon.json')
await fse.copy(nodemon, nodemonDest)

// .vscode/launch.json
const launchjson = path.resolve(commonFilesDir, '.vscode/launch.json')
const launchjsonDest = path.resolve(projectDir, '.vscode/launch.json')
await fse.copy(launchjson, launchjsonDest)

// README.md
const readmeTemplate = await fse.readFile(
path.resolve(commonFilesDir, 'README.template.md'),
Expand Down