Skip to content

Commit 1483452

Browse files
committed
GLSP-1363 Refactor CLI application
Remove dependency to shelljs for CLI application, refactor release/releng commands and introduce bundling with esbuild ## Remove dependency to shelljs Shelljs has some issues in its core architecture which prevent it from proper bundling. We only use a very small subset of shelljs features. Therefore I opted for removing the dependency alltogether and introduce replacement functions in our utility library that directly use node builtins under the hood ## Refactor release/releng commands - Remove the existing release commands and introduce a new set of releng commands that can also be used in CI and enable (partly) automated releases - These commands have already been used for the 2.5.0 release (i.e. have been tested and work) - Introduce helpers for working with (reading, updating etc.) workspace package jsons ## Bundle application with es build - Introduce bundling with es build for the CLI package - Package is now dependency free and ships the CLI app in one bundle (+ source maps) - Update package scripts accordingly - Introduce proper watch mode for CLI package - Introduce vs code lauch config for debugin the CLI application. When starting the config the desired arguments/commands can be passed via input box ## Add workflows - Add dispatch workflow to trigger a new release preparation PR for a repository Fixes /issues/1363
1 parent 88834be commit 1483452

Some content is hidden

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

42 files changed

+2476
-2021
lines changed

.eslintignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Compiled output
2+
**/dist/
3+
**/lib/
4+
**/node_modules/
5+
6+
# Build files
7+
**/.eslintrc.js
8+
**/esbuild.js
9+
10+
# Other generated files
11+
**/*.map

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
module.exports = {
33
root: true,
44
extends: '@eclipse-glsp',
5-
ignorePatterns: ['**/{node_modules,lib}', '**/.eslintrc.js'],
65

76
parserOptions: {
87
tsconfigRootDir: __dirname,

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ to learn how to report vulnerabilities.
2525

2626
<!-- Please check, when if it applies to your change. -->
2727

28-
- [ ] This PR should be mentioned in the changelog
29-
- [ ] This PR introduces a breaking change (if yes, provide more details below for the changelog and the migration guide)
28+
- [ ] This PR should be mentioned in the changelog
29+
- [ ] This PR introduces a breaking change (if yes, provide more details below for the changelog and the migration guide)
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Prepare Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_type:
7+
description: 'Release type (major, minor, patch, next, or custom)'
8+
required: true
9+
type: choice
10+
options:
11+
- major
12+
- minor
13+
- patch
14+
- next
15+
- custom
16+
custom_version:
17+
description: 'Custom version (required if release_type is custom)'
18+
required: false
19+
type: string
20+
release_repo:
21+
description: 'GLSP repository to release'
22+
required: true
23+
type: choice
24+
options:
25+
- glsp
26+
- glsp-client
27+
- glsp-theia-integration
28+
- glsp-server
29+
- glsp-server-node
30+
- glsp-eclipse-integration
31+
- glsp-vscode-integration
32+
- glsp-playwright
33+
branch:
34+
description: 'Branch to use for the release repo (default: default branch)'
35+
required: false
36+
type: string
37+
draft:
38+
description: 'Create PR as draft'
39+
required: false
40+
type: boolean
41+
default: false
42+
43+
jobs:
44+
release:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout release helper repo (@eclipse-glsp/glsp)
48+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
49+
with:
50+
repository: eclipse-glsp/glsp
51+
path: glsp-release-helper
52+
53+
- name: Checkout release repo (${{ github.event.inputs.release_repo }})
54+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
55+
with:
56+
repository: eclipse-glsp/${{ github.event.inputs.release_repo }}
57+
path: release-repo
58+
ref: ${{ github.event.inputs.branch }}
59+
60+
- name: Set up Node.js
61+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
62+
with:
63+
node-version: 20
64+
65+
- name: Install Yarn
66+
run: npm install -g yarn
67+
68+
- name: Install dependencies in glsp-release-helper
69+
working-directory: ./glsp-release-helper
70+
run: yarn install
71+
72+
- name: Configure Git
73+
run: |
74+
git config --global user.name "eclipse-glsp-bot"
75+
git config --global user.email "57175764+eclipse-glsp-bot@users.noreply.github.com"
76+
77+
- name: Prepare release
78+
id: prepare_release
79+
working-directory: ./glsp-release-helper
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
run: |
83+
DRAFT_FLAG=""
84+
if [[ "${{ github.event.inputs.draft }}" == "true" ]]; then
85+
DRAFT_FLAG="-d"
86+
fi
87+
88+
if [[ "${{ github.event.inputs.release_type }}" == "custom" ]]; then
89+
yarn glsp releng prepare custom "${{ github.event.inputs.custom_version }}" -r ${{ github.workspace }}/release-repo $DRAFT_FLAG
90+
else
91+
yarn glsp releng prepare "${{ github.event.inputs.release_type }}" -r ${{ github.workspace }}/release-repo $DRAFT_FLAG
92+
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules/
22
*.log
33
lib
4+
dist
45
tsconfig.tsbuildinfo
56
eslint.xml

.prettierignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
lib/
6+
dist/
7+
8+
# Generated files
9+
*.min.js
10+
*.min.css
11+
12+
# Lock files
13+
package-lock.json
14+
yarn.lock
15+
16+
# Logs
17+
*.log

.vscode/launch.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug GLSP CLI",
6+
"type": "node",
7+
"request": "launch",
8+
"program": "${workspaceFolder}/dev-packages/cli/dist/cli.js",
9+
"args": "${input:cliArgs}",
10+
"cwd": "${workspaceFolder}",
11+
"console": "integratedTerminal",
12+
"sourceMaps": true,
13+
"outFiles": ["${workspaceFolder}/dev-packages/cli/dist/*.js"]
14+
}
15+
],
16+
"inputs": [
17+
{
18+
"id": "cliArgs",
19+
"description": "CLI arguments (space-separated, e.g., 'checkHeaders ./')",
20+
"default": "",
21+
"type": "promptString"
22+
}
23+
]
24+
}

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Version 1.2
55
August 19, 2020
66

77
## Our Pledge
8+
89
<img align="right" src="https://www.eclipse.org/org/images/eclipse_code_of_conduct.png" width="246" style="padding: 0px 5px 0px 5px;">
910
In the interest of fostering an open and welcoming environment, we as community members, contributors, committers, and project leaders pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
1011

dev-packages/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Eclipse GLSP - Dev Packages [![build-status](https://img.shields.io/jenkins/build?jobUrl=https://ci.eclipse.org/glsp/job/eclipse-glsp/job/glsp/job/master)](https://ci.eclipse.org/glsp/job/eclipse-glsp/job/glsp-client/job/master)
2+
23
Common shared development packages for Eclipse GLSP components that are implemented with Typescript.
34

45
## Components

0 commit comments

Comments
 (0)