Skip to content

Commit

Permalink
Merge pull request #131 from etn-ccis/dev
Browse files Browse the repository at this point in the history
dev to master PR for R32 release
  • Loading branch information
ArshdeepSingh3-eaton authored Jun 5, 2024
2 parents 6a211ff + 2eca3b8 commit 747f4e7
Show file tree
Hide file tree
Showing 352 changed files with 37,221 additions and 13,585 deletions.
66 changes: 0 additions & 66 deletions .circleci/config.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,26 @@ module.exports = {
env: {
browser: true,
},
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-empty-function': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
selector: [
'classProperty',
'objectLiteralProperty',
'typeProperty',
'classMethod',
'objectLiteralMethod',
'typeMethod',
'accessor',
'enumMember',
],
format: null,
modifiers: ['requiresQuotes'],
},
],
},
};
102 changes: 102 additions & 0 deletions .github/workflows/blui-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Build

on:
push:
branches: ['dev', 'master']
pull_request:
branches: ['dev', 'master']
pull_request_target:
types:
- opened
branches:
- '*/*'

permissions:
pull-requests: write
contents: read

jobs:
prettier_lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn
- run: yarn prettier:check
- run: yarn lint

publish_blank_template:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev') }}
needs: prettier_lint
strategy:
matrix:
node-version: [20.x]
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
BRANCH: ${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- run: yarn --immutable
working-directory: blank-typescript
- run: npm run publish:package -- -b ${{env.BRANCH}}
working-directory: blank-typescript

publish_routing_template:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev') }}
needs: prettier_lint
strategy:
matrix:
node-version: [20.x]
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
BRANCH: ${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- run: yarn --immutable
working-directory: routing-typescript
- run: npm run publish:package -- -b ${{env.BRANCH}}
working-directory: routing-typescript

publish_auth_template:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev') }}
needs: prettier_lint
strategy:
matrix:
node-version: [20.x]
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
BRANCH: ${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- run: yarn --immutable
working-directory: authentication-typescript
- run: npm run publish:package -- -b ${{env.BRANCH}}
working-directory: authentication-typescript
4 changes: 2 additions & 2 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Automatic Publishing

This package is published to NPM automatically by CircleCI when code is merged into the `dev` or `master` branches. To publish a new version, simply update the version in `package.json` and merge your code into the appropriate branch.
This package is published to NPM automatically by Github when code is merged into the `dev` or `master` branches. To publish a new version, simply update the version in `package.json` and merge your code into the appropriate branch.
- The `dev` branch will publish versions marked as `alpha` or `beta`.
- The `master` branch will publish any version (`alpha`, `beta`, or `latest`).
In both cases, the code will only be published if the version number differs from the current version published under the respective dist tag.
Expand All @@ -25,4 +25,4 @@ cd <template>
npm adduser && yarn publish:package
```

> Publishing manually should only be done for `alpha` or `beta` packages. The command will work for `latest` packages, but this should be avoided except in rare situations where the automatic publishing functionality is not working in CircleCI.
> Publishing manually should only be done for `alpha` or `beta` packages. The command will work for `latest` packages, but this should be avoided except in rare situations where the automatic publishing functionality is not working in Github.
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[![Build](https://github.com/etn-ccis/blui-react-native-cli-templates/actions/workflows/blui-ci.yml/badge.svg?branch=master)](https://github.com/etn-ccis/blui-react-native-cli-templates/actions/workflows/blui-ci.yml)

# React Native CLI Templates

These are project templates that are used by the [Brightlayer UI CLI](https://github.com/etn-ccis/blui-cli) when starting a new Brightlayer UI project. They are used behind the scenes by the Brightlayer UI CLI.
These are project templates that are used by the React Native CLI when starting a new Brightlayer UI project.

## Available Templates

Expand All @@ -25,27 +27,38 @@ The [Authentication template](https://www.npmjs.com/package/@brightlayer-ui/reac
## Screenshots

##### Blank Template

![Blank Template](./images/blank-typescript-ios.png)
<img width="400" alt="blank typescript" src="./images/blank-typescript-ios.png">

##### Routing Template With Collapsed Drawer

![Routing Template](./images/routing-typescript-ios.png)
<img width="400" alt="blank typescript" src="./images/routing-typescript-ios.png">

##### Routing Template With Expanded Drawer

![Routing Template](./images/routing-typescript-ios-expanded-drawer.png)
<img width="400" alt="blank typescript" src="./images/routing-typescript-ios-expanded-drawer.png">

##### Authentication Template Login Page

![Authentication Template](./images/authentication-typescript-ios.png)
<img width="400" alt="blank typescript" src="./images/authentication-typescript-ios.png">

## Usage

You can use these templates with the Brightlayer UI CLI (recommended):
To create a new project using the Template simply run (recommended):

```sh
npx -p @brightlayer-ui/cli blui new react-native --cli=rnc --template=blank-typescript
npx -p @brightlayer-ui/cli blui new react-native --cli=rnc --template=routing-typescript
npx -p @brightlayer-ui/cli blui new react-native --cli=rnc --template=authentication-typescript
npx react-native init MyApp --template @brightlayer-ui/react-native-template-blank-typescript
npx react-native init MyApp --template @brightlayer-ui/react-native-template-routing-typescript
npx react-native init MyApp --template @brightlayer-ui/react-native-template-authentication-typescript
```
## Testing
to test a template go inside the template folder and run command
```sh
cd <template-name>/template
yarn install
cd ios && pod install
cd ..
yarn android/ios
```
Once you have tested make sure to delete Node modules, Pods and build folder for both android and ios

to check the template is working with react native cli
```sh
npx react-native init myapp --template file:///the-path-to-location/blui-react-native-cli-templates/blank-typescript
```
9 changes: 8 additions & 1 deletion authentication-typescript/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v3.0.0 (June 5, 2024)

### Changed

- Update to build with React Native 0.73.
- Updated the templates to use React Native CLI

## v2.1.0 (November 1, 2022)

### Changed
Expand Down Expand Up @@ -66,4 +73,4 @@ Previous versions listed after this indicator refer to our deprecated `@pxblue`

### Added

- Initial authentication template for TypeScript projects
- Initial authentication template for TypeScript projects
39 changes: 22 additions & 17 deletions authentication-typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

![npm (scoped)](https://img.shields.io/npm/v/@brightlayer-ui/react-native-template-authentication-typescript?color=%23007bc1&label=%40brightlayer-ui%2Freact-native-template-authentication-typescript)

This is an official Brightlayer UI template used internally by the [Brightlayer UI CLI](https://www.npmjs.com/package/@brightlayer-ui/cli).

This template installs and configures the Brightlayer UI [react-native-auth-workflow](https://www.npmjs.com/package/@brightlayer-ui/react-native-auth-workflow) package to automatically wrap your main application with functions and screens for Login, Registration, Change Password, etc. This uses the same configurations as the sample project for that package — you will need to replace the API integrations with implementations specific to your API. This template also includes the installation and initial setup of routing using [React Navigation](https://reactnavigation.org/). It includes several placeholder routes/screens and a [Drawer](https://brightlayer-ui-components.github.io/react-native/?path=/info/components-documentation--drawer) navigator from the Brightlayer UI [React Native Component Library](https://www.npmjs.com/package/@brightlayer-ui/react-native-components).

## Usage
This template can be used with the Brightlayer UI CLI:
To create a new project using the Authenication Template simply run :
```sh
npx -p @brightlayer-ui/cli blui new react-native --name=myapp --cli=rnc --language=ts --template=authentication
npx react-native init MyApp --template @brightlayer-ui/react-native-template-authentication-typescript
```

## Project Structure
Expand All @@ -18,19 +17,25 @@ Projects created using this template will start out with the following file stru
```
|── /ios // ios project folder
|── /android // android project folder
|── /actions
| |── AuthUIActions.tsx // handles the implementation of the authentication related actions (such as login and forgot password)
| └── RegistrationUIActions.tsx // handles the implementation of the registration related actions (such as loading the EULA and registration by invitation)
|── /assets // fonts and images used by the application
|── App.tsx // app entry point
|── /constants
| |── index.ts // application constants
| └── sampleEula.ts // sample Eula
|── /pages // sample application pages
|── /router
| |── index.tsx // sets up routing
| |── DeepLinking.ts // sets up deep linking
| └── navigation-drawer.tsx // sets up Drawer
└── /store
└── local-storage.ts // mock implementation for storing/retrieving user authentication session data
|── src
| |── actions
| | |── AuthUIActions.tsx // handles the implementation of the authentication related actions (such as login and forgot password)
| | └── RegistrationUIActions.tsx // handles the implementation of the registration related actions (such as loading the EULA and registration by invitation)
| |── assets // fonts and images used by the application
| |── constants
| | |── index.ts // application constants
| | └── sampleEula.ts // sample Eula
| |── contexts
| | |── AppContextProvider.tsx // handles context for Auth
| | └── ThemeContext.ts // handles context for theme
| |── screens // sample application pages
| |── navigation
| | |── index.tsx // sets up routing
| | └── navigation-drawer.tsx // sets up Drawer
| └── store
| └── local-storage.ts // mock implementation for storing/retrieving user authentication session data
└──/translations
|── /dictionary // translation dictionary for i18next
|── i18n.ts // configuration for i18next
```
31 changes: 0 additions & 31 deletions authentication-typescript/dependencies.json

This file was deleted.

Loading

0 comments on commit 747f4e7

Please sign in to comment.