Skip to content

Commit bd847ca

Browse files
feat: clone project fom web-app-template
https://github.com/remarkablemark/web-app-template
0 parents  commit bd847ca

22 files changed

Lines changed: 1820 additions & 0 deletions

β€Ž.babelrcβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@babel/preset-env"]
3+
}

β€Ž.browserslistrcβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Browsers that we support
2+
3+
>0.2%
4+
not dead
5+
not ie <= 11
6+
not op_mini all

β€Ž.commitlintrc.jsonβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

β€Ž.eslintrcβ€Ž

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"extends": "eslint:recommended",
8+
"parser": "babel-eslint",
9+
"parserOptions": {
10+
"ecmaVersion": 6,
11+
"sourceType": "module",
12+
"ecmaFeatures": {
13+
"experimentalObjectRestSpread": true
14+
}
15+
},
16+
"plugins": ["babel", "prettier"],
17+
"rules": {
18+
"no-cond-assign": 2,
19+
"no-unused-vars": ["error", { "vars": "all", "args": "none" }],
20+
"prettier/prettier": 2
21+
}
22+
}

β€Ž.gitignoreβ€Ž

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

β€Ž.huskyrcβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "lint-staged",
4+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
5+
}
6+
}

β€Ž.lintstagedrcβ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"*.js": [
3+
"npm run lint:fix",
4+
"git add"
5+
],
6+
"*.{json,css,md}": [
7+
"prettier --write",
8+
"git add"
9+
],
10+
".*{rc,json}": "jsonlint"
11+
}

β€Ž.prettierrcβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5"
4+
}

β€ŽLICENSEβ€Ž

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License
2+
3+
Copyright (c) 2019 Menglin "Mark" Xu <mark@remarkablemark.org>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

