Skip to content

Commit f20d6a7

Browse files
committed
Adjusted build watch and set explicit build order
- ensured that the build watch is triggering related packages builds by using -b parameter, - ensured the recommended sequential npm packages build to not risk the parallel build related issues, - adjusted the eslint plugin settings to use the explicit folders instead of the automatic detection, - Added the recommended extension lists, together with Install All Recommended Extensions to streamline the setup, - updated contributing guide.
1 parent 1a7e6f5 commit f20d6a7

15 files changed

+127
-15
lines changed

.vscode/Node.js.code-profile

-1
This file was deleted.

.vscode/extensions.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"esbenp.prettier-vscode",
5+
"connor4312.nodejs-testing"
6+
]
7+
}

.vscode/launch.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"name": "Debug Current Test File",
1818
"type": "node",
1919
"request": "launch",
20+
"env": { "DUMBO_LOG_LEVEL": "DEBUG" },
2021
"skipFiles": ["<node_internals>/**"],
2122
"runtimeExecutable": "npm",
2223
"runtimeArgs": [

.vscode/settings.json

+32-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@
99
"source.addMissingImports": "always"
1010
},
1111

12+
"[typescript]": {
13+
"editor.defaultFormatter": "esbenp.prettier-vscode",
14+
"editor.formatOnPaste": false,
15+
"editor.formatOnSave": true,
16+
17+
"editor.codeActionsOnSave": {
18+
"source.organizeImports": "explicit",
19+
"source.fixAll.eslint": "explicit",
20+
"source.addMissingImports": "always"
21+
}
22+
},
23+
"[javascript]": {
24+
"editor.defaultFormatter": "esbenp.prettier-vscode",
25+
"editor.formatOnPaste": false,
26+
"editor.formatOnSave": true,
27+
28+
"editor.codeActionsOnSave": {
29+
"source.organizeImports": "explicit",
30+
"source.fixAll.eslint": "explicit",
31+
"source.addMissingImports": "always"
32+
}
33+
},
34+
1235
"editor.tabSize": 2,
1336

1437
"files.exclude": {
@@ -23,5 +46,13 @@
2346
"eslint.workingDirectories": [{ "mode": "auto" }],
2447
"debug.javascript.terminalOptions": {
2548
"nodeVersionHint": 20
26-
}
49+
},
50+
"nodejs-testing.include": ["./**/**"],
51+
"nodejs-testing.extensions": [
52+
{
53+
"extensions": ["ts", "mts"],
54+
"filePatterns": ["**/*.spec.ts", "**/*.spec.mts"],
55+
"parameters": ["--import", "tsx"]
56+
}
57+
]
2758
}

.vscode/tasks.json

+13-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,24 @@
44
{
55
"type": "npm",
66
"script": "build:ts:watch",
7-
"group": "build",
7+
"group": {
8+
"kind": "build",
9+
"isDefault": true
10+
},
811
"problemMatcher": [],
912
"label": "npm: build:ts:watch",
10-
"detail": "tsc --watch",
13+
"detail": "tsc -b --watch",
1114
"options": {
1215
"cwd": "${workspaceFolder}/src/"
1316
}
17+
},
18+
{
19+
"label": "Install All Recommended Extensions",
20+
"type": "shell",
21+
"windows": {
22+
"command": "powershell ((node -e \"console.log(JSON.parse(require('fs').readFileSync('./.vscode/extensions.json')).recommendations.join('\\\\n'))\") -split '\\r?\\n') | ForEach-Object { code --install-extension $_ }"
23+
},
24+
"command": "node -e \"console.log(JSON.parse(require('fs').readFileSync('./.vscode/extensions.json')).recommendations.join('\\n'))\" | xargs -L 1 code --install-extension"
1425
}
1526
]
1627
}

CONTRIBUTING.md

+10
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ You are now ready to contribute to Pongo.
4646

4747
### 3. Setup dev environment
4848

49+
We recommend using VSCode and installing the following extensions:
50+
51+
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint),
52+
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode),
53+
- [node:test runner](https://marketplace.visualstudio.com/items?itemName=connor4312.nodejs-testing)
54+
55+
This will ensure that all workspace settings around code style will be automatically applied.
56+
57+
**You can install all of them automatically by running "Install All Recommended Extensions" VSCode task** (_**CTRL+SHIFT+P** => Run Task => Install All Recommended Extensions_).
58+
4959
You can streamling setup by running setup script:
5060

5161
- For Linux and MacOS

samples/simple-ts/.vscode/Node.js.code-profile

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"esbenp.prettier-vscode",
5+
"connor4312.nodejs-testing"
6+
]
7+
}

samples/simple-ts/.vscode/settings.json

+35-2
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,49 @@
99
"source.addMissingImports": "always"
1010
},
1111

