Skip to content
Open
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
940 changes: 0 additions & 940 deletions .yarn/releases/yarn-4.14.1.cjs

This file was deleted.

944 changes: 944 additions & 0 deletions .yarn/releases/yarn-4.17.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ supportedArchitectures:
- linux
- darwin

yarnPath: .yarn/releases/yarn-4.14.1.cjs
yarnPath: .yarn/releases/yarn-4.17.1.cjs
2 changes: 1 addition & 1 deletion eslint.config.mjs → eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default tseslint.config(
...jest.configs['flat/recommended'].languageOptions,
...jest.configs['flat/style'].languageOptions,
globals: {
...jest.configs['flat/recommended'].languageOptions?.globals,
...globals.jest,
...globals.node,
},
},
Expand Down
7 changes: 0 additions & 7 deletions i18n-scripts/build-i18n.sh

This file was deleted.

34 changes: 0 additions & 34 deletions i18n-scripts/common.js

This file was deleted.

31 changes: 0 additions & 31 deletions i18n-scripts/lexers.js

This file was deleted.

68 changes: 0 additions & 68 deletions i18n-scripts/set-english-defaults.js

This file was deleted.

32 changes: 0 additions & 32 deletions i18next-parser.config.js

This file was deleted.

58 changes: 58 additions & 0 deletions i18next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { readFile } from 'node:fs/promises';
import jsonc from 'comment-json';
import { defineConfig, Plugin } from 'i18next-cli';

/**
* Custom JSON parser for localizing keys matching format: /%.+%/
*/
const consoleExtensionsPlugin = (): Plugin => ({
name: 'console-extensions',

async onEnd(keys) {
const content = await readFile('console-extensions.json', 'utf-8');
const extracted: { key: string }[] = [];

try {
jsonc.parse(
content,
(_key, value) => {
if (typeof value === 'string') {
const match = value.match(/^%(.+)%$/);
if (match && match[1]) {
extracted.push({ key: match[1] });
}
}
return value;
},
true,
);
} catch (e) {
console.error('Failed to parse as JSON.', e);
extracted.length = 0;
}

for (const { key: fullKey } of extracted) {
const [ns, key] = fullKey.split('~', 2);

if (ns && key) {
keys.set(`${ns}:${key}`, { key, defaultValue: key, ns });
} else {
console.warn(`Invalid key format: ${fullKey}`);
}
}
},
});

export default defineConfig({
locales: ['en'],
extract: {
input: 'src/**/*.{js,jsx,ts,tsx}',
output: 'locales/{{language}}/{{namespace}}.json',

sort: true,
keySeparator: false,
nsSeparator: '~',
defaultNS: 'plugin__console-plugin-template', // TODO: Change me!
},
plugins: [consoleExtensionsPlugin()],
});
4 changes: 2 additions & 2 deletions integration-tests/pages/login.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Locator, Page } from '@playwright/test';
import { type Locator, type Page } from '@playwright/test';

declare global {
interface Window {
Expand Down Expand Up @@ -37,7 +37,7 @@ export class LoginPage {
password: string = process.env.BRIDGE_KUBEADMIN_PASSWORD ?? '',
) {
await this.page.context().clearCookies();
await this.page.goto('/');
await this.page.goto('/', { timeout: 90_000, waitUntil: 'domcontentloaded' });

if (await this.isAuthDisabled()) {
return;
Expand Down
10 changes: 0 additions & 10 deletions integration-tests/tsconfig.json

This file was deleted.

45 changes: 21 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,72 +7,69 @@
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/openshift/console-plugin-template.git"
"url": "git+https://github.com/openshift/console-plugin-template.git"
},
"scripts": {
"clean": "rm -rf dist",
"build": "yarn clean && NODE_ENV=production yarn rspack",
"build-dev": "yarn clean && yarn rspack",
"start": "yarn rspack serve",
"build": "yarn clean && NODE_ENV=production rspack",
"build-dev": "yarn clean && rspack",
"start": "rspack serve",
"start-console": "./start-console.sh",
"i18n": "./i18n-scripts/build-i18n.sh && node ./i18n-scripts/set-english-defaults.js",
"i18n": "i18next-cli lint && i18next-cli extract",
"test": "LANG=en_US.UTF-8 jest",
"lint": "yarn eslint src integration-tests --fix --max-warnings 0 && stylelint 'src/**/*.css' --allow-empty-input --fix",
"lint": "eslint src integration-tests --fix --max-warnings 0 && stylelint 'src/**/*.css' --allow-empty-input --fix",
"test-e2e": "playwright test --headed",
"test-e2e-headless": "playwright test",
"rspack": "node -r ts-node/register ./node_modules/.bin/rspack"
"test-e2e-headless": "playwright test"
},
"devDependencies": {
"@openshift-console/dynamic-plugin-sdk": "4.23-latest",
"@openshift-console/dynamic-plugin-sdk-webpack": "4.23-latest",
"@patternfly/react-core": "^6.6.0",
"@patternfly/react-icons": "^6.6.0",
"@patternfly/react-table": "^6.6.0",
"@playwright/browser-chromium": "^1.60.1",
"@playwright/test": "^1.60.1",
"@rspack/cli": "^2.1.4",
"@rspack/core": "^2.1.4",
"@playwright/browser-chromium": "^1.61.1",
"@playwright/test": "^1.61.1",
"@rspack/cli": "^2.1.5",
"@rspack/core": "^2.1.5",
"@rspack/dev-server": "^2.1.0",
"@rstest/core": "^0.11.1",
"@swc/core": "^1.15.40",
"@swc/core": "^1.15.46",
"@swc/jest": "^0.2.39",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/jest-dom": "^7.0.0",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/jest": "^30.0.0",
"@types/node": "^22.0.0",
"@types/react": "^18.3.28",
"eslint": "^9.7.0",
"eslint": "^9.39.5",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.5",
"eslint-plugin-import-x": "^4.17.1",
"eslint-plugin-jest": "^29.15.4",
"eslint-plugin-jest": "^29.15.5",
"eslint-plugin-playwright": "^2.10.5",
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-testing-library": "^7.16.2",
"globals": "^17.7.0",
"i18next": "^25.8.18",
"i18next-parser": "^9.4.0",
"i18next-cli": "1.50.3",
"jest": "^30.4.2",
"jest-environment-jsdom": "^30.4.1",
"jest-junit": "^17.0.0",
"pluralize": "^8.0.0",
"prettier": "^3.9.5",
"prettier": "^3.9.6",
"prettier-stylelint": "^0.4.2",
"react": "^18.3.1",
"react-compiler-runtime": "^1.0.0",
"react-dom": "^18.3.1",
"react-i18next": "~16.5.8",
"react-router": "~7.13.1",
"stylelint": "^17.14.0",
"stylelint": "^17.14.1",
"stylelint-config-standard": "^40.0.0",
"ts-checker-rspack-plugin": "^1.5.2",
"ts-node": "^10.9.2",
"typescript": "^5.9.3",
"typescript-eslint": "^8.64.0"
"typescript-eslint": "^8.65.0"
},
"dependenciesMeta": {
"@playwright/browser-chromium": {
Expand All @@ -88,8 +85,8 @@
"ExamplePage": "./components/ExamplePage"
},
"dependencies": {
"@console/pluginAPI": ">=4.22.0-0"
"@console/pluginAPI": ">=5.0.0-0 || >=4.23.0-0"
}
},
"packageManager": "yarn@4.14.1"
"packageManager": "yarn@4.17.1"
}
Loading