Skip to content

Commit

Permalink
Merge pull request #1 from frontapp/use-npm
Browse files Browse the repository at this point in the history
Switch to using npm
  • Loading branch information
eramdam committed Oct 31, 2023
2 parents 653390e + a1d47fa commit 0fd74c4
Show file tree
Hide file tree
Showing 16 changed files with 44,641 additions and 13,690 deletions.
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
- restore_cache:
name: Restore node modules
keys:
- node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
- node_modules-{{ arch }}-{{ checksum "package-lock.json" }}

- run:
name: Install dependencies
command: yarn --pure-lockfile
command: npm ci

- save_cache:
name: Save node modules
key: node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
key: node_modules-{{ arch }}-{{ checksum "package-lock.json" }}
paths:
- node_modules

Expand All @@ -31,11 +31,11 @@ jobs:
- restore_cache:
name: Restore node modules
keys:
- node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
- node_modules-{{ arch }}-{{ checksum "package-lock.json" }}

- run:
name: Lint checks
command: yarn ci
command: npm run ci

publish:
<<: *defaults
Expand All @@ -44,11 +44,11 @@ jobs:
- restore_cache:
name: Restore node modules
keys:
- node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
- node_modules-{{ arch }}-{{ checksum "package-lock.json" }}

- run:
name: Publish to NPM
command: yarn ci:publish
command: npm run ci:publish

workflows:
version: 2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 18
cache: 'yarn'
cache: 'npm'
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Install npm dependencies
run: yarn --frozen-lockfile
run: npm ci
shell: bash
- name: Build Android test app
uses: gradle/gradle-build-action@v2
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/detox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ jobs:
- uses: actions/setup-node@master
with:
node-version: 14
- name: Setup - Install Yarn
run: YARN_GPG=NO curl -o- -L https://yarnpkg.com/install.sh | bash
- name: Setup - Install NPM Dependencies
run: yarn --frozen-lockfile
run: npm ci
- name: Setup - Install CocoaPods CLI
run: sudo gem install cocoapods -v 1.8.4
- name: Run tests
run: yarn ci
run: npm run ci
4 changes: 2 additions & 2 deletions .github/workflows/ios-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache: 'npm'
- name: Install npm dependencies
run: yarn --frozen-lockfile
run: npm ci
- name: Install Pods
run: ${{matrix.extraEnv}} pod install
working-directory: example/ios
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
- name: Install npm dependencies
run: yarn --frozen-lockfile
run: npm ci
- name: Install macOS dependencies
if: false # Enable this if react-native-macos falls behind
run: yarn add:macos
run: npm run add:macos
- name: Install Pods
run: pod install
working-directory: example/macos
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '^14'
cache: 'yarn'
cache: 'npm'

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1.3
Expand All @@ -23,16 +23,14 @@ jobs:
msbuild-architecture: x64

- name: Install node modules
run: yarn --pure-lockfile
run: npm install

- name: yarn build
run: |
yarn build
yarn tsc
- name: npm build
run: npm build

- name: Build x64 release
shell: powershell
run: yarn windows --release --no-packager --no-deploy --logging
run: npm run windows -- --release --no-packager --no-deploy --logging

# Workaround for a bug in package searching during deploy.
# The deploy script only searches windows/{*/bin/x64/Release,Release/*}, but the build step above placed the packages at windows/x64/Release.
Expand All @@ -45,11 +43,11 @@ jobs:
- name: Start Appium server
shell: powershell
run: Start-Process PowerShell -ArgumentList "yarn appium"
run: Start-Process PowerShell -ArgumentList "npm run appium"

- name: Start React server
shell: powershell
run: Start-Process PowerShell -ArgumentList "yarn start"
run: Start-Process PowerShell -ArgumentList "npm start"

- name: Run tests
run: yarn test:windows
run: npm run test:windows
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ lib/android/src/main/gen
node_modules/
npm-debug.log
yarn-error.log
package-lock.json

# Rubygem bundles
#
Expand Down
28 changes: 16 additions & 12 deletions docs/Contributing.italian.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@ In secondo luogo, desideriamo che l'esperienza di contribuzione sia il migliore
Dopo aver forkato il reposito, clonalo sulla tuo computer e apporta le modifiche. Successivamente, potrai testarle in un'applicazione.

Ci sono due metodi per testare:
1) testare all'interno di una copia di react-native-webview;
2) testare in un nuovo progetto creato con `react-native init`.

1. testare all'interno di una copia di react-native-webview;
2. testare in un nuovo progetto creato con `react-native init`.

### Testare in react-native-webview

#### Per tutte le piattaforme:

```sh
yarn install
npm install
```

#### Per Android:

```sh
yarn android
npm run android
```

