Skip to content

Commit

Permalink
Setup yarn monorepo for packages (#988)
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot authored Jun 10, 2024
1 parent 4e630a9 commit a551b87
Show file tree
Hide file tree
Showing 38 changed files with 790 additions and 1,140 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/main.yml → .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
name: react-native-app-auth CI
name: Pull Request

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile --non-interactive
run: yarn install --frozen-lockfile

- name: Lint
run: yarn run lint
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -15,11 +15,15 @@ jobs:
deployments: write
packages: write
pull-requests: write

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
1 change: 0 additions & 1 deletion .npmignore

This file was deleted.

19 changes: 11 additions & 8 deletions Example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');

const path = require('path');

const packagePath = path.resolve(
path.join(__dirname, '..', 'packages', 'react-native-app-auth'),
);

const extraNodeModules = {
'react-native-app-auth': packagePath,
};
const watchFolders = [packagePath];

/**
* Metro configuration
* https://facebook.github.io/metro/docs/configuration
*
* @type {import('metro-config').MetroConfig}
*/

const path = require('path');

const extraNodeModules = {
'react-native-app-auth': path.resolve(path.join(__dirname, '..')),
};
const watchFolders = [path.resolve(path.join(__dirname, '..'))];

const config = {
resolver: {
extraNodeModules: new Proxy(extraNodeModules, {
Expand Down
4 changes: 2 additions & 2 deletions Example/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Example",
"name": "rnaa-demo",
"version": "0.0.1",
"private": true,
"scripts": {
Expand All @@ -12,7 +12,7 @@
"dependencies": {
"react": "18.2.0",
"react-native": "0.72.4",
"react-native-app-auth": "link:../"
"react-native-app-auth": "link:../packages/react-native-app-auth"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a href="https://formidable.com/open-source/" target="_blank">
<img alt="React Native App Auth — Formidable, We build the modern web" src="https://oss.nearform.com/api/banner?text=react+native+app+auth" />
<a href="https://commerce.nearform.com/open-source/" target="_blank">
<img alt="React Native App Auth" src="https://oss.nearform.com/api/banner?text=react+native+app+auth" />
</a>
<p align="center">
<strong>React native bridge for AppAuth - an SDK for communicating with OAuth2 providers</strong>
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "website",
"name": "rnaa-docs",
"version": "0.0.0",
"private": true,
"scripts": {
Expand Down
74 changes: 10 additions & 64 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
{
"name": "react-native-app-auth",
"version": "7.2.0",
"name": "rnaa",
"version": "1.0.0",
"private": true,
"description": "React Native bridge for AppAuth for supporting any OAuth 2 provider",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "jest",
"lint": "eslint ."
},
"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
],
"*.ts": [
"prettier --write",
"git add"
]
},
"files": [
"android",
"ios",
"index.d.ts",
"react-native-app-auth.podspec"
],
"repository": {
"type": "git",
"url": "https://github.com/FormidableLabs/react-native-app-auth"
Expand All @@ -41,46 +20,13 @@
"oauth2",
"appauth"
],
"author": "kadi.kraman@formidable.com",
"license": "MIT",
"peerDependencies": {
"react-native": ">=0.63.0"
},
"devDependencies": {
"@changesets/cli": "^2.26.1",
"@svitejs/changesets-changelog-github-compact": "^0.1.1",
"babel-eslint": "10.0.3",
"eslint": "6.8.0",
"eslint-config-formidable": "4.0.0",
"eslint-config-prettier": "6.9.0",
"eslint-plugin-filenames": "1.3.2",
"eslint-plugin-import": "2.19.1",
"eslint-plugin-jest": "23.3.0",
"eslint-plugin-prettier": "3.1.2",
"eslint-plugin-promise": "4.2.1",
"husky": "4.0.1",
"jest": "24.9.0",
"lint-staged": "9.5.0",
"prettier": "1.19.1",
"react": "16.9.0",
"react-native": "0.61.5"
},
"dependencies": {
"invariant": "2.2.4",
"react-native-base64": "0.0.2"
},
"jest": {
"preset": "react-native",
"modulePathIgnorePatterns": [
"<rootDir>/Example/"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"scripts": {
"changeset": "changeset",
"lint": "yarn workspace react-native-app-auth lint",
"test": "yarn workspace react-native-app-auth test"
},
"publishConfig": {
"provenance": true
}
"workspaces": [
"packages/*"
]
}
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.
66 changes: 66 additions & 0 deletions packages/react-native-app-auth/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "react-native-app-auth",
"version": "7.2.0",
"description": "React Native bridge for AppAuth for supporting any OAuth 2 provider",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "jest",
"lint": "eslint ."
},
"files": [
"android",
"ios",
"index.d.ts",
"react-native-app-auth.podspec"
],
"repository": {
"type": "git",
"url": "https://github.com/FormidableLabs/react-native-app-auth"
},
"bugs": {
"url": "https://github.com/FormidableLabs/react-native-app-auth/issues"
},
"homepage": "https://github.com/FormidableLabs/react-native-app-auth",
"keywords": [
"react",
"react-native",
"auth",
"authentication",
"oauth",
"oauth2",
"appauth"
],
"license": "MIT",
"author": "Nearform Commerce (https://commerce.nearform.com)",
"peerDependencies": {
"react-native": ">=0.63.0"
},
"devDependencies": {
"@changesets/cli": "^2.26.1",
"@svitejs/changesets-changelog-github-compact": "^0.1.1",
"babel-eslint": "10.0.3",
"eslint": "6.8.0",
"eslint-config-formidable": "4.0.0",
"eslint-config-prettier": "6.9.0",
"eslint-plugin-filenames": "1.3.2",
"eslint-plugin-import": "2.19.1",
"eslint-plugin-jest": "23.3.0",
"eslint-plugin-prettier": "3.1.2",
"eslint-plugin-promise": "4.2.1",
"jest": "24.9.0",
"prettier": "1.19.1",
"react": "16.9.0",
"react-native": "0.63.0"
},
"dependencies": {
"invariant": "2.2.4",
"react-native-base64": "0.0.2"
},
"jest": {
"preset": "react-native"
},
"publishConfig": {
"provenance": true
}
}
File renamed without changes.
Binary file removed react-native-app-auth-Hero.png
Binary file not shown.
Loading

0 comments on commit a551b87

Please sign in to comment.