Compare commits
48 Commits
67070c82bc
...
1.1.10
Author | SHA1 | Date | |
---|---|---|---|
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 |
53
.drone.yml
Normal file
53
.drone.yml
Normal file
@ -0,0 +1,53 @@
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: node
|
||||
commands:
|
||||
- npm ci
|
||||
- vsce package
|
||||
|
||||
# - name: gitea_release
|
||||
# environment:
|
||||
# GITEA_TOKEN:
|
||||
# from_secret: gitea_token
|
||||
# commands:
|
||||
# - bash gitearelease.sh
|
||||
|
||||
- name: gitea_release
|
||||
image: plugins/gitea-release
|
||||
settings:
|
||||
base_url: https://gitea.raphaelpiccolo.com
|
||||
files: ./*.vsix
|
||||
api_key:
|
||||
from_secret: gitea_token
|
||||
|
||||
# - name: deploy
|
||||
# environment:
|
||||
# PASSWORD:
|
||||
# from_secret: password
|
||||
# when:
|
||||
# status:
|
||||
# - success
|
||||
# - failure
|
||||
# commands:
|
||||
# - |
|
||||
# curl --fail-with-body -s -X POST \
|
||||
# --data-urlencode "digest=$(docker inspect registry.raphaelpiccolo.com/$DRONE_REPO_NAME:latest | jq -r '.[0].RepoDigests[0]' | cut -d@ -f 2)" \
|
||||
# --data-urlencode "start=$DRONE_BUILD_CREATED" \
|
||||
# --data-urlencode "url=$DRONE_BUILD_LINK" \
|
||||
# --data-urlencode "buildNumber=$DRONE_BUILD_NUMBER" \
|
||||
# --data-urlencode "version=$DRONE_TAG" \
|
||||
# --data-urlencode "name=$DRONE_REPO_NAME" \
|
||||
# --data-urlencode "size=$(docker inspect -f '{{ .Size }}' "$DRONE_REPO_NAME")" \
|
||||
# --data-urlencode "status=$DRONE_BUILD_STATUS" \
|
||||
# "https://admin:$PASSWORD@monitoring.raphaelpiccolo.com/fr/dronehook"
|
||||
|
||||
# - name: test
|
||||
# commands:
|
||||
# - docker run --rm cvtest npm test
|
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
|
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
|
||||
|
39
gitearelease.sh
Normal file
39
gitearelease.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Variables
|
||||
# GITEA_TOKEN="xxxxxxxxxx"
|
||||
# DRONE_TAG="1.1.6"
|
||||
# DRONE_REPO_NAME="vscodestat"
|
||||
# DRONE_REPO_OWNER="root"
|
||||
GITEA_API_URL="https://gitea.raphaelpiccolo.com/api/v1"
|
||||
RELEASE_NAME="Release ${DRONE_TAG}"
|
||||
RELEASE_BODY="vscode extension generated"
|
||||
ARTIFACT_PATH="${DRONE_REPO_NAME}-${DRONE_TAG}.vsix"
|
||||
|
||||
# Create a release
|
||||
response=$(curl -s -X POST "${GITEA_API_URL}/repos/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/releases" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"tag_name\": \"${DRONE_TAG}\",
|
||||
\"name\": \"${RELEASE_NAME}\",
|
||||
\"body\": \"${RELEASE_BODY}\",
|
||||
\"draft\": false,
|
||||
\"prerelease\": false
|
||||
}")
|
||||
|
||||
# Extract release ID from the response
|
||||
release_id=$(echo $response | jq '.id')
|
||||
|
||||
if [ -z "$release_id" ]; then
|
||||
echo "Failed to create release"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Upload the artifact
|
||||
curl -s -X POST "${GITEA_API_URL}/repos/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/releases/${release_id}/assets?name=$(basename ${ARTIFACT_PATH})" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: $(file -b --mime-type ${ARTIFACT_PATH})" \
|
||||
--data-binary @"${ARTIFACT_PATH}"
|
||||
|
||||
echo "Artifact uploaded successfully."
|
1555
package-lock.json
generated
1555
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "vscodestat",
|
||||
"displayName": "vscodestat",
|
||||
"version": "1.0.3",
|
||||
"version": "1.1.10",
|
||||
"description": "",
|
||||
"categories": [
|
||||
"Other"
|
||||
@ -10,6 +10,8 @@
|
||||
"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 ./",
|
||||
@ -45,18 +47,26 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"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"
|
||||
"@types/mocha": "^10.0.7",
|
||||
"@types/node": "22.x",
|
||||
"@types/vscode": "^1.92.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.1.0",
|
||||
"@typescript-eslint/parser": "^8.1.0",
|
||||
"@vscode/test-cli": "^0.0.10",
|
||||
"@vscode/test-electron": "^2.4.1",
|
||||
"eslint": "^9.9.0",
|
||||
"typescript": "^5.5.4"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.87.0"
|
||||
}
|
||||
"vscode": "^1.92.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);
|
||||
|
||||
@ -69,8 +70,17 @@ export function deactivate() { }
|
||||
* => monitoringserver
|
||||
*/
|
||||
function extractProjectName(path: string) {
|
||||
const match = path.match(/\/root\/(docker|projects)\/([^/]+)/);
|
||||
return match?.[2];
|
||||
// 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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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