Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsushitoji committed Nov 16, 2018
0 parents commit 792f105
Show file tree
Hide file tree
Showing 64 changed files with 9,636 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FB_API_KEY =
FB_AUTH_DOMAIN =
FB_DATABASE_URL =
FB_STORAGE_BUCKET =
FB_MESSAGING_SENDER_ID =
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "react-redux-firebase-3541f"
}
}
97 changes: 97 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
### gibo dump node
# 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 (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

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

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://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

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next


### gibo dump macOS
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### build directory
dist
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.12.0
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": all,
"semi": true,
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Try Firebase with react-redux-firebase

- [react-redux-firebase](https://github.com/prescottprue/react-redux-firebase)
20 changes: 20 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const presets = [
"@babel/react",
"@babel/typescript",
[
"@babel/env",
{
"modules": false
}
],
];

const plugins = [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread",
"@babel/plugin-syntax-dynamic-import",
];

process.env["NODE_ENV"] === 'production' && plugins.push("react-remove-properties");

module.exports = { presets, plugins };
20 changes: 20 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
14 changes: 14 additions & 0 deletions firestore.indexes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Example:
//
// "indexes": [
// {
// "collectionId": "widgets",
// "fields": [
// { "fieldPath": "foo", "mode": "ASCENDING" },
// { "fieldPath": "bar", "mode": "DESCENDING" }
// ]
// }
// ]
"indexes": []
}
7 changes: 7 additions & 0 deletions firestore.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write;
}
}
}
19 changes: 19 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
roots: [
"<rootDir>/src"
],
transform: {
"^.+\\.tsx?$": "ts-jest",
},
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
moduleFileExtensions: [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
//"snapshotSerializers": ["enzyme-to-json/serializer"],
setupTestFrameworkScriptFile: "<rootDir>src/setupTests.ts"
};
103 changes: 103 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"name": "react-ts-starter",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "NODE_ENV=production webpack",
"start": "NODE_ENV=development webpack-dev-server",
"lint": "tslint 'src/**/*.ts{,x}' -p tsconfig.json",
"tslint-check": "tslint-config-prettier-check ./tslint.json",
"type": "tsc #",
"test": "jest",
"precommit": "lint-staged"
},
"lint-staged": {
"*.{ts,tsx}": [
"yarn lint --fix",
"yarn lint",
"yarn type",
"git add"
]
},
"dependencies": {
"@material-ui/core": "^3.2.2",
"@material-ui/icons": "^3.0.1",
"@types/classnames": "^2.2.6",
"@types/react": "^16.4.13",
"@types/react-dom": "^16.0.7",
"@types/react-redux": "^6.0.7",
"@types/react-router-config": "^1.0.9",
"@types/react-router-dom": "^4.3.1",
"@types/recompose": "^0.27.0",
"classnames": "^2.2.6",
"connected-react-router": "^5.0.1",
"firebase": "^5.5.8",
"formik": "^1.3.1",
"history": "^4.7.2",
"loadable-components": "^2.2.3",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-redux": "^5.0.7",
"react-redux-firebase": "^2.2.1",
"react-router-config": "^4.4.0-beta.6",
"react-router-dom": "^4.3.1",
"recompose": "^0.30.0",
"redux": "^4.0.0",
"redux-firestore": "^0.5.8",
"redux-observable": "^1.0.0",
"redux-thunk": "^2.3.0",
"rxjs": "^6.3.3",
"typeface-roboto": "^0.0.54"
},
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.1.0",
"@types/dotenv": "^4.0.3",
"@types/enzyme": "^3.1.14",
"@types/enzyme-adapter-react-16": "^1.0.3",
"@types/jest": "^23.3.8",
"@types/redux-mock-store": "^1.0.0",
"babel-loader": "^8.0.4",
"babel-plugin-react-remove-properties": "^0.2.5",
"css-loader": "^1.0.1",
"dotenv": "^6.1.0",
"dotenv-webpack": "^1.5.7",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.6.0",
"enzyme-to-json": "^3.3.4",
"file-loader": "^2.0.0",
"html-webpack-externals-plugin": "^3.8.0",
"html-webpack-plugin": "^3.2.0",
"husky": "^1.0.0",
"jest": "^23.6.0",
"lint-staged": "^8.0.0",
"mini-css-extract-plugin": "^0.4.4",
"prettier": "^1.14.3",
"redux-mock-store": "^1.5.3",
"source-map-loader": "^0.2.4",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^1.1.0",
"ts-jest": "^23.10.4",
"tslint": "^5.11.0",
"tslint-config-airbnb": "^5.11.0",
"tslint-config-prettier": "^1.15.0",
"tslint-plugin-prettier": "^2.0.0",
"tslint-react": "^3.6.0",
"typescript": "^3.1.3",
"webpack": "^4.23.1",
"webpack-bundle-analyzer": "^3.0.3",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10",
"webpack-merge": "^4.1.4",
"why-did-you-update": "^1.0.6"
},
"author": "",
"license": "ISC"
}
22 changes: 22 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": [
"config:base",
":preserveSemverRanges"
],
"timezone": "Asia/Tokyo",
"schedule": "before 4am",
"automerge": true,
"major": {
"automerge": false
},
"packageRules": [
{
"updateTypes": [
"major"
],
"labels": [
"UPDATE-MAJOR"
]
}
]
}
48 changes: 48 additions & 0 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import * as React from 'react';
import { renderRoutes, RouteConfig } from 'react-router-config';
import { compose, withStateHandlers, StateHandlerMap } from 'recompose';
import 'typeface-roboto';
import CssBaseline from '@material-ui/core/CssBaseline';
import { MuiThemeProvider } from '@material-ui/core/styles';
import { theme } from '../theme';
import { Main } from '../templates/Main';

interface Props {
route: RouteConfig;
}

export interface State {
sideOpen: boolean;
}

export interface StateHandlers {
setSideOpen: (_: React.SyntheticEvent) => void;
}

export type EnhancedProps = State & StateHandlers & Props;

const enhancer = compose<EnhancedProps, Props>(
withStateHandlers<State, StateHandlerMap<State>, Props>(
{ sideOpen: false },
{
setSideOpen: ({ sideOpen }) => () => ({
sideOpen: !sideOpen,
}),
},
),
);

export const AppComponent: React.SFC<EnhancedProps> = ({
route,
sideOpen,
setSideOpen,
}) => (
<MuiThemeProvider theme={theme}>
<CssBaseline />
<Main sideOpen={sideOpen} setSideOpen={setSideOpen}>
{renderRoutes(route.routes)}
</Main>
</MuiThemeProvider>
);

export const App = enhancer(AppComponent);
1 change: 1 addition & 0 deletions src/components/App/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './App';
Loading

0 comments on commit 792f105

Please sign in to comment.