L'applicazione di esempio per Android verrà compilata, Metro bundler si avvierà e l'applicazione verrà installata e avviata nell'emulatore Android.
Expand All @@ -32,7 +33,7 @@ L'applicazione di esempio per Android verrà compilata, Metro bundler si avvier

```sh
pod install --project-directory=example/ios
yarn ios
npm run ios
```

L'app di esempio per iOS verrà compilata, Metro bundler verrà avviato e l'app verrà installata e avviata nel simulatore.
Expand All @@ -41,15 +42,15 @@ L'app di esempio per iOS verrà compilata, Metro bundler verrà avviato e l'app

```sh
pod install --project-directory=example/macos
yarn macos
npm run macos
```

L'app di esempio per macOS verrà compilata, Metro bundler verrà avviato e l'app verrà installata e avviata.

#### Per Windows:

```sh
yarn windows
npm run windows
```

L'app di esempio per Windows verrà compilata, Metro bundler verrà avviato e l'app verrà installata e avviata.
Expand All @@ -59,7 +60,7 @@ L'app di esempio per Windows verrà compilata, Metro bundler verrà avviato e l'
In un nuovo progetto `react-native init`, fai quanto segue:

```
$ yarn add <percorso locale a react-native-webview>
$ npm install <percorso locale a react-native-webview>
```

Potresti riscontrare un problema in cui la mappatura dei moduli `jest-haste-map` segnala che react-native è stato aggiunto due volte.
Expand Down Expand Up @@ -89,15 +90,18 @@ Potresti anche visualizzare un avviso sulla console riguardante "Invalid hook ca
Quando apporti una modifica, molto probabilmente dovrai rimuovere e aggiungere nuovamente `react-native-webview`:

```
$ yarn remove react-native-webview
$ yarn add ../react-native-webview
$ npm remove react-native-webview
$ npm install ../react-native-webview
```

## Note

- Usiamo TypeScript.
- Dopo aver scaricato quest repo e installato tutte le dipendenze, puoi eseguire i test usando il comando: `yarn ci`.
- Dopo aver scaricato quest repo e installato tutte le dipendenze, puoi eseguire i test usando il comando: `npm ci`.

### Traduzioni

Questo file è disponibile nelle seguenti lingue:

- [Inglese](Contributing.md)
- [Portoghese brasiliano](Contributing.portuguese.md)
- [Portoghese brasiliano](Contributing.portuguese.md)
24 changes: 13 additions & 11 deletions docs/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@ Secondly, we'd like the contribution experience to be as good as possible. While
After you fork the repo, clone it to your machine, and make your changes, you'll want to test them in an app.

There are two methods of testing:
1) Testing within a clone of react-native-webview
2) Testing in a new `react-native init` project

1. Testing within a clone of react-native-webview
2. Testing in a new `react-native init` project

### Testing within react-native-webview

#### For all platforms:

```sh
yarn install
npm install
```

#### For Android:

```sh
yarn android
npm run android
```

The Android example app will built, the Metro bundler will launch, and the example app will be installed and started in the Android emulator.
Expand All @@ -32,7 +33,7 @@ The Android example app will built, the Metro bundler will launch, and the examp

```sh
pod install --project-directory=example/ios
yarn ios
npm run ios
```

The iOS example app will be built, the Metro bundler will launch, and the example app will be installed and started in the Simulator.
Expand All @@ -41,15 +42,15 @@ The iOS example app will be built, the Metro bundler will launch, and the exampl

```sh
pod install --project-directory=macos
yarn macos
npm run macos
```

The macOS example app will be built, the Metro bundler will launch, and the example app will be installed and started.

#### For Windows:

```sh
yarn windows
npm run windows
```

The Windows example app will be built, the Metro bundler will launch, and the example app will be installed and started.
Expand All @@ -59,7 +60,7 @@ The Windows example app will be built, the Metro bundler will launch, and the ex
In a new `react-native init` project, do this:

```
$ yarn add <path to local react-native-webview>
$ npm install <path to local react-native-webview>
```

You may run into a problem where the `jest-haste-map` module map says react-native was added twice:
Expand Down Expand Up @@ -89,16 +90,17 @@ You may also see a console warning about "Invalid hook call," followed by a rend
When you make a change, you'll probably need to remove and re-add `react-native-webview`:

```
$ yarn remove react-native-webview
$ yarn add ../react-native-webview
$ npm remove react-native-webview
$ npm install ../react-native-webview
```

## Notes

- We use TypeScript.
- After pulling this repo and installing all dependencies, you can run tests using the command: `yarn ci`
- After pulling this repo and installing all dependencies, you can run tests using the command: `npm ci`

## Translations

This file is available in:

- [Brazilian portuguese](Contributing.portuguese.md)
Expand Down
Loading

0 comments on commit 0fd74c4

Please sign in to comment.