-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·31 lines (26 loc) · 1.23 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# wonky bonky scripting, inspiration and explanation here:
# https://www.codejam.info/2023/04/firebase-functions-monorepo.html
# Create output folder
mkdir -p build
# Create tarball for both shared and eslint packages
cd ../../../packages/shared/ || exit
pnpm install --no-frozen-lockfile
pnpm build
pnpm pack
cp devolunch-shared-1.0.0.tgz ../../apps/functions/scraper/devolunch-shared-1.0.0.tgz
cd ../eslint || exit
pnpm install --no-frozen-lockfile
pnpm pack
cp eslint-config-custom-1.0.0.tgz ../../apps/functions/scraper/eslint-config-custom-1.0.0.tgz
# Change devDependencies to point to the new tarball and include everything that's built into the zip
cd ../../apps/functions/scraper || exit
npm pkg set 'devDependencies.@devolunch/shared=file:devolunch-shared-1.0.0.tgz' 'devDependencies.eslint-config-custom=file:eslint-config-custom-1.0.0.tgz'
pnpm install --no-frozen-lockfile
npx make-dedicated-lockfile
pnpm compile
cp -R package.json pnpm-lock.yaml .puppeteerrc.cjs test dist devolunch-shared-1.0.0.tgz eslint-config-custom-1.0.0.tgz build
npm pkg set 'devDependencies.@devolunch/shared=workspace:' 'devDependencies.eslint-config-custom=workspace:'
# Clean up
rm -f devolunch-shared-1.0.0.tgz
rm -f eslint-config-custom-1.0.0.tgz