freeCodeCamp / Developer_Quiz_Site

This is a quiz site filled with over 1200+ questions on programming.
https://developerquiz.org
BSD 3-Clause "New" or "Revised" License
246 stars 348 forks source link

feat: use pnpm package manager #954

Closed a2937 closed 5 months ago

a2937 commented 5 months ago

Summary of changes

Checklist

closes #951

This removes the package-lock.json and replaces it with a pnpm lock file. I would be happy to prevent others from using npm or yarn with this site but it seemed a little overkill.

socket-security[bot] commented 5 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@testing-library/jest-dom@6.4.2 None +18 2.75 MB testing-library-bot
npm/@testing-library/react@12.1.5 environment Transitive: eval +84 11.4 MB testing-library-bot
npm/@types/jest@29.5.12 Transitive: environment, filesystem, unsafe +49 1.77 MB types
npm/@types/node@18.19.31 None +1 2.04 MB types
npm/@types/react-dom@18.3.0 None 0 37.8 kB types
npm/@types/react@18.3.1 None +2 1.69 MB types
npm/@typescript-eslint/eslint-plugin@5.62.0 Transitive: environment, filesystem +48 7.47 MB jameshenry
npm/@typescript-eslint/parser@5.62.0 Transitive: environment, filesystem +36 2.63 MB jameshenry
npm/bootstrap@5.3.3 None +1 11.1 MB xhmikosr
npm/eslint-config-prettier@8.10.0 None 0 19.9 kB lydell
npm/eslint-plugin-react@7.34.1 filesystem Transitive: environment, eval +107 6.1 MB ljharb
npm/eslint@8.57.0 environment, filesystem Transitive: eval, shell, unsafe +98 10.7 MB eslintbot
npm/husky@8.0.3 environment, filesystem, shell 0 6.44 kB typicode
npm/jsdom@24.0.0 eval, filesystem, network, shell, unsafe Transitive: environment +40 7.21 MB domenic
npm/lint-staged@13.3.0 Transitive: environment, filesystem, shell +52 2.31 MB okonet
npm/prettier@2.8.8 environment, filesystem, unsafe 0 11.2 MB prettier-bot
npm/pretty-quick@3.3.1 filesystem Transitive: environment, shell +31 569 kB jounqin
npm/react-bootstrap@2.10.2 environment +26 6.17 MB kytsang
npm/react-dom@18.3.1 environment +3 4.63 MB react-bot
npm/react-router-dom@6.23.0 environment Transitive: network +2 4.25 MB mjackson
npm/react@18.3.1 environment +2 339 kB react-bot
npm/typescript@4.9.5 None 0 66.8 MB typescript-bot
npm/vite-tsconfig-paths@4.3.2 filesystem Transitive: environment +4 226 kB aleclarson
npm/vite@5.2.10 environment, eval, filesystem, network, shell, unsafe +7 6.37 MB vitebot
npm/vitest@1.5.2 environment, eval Transitive: filesystem, shell, unsafe +63 5.96 MB vitestbot
npm/web-vitals@2.1.4 None 0 145 kB philipwalton

🚮 Removed packages: npm/@testing-library/jest-dom@6.1.5, npm/@testing-library/react@12.1.2, npm/@types/jest@29.5.11, npm/@types/node@18.0.0, npm/@types/react-dom@18.0.4, npm/@types/react@18.0.9, npm/@typescript-eslint/eslint-plugin@5.26.0, npm/@typescript-eslint/parser@5.26.0, npm/bootstrap@5.1.3, npm/eslint-config-prettier@8.5.0, npm/eslint-plugin-react@7.30.0, npm/eslint@8.16.0, npm/husky@8.0.1, npm/lint-staged@13.0.3, npm/prettier@2.6.2, npm/pretty-quick@3.1.3, npm/react-bootstrap@2.0.3, npm/react-dom@18.2.0, npm/react-router-dom@6.20.1, npm/react@18.2.0, npm/typescript@4.7.2, npm/vite-tsconfig-paths@4.2.2, npm/vite@5.0.10, npm/vitest@1.1.0, npm/web-vitals@2.1.2

View full report↗︎

jdwilkin4 commented 5 months ago

The workflows still uses npm. So those will need to be updated.

And a couple of the scripts inside the package.json still reference npm. so those will need to be updated too

jdwilkin4 commented 5 months ago

Also, the readme and contributing docs should be updated to mention using pnpm instead of npm https://github.com/freeCodeCamp/Developer_Quiz_Site/blob/main/CONTRIBUTING.md

If a contributor wants to use something else, that is technically their choice I guess. But the docs should be consistent with the package manager we are using.

shootermv commented 5 months ago

wanted to ask here... how about consider to try bun tool instead of pnpm? (i heard it even faster)

jdwilkin4 commented 5 months ago

@shootermv

I vote we stick with pnpm. A lot of the other freeCodeCamp repos use it so it would be consistent with that. Then in the future, if the other repos start to migrate to using bun then we can reassess then

shootermv commented 5 months ago

may be it something like this will solve the issue: image

a2937 commented 5 months ago

Why is jsdom required yet not on the list of dependencies if we're using it?

jdwilkin4 commented 5 months ago

It looks like jsdom is still being included in the devDependecies.

Screenshot 2024-04-30 at 9 01 16 AM

and it is still referenced in the vite config file and test setup file.

as for the linting issue it looks like updating the deprecated methods here will fix that and while we are at it, we should removed that unused CATEGORIES name here

/home/runner/work/Developer_Quiz_Site/Developer_Quiz_Site/src/__tests__/Results.test.tsx
  17:5  error  ReactDOM.render is deprecated since React 18.0.0, use createRoot instead, see https://reactjs.org/link/switch-to-createroot  react/no-deprecated

/home/runner/work/Developer_Quiz_Site/Developer_Quiz_Site/src/__tests__/SelectQuestionsTotal.test.tsx
  11:5  error  ReactDOM.render is deprecated since React 18.0.0, use createRoot instead, see https://reactjs.org/link/switch-to-createroot  react/no-deprecated

/home/runner/work/Developer_Quiz_Site/Developer_Quiz_Site/src/components/QuizTemplate.tsx
  4:26  warning  'CATEGORIES' is defined but never used  @typescript-eslint/no-unused-vars