Skip to content

Commit 06f3b71

Browse files
authored
docs: update font generation docs (#1811)
1 parent 11c8769 commit 06f3b71

File tree

4 files changed

+465
-77
lines changed

4 files changed

+465
-77
lines changed

CONTRIBUTING.md

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ If you wish to submit a pull request for a new feature or issue, you should star
1818

1919
This project is a monorepo managed using [pnpm workspaces](https://pnpm.io/workspaces). It contains the following packages:
2020

21-
- The library package in `packages/common`
22-
- An example app in `packages/icon-explorer
21+
- The library packages in `packages/common` and `packages/get-image`
22+
- Example apps in `packages/icon-explorer` and `packages/directory`
2323
- Fonts in `packages/fontname` e.g. `packages/fontawesome6`
2424

2525
To get started with the project, run `pnpm install` in the root directory to install the required dependencies for each package:
@@ -87,17 +87,16 @@ Running "IconExplorer" with {"fabric":true,"initialProps":{"concurrentRoot":true
8787

8888
Note the `"fabric":true` and `"concurrentRoot":true` properties.
8989

90-
Make sure your code passes TypeScript and ESLint. Run the following to verify:
90+
Make sure your code passes all of our linting. Run the following to verify:
9191

9292
```sh
93-
pnpm run typecheck
9493
pnpm run lint
9594
```
9695

9796
To fix formatting errors, run the following:
9897

9998
```sh
100-
pnpm run lint --fix
99+
pnpm run lint:biome --fix
101100
```
102101

103102
Remember to add tests for your change if possible. Run the unit tests by:
@@ -106,11 +105,11 @@ Remember to add tests for your change if possible. Run the unit tests by:
106105
pnpm run test
107106
```
108107

109-
### Detox
108+
### Tests
110109

111-
TODO: Expand on detox here
110+
We run tests again `new` and `old` architecture against the last 3 versions of React Native automatically via CI.
112111

113-
To run the detox tests you should create an avd called test which is based on the Pixel 6 Pro profile. This is essential for the screenshot diffs to work
112+
To run the these tests manually you should create an avd called test which is based on the Pixel 6 Pro profile. This is essential for the screenshot diffs to work
114113

115114
```sh
116115
sdkmanager --install 'system-images;android-31;default;x86_64' --channel=0
@@ -127,6 +126,15 @@ pnpm run run test:ios:build
127126
pnpm run run test:ios:run
128127
```
129128

129+
You can switch versions of react native before running the tests with
130+
131+
```
132+
cd packages/icon-explorer
133+
# ./set-rn-version <arch> <version>
134+
./set-rn-version new 0.74
135+
./set-rn-version old 0.79
136+
```
137+
130138
### Commit message convention
131139

132140
We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
@@ -150,25 +158,18 @@ Our pre-commit hooks verify that the linter and tests pass when committing.
150158

151159
### Publishing to npm
152160

153-
We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
161+
We use `nx` to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
154162

155-
To publish new versions, run the following:
156-
157-
```sh
158-
pnpm run release
159-
```
163+
To publish new versions, use the github action [release.yml](.github/workflows/deploy.yml) which is triggered manually.
160164

161165
### Scripts
162166

163167
The `package.json` file contains various scripts for common tasks:
164168

165169
- `pnpm i`: setup project by installing dependencies.
166-
- `pnpm run typecheck`: type-check files with TypeScript.
167-
- `pnpm run lint`: lint files with ESLint.
168-
- `pnpm run test`: run unit tests with Jest.
169-
- `pnpm run example start`: start the Metro server for the example app.
170-
- `pnpm run example android`: run the example app on Android.
171-
- `pnpm run example ios`: run the example app on iOS.
170+
- `pnpm run lint:typecheck`: type-check files with TypeScript.
171+
- `pnpm run lint:eslint`: lint files with ESLint.
172+
- `pnpm run lint:biome`: lint files with Biome.
172173

173174
### Sending a pull request
174175

@@ -181,3 +182,21 @@ When you're sending a pull request:
181182
- Review the documentation to make sure it looks good.
182183
- Follow the pull request template when opening a pull request.
183184
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
185+
186+
### Font generation
187+
188+
All the fonts are automatiaclly generated using a `yeoman` generator. This is driven by a `.yo-rc.json` file in the root of each font.
189+
190+
To make changes to common font files you shuold edit the files in `packages/generator-react-native-vector-icons/src/app/templates/` and then at the root you shuld run:
191+
192+
```sh
193+
# Generate all fonts
194+
pnpm generate
195+
196+
# Generate a single font
197+
pnpm generate ant-design
198+
```
199+
200+
### Font versioning
201+
202+
Font package versions are now independent of upstream font versions and we track the mapping in the README.md of each font

0 commit comments

Comments
 (0)