Skip to content

Commit

Permalink
fix: build and test failures caused by @devfile/api
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
  • Loading branch information
akurinnoy committed Dec 13, 2024
1 parent 96e170e commit 2ca70ce
Show file tree
Hide file tree
Showing 58 changed files with 25,006 additions and 24,816 deletions.
2 changes: 1 addition & 1 deletion .deps/EXCLUDED/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ This file contains a manual contribution to .deps/dev.md and it's needed because

| Packages | Resolved CQs |
| --- | --- |
| `@adobe/css-tools@4.4.1` | transitive dependency |
| `@csstools/selector-specificity@3.0.0` | transitive dependency |
| `@nrwl/nx-darwin-arm64@15.9.7` | transitive dependency |
| `@nrwl/nx-darwin-x64@15.9.7` | transitive dependency |
Expand All @@ -14,4 +15,3 @@ This file contains a manual contribution to .deps/dev.md and it's needed because
| `fsevents@2.3.3` | transitive dependency |
| `node-gyp@10.1.0` | transitive dependency |
| `nx@19.0.7` | transitive dependency |
| `@devfile/api@2.3.0-1721400636` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/@devfile/api/2.3.0-1721400636) |
5 changes: 3 additions & 2 deletions .deps/EXCLUDED/prod.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ This file lists dependencies that do not need CQs or auto-detection does not wor
| `blueimp-md5@2.19.0` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/blueimp-md5/2.19.0) |
| `codemirror@5.65.16` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/codemirror/5.65.16) |
| `cookie-signature@1.2.1` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/cookie-signature/1.2.1) |
| `ecc-jsbn@0.1.2` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/ecc-jsbn/0.1.2) |
| `elliptic@6.6.1` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/elliptic/6.6.1) |
| `fast-uri@2.4.0` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/fast-uri/2.4.0) |
| `fastify@4.28.1` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/fastify/4.28.1) |
| `jsep@1.3.9` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/jsep/1.3.9) |
| `real-require@0.2.0` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/real-require/0.2.0) |
| `light-my-request@5.14.0` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/light-my-request/5.14.0) |
| `real-require@0.2.0` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/real-require/0.2.0) |
| `devfile-api@0.0.1` | monorepo package |
639 changes: 279 additions & 360 deletions .deps/dev.md

Large diffs are not rendered by default.

