Skip to content

Commit

Permalink
Merge pull request #118 from nimblehq/release/cli-1.0.0-cra-3.0.0
Browse files Browse the repository at this point in the history
Release CLI Tool 1.0.0 and CRA Template 3.0.0
  • Loading branch information
carryall authored Jul 29, 2022
2 parents 104adfd + 1814851 commit 3a8597e
Show file tree
Hide file tree
Showing 125 changed files with 22,826 additions and 99 deletions.
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
https://github.com/nimblehq/react-templates/issues/?
https://github.com/nimblehq/react-templates/issues/??

## What happened 👀

Describe the big picture of your changes here to communicate to the team why we should accept this pull request.
Provide a description of the **changes** this pull request brings to the codebase. Additionally, when the pull request is still being worked on, a checklist of the planned changes is welcome to track progress.

## Insight 📝

Describe in detail how to test the changes. Referenced documentation is welcome as well.
Describe in detail why this solution is the most appropriate, which solution you tried but did not go with, and how to test the changes. References to relevant documentation are welcome as well.

## Proof Of Work 📹

Show us the implementation: screenshots, GIF, etc. P.S. Maximum details possible
Show us the implementation: screenshots, GIFs, etc.
23 changes: 15 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish package to npmjs
name: Publish packages to npmjs

on:
release:
Expand All @@ -7,25 +7,32 @@ on:

jobs:
publish:
name: Publish package
name: Publish packages

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
- name: Setup node and restore cached dependencies
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "16.x"
cache: "npm"
registry-url: "https://registry.npmjs.org"
scope: "@nimblehq"

- name: Install dependencies
run: npm ci
run: npm ci && lerna bootstrap --ci

- name: Publish package to npmjs
run: npm publish --access public
- name: Authenticate with Registry
run: |
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm whoami
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish packages to npmjs
run: npx lerna publish from-package --yes --no-verify-access
31 changes: 31 additions & 0 deletions .github/workflows/test-cli-tool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test CLI Tool

on: push

jobs:
test-cli-tool:
name: Run CLI Tool tests with Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: [16]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v2

- name: Setup node and restore cached dependencies
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: "npm"

- name: NPM install
run: npm ci && lerna bootstrap --ci

- name: Run tests
run: npm run test --workspace=packages/cli-tool
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Test
name: Test CRA Template

on: push

jobs:
test:
name: Bootstrap app, run linters and tests with Node ${{ matrix.node }}
name: Bootstrap CRA app, run linters and tests with Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -25,7 +25,7 @@ jobs:
cache: 'npm'

- name: Bootstrap React App
run: npx create-react-app test-app --template file:./
run: npx create-react-app test-app --template file:./packages/cra-template

- name: Run linters
working-directory: ./test-app
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules

# misc
.idea/
.DS_Store

npm-debug.log*

# tests
/test-app

# editors
.vscode
44 changes: 23 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</p>

Our template offers a rich boilerplate to jump-start React-based application development with [Create React App](https://github.com/facebook/create-react-app).
The complete list of features included in this template is available in [the Wiki](https://github.com/nimblehq/react-templates/wiki).
The complete list of features included in this template is available on [the Wiki](https://github.com/nimblehq/react-templates/wiki).

## Getting Started

Expand All @@ -25,28 +25,33 @@ The complete list of features included in this template is available in [the Wik

### Usage

To use this template, add `--template @nimblehq` when creating a new app from the `create-react-app` command.
* With CLI tool

```sh
npx create-react-app my-app --template @nimblehq
Start the CLI to generate the React application

```bash
npm install -g @nimblehq/react-template

nimble-react generate {application-name}
```

For more information about `create-react-app`, please refer to:
* With npx

- [Getting Started](https://create-react-app.dev/docs/getting-started) — How to create a new app.
- [User Guide](https://create-react-app.dev) – How to develop apps bootstrapped with Create React App.
```bash
npx @nimblehq/react-template generate {application-name}
```

## Template structure

```
.
├── template
│ ├── public
│ │ ├── ...
│ ├── src
│ | └── ...
├── gitignore
└── README.md
This project uses [Lerna](https://lerna.js.org/) to manage packages. The packages consist of:

* The CLI tool facilitates the process of application generating
* CRA template

```bash
├─ packages
├─ cli-tool
└─ cra-template
├── .gitignore
├── LICENSE
├── package.json
Expand All @@ -55,15 +60,12 @@ For more information about `create-react-app`, please refer to:
```

`Typescript` is used by default for our React applications.
With the standard files from a non-ejected `create-react-app` project, this template adds a folder structure in `/src` that follows our [React Convention](https://nimblehq.co/compass/development/code-conventions/javascript/react/#project-structure).

## How to contribute

To test the template locally, simply run the template install command with the path of your local `react-template` repository, prefixed by `file:`:
* Install Lerna for accessing to the lerna CLI.

```sh
npx create-react-app my-app --template file:{../path/to/your/local/template/repo}
```
* To contribute to the existing packages, simply navigate to the `/packages` folder and create a pull request to change them.

## License

Expand Down
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "independent"
}
Loading

0 comments on commit 3a8597e

Please sign in to comment.