Files
cd/ui/jest.config.js
zeekay de0c7fd86a ui: vendor the component kit in-tree, drop the argo-ui dependency
argo-ui shipped as a git dependency resolved straight from
github.com/argoproj/argo-ui at every install. Vendor its used surface
(v1 + v2 component trees) under ui/src/kit instead: no upstream fetch,
no patch-package step for the theme colors (now baked directly into
the copied source), and the library is ours to read and change.

Renamed every argo-branded identifier the vendored code carried:
the argo-icon webfont and its class prefix, the $argo-* Sass
variables, and the argo-button/argo-table-list/... BEM class prefix
used both inside the kit and by every consumer that composes with it
directly in a stylesheet. Two dead-code default strings and a stray
"Argo"/"argo-ui" mention in a handful of comments went the same way.

Repointed every `from 'argo-ui'` / `'argo-ui/v2'` / deep-path import
across ui/src/app (118 files, 165 specifiers) to a relative path into
the vendored tree, generated rather than hand-edited to avoid missing
one. kit/src and kit/v2 keep the exact sibling layout the original
package had (kit/src, kit/v2) so the two places v1 code reaches into
v2 by relative path keep resolving without changes to that code.

tippy.js was an implicit transitive dependency of argo-ui pulled in
via its own package.json; now that the tooltip's CSS import is
first-party source, it needs to be a direct dependency of ui/ itself.

Fixed two real bugs surfaced while wiring this up: the UI linked
"download/argocd-linux", a route the server renamed to "cd-linux"
already; and two places compared the session's iss claim against the
literal 'argocd' when the server has issued 'hanzocd' for a while.
Also dropped the promoter.argoproj.io icon and its test cases to match
the resource_customizations entry for it already being gone, and
regenerated resource-customizations.ts from its own generator instead
of hand-editing the generated file.

NOTICE gains one more Apache-2.0 attribution entry for the vendored
source, in the same form as the two entries already there.
2026-09-04 22:51:39 -07:00

20 lines
621 B
JavaScript

module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
reporters: ['default', 'jest-junit'],
collectCoverage: true,
testPathIgnorePatterns: ['/node_modules/'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
transform: {
'^.+\\.tsx?$': ['ts-jest', {isolatedModules: true}]
},
globals: {
'self': {}
},
moduleNameMapper: {
// https://github.com/facebook/jest/issues/3094
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/fileMock.js',
'.+\\.(css|styl|less|sass|scss)$': '<rootDir>/__mocks__/fileMock.js',
},
};