457 changes: 184 additions & 273 deletions .deps/prod.md

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"packages": [
"packages/common",
"packages/dashboard-backend",
"packages/dashboard-frontend"
"packages/dashboard-frontend",
"packages/devfile-api"
]
},
"bugs": {
Expand All @@ -29,7 +30,7 @@
"license:generate": "$PWD/scripts/container_tool.sh run --rm -t -v $PWD/:/workspace/project quay.io/che-incubator/dash-licenses:next",
"test": "yarn run pretest && yarn wrksps test --no-cache",
"test:check": "yarn run pretest && yarn workspace @eclipse-che/dashboard-frontend test --config=jest.config.check.js",
"pretest": "yarn workspace @eclipse-che/common run build",
"pretest": "yarn workspace @eclipse-che/common run build && yarn workspace devfile-api run build",
"test:coverage": "yarn run pretest && yarn wrksps test --coverage",
"format:check": "yarn wrksps format:check",
"format:fix": "yarn wrksps format:fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"test:watch": "yarn test --watch"
},
"devDependencies": {
"@devfile/api": "2.3.0-1721400636",
"@devfile/api": "2.3.0-1725380172",
"@kubernetes/client-node": "^0.22.1",
"@types/jest": "^29.5.3",
"@typescript-eslint/eslint-plugin": "^6.3.0",
Expand Down
7 changes: 0 additions & 7 deletions packages/dashboard-backend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@ module.exports = {
moduleNameMapper: {
// mapping for absolute imports (see tsconfig.json)
'^@/(.*)$': '<rootDir>/src/$1',

// not everything we need is exported from the package
// so we need to alias the rest
'@devfile/api/(.*)$': '<rootDir>/../../node_modules/@devfile/api/$1.ts',
},
transformIgnorePatterns: [
'node_modules/(?!@devfile/api)',
],
collectCoverageFrom: [
...base.collectCoverageFrom,

Expand Down
1 change: 0 additions & 1 deletion packages/dashboard-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
],
"license": "EPL-2.0",
"dependencies": {
"@devfile/api": "2.3.0-1721400636",
"@eclipse-che/che-devworkspace-generator": "7.95.0",
"@fastify/cors": "^9.0.1",
"@fastify/error": "^3.4.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@

/* eslint-disable @typescript-eslint/no-unused-vars */

import { V1alpha2DevWorkspace } from '@devfile/api';
import { devworkspaceGroup, devworkspaceLatestVersion, devworkspacePlural } from '@devfile/api/api';
import { api } from '@eclipse-che/common';
import * as mockClient from '@kubernetes/client-node';
import { CustomObjectsApi } from '@kubernetes/client-node';
import {
devworkspaceGroup,
devworkspaceLatestVersion,
devworkspacePlural,
V1alpha2DevWorkspace,
} from 'devfile-api';
import { IncomingMessage } from 'http';

import { DevWorkspaceApiService } from '@/devworkspaceClient/services/devWorkspaceApi';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspace } from '@devfile/api';
import { devworkspaceGroup, devworkspaceLatestVersion, devworkspacePlural } from '@devfile/api/api';
import * as mockClient from '@kubernetes/client-node';
import { CustomObjectsApi } from '@kubernetes/client-node';
import {
devworkspaceGroup,
devworkspaceLatestVersion,
devworkspacePlural,
V1alpha2DevWorkspace,
} from 'devfile-api';

import {
CheClusterCustomResource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

/* eslint-disable @typescript-eslint/no-unused-vars */

import { V1alpha2DevWorkspaceTemplate } from '@devfile/api';
import { api } from '@eclipse-che/common';
import * as mockClient from '@kubernetes/client-node';
import { CustomObjectsApi } from '@kubernetes/client-node';
import {
devworkspacetemplateGroup,
devworkspacetemplateLatestVersion,
devworkspacetemplatePlural,
} from '@devfile/api/api';
import { api } from '@eclipse-che/common';
import * as mockClient from '@kubernetes/client-node';
import { CustomObjectsApi } from '@kubernetes/client-node';
V1alpha2DevWorkspaceTemplate,
} from 'devfile-api';

import {
DevWorkspaceTemplateApiService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V230Devfile } from '@devfile/api';
import { V1ConfigMapList } from '@kubernetes/client-node/dist/gen/model/v1ConfigMapList';
import { V230Devfile } from 'devfile-api';
import http from 'http';
import * as yaml from 'js-yaml';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspace } from '@devfile/api';
import { devworkspaceGroup, devworkspaceLatestVersion, devworkspacePlural } from '@devfile/api/api';
import { api } from '@eclipse-che/common';
import * as k8s from '@kubernetes/client-node';
import { V1Status } from '@kubernetes/client-node';
import {
devworkspaceGroup,
devworkspaceLatestVersion,
devworkspacePlural,
V1alpha2DevWorkspace,
} from 'devfile-api';
import http, { IncomingHttpHeaders } from 'http';

import { createError } from '@/devworkspaceClient/services/helpers/createError';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspace } from '@devfile/api';
import { devworkspaceGroup, devworkspaceLatestVersion, devworkspacePlural } from '@devfile/api/api';
import { api } from '@eclipse-che/common';
import * as k8s from '@kubernetes/client-node';
import { V1Status } from '@kubernetes/client-node';
import {
devworkspaceGroup,
devworkspaceLatestVersion,
devworkspacePlural,
V1alpha2DevWorkspace,
} from 'devfile-api';
import http from 'http';

import { prepareCustomObjectWatch } from '@/devworkspaceClient/services/helpers/prepareCustomObjectWatch';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspaceTemplate } from '@devfile/api';
import { api } from '@eclipse-che/common';
import * as k8s from '@kubernetes/client-node';
import {
devworkspacetemplateGroup,
devworkspacetemplateLatestVersion,
devworkspacetemplatePlural,
} from '@devfile/api/api';
import { api } from '@eclipse-che/common';
import * as k8s from '@kubernetes/client-node';
V1alpha2DevWorkspaceTemplate,
} from 'devfile-api';

import { createError } from '@/devworkspaceClient/services/helpers/createError';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V230Devfile } from '@devfile/api';
import { V1ConfigMapList } from '@kubernetes/client-node/dist/gen/model/v1ConfigMapList';
import { V230Devfile } from 'devfile-api';
import http from 'http';
import * as yaml from 'js-yaml';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V230DevfileComponents } from '@devfile/api';
import { api } from '@eclipse-che/common';
import * as k8s from '@kubernetes/client-node';
import { V230DevfileComponents } from 'devfile-api';
import { readFileSync } from 'fs';
import path from 'path';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
* Red Hat, Inc. - initial API and implementation
*/

import { api } from '@eclipse-che/common';
import * as k8s from '@kubernetes/client-node';
import {
V1alpha2DevWorkspace,
V1alpha2DevWorkspaceTemplate,
V230Devfile,
V230DevfileComponents,
} from '@devfile/api';
import { api } from '@eclipse-che/common';
import * as k8s from '@kubernetes/client-node';
} from 'devfile-api';
import { IncomingHttpHeaders } from 'http';

import { MessageListener } from '@/services/types/Observer';
Expand Down
2 changes: 1 addition & 1 deletion packages/dashboard-backend/src/models/restParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspace, V1alpha2DevWorkspaceTemplate } from '@devfile/api';
import { api } from '@eclipse-che/common';
import { V1alpha2DevWorkspace, V1alpha2DevWorkspaceTemplate } from 'devfile-api';

