Compare commits

...

58 Commits

Author SHA1 Message Date
root dc9863ccc4 fix: release
continuous-integration/drone/tag Build is passing
2026-05-11 04:56:34 +00:00
m.schnitzler 229e0f4c03 renovate (#171)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-05-11 04:56:17 +00:00
root 4ea75811de fix: release
continuous-integration/drone/tag Build is passing
2026-05-10 05:03:49 +00:00
m.schnitzler 7cf1d6f7dc renovate (#170)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-05-10 05:03:14 +00:00
root b8e2339c9c fix: release
continuous-integration/drone/tag Build is passing
2026-05-09 09:40:49 +00:00
m.schnitzler d29a1bea80 renovatemajor (#169)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-05-09 09:40:32 +00:00
root 8d282828c0 fix: ajout @eslint/js et globals manquants pour eslint.config.js
continuous-integration/drone/tag Build is passing
2026-05-08 23:24:10 +02:00
root 07a89c5829 fix: release
continuous-integration/drone/tag Build is passing
2026-05-06 00:48:37 +00:00
m.schnitzler dac0a7b6fa renovate (#168)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-05-06 00:48:23 +00:00
root a574802ffb fix: release
continuous-integration/drone/tag Build is passing
2026-04-30 23:55:22 +00:00
m.schnitzler 228211991d renovate (#167)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-04-30 23:55:13 +00:00
root be832c4df4 up 2026-04-30 15:02:16 +02:00
root ff7da312a0 fix: cleanup todo.txt et suppression vsix repo
continuous-integration/drone/tag Build is passing
2026-04-30 14:54:14 +02:00
root af175e078c feature: cleanup helloWorld, focus event nomme, tests extractProjectName
continuous-integration/drone/tag Build is passing
2026-04-30 14:39:38 +02:00
root 09c3aa6fa6 fix: ajout types node/mocha/vscode dans tsconfig pour TS 6
continuous-integration/drone/tag Build is passing
2026-04-29 08:20:31 +02:00
root 84d69cad92 fix: release
continuous-integration/drone/tag Build is failing
2026-04-29 04:40:57 +00:00
m.schnitzler 30aa53c049 renovate (#166)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-04-29 04:40:04 +00:00
root e5c2b7d428 up 2026-04-28 00:16:18 +02:00
root 742b91bd90 fix: release
continuous-integration/drone/tag Build is failing
2026-04-22 02:13:10 +00:00
m.schnitzler 94e9b3de43 renovate (#165)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-04-22 02:12:41 +00:00
root 76a01082fe fix: release
continuous-integration/drone/tag Build is failing
2026-04-19 02:59:00 +00:00
m.schnitzler 90f630d07c renovate (#164)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-04-19 02:58:30 +00:00
root 2361c555ed fix: release
continuous-integration/drone/tag Build is failing
2026-04-17 03:47:12 +00:00
m.schnitzler 4345e9cf92 renovate (#163)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-04-17 03:46:30 +00:00
root 515fa59dcd fix: release
continuous-integration/drone/tag Build is failing
2026-04-16 01:15:04 +00:00
m.schnitzler c171fefc5e renovate (#162)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-04-16 01:14:16 +00:00
root ca3e610df2 fix: release
continuous-integration/drone/tag Build is failing
2026-04-15 02:16:44 +00:00
m.schnitzler c4a79dc07a renovate (#161)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-04-15 02:16:29 +00:00
root a7d467534c up 2026-04-13 11:37:51 +02:00
root 4c9ef78d4b fix: release
continuous-integration/drone/tag Build is failing
2026-04-12 03:46:02 +00:00
m.schnitzler afadea311c renovate (#160)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-04-12 03:45:19 +00:00
root 49e7ba7597 fix: release
continuous-integration/drone/tag Build is failing
2026-04-10 00:22:56 +00:00
m.schnitzler d9ac7f1fe1 renovate (#159)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-04-10 00:22:30 +00:00
root 8717509909 fix: release
continuous-integration/drone/tag Build is failing
2026-04-09 02:03:46 +00:00
m.schnitzler b1465077a1 renovate (#158)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-04-09 02:03:27 +00:00
root 31fa528fe2 up 2026-04-06 11:09:46 +02:00
root 71a054b964 up 2026-04-04 23:14:17 +02:00
root 15c05b5667 up 2026-04-04 15:13:29 +02:00
root 9d0fb0901e fix: release
continuous-integration/drone/tag Build is failing
2026-03-31 09:31:07 +00:00
m.schnitzler 87cc7b7e38 renovatemajor (#157)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-03-31 09:30:47 +00:00
root 8f802c4574 fix: release
continuous-integration/drone/tag Build is passing
2026-03-21 00:34:29 +00:00
m.schnitzler 942b4a3865 renovate (#156)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-03-21 00:34:13 +00:00
root c8d79ef509 fix: release
continuous-integration/drone/tag Build is passing
2026-03-19 03:37:16 +00:00
m.schnitzler 8bd362922a renovate (#155)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-03-19 03:37:09 +00:00
root cb4d1366bf fix: release
continuous-integration/drone/tag Build is passing
2026-03-17 00:33:06 +00:00
m.schnitzler e5cde7df45 renovate (#154)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-03-17 00:32:47 +00:00
root 50b051e155 fix: release
continuous-integration/drone/tag Build is passing
2026-03-10 00:41:45 +00:00
m.schnitzler efe9250969 renovate (#153)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-03-10 00:41:21 +00:00
root 39e4e03b29 fix: release
continuous-integration/drone/tag Build is passing
2026-03-08 01:18:19 +00:00
m.schnitzler eb97144726 renovate (#152)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-03-08 01:17:55 +00:00
root b695d0ff1f fix: release
continuous-integration/drone/tag Build is passing
2026-02-24 00:56:24 +00:00
m.schnitzler c004b7c70a renovate (#151)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-02-24 00:56:07 +00:00
root b15be4bf7c fix: release
continuous-integration/drone/tag Build is passing
2026-02-21 00:57:43 +00:00
m.schnitzler 5a3fd218bc renovate (#150)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-02-21 00:57:10 +00:00
root 9a33fc258f up 2026-02-18 22:30:56 +01:00
root 1781912d3f fix: release
continuous-integration/drone/tag Build is passing
2026-02-05 01:45:05 +00:00
m.schnitzler 2a494213ff renovate (#148)
Co-authored-by: m.schnitzler <martin.wb.2015@gmail.com>
Co-committed-by: m.schnitzler <martin.wb.2015@gmail.com>
2026-02-05 01:44:45 +00:00
root 9cc4bb48fc fix: eslint 2026-01-30 16:08:17 +01:00
14 changed files with 942 additions and 440 deletions
+1
View File
@@ -0,0 +1 @@
_
+9
View File
@@ -0,0 +1,9 @@
if [ -z "$(cat "$1" | grep -E '(^fix:)|(^feature:)|(^up$)|^Merge branch .+$')" ] ; then
echo ""
echo respecte le format de commit ❤
echo " fix: xxx"
echo " feature: xxx"
echo ""
exit 1
fi
+7
View File
@@ -0,0 +1,7 @@
if git diff --name-only HEAD@{1} HEAD | grep package-lock.json ; then
echo "📦 package-lock.json changed. Running npm ci to update your dependencies..."
npm ci
else
echo "📦 no need to update dependencies"
fi
+13
View File
@@ -0,0 +1,13 @@
# prevent commits on master
branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "$branch" = "master" ]; then
echo ""
echo "You can't commit directly to master branch"
echo "please create a pull request"
echo ""
exit 1
fi
# run linters
npx lint-staged
+11
View File
@@ -0,0 +1,11 @@
{
"*.js": ["eslint --fix", "prettier --write"],
"*.css": ["prettier --write"],
"*.jsx": ["prettier --write"],
"*.html.twig": ["twig-cs-fixer lint --fix", "myhtmlvalidate -q"],
"*.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"],
"*openapi.json": ["spectral lint"],
"*.tf": ["tflint"]
}
+1
View File
@@ -0,0 +1 @@
min-release-age=1
+6
View File
@@ -0,0 +1,6 @@
web/*
views/*
log/*
node_modules/*
coverage/*
data/*
+7
View File
@@ -0,0 +1,7 @@
export default {
tabWidth: 4,
singleQuote: true,
trailingComma: 'es5',
printWidth: 150,
arrowParens: 'always',
};
+798 -411
View File
File diff suppressed because it is too large Load Diff
+14 -11
View File
@@ -1,7 +1,7 @@
{
"name": "vscodestat",
"displayName": "vscodestat",
"version": "1.1.142",
"version": "1.2.7",
"description": "",
"categories": [
"Other"
@@ -17,6 +17,7 @@
"scripts": {
"compile": "tsc -p ./",
"lint": "eslint src --ext ts",
"prepare": "husky",
"pretest": "npm run compile && npm run lint",
"test": "vscode-test",
"vscode:prepublish": "npm run compile",
@@ -24,10 +25,6 @@
},
"contributes": {
"commands": [
{
"command": "vscodestat.helloWorld",
"title": "Hello World"
},
{
"command": "vscodestat.setUrl",
"title": "setUrl"
@@ -52,18 +49,24 @@
"onStartupFinished"
],
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/mocha": "^10.0.10",
"@types/node": "25.x",
"@types/vscode": "^1.108.1",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"@types/vscode": "^1.118.0",
"@typescript-eslint/eslint-plugin": "^8.59.2",
"@typescript-eslint/parser": "^8.59.2",
"@vscode/test-cli": "^0.0.12",
"@vscode/test-electron": "^2.5.2",
"eslint": "^9.39.2",
"typescript": "^5.9.3"
"eslint": "^10.1.0",
"globals": "^17.6.0",
"husky": "^9.1.7",
"lint-staged": "^17.0.4",
"prettier": "^3.8.3",
"ts-api-utils": "^2.5.0",
"typescript": "^6.0.3"
},
"engines": {
"vscode": "^1.108.1"
"vscode": "^1.118.0"
},
"icon": "icon.png",
"extensionKind": [
+2 -8
View File
@@ -3,12 +3,6 @@ import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
console.log('Congratulations, your extension "vscodestat" is now active!');
// crée une commande de test
const disposable = vscode.commands.registerCommand('vscodestat.helloWorld', () => {
vscode.window.showInformationMessage('Hello World from vscodestat!');
});
context.subscriptions.push(disposable);
// commande pour definir l'url
const disposable2 = vscode.commands.registerCommand('vscodestat.setUrl', async () => {
const url = await vscode.window.showInputBox({
@@ -58,7 +52,7 @@ export function activate(context: vscode.ExtensionContext) {
// detecte un focus / blur de la fenetre vscode
vscode.window.onDidChangeWindowState(async event => {
console.log('Window state changed:', event.focused);
await makeHttpRequest({ focus: event.focused });
await makeHttpRequest({ event: 'focus', focused: event.focused });
});
}
@@ -69,7 +63,7 @@ export function deactivate() { }
* /root/docker/monitoringserver/controller/homeController.js
* => monitoringserver
*/
function extractProjectName(path: string) {
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
+35 -10
View File
@@ -1,15 +1,40 @@
import * as assert from 'assert';
import { extractProjectName } from '../extension.js';
// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import * as vscode from 'vscode';
// import * as myExtension from '../../extension';
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'
);
});
suite('Extension Test Suite', () => {
vscode.window.showInformationMessage('Start all tests.');
test('extrait le nom de projet depuis un path Windows \\root\\docker\\X', () => {
assert.strictEqual(
extractProjectName('C:\\root\\docker\\monitoringserver\\controller\\homeController.js'),
'monitoringserver'
);
});
test('Sample test', () => {
assert.strictEqual(-1, [1, 2, 3].indexOf(5));
assert.strictEqual(-1, [1, 2, 3].indexOf(0));
});
test('retourne null pour un path hors /docker/', () => {
assert.strictEqual(extractProjectName('/home/user/projet/file.js'), null);
});
test('retourne null pour un path vide', () => {
assert.strictEqual(extractProjectName(''), null);
});
test('extrait correctement quand le chemin contient docker plusieurs fois', () => {
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'
);
});
});
+33
View File
@@ -0,0 +1,33 @@
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.
+5
View File
@@ -6,6 +6,11 @@
"lib": [
"ES2022"
],
"types": [
"node",
"mocha",
"vscode"
],
"sourceMap": true,
"rootDir": "src",
"strict": true /* enable all strict type-checking options */