Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: configure pnpm and remove phantom deps #2665

Merged
merged 15 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,31 @@ jobs:
with:
fetch-depth: 2

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.5
cache: 'pnpm'

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies
run: yarn --frozen-lockfile
run: pnpm i

- name: Build
run: yarn build
run: pnpm build

- name: Size
run: yarn size
run: pnpm size

- name: Lint
run: yarn lint
run: pnpm lint

- name: Test
run: yarn test
run: pnpm test

- name: Publish to Chromatic
uses: chromaui/action@latest
Expand All @@ -64,6 +69,12 @@ jobs:
- name: Clone starter
run: git clone https://github.com/vtex-sites/starter.store.git starter

- name: Install specific Yarn version
run: npm install -g yarn@1.22.19 # https://github.com/yarnpkg/yarn/issues/9015
matheusps marked this conversation as resolved.
Show resolved Hide resolved

- name: Verify Yarn version
run: yarn --version

- name: Install the packages on starter
run: |
cd starter
Expand All @@ -74,7 +85,7 @@ jobs:
- name: Install dependencies in starter
run: |
cd starter
yarn install --frozen-lockfile
yarn install

- name: Build starter
run: |
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ jobs:
token: ${{ secrets.VTEX_GITHUB_BOT_TOKEN }}
fetch-depth: 2

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.5

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Configure CI Git User
Expand All @@ -36,22 +41,22 @@ jobs:
git config user.email vtexgithubbot@github.com

- name: Install dependencies
run: yarn
run: pnpm i

- name: Build
run: yarn build
run: pnpm build

- name: Size
run: yarn size
run: pnpm size

- name: Lint
run: yarn lint
run: pnpm lint

- name: Test
run: yarn test
run: pnpm test

- name: Publish
run: yarn release
run: pnpm release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

