Skip to content

Commit c3fa2df

Browse files
hnn0003Copilot
andauthored
Change readme and ci.yml to use pnpm for everything, same as the release-workflow (#179)
Co-authored-by: Copilot <copilot@github.com>
1 parent 3d99fc6 commit c3fa2df

14 files changed

Lines changed: 327 additions & 310 deletions

File tree

.changeset/common-cameras-cross.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
---
3+
4+
Update ci.yml

.changeset/fair-stamps-swim.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@itwin/saved-views-client": patch
3+
"@itwin/saved-views-react": patch
4+
---
5+
6+
Update dependencies to fix audit issues and throw error instead of 0 on callITwinApi failure

.eslintrc.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
"no-alert": "warn",
1717
"no-empty": [ "warn", { "allowEmptyCatch": true } ],
1818
"no-eval": "error",
19-
"@typescript-eslint/comma-dangle": [ "warn", "always-multiline" ],
20-
"@typescript-eslint/member-delimiter-style": [ "warn", { "singleline": { "requireLast": true } } ],
19+
"comma-dangle": [ "warn", "always-multiline" ],
20+
"quotes": "warn",
2121
"@typescript-eslint/no-confusing-void-expression": [ "warn", { "ignoreArrowShorthand": true } ],
22+
"@typescript-eslint/no-duplicate-type-constituents": "warn",
2223
"@typescript-eslint/no-empty-function": "off",
24+
"@typescript-eslint/no-empty-object-type": "off",
2325
"@typescript-eslint/no-misused-promises": [ "error", { "checksVoidReturn": false } ],
2426
"@typescript-eslint/no-non-null-assertion": "warn",
2527
"@typescript-eslint/no-redundant-type-constituents": "off",
@@ -30,8 +32,8 @@
3032
"@typescript-eslint/no-unsafe-enum-comparison": "off",
3133
"@typescript-eslint/no-unsafe-member-access": "off",
3234
"@typescript-eslint/no-unsafe-return": "off",
35+
"@typescript-eslint/no-unused-expressions": [ "error", { "allowShortCircuit": true, "allowTernary": true } ],
3336
"@typescript-eslint/no-unused-vars": [ "warn", { "argsIgnorePattern": "^_", "ignoreRestSiblings": true } ],
34-
"@typescript-eslint/quotes": "warn",
3537
"@typescript-eslint/return-await": "warn",
3638
"@typescript-eslint/require-await": "off",
3739
"@typescript-eslint/switch-exhaustiveness-check": "warn",

.github/workflows/CI.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,23 @@ jobs:
3131
run: pnpm install
3232

3333
- name: ESLint
34-
run: npm run lint -- --max-warnings 0
34+
run: pnpm run lint --max-warnings 0
3535

3636
- name: Typecheck
37-
run: npm run typecheck
37+
run: pnpm run typecheck
3838

3939
- name: Run Audit
4040
run: pnpm audit --audit-level high
4141

4242
- name: Check saved-views-client unit test coverage
43-
run: npm run test:cover --prefix ./packages/saved-views-client
43+
run: |
44+
cd packages/saved-views-client &&
45+
pnpm run test:cover
4446
4547
- name: Check saved-views-react unit test coverage
46-
run: npm run test:cover --prefix ./packages/saved-views-react
48+
run: |
49+
cd packages/saved-views-react &&
50+
pnpm run test:cover
4751
4852
- name: Check if changeset is present
4953
if: github.actor != 'imodeljs-admin'

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@
2121
* Start the test application.
2222

2323
```shell
24-
npm start
24+
pnpm start
2525
```
2626

2727
* You can now edit TypeScript and CSS source files and changes will automatically be reflected in the test app.
2828

2929
## Top-level commands
3030

31-
* `npm start` – starts the test app which can be accessed at [http://localhost:7948](http://localhost:7948)
31+
* `pnpm start` – starts the test app which can be accessed at [http://localhost:7948](http://localhost:7948)
3232
* To enable app features that use [iTwin Platform](https://developer.bentley.com/), see [`packages/test-app-frontend/.env`](./packages/test-app-frontend/.env) file.
33-
* `npm run lint` – runs ESLint on all TypeScript files in this repository
34-
* `npm run typecheck` – type checks all packages in this repository
33+
* `pnpm run lint` – runs ESLint on all TypeScript files in this repository
34+
* `pnpm run typecheck` – type checks all packages in this repository
3535

3636
## Contributing
3737

package.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,26 @@
2424
"npm": "<0",
2525
"node": ">=20"
2626
},
27+
"pnpm": {
28+
"overrides": {
29+
"path-to-regexp@<0.1.13": ">=0.1.13",
30+
"picomatch@>=4.0.0 <4.0.4": "4.0.4",
31+
"brace-expansion@<1.1.13": "1.1.13",
32+
"brace-expansion@>=4.0.0 <5.0.5": ">=5.0.5",
33+
"fast-xml-parser@<5.7.0": ">=5.7.0",
34+
"follow-redirects@<=1.15.11": ">=1.16.0",
35+
"dompurify@<=3.3.3": ">=3.4.0",
36+
"axios@>=1.0.0 <1.15.0": ">=1.15.0",
37+
"i18next-http-backend@<3.0.5": ">=3.0.5",
38+
"postcss@<8.5.10": ">=8.5.10"
39+
}
40+
},
2741
"dependencies": {
2842
"@changesets/types": "6.0.0",
2943
"@changesets/cli": "^2.29.4",
3044
"@types/node": "^18.11.9",
31-
"@typescript-eslint/eslint-plugin": "^7.4.0",
32-
"@typescript-eslint/parser": "^7.4.0",
45+
"@typescript-eslint/eslint-plugin": "^8.0.0",
46+
"@typescript-eslint/parser": "^8.0.0",
3347
"eslint": "^8.57.0",
3448
"eslint-plugin-react": "^7.35.2",
3549
"eslint-plugin-react-hooks": "^4.6.2",

packages/saved-views-client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343
},
4444
"devDependencies": {
4545
"@vitest/coverage-v8": "^4.0.16",
46-
"happy-dom": "^20.0.0",
46+
"happy-dom": "^20.8.9",
4747
"rimraf": "^6.1.2",
4848
"typescript": "^5.5.4",
49-
"vite": "^6.4.1",
49+
"vite": "^6.4.2",
5050
"vitest": "^4.0.16"
5151
}
5252
}

packages/saved-views-client/src/client/ApiUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async function throwBadResponseCodeError(response: Response, errorMessage: strin
4444
try {
4545
const resp = (await response.json());
4646
if (!isErrorResponse(resp)) {
47-
throw 0;
47+
throw new Error();
4848
}
4949
error = resp.error;
5050
} catch {

packages/saved-views-react/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@
5353
"@types/recursive-readdir": "^2.2.2",
5454
"@vitejs/plugin-react-swc": "^3.5.0",
5555
"@vitest/coverage-v8": "^4.0.16",
56-
"cpx2": "^5.0.0",
57-
"happy-dom": "^20.0.0",
56+
"cpx2": "^8.0.0",
57+
"happy-dom": "^20.8.9",
5858
"npm-run-all": "^4.1.5",
5959
"react": "^18.0.0",
6060
"react-dom": "^18.0.0",
6161
"recursive-readdir": "^2.2.3",
6262
"typescript": "^5.5.4",
63-
"vite": "^6.4.1",
63+
"vite": "^6.4.2",
6464
"vitest": "^4.0.16"
6565
},
6666
"peerDependencies": {

packages/saved-views-react/src/useSavedViews.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export interface SavedViewsActions {
125125
updateSavedView: (
126126
savedViewId: string,
127127
savedView: Partial<WriteableSavedViewProperties>,
128-
savedViewData?: SavedViewData | undefined,
128+
savedViewData?: SavedViewData,
129129
) => Promise<void>;
130130

131131
/**

0 commit comments

Comments
 (0)