Skip to content

Commit

Permalink
Merge pull request #420 from RomanNikitenko/move-to-npm
Browse files Browse the repository at this point in the history
Move to npm
  • Loading branch information
RomanNikitenko authored Oct 30, 2024
2 parents c4e688f + c279bdd commit 6739ad2
Show file tree
Hide file tree
Showing 4,766 changed files with 182,635 additions and 125,642 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .rebase/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ https://github.com/che-incubator/che-code/commit/d3cf7dc86d284bc4cdff7cc163c5642
---

#### @RomanNikitenko
https://github.com/che-incubator/che-code/pull/376
https://github.com/che-incubator/che-code/pull/397

- code/package.json
Expand Down
4 changes: 0 additions & 4 deletions .rebase/override/code/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"name": "che-code",
"bin": "out/vs/server/main.js",
"scripts": {
"watch-client": "node --max-old-space-size=5120 ./node_modules/gulp/bin/gulp.js watch-client",
"watch-extensions": "node --max-old-space-size=5120 ./node_modules/gulp/bin/gulp.js watch-extensions watch-extension-media"
},
"devDependencies": {
"@vscode/l10n-dev": "0.0.18",
"typescript": "5.6.0-dev.20240715"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,12 @@
"by": "<link rel=\\\"manifest\\\" href=\\\"./oss-dev/static/resources/server/manifest.json\\\" crossorigin=\\\"use-credentials\\\" />"
},
{
"from": "<link data-name=\\\"vs/workbench/workbench.web.main\\\" rel=\\\"stylesheet\\\" href=\\\"{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css\\\">",
"by": "<link data-name=\\\"vs/workbench/workbench.web.main\\\" rel=\\\"stylesheet\\\" href=\\\"./oss-dev/static/out/vs/workbench/workbench.web.main.css\\\">"
},
{
"from": "<script src=\\\"{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js\\\"></script>",
"by": "<script src=\\\"./oss-dev/static/out/vs/loader.js\\\"></script>"
},
{
"from": "<script src=\\\"{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js\\\"></script>",
"by": "<script src=\\\"./oss-dev/static/out/vs/webPackagePaths.js\\\"></script>"
"from": "<link rel=\\\"stylesheet\\\" href=\\\"{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css\\\"\\\">",
"by": "<link rel=\\\"stylesheet\\\" href=\\\"./oss-dev/static/out/vs/code/browser/workbench/workbench.css\\\">"
},
{
"from": "const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();",
"by": "const baseUrl = `${window.location.protocol}//${window.location.host}${window.location.pathname}oss-dev/static`;"
"by": "const baseUrl = `${window.location.protocol}//${window.location.host}${window.location.pathname}oss-dev/static`;"
},
{
"from": "<script src=\\\"{{WORKBENCH_NLS_FALLBACK_URL}}\\\"></script>",
Expand All @@ -39,10 +31,6 @@
"from": "<script src=\\\"{{WORKBENCH_NLS_URL}}\\\"></script>",
"by": ""
},
{
"from": "<script src=\\\"{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.js\\\"></script>",
"by": "<script src=\\\"./oss-dev/static/out/vs/workbench/workbench.web.main.js\\\"></script>"
},
{
"from": "<script src=\\\"{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.js\\\"></script>",
"by": "<script src=\\\"./oss-dev/static/out/vs/code/browser/workbench/workbench.js\\\"></script>"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ The terminal is aware of the running pod. Then, you can open terminals in every
Upstream `Code-OSS` is stored using Git [subtree](https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_subtree_merge). It means that if you're not interested in updating/rebasing upstream code you don't need to setup anything else unlike git submodules. This repository is self-contained.

## Development pre-requisites
- NodeJS version used by `Code-OSS` (Exact version can be find inside https://github.com/microsoft/vscode/blob/main/remote/.yarnrc with target property)
- Yarn v1.x
- NodeJS version used by `Code-OSS` (Exact version can be find inside https://github.com/microsoft/vscode/blob/main/remote/.npmrc with target property)
- `npm`

## Directories layout

Expand All @@ -20,9 +20,9 @@ Upstream `Code-OSS` is stored using Git [subtree](https://git-scm.com/book/en/v2

## Development mode

1. Fetch dependencies with `yarn` command
2. Compile and watch folders: `yarn run watch`
3. Run the server (another terminal for example): `yarn run server`
1. Fetch dependencies with `npm install` command
2. Compile and watch folders: `npm run watch`
3. Run the server (another terminal for example): `npm run server`

## Image build

Expand Down
3 changes: 1 addition & 2 deletions build/dockerfiles/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ RUN source $NVM_DIR/nvm.sh && \
nvm use v$NODEJS_VERSION

USER 0
RUN npm install --global [email protected] yarn@v1 node-gyp@9
RUN npm install --global [email protected] node-gyp@9

# Set permissions on /home/user/.cache to allow the user to write
RUN yarn global add node-gyp@9
RUN chgrp -R 0 /home/user/.cache && chmod -R g=u /home/user/.cache

USER 10001
17 changes: 8 additions & 9 deletions build/dockerfiles/linux-libc-ubi8.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ RUN { if [[ $(uname -m) == "s390x" ]]; then LIBSECRET="\
LIBKEYBOARD=""; echo "Warning: arch $(uname -m) not supported"; \
fi; } \
&& yum install -y $LIBSECRET $LIBKEYBOARD curl make cmake gcc gcc-c++ python3.9 git git-core-doc openssh less libX11-devel libxkbcommon bash tar gzip rsync patch \
&& yum -y clean all && rm -rf /var/cache/yum \
&& npm install -g [email protected]
&& yum -y clean all && rm -rf /var/cache/yum

#########################################################
#
Expand All @@ -69,14 +68,14 @@ ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \
RUN git init .

# change network timeout (slow using multi-arch build)
RUN yarn config set network-timeout 600000 -g
RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000

# Grab dependencies (and force to rebuild them)
RUN yarn install --force
RUN npm install --force

# Compile
RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \
&& NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | grep target | cut -d ' ' -f 2 | tr -d '"') \
&& NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"') \
# cache node from this image to avoid to grab it from within the build
&& mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH} \
&& echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node" \
Expand All @@ -102,11 +101,11 @@ RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \

# Compile test suites
# https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile
RUN if [ "$(uname -m)" = "x86_64" ]; then yarn --cwd test/smoke compile && yarn --cwd test/integration/browser compile; fi
RUN if [ "$(uname -m)" = "x86_64" ]; then npm --prefix test/smoke run compile && npm --prefix test/integration/browser run compile; fi

# install test dependencies
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0
RUN if [ "$(uname -m)" = "x86_64" ]; then yarn playwright-install; fi
RUN if [ "$(uname -m)" = "x86_64" ]; then npm run playwright-install; fi
# Install procps to manage to kill processes and centos stream repository
RUN if [ "$(uname -m)" = "x86_64" ]; then \
ARCH=$(uname -m) && \
Expand Down Expand Up @@ -139,7 +138,7 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then \
RUN if [ "$(uname -m)" = "x86_64" ]; then \
NODE_ARCH=$(echo "console.log(process.arch)" | node) \
VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \
/opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \
/opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \
fi

# Do not change line below! It is used to cut this section to skip tests
Expand All @@ -152,7 +151,7 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then \
#########################################################
COPY launcher /checode-launcher
WORKDIR /checode-launcher
RUN yarn \
RUN npm install \
&& mkdir /checode/launcher \
&& cp -r out/src/*.js /checode/launcher \
&& chgrp -R 0 /checode && chmod -R g+rwX /checode
Expand Down
20 changes: 10 additions & 10 deletions build/dockerfiles/linux-libc-ubi9.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ RUN { if [[ $(uname -m) == "s390x" ]]; then LIBSECRET="\
LIBKEYBOARD=""; echo "Warning: arch $(uname -m) not supported"; \
fi; } \
&& yum install -y $LIBSECRET $LIBKEYBOARD make cmake gcc gcc-c++ python3.9 git git-core-doc openssh less libX11-devel libxkbcommon krb5-devel bash tar gzip rsync patch npm \
&& yum -y clean all && rm -rf /var/cache/yum \
&& npm install -g [email protected]
&& yum -y clean all && rm -rf /var/cache/yum

#########################################################
#
Expand All @@ -69,13 +68,14 @@ ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \
RUN git init .

# change network timeout (slow using multi-arch build)
RUN yarn config set network-timeout 600000 -g
RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000

# Grab dependencies (and force to rebuild them)
RUN yarn install --force
RUN npm install --force

# Compile
RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \
&& NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | grep target | cut -d ' ' -f 2 | tr -d '"') \
&& NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"') \
# cache node from this image to avoid to grab it from within the build
&& mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH} \
&& echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node" \
Expand Down Expand Up @@ -103,11 +103,11 @@ RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \

# # Compile test suites
# https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile
RUN if [ "$(uname -m)" = "x86_64" ]; then yarn --cwd test/smoke compile && yarn --cwd test/integration/browser compile; fi
RUN if [ "$(uname -m)" = "x86_64" ]; then npm --prefix test/smoke run compile && npm --prefix test/integration/browser run compile; fi

# install test dependencies
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0
RUN if [ "$(uname -m)" = "x86_64" ]; then yarn playwright-install; fi
RUN if [ "$(uname -m)" = "x86_64" ]; then npm run playwright-install; fi
# Install procps to manage to kill processes and centos stream repository
RUN if [ "$(uname -m)" = "x86_64" ]; then \
ARCH=$(uname -m) && \
Expand All @@ -117,7 +117,7 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then \
https://rpmfind.net/linux/centos-stream/9-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-9.0-23.el9.noarch.rpm; \
fi

RUN if [ "$(uname -m)" = "x86_64" ]; then \
RUN if [ "$(uname -m)" = "x86_64" ]; then \
yum install -y chromium && \
PLAYWRIGHT_CHROMIUM_PATH=$(echo /opt/app-root/src/.cache/ms-playwright/chromium-*/) && \
rm "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome" && \
Expand All @@ -139,7 +139,7 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then \
RUN if [ "$(uname -m)" = "x86_64" ]; then \
NODE_ARCH=$(echo "console.log(process.arch)" | node) \
VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \
/opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \
/opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \
fi

# Do not change line below! It is used to cut this section to skip tests
Expand All @@ -152,7 +152,7 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then \
#########################################################
COPY launcher /checode-launcher
WORKDIR /checode-launcher
RUN yarn \
RUN npm install \
&& mkdir /checode/launcher \
&& cp -r out/src/*.js /checode/launcher \
&& chgrp -R 0 /checode && chmod -R g+rwX /checode
Expand Down
19 changes: 10 additions & 9 deletions build/dockerfiles/linux-musl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@ ENV CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT'
RUN git init .

# change network timeout (slow using multi-arch build)
RUN yarn config set network-timeout 600000 -g
RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000

# Grab dependencies
RUN yarn install
RUN npm install

# Rebuild platform specific dependencies
RUN npm rebuild

RUN NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | grep target | cut -d ' ' -f 2 | tr -d '"') \
RUN NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"') \
# cache node from this image to avoid to grab it from within the build
&& echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine/node" \
&& mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine \
&& cp /usr/local/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine/node
&& cp /usr/local/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine/node \
# workaround to fix build
&& cp -r /checode-compilation/node_modules/tslib /checode-compilation/remote/node_modules/

RUN NODE_OPTIONS="--max_old_space_size=6500" ./node_modules/.bin/gulp vscode-reh-web-linux-alpine-min
RUN cp -r ../vscode-reh-web-linux-alpine /checode
Expand All @@ -76,8 +78,7 @@ RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \

# Compile test suites
# https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile
RUN [[ $(uname -m) == "x86_64" ]] && yarn --cwd test/smoke compile && yarn --cwd test/integration/browser compile

RUN [[ $(uname -m) == "x86_64" ]] && npm --prefix test/smoke run compile && npm --prefix test/integration/browser run compile
# use of retry and timeout
COPY /build/scripts/helper/retry.sh /usr/bin/retry
RUN chmod u+x /usr/bin/retry
Expand All @@ -86,7 +87,7 @@ RUN chmod u+x /usr/bin/retry
# chromium for tests and procps as tests are using kill commands and it does not work with busybox implementation
RUN [[ $(uname -m) == "x86_64" ]] && apk add --update --no-cache chromium procps
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0
RUN [[ $(uname -m) == "x86_64" ]] && yarn playwright-install
RUN [[ $(uname -m) == "x86_64" ]] && npm run playwright-install
RUN [[ $(uname -m) == "x86_64" ]] && \
PLAYWRIGHT_CHROMIUM_PATH=$(echo /root/.cache/ms-playwright/chromium-*/) && \
rm "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome" && \
Expand All @@ -100,7 +101,7 @@ RUN [[ $(uname -m) == "x86_64" ]] && VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-

# Run smoke tests (Browser)
RUN [[ $(uname -m) == "x86_64" ]] && VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \
retry -v -t 3 -s 2 -- timeout 5m yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"
retry -v -t 3 -s 2 -- timeout 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"

#########################################################
#
Expand All @@ -109,7 +110,7 @@ RUN [[ $(uname -m) == "x86_64" ]] && VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-
#########################################################
COPY launcher /checode-launcher
WORKDIR /checode-launcher
RUN yarn \
RUN npm install \
&& mkdir /checode/launcher \
&& cp -r out/src/*.js /checode/launcher \
&& chgrp -R 0 /checode && chmod -R g+rwX /checode
Expand Down
13 changes: 1 addition & 12 deletions code/.configurations/configuration.dsc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ properties:
id: OpenJS.NodeJS.LTS
version: "20.14.0"
source: winget
- resource: NpmDsc/NpmPackage
id: yarn
dependsOn:
- npm
directives:
description: Install Yarn
allowPrerelease: true
settings:
Name: 'yarn'
Global: true
PackageDirectory: '${WinGetConfigRoot}\..\'
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install Python 3.10
Expand Down Expand Up @@ -56,7 +45,7 @@ properties:
includeRecommended: true
components:
- Microsoft.VisualStudio.Workload.VCTools
- resource: YarnDsc/YarnInstall
- resource: NpmDsc/NpmInstall
dependsOn:
- npm
directives:
Expand Down
4 changes: 2 additions & 2 deletions code/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ RUN git config --system codespaces-theme.hide-status 1

USER node
RUN npm install -g node-gyp
RUN YARN_CACHE="$(yarn cache dir)" && rm -rf "$YARN_CACHE" && ln -s /vscode-dev/yarn-cache "$YARN_CACHE"
RUN NPM_CACHE="$(npm config get cache)" && rm -rf "$NPM_CACHE" && ln -s /vscode-dev/npm-cache "$NPM_CACHE"
RUN echo 'export DISPLAY="${DISPLAY:-:1}"' | tee -a ~/.bashrc >> ~/.zshrc

USER root
CMD chown node:node /vscode-dev && sudo -u node mkdir -p /vscode-dev/yarn-cache && sleep inf
CMD chown node:node /vscode-dev && sudo -u node mkdir -p /vscode-dev/npm-cache && sleep inf
4 changes: 2 additions & 2 deletions code/.devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If you already have VS Code and Docker installed, you can click the badge above
4. Press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd> and select **Dev Containers: Clone Repository in Container Volume...**.

> **Tip:** While you can use your local source tree instead, operations like `yarn install` can be slow on macOS or when using the Hyper-V engine on Windows. We recommend using the WSL filesystem on Windows or the "clone repository in container" approach on Windows and macOS instead since it uses "named volume" rather than the local filesystem.
> **Tip:** While you can use your local source tree instead, operations like `npm i` can be slow on macOS or when using the Hyper-V engine on Windows. We recommend using the WSL filesystem on Windows or the "clone repository in container" approach on Windows and macOS instead since it uses "named volume" rather than the local filesystem.
5. Type `https://github.com/microsoft/vscode` (or a branch or PR URL) in the input box and press <kbd>Enter</kbd>.

Expand Down Expand Up @@ -85,7 +85,7 @@ To start working with Code - OSS, follow these steps:
1. In your local VS Code client, open a terminal (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>\`</kbd>) and type the following commands:

```bash
yarn install
npm i
bash scripts/code.sh
```

Expand Down
4 changes: 2 additions & 2 deletions code/.devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

yarn install --network-timeout 180000
yarn electron
npm i
npm run electron
7 changes: 0 additions & 7 deletions code/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
**/src/vs/*/**/*.d.ts
**/src/vs/base/test/common/filters.perf.data.js
**/src/vs/loader.js
**/src2/**/dompurify.js
**/src2/**/marked.js
**/src2/**/semver.js
**/src2/typings/**/*.d.ts
**/src2/vs/*/**/*.d.ts
**/src2/vs/base/test/common/filters.perf.data.js
**/src2/vs/loader.js
**/test/unit/assert.js
**/test/unit/assert-esm.js
**/test/automation/out/**
Expand Down
Loading

0 comments on commit 6739ad2

Please sign in to comment.