diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a19dd7b4e..7b4a68c86 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -7,4 +7,4 @@ devfiles/** @azatsarynnyy @RomanNikitenko @vzhukovs @benoitf dockerfiles/** @azatsarynnyy @RomanNikitenko @vzhukovs @benoitf extensions/** @azatsarynnyy @RomanNikitenko @vzhukovs @benoitf generator/** @azatsarynnyy @RomanNikitenko @vzhukovs @benoitf -plugins/** @ericwill @vinokurig @vitaliy-guliy @svor @tsmaeder @benoitf @sunix +plugins/** @vinokurig @vitaliy-guliy @svor @tsmaeder @benoitf @sunix diff --git a/.github/workflows/happy-path-tests.yaml b/.github/workflows/happy-path-tests.yaml index 08e797aa6..51b982380 100644 --- a/.github/workflows/happy-path-tests.yaml +++ b/.github/workflows/happy-path-tests.yaml @@ -47,7 +47,7 @@ jobs: id: run-minikube uses: che-incubator/setup-minikube-action@next with: - minikube-version: v1.20.0 + minikube-version: v1.21.0 - name: Deploy Eclipse Che id: deploy-che uses: che-incubator/che-deploy-action@next diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54156fc47..c7b218193 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,7 +99,7 @@ jobs: echo "{\"text\":\":white_check_mark: Che Theia ${{ github.event.inputs.version }} has been released: https://quay.io/eclipse/che-theia-dev:${{ github.event.inputs.version }} https://quay.io/eclipse/che-theia:${{ github.event.inputs.version }} https://quay.io/eclipse/che-theia-endpoint-runtime-binary:${{ github.event.inputs.version }} https://quay.io/eclipse/che-theia-vsix-installer:${{ github.event.inputs.version }}\"}" > mattermost.json - name: Send MM message if: ${{ success() }} || ${{ failure() }} - uses: mattermost/action-mattermost-notify@1.0.2 + uses: mattermost/action-mattermost-notify@1.1.0 env: MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} MATTERMOST_CHANNEL: eclipse-che-releases diff --git a/build.include b/build.include index 0b1ad841f..15cd8c965 100644 --- a/build.include +++ b/build.include @@ -14,7 +14,7 @@ IMAGE_TAG="next" THEIA_GITHUB_REPO="eclipse-theia/theia" THEIA_VERSION="master" THEIA_BRANCH="master" -THEIA_COMMIT_SHA= +THEIA_COMMIT_SHA="9648953cd6e8552b7e027558509ba77770bd8b6f" THEIA_GIT_REFS="refs\\/heads\\/master" THEIA_DOCKER_IMAGE_VERSION= diff --git a/cico_build_master.sh b/cico_build_master.sh deleted file mode 100644 index a4548d012..000000000 --- a/cico_build_master.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2019 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# See: https://sipb.mit.edu/doc/safe-shell/ - -echo "Build is moved to GitHub Workflow" diff --git a/cico_build_nightly.sh b/cico_build_nightly.sh deleted file mode 100644 index 5018e2fcd..000000000 --- a/cico_build_nightly.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2019 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# See: https://sipb.mit.edu/doc/safe-shell/ - -echo "Not building Eclipse Che-Theia on nightly as it may publish for now images not passing happy path tests" diff --git a/cico_build_pr.sh b/cico_build_pr.sh deleted file mode 100644 index a4548d012..000000000 --- a/cico_build_pr.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2019 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# See: https://sipb.mit.edu/doc/safe-shell/ - -echo "Build is moved to GitHub Workflow" diff --git a/cico_common.sh b/cico_common.sh deleted file mode 100644 index d5fad7309..000000000 --- a/cico_common.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2019 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# See: https://sipb.mit.edu/doc/safe-shell/ - -# Source environment variables of the jenkins slave -# that might interest this worker. -function load_jenkins_vars() { - if [ -e "jenkins-env.json" ]; then - eval "$(./env-toolkit load -f jenkins-env.json \ - AKAMAI_CHE_AUTH \ - CHE_BOT_GITHUB_TOKEN \ - QUAY_ECLIPSE_CHE_USERNAME \ - QUAY_ECLIPSE_CHE_PASSWORD \ - CHE_NPM_AUTH_TOKEN \ - JENKINS_URL \ - GIT_BRANCH \ - GIT_COMMIT \ - BUILD_NUMBER \ - ghprbSourceBranch \ - ghprbActualCommit \ - BUILD_URL \ - ghprbPullId)" - #export provided GH token - export GITHUB_TOKEN=${CHE_BOT_GITHUB_TOKEN} - export NPM_AUTH_TOKEN=${CHE_NPM_AUTH_TOKEN} - fi -} - -function install_deps() { - # We need to disable selinux for now, XXX - /usr/sbin/setenforce 0 || true - - # Get all the deps in - yum install -y yum-utils device-mapper-persistent-data lvm2 - yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo - curl -sL https://rpm.nodesource.com/setup_12.x | bash - - yum-config-manager --add-repo https://dl.yarnpkg.com/rpm/yarn.repo - - yum install -y epel-release - yum install -y docker-ce git nodejs yarn gcc-c++ make jq - - service docker start - echo 'CICO: Dependencies installed' -} - -publishImagesOnQuay() { - REGISTRY="quay.io" - # For pushing to quay.io 'eclipse' organization we need to use different credentials - QUAY_USERNAME=${QUAY_ECLIPSE_CHE_USERNAME} - QUAY_PASSWORD=${QUAY_ECLIPSE_CHE_PASSWORD} - if [ -n "${QUAY_USERNAME}" ] && [ -n "${QUAY_PASSWORD}" ]; then - docker login -u "${QUAY_USERNAME}" -p "${QUAY_PASSWORD}" "${REGISTRY}" - else - echo "Could not login, missing credentials for pushing to the '${ORGANIZATION}' organization" - return - fi - - for image in "${PUBLISH_IMAGES_LIST[@]}" - do - echo "Publishing ${image}:${IMAGE_TAG}..." - docker tag "${image}:${IMAGE_TAG}" "${REGISTRY}/${image}:${IMAGE_TAG}" - echo y | docker push "${REGISTRY}/${image}:${IMAGE_TAG}" - if [[ -n "${THEIA_DOCKER_IMAGE_VERSION}" ]]; then - echo "Publishing ${image}:${THEIA_DOCKER_IMAGE_VERSION}..." - docker tag "${image}:${IMAGE_TAG}" "${REGISTRY}/${image}:${THEIA_DOCKER_IMAGE_VERSION}" - echo y | docker push "${REGISTRY}/${image}:${THEIA_DOCKER_IMAGE_VERSION}" - else - SHORT_SHA=$(git rev-parse --short HEAD) - echo "Publishing ${image}:${SHORT_SHA}..." - docker tag "${image}:${IMAGE_TAG}" "${REGISTRY}/${image}:${SHORT_SHA}" - echo y | docker push "${REGISTRY}/${image}:${SHORT_SHA}" - fi - done -} diff --git a/dockerfiles/theia-dev/docker/alpine/install-dependencies.dockerfile b/dockerfiles/theia-dev/docker/alpine/install-dependencies.dockerfile index db8fb2c0e..1b6e1a76d 100644 --- a/dockerfiles/theia-dev/docker/alpine/install-dependencies.dockerfile +++ b/dockerfiles/theia-dev/docker/alpine/install-dependencies.dockerfile @@ -16,4 +16,6 @@ RUN apk add --update --no-cache \ # synchronization tool rsync \ # patch (required in che-theia to apply patches) - patch + patch \ + # requirements to run theia with yarn start + libsecret diff --git a/dockerfiles/theia-dev/docker/ubi8/builder-image-from.dockerfile b/dockerfiles/theia-dev/docker/ubi8/builder-image-from.dockerfile index c470d6fa3..5b02373b8 100644 --- a/dockerfiles/theia-dev/docker/ubi8/builder-image-from.dockerfile +++ b/dockerfiles/theia-dev/docker/ubi8/builder-image-from.dockerfile @@ -1,2 +1,2 @@ # https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-12 -FROM registry.access.redhat.com/ubi8/nodejs-12:1-87 +FROM registry.access.redhat.com/ubi8/nodejs-12:1-90 diff --git a/dockerfiles/theia-dev/docker/ubi8/install-dependencies.dockerfile b/dockerfiles/theia-dev/docker/ubi8/install-dependencies.dockerfile index cf8a56031..8d6a9d922 100644 --- a/dockerfiles/theia-dev/docker/ubi8/install-dependencies.dockerfile +++ b/dockerfiles/theia-dev/docker/ubi8/install-dependencies.dockerfile @@ -1,3 +1,9 @@ USER root +# Install libsecret-devel on s390x and ppc64le for keytar build (binary included in npm package for x86) RUN yum install -y curl make cmake gcc gcc-c++ python2 git git-core-doc openssh less bash tar gzip rsync patch \ + && { [ $(uname -m) == "s390x" ] && yum install -y \ + https://rpmfind.net/linux/fedora-secondary/releases/34/Everything/s390x/os/Packages/l/libsecret-0.20.4-2.fc34.s390x.rpm \ + https://rpmfind.net/linux/fedora-secondary/development/rawhide/Everything/s390x/os/Packages/l/libsecret-devel-0.20.4-2.fc34.s390x.rpm || true; } \ + && { [ $(uname -m) == "ppc64le" ] && yum install -y libsecret https://rpmfind.net/linux/centos/8-stream/BaseOS/ppc64le/os/Packages/libsecret-devel-0.18.6-1.el8.ppc64le.rpm || true; } \ + && { [ $(uname -m) == "x86_64" ] && yum install -y libsecret || true; } \ && yum -y clean all && rm -rf /var/cache/yum diff --git a/dockerfiles/theia-endpoint-runtime-binary/docker/ubi8/runtime-from.dockerfile b/dockerfiles/theia-endpoint-runtime-binary/docker/ubi8/runtime-from.dockerfile index 8936f010d..f1bbefd82 100644 --- a/dockerfiles/theia-endpoint-runtime-binary/docker/ubi8/runtime-from.dockerfile +++ b/dockerfiles/theia-endpoint-runtime-binary/docker/ubi8/runtime-from.dockerfile @@ -1,2 +1,2 @@ # https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8-minimal -FROM registry.access.redhat.com/ubi8-minimal:8.4-200 as runtime +FROM registry.access.redhat.com/ubi8-minimal:8.4-205.1626828526 as runtime diff --git a/dockerfiles/theia-vsix-installer/docker/ubi8/from.dockerfile b/dockerfiles/theia-vsix-installer/docker/ubi8/from.dockerfile index 8936f010d..f1bbefd82 100644 --- a/dockerfiles/theia-vsix-installer/docker/ubi8/from.dockerfile +++ b/dockerfiles/theia-vsix-installer/docker/ubi8/from.dockerfile @@ -1,2 +1,2 @@ # https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8-minimal -FROM registry.access.redhat.com/ubi8-minimal:8.4-200 as runtime +FROM registry.access.redhat.com/ubi8-minimal:8.4-205.1626828526 as runtime diff --git a/dockerfiles/theia-vsix-installer/src/entrypoint.sh b/dockerfiles/theia-vsix-installer/src/entrypoint.sh index 22b38e79b..d872f05a0 100755 --- a/dockerfiles/theia-vsix-installer/src/entrypoint.sh +++ b/dockerfiles/theia-vsix-installer/src/entrypoint.sh @@ -20,6 +20,17 @@ for container in $(echo "$WORKSPACE" | sed -e 's|[[,]\({"attributes":{"app.kuber mkdir -p "$dest" unset IFS for url in $(echo "$urls" | sed 's/[",]/ /g' - ); do + # check if URL starts with relative:extension/ + # example of url: "relative:extension/resources/download_jboss_org/jbosstools/static/jdt_ls/stable/java-0.75.0-60.vsix + if [[ "$url" =~ ^relative:extension/.* ]]; then + # if there is no CHE_PLUGIN_REGISTRY_URL env var, skip + if [ -z "${CHE_PLUGIN_REGISTRY_URL}" ]; then + echo "CHE_PLUGIN_REGISTRY_URL env var is not set, skipping relative url ${url}" + continue + fi + # update URL by using the Plugin Registry URL as prefix + url=${CHE_PLUGIN_REGISTRY_URL}/${url#relative:extension/} + fi echo; echo "downloading $urls to $dest" curl -L "$url" > "$dest/$(basename "$url")" done diff --git a/dockerfiles/theia/README.md b/dockerfiles/theia/README.md index 1c2a75424..d4af06031 100644 --- a/dockerfiles/theia/README.md +++ b/dockerfiles/theia/README.md @@ -70,10 +70,9 @@ CI generates several tags of [docker images](https://quay.io/repository/eclipse/ - `eclipse/che-theia:next` - theia branch: [master](https://github.com/theia-ide/theia/) - che-theia branch: [main](https://github.com/eclipse-che/che-theia) - - CI [build job](https://ci.centos.org/view/Devtools/job/devtools-che-theia-che-build-master/) - - CI [nightly build job](https://ci.centos.org/view/Devtools/job/devtools-che-theia-che-nightly/) + - CI [next build job](https://github.com/eclipse-che/che-theia/actions/workflows/build-publish-next.yml) -- `eclipse/che-theia:latest` the latest stable Che-Theia 7.x release, updates on each release by CI [release job](https://ci.centos.org/view/Devtools/job/devtools-che-theia-che-release/) +- `eclipse/che-theia:latest` the latest stable Che-Theia 7.x release, updates on each release by CI [release job](https://github.com/eclipse-che/che-theia/actions/workflows/release.yml) ## Theia version diff --git a/dockerfiles/theia/docker/ubi8/build-result-from.dockerfile b/dockerfiles/theia/docker/ubi8/build-result-from.dockerfile index 79339de9f..e10fc7423 100644 --- a/dockerfiles/theia/docker/ubi8/build-result-from.dockerfile +++ b/dockerfiles/theia/docker/ubi8/build-result-from.dockerfile @@ -1,3 +1,3 @@ # https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-12 -FROM registry.access.redhat.com/ubi8/nodejs-12:1-87 as build-result +FROM registry.access.redhat.com/ubi8/nodejs-12:1-90 as build-result USER root diff --git a/dockerfiles/theia/docker/ubi8/runtime-from.dockerfile b/dockerfiles/theia/docker/ubi8/runtime-from.dockerfile index ebd1f098f..d26c0d45a 100644 --- a/dockerfiles/theia/docker/ubi8/runtime-from.dockerfile +++ b/dockerfiles/theia/docker/ubi8/runtime-from.dockerfile @@ -1,2 +1,2 @@ # https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-12 -FROM registry.access.redhat.com/ubi8/nodejs-12:1-87 as runtime +FROM registry.access.redhat.com/ubi8/nodejs-12:1-90 as runtime diff --git a/dockerfiles/theia/docker/ubi8/runtime-install-dependencies.dockerfile b/dockerfiles/theia/docker/ubi8/runtime-install-dependencies.dockerfile index 44a0460c4..dfe426b44 100644 --- a/dockerfiles/theia/docker/ubi8/runtime-install-dependencies.dockerfile +++ b/dockerfiles/theia/docker/ubi8/runtime-install-dependencies.dockerfile @@ -1,7 +1,7 @@ # need root user USER root -ARG SSHPASS_VERSION="1.06" +ARG SSHPASS_VERSION="1.08" # Install sudo # Install git @@ -12,7 +12,13 @@ ARG SSHPASS_VERSION="1.06" # Install less for handling git diff properly # Install sshpass for handling passwords for SSH keys # Install libsecret as Theia requires it -RUN yum install -y sudo git bzip2 which bash curl openssh less libsecret && \ - curl -ssl https://netcologne.dl.sourceforge.net/project/sshpass/sshpass/"${SSHPASS_VERSION}"/sshpass-"${SSHPASS_VERSION}".tar.gz -o sshpass.tar.gz && \ - tar -xvf sshpass.tar.gz && cd sshpass-"${SSHPASS_VERSION}" && ./configure && make install && cd .. && rm -rf sshpass-"${SSHPASS_VERSION}" && \ - yum -y clean all && rm -rf /var/cache/yum +# Install libsecret-devel on s390x and ppc64le for keytar build (binary included in npm package for x86) +RUN yum install -y sudo git bzip2 which bash curl openssh less \ + && { [ $(uname -m) == "s390x" ] && yum install -y \ + https://rpmfind.net/linux/fedora-secondary/releases/34/Everything/s390x/os/Packages/l/libsecret-0.20.4-2.fc34.s390x.rpm \ + https://rpmfind.net/linux/fedora-secondary/development/rawhide/Everything/s390x/os/Packages/l/libsecret-devel-0.20.4-2.fc34.s390x.rpm || true; } \ + && { [ $(uname -m) == "ppc64le" ] && yum install -y libsecret https://rpmfind.net/linux/centos/8-stream/BaseOS/ppc64le/os/Packages/libsecret-devel-0.18.6-1.el8.ppc64le.rpm || true; } \ + && { [ $(uname -m) == "x86_64" ] && yum install -y libsecret || true; } \ + && curl -sSLo sshpass.tar.gz https://downloads.sourceforge.net/project/sshpass/sshpass/"${SSHPASS_VERSION}"/sshpass-"${SSHPASS_VERSION}".tar.gz \ + && tar -xvf sshpass.tar.gz && cd sshpass-"${SSHPASS_VERSION}" && ./configure && make install && cd .. && rm -rf sshpass-"${SSHPASS_VERSION}" \ + && yum -y clean all && rm -rf /var/cache/yum diff --git a/extensions/eclipse-che-theia-mini-browser/src/browser/che-mini-browser-environment.ts b/extensions/eclipse-che-theia-mini-browser/src/browser/che-mini-browser-environment.ts index ced9b1ae0..b3ed2d739 100644 --- a/extensions/eclipse-che-theia-mini-browser/src/browser/che-mini-browser-environment.ts +++ b/extensions/eclipse-che-theia-mini-browser/src/browser/che-mini-browser-environment.ts @@ -41,4 +41,10 @@ export class CheMiniBrowserEnvironment extends MiniBrowserEnvironment { this._hostPatternPromise = Promise.resolve(miniBrowserHostName); } + + get hostPatternPromise(): Promise { + return this.environment + .getValue(MiniBrowserEndpoint.HOST_PATTERN_ENV) + .then(envVar => envVar?.value || MiniBrowserEndpoint.HOST_PATTERN_DEFAULT); + } } diff --git a/extensions/eclipse-che-theia-plugin-ext/src/browser/che-webview-environment.ts b/extensions/eclipse-che-theia-plugin-ext/src/browser/che-webview-environment.ts index b4b5fe708..3d8ea54b6 100644 --- a/extensions/eclipse-che-theia-plugin-ext/src/browser/che-webview-environment.ts +++ b/extensions/eclipse-che-theia-plugin-ext/src/browser/che-webview-environment.ts @@ -45,6 +45,12 @@ export class CheWebviewEnvironment extends WebviewEnvironment { return new URI(host).resolve('webview'); } + get hostPatternPromise(): Promise { + return this.environments + .getValue(WebviewExternalEndpoint.pattern) + .then(variable => variable?.value || WebviewExternalEndpoint.defaultPattern); + } + protected async getWebviewCheEndpoint(): Promise { const webviewCheEndpoints = await this.endpointService.getEndpointsByType(SERVER_WEBVIEWS_ATTR_VALUE); if (webviewCheEndpoints.length === 1) { diff --git a/extensions/eclipse-che-theia-workspace/src/browser/che-navigator-widget.tsx b/extensions/eclipse-che-theia-workspace/src/browser/che-navigator-widget.tsx index 832802dd7..b8e87c363 100644 --- a/extensions/eclipse-che-theia-workspace/src/browser/che-navigator-widget.tsx +++ b/extensions/eclipse-che-theia-workspace/src/browser/che-navigator-widget.tsx @@ -10,17 +10,111 @@ import * as React from 'react'; -import { injectable } from 'inversify'; +import { Devfile, DevfileService } from '@eclipse-che/theia-remote-api/lib/common/devfile-service'; import { FileNavigatorWidget } from '@theia/navigator/lib/browser/navigator-widget'; +import { FileService } from '@theia/filesystem/lib/browser/file-service'; +import URI from '@theia/core/lib/common/uri'; +import { WorkspaceInputDialog } from '@theia/workspace/lib/browser/workspace-input-dialog'; +import { WorkspaceService } from '@eclipse-che/theia-remote-api/lib/common/workspace-service'; +import { inject } from '@theia/core/shared/inversify'; +import { injectable } from 'inversify'; @injectable() export class CheFileNavigatorWidget extends FileNavigatorWidget { + @inject(FileService) protected readonly fileService: FileService; + @inject(DevfileService) protected readonly devfileService: DevfileService; + @inject(WorkspaceService) protected readonly cheWorkspaceService: WorkspaceService; + + protected devfile: Devfile | undefined; + protected projectsRootDirectory: string | undefined; + protected renderEmptyMultiRootWorkspace(): React.ReactNode { + if (this.devfile) { + const projects = this.devfile.projects; + if (projects && projects.length > 0) { + return this.renderNoProjectsPanel(); + } else { + return this.renderWelcomePanel(); + } + } else { + this.initialize().then(() => this.restartRendering()); + + return this.renderNoProjectsPanel(); + } + } + + protected renderNoProjectsPanel(): React.ReactNode { return (
No projects in the workspace yet
); } + + protected renderWelcomePanel(): React.ReactNode { + return ( +
+
No projects in the workspace yet.
+
You can clone a repository from a URL.
+
+ +
+
You can also add a new folder to the Che workspace.
+
+ +
+
+ ); + } + + protected newFolderToWorkspace = () => { + const parent = new URI(this.projectsRootDirectory); + const dialog = new WorkspaceInputDialog( + { + title: 'New Folder', + parentUri: new URI(this.projectsRootDirectory), + initialValue: 'Untitled', + }, + this.labelProvider + ); + dialog.open().then(async name => { + if (name) { + const folderUri = parent.resolve(name); + await this.fileService.createFolder(folderUri); + } + }); + }; + + protected cloneRepo = () => { + return this.commandService.executeCommand('git.clone'); + }; + + protected async initialize(): Promise { + if (!this.devfile) { + this.devfile = await this.devfileService.get(); + } + + if (!this.projectsRootDirectory) { + this.projectsRootDirectory = (await this.cheWorkspaceService.getProjectsRootDirectory()) || '/projects'; + } + } + + private async restartRendering(): Promise { + super.render(); + } } diff --git a/extensions/eclipse-che-theia-workspace/src/browser/che-workspace-module.ts b/extensions/eclipse-che-theia-workspace/src/browser/che-workspace-module.ts index 84cdca7b8..34b642bc0 100644 --- a/extensions/eclipse-che-theia-workspace/src/browser/che-workspace-module.ts +++ b/extensions/eclipse-che-theia-workspace/src/browser/che-workspace-module.ts @@ -7,6 +7,9 @@ * * SPDX-License-Identifier: EPL-2.0 ***********************************************************************/ + +import '../../src/browser/style/index.css'; + import { CommandContribution, MenuContribution } from '@theia/core/lib/common'; import { Container, ContainerModule, interfaces } from 'inversify'; import { FileTree, FileTreeModel, FileTreeWidget, createFileTreeContainer } from '@theia/filesystem/lib/browser'; diff --git a/extensions/eclipse-che-theia-workspace/src/browser/style/index.css b/extensions/eclipse-che-theia-workspace/src/browser/style/index.css new file mode 100644 index 000000000..16737e52c --- /dev/null +++ b/extensions/eclipse-che-theia-workspace/src/browser/style/index.css @@ -0,0 +1,21 @@ +/********************************************************************** + * Copyright (c) 2021 Red Hat, Inc. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + ***********************************************************************/ + +.theia-navigator-container .label { + text-align: center; + margin-top: 15px; +} + +.p-Widget .open-workspace-button { + padding: 4px 12px; + width: calc(100% - var(--theia-ui-padding) * 4); + margin-left: 0; + margin-bottom: 5px; +} diff --git a/generator/src/conf/.yarnclean b/generator/src/conf/.yarnclean index e6762b5a3..02523ba2c 100644 --- a/generator/src/conf/.yarnclean +++ b/generator/src/conf/.yarnclean @@ -28,6 +28,7 @@ dugite/git/* onigasm oniguruma @theia/monaco +react react-dom font-awesome @theia/monaco-editor-core diff --git a/generator/src/yarn.ts b/generator/src/yarn.ts index 911239d73..d5082113e 100644 --- a/generator/src/yarn.ts +++ b/generator/src/yarn.ts @@ -97,7 +97,22 @@ export class Yarn { nodePackages.map(e => e.path).filter((value, index, array) => index === array.indexOf(value)) ); } - + /** + * Exclude dependencies which defined on excludedPackages + * + * @protected + * @param {string} pkg + * @returns + * @memberof Yarn + */ + protected isExcluded(pkg: string) { + const exist = this.excludedPackages.indexOf(pkg) !== -1; + if (exist) { + Logger.debug(` --> Excluding the dependency ${pkg}`); + return true; + } + return false; + } /** * Find from children all the direct dependencies. Also exclude some dependencies by not analyzing them. * Allow as well to report error in case of a forbidden dependency found @@ -110,9 +125,9 @@ export class Yarn { nodeTreeDependencies: Map, subsetDependencies: string[] ): void { - children.map(child => { + children.forEach(child => { // only loop on exist - if (subsetDependencies.indexOf(child) >= 0) { + if (subsetDependencies.indexOf(child) >= 0 || this.isExcluded(child)) { return; } subsetDependencies.push(child); @@ -120,13 +135,7 @@ export class Yarn { // loop on children in any let depChildren = nodeTreeDependencies.get(child); if (depChildren) { - depChildren = depChildren.filter(depChild => { - const res = this.excludedPackages.indexOf(depChild) < 0; - if (!res) { - Logger.debug(` --> Excluding the dependency ${depChild}`); - } - return res; - }); + depChildren = depChildren.filter(depChild => !this.isExcluded(depChild)); const matching: string[] = []; const foundForbiddenPackage = depChildren.some(r => { diff --git a/plugins/workspace-plugin/README.md b/plugins/workspace-plugin/README.md index c4389ead7..606f49f48 100644 --- a/plugins/workspace-plugin/README.md +++ b/plugins/workspace-plugin/README.md @@ -31,16 +31,16 @@ From the factory definition: }, ``` -3. Build the needed "mydockerorg/che-theia:nightly" image with using build script +3. Build the needed "mydockerorg/che-theia:next" image with using build script ``` $ ./build.sh --organization:mydockerorg ``` -4. Push "mydockerorg/che-theia:nightly" image into your repo or use it locally. +4. Push "mydockerorg/che-theia:next" image into your repo or use it locally. 5. The following mount should be set in the che.env file: CHE_WORKSPACE_VOLUME=/var/run/docker.sock:/var/run/docker.sock; Change and restart CHE if it wasn't. -7. Create a new factory from this factory.json file as a working example. Change "mydockerorg/che-theia:nightly" image to your own from steps 3 and 4. +7. Create a new factory from this factory.json file as a working example. Change "mydockerorg/che-theia:next" image to your own from steps 3 and 4. ``` { "v":"4.0", @@ -115,7 +115,7 @@ Change and restart CHE if it wasn't. }, "recipe":{ "type":"compose", - "content":"services:\n machine-exec:\n image: eclipse/che-machine-exec:latest\n theia:\n image: mydockerorg/che-theia:nightly\n mem_limit: 1073741824\n dev-machine:\n image: eclipse/che-dev:nightly\n mem_limit: 2147483648\n depends_on:\n - theia", + "content":"services:\n machine-exec:\n image: eclipse/che-machine-exec:latest\n theia:\n image: mydockerorg/che-theia:next\n mem_limit: 1073741824\n dev-machine:\n image: eclipse/che-dev:next\n mem_limit: 2147483648\n depends_on:\n - theia", "contentType":"application/x-yaml" } } diff --git a/yarn.lock b/yarn.lock index c1e49f23b..10dd2b578 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4585,7 +4585,7 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -axios@0.21.1, axios@^0.21.0, axios@^0.21.1: +axios@0.21.1, axios@^0.21.1: version "0.21.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==