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

refactor(snackager): drop npm@6 version requirement #592

Merged
merged 7 commits into from
Jul 11, 2024
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
6 changes: 0 additions & 6 deletions .github/actions/setup-snackager/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ runs:
node-version: ${{ inputs.node-version }}
cache: yarn

# npm v7+ doesn't work well with our monorepo
- name: 🐛 Downgrade npm to v6
run: npm install --global npm@^6
working-directory: ../
shell: bash

- name: 📦 Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
shell: bash
Expand Down
16 changes: 12 additions & 4 deletions packages/snack-runtime/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8801,10 +8801,10 @@ snack-babel-standalone@^4.0.0:
resolved "https://registry.yarnpkg.com/snack-babel-standalone/-/snack-babel-standalone-4.0.0.tgz#17ee9134a515af3e2fc44d90598656c0903f665c"
integrity sha512-DB01CChul97KielzlP88miUx93E0o6ebnbNa2aah+KIl+vwcXbTuzc55KNNNrGELF5N8rpd74PYi23y/DqemKA==

snack-content@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/snack-content/-/snack-content-2.0.0.tgz#74f0e39467655bce9cec9f513201780471c237c7"
integrity sha512-oDoIuGEd3uSs/8eEdNbj2Jmq9g9iRbagGFpWmb01isKhJmN2s5Maq42I6toOq6mOWCaX69uiNlioOUzlFkt09g==
snack-content@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/snack-content/-/snack-content-3.0.0.tgz#a5d94c7973c5d3aeed82204aec415f393b87d5ec"
integrity sha512-q8y3OivrqEpy7jdahs3UlXGtv3SM2XE/lotMeTkv6FVC1eZ2djcmEQG322jpHwIZ7DzQdk8TT2n8nAk2mSY2dQ==
dependencies:
semver "^7.3.4"

Expand Down Expand Up @@ -9117,6 +9117,14 @@ sucrase@3.34.0:
version "3.34.0"
resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.34.0.tgz#1e0e2d8fcf07f8b9c3569067d92fbd8690fb576f"
integrity sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==
dependencies:
"@jridgewell/gen-mapping" "^0.3.2"
commander "^4.0.0"
glob "7.1.6"
lines-and-columns "^1.1.6"
mz "^2.7.0"
pirates "^4.0.1"
ts-interface-checker "^0.1.9"

sudo-prompt@9.1.1:
version "9.1.1"
Expand Down
3 changes: 0 additions & 3 deletions snackager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ ENV NODE_OPTIONS --openssl-legacy-provider
ARG APP_VERSION
ENV APP_VERSION ${APP_VERSION}

# Install system dependencies
RUN npm install --global npm@^6


# --- Development - Prepare Snackager for development
FROM base as development
Expand Down
3 changes: 1 addition & 2 deletions snackager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
"source-map-support": "^0.4.15",
"targz": "^1.0.1",
"validate-npm-package-name": "^3.0.0",
"webpack": "^5.40.0",
"yarn": "^1.22.5"
"webpack": "^5.40.0"
},
"devDependencies": {
"@google-cloud/secret-manager": "^5.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ exports[`git imports repository with app.config.js 1`] = `
},
"description": "some-example @ Jan 1, 2020",
"name": "some-example",
"sdkVersion": "51.0.0",
"sdkVersion": "50.0.0",
},
},
"headers": {
Expand Down
6 changes: 2 additions & 4 deletions snackager/src/utils/installDependencies.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import spawnAsync, { SpawnPromise, SpawnResult } from '@expo/spawn-async';
import path from 'path';

import logger from '../logger';
import { Package } from '../types';
Expand Down Expand Up @@ -39,9 +38,8 @@ export function spawnSafeAsync(
}

export async function getYarnPackagerAsync(): Promise<string> {
const npmBinOutput = await spawnSafeAsync('npm', ['bin']);
const yarn = path.resolve(npmBinOutput.stdout.trim(), 'yarn');
return yarn;
const yarnBinaryPath = await spawnSafeAsync('which', ['yarnpkg']);
return yarnBinaryPath.stdout.trim();
}

async function installDependencyAsync(
Expand Down
43 changes: 37 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4426,7 +4426,7 @@ ansi-to-html@^0.6.14:
dependencies:
entities "^1.1.2"

any-promise@^1.1.0:
any-promise@^1.0.0, any-promise@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
integrity sha1-q8av7tzqUugJzcA3au0845Y10X8=
Expand Down Expand Up @@ -12254,6 +12254,15 @@ mv@~2:
ncp "~2.0.0"
rimraf "~2.4.0"

mz@^2.7.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32"
integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==
dependencies:
any-promise "^1.0.0"
object-assign "^4.0.1"
thenify-all "^1.0.0"

nan@^2.12.1, nan@^2.14.0:
version "2.14.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19"
Expand Down Expand Up @@ -15603,6 +15612,14 @@ sucrase@3.34.0:
version "3.34.0"
resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.34.0.tgz#1e0e2d8fcf07f8b9c3569067d92fbd8690fb576f"
integrity sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==
dependencies:
"@jridgewell/gen-mapping" "^0.3.2"
commander "^4.0.0"
glob "7.1.6"
lines-and-columns "^1.1.6"
mz "^2.7.0"
pirates "^4.0.1"
ts-interface-checker "^0.1.9"

sudo-block@^3.0.0:
version "3.0.0"
Expand Down Expand Up @@ -15835,6 +15852,20 @@ text-table@^0.2.0:
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==

thenify-all@^1.0.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726"
integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==
dependencies:
thenify ">= 3.1.0 < 4"

"thenify@>= 3.1.0 < 4":
version "3.3.1"
resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f"
integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==
dependencies:
any-promise "^1.0.0"

throat@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b"
Expand Down Expand Up @@ -16052,6 +16083,11 @@ ts-api-utils@^1.0.1:
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331"
integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==

ts-interface-checker@^0.1.9:
version "0.1.13"
resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699"
integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==

ts-jest@^26.5.0:
version "26.5.0"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.0.tgz#3e3417d91bc40178a6716d7dacc5b0505835aa21"
Expand Down Expand Up @@ -17444,11 +17480,6 @@ yargs@~3.10.0:
decamelize "^1.0.0"
window-size "0.1.0"

yarn@^1.22.5:
version "1.22.10"
resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.10.tgz#c99daa06257c80f8fa2c3f1490724e394c26b18c"
integrity sha512-IanQGI9RRPAN87VGTF7zs2uxkSyQSrSPsju0COgbsKQOOXr5LtcVPeyXWgwVa0ywG3d8dg6kSYKGBuYK021qeA==

ylru@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.2.1.tgz#f576b63341547989c1de7ba288760923b27fe84f"
Expand Down
Loading