Skip to content

Commit 2b022bc

Browse files
committed
vscode-extension - migrating vscode-extension from ocm-io org to lab repo
Signed-off-by: Mike Ng <ming@redhat.com>
1 parent 1eb166c commit 2b022bc

File tree

128 files changed

+28864
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+28864
-0
lines changed

vscode-extension/.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
indent_size = 4
9+
indent_style = tab
10+
max_line_length = 100
11+
12+
[**.{yaml,yml}]
13+
indent_size = 2
14+
indent_style = space
15+
16+
[**.md]
17+
indent_size = 2
18+
indent_style = space
19+
max_line_length = 120

vscode-extension/.eslintrc.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"root": true,
3+
"extends": "eslint:recommended",
4+
"parser": "@typescript-eslint/parser",
5+
"parserOptions": {
6+
"project": "./tsconfig.json"
7+
},
8+
"plugins": [
9+
"@typescript-eslint"
10+
],
11+
"rules": {
12+
"@typescript-eslint/adjacent-overload-signatures": "error",
13+
"@typescript-eslint/await-thenable": "error",
14+
//"@typescript-eslint/ban-ts-comment": "warn",
15+
"@typescript-eslint/no-empty-interface": "error",
16+
"@typescript-eslint/no-extra-non-null-assertion": "error",
17+
"@typescript-eslint/no-for-in-array": "error",
18+
"@typescript-eslint/no-misused-new": "error",
19+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
20+
"@typescript-eslint/no-non-null-assertion": "warn",
21+
"@typescript-eslint/no-this-alias": "error",
22+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
23+
"@typescript-eslint/no-unnecessary-type-constraint": "error",
24+
"@typescript-eslint/no-var-requires": "error",
25+
"@typescript-eslint/prefer-as-const": "error",
26+
"@typescript-eslint/prefer-namespace-keyword": "error",
27+
"@typescript-eslint/restrict-plus-operands": "error",
28+
"@typescript-eslint/restrict-template-expressions": "error",
29+
"@typescript-eslint/triple-slash-reference": "error",
30+
"@typescript-eslint/unbound-method": "error",
31+
"@typescript-eslint/explicit-function-return-type": "warn",
32+
"@typescript-eslint/naming-convention": "warn",
33+
"@typescript-eslint/semi": "warn",
34+
"curly": "warn",
35+
"eqeqeq": "warn",
36+
"no-async-promise-executor": "off",
37+
"no-throw-literal": "warn",
38+
"no-undef":"off",
39+
"no-unused-vars": "off",
40+
"sort-imports":"warn"
41+
},
42+
"ignorePatterns": [
43+
"out",
44+
"dist",
45+
"**/*.d.ts"
46+
]
47+
}

