Skip to content

Commit

Permalink
Merge pull request #17 from gregoranders/development
Browse files Browse the repository at this point in the history
Closes #5
  • Loading branch information
gregoranders authored Jun 11, 2020
2 parents 515d436 + 9555020 commit b7c0d86
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 16 deletions.
15 changes: 12 additions & 3 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ plugins:
tslint:
enabled: false
eslint:
enabled: false
enabled: true
channel: "eslint-6"
config:
config: .cceslintrc.js
extensions:
- .es6
- .js
- .jsx
- .ts
- .tsx
- .mjs
fixme:
enabled: true
git-legal:
Expand All @@ -14,8 +24,7 @@ exclude_patterns:
- "!spec/support/helpers"
- "config/"
- "db/"
- "dist/"
- "public/"
- "docs/public"
- "features/"
- ".circleci/"
- ".github/"
Expand Down
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/public/**
#/public/**
*.config.js
6 changes: 2 additions & 4 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest]
node-version: [14.x]
# os: [ubuntu-latest, macos-latest, windows-latest]
# node-version: [10.x, 12.x, 13.x, 14.x]
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [10.x, 12.x, 13.x, 14.x]

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest]
node-version: [14.x]
# os: [ubuntu-latest, macos-latest, windows-latest]
# node-version: [10.x, 12.x, 13.x, 14.x]
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [10.x, 12.x, 13.x, 14.x]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ npm run watch-script
npm run watch-scss
npm run watch-livereload
```
#### Code Climate Checks [docker required](docs/CODECLIMATE.md)
```
npm run codeclimate
```

### Storybook

Expand Down
64 changes: 64 additions & 0 deletions docs/CODECLIMATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Code Climate on localhost

## Docker image sizes

```sh
codeclimate/codeclimate 110MB
codeclimate/codeclimate-eslint 1.25GB
codeclimate/codeclimate-structure 5.16GB
codeclimate/codeclimate-duplication 5.16GB
codeclimate/codeclimate-tslint 559MB
codeclimate/codeclimate-editorconfig 74.1MB
codeclimate/codeclimate-fixme 58.8MB
codeclimate/codeclimate-git-legal 373MB
```

### Initial docker images

```sh
#!/usr/bin/env sh

docker pull codeclimate/codeclimate-structure
docker pull codeclimate/codeclimate-duplication
docker pull codeclimate/codeclimate

# vim: tw=78 ft=sh ts=2 sw=2 sts=2 nu:
```

### Script for code climate

```sh
#!/usr/bin/env sh

CODE_DIRECTORY=$(pwd)

docker run \
--interactive --tty --rm \
--env CODECLIMATE_CODE="${CODE_DIRECTORY}" \
--volume "${CODE_DIRECTORY}":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc \
codeclimate/codeclimate $@

docker run --interactive --tty --rm --env CODECLIMATE_CODE=\"./\" --volume \"./\":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze

# vim: tw=78 ft=sh ts=2 sw=2 sts=2 nu:
```

### Install engines

```sh
[script above] engines:install duplication structure eslint nodesecurity requiresafe
```

### Analyze code

```sh
[script above] analyze
```

or

```sh
npm run codeclimate
```
6 changes: 5 additions & 1 deletion docs/Intro.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Meta } from '@storybook/addon-docs/blocks';

<Meta title="Docs|Intro" />

# ts-react-playground - [TypeScript](http://www.typescriptlang.org/) [React](https://reactjs.org/) Playground 0.0.4
# ts-react-playground - [TypeScript](http://www.typescriptlang.org/) [React](https://reactjs.org/) Playground v0.0.5

[![Dependency Status][daviddm-image]][daviddm-url]
[![License][license-image]][license-url]
Expand Down Expand Up @@ -83,6 +83,10 @@ npm run watch-script
npm run watch-scss
npm run watch-livereload
```
#### Code Climate Checks [docker required](docs/CODECLIMATE.md)
```
npm run codeclimate
```

### Storybook

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-react-playground",
"version": "0.0.4",
"version": "0.0.5",
"description": "TypeScript React Playground",
"scripts": {
"start": "webpack-dev-server --open --progress --config webpack.config.js",
Expand Down Expand Up @@ -39,6 +39,7 @@
"docker:build": "cross-env NODE_ENV=production docker-compose build --force-rm --no-cache --parallel --pull",
"docker:up": "docker-compose up -d",
"docker:down": "docker-compose down",
"codeclimate": "docker run --interactive --tty --rm --env CODECLIMATE_CODE=\"$PWD\" --volume \"$PWD\":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze",
"prestorybook": "jest --runInBand --json --outputFile=.jest-test-results.json --env=enzyme --setupFilesAfterEnv=jest-enzyme --reporters=jest-spec-reporter jest-junit --coverage --coverageDirectory ../coverage --rootDir ./src",
"storybook": "cross-env NODE_ENV=production start-storybook",
"prebuild-storybook": "jest --runInBand --json --outputFile=.jest-test-results.json --env=enzyme --setupFilesAfterEnv=jest-enzyme --reporters=jest-spec-reporter jest-junit --coverage --coverageDirectory ../coverage --rootDir ./src",
Expand Down
2 changes: 1 addition & 1 deletion src/script/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BrowserRouter, Redirect, Route, Switch } from 'react-router-dom';
import { RecoilRoot } from 'recoil';
import { string as IsString } from 'prop-types';

import Loading from '@app/loading';
import { default as Loading } from '@app/loading';

const Layout = lazy(() => import('@components/layout'));

Expand Down
2 changes: 1 addition & 1 deletion src/script/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@
"@app/*": ["./*"],
},
},
"files": ["index.tsx"]
"files": ["index.tsx", "components/pages/about/index.tsx", "components/pages/home/index.tsx", "components/pages/index/index.tsx"]
}
23 changes: 23 additions & 0 deletions src/style/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,29 @@ header {
}
}

.centered {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}

.bootstrap,
.spinner {
> h1 {
&.dots {
color: $color-theme-d3;
font-size: 15em;
font-weight: 900;
text-shadow: 4px 4px 8px lighten($color-theme-dark, 50%);
}
}
}

main {
height: 90vh;
}

table {
width: 100%;

Expand Down

0 comments on commit b7c0d86

Please sign in to comment.