Compare commits

...
6 Commits
Author SHA1 Message Date
root 05cf7e7256 feature: sweep flotte — convergence canons (validation zod/OpenAPI, buildCsv, no-alert→toast/sonner, publicUser anti-leak, dates dayjs, appshell/profil, lastSeenAt, scrollRestoration) + fixes divers
continuous-integration/drone/tag Build is passing
2026-07-17 02:20:43 +02:00
root c9b39ffca0 fix: release
continuous-integration/drone/tag Build is passing
2026-07-14 23:26:30 +00:00
m.schnitzlerandroot 0ddeb439ee renovate (#186)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-07-14 23:26:21 +00:00
root 5316114dae feature: sweep flotte (chantiers en cours: canon UI/forms/zod/openapi, dates dayjs, scrollrestoration, conformites migration)
continuous-integration/drone/tag Build is passing
2026-07-14 00:41:40 +02:00
root edb296c6e8 fix: release
continuous-integration/drone/tag Build is passing
2026-07-10 23:35:04 +00:00
m.schnitzlerandroot 143eff95bc renovate (#185)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-07-10 23:34:53 +00:00
8 changed files with 121 additions and 137 deletions
+1
View File
@@ -33,3 +33,4 @@ data/
/dist/
tsconfig.tsbuildinfo
.twig-cs-fixer.cache
testfront-screenshots/
+4 -3
View File
@@ -5,14 +5,15 @@ collect stats about a user's activity in vscode
## Features
it can track :
- file opening
- file saving
- window focus
## Extension Settings
* `vscodestat.setUrl`: function to set the remote server's url
this will set the variable vscodestat.url
* `vscodestat.callUrl`: funciton to test if it works
- `vscodestat.setUrl`: function to set the remote server's url
this will set the variable vscodestat.url
- `vscodestat.callUrl`: funciton to test if it works
Sample url : https://xxxxxx/vscodestat?userName=raf
+4 -4
View File
@@ -32,10 +32,10 @@ export default [
format: ['camelCase', 'PascalCase'],
},
],
'curly': 'warn',
'eqeqeq': 'warn',
curly: 'warn',
eqeqeq: 'warn',
'no-throw-literal': 'warn',
'semi': 'off',
semi: 'off',
// Règles générales réutilisées de flatbay
'prefer-const': ['error', { destructuring: 'all' }],
'no-var': 'error',
@@ -47,7 +47,7 @@ export default [
'one-var-declaration-per-line': ['error', 'always'],
'one-var': ['error', 'never'],
'vars-on-top': 'error',
'yoda': 'error',
yoda: 'error',
'prefer-arrow-callback': 'error',
'no-implicit-globals': 'error',
'no-labels': 'error',
+77 -77
View File
@@ -1,27 +1,27 @@
{
"name": "vscodestat",
"version": "1.6.3",
"version": "1.8.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "vscodestat",
"version": "1.6.3",
"version": "1.8.0",
"license": "ISC",
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/mocha": "^10.0.10",
"@types/node": "26.x",
"@types/vscode": "^1.125.0",
"@typescript-eslint/eslint-plugin": "^8.63.0",
"@typescript-eslint/parser": "^8.63.0",
"@typescript-eslint/eslint-plugin": "^8.64.0",
"@typescript-eslint/parser": "^8.64.0",
"@vscode/test-cli": "^0.0.15",
"@vscode/test-electron": "^3.0.0",
"eslint": "^10.1.0",
"globals": "^17.7.0",
"husky": "^9.1.7",
"lint-staged": "^17.0.8",
"prettier": "^3.9.4",
"prettier": "^3.9.5",
"ts-api-utils": "^2.5.0",
"typescript": "^6.0.3"
},
@@ -379,9 +379,9 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "26.1.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.0.tgz",
"integrity": "sha512-O0A1G3xPGy4w7AgQdAQYUlQ+BKk2Oovw8eRpofyp5KdBZULnbe+WqaOVNrm705SHphCiG4XHsACrSmPu1f+Kgw==",
"version": "26.1.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz",
"integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -396,17 +396,17 @@
"license": "MIT"
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.63.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.63.0.tgz",
"integrity": "sha512-rvwSgqT+DHpWdzfSzPatRLm02a0GlESt++9iy3hLCDY4BgkaLcl8LBi9Yh7XGFBpwcBE/K3024QuXWTpbz4FfQ==",
"version": "8.64.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.64.0.tgz",
"integrity": "sha512-CGvQPBxN3wZLu6Rz2kFUpZeoCm78xUic92ck39KPePkO1NPOwjCqdQnm5Q87tpWw9vcBvW8XLrDXjH9PWYtJ3Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/regexpp": "^4.12.2",
"@typescript-eslint/scope-manager": "8.63.0",
"@typescript-eslint/type-utils": "8.63.0",
"@typescript-eslint/utils": "8.63.0",
"@typescript-eslint/visitor-keys": "8.63.0",
"@typescript-eslint/scope-manager": "8.64.0",
"@typescript-eslint/type-utils": "8.64.0",
"@typescript-eslint/utils": "8.64.0",
"@typescript-eslint/visitor-keys": "8.64.0",
"ignore": "^7.0.5",
"natural-compare": "^1.4.0",
"ts-api-utils": "^2.5.0"
@@ -419,22 +419,22 @@
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"@typescript-eslint/parser": "^8.63.0",
"@typescript-eslint/parser": "^8.64.0",
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/parser": {
"version": "8.63.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.63.0.tgz",
"integrity": "sha512-gwh4gvvlaVDKKxyfxMG+Gnu1u9X0OQBwyGLkbwB65dIzBKnxeRiJlNFqlI3zwVhNXJIs6qV7mlFCn/BIajlVig==",
"version": "8.64.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.64.0.tgz",
"integrity": "sha512-KA0OshtlcCCXmbfqyZkM5pV3/WNraJf7DkJRLpyrmwPtud57H5BDX7C3k0LPSPxpprfRL+cJDGabF10mvNCoCw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/scope-manager": "8.63.0",
"@typescript-eslint/types": "8.63.0",
"@typescript-eslint/typescript-estree": "8.63.0",
"@typescript-eslint/visitor-keys": "8.63.0",
"@typescript-eslint/scope-manager": "8.64.0",
"@typescript-eslint/types": "8.64.0",
"@typescript-eslint/typescript-estree": "8.64.0",
"@typescript-eslint/visitor-keys": "8.64.0",
"debug": "^4.4.3"
},
"engines": {
@@ -450,14 +450,14 @@
}
},
"node_modules/@typescript-eslint/project-service": {
"version": "8.63.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.63.0.tgz",
"integrity": "sha512-e5dh0/UI0ok53AlZ5wRkXCB32z/f2jUZqPR/ygAw5WYaSw8j9EoJWlS7wQjr/dmOaqWjnPIn2m+HhVPCMWGZVQ==",
"version": "8.64.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.64.0.tgz",
"integrity": "sha512-tk4WpOJ6IEbGrVHaNmM0YRrwAD3exZlIK3iadQNAxh4YKk6jvUQ4ecq18n+v7+meh+cJ3j+D8nbk8sRKhlwLQg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.63.0",
"@typescript-eslint/types": "^8.63.0",
"@typescript-eslint/tsconfig-utils": "^8.64.0",
"@typescript-eslint/types": "^8.64.0",
"debug": "^4.4.3"
},
"engines": {
@@ -472,14 +472,14 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "8.63.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.63.0.tgz",
"integrity": "sha512-uUyfMWCnDSN8bCpcrY8nGP2BLkQ9Xn0GsipcONcpIDWhwhO4ZSyHvyS14U3X75mzxWxL3I2UZIrenTzdzcJO8A==",
"version": "8.64.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.64.0.tgz",
"integrity": "sha512-CXEaFdYXjSTgKhisNkwCcJwTP8Pl+fmRrEQrri4nm3vU743bALrxzLmq7fHG/7e6a5xO0lDYeURpZmBuhHk54w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.63.0",
"@typescript-eslint/visitor-keys": "8.63.0"
"@typescript-eslint/types": "8.64.0",
"@typescript-eslint/visitor-keys": "8.64.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -490,9 +490,9 @@
}
},
"node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.63.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.63.0.tgz",
"integrity": "sha512-sUAbkulqBAsncKnbRP3+7CtQFRKicexnj7ZwNC6ddCR7EmrXvjvdCYMJbUIqMd6lwoEriZjwLo08aS5tSjVMHg==",
"version": "8.64.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.64.0.tgz",
"integrity": "sha512-2yo8rRNKuzbVWQp5kslhANqZ2uDAeROQHBRZNPu8JDsHmeFNj/XJJhX/FhNUWmkHHvoNsKa6+tHJiig87EzsQw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -507,15 +507,15 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "8.63.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.63.0.tgz",
"integrity": "sha512-Nzzh/OGxVCOjObjaj1CQF2RUasyYy2Jfuh+zZ3PjLzG2fYRriAiZLib9UKtO+CpQAS3YHiAS+ckZDclwqI1TPA==",
"version": "8.64.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.64.0.tgz",
"integrity": "sha512-XWG4Fmmv/6SvyS9nH8jWrKs6terwJvE8cyRt1CzYYqzp9OrPhCT4cMc/f7C6RZCwG+qMmiffJS1/qJP8G1URtg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.63.0",
"@typescript-eslint/typescript-estree": "8.63.0",
"@typescript-eslint/utils": "8.63.0",
"@typescript-eslint/types": "8.64.0",
"@typescript-eslint/typescript-estree": "8.64.0",
"@typescript-eslint/utils": "8.64.0",
"debug": "^4.4.3",
"ts-api-utils": "^2.5.0"
},
@@ -532,9 +532,9 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "8.63.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.63.0.tgz",
"integrity": "sha512-xyLtl9DUBBFrcJS4x2pIqGLH68/tC2uOa4Z7pUteW09D3bXnnXUom4dyPikzWgB7llmIc1zoeI3aoUdC4rPK/Q==",
"version": "8.64.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.64.0.tgz",
"integrity": "sha512-qjhfuTfLXjA4IOzXvz0rTjT01BqEiIgPoUeMwiEjnaHKJMTNo8rH5pYW1a2L/0Dnux2fPC85AeyJoWaGa8WxTA==",
"dev": true,
"license": "MIT",
"engines": {
@@ -546,16 +546,16 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "8.63.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.63.0.tgz",
"integrity": "sha512-ygBkU+B7ex5UI/gKhaqexWev79uISfIv7XQCRNYO/jmD8rGLPyWLAb3KMRT6nd8Gt9bmUBi9+iX6tBdYfOY81Q==",
"version": "8.64.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.64.0.tgz",
"integrity": "sha512-Pztpsn1aCE1oWDvDEfUk31nngvvF7vUB5SwHFEaZIFpvw7WJtqUHHL4plBZDA9HfWJJjL13BdG0YrJInTUvoVA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/project-service": "8.63.0",
"@typescript-eslint/tsconfig-utils": "8.63.0",
"@typescript-eslint/types": "8.63.0",
"@typescript-eslint/visitor-keys": "8.63.0",
"@typescript-eslint/project-service": "8.64.0",
"@typescript-eslint/tsconfig-utils": "8.64.0",
"@typescript-eslint/types": "8.64.0",
"@typescript-eslint/visitor-keys": "8.64.0",
"debug": "^4.4.3",
"minimatch": "^10.2.2",
"semver": "^7.7.3",
@@ -574,16 +574,16 @@
}
},
"node_modules/@typescript-eslint/utils": {
"version": "8.63.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.63.0.tgz",
"integrity": "sha512-fUKaeAvrTuQg/Tgt3nliAUSZHJM6DlCcfyEmxCvlX8kieWSStBX+5O5Fnidtc3i2JrH+9c/GL4RY2iasd/GPTA==",
"version": "8.64.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.64.0.tgz",
"integrity": "sha512-aJUGVB3+U0htrrCjoA8qukw8cm8fNCGAxK/tVoS70k8aeb7DETKeFozRiVFIwEeN9WJLsjaP3ph8I60tY2XZoQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.9.1",
"@typescript-eslint/scope-manager": "8.63.0",
"@typescript-eslint/types": "8.63.0",
"@typescript-eslint/typescript-estree": "8.63.0"
"@typescript-eslint/scope-manager": "8.64.0",
"@typescript-eslint/types": "8.64.0",
"@typescript-eslint/typescript-estree": "8.64.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -598,13 +598,13 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "8.63.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.63.0.tgz",
"integrity": "sha512-UexrHGnGTpbuQHct2ExOc2ZcFbGUS9FOesCxxqdBGcpI1BxYu/LZ6U8Aq6/72XtF/qRBk9nhuGHFJIXXMhPMdw==",
"version": "8.64.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.64.0.tgz",
"integrity": "sha512-mrtuL8Nsn6gi2H4mo5KMTp823M+3Q19Ew/i+Zlikq20tIMm99C3Ez0dCmkWWnxut20esQvTg8aUSEhMcAOXhEw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.63.0",
"@typescript-eslint/types": "8.64.0",
"eslint-visitor-keys": "^5.0.0"
},
"engines": {
@@ -1273,9 +1273,9 @@
}
},
"node_modules/eslint": {
"version": "10.6.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.6.0.tgz",
"integrity": "sha512-6lVbcqSodALYo+4ELD0heG6lFiFxnLMuLkiMi2qV8LMp54N8tE8FT1GMH+ev4Ti00nFjNze2+Su6DsV5OQW3Dg==",
"version": "10.7.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.7.0.tgz",
"integrity": "sha512-GVTD7s1vdIl6UYvAfriOPeY1Df8LIZjfofLvHwde+erDHGGuHyuM6xoxRxmHiebhYuD2p1vN4wWh0XzPARSGDQ==",
"dev": true,
"license": "MIT",
"workspaces": [
@@ -1733,9 +1733,9 @@
}
},
"node_modules/ignore": {
"version": "7.0.5",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
"integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.6.tgz",
"integrity": "sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -2312,9 +2312,9 @@
"license": "MIT"
},
"node_modules/mocha/node_modules/brace-expansion": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.1.tgz",
"integrity": "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==",
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.2.tgz",
"integrity": "sha512-w5JZcKgdhDOgOwm8H+KgbosopHMuGcl6qbulwjtz3SM7I7P3yW1eAjzMPLrIE+NQ9vjgANKHWeMHnrT0OXW1oA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2786,9 +2786,9 @@
}
},
"node_modules/prettier": {
"version": "3.9.4",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.4.tgz",
"integrity": "sha512-yWG/o/4oJfo036EKAfK6ACAoDOfHeRHx4tuxkfBZiauURiaSmYwlpOr5LQqKtIkRD2z1PLteme2WoxEnj4tHTg==",
"version": "3.9.5",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.5.tgz",
"integrity": "sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg==",
"dev": true,
"license": "MIT",
"bin": {
@@ -3029,9 +3029,9 @@
}
},
"node_modules/string-width": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.1.tgz",
"integrity": "sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==",
"version": "8.2.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz",
"integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==",
"dev": true,
"license": "MIT",
"dependencies": {
+4 -4
View File
@@ -1,7 +1,7 @@
{
"name": "vscodestat",
"displayName": "vscodestat",
"version": "1.6.3",
"version": "1.8.0",
"description": "",
"categories": [
"Other"
@@ -53,15 +53,15 @@
"@types/mocha": "^10.0.10",
"@types/node": "26.x",
"@types/vscode": "^1.125.0",
"@typescript-eslint/eslint-plugin": "^8.63.0",
"@typescript-eslint/parser": "^8.63.0",
"@typescript-eslint/eslint-plugin": "^8.64.0",
"@typescript-eslint/parser": "^8.64.0",
"@vscode/test-cli": "^0.0.15",
"@vscode/test-electron": "^3.0.0",
"eslint": "^10.1.0",
"globals": "^17.7.0",
"husky": "^9.1.7",
"lint-staged": "^17.0.8",
"prettier": "^3.9.4",
"prettier": "^3.9.5",
"ts-api-utils": "^2.5.0",
"typescript": "^6.0.3"
},
+17 -17
View File
@@ -7,7 +7,7 @@ export function activate(context: vscode.ExtensionContext) {
const disposable2 = vscode.commands.registerCommand('vscodestat.setUrl', async () => {
const url = await vscode.window.showInputBox({
prompt: 'Enter the URL:',
placeHolder: ''
placeHolder: '',
});
if (url) {
@@ -24,13 +24,13 @@ export function activate(context: vscode.ExtensionContext) {
vscode.window.showWarningMessage('URL is not set. Please set the URL first.');
return;
}
await makeHttpRequest({ event: 'ping'});
await makeHttpRequest({ event: 'ping' });
vscode.window.showInformationMessage('callUrl done');
});
context.subscriptions.push(disposable3);
// detecte une ouverture de fichier / nouvel onglet
vscode.window.onDidChangeActiveTextEditor(async editor => {
vscode.window.onDidChangeActiveTextEditor(async (editor) => {
if (editor) {
const filePath = editor.document.fileName;
console.log('Opened file:', filePath);
@@ -41,7 +41,7 @@ export function activate(context: vscode.ExtensionContext) {
});
// detecte une sauvegarde de fichier
vscode.workspace.onDidSaveTextDocument(async document => {
vscode.workspace.onDidSaveTextDocument(async (document) => {
const filePath = document.fileName;
console.log('Saved file:', filePath);
@@ -50,25 +50,25 @@ export function activate(context: vscode.ExtensionContext) {
});
// detecte un focus / blur de la fenetre vscode
vscode.window.onDidChangeWindowState(async event => {
vscode.window.onDidChangeWindowState(async (event) => {
console.log('Window state changed:', event.focused);
await makeHttpRequest({ event: 'focus', focused: event.focused });
});
}
export function deactivate() { }
export function deactivate() {}
/*
* extractProjectName will extract a project name from a path
* /root/docker/monitoringserver/controller/homeController.js
* => monitoringserver
*/
* extractProjectName will extract a project name from a path
* /root/docker/monitoringserver/controller/homeController.js
* => monitoringserver
*/
export function extractProjectName(path: string) {
// des c'est l'un des fois l'autre ?
// /root/docker/vscodestat/src/extension.ts
// \root\docker\vscodestat\src\extension.ts
path = path.replace(/\\/g, '/');
const match = path.match(/\/docker\/([^/]+)/);
if (match) {
return match[1];
@@ -78,8 +78,8 @@ export function extractProjectName(path: string) {
}
/*
* fonction qui envoie un event au serveur
*/
* fonction qui envoie un event au serveur
*/
async function makeHttpRequest(json: Object) {
try {
const url = vscode.workspace.getConfiguration().get('vscodestat.url') as string;
@@ -91,16 +91,16 @@ async function makeHttpRequest(json: Object) {
const rawResponse = await fetch(url, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify(json)
body: JSON.stringify(json),
});
const content = await rawResponse.json();
console.log(content);
// vscode.window.showInformationMessage('HTTP request successful.');
} catch (error:any) {
} catch (error: any) {
console.error('Error making HTTP request:', error);
// vscode.window.showErrorMessage('Error making HTTP request: ' + error.message);
}
+4 -16
View File
@@ -3,17 +3,11 @@ import { extractProjectName } from '../extension.js';
suite('extractProjectName', () => {
test('extrait le nom de projet depuis un path Linux /root/docker/X', () => {
assert.strictEqual(
extractProjectName('/root/docker/vscodestat/src/extension.ts'),
'vscodestat'
);
assert.strictEqual(extractProjectName('/root/docker/vscodestat/src/extension.ts'), 'vscodestat');
});
test('extrait le nom de projet depuis un path Windows \\root\\docker\\X', () => {
assert.strictEqual(
extractProjectName('C:\\root\\docker\\monitoringserver\\controller\\homeController.js'),
'monitoringserver'
);
assert.strictEqual(extractProjectName('C:\\root\\docker\\monitoringserver\\controller\\homeController.js'), 'monitoringserver');
});
test('retourne null pour un path hors /docker/', () => {
@@ -25,16 +19,10 @@ suite('extractProjectName', () => {
});
test('extrait correctement quand le chemin contient docker plusieurs fois', () => {
assert.strictEqual(
extractProjectName('/root/docker/flatbay/lib/docker/foo.js'),
'flatbay'
);
assert.strictEqual(extractProjectName('/root/docker/flatbay/lib/docker/foo.js'), 'flatbay');
});
test('gere les paths avec tirets et chiffres', () => {
assert.strictEqual(
extractProjectName('/root/docker/gextra6/bin/console'),
'gextra6'
);
assert.strictEqual(extractProjectName('/root/docker/gextra6/bin/console'), 'gextra6');
});
});
+10 -16
View File
@@ -1,18 +1,12 @@
{
"compilerOptions": {
"module": "Node16",
"target": "ES2022",
"outDir": "out",
"lib": [
"ES2022"
],
"types": [
"node",
"mocha",
"vscode"
],
"sourceMap": true,
"rootDir": "src",
"strict": true
}
"compilerOptions": {
"module": "Node16",
"target": "ES2022",
"outDir": "out",
"lib": ["ES2022"],
"types": ["node", "mocha", "vscode"],
"sourceMap": true,
"rootDir": "src",
"strict": true
}
}