From b50951f4daf4ba46ee0bb6aff3bee333fce6b176 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Thu, 11 Jan 2024 07:35:37 -0500 Subject: [PATCH] cp brew in how to install vite (#4803) Fixes #4751 Fixes #4498 --- projects/vitejs.dev/package.yml | 48 ++++++++++++++------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/projects/vitejs.dev/package.yml b/projects/vitejs.dev/package.yml index ff96ab22..fc3c4cd5 100644 --- a/projects/vitejs.dev/package.yml +++ b/projects/vitejs.dev/package.yml @@ -1,40 +1,32 @@ distributable: - url: https://github.com/vitejs/vite/archive/refs/tags/v{{version.raw}}.tar.gz + url: https://registry.npmjs.org/vite/-/vite-{{version}}.tgz strip-components: 1 versions: github: vitejs/vite/tags strip: /v/ +dependencies: + nodejs.org: ^16 || ^18 || ^20 + build: - dependencies: - pnpm.io: '*' - nodejs.org: ^16 || ^18 || ^20 - deno.land: ^1.39 # Required - script: - - mkdir -p {{prefix}}/bin - # prevent pnpm from using symlinks - - echo "node-linker=hoisted" >> .npmrc - - echo "node-linker=hoisted" >> packages/vite/.npmrc + - npm install . + --global + --install-links + --prefix="{{prefix}}" - - pnpm i - - rm -rf node_modules - - - run: | - pnpm i - sed -i 's/163/200/g' rollup.config.ts - - # Required because it'll fail but still generate the required files - pnpm build || true - working-directory: packages/vite - - - rm -rf node_modules - - pnpm i - - - deno compile -o vite -Ar --unstable --unstable-byonm --node-modules-dir node_modules/vite/bin/vite.js - - cp vite {{prefix}}/bin/vite - # deno binaries are destroyed if patchelfed - skip: fix-patchelf + # minimize universal binaries + #TODO should probs be a general step we perform in CI/CD + - run: + - for x in $(pkgx fd --type x); do + # not all are unix binaries and I couldn’t find a command to filter + # for those properly + - | + if lipo $x -thin $(uname -m) -output $x.new; then + mv $x.new $x + fi + - done + working-directory: ${{prefix}}/lib test: dependencies: