Skip to content

Commit fc7b23d

Browse files
committed
Prepare for npm v12 - bump sharp
1 parent 87bdeb0 commit fc7b23d

3 files changed

Lines changed: 6 additions & 93 deletions

File tree

.changeset/uploadfs-sharp-035.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"uploadfs": minor
3+
---
4+
5+
Upgraded the optional `sharp` image-processing dependency from `^0.32.6` to `^0.35.2`. Since 0.33, sharp distributes its prebuilt binaries as platform-specific `@img/sharp-*` packages, and as of 0.35 it no longer runs an install script (the previous `node-gyp`/`prebuild-install` step). This removes a deprecation warning and prepares projects for npm v12, where dependency install scripts are disabled by default.

.github/workflows/monorepo.yml

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -147,83 +147,11 @@ jobs:
147147
docker pull "postgres:${{ env.POSTGRES_VERSION }}"
148148
docker save "postgres:${{ env.POSTGRES_VERSION }}" -o ".github/docker-cache/postgres-${{ env.POSTGRES_VERSION }}.tar"
149149
150-
warm-sharp-cache:
151-
name: Warm sharp/libvips cache (Node ${{ matrix.nodeVersion }})
152-
runs-on: ubuntu-latest
153-
needs:
154-
- setup
155-
- shared-runtime
156-
if: needs.setup.outputs.has-packages == 'true'
157-
strategy:
158-
fail-fast: false
159-
matrix:
160-
nodeVersion: ${{ fromJson(needs.setup.outputs['node-versions']) }}
161-
steps:
162-
- name: Git checkout
163-
uses: actions/checkout@v5
164-
with:
165-
fetch-depth: 0
166-
167-
- name: Download pnpm lockfile
168-
uses: actions/download-artifact@v4
169-
with:
170-
name: pnpm-lock
171-
path: .
172-
173-
- name: Install pnpm
174-
uses: pnpm/action-setup@v4
175-
with:
176-
version: 10.18.0
177-
178-
- name: Use Node.js ${{ matrix.nodeVersion }}
179-
uses: actions/setup-node@v4
180-
with:
181-
node-version: ${{ matrix.nodeVersion }}
182-
cache: pnpm
183-
cache-dependency-path: pnpm-lock.yaml
184-
185-
# Provide headers so sharp can compile from source when
186-
# prebuilt binaries fail to download.
187-
# Disabled for now as it adds time for each job. If we
188-
# keep seeing related issues we can re-enable it.
189-
# - name: Install libvips build dependencies
190-
# run: |
191-
# sudo apt-get update
192-
# sudo apt-get install -y --no-install-recommends libvips-dev
193-
194-
- name: Grant private repositories access
195-
uses: webfactory/ssh-agent@v0.9.0
196-
with:
197-
ssh-private-key: |
198-
${{ secrets.AUTOMATIC_TRANSLATION_DEPLOYMENT_KEY }}
199-
200-
- name: Cache sharp/libvips downloads
201-
id: sharp-cache
202-
uses: actions/cache@v4
203-
with:
204-
path: |
205-
~/.npm/_libvips
206-
key: sharp-libvips-${{ runner.os }}-node${{ matrix.nodeVersion }}-${{ hashFiles('pnpm-lock.yaml') }}
207-
restore-keys: |
208-
sharp-libvips-${{ runner.os }}-node${{ matrix.nodeVersion }}-
209-
sharp-libvips-${{ runner.os }}-
210-
211-
- name: Warm cache by installing dependencies once
212-
run: pnpm install --frozen-lockfile
213-
214-
- name: Debug sharp/libvips cache contents
215-
if: always()
216-
run: |
217-
echo "-- ~/.npm/_libvips"
218-
ls -alh ~/.npm/_libvips || true
219-
du -sh ~/.npm/_libvips || true
220-
221150
package-tests:
222151
name: ${{ format('{0} ({1}, {2}{3})', matrix.group, matrix.nodeVersion, matrix.adapter || 'n/a', matrix.needsMongo && format(' mongo {0}', matrix.mongodbVersion) || '') }}
223152
needs:
224153
- setup
225154
- shared-runtime
226-
- warm-sharp-cache
227155
if: needs.setup.outputs.has-packages == 'true'
228156
runs-on: ubuntu-latest
229157
strategy:
@@ -253,32 +181,12 @@ jobs:
253181
cache: pnpm
254182
cache-dependency-path: pnpm-lock.yaml
255183

256-
- name: Cache sharp/libvips downloads
257-
id: sharp-cache
258-
uses: actions/cache@v4
259-
with:
260-
path: |
261-
~/.npm/_libvips
262-
key: sharp-libvips-${{ runner.os }}-node${{ matrix.nodeVersion }}-${{ hashFiles('pnpm-lock.yaml') }}
263-
restore-keys: |
264-
sharp-libvips-${{ runner.os }}-node${{ matrix.nodeVersion }}-
265-
sharp-libvips-${{ runner.os }}-
266-
267184
- name: Grant private repositories access
268185
uses: webfactory/ssh-agent@v0.9.0
269186
with:
270187
ssh-private-key: |
271188
${{ secrets.AUTOMATIC_TRANSLATION_DEPLOYMENT_KEY }}
272189
273-
# Same safety net: ensures node-gyp builds succeed when
274-
# sharp's prebuild-install hits the network fallback.
275-
# Disabled for now as it adds time for each job. If we
276-
# keep seeing related issues we can re-enable it.
277-
# - name: Install libvips build dependencies
278-
# run: |
279-
# sudo apt-get update
280-
# sudo apt-get install -y --no-install-recommends libvips-dev
281-
282190
- name: Restore docker image cache
283191
id: docker-cache-restore
284192
uses: actions/cache/restore@v4

packages/uploadfs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@azure/storage-blob": "^12.14.0",
4040
"@google-cloud/storage": "^7.19.0",
4141
"@smithy/node-http-handler": "^4.4.0",
42-
"sharp": "^0.32.6"
42+
"sharp": "^0.35.2"
4343
},
4444
"devDependencies": {
4545
"eslint": "^9.39.1",

0 commit comments

Comments
 (0)