Skip to content

Commit 9e00e49

Browse files
committed
chore: fix tasks
1 parent c5b9b80 commit 9e00e49

File tree

18 files changed

+46
-29
lines changed

18 files changed

+46
-29
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@ jobs:
2626
# - run: npx nx start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
2727

2828
# Cache node_modules
29-
- uses: actions/setup-node@v4
29+
- uses: pnpm/action-setup@v4
30+
name: Install pnpm
3031
with:
31-
node-version: 20
32-
cache: 'npm'
32+
run_install: false
3333

34-
- run: npm ci --legacy-peer-deps
34+
- name: Install Node.js
35+
uses: actions/setup-node@v5
36+
with:
37+
cache: 'pnpm'
38+
39+
- run: pnpm install
3540
- run: npx playwright install --with-deps
3641

3742
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
@@ -40,4 +45,4 @@ jobs:
4045
- run: npx nx run-many -t lint test build typecheck e2e
4146
# Nx Cloud recommends fixes for failures to help you get CI green faster. Learn more: https://nx.dev/ci/features/self-healing-ci
4247
- run: npx nx fix-ci
43-
if: always()
48+
if: always()

.github/workflows/nx-migrate.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ jobs:
5151
if: ${{ steps.nx-workspace-package-check.outputs.was-changed == 'true' }}
5252
uses: actions/setup-node@v5
5353
with:
54-
# Use the volta.node property as the source of truth
55-
node-version-file: 'package.json'
5654
cache: 'pnpm'
5755

5856
- name: Run nx migrate if @nx/workspace changed and commit the results
@@ -80,7 +78,6 @@ jobs:
8078
# Sometimes Nx can require config formatting changes after a migrate command
8179
# We need to expect lock file changes to be applicable
8280
pnpm install --ignore-scripts --frozen-lockfile=false
83-
pnpm nx format
8481
8582
# migrations.json may or may not exist after running nx migrate
8683
if [ -f migrations.json ]; then
@@ -90,9 +87,6 @@ jobs:
9087
rm migrations.json
9188
fi
9289
93-
# Ensure all the changed files are formatted appropriately
94-
pnpm format
95-
9690
# Commit all the changes to the PR (see note on not being able to use secrets.GITHUB_TOKEN for this)
9791
git config --global user.email "[email protected]"
9892
git config --global user.name "Coly010"

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
run_install: false
2525

26-
- name: Install Node.js per package.json
26+
- name: Install Node.js
2727
uses: actions/setup-node@v5
2828
with:
2929
cache: 'pnpm'

apps/shop-e2e/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default [
55
playwright.configs['flat/recommended'],
66
...baseConfig,
77
{
8-
files: ['**/*.ts', '**/*.js'],
8+
files: ['src/**/*.ts', 'src/**/*.js'],
99
// Override or add rules here
1010
rules: {},
1111
},

apps/shop/tsconfig.spec.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
"@nx/react/typings/cssmodule.d.ts",
1212
"@nx/react/typings/image.d.ts"
1313
],
14+
"lib": ["es2022", "dom"],
1415
"jsx": "react-jsx"
1516
},
1617
"include": [
1718
"vite.config.ts",
1819
"vite.config.mts",
1920
"vitest.config.ts",
2021
"vitest.config.mts",
22+
"src/test-setup.ts",
2123
"src/**/*.test.ts",
2224
"src/**/*.spec.ts",
2325
"src/**/*.test.tsx",

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default [
1010
'**/vite.config.*.timestamp*',
1111
'**/vitest.config.*.timestamp*',
1212
'**/test-output',
13+
'**/out-tsc'
1314
],
1415
},
1516
{

libs/api/products/src/lib/products.service.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { describe, it, expect, beforeEach } from '@jest/globals';
21
import { ProductsService } from './products.service';
32
// eslint-disable-next-line
43
import { ProductFilter } from '@org/models';

libs/shared/test-utils/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
},
1313
"./package.json": "./package.json"
1414
},
15+
"devDependencies": {
16+
"@org/models": "workspace:*"
17+
},
1518
"nx": {
1619
"sourceRoot": "libs/shared/test-utils/src",
1720
"projectType": "library",

libs/shared/test-utils/src/lib/test-render.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ReactElement } from 'react';
2-
import { render, RenderOptions } from '@testing-library/react';
2+
import {render, RenderOptions, RenderResult} from '@testing-library/react';
33
import { BrowserRouter } from 'react-router-dom';
44

55
interface AllTheProvidersProps {
@@ -13,9 +13,9 @@ function AllTheProviders({ children }: AllTheProvidersProps) {
1313
export function renderWithRouter(
1414
ui: ReactElement,
1515
options?: Omit<RenderOptions, 'wrapper'>
16-
) {
16+
): RenderResult {
1717
return render(ui, { wrapper: AllTheProviders, ...options });
1818
}
1919

2020
export * from '@testing-library/react';
21-
export { renderWithRouter as render };
21+
export { renderWithRouter as render };

libs/shop/data/src/lib/hooks/use-product.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function useProduct(id: string | undefined) {
2020

2121
try {
2222
const response = await fetch(`${API_URL}/products/${id}`);
23-
const data: ApiResponse<Product> = await response.json();
23+
const data: ApiResponse<Product> = await response.json() as ApiResponse<Product>;
2424

2525
if (!data.success) {
2626
throw new Error(data.error || 'Failed to load product');
@@ -45,4 +45,4 @@ export function useProduct(id: string | undefined) {
4545
loading,
4646
error,
4747
};
48-
}
48+
}

0 commit comments

Comments
 (0)