vscode-extension/.gitattributes

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Normalize text files (crlf -> lf)
2+
#* text=auto
3+
# Language specific
4+
*.py text eol=crlf diff=python
5+
*.pyc text eol=crlf diff=python
6+
*.cs text eol=crlf diff=csharp
7+
*.java text eol=lf diff=java
8+
*.groovy text eol=crlf diff=java
9+
*.proto text eol=crlf diff=text
10+
# Documents
11+
*.csv text eol=crlf
12+
*.doc text eol=crlf diff=text
13+
*.docx text eol=crlf diff=text
14+
*.pdf text eol=crlf diff=text
15+
*.rtf text eol=crlf diff=text
16+
# Documentation
17+
*.markdown text eol=lf
18+
*.md text eol=lf
19+
*.mdtxt text eol=lf
20+
*.mdtext text eol=lf
21+
*.txt text eol=lf
22+
*.rst text eol=lf
23+
CHANGELOG text eol=lf
24+
CONTRIBUTING text eol=lf
25+
*COPYRIGHT* text eol=lf
26+
LICENSE text eol=lf
27+
*README* text eol=lf
28+
# Configs
29+
*.cnf text eol=lf
30+
*.conf text eol=crlf
31+
*.config text eol=lf
32+
*.lock binary
33+
*.npmignore text eol=lf
34+
*.properties text eol=lf
35+
*.toml text eol=lf
36+
*.yaml text eol=lf
37+
*.yml text eol=lf
38+
.editorconfig text eol=lf
39+
.env text eol=lf
40+
package-lock.json binary
41+
Makefile text eol=lf
42+
makefile text eol=lf
43+
# Graphics
44+
*.bmp binary
45+
*.gif binary
46+
*.gifv binary
47+
*.jpg binary
48+
*.jpeg binary
49+
*.ico binary
50+
*.png binary
51+
*.svg text eol=lf
52+
*.svgz binary
53+
*.tif binary
54+
*.tiff binary
55+
*.wbmp binary
56+
*.webp binary
57+
# Scripts
58+
*.bash text eol=lf
59+
*.sh text eol=lf
60+
*.sql text eol=lf
61+
# Windows
62+
*.bat text eol=crlf
63+
*.cmd text eol=crlf
64+
*.ps1 text eol=crlf
65+
# Docker
66+
*.dockerignore text eol=lf
67+
*-dockerignore text eol=lf
68+
Dockerfile text eol=lf
69+
Dockerfile* text eol=lf
70+
# Git
71+
*.gitattributes text eol=lf
72+
.gitignore text eol=lf
73+
.gitmodules text eol=rf
74+
# Web files
75+
*.coffee text eol=lf
76+
*.css text eol=lf diff=css
77+
*.htm text eol=lf diff=html
78+
*.html text eol=lf diff=html
79+
*.ini text eol=crlf
80+
*.js text eol=lf
81+
*.json text eol=lf
82+
*.jsp text eol=lf
83+
*.jspf text eol=lf
84+
*.jspx text eol=lf
85+
*.jsx text eol=lf
86+
*.less text eol=lf
87+
*.ls text eol=lf
88+
*.map binary
89+
*.php text eol=lf diff=php
90+
*.scss text eol=lf diff=css
91+
*.xml text eol=lf
92+
*.xhtml text eol=lf diff=html
93+
# Binary files
94+
*.class binary
95+
*.ear binary
96+
*.so binary
97+
*.war binary
98+
*.db binary
99+
*.p binary
100+
*.pkl binary
101+
*.pickle binary
102+
*.pyc binary
103+
*.pyd binary
104+
*.pyo binary
105+
# Visual studio specific
106+
*.sln text eol=crlf
107+
*.csproj text eol=crlf
108+
*.vbproj text eol=crlf
109+
*.vcxproj text eol=crlf
110+
*.vcproj text eol=crlf
111+
*.dbproj text eol=crlf
112+
*.fsproj text eol=crlf
113+
*.lsproj text eol=crlf
114+
*.wixproj text eol=crlf
115+
*.modelproj text eol=crlf
116+
*.sqlproj text eol=crlf
117+
*.wmaproj text eol=crlf
118+
*.xproj text eol=crlf
119+
*.props text eol=crlf
120+
*.filters text eol=crlf
121+
*.vcxitems text eol=crlf
122+
123+
# Git lfs
124+
# *.exe filter=lfs diff=lfs merge=lfs -text
125+
# *.jar filter=lfs diff=lfs merge=lfs -text
126+
# *.jar filter=lfs diff=lfs merge=lfs -binary
127+
# *.dll filter=lfs diff=lfs merge=lfs -text
128+
# *.7z filter=lfs diff=lfs merge=lfs -text
129+
# *.gz filter=lfs diff=lfs merge=lfs -text
130+
# *.tar filter=lfs diff=lfs merge=lfs -text
131+
# *.zip filter=lfs diff=lfs merge=lfs -text

vscode-extension/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
.nyc_output
3+
.vscode-test
4+
coverage
5+
node_modules
6+
build
7+
out
8+
# note the order of the next test-workspace records
9+
test/test-workspace/*
10+
!test/test-workspace/.gitkeep
11+
**/*.vsix