12+
"[typescript]": {
13+
"editor.defaultFormatter": "esbenp.prettier-vscode",
14+
"editor.formatOnPaste": false,
15+
"editor.formatOnSave": true,
16+
17+
"editor.codeActionsOnSave": {
18+
"source.organizeImports": "explicit",
19+
"source.fixAll.eslint": "explicit",
20+
"source.addMissingImports": "always"
21+
}
22+
},
23+
"[javascript]": {
24+
"editor.defaultFormatter": "esbenp.prettier-vscode",
25+
"editor.formatOnPaste": false,
26+
"editor.formatOnSave": true,
27+
28+
"editor.codeActionsOnSave": {
29+
"source.organizeImports": "explicit",
30+
"source.fixAll.eslint": "explicit",
31+
"source.addMissingImports": "always"
32+
}
33+
},
34+
1235
"editor.tabSize": 2,
1336

1437
"files.exclude": {
15-
"**/*.tsbuildinfo": true
38+
"**/*.tsbuildinfo": true,
39+
"**/node_modules": true,
40+
"**/dist": true
1641
},
1742
"files.eol": "\n",
1843

1944
"typescript.preferences.importModuleSpecifier": "relative",
2045
"eslint.workingDirectories": [{ "mode": "auto" }],
2146
"debug.javascript.terminalOptions": {
2247
"nodeVersionHint": 20
23-
}
48+
},
49+
"nodejs-testing.include": ["./**/**"],
50+
"nodejs-testing.extensions": [
51+
{
52+
"extensions": ["ts", "mts"],
53+
"filePatterns": ["**/*.spec.ts", "**/*.spec.mts"],
54+
"parameters": ["--import", "tsx"]
55+
}
56+
]
2457
}

samples/simple-ts/.vscode/tasks.json

+13-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,21 @@
44
{
55
"type": "npm",
66
"script": "build:ts:watch",
7-
"group": "build",
7+
"group": {
8+
"kind": "build",
9+
"isDefault": true
10+
},
811
"problemMatcher": [],
912
"label": "npm: build:ts:watch",
10-
"detail": "tsc --watch"
13+
"detail": "tsc -b --watch"
14+
},
15+
{
16+
"label": "Install All Recommended Extensions",
17+
"type": "shell",
18+
"windows": {
19+
"command": "powershell ((node -e \"console.log(JSON.parse(require('fs').readFileSync('./.vscode/extensions.json')).recommendations.join('\\\\n'))\") -split '\\r?\\n') | ForEach-Object { code --install-extension $_ }"
20+
},
21+
"command": "node -e \"console.log(JSON.parse(require('fs').readFileSync('./.vscode/extensions.json')).recommendations.join('\\n'))\" | xargs -L 1 code --install-extension"
1122
}
1223
]
1324
}

samples/simple-ts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"setup": "cat .nvmrc | nvm install; nvm use",
88
"build": "tsup",
99
"build:ts": "tsc",
10-
"build:ts:watch": "tsc --watch",
10+
"build:ts:watch": "tsc -b --watch",
1111
"start": "tsx ./src/index.ts",
1212
"start:shim": "tsx ./src/shim.ts",
1313
"start:typed": "tsx ./src/typedClient.ts",

src/eslint.config.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default [
3030
'**/dist',
3131
'**/*.d.ts',
3232
'src/types/',
33+
'eslint.config.mjs',
3334
'e2e/*',
3435
],
3536
},

src/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
"private": true,
1010
"scripts": {
1111
"setup": "cat .nvmrc | nvm install; nvm use",
12-
"build": "npm run build:ts && npm run build --ws",
12+
"build": "run-s build:ts build:dumbo build:pongo",
1313
"build:ts": "tsc -b",
1414
"build:ts:watch": "tsc -b --watch",
15+
"build:dumbo": "npm run build -w packages/dumbo",
16+
"build:pongo": "npm run build -w packages/pongo",
1517
"lint": "npm run lint:eslint && npm run lint:prettier",
1618
"lint:prettier": "prettier --check \"**/**/!(*.d).{ts,json,md}\"",
1719
"lint:eslint": "eslint '**/*.ts'",

src/packages/dumbo/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"type": "module",
66
"scripts": {
77
"build": "tsup",
8-
"build:ts": "tsc",
9-
"build:ts:watch": "tsc --watch",
8+
"build:ts": "tsc -b",
9+
"build:ts:watch": "tsc -b --watch",
1010
"test": "run-s test:unit test:int test:e2e",
1111
"test:unit": "glob -c \"node --import tsx --test\" **/*.unit.spec.ts",
1212
"test:int": "glob -c \"node --import tsx --test\" **/*.int.spec.ts",

src/packages/pongo/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"type": "module",
66
"scripts": {
77
"build": "tsup",
8-
"build:ts": "tsc",
9-
"build:ts:watch": "tsc --watch",
8+
"build:ts": "tsc -b",
9+
"build:ts:watch": "tsc -b --watch",
1010
"test": "run-s test:unit test:int test:e2e",
1111
"test:unit": "glob -c \"node --import tsx --test\" **/*.unit.spec.ts",
1212
"test:int": "glob -c \"node --import tsx --test\" **/*.int.spec.ts",

0 commit comments

Comments
 (0)