Skip to content

Commit d607e10

Browse files
authored
feat: PNPM (#419)
# Description Migrates the project to PNPM ## Issue Ticket Number Fixes #408 <!-- Specify above which issue this fixes by referencing the issue number (`#<ISSUE_NUMBER>`) or issue URL. --> <!-- Example: Fixes https://github.com/cloudinary-community/next-cloudinary/issues/<ISSUE_NUMBER> --> ## Type of change <!-- Please select all options that are applicable. --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Fix or improve the documentation - [ ] This change requires a documentation update # Checklist <!-- These must all be followed and checked. --> - [ ] I have followed the contributing guidelines of this project as mentioned in [CONTRIBUTING.md](/CONTRIBUTING.md) - [ ] I have created an [issue](https://github.com/cloudinary-community/next-cloudinary/issues) ticket for this PR - [ ] I have checked to ensure there aren't other open [Pull Requests](https://github.com/cloudinary-community/next-cloudinary/pulls) for the same update/change? - [ ] I have performed a self-review of my own code - [ ] I have run tests locally to ensure they all pass - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes needed to the documentation
1 parent 324a0be commit d607e10

File tree

12 files changed

+9189
-13463
lines changed

12 files changed

+9189
-13463
lines changed

.github/workflows/test_and_release.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,23 @@ jobs:
1111
node: [ '18', '20' ]
1212
steps:
1313
- uses: actions/checkout@v2
14+
15+
- uses: pnpm/action-setup@v2
16+
with:
17+
version: 7
18+
1419
- uses: actions/setup-node@v3
1520
with:
1621
node-version: ${{ matrix.node }}
17-
- run: yarn install --frozen-lockfile
22+
cache: 'pnpm'
23+
24+
- run: pnpm install --frozen-lockfile
1825
working-directory: ./next-cloudinary
19-
- run: yarn test
26+
27+
- run: pnpm test
2028
working-directory: ./next-cloudinary
21-
- run: yarn test:app
29+
30+
- run: pnpm test:app
2231
working-directory: ./next-cloudinary
2332

2433
release:
@@ -30,15 +39,23 @@ jobs:
3039
- uses: actions/checkout@v2
3140
with:
3241
fetch-depth: 0
42+
43+
- uses: pnpm/action-setup@v2
44+
with:
45+
version: 7
46+
3347
- uses: actions/setup-node@v3
3448
with:
3549
node-version: '20'
36-
- name: Install dependencies
37-
run: yarn install --frozen-lockfile
38-
# Semantic Release is incompatible with node 16 - so add these only on release
39-
- run: yarn add @semantic-release/changelog @semantic-release/git semantic-release -W
40-
- name: Release
50+
cache: 'pnpm'
51+
# https://github.com/pnpm/pnpm/issues/3141
52+
registry-url: 'https://registry.npmjs.org'
53+
54+
- run: pnpm install --frozen-lockfile
55+
56+
- run: pnpm release
4157
env:
4258
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4359
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44-
run: npx semantic-release
60+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61+

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers = true

.releaserc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
}
4141
],
4242
[
43-
"@semantic-release/npm",
43+
"@colbyfayock/semantic-release-pnpm",
4444
{
4545
"pkgRoot": "next-cloudinary"
4646
}

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ High-performance image delivery and uploading at scale in Next.js powered by Clo
3939
### Installation
4040

4141
* Install `next-cloudinary` with:
42+
4243
```
43-
yarn add next-cloudinary
44-
# or
4544
npm install next-cloudinary
4645
```
4746

@@ -91,12 +90,12 @@ Please read [CONTRIBUTING.md](https://github.com/cloudinary-community/next-cloud
9190

9291
#### Installation
9392

94-
This project is using [yarn](https://yarnpkg.com/) as a way to manage dependencies and workspaces.
93+
This project is using [pnpm](https://pnpm.io/) as a way to manage dependencies and workspaces.
9594

9695
With the project cloned, install the dependencies from the root of the project with:
9796

9897
```
99-
yarn install
98+
pnpm install
10099
```
101100

102101
#### Configuration
@@ -128,7 +127,7 @@ CLOUDINARY_API_SECRET="<Your API Secret>"
128127
Then run the upload script with:
129128

130129
```
131-
yarn upload
130+
pnpm upload
132131
```
133132

134133
By default, the images inside of `scripts/images.json` will be uploaded to the "images" directory inside of your Cloudinary account. To change the location, add the `CLOUDINARY_IMAGES_DIRECTORY` environment variable with your preferred directory:
@@ -142,7 +141,7 @@ CLOUDINARY_IMAGES_DIRECTORY="<Your Directory>"
142141
Once installed and configured, open two terminal tabs, navigating one to `next-cloudinary` and one to `docs`, running the following command in each:
143142

144143
```
145-
yarn dev
144+
pnpm dev
146145
```
147146

148147
The project will now be available at <https://localhost:3000> or the configured local port.
@@ -154,7 +153,7 @@ All tests are located inside of `next-cloudinary/tests` with a directory structu
154153
While inside `next-cloudinary`, run tests with:
155154

156155
```
157-
yarn test
156+
pnpm test
158157
```
159158

160159
## Contributors

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@cloudinary-util/url-loader": "^4.0.1",
12+
"@cloudinary-util/url-loader": "4.2.0",
1313
"@cloudinary-util/util": "^3.0.0",
1414
"@vercel/analytics": "^1.0.1",
1515
"cloudinary": "^1.37.3",

0 commit comments

Comments
 (0)