Skip to content

Commit

Permalink
v0.0.1 (#1)
Browse files Browse the repository at this point in the history
* chore(release): v0.0.1

* docs: add banner.png

* docs: update README.md

* docs: update README.md in template
  • Loading branch information
r17x authored Aug 16, 2020
1 parent 0b59f15 commit 11fc3ad
Show file tree
Hide file tree
Showing 26 changed files with 605 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

### Vim ###
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim
Sessionx.vim

# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~

### rescript
*.bs.js
*.gen.tsx
*.gen.js
53 changes: 51 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,51 @@
# cra-template
create-react-app template with Reason/ReScript.
<p align="center">
<br />
<img src="banner.svg" width="100%" />
</p>
<p align="center">
<a href="#usage">Usage</a> •
<a href="#project-structure">Project Structure</a> •
<a href="#alternative">Alternative</a>
</p>
<br/>
<br/>

## Usage

First run the below commands to start create new project:
```bash
npx create-react-app <project_name> --template @reason-id/cra-template
```

## Project Structure

```
.
├── bsconfig.json
├── .gitignore
├── public
│   ├── favicon.ico
│   ├── index.html
│   ├── logo192.png
│   ├── logo512.png
│   ├── manifest.json
│   └── robots.txt
├── README.md
└── src
├── App.css
├── App.re
├── index.css
├── index.js
├── index.re
├── logo.svg
├── reportWebVitals.js
└── Router
├── Route.re
├── Route.rei
└── Router.re
```

## Alternative
* [**Spin**](https://github.com/tmattio/spin)(we use [Router](https://github.com/reason-id/cra-template/tree/feat/v0.0.1/template/src/Router) from [Spin](https://github.com/tmattio/spin))
* [**app-template-reason-react**](https://github.com/jihchi/app-template-reason-react) for [Snowpack](snowpack.dev)
* [**vite-reason-react-template**](https://github.com/tatchi/vite-reason-react-template) for [Vite](https://github.com/vitejs/vite)
53 changes: 53 additions & 0 deletions banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "@reason-id/cra-template",
"version": "0.0.1",
"keywords": [
"react",
"create-react-app",
"reason-react",
"reasonml",
"rescript"
],
"author": {
"name": "ri7nz",
"email": "ri7nz.labs@gmail.com",
"url": "https://rin.rocks/"
},
"description": "Create-React-App Template for Reason/ReScript",
"license": "MIT",
"engines": {
"node": ">=10"
},
"bugs": {
"url": "https://github.com/reason-id/cra-template/issues"
},
"files": [
"template",
"template.json"
],
"repository": {
"type": "git",
"url": "https://github.com/reason-id/cra-template"
},
"main": "template.json",
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
}
}
22 changes: 22 additions & 0 deletions template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"package": {
"scripts": {
"start:re": "bsb -make-world -w",
"start:cra": "react-scripts start",
"start": "run-p -ln start:*",
"prebuild": "bsb -clean-world -make-world",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"dependencies": {
"@testing-library/jest-dom": "^5.11.0",
"@testing-library/react": "^10.4.3",
"@testing-library/user-event": "^12.0.11",
"web-vitals": "^0.2.2",
"bs-platform": "^8.2.0",
"reason-react": "^0.9.0",
"npm-run-all": "^4.1.5"
}
}
}
1 change: 1 addition & 0 deletions template/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EXTEND_ESLINT=true
3 changes: 3 additions & 0 deletions template/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.bs.js
*.gen.tsx
*.gen.js
46 changes: 46 additions & 0 deletions template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Getting Started with Create React App with ReasonReact.

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app) and `ReasonReact` template from [@reason-id/cra-template](https://github.com/reason-id/cra-template).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors from `react-scripts` and `bs-platform` in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
28 changes: 28 additions & 0 deletions template/bsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "your-awesom-cra-reason-project",
"reason": {
"react-jsx": 3
},
"sources": [
{
"dir": "src",
"subdirs": true
}
],
"package-specs": [
{
"module": "commonjs",
"in-source": true
}
],
"suffix": ".bs.js",
"namespace": true,
"ppx-flags": [],
"bs-dependencies": ["reason-react"],
"bs-dev-dependencies": [],
"refmt": 3,
"warnings": {
"error": "+5"
},
"bsc-flags": ["-bs-super-errors", "-bs-no-version-header"]
}
27 changes: 27 additions & 0 deletions template/gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
### Reasonml ###
/lib

Binary file added template/public/favicon.ico
Binary file not shown.
39 changes: 39 additions & 0 deletions template/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="your description" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Your Application Title | @reason-id</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added template/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added template/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions template/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "your-app-name",
"name": "your-app-name",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#fecf28"
}
3 changes: 3 additions & 0 deletions template/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
42 changes: 42 additions & 0 deletions template/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.App {
min-height:100vh;
text-align: center;
background-color: #282c34;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

code {
color: white;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
Loading

0 comments on commit 11fc3ad

Please sign in to comment.