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

chore: move to pnpm #38

Merged
merged 27 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
41813ee
Add release workflow
raducristianpopa Dec 5, 2023
7712c05
Update package.json license
raducristianpopa Dec 5, 2023
5a1847c
Remove upload workflow
raducristianpopa Dec 5, 2023
5887f7d
Pin Ubuntu version
raducristianpopa Dec 5, 2023
f808a80
Add sanity checks workflow
raducristianpopa Dec 5, 2023
6133eed
Add custom scripts and preview template
raducristianpopa Dec 5, 2023
1bd5415
Merge branch 'main' into rp--pr-workflows
raducristianpopa Dec 6, 2023
9e7cbbd
Add PR checks and build previews workflow
raducristianpopa Dec 6, 2023
c252db3
Add delete artifacts workflow
raducristianpopa Dec 6, 2023
eaf2796
Update workflows config, template and scripts
raducristianpopa Dec 6, 2023
438c2b3
Update find comment args
raducristianpopa Dec 6, 2023
535f50c
Pin Ubuntu version for all workflows
raducristianpopa Dec 6, 2023
3e30e2d
Small refactor
raducristianpopa Dec 6, 2023
d66dc3c
Use core for workflow failure
raducristianpopa Dec 6, 2023
902703a
Remove ENV for `get-workflow-artifacts` script
raducristianpopa Dec 6, 2023
9ae631a
Remove unused deps and start migrating to PNPM
raducristianpopa Dec 7, 2023
5d3ed6f
Add events and webextension-polyfills types
raducristianpopa Dec 7, 2023
b27c1d1
Add composite workflow and move actions to PNPM
raducristianpopa Dec 7, 2023
d008bb6
Restore package.json build script changes
raducristianpopa Dec 7, 2023
e04b4bb
Update formatBytes utility function
raducristianpopa Dec 11, 2023
10d2f83
Update template to prevent comment mismatch
raducristianpopa Dec 11, 2023
e983aba
Add PR checks concurrency
raducristianpopa Dec 11, 2023
e98d04b
Return early if workflow gets cancelled
raducristianpopa Dec 11, 2023
6cdd80b
Move action scripts to github folder
raducristianpopa Dec 11, 2023
0f326bd
Merge branch 'rp--pr-workflows' into rp--move-to-pnpm
raducristianpopa Dec 11, 2023
a08f195
Update workflows
raducristianpopa Dec 11, 2023
8ed634c
Merge branch 'main' into rp--move-to-pnpm
raducristianpopa Dec 12, 2023
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
Empty file removed .env
Empty file.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The team will review your pull request as soon as possible.

### Working in the Web Monetization Extension repository

