Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript",
],
"plugins": [
// Reuse babel's injected headers
// ["@babel/plugin-transform-runtime", { "version": "^7.11.2" }],

// Handle absolute imports
["polyfill-corejs3", {
"method": "usage-pure",
}],

// Handle absolute imports
["babel-plugin-module-resolver", {
"root": ["."],
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"alias": {
"#components": "./src/components",
"#hooks": "./src/hooks",
"#utils": "./src/utils",
},
}],

// Extends javascript support
"@babel/plugin-syntax-dynamic-import",

// Extends react support
"@babel/plugin-transform-react-constant-elements",
// "@babel/plugin-transform-react-inline-elements",
]
}
66 changes: 0 additions & 66 deletions .babelrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Support all browsers with more than 1% market share
> 1%
>= 1%
148 changes: 148 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
media
postgres-data
redis-data

production.env

# Swap files
*.swp

# Byte-compiled / optimized / DLL files
__pycache__
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env
build
develop-eggs
dist
downloads
eggs
.eggs
lib
lib64
parts
sdist
var
*.egg-info
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov
.tox
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build

# PyBuilder
target

#Ipython Notebook
.ipynb_checkpoints

# SASS cache
.sass-cache
media_test

# Rope project settings
.ropeproject


# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Typescript v1 declaration files
typings

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env*

# Sensitive Deploy Files
deploy/eb/

# tox
./.tox

# git
./.git
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ module.exports = {
}],
'react/prop-types': 0,
'react/jsx-props-no-spreading': 0,
'react/jsx-key': ['warn', {
checkFragmentShorthand: true,
checkKeyMustBeforeSpread: true,
}],
// 'react/prop-types': [1, { ignore: [], customValidators: [], skipUndeclared: false }],
'react/no-unused-state': 'warn',
'react/require-default-props': ['warn', {
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: deep ui CI

on:
pull_request:
push:
branches:
- master

jobs:
build_test:
name: 🚴 Build + Lint + Test 🚴 # Match the name below (8398a7/action-slack).
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🐳 Prepare Docker
id: prep
run: |
TAG=$(echo $GITHUB_SHA | head -c7)
IMAGE="docker.pkg.github.com/the-deep/deep-ui"
echo ::set-output name=tagged_image::${IMAGE}:${TAG}
echo ::set-output name=tag::${TAG}
- name: 🐳 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

- name: 🐳 Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-single-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-single-buildx

- name: 🐳 Build image
uses: docker/build-push-action@v2
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: Dockerfile
push: false # This would be set to true in a real world deployment scenario.
load: true
tags: ${{ steps.prep.outputs.tagged_image }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

- name: 🤞 Run CSS Lint 🧪
env:
DOCKER_IMAGE: ${{ steps.prep.outputs.tagged_image }}
run: |
docker run --rm --workdir="/code/" $DOCKER_IMAGE sh -c 'yarn css-lint'

- name: 🤞 Run Lint 🧪
env:
DOCKER_IMAGE: ${{ steps.prep.outputs.tagged_image }}
run: |
docker run --rm --workdir="/code/" $DOCKER_IMAGE sh -c 'yarn lint'

- name: 🤞 Run Typecheck 🧪
env:
DOCKER_IMAGE: ${{ steps.prep.outputs.tagged_image }}
run: |
docker run --rm --workdir="/code/" $DOCKER_IMAGE sh -c 'yarn typecheck'

- name: 🤞 Run Build 🧪
env:
DOCKER_IMAGE: ${{ steps.prep.outputs.tagged_image }}
run: |
docker run --rm --workdir="/code/" $DOCKER_IMAGE sh -c 'yarn build'

# Temp fix
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: 🐳 Move docker cache (🧙 Hack fix)
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ yarn-error.log*

build-storybook.log*
storybook-static/

stats.html
3 changes: 1 addition & 2 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"plugins": [],
"extends": [
"stylelint-config-recommended",
"stylelint-config-concentric"
"stylelint-config-recommended"
],
"rules": {
"indentation": 4,
Expand Down
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:lts-alpine

MAINTAINER togglecorp [email protected]

RUN apk update\
&& apk add --no-cache git bash python3 g++ make

WORKDIR /code

COPY ./package.json ./yarn.lock /code/
RUN yarn install --frozen-lockfile

COPY . /code/
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3.3'

services:
js:
build: .
command: sh -c 'yarn install --frozen-lock && yarn watch'
volumes:
- .:/code
Loading