Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use npm instead of yarn to build Theia #14481

Merged
merged 10 commits into from
Jan 8, 2025
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
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
root = true

[*]
insert_final_newline = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep this? Why remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we now have the preference "files.insertFinalNewline" which acomplishes the same thing.

end_of_line = lf
indent_style = space

Expand Down
18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dev-packages/*/bin/*.js text eol=lf
36 changes: 15 additions & 21 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ jobs:
- name: Install and Build
shell: bash
run: |
yarn global add node-gyp
yarn --skip-integrity-check --network-timeout 100000
npm install -g node-gyp
npm ci
./scripts/check_git_status.sh
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Lint
run: |
yarn lint
npm run lint

build:
name: Build and Test (${{ matrix.os }}, node-${{ matrix.node }})
Expand Down Expand Up @@ -72,44 +72,38 @@ jobs:
with:
python-version: '3.11'

- name: Install
- name: Build
shell: bash
run: |
yarn global add node-gyp
yarn --skip-integrity-check --network-timeout 100000
npm install -g node-gyp
npm ci
npm run build
git status
./scripts/check_git_status.sh
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9


- name: Download Plugins
if: runner.os == 'Linux'
shell: bash
run: |
yarn -s download:plugins --rate-limit 3

- name: Build
shell: bash
run: |
yarn build:examples
./scripts/check_git_status.sh
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

npm run download:plugins -- --rate-limit 3

- name: Test (headless)
if: matrix.tests != 'skip'
shell: bash
run: |
yarn browser rebuild
yarn test:theia
npm run rebuild:browser
npm run test:theia

- name: Test (browser)
if: matrix.tests != 'skip' && runner.os == 'Linux'
run: |
xvfb-run -a yarn browser test
xvfb-run -a npm run test:browser

- name: Test (electron)
if: matrix.tests != 'skip' && runner.os == 'Linux'
run: |
xvfb-run -a yarn electron test
xvfb-run -a npm run test:electron
2 changes: 1 addition & 1 deletion .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ jobs:
if: matrix.tests != 'skip'
shell: bash
run: |
yarn license:check
npm run license:check
6 changes: 3 additions & 3 deletions .github/workflows/native-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ jobs:
- name: Install and Build
shell: bash
run: |
yarn --skip-integrity-check --network-timeout 100000
npm ci
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Build Browser App
shell: bash
run: |
yarn browser build
npm run build:browser
env:
NODE_OPTIONS: --max_old_space_size=4096

- name: Zip Native Dependencies
shell: bash
run: yarn zip:native:dependencies
run: npm run zip:native:dependencies

- name: Upload Artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ jobs:
- name: Build
shell: bash
run: |
yarn global add node-gyp
yarn --skip-integrity-check --network-timeout 100000 --ignore-engines
yarn build:examples
npm install -g node-gyp
npm ci
npm run build
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Performance (browser)
shell: bash
run: yarn performance:startup:browser
run: npm run performance:startup:browser

- name: Performance (Electron)
shell: bash
run: xvfb-run yarn performance:startup:electron
run: xvfb-run npm run performance:startup:electron

- name: Analyze performance results
uses: benchmark-action/github-action-benchmark@fd31771ce86cc65eab85653da103f71ab1b4479c # v1.9.0
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ jobs:
- name: Build Browser
shell: bash
run: |
yarn global add node-gyp
yarn --skip-integrity-check --network-timeout 100000
yarn download:plugins
yarn browser build
npm install -g node-gyp
npm ci
npm run build:browser
npm run download:plugins
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Build Playwright
shell: bash
run: |
yarn --cwd examples/playwright build
cd examples/playwright && npm run build

- name: Test (playwright)
shell: bash
run: yarn --cwd examples/playwright ui-tests-ci
run: cd examples/playwright && npm run ui-tests-ci

- name: Archive test results
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 #v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/production-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ jobs:
- name: Build Browser Example Application for Production
shell: bash
run: |
yarn global add node-gyp
yarn --skip-integrity-check --network-timeout 100000
yarn browser build:production
npm install -g node-gyp
npm ci
cd examples/browser && npm run build:production
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Build Playwright
shell: bash
run: |
yarn --cwd examples/playwright build
cd examples/playwright && npm run build

- name: Run Smoke Test (examples/playwright/src/tests/theia-app)
shell: bash
run: yarn test:playwright theia-app
run: npm run test:playwright -- theia-app
11 changes: 6 additions & 5 deletions .github/workflows/publish-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-22.04

# The current approach is silly. We should be smarter and use `actions/upload-artifact` and `actions/download-artifact` instead of rebuilding
# everything from scratch again. (git checkout, Node.js install, yarn, etc.) It was not possible to share artifacts on Travis CI without an
# everything from scratch again. (git checkout, Node.js install, npm, etc.) It was not possible to share artifacts on Travis CI without an
# external storage (such as S3), so we did rebuild everything before the npm publish. We should overcome this limitation with GH Actions.

steps:
Expand All @@ -35,15 +35,16 @@ jobs:

- name: Pre-npm-Publish
run: |
yarn global add node-gyp
yarn --skip-integrity-check --network-timeout 100000
npm install -g node-gyp
npm ci
npm run build
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Pre-docs-Publish
run: |
yarn docs
npm run docs
env:
NODE_OPTIONS: --max_old_space_size=14336

Expand All @@ -61,7 +62,7 @@ jobs:
retry_wait_seconds: 30
max_attempts: 3
retry_on: error
command: yarn publish:next
command: npm run publish:next
on_retry_command: git reset --hard
env:
NPM_CONFIG_PROVENANCE: "true"
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ jobs:
- name: Install
shell: bash
run: |
yarn global add node-gyp
yarn --skip-integrity-check --network-timeout 100000
npm install -g node-gyp
npm ci
npm run build
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Publish NPM
shell: bash
run: |
yarn publish:next
npm run publish:next
env:
NPM_CONFIG_PROVENANCE: "true"
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
9 changes: 5 additions & 4 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@ jobs:
- name: Install
shell: bash
run: |
yarn global add node-gyp
yarn --skip-integrity-check --network-timeout 100000
npm install -g node-gyp
npm ci
npm run build
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Publish NPM
shell: bash
run: |
yarn publish:latest -- ${{ inputs.release_type }}
yarn publish:check
npm run publish:latest -- ${{ inputs.release_type }}
npm run publish:check
env:
NPM_CONFIG_PROVENANCE: "true" # enable provenance check
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/translation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ jobs:
- name: Install and Build
shell: bash
run: |
yarn global add node-gyp
yarn --skip-integrity-check --network-timeout 100000
npm install -g node-gyp
npm ci
npm run build
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9
Expand Down
3 changes: 1 addition & 2 deletions .gitpod.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ ENV NODE_VERSION="18.17.0"
RUN bash -c ". .nvm/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm use $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& npm install -g yarn"
&& nvm alias default $NODE_VERSION
ENV PATH=$HOME/.nvm/versions/node/v${NODE_VERSION}/bin:$PATH
4 changes: 2 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ ports:
- port: 9339 # Node.js debug port
onOpen: ignore
tasks:
- init: yarn --network-timeout 100000 && yarn browser build && yarn download:plugins
- init: npm ci && npm run build && npm run download:plugins
command: >
jwm &
yarn browser start ../.. --hostname=0.0.0.0
npm run start:browser ../.. --hostname=0.0.0.0
vscode:
extensions:
- dbaeumer.vscode-eslint
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"lcov.watch": [
{
"pattern": "**/*.spec.ts",
"command": "yarn test:theia"
"command": "npm run test:theia"
}
],
"editor.insertSpaces": true,
Expand Down
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

5 changes: 4 additions & 1 deletion configs/base.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"@typescript-eslint",
"@typescript-eslint/tslint",
"import",
"no-null"
"no-null",
"eslint-plugin-deprecation",
"eslint-plugin-react",
"eslint-plugin-no-unsanitized"
],
"env": {
"browser": true,
Expand Down
6 changes: 1 addition & 5 deletions dependency-check-baseline.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"npm/npmjs/-/advanced-mark.js/2.6.0": "Manually approved",
"npm/npmjs/-/inversify/6.1.3": "Manually approved",
"npm/npmjs/@inversifyjs/common/1.3.2": "Manually approved",
"npm/npmjs/@inversifyjs/core/1.3.3": "Manually approved",
"npm/npmjs/@inversifyjs/reflect-metadata-utils/0.2.2": "Manually approved"

}
Loading
Loading