Skip to content

Commit ec540c3

Browse files
feature/integrate-with-codeclimate (#41)
1 parent 8466519 commit ec540c3

File tree

8 files changed

+183
-3620
lines changed

8 files changed

+183
-3620
lines changed

.github/workflows/ci.yml

-27
This file was deleted.

.github/workflows/coverage.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: coverage
2+
on: [push]
3+
jobs:
4+
coverage:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
node-version: [12.x]
9+
env:
10+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
11+
CODECLIMATE_PREBUILD_TEST_REPORTER_URL: https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: ${{ matrix.node-version }}
17+
- name: Get Yarn cache directory
18+
id: yarn-cache-dir-path
19+
run: echo "::set-output name=dir::$(yarn cache dir)"
20+
- name: Use Yarn cache
21+
uses: actions/cache@v2
22+
id: yarn-cache
23+
with:
24+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
25+
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
26+
- run: yarn install --prefer-offline --frozen-lockfile
27+
- run: yarn test:coverage
28+
- name: set up codeclimate test reporter
29+
run: |
30+
wget -O cc-test-reporter ${CODECLIMATE_PREBUILD_TEST_REPORTER_URL}
31+
chmod u+x cc-test-reporter
32+
- name: coverage
33+
run: |
34+
./cc-test-reporter before-build
35+
yarn test:coverage
36+
./cc-test-reporter after-build

.github/workflows/test.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: test
2+
on: [push]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
node-version: [12.x]
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-node@v1
12+
with:
13+
node-version: ${{ matrix.node-version }}
14+
- name: Get Yarn cache directory
15+
id: yarn-cache-dir-path
16+
run: echo "::set-output name=dir::$(yarn cache dir)"
17+
- name: Use Yarn cache
18+
uses: actions/cache@v2
19+
id: yarn-cache
20+
with:
21+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
22+
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
23+
- run: yarn install --prefer-offline --frozen-lockfile
24+
- run: yarn test

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ yarn-debug.log*
66
yarn-error.log*
77
lerna-debug.log*
88

9+
# Gatsby Typegen
10+
src/__generated__/
11+
912
# Jetbrains
1013
.idea/
1114

README.md

+110-17
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,85 @@
1-
<h1 align="center">⚡️ Zap</h1>
1+
<p align="center">
2+
<img width="140" src="assets/logo.svg" alt="Zap Logo" />
3+
</p>
4+
<h1 align="center">⚡ Zap</h1>
25
<p align="center">Fast and lightweight blog research project</p>
3-
4-
# Table of contents
5-
6-
- [Overview](#overview)
7-
8-
- [What is zap?](#what-is-zap?)
9-
- [Getting started](#getting-started)
6+
<p align="center">
7+
<a href="https://codeclimate.com/github/zap-lab/zap/maintainability"><img src="https://api.codeclimate.com/v1/badges/d797b7556019a23cf5bc/maintainability" /></a>
8+
<a href="https://codeclimate.com/github/zap-lab/zap/test_coverage"><img src="https://api.codeclimate.com/v1/badges/d797b7556019a23cf5bc/test_coverage" /></a>
9+
</p>
1010

1111
# Overview
1212

1313
## What is zap?
1414

15-
## Getting started
15+
Zap is a fast, lightweight, developer-specific blog open source built on top of Gatsby. The principles for developing Zap are as follows.
1616

17-
### Install
17+
- It should be incredibly fast, the content should load within the user's browser in 50ms.
18+
- It should be aesthetic. Readability is the most important principle, and for this we aim for simple functionality and UI.
19+
- All information in the Zap project should be accessible to anyone. This applies to everything including design, decision, and remaining tasks.
20+
- It should be easy, easy to install, easy to contribute, and easy to use.
21+
- It must be multi-platform compatible.
22+
- It must conform to the Modern Web Specification. This includes PWA, AMP, a11y, and means to prefer video instead of gif, svg instead of png, icon font set instead of svg icon whenever possible.
1823

19-
First, You need `gatsby-cli` to use gatsby features. Type the following command on your terminal.
24+
## Getting started
25+
26+
If you type as follows, You can see the project structure.
2027

2128
```bash
22-
// yarn
23-
yarn global add gatsby-cli
29+
tree -L 2 -I 'node_modules' .
30+
```
2431

25-
// npm
26-
npm install -g gatsby-cli
32+
Below is the project structure of zap.
33+
34+
```plaintext
35+
zap/
36+
|-- LICENSE # project license (MIT)
37+
|-- README.md # project main document
38+
|-- assets # document assets (images)
39+
| `-- logo.svg
40+
|-- commitlint.config.js
41+
|-- gatsby-browser.js
42+
|-- gatsby-config.js
43+
|-- gatsby-node.js
44+
|-- gatsby-ssr.js
45+
|-- jest.config.js # jest test settings
46+
|-- package.json # dependency list, yarn scripts
47+
|-- node_modules/ # dependency packages
48+
|-- public # gatsby static folder
49+
| |-- chunk-map.json
50+
| |-- favicon-32x32.png
51+
| |-- favicon.svg
52+
| |-- icons
53+
| |-- manifest.webmanifest
54+
| |-- page-data
55+
| |-- render-page.js
56+
| |-- render-page.js.map
57+
| |-- static
58+
| `-- webpack.stats.json
59+
|-- src # project main sources
60+
| |-- __generated__
61+
| |-- components
62+
| |-- content
63+
| |-- images
64+
| |-- layouts
65+
| |-- pages
66+
| |-- stories
67+
| |-- styles
68+
| |-- templates
69+
| `-- typings.d.ts
70+
|-- tsconfig.json # typescript configuration
71+
`-- yarn.lock # package lock files
2772
```
2873

29-
Then, run following command
74+
### Installation
75+
76+
This project uses [yarn](https://yarnpkg.com/) as a package manager, If you don't have yarn, Follow [this link](https://yarnpkg.com/getting-started/install) to get download one.
77+
78+
```bash
79+
yarn install
80+
```
81+
82+
Then, run following command.
3083

3184
```bash
3285
yarn start
@@ -36,15 +89,55 @@ yarn start
3689

3790
## Testing
3891

92+
This project uses [Jest](https://jestjs.io/) and [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/), If you want to run test, Run as follows.
93+
94+
```bash
95+
yarn test
96+
```
97+
98+
## Coverage
99+
100+
For coverage, You can run as follows.
101+
102+
```bash
103+
yarn test:coverage
104+
```
105+
106+
## Linting
107+
108+
This project uses two lint systems as follows.
109+
110+
- eslint ([link](https://eslint.org/))
111+
- prettier ([link](https://prettier.io/))
112+
113+
And, if you commit the husky will handle the lint automatically.
114+
115+
- See husky setting
116+
117+
If you want to run the lint manually, You can run as follows.
118+
119+
```bash
120+
# eslint
121+
yarn lint
122+
123+
# prettier
124+
yarn format
125+
```
126+
39127
## Convention
40128

129+
This project has following conventions.
130+
131+
- Conventional Commits ([link](https://www.conventionalcommits.org/en/v1.0.0/))
132+
- airbnb-typescript ([link](https://www.npmjs.com/package/eslint-config-airbnb-typescript))
133+
41134
# License
42135

43136
zap is under MIT license
44137

45138
MIT License
46139

47-
Copyright (c) 2020 Mighty-Legion
140+
Copyright (c) 2020-2021 zap-lab
48141

49142
Permission is hereby granted, free of charge, to any person obtaining a copy
50143
of this software and associated documentation files (the "Software"), to deal

assets/logo.svg

+9
Loading

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"start": "yarn dev",
2020
"precommit": "lint-staged",
2121
"test": "jest",
22+
"test:coverage": "jest --coverage",
2223
"tsc": "tsc",
2324
"storybook": "start-storybook -p 6006",
2425
"build-storybook": "build-storybook"

0 commit comments

Comments
 (0)