Skip to content

Commit

Permalink
chore: bump node and finally fix pnpm :amaze: (#3871)
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelchris authored Dec 5, 2024
1 parent 7e904c5 commit 21bf142
Show file tree
Hide file tree
Showing 25 changed files with 11,274 additions and 11,477 deletions.
40 changes: 20 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ version: 2.1
jobs:
install_deps:
docker:
- image: cimg/node:20.12
- image: cimg/node:22.11
steps:
- checkout
- run:
name: Install pnpm
command: npm i --prefix=$HOME/.local -g pnpm@8.15.7
command: npm i --prefix=$HOME/.local -g pnpm@9.14.4
- restore_cache:
keys:
- deps-v6-{{ checksum "pnpm-lock.yaml" }}
- deps-v6-{{ .Branch }}
- deps-v7-{{ checksum "pnpm-lock.yaml" }}
- deps-v7-{{ .Branch }}
- run:
name: Install dependencies
command: pnpm install
- save_cache:
key: deps-v6-{{ checksum "pnpm-lock.yaml" }}
key: deps-v7-{{ checksum "pnpm-lock.yaml" }}
paths:
- ./node_modules
- ./packages/eslint-config/node_modules
Expand All @@ -28,28 +28,28 @@ jobs:
- ./packages/extension/node_modules
build:
docker:
- image: cimg/node:20.12
- image: cimg/node:22.11
resource_class: medium+
steps:
- checkout
- restore_cache:
keys:
- deps-v6-{{ checksum "pnpm-lock.yaml" }}
- deps-v6-{{ .Branch }}
- deps-v7-{{ checksum "pnpm-lock.yaml" }}
- deps-v7-{{ .Branch }}
- run:
name: Build
command: npm run build:chrome
working_directory: packages/extension
test_extension:
docker:
- image: cimg/node:20.12
- image: cimg/node:22.11
parallelism: 1
steps:
- checkout
- restore_cache:
keys:
- deps-v6-{{ checksum "pnpm-lock.yaml" }}
- deps-v6-{{ .Branch }}
- deps-v7-{{ checksum "pnpm-lock.yaml" }}
- deps-v7-{{ .Branch }}
- run:
name: Test
command: |
Expand All @@ -63,14 +63,14 @@ jobs:
path: ./test-results
test_webapp:
docker:
- image: cimg/node:20.12
- image: cimg/node:22.11
parallelism: 1
steps:
- checkout
- restore_cache:
keys:
- deps-v6-{{ checksum "pnpm-lock.yaml" }}
- deps-v6-{{ .Branch }}
- deps-v7-{{ checksum "pnpm-lock.yaml" }}
- deps-v7-{{ .Branch }}
- run:
name: Test
command: |
Expand All @@ -84,28 +84,28 @@ jobs:
path: ./test-results
lint_shared:
docker:
- image: cimg/node:20.12
- image: cimg/node:22.11
resource_class: large
steps:
- checkout
- restore_cache:
keys:
- deps-v6-{{ checksum "pnpm-lock.yaml" }}
- deps-v6-{{ .Branch }}
- deps-v7-{{ checksum "pnpm-lock.yaml" }}
- deps-v7-{{ .Branch }}
- run:
name: Lint
command: npm run pretest
working_directory: packages/shared
test_shared:
docker:
- image: cimg/node:20.12
- image: cimg/node:22.11
parallelism: 1
steps:
- checkout
- restore_cache:
keys:
- deps-v6-{{ checksum "pnpm-lock.yaml" }}
- deps-v6-{{ .Branch }}
- deps-v7-{{ checksum "pnpm-lock.yaml" }}
- deps-v7-{{ .Branch }}
- run:
name: Test
command: |
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ tasks:
nvm install
nvm use
init: |
npm i -g pnpm@8.15.7
npm i -g pnpm@9.14.4
pnpm install
command: |
cd packages/webapp
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.12
22.11
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.12-alpine
FROM node:22.11-alpine
RUN apk add g++ make python3

RUN mkdir -p /opt/app
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The decision was made to allow faster iterations and to keep features parity in

## Technologies

- Node v20.12.0 (a `.nvmrc` is presented for [nvm](https://github.com/nvm-sh/nvm) users).
- Node v22.11 (a `.nvmrc` is presented for [nvm](https://github.com/nvm-sh/nvm) users).
- [pnpm](https://pnpm.io/workspaces) for managing the monorepo and dependencies.

## Projects
Expand Down Expand Up @@ -81,7 +81,7 @@ https://github.com/dailydotdev/.github/blob/master/CONTRIBUTING.md
After cloning the project, please make sure to run the following commands to bootstrap the project:

```bash
npm i -g pnpm@8.15.7
npm i -g pnpm@9.14.4
pnpm install
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"prepare": "corepack enable || true",
"pnpm-version": "pnpm -v"
},
"packageManager": "pnpm@8.15.7+sha256.50783dd0fa303852de2dd1557cd4b9f07cb5b018154a6e76d0f40635d6cee019",
"packageManager": "pnpm@9.14.4",
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"main": "index.js",
"prettier": "@dailydotdev/prettier-config",
"devDependencies": {
"@dailydotdev/eslint-plugin-daily-dev-eslint-rules": "*",
"@dailydotdev/prettier-config": "*",
"@dailydotdev/eslint-plugin-daily-dev-eslint-rules": "workspace:*",
"@dailydotdev/prettier-config": "workspace:*",
"@typescript-eslint/eslint-plugin": "^4.31.2",
"@typescript-eslint/parser": "^4.31.2",
"eslint-config-airbnb-typescript": "^12.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-rules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"prettier": "@dailydotdev/prettier-config",
"devDependencies": {
"@dailydotdev/prettier-config": "*"
"@dailydotdev/prettier-config": "workspace:*"
},
"files": [
"lib"
Expand Down
10 changes: 5 additions & 5 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"prettier": "@dailydotdev/prettier-config",
"dependencies": {
"@dailydotdev/react-contexify": "^5.0.2",
"@dailydotdev/shared": "*",
"@dailydotdev/shared": "workspace:*",
"@tanstack/react-query": "^5.59.16",
"@tanstack/react-query-devtools": "^5.59.16",
"classnames": "^2.5.1",
Expand All @@ -40,16 +40,16 @@
"@babel/preset-env": "^7.25.9",
"@babel/preset-react": "^7.25.9",
"@babel/preset-typescript": "^7.25.9",
"@dailydotdev/eslint-config": "*",
"@dailydotdev/eslint-plugin-daily-dev-eslint-rules": "*",
"@dailydotdev/prettier-config": "*",
"@dailydotdev/eslint-config": "workspace:*",
"@dailydotdev/eslint-plugin-daily-dev-eslint-rules": "workspace:*",
"@dailydotdev/prettier-config": "workspace:*",
"@svgr/webpack": "^5.5.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^13.5.0",
"@types/dompurify": "^2.3.1",
"@types/jest": "^26.0.24",
"@types/node": "^16.11.41",
"@types/node": "^22.9.1",
"@types/node-fetch": "^2.6.11",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ const defaultSettings: RemoteSettings = {
};

const defaultBootData: BootCacheData = {
exp: undefined,
postData: undefined,
alerts: defaultAlerts,
user: { ...loggedUser, createdAt: '2024-08-16T00:00:00.000Z' },
settings: defaultSettings,
Expand Down
6 changes: 3 additions & 3 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"@babel/preset-env": "^7.25.9",
"@babel/preset-react": "^7.25.9",
"@babel/preset-typescript": "^7.25.9",
"@dailydotdev/eslint-config": "*",
"@dailydotdev/eslint-plugin-daily-dev-eslint-rules": "*",
"@dailydotdev/prettier-config": "*",
"@dailydotdev/eslint-config": "workspace:*",
"@dailydotdev/eslint-plugin-daily-dev-eslint-rules": "workspace:*",
"@dailydotdev/prettier-config": "workspace:*",
"@dailydotdev/react-contexify": "^5.0.0",
"@tanstack/react-query": "^5.59.16",
"@tanstack/react-query-devtools": "^5.59.16",
Expand Down
10 changes: 5 additions & 5 deletions packages/shared/src/components/Feed.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ const defaultVariables = {
after: '',
};

let queryClient: QueryClient;
const queryClient = new QueryClient(defaultQueryClientTestingConfig);

beforeEach(() => {
queryClient?.clear();
queryClient.clear();
jest.restoreAllMocks();
jest.clearAllMocks();
nock.cleanAll();
Expand Down Expand Up @@ -175,8 +175,6 @@ const renderComponent = (
user: LoggedUser = defaultUser,
feedName: AllFeedPages = SharedFeedPage.MyFeed,
): RenderResult => {
queryClient = new QueryClient(defaultQueryClientTestingConfig);

mocks.forEach(mockGraphQL);
nock('http://localhost:3000').get('/v1/a?active=false').reply(200, [ad]);
const settingsContext: SettingsContextData = {
Expand Down Expand Up @@ -632,7 +630,7 @@ describe('Feed logged in', () => {
});
const contextBtn = await screen.findByText("Don't show posts from Echo JS");
fireEvent.click(contextBtn);

await waitForNock();
await waitFor(() => expect(mutationCalled).toBeTruthy());
});

Expand Down Expand Up @@ -689,6 +687,7 @@ describe('Feed logged in', () => {
expect(feed).toHaveAttribute('aria-live', 'assertive');
});

await waitForNock();
await waitFor(() => expect(mutationCalled).toBeTruthy());
});

Expand Down Expand Up @@ -723,6 +722,7 @@ describe('Feed logged in', () => {
const contextBtn = await screen.findByText('Not interested in #javascript');
fireEvent.click(contextBtn);

await waitForNock();
await waitFor(() => expect(mutationCalled).toBeTruthy());
});

Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/components/LazyImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function LazyImageComponent(
loading={eager ? 'eager' : 'lazy'}
src={src}
onError={onError}
// @ts-expect-error - Not supported by react yet
/* @ts-expect-error - Not supported by react yet */ /* eslint-disable react/no-unknown-property */
fetchpriority={fetchPriority}
/>
{children}
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/components/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const LogoSvgElem = ({
return (
<img
loading="eager"
// @ts-expect-error - Not supported by react yet
/* @ts-expect-error - Not supported by react yet */ /* eslint-disable react/no-unknown-property */
fetchpriority="high"
src={src}
className={className?.container}
Expand Down
8 changes: 6 additions & 2 deletions packages/shared/src/components/RenderMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ import {
TypographyType,
} from './typography/Typography';

const ReactMarkdown = dynamic(
() => import(/* webpackChunkName: "reactMarkdown" */ 'react-markdown'),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const ReactMarkdown = dynamic(() =>
import(/* webpackChunkName: "reactMarkdown" */ 'react-markdown').then(
(mod) => mod.default,
),
);

const SyntaxHighlighter = dynamic(() =>
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/components/image/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const ImageComponent = (
return (
<img
{...props}
// @ts-expect-error - Not supported by react yet
/* @ts-expect-error - Not supported by react yet */ /* eslint-disable react/no-unknown-property */
fetchpriority={fetchPriority}
ref={ref}
alt={alt}
Expand Down
12 changes: 6 additions & 6 deletions packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
},
"prettier": "@dailydotdev/prettier-config",
"dependencies": {
"@dailydotdev/shared": "*",
"@dailydotdev/shared": "workspace:*",
"@tanstack/react-query": "^5.59.16",
"extension": "*",
"extension": "workspace:*",
"next": "15.0.1",
"next-router-mock": "^0.9.13",
"react": "18.3.1",
"react-dom": "18.3.1",
"webextension-polyfill": "^0.12.0"
},
"devDependencies": {
"@dailydotdev/eslint-config": "*",
"@dailydotdev/eslint-plugin-daily-dev-eslint-rules": "*",
"@dailydotdev/prettier-config": "*",
"@dailydotdev/eslint-config": "workspace:*",
"@dailydotdev/eslint-plugin-daily-dev-eslint-rules": "workspace:*",
"@dailydotdev/prettier-config": "workspace:*",
"@storybook/addon-actions": "^8.3.6",
"@storybook/addon-designs": "^8.0.3",
"@storybook/addon-docs": "^8.3.6",
Expand All @@ -36,7 +36,7 @@
"@storybook/theming": "^8.3.6",
"@svgr/plugin-jsx": "^5.5.0",
"@svgr/plugin-svgo": "^5.5.0",
"@types/node": "^20.14.9",
"@types/node": "^22.9.1",
"@types/react": "18.3.12",
"@types/webextension-polyfill": "^0.10.5",
"@vitejs/plugin-react": "^1.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/__tests__/BookmarksPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const renderComponent = (
client = new QueryClient();

mocks.forEach(mockGraphQL);
nock('http://localhost:3000').get('/v1/a').reply(200, [ad]);
nock('http://localhost:3000').get('/v1/a?active=false').reply(200, [ad]);

return render(
<TestBootProvider client={client} auth={{ user }}>
Expand Down
4 changes: 2 additions & 2 deletions packages/webapp/__tests__/SourcePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import {
REMOVE_FILTERS_FROM_FEED_MUTATION,
} from '@dailydotdev/shared/src/graphql/feedSettings';
import { getFeedSettingsQueryKey } from '@dailydotdev/shared/src/hooks/useFeedSettings';
import ad from '@dailydotdev/shared/__tests__/fixture/ad';
import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser';
import defaultFeedPage from '@dailydotdev/shared/__tests__/fixture/feed';
import {
MockedGraphQLResponse,
mockGraphQL,
} from '@dailydotdev/shared/__tests__/helpers/graphql';
import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities';
import ad from '@dailydotdev/shared/__tests__/fixture/ad';
import SourcePage from '../pages/sources/[source]';
import { FEED_SETTINGS_QUERY } from '../../shared/src/graphql/feedSettings';

Expand Down Expand Up @@ -126,7 +126,7 @@ const renderComponent = (
client = new QueryClient();

mocks.forEach(mockGraphQL);
nock('http://localhost:3000').get('/v1/a').reply(200, [ad]);
nock('http://localhost:3000').get('/v1/a?active=false').reply(200, [ad]);
const settingsContext: SettingsContextData = {
spaciness: 'eco',
openNewTab: true,
Expand Down
Loading

0 comments on commit 21bf142

Please sign in to comment.