β€ŽREADME.mdβ€Ž

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
# web-app-template
2+
3+
A framework-agnostic web app template.
4+
5+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app) but also ejected with dependencies like React removed.
6+
7+
[See demo.](https://remarkablemark.github.io/web-app-template/)
8+
9+
## Prerequisites
10+
11+
- [Node.js 8.6+](https://nodejs.org/en/download/)
12+
- [npm 5.3+](https://www.npmjs.com/get-npm) or [Yarn 1+](https://yarnpkg.com/lang/en/docs/install/)
13+
14+
## Installation
15+
16+
Clone repository:
17+
18+
```sh
19+
$ git clone https://github.com/remarkablegames/web-app-template.git
20+
```
21+
22+
Rename project:
23+
24+
```sh
25+
$ mv web-app-template my-app
26+
$ cd my-app
27+
$ git grep -l web-app-template | xargs sed -i '' -e 's/web-app-template/my-app/g'
28+
$ git grep -l 'Web App Template' | xargs sed -i '' -e 's/Web App Template/My App/g'
29+
```
30+
31+
You should also update the following files:
32+
33+
- [ ] README.md
34+
- [ ] package.json
35+
- [ ] public/index.html
36+
- [ ] public/manifest.json
37+
- [ ] src/index.js
38+
39+
Install dependencies:
40+
41+
```sh
42+
# with npm
43+
$ npm install
44+
45+
# or with yarn
46+
$ yarn
47+
```
48+
49+
Initialize new repository:
50+
51+
```sh
52+
$ rm -rf .git
53+
$ git init
54+
```
55+
56+
Make first commit:
57+
58+
```sh
59+
$ git add .
60+
$ git commit -m "feat: initialize project from web-app-template"
61+
```
62+
63+
> Commit messages follow the [Conventional Commits](https://conventionalcommits.org/) format. (Used when releasing a new version.)
64+
65+
Don't forget to [push the local repository to GitHub](https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/) or to another remote repository:
66+
67+
```sh
68+
$ git remote add origin <remote-repository-url>
69+
$ git push origin -u origin master
70+
```
71+
72+
## Scripts
73+
74+
Start development server:
75+
76+
```sh
77+
# with npm
78+
$ npm start
79+
80+
# or with yarn
81+
$ yarn start
82+
```
83+
84+
Build production artifacts:
85+
86+
```sh
87+
# with npm
88+
$ npm run build
89+
90+
# or with yarn
91+
$ yarn build
92+
```
93+
94+
> **Note**: Make sure the `"homepage"` field in `package.json` is correct.
95+
96+
Create a release using [standard-version](https://github.com/conventional-changelog/standard-version):
97+
98+
```sh
99+
# with npm
100+
$ npm run release
101+
102+
# or with yarn
103+
$ yarn release
104+
```
105+
106+
Deploy to [GitHub Pages](https://pages.github.com/):
107+
108+
```sh
109+
# with npm
110+
$ npm run deploy
111+
112+
# or with yarn
113+
$ yarn deploy
114+
```
115+
116+
It force pushes the `./build/` directory to the remote repository's `gh-pages` branch.
117+
118+
## Environment Variables
119+
120+
Environment variables work the same as [create-react-app](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables) except the custom environment variables begin with `APP_` instead of `REACT_APP_`.
121+
122+
## Test
123+
124+
There are no tests, just linting:
125+
126+
```sh
127+
# with npm
128+
$ npm run lint
129+
$ npm run lint:fix
130+
131+
# with yarn
132+
$ yarn lint
133+
$ yarn lint:fix
134+
```
135+
136+
Feel free to add a [testing framework](https://github.com/sorrycc/awesome-javascript#testing-frameworks).
137+
138+
For manual testing, you can build the (production) app locally:
139+
140+
```sh
141+
# git stash
142+
$ sed -i '' '/homepage/d' package.json
143+
$ npm run build # yarn build
144+
# git checkout -- package.json
145+
# git stash pop
146+
```
147+
148+
Start a local server:
149+
150+
```sh
151+
$ cd build
152+
$ python -m SimpleHTTPServer
153+
# press `Ctrl + C` to stop the server
154+
```
155+
156+
And access it on `localhost:8000`:
157+
158+
```sh
159+
$ open http://localhost:8000
160+
```
161+
162+
## Layout
163+
164+
Directory structure (dotfiles are omitted):
165+
166+
```sh
167+
$ tree -I 'build|node_modules'
168+
.
169+
β”œβ”€β”€ LICENSE
170+
β”œβ”€β”€ README.md
171+
β”œβ”€β”€ config
172+
β”‚Β Β  β”œβ”€β”€ env.js
173+
β”‚Β Β  β”œβ”€β”€ paths.js
174+
β”‚Β Β  β”œβ”€β”€ webpack.config.js
175+
β”‚Β Β  └── webpackDevServer.config.js
176+
β”œβ”€β”€ package.json
177+
β”œβ”€β”€ public
178+
β”‚Β Β  β”œβ”€β”€ index.html
179+
β”‚Β Β  └── manifest.json
180+
β”œβ”€β”€ scripts
181+
β”‚Β Β  β”œβ”€β”€ build.js
182+
β”‚Β Β  └── start.js
183+
└── src
184+
β”œβ”€β”€ index.css
185+
β”œβ”€β”€ index.js
186+
└── serviceWorker.js
187+
188+
4 directories, 14 files
189+
```
190+
191+
## Diff
192+
193+
Compared to `create-react-app`, the additional dependencies saved to `package.json` are:
194+
195+
- [@commitlint/{cli,config-conventional}](https://github.com/conventional-changelog/commitlint)
196+
- [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel)
197+
- [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)
198+
- [gitploy](https://github.com/remarkablemark/gitploy)
199+
- [husky](https://github.com/typicode/husky)
200+
- [jsonlint](https://github.com/zaach/jsonlint)
201+
- [lint-staged](https://github.com/okonet/lint-staged)
202+
- [prettier](https://github.com/prettier/prettier)
203+
- [standard-version](https://github.com/conventional-changelog/standard-version)
204+
205+
## License
206+
207+
[MIT](LICENSE)

0 commit comments

Comments
Β (0)