Skip to content

Commit

Permalink
build: Convert project to monorepo using Lerna (#1224)
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Jelinek <djelinek@redhat.com>
  • Loading branch information
djelinek authored Apr 2, 2024
1 parent a7537b0 commit 4386235
Show file tree
Hide file tree
Showing 275 changed files with 11,207 additions and 2,732 deletions.
25 changes: 24 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,30 @@ updates:
reviewers:
- redhat-developer/extester-maintainers
- package-ecosystem: 'npm'
directory: '/test/test-project'
directory: '/tests/test-project'
schedule:
interval: 'daily'
labels:
- "skip-changelog"
versioning-strategy: increase
reviewers:
- redhat-developer/extester-maintainers
- package-ecosystem: 'npm'
directory: '/packages/extester'
schedule:
interval: 'daily'
versioning-strategy: increase
reviewers:
- redhat-developer/extester-maintainers
- package-ecosystem: 'npm'
directory: '/packages/locators'
schedule:
interval: 'daily'
versioning-strategy: increase
reviewers:
- redhat-developer/extester-maintainers
- package-ecosystem: 'npm'
directory: '/packages/page-objects'
schedule:
interval: 'daily'
versioning-strategy: increase
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ main ]
paths:
- wiki/**
- docs/**
- .github/workflows/publish-wiki.yml

concurrency:
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/template-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
TEST_RESOURCES: test-resources

steps:
- name: 🔧 Checkout Repository
- name: 👷🏻 Checkout Repository
uses: actions/checkout@v4

- name: 🔧 Setup NodeJS
- name: ⚙️ Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodejs }}
Expand All @@ -42,15 +42,19 @@ jobs:
- name: 🔧 Install
run: npm ci

- name: 🔧 Build
run: npm run build

- name: 🔧 Install - Test Project
run: npm install --workspace=extester-test

- name: 🔍 Run Tests (macOS, windows)
if: matrix.os != 'ubuntu-latest'
run: |
npm test
run: npm test

- name: 🔍 Run Tests (linux)
if: matrix.os == 'ubuntu-latest'
run: |
xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm test
run: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm test

- name: 💾 Upload Screenshots
uses: actions/upload-artifact@v4
Expand Down
11 changes: 3 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
out
node_modules
./.vscode
docs
resources/api-handler.vsix
.npmrc
*.tgz
test/test-project/package-lock.json
out/
node_modules/
.npmrc
5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

29 changes: 10 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,17 @@ Now that you have the code, you will need to build the project. First, we need t
npm install
```

Now you can compile the typescript project. We recommend using the predefined script for that:

```nodejs
npm run build
```

After these steps, you should be able to run the project and make your changes. Just make sure to rebuild the project after changing the source files so you can test it.

### Test It

**When you make a change, make sure the tests are passing**. In the ```test/test-project``` directory there is a dummy VS Code extension we use to test the framework itself.
**When you make a change, make sure the tests are passing**. In the ```tests/test-project``` directory there is a dummy VS Code extension we use to test the framework itself.

For that, you can use the following script and launch the tests:

```nodejs
npm test
npm run test:build
```

If you are adding a new feature, be sure to **write new tests** for it. If you navigate to the ```test/test-project/src/test``` folder, you will find a test file structure that mirrors the source files. Put your new test into the appropriate existing file, or create a new one that follows the same structure.
If you are adding a new feature, be sure to **write new tests** for it. If you navigate to the ```tests/test-project/src/test``` folder, you will find a test file structure that mirrors the source files. Put your new test into the appropriate existing file, or create a new one that follows the same structure.

### Pull Requests

Expand All @@ -73,21 +65,20 @@ Lastly, a pull request check on [Github Actions](../../actions) is going to kick

- [ ] Check all related PR's were merged and the `Main CI` is green

1. _(optional)_ Publish `monaco-page-objects` package
1. _(optional)_ Publish `@vscode-extension-tester/page-objects` package
- `cd page-objects`
- [ ] `npm version (major|minor|patch)`
- [ ] `npm publish`
2. _(optional)_ Publish `vscode-extension-tester-locators` package
2. _(optional)_ Publish `@vscode-extension-tester/locators` package
- `cd locators`
- [ ] `npm version (major|minor|patch)`
- [ ] bump `monaco-page-objects` peerDependency to recently published in step 1)
- [ ] `npm publish`
3. Publish `vscode-extension-tester` package
- [ ] `npm version (major|minor|patch) --no-git-tag-version`
- [ ] bump `page-objects` dependency
- `npm install monaco-page-objects@latest`
- [ ] bump `locators` dependency
- `npm install vscode-extension-tester-locators@latest`
- [ ] bump `@vscode-extension-tester/page-objects` dependency
- `npm install @vscode-extension-tester/page-objects@latest`
- [ ] bump `@vscode-extension-tester/locators` dependency
- `npm install @vscode-extension-tester/locators@latest`
- [ ] commit changes and open new PR
- [ ] wait for PR is approved and merged
- [ ] after merge, wait until `Main CI` is green
Expand All @@ -98,7 +89,7 @@ Lastly, a pull request check on [Github Actions](../../actions) is going to kick
### Post publish tasks

- [ ] Close published version [milestone](https://github.com/redhat-developer/vscode-extension-tester/milestones) and update ExTester [project board](https://github.com/orgs/redhat-developer/projects/41/views/3)
- Update `sample-projects/helloworld-sample` project
- Update `examples/helloworld-extester` project
- [ ] Bump `vscode-extension-tester` version to recently released one
- [ ] Run tests and check everything is working properly
- _(optional)_ Spread a message about new release using IM tools, mailing lists and social media
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

<p align="center">
<a href="https://www.npmjs.com/package/vscode-extension-tester"><img src="https://img.shields.io/npm/v/vscode-extension-tester?label=extester&color=orange&style=for-the-badge" alt="ExTester"/></a>
<a href="https://www.npmjs.com/package/vscode-extension-tester-locators"><img src="https://img.shields.io/npm/v/vscode-extension-tester-locators?color=orange&label=locators&style=for-the-badge" alt="ExTester Locators"/></a>
<a href="https://www.npmjs.com/package/monaco-page-objects"><img src="https://img.shields.io/npm/v/monaco-page-objects?color=orange&label=page%20objects&style=for-the-badge" alt="ExTester Page Objects"/></a>
<a href="https://www.npmjs.com/package/@vscode-extension-tester/locators"><img src="https://img.shields.io/npm/v/v@vscode-extension-tester/locators?color=orange&label=locators&style=for-the-badge" alt="ExTester Locators"/></a>
<a href="https://www.npmjs.com/package/@vscode-extension-tester/page-objects"><img src="https://img.shields.io/npm/v/@vscode-extension-tester/page-objects?color=orange&label=page%20objects&style=for-the-badge" alt="ExTester Page Objects"/></a>
<a href="https://github.com/redhat-developer/vscode-extension-tester/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202-blue.svg?style=for-the-badge&logo=appveyor" alt="License"/></a>
</br>
<a href="https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/main.yml"><img src="https://img.shields.io/github/actions/workflow/status/redhat-developer/vscode-extension-tester/main.yml?label=Main%20CI&style=for-the-badge" alt="Main CI"></a>
Expand Down Expand Up @@ -54,10 +54,10 @@ npm install --save-dev vscode-extension-tester@latest

Make sure to check out the 🔗 [Documentation](#documentation) for detailed instructions.

- 📄 [How to set up the tests](../../wiki/Test-Setup)
- 📄 [Configuring Mocha](../../wiki/Mocha-Configuration)
- 📄 [An example simple test case](../../wiki/Writing-Simple-Tests)
- 📄 [Page objects API quick guide](../../wiki/Page-Object-APIs)
- 📄 [How to set up the tests](./docs/Test-Setup)
- 📄 [Configuring Mocha](./docs/Mocha-Configuration)
- 📄 [An example simple test case](./docs/Writing-Simple-Tests)
- 📄 [Page objects API quick guide](./docs/Page-Object-APIs)

### Documentation

Expand Down
2 changes: 1 addition & 1 deletion wiki/ActionsControl.md → docs/ActionsControl.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![actionControl](https://user-images.githubusercontent.com/4181232/56589258-27bb1900-65e5-11e9-9aef-7643f44697f4.png)

#### Look up the ActionsControl by title
Import and find the control through activity bar
Import and find the control through activity bar
```typescript
import { ActivityBar, ActionsControl } from 'vscode-extension-tester';
...
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion wiki/Debugging-Tests.md → docs/Debugging-Tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ We recommend using separate mocha configuration files for running, and debugging

To learn more about mocha configuration, check [[Mocha-Configuration]].

An example debugging setup can be found in [helloworld-sample](../tree/master/sample-projects/helloworld-sample).
An example debugging setup can be found in [helloworld-extester](../tree/main/examples/helloworld-extester).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 4386235

Please sign in to comment.