Skip to content

Commit 5c6f011

Browse files
authored
Merge pull request #611 from BloomBooks/BL_harden_deps_pnpm
yarn -> pnpm, volta -> vite+ (BL-16115)
2 parents 2a19aa8 + 28949bc commit 5c6f011

12 files changed

Lines changed: 16925 additions & 10893 deletions

File tree

.github/workflows/build-and-deploy.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,40 @@ jobs:
1616
- name: Checkout repository
1717
uses: actions/checkout@v3
1818

19+
- name: Install Vite+ (manages Node.js and pnpm)
20+
uses: voidzero-dev/setup-vp@v1
21+
with:
22+
version: 0.1.24
23+
node-version-file: .node-version
24+
cache: true
25+
1926
- name: Install dependencies
20-
run: |
21-
if [ "${{ github.ref }}" == "refs/heads/master" ]; then
22-
yarn upgrade bloom-player@alpha --network-timeout 1000000000
23-
else
24-
yarn install --frozen-lockfile --network-timeout 1000000000
25-
fi
27+
# On master, build:ci:alpha bumps bloom-player to the latest alpha, so we
28+
# don't upgrade it here too. Other branches use the locked version.
29+
run: vp install --frozen-lockfile
2630

2731
- name: Upload translations to Crowdin
2832
if: github.ref == 'refs/heads/release'
2933
# Push any new code-based strings to Crowdin
30-
run: yarn crowdin-dangerous-upload
34+
run: vp run crowdin-dangerous-upload
3135
env:
3236
BLOOM_CROWDIN_TOKEN: ${{ secrets.BLOOM_CROWDIN_TOKEN }}
3337

3438
- name: Download translations from Crowdin
35-
run: yarn crowdin-download
39+
run: vp run crowdin-download
3640
env:
3741
BLOOM_CROWDIN_TOKEN: ${{ secrets.BLOOM_CROWDIN_TOKEN }}
3842

3943
- name: Build
4044
run: |
4145
if [ "${{ github.ref }}" == "refs/heads/master" ]; then
42-
yarn build:ci:alpha
46+
vp run build:ci:alpha
4347
else
44-
yarn build:ci
48+
vp run build:ci
4549
fi
4650
4751
- name: Run tests
48-
run: yarn test:ci
52+
run: vp run test:ci
4953

5054
- name: Deploy to S3 - alpha.bloomlibrary.org
5155
if: github.ref == 'refs/heads/master'

.gitignore

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
# dependencies
44
/node_modules
5-
/.pnp
6-
.pnp.js
75

86
# testing
97
/coverage
@@ -19,8 +17,7 @@
1917
.env.production.local
2018

2119
npm-debug.log*
22-
yarn-debug.log*
23-
yarn-error.log*
20+
pnpm-debug.log*
2421

2522
\.nyc_output/
2623

@@ -29,11 +26,6 @@ public/bloom-player/
2926
debug.log
3027
*.orig
3128

32-
# we're not using zero-installs yet
33-
.yarn/*
34-
35-
.yarnrc.yml
36-
3729
# Translations handling:
3830
# First ignore everything in translations
3931
src/translations/*

.husky/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn pretty-quick --staged
5-
yarn lint-staged
4+
pnpm exec pretty-quick --staged
5+
pnpm exec lint-staged

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.22.3

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
A web site ([bloomlibrary.org](https://bloomlibrary.org)) for sharing literacy materials, especially templates for translation into minority languages.
1+
A crowd-sourced web site ([bloomlibrary.org](https://bloomlibrary.org)) for sharing literacy materials, especially templates for translation into minority languages.
22

33
Language speakers find books in their own language, and book creators find shellbooks to translate. They upload these to share them with the world.
44

@@ -8,17 +8,16 @@ Language speakers find books in their own language, and book creators find shell
88

99

1010
## Get dependencies
11-
You'll need nodejs and yarn. Please install [volta](https://github.com/volta-cli/volta) so that you automatically use the correct version of nodejs and yarn that this project requires, as specified in `package.json`.
12-
Finally, run `yarn` in a command line (e.g. in VSCode) to install the library dependencies.
11+
This project uses [Vite+](https://viteplus.dev) (the `vp` CLI) to manage the Node.js runtime and the pnpm package manager, so you don't need to install those separately. Install `vp` (see the [Vite+ docs](https://viteplus.dev)), then run `vp install` in a command line (e.g. in VSCode). That selects the correct Node.js version (from `.node-version`) and the pinned pnpm (from `package.json`), and installs the library dependencies.
1312

1413
## Run locally
15-
To run the site locally, do `yarn dev`
14+
To run the site locally, do `vp run dev`
1615

1716
## Storybook
18-
To see various components/scenarios, do `yarn storybook`
17+
To see various components/scenarios, do `vp run storybook`
1918

2019
## Unit Tests
21-
To run the unit tests, do `yarn test`
20+
To run the unit tests, do `vp run test`
2221

2322

2423
### Pointing to Prod, Dev, or Local
@@ -33,8 +32,8 @@ BloomLibrary depends upon on the [bloom-player](https://github.com/BloomBooks/bl
3332
This is installed as a normal dependency. However, sometimes during the development process you may wish to run your own local build of bloom-player.
3433

3534
If you need to do that, there are a couple options:
36-
### A) yarn link
37-
One option is to ```yarn link``` ([docs](https://classic.yarnpkg.com/lang/en/docs/cli/link/)) to the local bloom-player source code on the same computer.
35+
### A) pnpm link
36+
One option is to ```pnpm link``` ([docs](https://pnpm.io/cli/link)) to the local bloom-player source code on the same computer.
3837

3938
### B) manual copy
4039
Another option is to manually copy the bloom-player's `/dist` folder build to BloomLibrary's `node_modules/bloom-player/dist`.

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ <h1>
8585
You can add webfonts, meta tags, or analytics to this file.
8686
The build step will place the bundled scripts into the <body> tag.
8787
88-
To begin the development, run `npm start` or `yarn start`.
89-
To create a production bundle, use `npm run build` or `yarn build`.
88+
To begin the development, run `vp run dev`.
89+
To create a production bundle, use `vp run build`.
9090
9191
(The phony onclick is a bizarre workaround for an IOS bug.)
9292
-->

0 commit comments

Comments
 (0)