Skip to content

Commit

Permalink
initial commit with ReactQL scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
nchan0154 committed Sep 28, 2017
1 parent d74dfb0 commit 1bd7387
Show file tree
Hide file tree
Showing 59 changed files with 22,140 additions and 23 deletions.
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
["env", {
"targets": {
"node": true
}
}]
]
}
43 changes: 43 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Meta
**/.DS_Store

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

# Runtime data
pids
*.pid
*.seed

# 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

# node-waf configuration
.lock-wscript

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

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Distribution
dist
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[*]
indent_style = space
end_of_line = lf
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
64 changes: 64 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const path = require('path');
const baseRules = require('eslint-config-airbnb-base/rules/style');
const [_, ...restricted] = baseRules.rules['no-restricted-syntax'];

const PATHS = require('./config/paths');

module.exports = {
extends: 'airbnb',
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
jsx: true,
},
env: {
node: true,
browser: true,
},
plugins: [
'babel',
'import',
'jsx-a11y',
'compat',
],
rules: {
'arrow-parens': ['error', 'as-needed'],
'react/forbid-prop-types': [1, { forbid: ['any']} ],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'react/prefer-stateless-function': [2, { ignorePureComponents: true }],
'react/no-multi-comp': 0,
'react/jsx-closing-bracket-location': [1, 'after-props'],
'react/prop-types': [1, {
ignore: [
// `dispatch` is typically used by Redux `@connect`
'dispatch',
// `data` is injected by Apollo
'data',
],
}],
'linebreak-style': 0,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'no-restricted-syntax': [2,
...restricted.filter(
r => !['ForOfStatement'].includes(r.selector)
),
],
'global-require': 0,
'import/no-unresolved': [2, { commonjs: true }],
'compat/compat': 2
},
settings: {
'import/resolver': {
node: {
paths: [
PATHS.root,
'node_modules',
],
},
},
},
globals: {
SERVER: false,
},
};
30 changes: 7 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Meta
**/.DS_Store

# 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
Expand All @@ -23,37 +23,21 @@ coverage
# 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/
node_modules
jspm_packages

# 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

# Distribution
dist
1 change: 1 addition & 0 deletions .reactql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.8.5
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sudo: required
services:
- docker
before_install:
- docker build -t reactql_kit .
script:
- docker run reactql_kit npm run lint
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM debian:jessie-slim

ENV EPHIMERAL_PACKAGES "build-essential dh-autoreconf curl xz-utils python"
ENV PACKAGES "libpng-dev"

# Add `package.json` to build Debian compatible NPM packages
WORKDIR /src
ADD package.json .

# install everything (and clean up afterwards)
RUN apt-get update \
&& apt-get install -y apt-utils \
&& apt-get install -y ${EPHIMERAL_PACKAGES} ${PACKAGES} \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install -y nodejs \
&& cd /src \
&& npm i \
; apt-get remove --purge -y ${EPHIMERAL_PACKAGES} \
; apt-get autoremove -y ${EPHIMERAL_PACKAGES} \
; apt-get clean \
; apt-get autoclean \
; echo -n > /var/lib/apt/extended_states \
; rm -rf /var/lib/apt/lists/* \
; rm -rf /usr/share/man/?? \
; rm -rf /usr/share/man/??_*

# Add the remaining project files
ADD . .

# Build distribution
RUN npm run build

# Set the default host/port
ENV HOST 0.0.0.0
ENV PORT 4000

# Start the server by default
CMD npm run server
3 changes: 3 additions & 0 deletions browerslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# By default, target only modern browsers

last 3 versions
45 changes: 45 additions & 0 deletions config/paths.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// ----------------------
// IMPORTS

const path = require('path');

// ----------------------

// Parent folder = project root
const root = path.join(__dirname, '..');

module.exports = {
// Root project folder. This is the current dir.
root,

// Kit. ReactQL starter kit code. You can edit these files, but be
// aware that upgrading your starter kit could overwrite them
kit: path.join(root, 'kit'),

// Entry points. This is where webpack will look for our browser.js,
// server.js and vendor.js files to start building
entry: path.join(root, 'kit', 'entry'),

// Webpack configuration files
webpack: path.join(root, 'kit', 'webpack'),

// Views for internal use
views: path.join(root, 'kit', 'views'),

// Source path; where we'll put our application files
src: path.join(root, 'src'),

// Static files. HTML, images, etc that can be processed by Webpack
// before being moved into the final `dist` folder
static: path.join(root, 'static'),

// Dist path; where bundled assets will wind up
dist: path.join(root, 'dist'),

// Dist path for development; where dev assets will wind up
distDev: path.resolve(root, 'dist', 'dev'),

// Public. This is where our web server will start looking to serve
// static files from
public: path.join(root, 'dist', 'public'),
};
6 changes: 6 additions & 0 deletions cssnano.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-disable import/no-extraneous-dependencies */
const defaultPreset = require('cssnano-preset-default');

module.exports = defaultPreset({
normalizeUrl: false,
});
Loading

0 comments on commit 1bd7387

Please sign in to comment.