Skip to content

Commit

Permalink
chore: setup Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
abdonrd authored and starpit committed Jul 3, 2019
1 parent ad31f29 commit 4109986
Show file tree
Hide file tree
Showing 616 changed files with 47,357 additions and 33,503 deletions.
64 changes: 35 additions & 29 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,50 @@
"extends": [
"standard",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/standard",
"prettier/@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"plugins": ["@typescript-eslint"],
"rules": {
"no-undef": "off",
"@typescript-eslint/camelcase": ["error", {
"allow": [
"wrap_line_length",
"indent_size",
"api_key",
"apigw_token",
"apigw_space_guid",
"ignore_certs",
"__cloudshell_decorations",
"follow_max",
"open_timeout",
"read_timeout",
"get_activation",
"action_body",
"rule_body",
"invoke_options",
"invoke_params",
"convert_to_fqn"
]
}],
"@typescript-eslint/camelcase": [
"error",
{
"allow": [
"wrap_line_length",
"indent_size",
"api_key",
"apigw_token",
"apigw_space_guid",
"ignore_certs",
"__cloudshell_decorations",
"follow_max",
"open_timeout",
"read_timeout",
"get_activation",
"action_body",
"rule_body",
"invoke_options",
"invoke_params",
"convert_to_fqn"
]
}
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/member-delimiter-style": ["error", {
"multiline": {
"delimiter": "none"
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "none"
}
}
}]
]
}
}
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build/
node_modules/
*.d.ts
package-lock.json
plugins/plugin-apache-composer/tests/data/composer/composer-source-expect-errors/if-bad.js
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}
4 changes: 1 addition & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"recommendations": [
"dbaeumer.vscode-eslint"
],
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
"unwantedRecommendations": []
}
20 changes: 11 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ This page contains information about reporting issues, how to suggest changes
as well as the guidelines we follow for how our documents are formatted.

