Skip to content

Commit ccb8c95

Browse files
docs(tooling),test(e2e): address review comments on the vendored tooling docs
- e2e: validate IDP_TARGET at the start of performSignIn so an invalid value fails fast instead of silently running the IS flow. - tooling READMEs: the packages are private workspace packages, so replace the npm/pnpm/yarn registry installation sections (which also had `yard` typos and duplicate headings) with the `workspace:*` usage and a pointer to tooling/README.md. - eslint-plugin README: make the React JSON examples valid JSON. - TROUBLESHOOTING: fix the heading level jump (MD001). - tooling/README.md: list the local deviations from upstream so they can be re-applied after a refresh. Library code under lib/ stays identical to upstream. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 68f7c3c commit ccb8c95

5 files changed

Lines changed: 41 additions & 91 deletions

File tree

‎e2e/helpers/auth-helpers.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ function getSignInCredentials(): {username: string; password: string} {
2828
* - IS: WSO2 IS authentication endpoint
2929
*/
3030
export async function performSignIn(page: Page): Promise<void> {
31+
// Fail fast on an invalid IDP_TARGET instead of silently running the IS flow.
32+
getIdpTarget();
33+
3134
const credentials = getSignInCredentials();
3235

3336
await performIsSignIn(page, credentials);

‎tooling/README.md‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22

33
Shared lint and formatting configuration used by every package in this workspace.
44

5-
Both packages are vendored copies of
6-
[`brionmario/wso2-ui-configs`](https://github.com/brionmario/wso2-ui-configs) at commit
7-
`d3041825a4f8f235c8f9fa36b55cf29d54e791c8` (Apache-2.0, see `LICENSE`):
5+
Both packages are vendored copies of [`brionmario/wso2-ui-configs`](https://github.com/brionmario/wso2-ui-configs) at
6+
commit `d3041825a4f8f235c8f9fa36b55cf29d54e791c8` (Apache-2.0, see `LICENSE`):
87

98
- `eslint-plugin/` — `@wso2/eslint-plugin` (`packages/eslint-plugin` upstream)
109
- `prettier-config/` — `@wso2/prettier-config` (`packages/prettier-config` upstream)
1110

12-
They used to be consumed as git dependencies with a `path:` subdirectory. pnpm resolves GitHub-hosted git
13-
dependencies to a tarball of the whole repository and drops the `path:` fragment, so a clean install (CI, or a
14-
fresh store) ended up with the repository root instead of the package and ESLint could not find the plugin.
15-
Consuming them as workspace packages makes installs deterministic. To update, copy the upstream package
16-
contents over these directories and bump the commit above.
11+
They used to be consumed as git dependencies with a `path:` subdirectory. pnpm resolves GitHub-hosted git dependencies
12+
to a tarball of the whole repository and drops the `path:` fragment, so a clean install (CI, or a fresh store) ended up
13+
with the repository root instead of the package and ESLint could not find the plugin. Consuming them as workspace
14+
packages makes installs deterministic. To update, copy the upstream package contents over these directories and bump the
15+
commit above.
16+
17+
Local deviations from upstream, to re-apply after an update: `package.json` is trimmed and marked `private`, the READMEs
18+
describe `workspace:*` usage instead of registry installation, and the README/TROUBLESHOOTING Markdown was fixed to pass
19+
markdownlint. Library code under `lib/` and `index.js` is unchanged.

‎tooling/eslint-plugin/README.md‎

Lines changed: 13 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,20 @@ ESLint plugin containing configurations & custom rules used in WSO2 code bases.
44

55
## Installation
66

7-
You'll first need to install [ESLint](https://eslint.org/):
7+
This is a private workspace package (`"private": true`) vendored from
8+
[`brionmario/wso2-ui-configs`](https://github.com/brionmario/wso2-ui-configs); it is not published to a registry.
9+
Packages in this monorepo consume it with a `workspace:*` dependency:
810

9-
### With npm
10-
11-
```sh
12-
npm i eslint --save-dev
13-
```
14-
15-
### With pnpm
16-
17-
```sh
18-
pnpm add --save-dev eslint
19-
```
20-
21-
### With Yarn
22-
23-
```sh
24-
yard add --dev eslint
25-
```
26-
27-
Next, install `@wso2/eslint-plugin`:
28-
29-
### With npm
30-
31-
```sh
32-
npm i @wso2/eslint-plugin --save-dev
33-
```
34-
35-
### With pnpm
36-
37-
```sh
38-
pnpm add --save-dev @wso2/eslint-plugin
11+
```json
12+
{
13+
"devDependencies": {
14+
"@wso2/eslint-plugin": "workspace:*",
15+
"eslint": "8.57.0"
16+
}
17+
}
3918
```
4019

41-
### With Yarn
42-
43-
```sh
44-
yard add --dev @wso2/eslint-plugin
45-
```
20+
See [`../README.md`](../README.md) for provenance and how to update the vendored copy.
4621

4722
## Usage
4823

@@ -88,21 +63,15 @@ If you're working on a React project, do the following extension in your `eslint
8863

8964
```json
9065
{
91-
"extends": [
92-
"plugin:@wso2/javascript"
93-
"plugin:@wso2/react",
94-
]
66+
"extends": ["plugin:@wso2/javascript", "plugin:@wso2/react"]
9567
}
9668
```
9769

9870
#### React TypeScript
9971

10072
```json
10173
{
102-
"extends": [
103-
"plugin:@wso2/typescript"
104-
"plugin:@wso2/react",
105-
]
74+
"extends": ["plugin:@wso2/typescript", "plugin:@wso2/react"]
10675
}
10776
```
10877

‎tooling/eslint-plugin/TROUBLESHOOTING.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ If you're using the ESLint Plugin inside a Create React App project, you might e
1010
[eslint] Plugin "@typescript-eslint" was conflicted between ".eslintrc.cjs » plugin:@wso2/react » plugin:@wso2/typescript#overrides[0]" and ".eslintrc.cjs » plugin:@wso2/react » plugin:@wso2/typescript » eslint-config-airbnb-typescript/base » /<PATH>/node_modules/.pnpm/eslint-config-airbnb-typescript@17.0.0_mnxwss6wgpp5zz53fmtbuvhzim/node_modules/eslint-config-airbnb-typescript/lib/shared.js".
1111
```
1212

13-
#### Reason
13+
### Reason
1414

1515
A possible reason for the above would be that Create React app has it's own eslint configuration([eslint-config-react-ap](https://github.com/facebook/create-react-app/tree/main/packages/eslint-config-react-app)). This package has it's own eslint-plugins declared as dependencies and these can cause conflicts. Even if you remove the extension in the eslint config, there's no way to remove this dependency without ejecting.
1616

17-
#### Workaround
17+
### Workaround
1818

1919
You can disable the inbuilt eslint plugin using the following config.
2020

‎tooling/prettier-config/README.md‎

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,20 @@ Shareable Prettier configurations used in WSO2 code bases.
44

55
## Installation
66

7-
You'll first need to install [Prettier](https://prettier.io/):
8-
9-
### With npm
10-
11-
```sh
12-
npm i prettier --save-dev
13-
```
14-
15-
### With pnpm
16-
17-
```sh
18-
pnpm add --save-dev prettier
7+
This is a private workspace package (`"private": true`) vendored from
8+
[`brionmario/wso2-ui-configs`](https://github.com/brionmario/wso2-ui-configs); it is not published to a registry.
9+
Packages in this monorepo consume it with a `workspace:*` dependency:
10+
11+
```json
12+
{
13+
"devDependencies": {
14+
"@wso2/prettier-config": "workspace:*",
15+
"prettier": "2.6.2"
16+
}
17+
}
1918
```
2019

21-
### With Yarn
22-
23-
```sh
24-
yard add --dev prettier
25-
```
26-
27-
Next, install `@wso2/prettier-config`:
28-
29-
### With npm
30-
31-
```sh
32-
npm i @wso2/prettier-config --save-dev
33-
```
34-
35-
### With pnpm
36-
37-
```sh
38-
pnpm add --save-dev @wso2/prettier-config
39-
```
40-
41-
### With Yarn
42-
43-
```sh
44-
yard add --dev @wso2/prettier-config
45-
```
20+
See [`../README.md`](../README.md) for provenance and how to update the vendored copy.
4621

4722
## Usage
4823

0 commit comments

Comments
 (0)