Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
KamasamaK committed Mar 17, 2020
0 parents commit 558a52b
Show file tree
Hide file tree
Showing 38 changed files with 9,909 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/*
74 changes: 74 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
module.exports = {
"env": {
"es2017": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"plugins": [
"jsdoc",
"@typescript-eslint"
],
"rules": {
"curly": "error",
"eqeqeq": [
"error",
"always"
],
"indent": [
"error",
"tab"
],
"new-parens": "error",
"no-redeclare": "error",
"no-trailing-spaces": "error",
"no-unused-expressions": "warn",
"no-var": "error",
"prefer-arrow-callback": "error",
"prefer-const": "warn",
"quotes": [
"error",
"double",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"semi": [
"error",
"always"
],
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never"
}
],
"spaced-comment": "error",
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "error",
"jsdoc/newline-after-description": "error",
"jsdoc/check-param-names": "error",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/prefer-for-of": "error"
}
};
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.history/
.DS_Store
Thumbs.db
node_modules/
out/
dist/
*.vsix
npm-debug.log
4 changes: 4 additions & 0 deletions .markdownlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"MD013": false,
"MD024": { "siblings_only": true }
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"DavidAnson.vscode-markdownlint",
"eg2.vscode-npm-script",
"eamodio.tsl-problem-matcher"
]
}
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"smartStep": true,
"preLaunchTask": "npm: webpack-dev"
}
]
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"[markdown]": {
"files.trimTrailingWhitespace": false
},
"files.trimTrailingWhitespace": true,
"search.exclude": {
"dist": true,
"out": true
},
"typescript.tsc.autoDetect": "off",
"typescript.tsdk": "node_modules\\typescript\\lib"
}
35 changes: 35 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "webpack-dev",
"problemMatcher": "$ts-webpack-watch",
"isBackground": true,
"presentation": {
"reveal": "always",
"panel": "dedicated"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "test-compile",
"group": "build",
"problemMatcher": "$tsc",
"presentation": {
"reveal": "always",
"panel": "dedicated"
}
},
{
"type": "npm",
"script": "lint",
"group": "build",
"problemMatcher": ["$eslint-stylish"]
}
]
}
14 changes: 14 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.history/**
.markdownlintrc
.vscode/**
.vscode-test/**
node_modules/**
src/**
test/**
out/**
**/*.map
**/tsconfig.json
**/.gitignore
**/.eslintignore
**/.eslintrc.js
webpack.config.js
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## v1.0.0

* Initial release
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Ortus Solutions

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# VS Code CommandBox extension

Integrates [CommandBox](https://www.ortussolutions.com/products/commandbox) into VS Code. If you are new to CommandBox, check the [documentation](https://commandbox.ortusbooks.com/).

You are expected to have CommandBox installed on your system.

## Features

### Scripts

This extension supports running CommandBox scripts as [tasks](https://code.visualstudio.com/docs/editor/tasks). Scripts containing the name 'build', 'compile', or 'watch' are treated as build tasks. Any scripts defined in the `box.json` will be auto-detected by default and added as tasks. You can also annotate task definitions in your `tasks.json` files using the `type` as `commandbox` and `script` as the script name.

To run scripts as tasks, use the Task menu items or commands.

#### Script Explorer

The CommandBox Script Explorer shows the CommandBox scripts found in your workspace. The explorer view is enabled by the setting `commandbox.enableScriptExplorer`. A script can be opened or run from the explorer.

![CommandBox Scripts View](./images/commandbox-scripts-view.png)

#### Run Scripts from the Editor

The extension supports to run the selected script as a task when editing the `box.json` file. You can either run a script from the hover shown on a script or using the command `commandbox: Run Selected Script`.

![Box Script Hover](./images/box-script-hover.png)

#### Run Scripts from a Folder in the Explorer

The extension supports running a script as a task from a folder in the Explorer. The command `commandbox: Run Script in Folder...` shown in the Explorer context menu finds all scripts in `box.json` files that are contained in this folder. You can then select the script to be executed as a task from the resulting list. You enable this support with the `commandbox.runScriptFromFolder` which is `false` by default.

### Editing server.json

#### Schema

The extension ships with a schema for the `server.json` file to provide auto-completion and information on hover for standard properties. To ensure it is kept up-to-date without having to update the extension, the latest schema in the GitHub `master` is pulled when the extension is activated.

##### Property Completion

![Server Completion](./images/server-completion.png)

##### Property Hover

![Server Hover](./images/server-hover.png)

### Editing box.json

#### Schema

The extension ships with a schema for the `box.json` file to provide auto-completion and information on hover for standard properties. To ensure it is kept up-to-date without having to update the extension, the latest schema in the GitHub `master` is pulled when the extension is activated.

##### Property Completion

![Box Completion](./images/box-completion.png)

##### Property Hover

![Box Hover](./images/box-hover.png)

#### Dependencies

The extension also fetches data from ForgeBox to provide auto-completion and information on hover features on dependencies.

##### Slug Completion

![Dependency Slug Completion](./images/dependency-slug-completion.png)

##### Version Completion

![Dependency Version Completion](./images/dependency-version-completion.png)

##### Hover

![Dependency Hover](./images/dependency-hover.png)

## Settings

- `commandbox.autoDetect` - Enable detecting scripts as tasks. [*Default*: `on`]
- `commandbox.exclude` - Glob patterns for folders that should be excluded from automatic script detection. The pattern is matched against the **absolute path** of the `box.json`. For example, to exclude all test folders use '**/test/**'.
- `commandbox.enableScriptExplorer` - Enable an explorer view for CommandBox scripts when there is no top-level `box.json` file. [*Default*: `false`]
- `commandbox.enableRunFromFolder` - Enable running CommandBox scripts from the context menu of folders in Explorer. [*Default*: `false`]
- `commandbox.scriptExplorerAction` - The default click action: `open` or `run`. [*Default*: `open`]
- `commandbox.buildNames` - When a task contains this as part of its name, it will be assigned as a build task. [*Default*: `["build", "compile", "watch"]`]
- `commandbox.testNames` - When a task name starts with this, it will be assigned as a test task. [*Default*: `["test"]`]
- `commandbox.forgebox.fetchOnlinePackageInfo` - Fetch data from ForgeBox to provide auto-completion and information on hover features on dependencies. [*Default*: `true`]
- `commandbox.forgebox.endpointUrl` - The URL for the ForgeBox endpoint. Customize for ForgeBox Enterprise. [*Default*: `https://www.forgebox.io`]
Binary file added images/box-completion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/box-hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/box-script-hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/commandbox-128-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/commandbox-scripts-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/dependency-hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/dependency-slug-completion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/dependency-version-completion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/server-completion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/server-hover.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 558a52b

Please sign in to comment.