## Table of Contents
* [Reporting an Issue](#reporting-an-issue)
* [Suggesting a Change](#suggesting-a-change)
* [Spec Formatting Conventions](#spec-formatting-conventions)

- [Reporting an Issue](#reporting-an-issue)
- [Suggesting a Change](#suggesting-a-change)
- [Spec Formatting Conventions](#spec-formatting-conventions)

## Reporting an Issue

Expand Down Expand Up @@ -42,9 +43,9 @@ This project uses [Conventional Commits](https://www.conventionalcommits.org) as
type(component?): message
```

*type* is one of: feat, fix, docs, chore, style, refactor, perf, test
_type_ is one of: feat, fix, docs, chore, style, refactor, perf, test

*component* optionally is the name of the module you are fixing; either "core" or a named module in `plugins/` directory. Note: Please specify the full name of the module (e.g. plugin-bash-like) instead of abbreviation. It helps us generate the correct CHANGELOG.md.
_component_ optionally is the name of the module you are fixing; either "core" or a named module in `plugins/` directory. Note: Please specify the full name of the module (e.g. plugin-bash-like) instead of abbreviation. It helps us generate the correct CHANGELOG.md.

#### Sign your work

Expand Down Expand Up @@ -102,7 +103,7 @@ If you set your `user.name` and `user.email` git configs, you can sign your
commit automatically with `git commit -s`.

Note: If your git config information is set properly then viewing the
`git log` information for your commit will look something like this:
`git log` information for your commit will look something like this:

```
Author: Joe Smith <[email protected]>
Expand All @@ -119,6 +120,7 @@ your PR will be rejected by the automated DCO check.
## Spec Formatting Conventions

Documents in this repository will adhere to the following rules:
* Lines are wrapped at 80 columns (when possible)
* Specifications will use [RFC2119](https://tools.ietf.org/html/rfc2119)
keywords to indicate normative requirements

- Lines are wrapped at 80 columns (when possible)
- Specifications will use [RFC2119](https://tools.ietf.org/html/rfc2119)
keywords to indicate normative requirements
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ complex menu structures.
For example, to see a visual summary of your Kubernetes pods, issue
this command from your favorite terminal:

|Example Command|Thumbnail of Output|
|:--------------------------|:------------------------------|
|`kubectl kui get pods --ui`|[![](docs/readme/images/kubectl-get-pods-thumbnail.jpg)](docs/readme/images/kubectl-get-pods.png)|
| Example Command | Thumbnail of Output |
| :-------------------------- | :------------------------------------------------------------------------------------------------ |
| `kubectl kui get pods --ui` | [![](docs/readme/images/kubectl-get-pods-thumbnail.jpg)](docs/readme/images/kubectl-get-pods.png) |

Without the `--ui` option, Kui will display the output in your
terminal directly; you will observe that the output is identical to
Expand Down
26 changes: 13 additions & 13 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand Down
27 changes: 16 additions & 11 deletions docs/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ concerned. Otherwise, consult the [Kui installation
guide](../installation.md) for more information on setting up
credentials.

- [Coding Strategy](#coding-strategy)
- [Packaging](packaging.md)
- [Running Tests](#local-testing)
- [Live Webpack Development](live-webpack-development.md)
- [Coding Strategy](#coding-strategy)
- [Packaging](packaging.md)
- [Running Tests](#local-testing)
- [Live Webpack Development](live-webpack-development.md)

## Coding Strategy

Expand Down Expand Up @@ -54,7 +54,7 @@ from edit to use, is usually on the order of a few seconds.
There are several cases where a simple reload will not suffice to
realize your changes.

1. **Adding new commands** For efficiency, Kui relies on a
1. **Adding new commands** For efficiency, Kui relies on a
precompiled model of the command tree. This allows Kui to load
plugin code lazily. If you add a new command, or move a command
from one plugin to another, you must therefore recompile the
Expand All @@ -64,15 +64,15 @@ realize your changes.
> npm run compile
```

2. **Changing code in the main process** Electron applications
2. **Changing code in the main process** Electron applications
consist of two groups of processes: the renderer processes
(e.g. one per window, web view, web worker, etc.), and the "main"
or server-side processes. The javascript code under the
`packages/app/src/main` directory (e.g. `main.js` and `headless.js`) are
run in the main/server process. Thus, changes to these files
require a full quit and relaunch of the Electron application.

3. **Changing the HTML templates** Changes to files under the
3. **Changing the HTML templates** Changes to files under the
`packages/app/templates/` directory, such as `packages/app/templates/index.html` require a
rebuild, accomplished via

Expand All @@ -83,15 +83,20 @@ realize your changes.
## Local Testing

### Setup:
* To install Kubernetes on your local machine, consult the official [Kubernetes Local Machine Solutions](https://kubernetes.io/docs/setup/pick-right-solution/#local-machine-solutions) .

- To install Kubernetes on your local machine, consult the official [Kubernetes Local Machine Solutions](https://kubernetes.io/docs/setup/pick-right-solution/#local-machine-solutions) .

### Testing:
* Go to the root of the project folder
* Run all the test suites

- Go to the root of the project folder
- Run all the test suites

```bash
> npm test
```
* Filter test execution

- Filter test execution

```bash
> TEST_FILTER='About command' npm test # Only run test suites containing 'About command' in suite titles
```
29 changes: 14 additions & 15 deletions docs/dev/customization-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ npm install --save @kui-shell/core
npx kui-init
```

You may mix in additional Kui plugins by adding more `npm install
--save` lines. For example, a useful plugin is
You may mix in additional Kui plugins by adding more `npm install --save` lines. For example, a useful plugin is
`@kui-shell/core-support` which adds the help system and the
screenshot capability to the electron builds. You now should have a
directory structure such as shown above.
Expand Down Expand Up @@ -82,22 +81,22 @@ hello world
## Theming

In `theme.json, you may specify overrides of the [default
theme](../../clients/default/theme/theme.json). For example, this
[example
theme](../../packages/kui-builder/examples/build-configs/material-design/theme.json)
changes the product name to "Kui Fun Shell", and changes the UI
theme to use a [material design](https://material.io/) color
scheme.
theme](../../clients/default/theme/theme.json). For example, this
[example
theme](../../packages/kui-builder/examples/build-configs/material-design/theme.json)
changes the product name to "Kui Fun Shell", and changes the UI
theme to use a [material design](https://material.io/) color
scheme.

## Injecting Build-time Values

Via a `config.json`, you have the opportunity to inject
configuration options into your plugin code. Using the
[example config injection](../../packages/kui-builder/examples/build-configs/material-design/config.json) as an example,
you would access that example configuration setting via:
```typescript
import { config } from '@kui-shell/core/core/settings'
configuration options into your plugin code. Using the
[example config injection](../../packages/kui-builder/examples/build-configs/material-design/config.json) as an example,
you would access that example configuration setting via:

if (config['disableProxy']) { ... }
```
```typescript
import { config } from '@kui-shell/core/core/settings'

if (config['disableProxy']) { ... }
```
12 changes: 8 additions & 4 deletions docs/dev/packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Beyond local development of Kui, you may want to package and
distribute Kui to others. The code base currently supports three
packaging modes:

- [Headless](#headless-packaging) &mdash; making a lightweight headless release
- [Electron](#electron-packaging) &mdash; building an Electron client app
- [Browser](#browser-packaging) &mdash; building for the browser, using [webpack](https://webpack.js.org/)
- [Headless](#headless-packaging) &mdash; making a lightweight headless release
- [Electron](#electron-packaging) &mdash; building an Electron client app
- [Browser](#browser-packaging) &mdash; building for the browser, using [webpack](https://webpack.js.org/)

## Headless packaging

Expand Down Expand Up @@ -45,26 +45,29 @@ To build for use in a browser, Kui uses
[webpack](https://webpack.js.org/).

Option A) Build webpack with [proxy support](../../packages/proxy/doc/proxy-architecture.pdf).

```bash
> cd clients/default # or: cd clients/[your-customized-client]
> npm run build:proxy
> npm run build:webpack # including proxy-related support by default
> ls dist/webpack
... lots of *.bundle.js.br files ...
```

Option B) Build webpack without proxy support

```bash
> cd clients/default # or: cd clients/[your-customized-client]
> KUI_USE_PROXY=false npm run build:webpack
> ls dist/webpack
... lots of *.bundle.js.br files ...
```

The first time you do so, you will be asked to set up a local https
certificate. You should see the normal openssl series of prompts; make
sure that you provide at least one non-empty answer to the self-signed
certificate prompts, otherwise it will fail in odd ways.


After you have built the webpack bundles, you can test them out
locally:

Expand All @@ -76,4 +79,5 @@ https://localhost:9080
```

## Internal Details

See: [Internal Development Details](../../packages/kui-builder/README.md).
Loading

0 comments on commit 4109986

Please sign in to comment.