Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Bug Report
about: Create a report to help us improve.
title: ''
labels: ''
assignees: ''
---

<!-- Prior to creating a bug report, please review
existing issues at https://github.com/eclipse-cdt-cloud/vscode-ui-components/issues
to avoid creating duplicates.
-->

Type: Bug Report

**Describe the bug**

- OS and Version:
- VS Code Version:
- Extension Version:
- Target Device:
- Other extensions you installed (and if the issue persists after disabling them):
- A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**

<!-- A clear and concise description of what you expected to happen. -->

**Code sample and logs**

- Code sample
- `launch.json`

**Screenshots**

<!-- If applicable, add screenshots to help explain your problem. -->

**Additional context**

<!-- Provide any other context about the problem. -->
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Feature Request
about: Suggest an idea for this extension.
title: ''
labels: ''
assignees: ''
---

Type: Feature Request

<!-- Prior to creating a feature request, please review
existing issues at https://github.com/eclipse-cdt-cloud/vscode-ui-components/issues
to avoid creating duplicates.
-->

<!-- Describe the feature you'd like. -->
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: ci

on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Build
env:
GITHUB_TOKEN: ${{github.token}}
run: |
yarn install --ignore-scripts
yarn build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
node_modules
lib
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// 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": []
}
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// If one would like to add/remove/modify user preferences without modifying the content of the
// workspace settings file, then one would need to modify the `settings.json` under here:
// - Windows: %APPDATA%\Code\User\settings.json
// - Linux: $HOME/.config/Code/User/settings.json
// - Mac: $HOME/Library/Application Support/Code/User/settings.json
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
4 changes: 4 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": "2.0.0",
"tasks": []
}
16 changes: 16 additions & 0 deletions .vscode/vscode-ui-components.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"Copyright": {
"prefix": [
"header",
"copyright"
],
"body": "/********************************************************************************\n * Copyright (C) $CURRENT_YEAR ${YourCompany} and others.\n *\n * This program and the accompanying materials are made available under the\n * terms of the MIT License as outlined in the LICENSE File\n ********************************************************************************/\n\n$0",
"description": "Adds the copyright...",
"scope": "css,javascript,javascriptreact,typescript,typescriptreact"
},
"Import VSCode": {
"prefix": "codeimport",
"body": "import * as vscode from 'vscode';",
"scope": "typescript,javascript"
}
}
10 changes: 10 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MIT License

Copyright 2024-2025 Arm Limited and EclipseSource
Copyright 2017-2023 Marcel Ball and Arm Limited

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.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,29 @@
# vscode-ui-components
Shared UI Components for CDT Cloud VS Code extensions
# UI Components for Visual Studio Code Extensions

This is a VS Code components React library.

## Project Structure

```
src/
│── base/ # Shared functionality
│── vscode/ # VS Code specific functionality

├── <component>/
│ ├── browser/ # React specific code
│ ├── common/ # Shared code between browser and VS Code
│ ├── vscode/ # VS Code integration (converters, webview providers, etc.)

├── <component>/
│ ├── *.tsx # Components without VS Code integration
```

## Installation

`npm install @eclipse-cdt-cloud/vscode-ui-components`

## Components

- [Tree](./src/tree/README.md): A component that combines tree structure functionality with table capabilities.

For usage information, refer to the component's README.
117 changes: 117 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/**********************************************************************************
* Copyright (c) 2025 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the MIT License as outlined in the LICENSE file.
**********************************************************************************/

import globals from 'globals';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import header from 'eslint-plugin-header';

header.rules.header.meta.schema = false;

export default tseslint.config(
{
ignores: ['**/node_modules', '**/lib']
},
eslint.configs.recommended,
tseslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.commonjs,
...globals.node
}
}
},
{
rules: {
// ESLint Convention
quotes: ['error', 'single'],
semi: ['error', 'always'],
indent: [
'error',
4,
{
SwitchCase: 1
}
],
'block-spacing': ['error', 'always'],
'brace-style': [
'error',
'1tbs',
{
allowSingleLine: true
}
],
'eol-last': ['error'],
'linebreak-style': ['error', 'unix'],

// ESLint Best Practices
'no-console': ['warn'],
'no-constant-condition': [
'error',
{
checkLoops: false
}
],

'no-trailing-spaces': ['error'],
'object-curly-spacing': ['error', 'always']
}
},
{
name: 'typescript',
files: ['**/*.ts', '**/*.mts', '**/*.cts', '**/*.tsx'],
plugins: {
typescript: tseslint
},
rules: {
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'explicit',
overrides: {
constructors: 'off'
}
}
],
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_'
}
]
}
},
{
name: 'header',
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx', '**/*.mjs', '**/*.cjs'],
plugins: {
header
},
rules: {
'header/header': [
2,
'block',
[
{
pattern: '[\n\r]+ \\* Copyright \\([cC]\\) \\d{4}(-\\d{4})? .*[\n\r]+',
template: `*********************************************************************************
* Copyright (c) ${new Date().getFullYear()} Company and others.
*
* This program and the accompanying materials are made available under the
* terms of the MIT License as outlined in the LICENSE file.
*********************************************************************************`
}
],
2
]
}
}
);
60 changes: 60 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "@eclipse-cdt-cloud/vscode-ui-components",
"version": "0.0.1",
"description": "VS Code UI Components for React",
"repository": "https://github.com/eclipse-cdt-cloud/vscode-ui-components",
"license": "MIT",
"qna": "https://github.com/eclipse-cdt-cloud/vscode-ui-components/issues",
"publisher": "eclipse-cdt",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"files": [
"lib"
],
"scripts": {
"build": "tsc && yarn lint",
"clean": "rimraf ./lib ./node_modules/.tmp",
"lint": "eslint .",
"prepare": "yarn clean && yarn build",
"watch": "tsc -w"
},
"dependencies": {
"@floating-ui/react": "^0.26.17",
"@vscode/codicons": "0.0.20",
"@vscode/webview-ui-toolkit": "^1.4.0",
"antd": "^5.22.1",
"primeflex": "^3.3.1",
"react-markdown": "^9.0.1",
"remark-gfm": "^4.0.0",
"throttle-debounce": "5.0.2",
"vscode-messenger": "^0.4.5",
"vscode-messenger-common": "^0.4.5",
"vscode-messenger-webview": "^0.4.5"
},
"devDependencies": {
"@eslint/js": "^9.21.0",
"@types/node": "^20.0.0",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@types/throttle-debounce": "5.0.2",
"@types/vscode": "^1.63.2",
"@types/vscode-webview": "^1.57.0",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"eslint": "^9.21.0",
"eslint-plugin-header": "^3.1.1",
"globals": "^16.0.0",
"prettier": "^3.5.2",
"prettier-plugin-packagejson": "^2.5.8",
"rimraf": "^6.0.1",
"typescript": "^5.7.3",
"typescript-eslint": "^8.25.0"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"engines": {
"node": ">=20"
}
}
Loading