Switch to using NPM workspaces (#7115)

* Switch to using npm over yarn

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Remove reference to `yarn` from documentation

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Enable NPM workspaces

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Introduce script for installing all dependencies

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Remove usage of lerna bootstrap for no longer being used

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Fix build by not bundling libraries for application in node environment (main) as Electron does that

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Tweak evil static import paths in build of application

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Consolidate npmrc configs to root since required by workspaces

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Make application build not fail for not detecting electron version

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Update package-lock

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Make sure native dependencies are rebuilt for electron

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Remove unused binary for causing trouble when installing dependencies

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Update package-lock

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Disable caching in CI for Windows

Installing Electron in Windows seems to be broken in this regards.

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

---------

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
authored and GitHub committed 2023-02-20 12:48:18 +02:00
1 parent 219a683890
commit a0fb46c3e6
37 files changed
+32995 -40670

No files matched your search

+3 -3
View File
@@ -24,9 +24,9 @@ jobs:
- name: Generate Extensions API Reference using typedocs
run: |
yarn install
yarn run build:docs
npm install
npm run build:docs
- name: Verify that the markdown is valid
run: |
yarn run mkdocs:verify
npm run mkdocs:verify
+5 -5
View File
@@ -21,9 +21,9 @@ jobs:
- name: Install deps
run: |
yarn install
npm install
sudo apt-get install -y ripgrep
cd packages/bump-version-for-cron && yarn build
cd packages/bump-version-for-cron && npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Bump version
@@ -85,14 +85,14 @@ jobs:
- name: Build package
shell: bash
run: |
yarn install --frozen-lockfile
yarn run build
npm ci
npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release to GitHub NPM registry
run: |
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
yarn lerna \
npx lerna \
publish from-package \
--no-push \
--no-git-tag-version \
+2 -2
View File
@@ -20,7 +20,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install deps
run: yarn install
run: npm install
- name: Lint
run: yarn run lint
run: npm run lint
+5 -5
View File
@@ -34,12 +34,12 @@ jobs:
- name: Generate Extensions API Reference using typedocs
run: |
yarn install
yarn run build:docs
npm install
npm run build:docs
- name: Verify that the markdown is valid
run: |
yarn run mkdocs:verify
npm run mkdocs:verify
build:
name: Deploy docs
@@ -77,8 +77,8 @@ jobs:
- name: Generate Extensions API Reference using typedocs
run: |
yarn install --frozen-lockfile
yarn build:docs
npm ci
npm run build:docs
- name: mkdocs deploy master
if: contains(github.ref, 'refs/heads/master')
+2 -2
View File
@@ -37,8 +37,8 @@ jobs:
- name: Generate Extensions API Reference using typedocs
run: |
yarn install
yarn typedocs-extensions-api
npm install
npm run typedocs-extensions-api
- name: Checkout master branch from lens
uses: actions/checkout@v3
+3 -3
View File
@@ -32,8 +32,8 @@ jobs:
- name: Generate NPM packages
run: |
yarn install --frozen-lockfile
yarn run build
npm ci
npm run build
- name: Publish NPM packages
run: |
@@ -41,7 +41,7 @@ jobs:
VERSION=$(cat lerna.json | jq '.version' --raw-output)
echo ${VERSION}
DIST_TAG=$(node packages/semver/dist/index.js --prerelease 0 ${VERSION})
yarn lerna \
npx lerna \
publish from-package \
--no-push \
--no-git-tag-version \
+14 -12
View File
@@ -32,18 +32,20 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- name: Get npm cache directory path
if: ${{ runner.os != 'Windows' }}
id: npm-cache-dir-path
shell: bash
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
if: ${{ runner.os != 'Windows' }}
id: npm-cache # use this to check for `cache-hit` (`steps.npm-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-npm-
- uses: nick-fields/retry@v2
name: Install dependencies
@@ -51,9 +53,9 @@ jobs:
timeout_minutes: 20
max_attempts: 3
retry_on: error
command: yarn install --frozen-lockfile
command: npm ci
- run: yarn run test:unit
- run: npm run test:unit
name: Run tests
if: ${{ matrix.type == 'unit' }}
@@ -64,15 +66,15 @@ jobs:
minikube-version: latest
if: ${{ runner.os == 'Linux' && matrix.type == 'smoke' }}
- run: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' yarn run test:integration
- run: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' npm run test:integration
name: Run Linux integration tests
if: ${{ runner.os == 'Linux' && matrix.type == 'smoke' }}
- run: yarn run test:integration
- run: npm run test:integration
name: Run macOS integration tests
shell: bash
if: ${{ runner.os == 'macOS' && matrix.type == 'smoke' }}
- run: yarn run test:integration
- run: npm run test:integration
name: Run Windows integration tests
if: ${{ runner.os == 'Windows' && matrix.type == 'smoke' }}