This project uses `yarn`. A list of steps for setting up a [local development environment](https://github.com/interledger/web-monetization-extension/#development) can be found in the Readme.
This project uses `PNPM`. A list of steps for setting up a [local development environment](https://github.com/interledger/web-monetization-extension/#development) can be found in the Readme.

#### Code quality

Expand Down
33 changes: 33 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Environment setup

runs:
using: 'composite'

steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 'lts/hydrogen'

- name: Install PNPM
uses: pnpm/action-setup@v2
with:
run_install: false

- name: Get PNPM store path
id: pnpm-cache
shell: bash
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup PNPM cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
12 changes: 3 additions & 9 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies
run: rm -rf node_modules && yarn install --frozen-lockfile
- name: Environment setup
uses: ./.github/actions/setup

- name: Build
run: yarn build:${{ matrix.browser }}
run: pnpm build:${{ matrix.browser }}

- name: Upload artifacts
uses: actions/[email protected]
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'

- name: Install dependencies
run: rm -rf node_modules && yarn install --frozen-lockfile
- name: Environment setup
uses: ./.github/actions/setup

- name: Build extension for all browsers
run: yarn build
- name: Build
run: pnpm build

- name: Release
uses: softprops/action-gh-release@v1
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'

- name: Install dependencies
run: rm -rf node_modules && yarn install --frozen-lockfile
- name: Environment setup
uses: ./.github/actions/setup

- name: Build
run: yarn build:${{ matrix.browser }}
run: pnpm build:${{ matrix.browser}}
6 changes: 0 additions & 6 deletions .markdownlint.json

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
public
generated
dist
yarn.lock
pnpm-lock.yaml
*.svg
.gitignore
.prettierignore
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Please read the [contribution guidelines](.github/CONTRIBUTING.md) before submit

1. Clone the repository from GitHub: `git clone https://github.com/interledger/web-monetization-extension.git`
2. Navigate to the project directory: `cd web-monetization-extension`
3. Install the dependencies using Yarn: `yarn install`
3. Install the dependencies using PNPM: `pnpm install`

### Development

To run the extension in development mode with hot reload, use the following command:

`yarn dev`
`pnpm dev`

This command builds the extension using Vite's hot reload feature, allowing you to see immediate changes in the browser
as you modify the code.
Expand All @@ -30,13 +30,13 @@ as you modify the code.

To build the extension for production, use the following command:

`yarn build`
`pnpm build`

### Building the Extension for Firefox

To build the extension for Firefox, use the following command:

`yarn build:firefox`
`pnpm build:firefox`

This command transpiles the TypeScript code and generates a production-ready build of the extension in the dist
directory.
Expand Down Expand Up @@ -81,7 +81,7 @@ To install the extension in Chrome, follow these steps:

To run the tests, use the following command:

`yarn test`
`pnpm test`

This command runs the tests using Jest and generates a coverage report in the coverage directory.

Expand Down
218 changes: 107 additions & 111 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,113 +1,109 @@
{
"name": "web-monetization-extension",
"description": "Web Monetization is a browser API that allows the creation of a payment stream from the user agent to the website.",
"version": "0.2.3",
"scripts": {
"dev:chrome": "cross-env NODE_ENV=development TARGET=chrome webpack",
"dev:firefox": "cross-env NODE_ENV=development TARGET=firefox webpack",
"dev:opera": "cross-env NODE_ENV=development TARGET=opera webpack",
"dev:edge": "cross-env NODE_ENV=development TARGET=edge webpack",
"profile:chrome": "cross-env NODE_ENV=profile TARGET=chrome webpack",
"profile:firefox": "cross-env NODE_ENV=profile TARGET=firefox webpack",
"profile:opera": "cross-env NODE_ENV=profile TARGET=opera webpack",
"profile:edge": "cross-env NODE_ENV=profile TARGET=edge webpack",
"build:chrome": "cross-env NODE_ENV=production TARGET=chrome webpack",
"build:firefox": "cross-env NODE_ENV=production TARGET=firefox webpack",
"build:opera": "cross-env NODE_ENV=production TARGET=opera webpack",
"build:edge": "cross-env NODE_ENV=production TARGET=edge webpack",
"build": "concurrently \"yarn:build:*\"",
"lint": "run-p lint:*",
"lint:fix": "eslint --ext js,jsx,ts,tsx, src --fix",
"lint:eslint": "eslint . --ext .js,.ts,.tsx --max-warnings 0 --ignore-path .gitignore",
"lint:prettier": "prettier \"**/*.(md|json|yml)\" --ignore-path .gitignore --check",
"lint:type": "tsc --noEmit",
"test": "jest",
"ci:test": "run-s \" test --ci --reporters=\"default\" --reporters=\"github-actions\" \""
},
"husky": {
"hooks": {
"pre-commit": "yarn ci:test && lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix --report-unused-disable-directives"
],
"*.json": "prettier --write"
},
"dependencies": {
"axios": "^1.5.1",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"core-js": "^3.32.1",
"cross-env": "^7.0.3",
"css-loader": "^6.8.1",
"dotenv": "^16.3.1",
"html-webpack-plugin": "^5.5.3",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.66.1",
"sass-loader": "^13.3.2",
"style-loader": "^3.3.3",
"terser-webpack-plugin": "^5.3.9",
"ts-node": "^10.9.1",
"uuid": "^9.0.1",
"webextension-polyfill": "^0.10.0",
"webpack": "^5.88.2",
"webpack-bundle-analyzer": "^4.9.1",
"webpack-ext-reloader-mv3": "^2.1.1",
"webpack-extension-manifest-plugin": "^0.8.0",
"zip-webpack-plugin": "^4.0.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@types/chrome": "^0.0.244",
"@types/inboxsdk": "^2.0.11",
"@types/jest": "^29.5.5",
"@types/jquery": "^3.5.18",
"@types/lodash": "^4.14.197",
"@types/node": "^20.8.4",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@types/react-router-dom": "^5.3.3",
"@types/redux": "^3.6.31",
"@types/uuid": "^9.0.5",
"@types/webpack-bundle-analyzer": "^4.6.0",
"@types/zip-webpack-plugin": "^3.0.4",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"concurrently": "^8.2.2",
"eslint": "^8.48.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jest": "^26.1.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-webpack-plugin": "^4.0.1",
"husky": "^8.0.3",
"jest": "^29.7.0",
"jest-chrome": "^0.8.0",
"jest-environment-jsdom": "^29.7.0",
"jest-transform-stub": "^2.0.0",
"lint-staged": "^14.0.1",
"prettier": "^3.0.3",
"ts-loader": "^9.4.4",
"typescript": "^5.2.2",
"webpack-cli": "^5.1.4"
},
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/interledger/web-monetization-extension"
}
"name": "web-monetization-extension",
"description": "Web Monetization is a browser API that allows the creation of a payment stream from the user agent to the website.",
"private": true,
"version": "0.2.3",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/interledger/web-monetization-extension"
},
"scripts": {
"dev:chrome": "NODE_ENV=development TARGET=chrome webpack",
"dev:firefox": "NODE_ENV=development TARGET=firefox webpack",
"dev:opera": "NODE_ENV=development TARGET=opera webpack",
"dev:edge": "NODE_ENV=development TARGET=edge webpack",
"profile:chrome": "NODE_ENV=profile TARGET=chrome webpack",
"profile:firefox": "NODE_ENV=profile TARGET=firefox webpack",
"profile:opera": "NODE_ENV=profile TARGET=opera webpack",
"profile:edge": "NODE_ENV=profile TARGET=edge webpack",
"build:chrome": "NODE_ENV=production TARGET=chrome webpack",
"build:firefox": "NODE_ENV=production TARGET=firefox webpack",
"build:opera": "NODE_ENV=production TARGET=opera webpack",
"build:edge": "NODE_ENV=production TARGET=edge webpack",
"build": "concurrently \"pnpm:build:*\"",
"lint": "concurrently \"lint:*\"",
"lint:fix": "eslint --ext js,jsx,ts,tsx, src --fix",
"lint:eslint": "eslint . --ext .js,.ts,.tsx --max-warnings 0 --ignore-path .gitignore",
"lint:prettier": "prettier \"**/*.(md|json|yml)\" --ignore-path .gitignore --check",
"lint:type": "tsc --noEmit",
"test": "jest --maxWorkers=2",
"ci:test": "run-s \" test --ci --reporters=\"default\" --reporters=\"github-actions\" \""
},
"dependencies": {
"axios": "^1.5.1",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"core-js": "^3.32.1",
"css-loader": "^6.8.1",
"dotenv": "^16.3.1",
"events": "^3.3.0",
"html-webpack-plugin": "^5.5.3",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.66.1",
"sass-loader": "^13.3.2",
"style-loader": "^3.3.3",
"terser-webpack-plugin": "^5.3.9",
"ts-node": "^10.9.1",
"uuid": "^9.0.1",
"webextension-polyfill": "^0.10.0",
"webpack": "^5.88.2",
"webpack-bundle-analyzer": "^4.9.1",
"webpack-ext-reloader-mv3": "^2.1.1",
"webpack-extension-manifest-plugin": "^0.8.0",
"zip-webpack-plugin": "^4.0.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@types/chrome": "^0.0.244",
"@types/inboxsdk": "^2.0.11",
"@types/jest": "^29.5.5",
"@types/jquery": "^3.5.18",
"@types/lodash": "^4.14.197",
"@types/node": "^20.8.4",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@types/react-router-dom": "^5.3.3",
"@types/redux": "^3.6.31",
"@types/uuid": "^9.0.5",
"@types/webextension-polyfill": "^0.10.7",
"@types/webpack-bundle-analyzer": "^4.6.0",
"@types/zip-webpack-plugin": "^3.0.4",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"concurrently": "^8.2.2",
"eslint": "^8.48.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jest": "^26.1.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-webpack-plugin": "^4.0.1",
"jest": "^29.7.0",
"jest-chrome": "^0.8.0",
"jest-environment-jsdom": "^29.7.0",
"jest-transform-stub": "^2.0.0",
"prettier": "^3.0.3",
"ts-loader": "^9.4.4",
"typescript": "^5.2.2",
"webpack-cli": "^5.1.4"
},
"engines": {
"pnpm": "^8.10.5",
"npm": "pnpm",
"yarn": "pnpm",
"node": "^18.19.0"
},
"packageManager": "[email protected]"
}
Loading