Skip to content

Commit

Permalink
chore: use pnpm instead of yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Jul 26, 2023
1 parent 3df5d33 commit 118fc17
Show file tree
Hide file tree
Showing 13 changed files with 6,638 additions and 5,754 deletions.
66 changes: 17 additions & 49 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: CI
name: Build

on:
push:
branches:
- main
pull_request:

env:
DEFAULT_NODE_VERSION: 20
permissions: {}

jobs:
tests:
Expand All @@ -22,24 +21,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
- uses: pnpm/action-setup@v2
name: Install pnpm

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Cache node_modules
uses: actions/cache@v3
id: cache-nodemodules
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
cache: pnpm

- name: Install dependencies
if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }}
run: yarn install --frozen-lockfile --non-interactive
run: pnpm install --frozen-lockfile

- name: Unit tests
run: yarn test --ci
- name: Tests
run: pnpm test

lint:
name: Lint
Expand All @@ -49,44 +44,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
name: Install pnpm

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}

- name: Cache node_modules
uses: actions/cache@v3
id: cache-nodemodules
with:
path: node_modules
key: ${{ runner.os }}-${{ env.DEFAULT_NODE_VERSION }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
node-version: "lts/*"
cache: pnpm

- name: Install dependencies
if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }}
run: yarn install --frozen-lockfile --non-interactive
run: pnpm install --frozen-lockfile

- name: Lint
run: yarn lint

release:
needs: [tests, lint]
if: ${{ github.ref == 'refs/heads/main' }}
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}

- name: Release
run: npx semantic-release --branches main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm lint
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
push:
branches:
- main

permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2
name: Install pnpm

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
cache: pnpm

- name: Release
run: pnpm dlx semantic-release --branches main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ coverage
node_modules
npm-debug.log
tests/integration/tmp
yarn-error.log
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tasks:
- init: yarn install
- init: pnpm install
vscode:
extensions:
- dbaeumer.vscode-eslint
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@
Install this grunt plugin next to your project's [Gruntfile.js](http://gruntjs.com/getting-started). You also need to install webpack yourself, this grunt plugin does not install webpack itself.

```bash
yarn add webpack grunt-webpack --dev
// or
// npm i webpack grunt-webpack --save-dev
npm install webpack grunt-webpack --save-dev
```

If you also want to use the webpack-dev-server task you also need to install `webpack-dev-server`

```bash
yarn add webpack-dev-server --dev
npm install webpack-dev-server --save-dev
```

Then add this line to your project's `Gruntfile.js` gruntfile:
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";

module.exports = {
presets: [['@babel/env', { targets: { node: "current" } }]],
presets: [["@babel/env", { targets: { node: "current" } }]],
};
37 changes: 21 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"bugs": {
"url": "https://github.com/webpack-contrib/grunt-webpack/issues"
},
"publishConfig": {
"provenance": true
},
"packageManager": "pnpm@8.6.10",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
Expand All @@ -26,33 +30,34 @@
},
"license": "MIT",
"keywords": [
"gruntplugin"
"gruntplugin",
"webpack",
"grunt"
],
"scripts": {
"lint": "eslint src tasks --report-unused-disable-directives",
"prebump": "yarn test",
"lint": "eslint ./src ./tasks --report-unused-disable-directives",
"test": "jest"
},
"devDependencies": {
"@babel/core": "^7.10.5",
"@babel/preset-env": "^7.10.4",
"babel-loader": "^8.1.0",
"eslint": "^8.2.0",
"eslint-config-prettier": "^8.2.0",
"@babel/core": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"babel-loader": "^9.1.3",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-webpack": "^1.2.5",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-prettier": "^4.0.0",
"fast-glob": "^3.2.4",
"fs-extra": "^10.0.0",
"grunt": "^1.2.1",
"jest": "^28.1.0",
"prettier": "^2.0.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^5.0.0",
"fast-glob": "^3.3.1",
"fs-extra": "^11.1.1",
"grunt": "^1.6.1",
"jest": "^29.6.1",
"prettier": "^3.0.0",
"webpack": "^5.62.1",
"webpack-dev-server": "^4.4.0"
},
"dependencies": {
"deep-for-each": "^3.0.0",
"lodash": "^4.17.19"
"lodash": "^4.17.21"
},
"jest": {
"collectCoverageFrom": [
Expand Down

0 comments on commit 118fc17

Please sign in to comment.