From 210877e868eb0236900637b2444adc9cf0eae4fe Mon Sep 17 00:00:00 2001 From: Virajjai Date: Thu, 1 Aug 2024 00:34:09 +0530 Subject: [PATCH 01/10] Added launch.json file --- .vscode/launch.json | 0 packages/cli/.vscode/launch.json | 11 +++++------ 2 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..e69de29bb diff --git a/packages/cli/.vscode/launch.json b/packages/cli/.vscode/launch.json index 812338523..05e34602a 100644 --- a/packages/cli/.vscode/launch.json +++ b/packages/cli/.vscode/launch.json @@ -1,15 +1,14 @@ + { - // 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": [ + // Runs npx boost -e local { - "command": "rushx test", - "name": "Unit Tests", + "command": "npm run build && npx boost start -e local", + "name": "Start Debug Server", "request": "launch", "type": "node-terminal", - "cwd": "${workspaceFolder}", + "cwd": "${workspaceFolder}" }, ] } \ No newline at end of file From 5fd13b7383bc338659fbe58f043b2baede490752 Mon Sep 17 00:00:00 2001 From: Virajjai Date: Thu, 1 Aug 2024 00:35:30 +0530 Subject: [PATCH 02/10] added launch.json --- packages/cli/.vscode/launch.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cli/.vscode/launch.json b/packages/cli/.vscode/launch.json index 05e34602a..c96d7fb69 100644 --- a/packages/cli/.vscode/launch.json +++ b/packages/cli/.vscode/launch.json @@ -1,4 +1,6 @@ + + { "version": "0.2.0", "configurations": [ @@ -9,6 +11,6 @@ "request": "launch", "type": "node-terminal", "cwd": "${workspaceFolder}" - }, + }, ] } \ No newline at end of file From d26bc37532c5ec2001c6a9cb9c0971e18fbef0ca Mon Sep 17 00:00:00 2001 From: Virajjai Date: Thu, 1 Aug 2024 00:37:38 +0530 Subject: [PATCH 03/10] added launch.json --- packages/cli/.vscode/launch.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/cli/.vscode/launch.json b/packages/cli/.vscode/launch.json index c96d7fb69..f0e9c50a7 100644 --- a/packages/cli/.vscode/launch.json +++ b/packages/cli/.vscode/launch.json @@ -1,6 +1,4 @@ - - { "version": "0.2.0", "configurations": [ From e7894ff09939ef9c315dbfa842cfd03302ab4851 Mon Sep 17 00:00:00 2001 From: Viraj Jaiswal <157706576+Virajjai@users.noreply.github.com> Date: Thu, 1 Aug 2024 00:39:01 +0530 Subject: [PATCH 04/10] Update launch.json --- .vscode/launch.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index e69de29bb..53cd05d9a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + "version": "0.2.0", + "configurations": [ + // Runs npx boost -e local + { + "command": "npm run build && npx boost start -e local", + "name": "Start Debug Server", + "request": "launch", + "type": "node-terminal", + "cwd": "${workspaceFolder}" + }, + ] +} From 5ec44684d98994c121cba221c63c287851cb466b Mon Sep 17 00:00:00 2001 From: virajjai Date: Tue, 6 Aug 2024 17:08:26 +0530 Subject: [PATCH 05/10] added launch.json file in root .vscode folder --- .vscode/launch.json | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 53cd05d9a..6b2fb7f94 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,13 +1,22 @@ + { "version": "0.2.0", "configurations": [ - // Runs npx boost -e local { - "command": "npm run build && npx boost start -e local", - "name": "Start Debug Server", - "request": "launch", + "name": "Launch Booster App", "type": "node-terminal", - "cwd": "${workspaceFolder}" - }, + "request": "launch", + "program": "${workspaceFolder}/src/index.ts", + "preLaunchTask": "tsc: build", + "cwd": "${workspaceFolder}", + "outFiles": ["${workspaceFolder}/dist/**/*.js"], + "sourceMaps": true, + "env": { + "NODE_ENV": "development" + }, + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "skipFiles": ["/**"] + } ] } From 6a4950ece68337b9fdedc8fee663704eae6e0d11 Mon Sep 17 00:00:00 2001 From: Virajjai Date: Tue, 6 Aug 2024 17:12:17 +0530 Subject: [PATCH 06/10] add launch.json file --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 6b2fb7f94..bcb79c15c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,5 +18,5 @@ "internalConsoleOptions": "neverOpen", "skipFiles": ["/**"] } - ] + ] } From 4a910d8d4dfb41bfb488ab02acc5f34114df8123 Mon Sep 17 00:00:00 2001 From: Virajjai Date: Tue, 6 Aug 2024 22:09:36 +0530 Subject: [PATCH 07/10] Add a .vscode/launch.json file to the default --- packages/cli/src/services/project-initializer.ts | 3 +++ packages/cli/src/templates/project/index.ts | 2 ++ packages/cli/src/templates/project/launch-json.ts | 14 ++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 packages/cli/src/templates/project/launch-json.ts diff --git a/packages/cli/src/services/project-initializer.ts b/packages/cli/src/services/project-initializer.ts index b848f3be8..e34fe11fd 100644 --- a/packages/cli/src/services/project-initializer.ts +++ b/packages/cli/src/services/project-initializer.ts @@ -12,6 +12,7 @@ import * as configTs from '../templates/project/config-ts' import * as indexTs from '../templates/project/index-ts' import * as prettierRc from '../templates/project/prettierrc-yaml' import * as mochaRc from '../templates/project/mocharc-yml' +import * as launchJson from '../templates/project/launch-json' import { guardError, wrapExecError } from '../common/errors' import { PackageManagerService } from './package-manager' import { gen, mapError, pipe, unsafeRunEffect } from '@boostercloud/framework-types/dist/effect' @@ -53,6 +54,7 @@ export async function generateRootDirectory(config: ProjectInitializerConfig): P [srcDir, 'event-handlers'], [srcDir, 'read-models'], [srcDir, 'scheduled-commands'], + ] await Promise.all(dirs.map(createDirectory)) } @@ -107,4 +109,5 @@ const filesToGenerate: Array<[Array, string]> = [ [['src', 'config', 'config.ts'], configTs.template], [['src', 'index.ts'], indexTs.template], [['.mocharc.yml'], mochaRc.template], + [['.vscode','launch.json'],launchJson.template], ] diff --git a/packages/cli/src/templates/project/index.ts b/packages/cli/src/templates/project/index.ts index 687583598..82a4e369e 100644 --- a/packages/cli/src/templates/project/index.ts +++ b/packages/cli/src/templates/project/index.ts @@ -4,6 +4,7 @@ import * as GitIgnore from './gitignore' import * as IndexTs from './index-ts' import * as PackageJson from './package-json' import * as TsconfigJson from './tsconfig-json' +import * as LaunchJson from './launch-json' export const templates = { configTs: ConfigTs.template, @@ -12,4 +13,5 @@ export const templates = { indexTs: IndexTs.template, packageJson: PackageJson.template, tsconfigJson: TsconfigJson.template, + launchJson: LaunchJson.template, } diff --git a/packages/cli/src/templates/project/launch-json.ts b/packages/cli/src/templates/project/launch-json.ts new file mode 100644 index 000000000..2c83164e4 --- /dev/null +++ b/packages/cli/src/templates/project/launch-json.ts @@ -0,0 +1,14 @@ + +export const template = '{ + "version": "0.2.0", + "configurations": [ + // Runs npx boost -e local + { + "command": "npm run build && npx boost start -e local", + "name": "Start Debug Server", + "request": "launch", + "type": "node-terminal", + "cwd": "${workspaceFolder}" + }, + ] + }' \ No newline at end of file From 1e60b1d210f8da3be3723b353f3f566622fe70a8 Mon Sep 17 00:00:00 2001 From: Virajjai Date: Tue, 6 Aug 2024 22:14:09 +0530 Subject: [PATCH 08/10] corrected src/.vscode/launch.json --- packages/cli/.vscode/launch.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/cli/.vscode/launch.json b/packages/cli/.vscode/launch.json index f0e9c50a7..162402e17 100644 --- a/packages/cli/.vscode/launch.json +++ b/packages/cli/.vscode/launch.json @@ -1,14 +1,16 @@ - { + // 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": [ - // Runs npx boost -e local + { - "command": "npm run build && npx boost start -e local", - "name": "Start Debug Server", + "command": "rushx test", + "name": "Unit Tests", "request": "launch", "type": "node-terminal", - "cwd": "${workspaceFolder}" - }, + "cwd": "${workspaceFolder}", + }, ] } \ No newline at end of file From 1df16ef3ce155a4f59dbedebe582d1fe745a101c Mon Sep 17 00:00:00 2001 From: Javier Toledo Date: Thu, 8 Aug 2024 10:25:42 +0100 Subject: [PATCH 09/10] Update packages/cli/src/services/project-initializer.ts --- packages/cli/src/services/project-initializer.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/cli/src/services/project-initializer.ts b/packages/cli/src/services/project-initializer.ts index e34fe11fd..eb6b8f074 100644 --- a/packages/cli/src/services/project-initializer.ts +++ b/packages/cli/src/services/project-initializer.ts @@ -54,7 +54,6 @@ export async function generateRootDirectory(config: ProjectInitializerConfig): P [srcDir, 'event-handlers'], [srcDir, 'read-models'], [srcDir, 'scheduled-commands'], - ] await Promise.all(dirs.map(createDirectory)) } From 212aab5566c0db64096ab218fbbaeca1043742e0 Mon Sep 17 00:00:00 2001 From: Javier Toledo Date: Thu, 8 Aug 2024 10:27:12 +0100 Subject: [PATCH 10/10] Apply suggestions from code review --- .vscode/launch.json | 1 - packages/cli/.vscode/launch.json | 1 - packages/cli/src/templates/project/launch-json.ts | 1 - 3 files changed, 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index bcb79c15c..03b23bd2c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,4 +1,3 @@ - { "version": "0.2.0", "configurations": [ diff --git a/packages/cli/.vscode/launch.json b/packages/cli/.vscode/launch.json index 162402e17..812338523 100644 --- a/packages/cli/.vscode/launch.json +++ b/packages/cli/.vscode/launch.json @@ -4,7 +4,6 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { "command": "rushx test", "name": "Unit Tests", diff --git a/packages/cli/src/templates/project/launch-json.ts b/packages/cli/src/templates/project/launch-json.ts index 2c83164e4..963fa5e56 100644 --- a/packages/cli/src/templates/project/launch-json.ts +++ b/packages/cli/src/templates/project/launch-json.ts @@ -1,4 +1,3 @@ - export const template = '{ "version": "0.2.0", "configurations": [