vscode-extension/.vscodeignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.git/**
2+
.github/**
3+
.nyc_output/**
4+
.vscode/**
5+
.vscode-test/**
6+
coverage/**
7+
images/**
8+
src/**
9+
test/**
10+
out/test/**
11+
.editorconfig
12+
.eslintrc.json
13+
.gitattributes
14+
.gitignore
15+
.vscodeignore
16+
CODE_OF_CONDUCT.md
17+
CONTRIBUTING.md
18+
DCO
19+
OWNERS
20+
SECURITY.md
21+
tsconfig.json
22+
**/*.ts
23+
**/*.tsx
24+
**/*.vsix
25+
webview-ui
26+
!images/icon.png
27+
!images/dark/**
28+
!images/light/**
29+
!webview-ui/build
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Refer to our [Open Cluster Management Community Code of Conduct](https://github.com/open-cluster-management-io/community/blob/main/CODE_OF_CONDUCT.md)

vscode-extension/CONTRIBUTING.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
<!-- markdownlint-disable MD041 -->
2+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
3+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
4+
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
5+
6+
- [Contributing guidelines](#contributing-guidelines)
7+
- [Contributions](#contributions)
8+
- [Certificate of Origin](#certificate-of-origin)
9+
- [Contributing A Patch](#contributing-a-patch)
10+
- [Issue and Pull Request Management](#issue-and-pull-request-management)
11+
- [Development](#development)
12+
- [Early Access](#early-access)
13+
- [Useful Links](#useful-links)
14+
- [Environment Preparations](#environment-preparations)
15+
- [Project Layout](#project-layout)
16+
- [NPM Scripts](#npm-scripts)
17+
- [Launch Configurations](#launch-configurations)
18+
19+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
20+
21+
# Contributing guidelines
22+
23+
## Contributions
24+
25+
All contributions to the repository must be submitted under the terms of the [Apache Public License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
26+
27+
## Certificate of Origin
28+
29+
By contributing to this project you agree to the Developer Certificate of
30+
Origin (DCO). This document was created by the Linux Kernel community and is a
31+
simple statement that you, as a contributor, have the legal right to make the
32+
contribution. See the [DCO](DCO) file for details.
33+
34+
## Contributing A Patch
35+
36+
1. Submit an issue describing your proposed change to the repo in question.
37+
2. The [repo owners](OWNERS) will respond to your issue promptly.
38+
3. Fork the desired repo, develop and test your code changes.
39+
4. Submit a pull request.
40+
41+
## Issue and Pull Request Management
42+
43+
Anyone may comment on issues and submit reviews for pull requests. However, in
44+
order to be assigned an issue or pull request, you must be a member of the
45+
[open-cluster-management](https://github.com/open-cluster-management-io) GitHub organization.
46+
47+
Repo maintainers can assign you an issue or pull request by leaving a
48+
`/assign <your Github ID>` comment on the issue or pull request.
49+
50+
## Development
51+
52+
### Early Access
53+
54+
Early-access pre-release is available [here][early-access] and will always reflect the current development snapshot from the *main* branch.
55+
56+
### Useful Links
57+
58+
- [VSCode API Documentation][vscode-ext-api]
59+
- [VSCode API References][vscode-api-ref]
60+
61+
### Environment Preparations
62+
63+
All you need is [VSCode][vscode] and [NodeJS][nodejs].
64+
65+
### Project Layout
66+
67+
- [src][repo-src] contains the source code for the extension.
68+
- [test][repo-test] contains the sources for the unit tests.
69+
- [snippets][repo-snippets] contains the snippets offered by the extension.
70+
- [templates][repo-templates] contains template files for orchestrating new projects.
71+
- [images][repo-images] contains various images used throughout the project.
72+
- [webview-ui][repo-webview-ui] contains the sources for *react* module providing the *web view*.
73+
74+
### NPM Scripts
75+
76+
Install module dependencies:
77+
78+
```bash
79+
npm i
80+
```
81+
82+
Lint the project with *eslint*:
83+
84+
```bash
85+
npm run lint
86+
```
87+
88+
Test the project (sandbox tests):
89+
90+
```bash
91+
npm test
92+
```
93+
94+
Test the project skipping "slow" tests (sandbox tests):
95+
> New "slow" tests should include `@slow` in their description.
96+
97+
```bash
98+
npm run test:quick
99+
```
100+
101+
Print and verify coverage ratio (requires tests to be executed first):
102+
103+
```bash
104+
npm run cov
105+
```
106+
107+
Create an *html* coverage report (requires tests to be executed first):
108+
109+
```bash
110+
npm run cov:rep
111+
```
112+
113+
Build the project (including the *web project*):
114+
115+
```bash
116+
npm run build
117+
118+
```
119+
120+
List all available scripts:
121+
122+
```bash
123+
npm run
124+
```
125+
126+
### Launch Configurations
127+
128+
- *Run Extension* will run the extension in a separate *vscode instance*.
129+
- *Extension Tests* will execute the tests in debug mode.
130+
131+
<!-- LINKS -->
132+
[early-access]: https://github.com/open-cluster-management-io/ocm-vscode-extension/releases/tag/early-access
133+
[nodejs]: https://nodejs.org
134+
[vscode-api-ref]: https://code.visualstudio.com/api/references/vscode-api
135+
[vscode-ext-api]: https://code.visualstudio.com/api
136+
[vscode]: https://code.visualstudio.com/
137+
<!-- CODE LINKS -->
138+
[repo-images]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/images
139+
[repo-snippets]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/snippets
140+
[repo-src]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/src
141+
[repo-templates]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/templates
142+
[repo-test]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/test
143+
[repo-webview-ui]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/webview-ui

0 commit comments

Comments
 (0)