export interface ISchemaParams {
[key: string]: unknown;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspaceTemplate } from '@devfile/api';
import { Main as DevworkspaceGenerator } from '@eclipse-che/che-devworkspace-generator/lib/main';
import { api } from '@eclipse-che/common';
import { V1alpha2DevWorkspaceTemplate } from 'devfile-api';
import { FastifyInstance, FastifyRequest } from 'fastify';
import { dump } from 'js-yaml';

Expand All @@ -37,8 +37,6 @@ export function registerDevworkspaceResourcesRoute(instance: FastifyInstance) {
{
devfileContent,
editorPath,
pluginRegistryUrl: undefined,
editorEntry: undefined,
editorContent,
projects: [],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

/* eslint-disable @typescript-eslint/no-unused-vars */

import { api } from '@eclipse-che/common';
import {
V1alpha2DevWorkspace,
V1alpha2DevWorkspaceTemplate,
V230Devfile,
V230DevfileComponents,
} from '@devfile/api';
import { api } from '@eclipse-che/common';
} from 'devfile-api';
import { IncomingHttpHeaders } from 'http';

import {
Expand Down
4 changes: 0 additions & 4 deletions packages/dashboard-backend/webpack.config.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ module.exports = () => {
alias: {
// alias for absolute imports (see tsconfig.json)
'@': path.resolve(__dirname, 'src/'),

// not everything we need is exported from the package
// so we need to alias the rest
'@devfile/api/api': path.resolve(__dirname, '../../node_modules/@devfile/api/api.ts'),
},
},
resolveLoader: {},
Expand Down
1 change: 0 additions & 1 deletion packages/dashboard-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"sanitize-html": "^2.11.0"
},
"devDependencies": {
"@devfile/api": "2.3.0-1721400636",
"@eclipse-che/api": "^7.86.0",
"@kubernetes/client-node": "^0.22.1",
"@react-mock/state": "^0.1.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V230DevfileProjects, V230DevfileProjectsItemsGit } from '@devfile/api';
import common from '@eclipse-che/common';
import { V230DevfileProjects, V230DevfileProjectsItemsGit } from 'devfile-api';

import { getProjectFromLocation } from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation';
import devfileApi from '@/services/devfileApi';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V230DevfileProjects } from '@devfile/api';
import { V230DevfileProjects } from 'devfile-api';

import { FactoryLocationAdapter } from '@/services/factory-location-adapter';
import { getProjectName } from '@/services/helpers/getProjectName';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspace } from '@devfile/api';
import { V1alpha2DevWorkspace } from 'devfile-api';

import prepareResources from '@/components/WorkspaceProgress/CreatingSteps/Apply/Resources/prepareResources';
import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspaceStatusConditions } from '@devfile/api';
import { V1alpha2DevWorkspaceStatusConditions } from 'devfile-api';
import isEqual from 'lodash/isEqual';
import React from 'react';
import { connect, ConnectedProps } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspaceStatusConditions } from '@devfile/api';
import { V1alpha2DevWorkspaceStatusConditions } from 'devfile-api';

import devfileApi from '@/services/devfileApi';
import { DevWorkspaceStatus } from '@/services/helpers/types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspace } from '@devfile/api';
import { V1alpha2DevWorkspace } from 'devfile-api';

import { DevWorkspaceMetadata } from '@/services/devfileApi/devWorkspace/metadata';
import { DevWorkspaceSpec } from '@/services/devfileApi/devWorkspace/spec';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspaceMetadata } from '@devfile/api';
import { V1alpha2DevWorkspaceMetadata } from 'devfile-api';

export const DEVWORKSPACE_CHE_EDITOR = 'che.eclipse.org/che-editor';
// used by devworkspace-controller to allow to mount the corresponding Che7 workspace folder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspaceSpec } from '@devfile/api';
import { V1alpha2DevWorkspaceSpec } from 'devfile-api';

import { DevWorkspaceSpecTemplate } from '@/services/devfileApi/devWorkspace/spec/template';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspaceSpecTemplate } from '@devfile/api';
import { V1alpha2DevWorkspaceSpecTemplate } from 'devfile-api';

export const DEVWORKSPACE_CONFIG_ATTR = 'controller.devfile.io/devworkspace-config';
export const DEVWORKSPACE_CONTAINER_BUILD_ATTR = 'controller.devfile.io/scc';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Red Hat, Inc. - initial API and implementation
*/

import { V1alpha2DevWorkspaceTemplate } from '@devfile/api';
import { V1alpha2DevWorkspaceTemplate } from 'devfile-api';

import { DevWorkspaceTemplateMetadata } from '@/services/devfileApi/devWorkspaceTemplate/metadata';

Expand Down
Loading

0 comments on commit 2ca70ce

Please sign in to comment.