Skip to content

Commit

Permalink
update dependencies; internal restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew committed Dec 13, 2018
1 parent 6fd2778 commit 02f5cc1
Show file tree
Hide file tree
Showing 31 changed files with 2,451 additions and 67,403 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/node_modules
node_modules
dist
8 changes: 7 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/node_modules
node_modules
src
examples
dummy_data
.babelrc
.gitignore
webpack.config.js
1 change: 0 additions & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
</head>
<body>
<div id="root"></div>
<script src="./dist/main.js"></script>
<script type="text/javascript" src="main.js"></script></body>
</html>
56 changes: 30 additions & 26 deletions dist/main.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/app/js/components/Demo.js → examples/src/Demo.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React, { Component } from 'react'

import { GOOGLE_API_KEY } from '../config.js'
import Calendar from './Calendar'
import Calendar from '../../src/index.js'
import Docs1 from './Docs1'
import Docs2 from './Docs2'
import styles from './Demo.scss'

const calendar_configuration = {
api_key: GOOGLE_API_KEY,
api_key: 'AIzaSyA13TZidErRpYRuet8rqXPRdxEX_dcM9gU',
calendars: [
{
name: 'demo',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions src/public/index.html → examples/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
<html>
<head>
<title>React Google Calendar</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script src="./public/dist/main.bundle.js"></script>
<script type="text/javascript" src="app.bundle.js"></script></body>
</body>
</html>
2 changes: 1 addition & 1 deletion src/app/js/index.js → examples/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-dom'
import Demo from './components/Demo'
import Demo from './Demo'

render(<Demo />, document.getElementById('root'))
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
<html>
<head>
<title>React Google Calendar</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script src="./dist/main.js"></script>
</body>
</html>
3 changes: 0 additions & 3 deletions index.js

This file was deleted.

5,738 changes: 2,294 additions & 3,444 deletions package-lock.json

Large diffs are not rendered by default.

37 changes: 22 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"name": "react_google_calendar",
"version": "2.2.1",
"version": "2.2.2",
"description": "An implementation of react-big-calendar populated by linked Google calendars",
"main": "index.js",
"main": "dist/index.js",
"scripts": {
"start": "webpack-dev-server --mode development --config webpack.base.config.js --open --hot --history-api-fallback --env.PLATFORM=local --env.VERSION=stag",
"build": "webpack --mode production --config webpack.prod.config.js --env.PLATFORM=production --env.VERSION=stag --progress",
"test": "jest"
"build": "webpack --mode production",
"deploy": "gh-pages -d examples/dist",
"prepublishOnly": "npm run transpile",
"publish-demo": "npm run build && npm run deploy",
"start": "webpack-dev-server --mode development --open --display-error-details",
"test": "jest",
"transpile": "babel src -d dist --copy-files"
},
"keywords": [
"react",
Expand All @@ -15,20 +19,17 @@
],
"author": "crash <[email protected]>",
"license": "MIT",
"dependencies": {
"peerDependencies": {
"array.prototype.flat": "^1.2.1",
"axios": "^0.16.2",
"bluebird": "^3.5.2",
"bootstrap": "^4.1.3",
"dotenv": "^6.1.0",
"express": "^4.16.4",
"moment": "^2.22.2",
"react": "^15.6.1",
"react-big-calendar": "^0.14.4",
"react-dom": "^15.6.1"
"react": "^16.6.3",
"react-big-calendar": "^0.20.2",
"react-dom": "^16.6.3"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/cli": "^7.0.0",
"@babel/core": "^7.2.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
Expand All @@ -38,9 +39,12 @@
"@babel/polyfill": "^7.0.0-beta.51",
"@babel/preset-env": "^7.0.0-beta.51",
"@babel/preset-react": "^7.0.0-beta.51",
"babel-loader": "^8.0.0-beta.0",
"babel-core": "^7.0.0-bridge.0",
"babel-loader": "^8.0.4",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.11",
"gh-pages": "^2.0.1",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"jest": "^23.6.0",
"node-sass": "^4.9.4",
Expand All @@ -53,6 +57,9 @@
"webpack-dev-server": "^3.1.0",
"webpack-merge": "^4.1.4"
},
"resolutions": {
"babel-core": "7.0.0-bridge.0"
},
"repository": {
"type": "git",
"url": "https://github.com/crashspringfield/react-google-calendar"
Expand Down
33 changes: 0 additions & 33 deletions src/app/js/components/Calendar.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/app/js/config.js

This file was deleted.

42 changes: 40 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
import Calendar from './app/components/Calendar.js'
import React, { Component } from 'react'
import BigCalendar from 'react-big-calendar'
import moment from 'moment'

export default Calendar
import 'react-big-calendar/lib/css/react-big-calendar.css'
import googleAPI from "./utils/googleAPI"

const localizer = BigCalendar.momentLocalizer(moment)

export default class Calendar extends Component {
constructor(props) {
super(props)
this.state = {
events: []
}
}

componentDidMount = () => {
if (this.props.config) {
this.getGoogleCalendarEvents()
} else {
console.log("React Google Calendar requires you pass a configuration object")
}
}

getGoogleCalendarEvents = () => {
googleAPI.getAllCalendars(this.props.config)
.then(events => {
this.setState({ events })
})
.catch(err => { throw new Error(err) })
}

render = () =>
<div>
<BigCalendar
localizer={localizer}
events={this.state.events}
style={{ height: "100vh" }} />
</div>
}
Loading

0 comments on commit 02f5cc1

Please sign in to comment.