Expand Down
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
yarn install
yarn lint-staged
pnpm i
pnpm lint-staged
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
link-workspace-packages=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "3.15.2",
"npmClient": "yarn",
"npmClient": "pnpm",
"command": {
"publish": {
"message": "[no ci] Release: %v"
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"license": "MIT",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "turbo run build --log-order=grouped",
"dev": "turbo run dev --parallel --no-cache",
"lint": "biome check .",
Expand All @@ -17,9 +18,6 @@
"clean": "turbo run clean && rm -rf node_modules",
"prepare": "husky"
},
"workspaces": [
"packages/*"
],
"devDependencies": {
"@biomejs/biome": "1.9.4",
"husky": "9.1.7",
Expand All @@ -38,12 +36,12 @@
"version": "0.0.0",
"volta": {
"node": "18.19.0",
"yarn": "1.22.22"
"pnpm": "9.15.5"
},
"dependencies": {},
"packageManager": "yarn@1.22.22",
"packageManager": "pnpm@9.15.5",
"lint-staged": {
"*.{ts,js,tsx,jsx,json}": "yarn lint:fix",
"*.{ts,js,tsx,jsx,json}": "pnpm lint:fix",
"*.scss": "stylelint --fix"
}
}
9 changes: 7 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"node": ">=18"
},
"scripts": {
"dev": "concurrently \"yarn generate -w\" \"tsc --watch\" \"yarn dev:graphql\"",
"dev": "concurrently \"pnpm run generate -w\" \"tsc --watch\" \"pnpm run dev:graphql\"",
"dev:graphql": "nodemon --watch src --ext graphql --exec \"copyfiles \"src/**/*.graphql\" dist/esm\"",
"dev:server": "tsx --no-cache ./local/server.ts",
"build": "graphql-codegen --config codegen.yml && (yarn build:cjs && yarn build:esm)",
"build": "graphql-codegen --config codegen.yml && (pnpm build:cjs && pnpm build:esm)",
"build:cjs": "tsc --module commonjs --moduleResolution node10 --outDir dist/cjs && copyfiles \"src/**/*.graphql\" dist/cjs",
"build:esm": "tsc && copyfiles \"src/**/*.graphql\" dist/esm",
"test": "jest",
Expand All @@ -36,10 +36,14 @@
"@envelop/on-resolve": "^4.1.1",
"@graphql-tools/load-files": "^7.0.0",
"@graphql-tools/schema": "^9.0.0",
"@graphql-tools/utils": "^10.2.0",
"@opentelemetry/exporter-logs-otlp-grpc": "^0.39.1",
"@opentelemetry/exporter-trace-otlp-grpc": "^0.39.1",
"@opentelemetry/sdk-logs": "^0.39.1",
"@opentelemetry/sdk-trace-base": "^1.13.0",
"@opentelemetry/api-logs": "^0.39.1",
"@opentelemetry/api": "^1.4.1",
"@opentelemetry/resources": "^1.13.0",
"@rollup/plugin-graphql": "^1.0.0",
"cookie": "^0.7.0",
"dataloader": "^2.1.0",
Expand All @@ -56,6 +60,7 @@
"@types/cookie": "^0.6.0",
"@types/express": "^4.17.16",
"@types/sanitize-html": "^2.9.1",
"@types/jest": "29.1.0",
"concurrently": "^6.2.1",
"copyfiles": "^2.4.1",
"express": "^4.17.3",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@types/degit": "^2.8.6",
"@types/fs-extra": "^9.0.13",
"@types/node": "^16.11.63",
"@types/jest": "29.1.0",
"chai": "^4",
"jest": "^29.7.0",
"oclif": "^3",
Expand Down
11 changes: 10 additions & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,25 @@
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"dependencies": {
"react-intersection-observer": "^8.32.5",
"react-swipeable": "^7.0.0",
"tabbable": "^5.2.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^14.3.0",
"@types/jest-axe": "^3.5.9",
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@types/tabbable": "^3.1.1",
"@types/jest": "29.1.0",
"@jest/globals": "29.7.0",
"jest": "^29.7.0",
"jest-axe": "^9.0.0",
"jest-environment-jsdom": "^29.7.0",
"ts-jest": "^29.1.2"
"ts-jest": "^29.1.2",
"tslib": "^2.3.1"
},
"volta": {
"extends": "../../package.json"
Expand Down
3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"volta": {
"node": "18.19.0",
"yarn": "1.22.22"
"pnpm": "9.15.1"
},
"sideEffects": false,
"dependencies": {
Expand Down Expand Up @@ -91,6 +91,7 @@
"@types/cypress": "^1.1.3",
"@types/fs-extra": "^9.0.13",
"@types/jest": "29.1.0",
"@jest/globals": "29.7.0",
"@vtex/prettier-config": "1.0.0",
"axe-core": "^4.8.1",
"cypress": "12.17.4",
Expand Down
3 changes: 3 additions & 0 deletions packages/lighthouse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
"scripts": {
"dev": "tsc --watch",
"build": "tsc"
},
"devDependencies": {
"@types/node": "^18.11.16"
}
}
5 changes: 4 additions & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"devDependencies": {
"@size-limit/preset-small-lib": "^7.0.8",
"@testing-library/react": "^14.3.0",
"@types/node": "^18.11.16",
"@types/jest": "29.1.0",
"fake-indexeddb": "^3.1.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand All @@ -47,6 +49,7 @@
"tslib": "^2.3.1"
},
"dependencies": {
"idb-keyval": "^5.1.3"
"idb-keyval": "^5.1.3",
"@types/react": "^18.2.42"
}
}
2 changes: 1 addition & 1 deletion packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"volta": {
"node": "18.19.0",
"yarn": "1.22.22"
"pnpm": "9.15.1"
},
"scripts": {
"dev": "storybook dev -p 6006",
Expand Down
5 changes: 4 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@
"devDependencies": {
"@size-limit/preset-small-lib": "^7.0.8",
"@types/tabbable": "^3.1.1",
"@types/node": "^18.11.16",
"@types/react": "^18.2.42",
"babel-loader": "^8.2.5",
"size-limit": "^7.0.8"
"size-limit": "^7.0.8",
"tslib": "^2.3.1"
},
"volta": {
"extends": "../../package.json"
Expand Down
Loading
Loading