Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock', 'packages/react-native-enriched-markdown/android/**', 'packages/react-native-enriched-markdown/src/**', 'packages/core/cpp/**', 'apps/example/android/**') }}
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock', 'packages/react-native-enriched-markdown/android/**', 'packages/react-native-enriched-markdown/src/**', 'packages/core/cpp/**', 'apps/react-native-example/android/**') }}
restore-keys: |
${{ runner.os }}-turborepo-android-

Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('apps/example/android/gradle/wrapper/gradle-wrapper.properties') }}
key: ${{ runner.os }}-gradle-${{ hashFiles('apps/react-native-example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

Expand Down Expand Up @@ -126,13 +126,13 @@ jobs:
xcode-version: '16.4'

- name: Reset build folder and pods
run: rm -rf apps/example/build apps/example/ios/Pods apps/example/ios/Podfile.lock
run: rm -rf apps/react-native-example/build apps/react-native-example/ios/Pods apps/react-native-example/ios/Podfile.lock

- name: Cache turborepo for iOS
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock', 'packages/react-native-enriched-markdown/ios/**', 'packages/react-native-enriched-markdown/src/**', 'packages/core/cpp/**', 'apps/example/ios/**') }}
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock', 'packages/react-native-enriched-markdown/ios/**', 'packages/react-native-enriched-markdown/src/**', 'packages/core/cpp/**', 'apps/react-native-example/ios/**') }}
restore-keys: |
${{ runner.os }}-turborepo-ios-

Expand All @@ -154,14 +154,14 @@ jobs:
with:
path: |
**/ios/Pods
key: ${{ runner.os }}-cocoapods-${{ hashFiles('apps/example/ios/Podfile.lock') }}
key: ${{ runner.os }}-cocoapods-${{ hashFiles('apps/react-native-example/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-cocoapods-

- name: Install cocoapods
if: env.turbo_cache_hit != 1
run: |
cd apps/example/ios
cd apps/react-native-example/ios
pod install
env:
NO_FLIPPER: 1
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ android.iml

# Cocoapods
#
apps/example/ios/Pods
apps/react-native-example/ios/Pods
apps/macos-example/macos/Pods

# Ruby
apps/example/vendor/
apps/react-native-example/vendor/
apps/macos-example/vendor/

# node.js
Expand Down
4 changes: 2 additions & 2 deletions .maestro/scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ if [ -n "$REBUILD" ] || ! app_installed; then
[ -n "$REBUILD" ] && echo "=== rebuild forced, building and installing ==="
[ -z "$REBUILD" ] && echo "=== App ($BUNDLE_ID) not found, building and installing ==="
if [ "$PLATFORM" = ios ]; then
yarn example ios --udid "$DEVICE_ID"
yarn react-native-example ios --udid "$DEVICE_ID"
else
yarn example android --device "$DEVICE_ID"
yarn react-native-example android --device "$DEVICE_ID"
fi
else
echo "=== APP ($BUNDLE_ID) aleady installed, skipping build ==="
Expand Down
24 changes: 12 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ We want this community to be friendly and respectful to each other. Please follo
This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:

- The library package in the root directory.
- An example app in the `apps/example/` directory.
- A React Native example app in the `apps/react-native-example/` directory.

To get started with the project, make sure you have the correct version of [Node.js](https://nodejs.org/) installed. See the [`.nvmrc`](./.nvmrc) file for the version used in this project.

Expand All @@ -32,32 +32,32 @@ yarn prepare

> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development without manually migrating.

The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
The [react-native-example app](/apps/react-native-example/) demonstrates usage of the library. You need to run it to test any changes you make.

It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.

If you want to use Android Studio or Xcode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/EnrichedMarkdownExample.xcworkspace` in Xcode and find the source files at `Pods > Development Pods > react-native-enriched-markdown`.
If you want to use Android Studio or Xcode to edit the native code, you can open the `apps/react-native-example/android` or `apps/react-native-example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `apps/react-native-example/ios/EnrichedMarkdownExample.xcworkspace` in Xcode and find the source files at `Pods > Development Pods > react-native-enriched-markdown`.

To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-enriched-markdown` under `Android`.
To edit the Java or Kotlin files, open `apps/react-native-example/android` in Android studio and find the source files at `react-native-enriched-markdown` under `Android`.

You can use various commands from the root directory to work with the project.

To start the packager:

```sh
yarn example start
yarn react-native-example start
```

To run the example app on Android:

```sh
yarn example android
yarn react-native-example android
```

To run the example app on iOS:

```sh
yarn example ios
yarn react-native-example ios
```

To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this:
Expand Down Expand Up @@ -116,9 +116,9 @@ yarn test:e2e:android:update-screenshots

### Storybook

Storybook is embedded in the example app (`apps/example/`) as a dedicated screen. To use it, run the example app normally and navigate to the **Storybook** screen from the home screen.
Storybook is embedded in the react-native-example app (`apps/react-native-example/`) as a dedicated screen. To use it, run the example app normally and navigate to the **Storybook** screen from the home screen.

Stories live in `apps/example/.rnstorybook/stories/`.
Stories live in `apps/react-native-example/.rnstorybook/stories/`.

### Commit message convention

Expand Down Expand Up @@ -159,9 +159,9 @@ The `package.json` file contains various scripts for common tasks:
- `yarn prepare`: build the library (required before running any app).
- `yarn typecheck`: type-check files with TypeScript.
- `yarn lint`: lint files with ESLint.
- `yarn example start`: start the Metro server for the example app.
- `yarn example android`: run the example app on Android.
- `yarn example ios`: run the example app on iOS.
- `yarn react-native-example start`: start the Metro server for the react-native-example app.
- `yarn react-native-example android`: run the react-native-example app on Android.
- `yarn react-native-example ios`: run the react-native-example app on iOS.
- `yarn test:e2e:ios`: run all E2E tests on iOS simulator.
- `yarn test:e2e:android`: run all E2E tests on Android emulator.
- `yarn test:e2e:mobile`: run all E2E tests on both platforms sequentially.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ export function githubFlavorArgTypes(description: string) {
};
}

/** Bundled fonts in apps/example/assets/fonts (see src/markdownStyles.ts). */
/** Bundled fonts in apps/react-native-example/assets/fonts (see src/markdownStyles.ts). */
export const EXAMPLE_FONT_FAMILIES = [
'',
'Montserrat-Regular',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/web-example/src/sampleMarkdown.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { sampleMarkdown } from '../../example/src/sampleMarkdown';
export { sampleMarkdown } from '../../react-native-example/src/sampleMarkdown';
2 changes: 1 addition & 1 deletion lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pre-commit:
ktlint:
glob: '*.kt'
exclude: '(build|generated|node_modules)'
run: cd apps/example/android && ./gradlew :react-native-enriched-markdown:ktlintFormat --quiet && cd ../../.. && git add {staged_files}
run: cd apps/react-native-example/android && ./gradlew :react-native-enriched-markdown:ktlintFormat --quiet && cd ../../.. && git add {staged_files}
commit-msg:
parallel: true
commands:
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"apps/*"
],
"scripts": {
"example": "yarn workspace react-native-enriched-markdown-example",
"react-native-example": "yarn workspace react-native-enriched-markdown-example",
"macos-example": "yarn workspace react-native-enriched-markdown-macos-example",
"web-example": "yarn workspace react-native-enriched-markdown-web-example",
"android-example": "yarn workspace enriched-markdown-android-example start",
"build:wasm": "yarn workspace react-native-enriched-markdown build:wasm",
"android:build:release": "cd apps/example && npx react-native build-android --mode=release",
"android:test:release": "cd apps/example && yarn android --mode release",
"android:build:release": "cd apps/react-native-example && npx react-native build-android --mode=release",
"android:test:release": "cd apps/react-native-example && yarn android --mode release",
"test:e2e:mobile": ".maestro/scripts/run-all-tests.sh",
"test:e2e:android": ".maestro/scripts/run-tests.sh --platform android",
"test:e2e:ios": ".maestro/scripts/run-tests.sh --platform ios",
Expand All @@ -34,9 +34,9 @@
"lint-clang:android:fix": "yarn workspace react-native-enriched-markdown lint-clang:android:fix",
"lint-clang": "yarn workspace react-native-enriched-markdown lint-clang",
"lint-clang:fix": "yarn workspace react-native-enriched-markdown lint-clang:fix",
"lint-kotlin": "cd apps/example/android && ./gradlew :react-native-enriched-markdown:ktlintCheck",
"lint-kotlin:fix": "cd apps/example/android && ./gradlew :react-native-enriched-markdown:ktlintFormat",
"clean": "yarn workspace react-native-enriched-markdown clean && del-cli apps/example/android/build apps/example/android/app/build apps/example/ios/build apps/macos-example/macos/build",
"lint-kotlin": "cd apps/react-native-example/android && ./gradlew :react-native-enriched-markdown:ktlintCheck",
"lint-kotlin:fix": "cd apps/react-native-example/android && ./gradlew :react-native-enriched-markdown:ktlintFormat",
"clean": "yarn workspace react-native-enriched-markdown clean && del-cli apps/react-native-example/android/build apps/react-native-example/android/app/build apps/react-native-example/ios/build apps/macos-example/macos/build",
"sync-md4c": "yarn workspace react-native-enriched-markdown sync-md4c",
"prepare": "yarn workspace react-native-enriched-markdown prepare",
"release": "release-it --only-version"
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15874,9 +15874,9 @@ __metadata:
languageName: node
linkType: hard

"react-native-enriched-markdown-example@workspace:apps/example":
"react-native-enriched-markdown-example@workspace:apps/react-native-example":
version: 0.0.0-use.local
resolution: "react-native-enriched-markdown-example@workspace:apps/example"
resolution: "react-native-enriched-markdown-example@workspace:apps/react-native-example"
dependencies:
"@babel/core": "npm:^7.25.2"
"@babel/preset-env": "npm:^7.25.3"
Expand Down
Loading