Skip to content

Commit

Permalink
Created
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Scheibling committed Oct 20, 2022
1 parent 089c457 commit 61fe21d
Show file tree
Hide file tree
Showing 15 changed files with 7,172 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
28 changes: 28 additions & 0 deletions .github/workflows/pack-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish Extension
on:
push:
branches: [ main ]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v2
- name: "Install Node.JS"
uses: actions/setup-node@v2
with:
node-version: 18.0.0
- name: "Run CI"
run: npm ci
- name: "Publish to VS Marketplace"
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VSM_PAT }}
registryUrl: https://marketplace.visualstudio.com
# Continue to publish to OVSX even if MS Publishing fails
continue-on-error: True
- name: "Publish to OpenVSX"
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.OVSX_PAT }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ dist

# TernJS port file
.tern-port

*.vsix
out/
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": {
"tsconfig": "tsconfig.json",
"type": "typescript"
}
}
]
}
37 changes: 37 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "build",
"problemMatcher": [
"$tsc"
],
"group": "none",
"label": "TypeScript: Watch - tsconfig.json"
},
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"problemMatcher": ["$tsc"],
"group": {
"kind": "build",
"isDefault": false
}
}
]
}
4 changes: 4 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Change Log

All notable changes to the "code-itop-tools" 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
63 changes: 61 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,61 @@
# code-itop-tools
VSCode tools for Combodo iTop
# code-itop-tools README
VSCode extension for combodo iTop. Includes snippets and various functions.

## Installation
Available at scheiblingco/code-itop-tools on VSCode Marketplace and OpenVSX.

## Usage
Install the package, press F1 or Ctrl + Shift + P and type iTop to see the commands. Before using the commands, you need to set an iTop URL in the settings (code-itop-tools.itop-url) or via the config file parser (code-itop-tools.getURLFromConfigFile).
Once done, you can use the commands below. The snippets are available from activation.

## Settings
The following settings are available to customize the plugin behaviour:
* `code-itop-tools.ignore-certificate-errors`: Ignore self-signed and invalid certificates when making requests
* `code-itop-tools.timeout`: Requests timeout in seconds
* `code-itop-tools.symlinks`: Enables/disables the use of symlinks for plugin PHP files
* `code-itop-tools.itop-url`: The URL for the iTop Instance, can be set manually or via code-itop-tools.getURLFromConfigFile command
* `code-itop-tools.toolkit-path`: The URL for the iTop Instance, can be set manually or via code-itop-tools.getURLFromConfigFile command

## Commands
|Command|Description|
|code-itop-tools.getURLFromConfigFile|Get the iTop URL from a configuration file (config-itop.php)|
|code-itop-tools.checkDatamodel|Check the datamodel against warnings and misconfigurations|
|code-itop-tools.applyCodeChanges|Apply changes made to extension code. If you want to customize symlink behaviour, do this under settings|
|code-itop-tools.applyAllChanges|Apply changes made toe extension code and data model changes. If you want to customize symlink behaviour, do this under settings|

## Snippets
|Snippet|Description|
|---|---|
|presitem|Creates a presentation list item (item#x>rank{y}|
|itopclass|Creates a class XML template|
|stringfield|Creates an AttributeString field|
|textfield|Creates an AttributeText field|
|enumfield|Creates an AttributeEnum field|
|boolfield|Creates an AttributeEnum field with true/false options|
|objectkey|Creates an AttributeObjectKey field|
|extkeyfield|Creates an AttributeExternalKey field|
|extfield|Creates an AttributeExternalField field|
|linksetfield|Creates an AttributeLinkedSet field|
|indirectlinksetfield|Creates an AttributeLinkedSetIndirect field|
|extkeyfield|Creates an AttributeExternalKey field|
|datefield|Creates an AttributeDate field|


## Known Issues/TODO
None yet, feel free to open a ticket if you find any.

TODO
- [ ] Add more snippets
- [ ] Comment and clean code
- [ ] Add more commands for various API actions/stimuli/queries
- [ ] Add tests and linting

## Release Notes
Release information

### 0.1.0
Initial release

- Snippets for XML file creation
- Functions for toolkit (validate datamodel, apply code changes, apply database changes)
- Config file parser for iTop URL
Binary file added images/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 61fe21d

Please sign in to comment.