Compare commits

...
48 Commits
Author SHA1 Message Date
root e6b404f009 fix: await sur l'écriture de la config setUrl + renommage des disposables
continuous-integration/drone/tag Build is passing
2026-07-31 15:02:34 +02:00
root 30b87d515f feature: renommage disposable2/disposable3 en setUrlCommand/callUrlCommand 2026-07-31 15:01:17 +02:00
root 087dc3dad1 fix: attendre l'écriture de la config avant d'annoncer « URL set successfully » 2026-07-31 14:52:02 +02:00
root 8fb2196e67 fix: release
continuous-integration/drone/tag Build is passing
2026-07-28 03:08:07 +00:00
m.schnitzlerandroot fe4e5393e0 renovate (#193)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-07-28 03:07:51 +00:00
root 437f07ccc1 fix: release
continuous-integration/drone/tag Build is passing
2026-07-25 23:30:02 +00:00
m.schnitzlerandroot afa57178d9 renovate (#192)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-07-25 23:29:41 +00:00
root f9824e1523 fix: release
continuous-integration/drone/tag Build is passing
2026-07-24 23:22:14 +00:00
m.schnitzlerandroot 9fa19fe316 renovate (#191)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-07-24 23:21:55 +00:00
root 1e8b682afc fix: release
continuous-integration/drone/tag Build is passing
2026-07-24 00:14:57 +00:00
m.schnitzlerandroot 7ee9dd2a49 renovate (#190)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-07-24 00:14:46 +00:00
root 9535565349 fix: release
continuous-integration/drone/tag Build is passing
2026-07-22 23:36:51 +00:00
m.schnitzlerandroot bcabfe6db1 renovate (#189)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-07-22 23:36:33 +00:00
root b67d12ecdd fix: release
continuous-integration/drone/tag Build is passing
2026-07-22 00:01:26 +00:00
m.schnitzlerandroot 2d865f87dd renovate (#188)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-07-21 23:59:50 +00:00
root 9403710c8a fix: release
continuous-integration/drone/tag Build is passing
2026-07-19 23:05:13 +00:00
m.schnitzlerandroot cb5b4478e5 renovate (#187)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-07-19 23:04:58 +00:00
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
root ce7dd93de5 fix: release
continuous-integration/drone/tag Build is passing
2026-07-09 03:35:35 +00:00
m.schnitzlerandroot f250f48788 renovate (#184)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-07-09 03:35:09 +00:00
root 840564fc69 fix: release
continuous-integration/drone/tag Build is pending
2026-07-01 02:08:32 +00:00
m.schnitzlerandroot a7086bdaf6 renovate (#183)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-07-01 02:07:21 +00:00
root 6ec43bf622 fix: release
continuous-integration/drone/tag Build is passing
2026-06-30 23:37:06 +00:00
m.schnitzlerandroot 73494bf805 renovatemajor (#182)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-06-30 23:36:47 +00:00
root 94b058a6e7 feature: lance les tests (xvfb-run npm test) dans la CI Drone avant le packaging vsix
continuous-integration/drone/tag Build is passing
2026-06-25 22:30:24 +02:00
root a896a8e7fc fix: nettoyage commentaires boilerplate yo-code dans tsconfig (JSON strict valide) 2026-06-25 22:14:56 +02:00
root a05d2218c6 fix: eslint reportUnusedDisableDirectives error (sweep flotte) + nettoyage
continuous-integration/drone/tag Build is passing
2026-06-25 00:25:49 +02:00
root 8908a32a68 feature: sweep flotte (propagation libs copy-first model/monitoring/requestPromise/influxdb, config eslint/lintstaged/husky, migration TS, avancement conformite migrations Vite)
continuous-integration/drone/tag Build is passing
2026-06-24 00:28:06 +02:00
root 695d1c1b50 feature: sweep flotte (propagation libs copy-first, migration TS, chantiers en cours)
continuous-integration/drone/tag Build is passing
2026-06-23 17:43:28 +02:00
root 7da16a82e5 chore: audit securite (todo.txt)
todo.txt
2026-06-21 08:26:17 +02:00
root c297beb494 fix: release
continuous-integration/drone/tag Build is passing
2026-06-20 00:43:29 +00:00
m.schnitzlerandroot da5bbfe1a8 renovate (#181)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-06-20 00:43:13 +00:00
root 5b116e016c feature: tag source:vscode sur events open/save + .npmrc fund/audit 2026-06-14 22:43:42 +02:00
root 39b5d46122 fix: release
continuous-integration/drone/tag Build is passing
2026-06-12 00:14:22 +00:00
m.schnitzlerandroot fa606b745d renovate (#180)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-06-12 00:14:08 +00:00
root b98b3db80b feature: robots.txt->sitemap, cleanup tooling (twig-cs-fixer/c8rc), maj libs flotte
continuous-integration/drone/tag Build is passing
2026-06-11 18:06:50 +02:00
root 44b8302801 up 2026-06-09 14:00:08 +02:00
root b16b775efb chore: harmonisation flotte (ignores legacy/ eslint/prettier/dockerignore, garde-fou vite watch.ignored, Dockerfile npm ci) 2026-06-06 08:14:12 +02:00
root f332115e6a fix: release
continuous-integration/drone/tag Build is passing
2026-06-03 00:40:20 +00:00
m.schnitzlerandroot 24a26551ce renovate (#179)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-06-03 00:40:08 +00:00
root ef8c92a4b4 chore: retrait du hook myhtmlvalidate (lib archivée) 2026-06-03 02:01:46 +02:00
root bf88d3526f fix: release
continuous-integration/drone/tag Build is passing
2026-06-02 02:08:43 +00:00
m.schnitzlerandroot c70435e58a renovate (#178)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-06-02 02:08:12 +00:00
13 changed files with 640 additions and 1023 deletions
+1
View File
@@ -18,6 +18,7 @@ steps:
commands:
- npm install -g vsce
- npm ci
- xvfb-run -a npm test
- vsce package
- name: gitea_release
+2
View File
@@ -32,3 +32,5 @@ data/
.aider*
/dist/
tsconfig.tsbuildinfo
.twig-cs-fixer.cache
testfront-screenshots/
+2 -1
View File
@@ -1,8 +1,9 @@
{
"*.js": ["eslint --fix", "prettier --write"],
"*.ts": ["eslint --fix", "prettier --write"],
"*.css": ["prettier --write"],
"*.jsx": ["prettier --write"],
"*.html.twig": ["twig-cs-fixer lint --fix", "myhtmlvalidate -q"],
"*.tsx": ["prettier --write"],
"*.php": ["php-cs-fixer fix --config .php-cs-fixer.php"],
"Dockerfile": ["hadolint --ignore DL3002 --ignore DL3003 --ignore DL3008 --ignore DL3013 --ignore DL3016 --ignore DL3022"],
"*.md": ["markdownlint --fix"],
+2
View File
@@ -1 +1,3 @@
min-release-age=1
fund=false
audit=false
+1
View File
@@ -7,3 +7,4 @@ data/*
.vscode-test/
/dist/
tsconfig.tsbuildinfo
legacy/*
+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
+7 -5
View File
@@ -4,6 +4,8 @@ import tsplugin from '@typescript-eslint/eslint-plugin';
import globals from 'globals';
export default [
// remonte (et --fix supprime) tout eslint-disable inutile : regle deja off, inactive, ou qui ne tire pas
{ linterOptions: { reportUnusedDisableDirectives: 'error' } },
js.configs.recommended,
{
files: ['**/*.ts'],
@@ -30,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',
@@ -45,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',
@@ -61,6 +63,6 @@ export default [
},
},
{
ignores: ['out/', 'dist/', '.vscode-test/', '**/*.d.ts'],
ignores: ['legacy/', 'out/', 'dist/', '.vscode-test/', '**/*.d.ts'],
},
];
+572 -910
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -1,7 +1,7 @@
{
"name": "vscodestat",
"displayName": "vscodestat",
"version": "1.2.14",
"version": "1.8.8",
"description": "",
"categories": [
"Other"
@@ -51,22 +51,22 @@
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/mocha": "^10.0.10",
"@types/node": "25.x",
"@types/vscode": "^1.120.0",
"@typescript-eslint/eslint-plugin": "^8.60.0",
"@typescript-eslint/parser": "^8.60.0",
"@vscode/test-cli": "^0.0.12",
"@vscode/test-electron": "^2.5.2",
"@types/node": "26.x",
"@types/vscode": "^1.125.0",
"@typescript-eslint/eslint-plugin": "^8.65.0",
"@typescript-eslint/parser": "^8.65.0",
"@vscode/test-cli": "^0.0.15",
"@vscode/test-electron": "^3.1.0",
"eslint": "^10.1.0",
"globals": "^17.6.0",
"globals": "^17.8.0",
"husky": "^9.1.7",
"lint-staged": "^17.0.6",
"prettier": "^3.8.3",
"lint-staged": "^17.2.0",
"prettier": "^3.9.6",
"ts-api-utils": "^2.5.0",
"typescript": "^6.0.3"
},
"engines": {
"vscode": "^1.120.0"
"vscode": "^1.125.0"
},
"icon": "icon.png",
"extensionKind": [
+24 -24
View File
@@ -4,71 +4,71 @@ export function activate(context: vscode.ExtensionContext) {
console.log('Congratulations, your extension "vscodestat" is now active!');
// commande pour definir l'url
const disposable2 = vscode.commands.registerCommand('vscodestat.setUrl', async () => {
const setUrlCommand = vscode.commands.registerCommand('vscodestat.setUrl', async () => {
const url = await vscode.window.showInputBox({
prompt: 'Enter the URL:',
placeHolder: ''
placeHolder: '',
});
if (url) {
vscode.workspace.getConfiguration().update('vscodestat.url', url, vscode.ConfigurationTarget.Global);
await vscode.workspace.getConfiguration().update('vscodestat.url', url, vscode.ConfigurationTarget.Global);
vscode.window.showInformationMessage('URL set successfully.');
}
});
context.subscriptions.push(disposable2);
context.subscriptions.push(setUrlCommand);
// commande pour tester l'url
const disposable3 = vscode.commands.registerCommand('vscodestat.callUrl', async () => {
const callUrlCommand = vscode.commands.registerCommand('vscodestat.callUrl', async () => {
const storedUrl = vscode.workspace.getConfiguration().get('vscodestat.url') as string;
if (!storedUrl) {
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);
context.subscriptions.push(callUrlCommand);
// 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);
// vscode.window.showInformationMessage(`Opened file: ${filePath}`);
await makeHttpRequest({ event: 'open', project: extractProjectName(filePath) });
await makeHttpRequest({ event: 'open', project: extractProjectName(filePath), source: 'vscode' });
}
});
// detecte une sauvegarde de fichier
vscode.workspace.onDidSaveTextDocument(async document => {
vscode.workspace.onDidSaveTextDocument(async (document) => {
const filePath = document.fileName;
console.log('Saved file:', filePath);
// vscode.window.showInformationMessage(`Saved file: ${filePath}`);
await makeHttpRequest({ event: 'save', project: extractProjectName(filePath) });
await makeHttpRequest({ event: 'save', project: extractProjectName(filePath), source: 'vscode' });
});
// 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');
});
});
-33
View File
@@ -1,33 +0,0 @@
REVIEW DE CODE — 2026-04-26
============================================
Extension VSCode (TypeScript) qui collecte des metriques sur
l'activite du user dans VSCode :
- ouverture de fichier / changement d'onglet (event 'open')
- sauvegarde de fichier (event 'save')
- focus/blur de la fenetre (event 'focus')
Envoie un POST JSON a la URL configuree (`vscodestat.url`).
NB : extension force-installed dans les containers vscode + vscodeluigi
(cf vscode/todo.txt). C'est l'extension de monitoring activite dev.
SECURITE
--------
[ ] makeHttpRequest envoie au serveur l'event sans auth
src/extension.ts : `fetch(url, { method: 'POST',
headers: ..., body: JSON.stringify(json) })`. Pas de token.
Cote serveur (cf monitoringserver/todo.txt), `/vscodestat` est
aussi sans auth => tout le monde peut envoyer des metriques.
BUGS / FRAGILITE
----------------
[ ] Pas de batching
Chaque event = 1 fetch. Pas de queue + flush periodique.
Si reseau down, perte d'events (pas de retry). A capper.
[ ] makeHttpRequest catch silencieux
src/extension.ts : catch + console.error. Pas de
retry, pas de notification user. Si serveur down, events
perdus.
+10 -20
View File
@@ -1,22 +1,12 @@
{
"compilerOptions": {
"module": "Node16",
"target": "ES2022",
"outDir": "out",
"lib": [
"ES2022"
],
"types": [
"node",
"mocha",
"vscode"
],
"sourceMap": true,
"rootDir": "src",
"strict": true /* enable all strict type-checking options */
/* Additional Checks */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
}
"compilerOptions": {
"module": "Node16",
"target": "ES2022",
"outDir": "out",
"lib": ["ES2022"],
"types": ["node", "mocha", "vscode"],
"sourceMap": true,
"rootDir": "src",
"strict": true
}
}