Skip to content

Commit 2acacd3

Browse files
authored
feat(cli): Use and recommend pnpm instead of yarn (#3016)
* wip: pnpm default * allow sharp to run scripts * formatting fixes * upgrade circle ci node version * force cache clean * PR feedback * add yes * add back gitignore items, fix typos, remove yarn4 recommend * shhhh linter
1 parent 5f5e00a commit 2acacd3

28 files changed

+8209
-12233
lines changed

.circleci/config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
defaults: &defaults
77
docker:
88
# Choose the version of Node you want here
9-
- image: cimg/node:20.17.0
9+
- image: cimg/node:20.19.4
1010
working_directory: /mnt/ramdisk/repo
1111

1212
version: 2.1
@@ -33,12 +33,12 @@ jobs:
3333
- restore_cache:
3434
name: Restore node modules
3535
keys:
36-
- v1-dependencies-{{ checksum "package.json" }}-{{ arch }}
36+
- v2-dependencies-{{ checksum "package.json" }}-{{ arch }}
3737
# fallback to using the latest cache if no exact match is found
38-
- v1-dependencies-
38+
- v2-dependencies-
3939
- run:
4040
name: Install dependencies
41-
command: yarn install
41+
command: pnpm install
4242
- save_cache:
4343
name: Save node modules
4444
paths:
@@ -59,10 +59,10 @@ jobs:
5959
key: ignite-deps-cache-{{ .Environment.IGNITE_DEPS_PACKAGER }}-{{ checksum "boilerplate/package.json" }}-{{ arch }}-{{ .Environment.IGNITE_DEPS_KEY_SUFFIX }}
6060
- run:
6161
name: Run static tests
62-
command: yarn format:check && yarn lint && yarn typecheck && yarn depcruise
62+
command: pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run depcruise
6363
- run:
6464
name: Run jest tests
65-
command: yarn test
65+
command: pnpm run test
6666
no_output_timeout: 10m
6767
- save_cache:
6868
name: Save ignite dependency cache
@@ -83,11 +83,11 @@ jobs:
8383
- v1-dependencies-
8484
- run:
8585
name: Build package
86-
command: yarn build
86+
command: pnpm run build
8787
# Run semantic-release after all the above is set.
8888
- run:
8989
name: Publish to npm
90-
command: yarn ci:publish # this will be added to your package.json scripts
90+
command: pnpm run ci:publish # this will be added to your package.json scripts
9191

9292
# Publishing docs details
9393
publish-details: &publish-details

.github/CONTRIBUTING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ We welcome all contributors to Ignite CLI! This contributing guide will help you
44

55
Before submitting a pull request, you will want to make sure that your branch meets the following requirements:
66

7-
_Working on Ignite CLI requires Yarn v1._
7+
\_Working on Ignite CLI requires pnpm 10.9.0
88

99
- Everything works on iOS/Android
10-
- Jest tests pass in the root folder (`yarn test`)
10+
- Jest tests pass in the root folder (`pnpm run test`)
1111
- New tests are included for any new functionality
12-
- Code is compliant with our linter and prettier (`yarn format:write && yarn lint`)
12+
- Code is compliant with our linter and prettier (`pnpm run format:write && pnpm run lint`)
1313
- Branch has already been [synced with the upstream repo](https://help.github.com/articles/syncing-a-fork/) and any merge-conflicts have been resolved.
1414

1515
## Requirements
1616

1717
- Node (reasonably recent version)
18-
- Yarn (while you can use Ignite CLI without Yarn, we require it for contributors)
18+
- pnpm (while you can use Ignite CLI without pnpm, we require it for contributors)
1919

2020
## Getting Started
2121

2222
1. Fork and then clone the repo (`git clone [email protected]:<YOURGITHUBUSER>/ignite.git`)
2323
2. CD into the directory (`cd ignite`)
24-
3. Uninstall npm version (`yarn global remove ignite-cli`)
25-
4. Pull all package dependencies (`yarn`)
26-
5. Link the local binary (`yarn link`)
24+
3. Uninstall npm version (`pnpm remove ignite-cli -g`)
25+
4. Pull all package dependencies (`pnpm install`)
26+
5. Link the local binary (`pnpm link`)
2727

2828
Test it out:
2929

@@ -56,11 +56,11 @@ We use Jest for testing.
5656
To run tests from the ignite folder:
5757

5858
```sh
59-
$ yarn test
59+
$ pnpm run test
6060
```
6161

6262
**To Run Lint** from ignite:
6363

6464
```sh
65-
$ yarn lint
65+
$ pnpm run lint
6666
```

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ yarn-error.log
88
lerna-debug.log
99
node_modules
1010
.vscode/*
11-
package-lock.json
1211

1312
# TS build
1413
/build
@@ -20,6 +19,7 @@ coverage
2019
boilerplate/yarn.lock
2120
boilerplate/bun.lockb
2221
boilerplate/bun.lock
22+
boilerplate/pnpm-lock.yaml
2323
boilerplate/.gitignore.template
2424

2525
# Test artifacts
@@ -43,6 +43,7 @@ test/artifacts/*
4343
.yarn/build-state.yml
4444
.yarn/install-state.gz
4545

46+
4647
# Dependency graph visualizations
4748
ignite-cli-dependency-graph.svg
4849
ignite-cli-dependency-graph.png

.yarn/releases/yarn-4.9.1.cjs

Lines changed: 0 additions & 948 deletions
This file was deleted.

.yarnrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ enableGlobalCache: false
33
nodeLinker: node-modules
44

55
yarnPath: .yarn/releases/yarn-4.9.1.cjs
6+
7+
enableScripts: false

boilerplate/.gitignore

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ local.properties
3636
#
3737
node_modules/
3838
npm-debug.log
39-
yarn-error.log
4039

4140
# BUCK
4241
buck-out/
@@ -88,14 +87,6 @@ web-build/
8887

8988
/coverage
9089

91-
# Yarn
92-
.yarn/*
93-
!.yarn/patches
94-
!.yarn/plugins
95-
!.yarn/releases
96-
!.yarn/sdks
97-
!.yarn/versions
98-
9990
# Dependency Graph Visualizations
10091
app-dependency-graph.svg
10192
app-dependency-graph.png

boilerplate/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ This is the boilerplate that [Infinite Red](https://infinite.red) uses as a way
1010
## Getting Started
1111

1212
```bash
13-
yarn
14-
yarn start
13+
pnpm run
14+
pnpm run start
1515
```
1616

1717
To make things work on your local simulator, or on your phone, you need first to [run `eas build`](https://github.com/infinitered/ignite/blob/master/docs/expo/EAS.md). We have many shortcuts on `package.json` to make it easier:
1818

1919
```bash
20-
yarn build:ios:sim # build for ios simulator
21-
yarn build:ios:device # build for ios device
22-
yarn build:ios:prod # build for ios device
20+
pnpm run build:ios:sim # build for ios simulator
21+
pnpm run build:ios:device # build for ios device
22+
pnpm run build:ios:prod # build for ios device
2323
```
2424

25-
### `./assets` directory
25+
### `./assets`
2626

2727
This directory is designed to organize and store various assets, making it easy for you to manage and use them in your application. The assets are further categorized into subdirectories, including `icons` and `images`:
2828

boilerplate/app/navigators/navigationTypes.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ export type DemoTabScreenProps<T extends keyof DemoTabParamList> = CompositeScre
3434
AppStackScreenProps<keyof AppStackParamList>
3535
>
3636

37-
export interface NavigationProps
38-
extends Partial<ComponentProps<typeof NavigationContainer<AppStackParamList>>> {}
37+
export interface NavigationProps extends Partial<
38+
ComponentProps<typeof NavigationContainer<AppStackParamList>>
39+
> {}

docs/Guide.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ The react-native ecosystem moves quickly and sometimes, you may need to patch a
114114
Igniting an app allows you to choose `npm`, `yarn`, `pnpm`, or `bun` as a package manager, so we don't have configuration in the boilerplate for patches. If you find that you need to patch a library in your app, we recommend the following:
115115

116116
- `npm` - use [`patch-package`](https://www.npmjs.com/package/patch-package).
117-
- `yarn@1` - use [`patch-package`](https://www.npmjs.com/package/patch-package).
118-
- `yarn@3` - use [`yarn patch` tool](https://v3.yarnpkg.com/features/protocols#patch).
119117
- `yarn@4` - use [`yarn patch` tool](https://yarnpkg.com/features/patching).
120118
- `pnpm` - use [`pnpm patch <package>`](https://pnpm.io/cli/patch).
121119
- `bun` - use [`bun patch <package>`](https://bun.sh/docs/install/patch).

docs/QuickStart.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ Once the app has been created, change to the project directory and fire it up vi
4343
# first
4444
cd MyFirstApp
4545
# then one of the following
46-
yarn run android
47-
yarn run ios
48-
yarn run web
46+
pnpm run android
47+
pnpm run ios
48+
pnpm run web
4949
```
5050

5151
Android and iOS will take a few moments to build depending on your machine's hardware.
@@ -60,9 +60,9 @@ Ignite uses EAS Build to make the proper binaries for App Store and Google Play
6060

6161
```bash
6262
# Running a local Android build
63-
yarn run build:android:prod
63+
pnpm run build:android:prod
6464
# or a local iOS build
65-
yarn build:ios:prod
65+
pnpm build:ios:prod
6666
```
6767

6868
Follow the instructions in your terminal upon running these commands. With a successful build you'll end up with binaries in the AAB or IPA format (depending on which platform you're building for). Those can be submitted to the appropriate app stores.

0 commit comments

Comments
 (0)