This repository has been archived by the owner on May 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce67d1e
commit 550afbe
Showing
16 changed files
with
1,388 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
yarn-error.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Uber Technologies, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
# create-fusionjs | ||
# Create Fusion.js App | ||
|
||
Creates a Fusion.js application using the command line. | ||
|
||
## Usage | ||
|
||
``` | ||
yarn create fusion-app <appName> | ||
``` | ||
|
||
## Documentation | ||
|
||
Read Fusion.js documentation and learn how to get help at: https://fusionjs.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env node | ||
|
||
const path = require('path'); | ||
const chalk = require('chalk'); | ||
const scaffold = require('fusion-scaffolder'); | ||
|
||
const projectName = process.argv[2]; | ||
|
||
if (!projectName) { | ||
console.log(`${chalk.red('Could not create application.')} | ||
Please specify the project directory: | ||
${chalk.cyan('yarn create fusion-app')} ${chalk.green('<project-directory>')} | ||
Example: | ||
${chalk.cyan('yarn create fusion-app')} ${chalk.green('my-fusionjs-app')} | ||
`); | ||
process.exit(1); | ||
} | ||
|
||
console.log(` | ||
Creating a new Fusion.js app in: ${chalk.green( | ||
`${process.cwd()}/${projectName}` | ||
)} | ||
`); | ||
|
||
scaffold({ | ||
path: './templates/basic', | ||
cwd: path.join(__dirname, '..'), | ||
projectPath: path.join(process.cwd(), projectName), | ||
project: projectName, | ||
}) | ||
.then(() => { | ||
console.log(` | ||
${chalk.green.bold(`Success! You have created a Fusion.js project.`)} | ||
Start your Fusion.js app with: | ||
${chalk.cyan(`cd ${projectName} && yarn dev`)} | ||
`); | ||
}) | ||
.catch(e => { | ||
console.log('Error starting your application', e); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "create-fusion-app", | ||
"version": "0.0.1", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"bin": { | ||
"create-fusion-app": "bin/cli.js" | ||
}, | ||
"dependencies": { | ||
"chalk": "^2.4.1", | ||
"fusion-scaffolder": "https://github.com/kevingrandon/fusion-scaffolder" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.fusion | ||
node_modules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Fusion.js application | ||
|
||
Welcome to your Fusion.js application. Get started by running the application with `yarn dev` in a terminal. | ||
|
||
Visit our documentation at: https://fusionjs.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "fusion-boilerplate", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"dependencies": { | ||
"fusion-cli": "^1.6.0", | ||
"fusion-core": "^1.3.1", | ||
"fusion-plugin-react-router": "^1.1.1", | ||
"fusion-plugin-styletron-react": "^2.4.1", | ||
"fusion-react": "^1.0.5", | ||
"fusion-react-async": "^1.2.2", | ||
"fusion-tokens": "^1.0.3", | ||
"react": "^16.4.0", | ||
"react-dom": "^16.4.0", | ||
"styletron": "^3.0.4" | ||
}, | ||
"scripts": { | ||
"dev": "fusion dev", | ||
"test": "fusion test", | ||
"build": "fusion build", | ||
"start": "fusion start" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React, { Component } from 'react'; | ||
|
||
import {Router, Route, Link, Switch, NotFound} from 'fusion-plugin-react-router'; | ||
|
||
export default class Header extends Component { | ||
render() { | ||
return ( | ||
<header> | ||
<h1>Welcome to Fusion.js</h1> | ||
<ul> | ||
<li><Link to="/">Home</Link></li> | ||
<li><Link to="/styles">Styles</Link></li> | ||
<li><Link to="/404">404</Link></li> | ||
</ul> | ||
</header> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import App from 'fusion-react'; | ||
import Router from 'fusion-plugin-react-router'; | ||
import UniversalEvents, { | ||
UniversalEventsToken, | ||
} from 'fusion-plugin-universal-events'; | ||
import Styletron from 'fusion-plugin-styletron-react'; | ||
|
||
import root from './root.js'; | ||
|
||
export default () => { | ||
const app = new App(root); | ||
app.register(Styletron); | ||
app.register(Router); | ||
app.register(UniversalEventsToken, UniversalEvents); | ||
return app; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import React from 'react'; | ||
|
||
const Home = () => <div>Hello world</div>; | ||
export default Home; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from 'react'; | ||
|
||
import {NotFound} from 'fusion-plugin-react-router'; | ||
|
||
const PageNotFound = () => <NotFound><div>404</div></NotFound>; | ||
export default PageNotFound; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
import {styled} from 'fusion-plugin-styletron-react'; | ||
|
||
const Panel = styled('div', {background: 'silver'}); | ||
const Styles = () => <Panel>Styled component</Panel>; | ||
export default Styles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
|
||
import {Router, Route, Switch} from 'fusion-plugin-react-router'; | ||
|
||
import Header from './components/header.js'; | ||
import Home from './pages/home.js'; | ||
import PageNotFound from './pages/pageNotFound.js'; | ||
import Styles from './pages/styles.js'; | ||
|
||
const root = ( | ||
<div> | ||
<Header /> | ||
<Switch> | ||
<Route exact path="/" component={Home} /> | ||
<Route exact path="/styles" component={Styles} /> | ||
<Route component={PageNotFound} /> | ||
</Switch> | ||
</div> | ||
); | ||
export default root; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// @flow | ||
|
||
module.exports = async function getContext(ctx /*: any*/) { | ||
return ctx; | ||
}; |
Oops, something went wrong.