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
continuous-integration/drone/tag Build is passing
This commit is contained in:
@@ -5,14 +5,15 @@ collect stats about a user's activity in vscode
|
|||||||
## Features
|
## Features
|
||||||
|
|
||||||
it can track :
|
it can track :
|
||||||
|
|
||||||
- file opening
|
- file opening
|
||||||
- file saving
|
- file saving
|
||||||
- window focus
|
- window focus
|
||||||
|
|
||||||
## Extension Settings
|
## Extension Settings
|
||||||
|
|
||||||
* `vscodestat.setUrl`: function to set the remote server's url
|
- `vscodestat.setUrl`: function to set the remote server's url
|
||||||
this will set the variable vscodestat.url
|
this will set the variable vscodestat.url
|
||||||
* `vscodestat.callUrl`: funciton to test if it works
|
- `vscodestat.callUrl`: funciton to test if it works
|
||||||
|
|
||||||
Sample url : https://xxxxxx/vscodestat?userName=raf
|
Sample url : https://xxxxxx/vscodestat?userName=raf
|
||||||
|
|||||||
+4
-4
@@ -32,10 +32,10 @@ export default [
|
|||||||
format: ['camelCase', 'PascalCase'],
|
format: ['camelCase', 'PascalCase'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'curly': 'warn',
|
curly: 'warn',
|
||||||
'eqeqeq': 'warn',
|
eqeqeq: 'warn',
|
||||||
'no-throw-literal': 'warn',
|
'no-throw-literal': 'warn',
|
||||||
'semi': 'off',
|
semi: 'off',
|
||||||
// Règles générales réutilisées de flatbay
|
// Règles générales réutilisées de flatbay
|
||||||
'prefer-const': ['error', { destructuring: 'all' }],
|
'prefer-const': ['error', { destructuring: 'all' }],
|
||||||
'no-var': 'error',
|
'no-var': 'error',
|
||||||
@@ -47,7 +47,7 @@ export default [
|
|||||||
'one-var-declaration-per-line': ['error', 'always'],
|
'one-var-declaration-per-line': ['error', 'always'],
|
||||||
'one-var': ['error', 'never'],
|
'one-var': ['error', 'never'],
|
||||||
'vars-on-top': 'error',
|
'vars-on-top': 'error',
|
||||||
'yoda': 'error',
|
yoda: 'error',
|
||||||
'prefer-arrow-callback': 'error',
|
'prefer-arrow-callback': 'error',
|
||||||
'no-implicit-globals': 'error',
|
'no-implicit-globals': 'error',
|
||||||
'no-labels': 'error',
|
'no-labels': 'error',
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "vscodestat",
|
"name": "vscodestat",
|
||||||
"version": "1.7.1",
|
"version": "1.8.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "vscodestat",
|
"name": "vscodestat",
|
||||||
"version": "1.7.1",
|
"version": "1.8.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "vscodestat",
|
"name": "vscodestat",
|
||||||
"displayName": "vscodestat",
|
"displayName": "vscodestat",
|
||||||
"version": "1.7.1",
|
"version": "1.8.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"categories": [
|
"categories": [
|
||||||
"Other"
|
"Other"
|
||||||
|
|||||||
+7
-7
@@ -7,7 +7,7 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
const disposable2 = vscode.commands.registerCommand('vscodestat.setUrl', async () => {
|
const disposable2 = vscode.commands.registerCommand('vscodestat.setUrl', async () => {
|
||||||
const url = await vscode.window.showInputBox({
|
const url = await vscode.window.showInputBox({
|
||||||
prompt: 'Enter the URL:',
|
prompt: 'Enter the URL:',
|
||||||
placeHolder: ''
|
placeHolder: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
if (url) {
|
if (url) {
|
||||||
@@ -30,7 +30,7 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
context.subscriptions.push(disposable3);
|
context.subscriptions.push(disposable3);
|
||||||
|
|
||||||
// detecte une ouverture de fichier / nouvel onglet
|
// detecte une ouverture de fichier / nouvel onglet
|
||||||
vscode.window.onDidChangeActiveTextEditor(async editor => {
|
vscode.window.onDidChangeActiveTextEditor(async (editor) => {
|
||||||
if (editor) {
|
if (editor) {
|
||||||
const filePath = editor.document.fileName;
|
const filePath = editor.document.fileName;
|
||||||
console.log('Opened file:', filePath);
|
console.log('Opened file:', filePath);
|
||||||
@@ -41,7 +41,7 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// detecte une sauvegarde de fichier
|
// detecte une sauvegarde de fichier
|
||||||
vscode.workspace.onDidSaveTextDocument(async document => {
|
vscode.workspace.onDidSaveTextDocument(async (document) => {
|
||||||
const filePath = document.fileName;
|
const filePath = document.fileName;
|
||||||
console.log('Saved file:', filePath);
|
console.log('Saved file:', filePath);
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// detecte un focus / blur de la fenetre 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);
|
console.log('Window state changed:', event.focused);
|
||||||
await makeHttpRequest({ event: 'focus', focused: event.focused });
|
await makeHttpRequest({ event: 'focus', focused: event.focused });
|
||||||
});
|
});
|
||||||
@@ -91,10 +91,10 @@ async function makeHttpRequest(json: Object) {
|
|||||||
const rawResponse = await fetch(url, {
|
const rawResponse = await fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/json',
|
Accept: 'application/json',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(json)
|
body: JSON.stringify(json),
|
||||||
});
|
});
|
||||||
const content = await rawResponse.json();
|
const content = await rawResponse.json();
|
||||||
|
|
||||||
|
|||||||
@@ -3,17 +3,11 @@ import { extractProjectName } from '../extension.js';
|
|||||||
|
|
||||||
suite('extractProjectName', () => {
|
suite('extractProjectName', () => {
|
||||||
test('extrait le nom de projet depuis un path Linux /root/docker/X', () => {
|
test('extrait le nom de projet depuis un path Linux /root/docker/X', () => {
|
||||||
assert.strictEqual(
|
assert.strictEqual(extractProjectName('/root/docker/vscodestat/src/extension.ts'), 'vscodestat');
|
||||||
extractProjectName('/root/docker/vscodestat/src/extension.ts'),
|
|
||||||
'vscodestat'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('extrait le nom de projet depuis un path Windows \\root\\docker\\X', () => {
|
test('extrait le nom de projet depuis un path Windows \\root\\docker\\X', () => {
|
||||||
assert.strictEqual(
|
assert.strictEqual(extractProjectName('C:\\root\\docker\\monitoringserver\\controller\\homeController.js'), 'monitoringserver');
|
||||||
extractProjectName('C:\\root\\docker\\monitoringserver\\controller\\homeController.js'),
|
|
||||||
'monitoringserver'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('retourne null pour un path hors /docker/', () => {
|
test('retourne null pour un path hors /docker/', () => {
|
||||||
@@ -25,16 +19,10 @@ suite('extractProjectName', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('extrait correctement quand le chemin contient docker plusieurs fois', () => {
|
test('extrait correctement quand le chemin contient docker plusieurs fois', () => {
|
||||||
assert.strictEqual(
|
assert.strictEqual(extractProjectName('/root/docker/flatbay/lib/docker/foo.js'), 'flatbay');
|
||||||
extractProjectName('/root/docker/flatbay/lib/docker/foo.js'),
|
|
||||||
'flatbay'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('gere les paths avec tirets et chiffres', () => {
|
test('gere les paths avec tirets et chiffres', () => {
|
||||||
assert.strictEqual(
|
assert.strictEqual(extractProjectName('/root/docker/gextra6/bin/console'), 'gextra6');
|
||||||
extractProjectName('/root/docker/gextra6/bin/console'),
|
|
||||||
'gextra6'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+2
-8
@@ -3,14 +3,8 @@
|
|||||||
"module": "Node16",
|
"module": "Node16",
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"outDir": "out",
|
"outDir": "out",
|
||||||
"lib": [
|
"lib": ["ES2022"],
|
||||||
"ES2022"
|
"types": ["node", "mocha", "vscode"],
|
||||||
],
|
|
||||||
"types": [
|
|
||||||
"node",
|
|
||||||
"mocha",
|
|
||||||
"vscode"
|
|
||||||
],
|
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"strict": true
|
"strict": true
|
||||||
|
|||||||
Reference in New Issue
Block a user