Compare commits
93 Commits
7f42bb0ebd
...
1.1.32
Author | SHA1 | Date | |
---|---|---|---|
89c1150c7d | |||
65a1db8157 | |||
c7bb134cff | |||
640ba2fbf5 | |||
c21ddcdd2e | |||
910c941222 | |||
6d6c56b87c | |||
96f27dadd7 | |||
0a380910dc | |||
98ab84e21f | |||
4cd0e6a1e3 | |||
27ef2b1e7f | |||
6b46502e81 | |||
cc8a946cd6 | |||
7580bcb90a | |||
07e384f98d | |||
5765b0e00b | |||
f6a8250db8 | |||
b94da7e56c | |||
b89a824004 | |||
b7845de2cb | |||
2f7b7645e3 | |||
6f4502389e | |||
636e769e56 | |||
d239610e81 | |||
e82de8da2a | |||
5232607549 | |||
1bacb3f46d | |||
6bf71399a3 | |||
4951107d89 | |||
5581e178a5 | |||
d688b9d34a | |||
dfe13b5ad5 | |||
eded025bd5 | |||
04ae797578 | |||
e38cf200b9 | |||
51d0d54771 | |||
664740860b | |||
8440fd8275 | |||
084e4239b4 | |||
9f0c85e8d3 | |||
66ea0ee96d | |||
5489463885 | |||
cf1eca0e5c | |||
5a28602203 | |||
9b3cd8cbcc | |||
b7608be252 | |||
4235fd7961 | |||
2f359da27a | |||
8340c1b4f2 | |||
e17c9bc287 | |||
1f31f43497 | |||
1c8c95191e | |||
497054d911 | |||
55ef37fab8 | |||
e266af9370 | |||
4925404e04 | |||
ea16544636 | |||
91b0d32b8a | |||
bc759c3deb | |||
a9a886cbc8 | |||
5f2724bdd1 | |||
a767d334a0 | |||
c315eecc46 | |||
e0ad27be04 | |||
7f480b480f | |||
cf85a5ad24 | |||
b78d041c42 | |||
b07a29c868 | |||
5ccb93835d | |||
73b9536109 | |||
b321e19d2d | |||
88757a4bb3 | |||
da188d6c92 | |||
0a55a5bbdc | |||
74d298bc8a | |||
e946dfe08a | |||
75ca1feeae | |||
8458af9ffd | |||
342e56b860 | |||
4fd01c314f | |||
e501c0aea1 | |||
4afb410e11 | |||
1e2148a1bb | |||
52bae9f401 | |||
d131041873 | |||
71d54d5e90 | |||
6fe024eddd | |||
0b619beb75 | |||
d91474f3da | |||
d8730da20f | |||
67070c82bc | |||
44d71cc184 |
22
.drone.yml
Normal file
22
.drone.yml
Normal file
@ -0,0 +1,22 @@
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: node
|
||||
commands:
|
||||
- npm install -g vsce
|
||||
- npm ci
|
||||
- vsce package
|
||||
|
||||
- name: gitea_release
|
||||
image: plugins/gitea-release
|
||||
settings:
|
||||
base_url: https://gitea.data.raphaelpiccolo.com
|
||||
files: ./*.vsix
|
||||
api_key:
|
||||
from_secret: gitea_token
|
27
.gitignore
vendored
27
.gitignore
vendored
@ -3,3 +3,30 @@ dist
|
||||
node_modules
|
||||
.vscode-test/
|
||||
*.vsix
|
||||
/core
|
||||
*~
|
||||
\#*#
|
||||
node_modules/
|
||||
log/
|
||||
logs/
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.env*
|
||||
Thumbs.db
|
||||
.DS_Store
|
||||
.npm
|
||||
.vscode*
|
||||
*.pem
|
||||
*.p12
|
||||
*.p8
|
||||
*.key
|
||||
.vercel
|
||||
.composer/
|
||||
.php-cs-fixer.cache
|
||||
coverage/
|
||||
.cache/
|
||||
.local/
|
||||
.config/
|
||||
data/
|
||||
|
@ -1,9 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to the "vscodestat" extension will be documented in this file.
|
||||
|
||||
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- Initial release
|
1
LICENSE.md
Normal file
1
LICENSE.md
Normal file
@ -0,0 +1 @@
|
||||
soak
|
58
README.md
58
README.md
@ -9,60 +9,10 @@ it can track :
|
||||
- file saving
|
||||
- window focus
|
||||
|
||||
## Requirements
|
||||
|
||||
nothing particular
|
||||
|
||||
## Extension Settings
|
||||
|
||||
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
|
||||
* `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
|
||||
|
||||
For example:
|
||||
|
||||
This extension contributes the following settings:
|
||||
|
||||
* `myExtension.enable`: Enable/disable this extension.
|
||||
* `myExtension.thing`: Set to `blah` to do something.
|
||||
|
||||
## Known Issues
|
||||
|
||||
Calling out known issues can help limit users opening duplicate issues against your extension.
|
||||
|
||||
## Release Notes
|
||||
|
||||
Users appreciate release notes as you update your extension.
|
||||
|
||||
### 1.0.0
|
||||
|
||||
Initial release of ...
|
||||
|
||||
### 1.0.1
|
||||
|
||||
Fixed issue #.
|
||||
|
||||
### 1.1.0
|
||||
|
||||
Added features X, Y, and Z.
|
||||
|
||||
---
|
||||
|
||||
## Following extension guidelines
|
||||
|
||||
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
|
||||
|
||||
* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)
|
||||
|
||||
## Working with Markdown
|
||||
|
||||
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
|
||||
|
||||
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux).
|
||||
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux).
|
||||
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets.
|
||||
|
||||
## For more information
|
||||
|
||||
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
|
||||
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
|
||||
|
||||
**Enjoy!**
|
||||
Sample url : https://xxxxxx/vscodestat?userName=raf
|
||||
|
6495
package-lock.json
generated
6495
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
125
package.json
125
package.json
@ -1,61 +1,72 @@
|
||||
{
|
||||
"name": "vscodestat",
|
||||
"displayName": "vscodestat",
|
||||
"version": "1.0.3",
|
||||
"description": "",
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"main": "./out/extension.js",
|
||||
"scripts": {
|
||||
"compile": "tsc -p ./",
|
||||
"lint": "eslint src --ext ts",
|
||||
"pretest": "npm run compile && npm run lint",
|
||||
"test": "vscode-test",
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"watch": "tsc -watch -p ./"
|
||||
},
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "vscodestat.helloWorld",
|
||||
"title": "Hello World"
|
||||
},
|
||||
{
|
||||
"command": "vscodestat.setUrl",
|
||||
"title": "setUrl"
|
||||
},
|
||||
{
|
||||
"command": "vscodestat.callUrl",
|
||||
"title": "callUrl"
|
||||
}
|
||||
"name": "vscodestat",
|
||||
"displayName": "vscodestat",
|
||||
"version": "1.1.32",
|
||||
"description": "",
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"configuration": {
|
||||
"title": "vscodestat",
|
||||
"properties": {
|
||||
"vscodestat.url": {
|
||||
"type": "string",
|
||||
"default": "https://example.com",
|
||||
"description": "Specifies the url of the server to store the events"
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@gitea.raphaelpiccolo.com:10022/root/vscodestat.git"
|
||||
},
|
||||
"license": "ISC",
|
||||
"author": "Raphael Piccolo",
|
||||
"main": "./out/extension.js",
|
||||
"scripts": {
|
||||
"compile": "tsc -p ./",
|
||||
"lint": "eslint src --ext ts",
|
||||
"pretest": "npm run compile && npm run lint",
|
||||
"test": "vscode-test",
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"watch": "tsc -watch -p ./"
|
||||
},
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "vscodestat.helloWorld",
|
||||
"title": "Hello World"
|
||||
},
|
||||
{
|
||||
"command": "vscodestat.setUrl",
|
||||
"title": "setUrl"
|
||||
},
|
||||
{
|
||||
"command": "vscodestat.callUrl",
|
||||
"title": "callUrl"
|
||||
}
|
||||
],
|
||||
"configuration": {
|
||||
"title": "vscodestat",
|
||||
"properties": {
|
||||
"vscodestat.url": {
|
||||
"type": "string",
|
||||
"default": "https://example.com",
|
||||
"description": "Specifies the url of the server to store the events"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"activationEvents": [
|
||||
"onStartupFinished"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^10.0.6",
|
||||
"@types/node": "20.x",
|
||||
"@types/vscode": "^1.87.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
||||
"@typescript-eslint/parser": "^7.5.0",
|
||||
"@vscode/test-cli": "^0.0.9",
|
||||
"@vscode/test-electron": "^2.3.9",
|
||||
"eslint": "^8.57.0",
|
||||
"typescript": "^5.4.3"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.87.0"
|
||||
}
|
||||
},
|
||||
"activationEvents": [
|
||||
"onStartupFinished"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^10.0.9",
|
||||
"@types/node": "22.x",
|
||||
"@types/vscode": "^1.94.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.9.0",
|
||||
"@typescript-eslint/parser": "^8.9.0",
|
||||
"@vscode/test-cli": "^0.0.10",
|
||||
"@vscode/test-electron": "^2.4.1",
|
||||
"eslint": "^9.12.0",
|
||||
"typescript": "^5.6.3"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.94.0"
|
||||
},
|
||||
"icon": "icon.png",
|
||||
"extensionKind": [
|
||||
"ui",
|
||||
"workspace"
|
||||
]
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
let disposable2 = vscode.commands.registerCommand('vscodestat.setUrl', async () => {
|
||||
const url = await vscode.window.showInputBox({
|
||||
prompt: 'Enter the URL:',
|
||||
placeHolder: 'https://example.com'
|
||||
placeHolder: ''
|
||||
});
|
||||
|
||||
if (url) {
|
||||
@ -31,6 +31,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
return;
|
||||
}
|
||||
await makeHttpRequest({ event: 'ping'});
|
||||
vscode.window.showInformationMessage('callUrl done');
|
||||
});
|
||||
context.subscriptions.push(disposable3);
|
||||
|
||||
@ -40,7 +41,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
const filePath = editor.document.fileName;
|
||||
console.log('Opened file:', filePath);
|
||||
|
||||
vscode.window.showInformationMessage(`Opened file: ${filePath}`);
|
||||
// vscode.window.showInformationMessage(`Opened file: ${filePath}`);
|
||||
await makeHttpRequest({ event: 'open', project: extractProjectName(filePath) });
|
||||
}
|
||||
});
|
||||
@ -50,7 +51,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
const filePath = document.fileName;
|
||||
console.log('Saved file:', filePath);
|
||||
|
||||
vscode.window.showInformationMessage(`Saved file: ${filePath}`);
|
||||
// vscode.window.showInformationMessage(`Saved file: ${filePath}`);
|
||||
await makeHttpRequest({ event: 'save', project: extractProjectName(filePath) });
|
||||
});
|
||||
|
||||
@ -69,8 +70,17 @@ export function deactivate() { }
|
||||
* => monitoringserver
|
||||
*/
|
||||
function extractProjectName(path: string) {
|
||||
const match = path.match(/\/root\/(docker|projects)\/([^/]+)/);
|
||||
return match?.[1];
|
||||
// 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];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -83,7 +93,7 @@ async function makeHttpRequest(json: Object) {
|
||||
return;
|
||||
}
|
||||
|
||||
vscode.window.showInformationMessage('Calling URL: ' + url);
|
||||
// vscode.window.showInformationMessage('Calling URL: ' + url);
|
||||
const rawResponse = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@ -95,9 +105,9 @@ async function makeHttpRequest(json: Object) {
|
||||
const content = await rawResponse.json();
|
||||
|
||||
console.log(content);
|
||||
vscode.window.showInformationMessage('HTTP request successful.');
|
||||
// vscode.window.showInformationMessage('HTTP request successful.');
|
||||
} catch (error:any) {
|
||||
console.error('Error making HTTP request:', error);
|
||||
vscode.window.showErrorMessage('Error making HTTP request: ' + error.message);
|
||||
// vscode.window.showErrorMessage('Error making HTTP request: ' + error.message);
|
||||
}
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
# Welcome to your VS Code Extension
|
||||
|
||||
## What's in the folder
|
||||
|
||||
* This folder contains all of the files necessary for your extension.
|
||||
* `package.json` - this is the manifest file in which you declare your extension and command.
|
||||
* The sample plugin registers a command and defines its title and command name. With this information VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.
|
||||
* `src/extension.ts` - this is the main file where you will provide the implementation of your command.
|
||||
* The file exports one function, `activate`, which is called the very first time your extension is activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
|
||||
* We pass the function containing the implementation of the command as the second parameter to `registerCommand`.
|
||||
|
||||
## Get up and running straight away
|
||||
|
||||
* Press `F5` to open a new window with your extension loaded.
|
||||
* Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`.
|
||||
* Set breakpoints in your code inside `src/extension.ts` to debug your extension.
|
||||
* Find output from your extension in the debug console.
|
||||
|
||||
## Make changes
|
||||
|
||||
* You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`.
|
||||
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
|
||||
|
||||
## Explore the API
|
||||
|
||||
* You can open the full set of our API when you open the file `node_modules/@types/vscode/index.d.ts`.
|
||||
|
||||
## Run tests
|
||||
|
||||
* Install the [Extension Test Runner](https://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner)
|
||||
* Run the "watch" task via the **Tasks: Run Task** command. Make sure this is running, or tests might not be discovered.
|
||||
* Open the Testing view from the activity bar and click the Run Test" button, or use the hotkey `Ctrl/Cmd + ; A`
|
||||
* See the output of the test result in the Test Results view.
|
||||
* Make changes to `src/test/extension.test.ts` or create new test files inside the `test` folder.
|
||||
* The provided test runner will only consider files matching the name pattern `**.test.ts`.
|
||||
* You can create folders inside the `test` folder to structure your tests any way you want.
|
||||
|
||||
## Go further
|
||||
|
||||
* [Follow UX guidelines](https://code.visualstudio.com/api/ux-guidelines/overview) to create extensions that seamlessly integrate with VS Code's native interface and patterns.
|
||||
* Reduce the extension size and improve the startup time by [bundling your extension](https://code.visualstudio.com/api/working-with-extensions/bundling-extension).
|
||||
* [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VS Code extension marketplace.
|
||||
* Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).
|
Reference in New Issue
Block a user