create-cayde-app
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -55,3 +55,3 @@ "use strict"; | ||
? ["cayde"] | ||
: ["react", "react-dom", "react-router-dom", "cayde", "express"], | ||
: ["react@next", "react-dom@next", "react-router-dom", "cayde", "express"], | ||
}) | ||
@@ -58,0 +58,0 @@ .then(function() { |
{ | ||
"name": "create-cayde-app", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "CLI tool to bootstrap Cayde applications with no configuration", | ||
@@ -38,3 +38,3 @@ "main": "index.js", | ||
], | ||
"gitHead": "da8642f1211ef8a3ea6c70a6a2691de77ea970ae" | ||
"gitHead": "95ea17fddf483059560214982b4a74b8f053a646" | ||
} |
@@ -6,7 +6,7 @@ { | ||
"scripts": { | ||
"start": "ff start", | ||
"build": "ff build", | ||
"test": "ff test --env=jsdom", | ||
"start": "cayde start", | ||
"build": "cayde build", | ||
"test": "cayde test --env=jsdom", | ||
"start:prod": "NODE_ENV=production node build/server.js" | ||
} | ||
} |
@@ -1,13 +0,13 @@ | ||
import React from 'react'; | ||
import Route from 'react-router-dom/Route'; | ||
import Switch from 'react-router-dom/Switch'; | ||
import Home from './Home'; | ||
import './App.css'; | ||
import React from "react"; | ||
import Route from "react-router-dom/Route"; | ||
import Switch from "react-router-dom/Switch"; | ||
import Home from "./Home"; | ||
import "./App.css"; | ||
const App = () => ( | ||
<Switch> | ||
<Route exact path="/" component={Home} /> | ||
</Switch> | ||
<Switch> | ||
<Route exact path="/" component={Home} /> | ||
</Switch> | ||
); | ||
export default App; |
@@ -1,16 +0,16 @@ | ||
import App from './App'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import MemoryRouter from 'react-router-dom/MemoryRouter'; | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import MemoryRouter from "react-router-dom/MemoryRouter"; | ||
import App from "./App"; | ||
describe('<App />', () => { | ||
test('renders without exploding', () => { | ||
const div = document.createElement('div'); | ||
describe("<App />", () => { | ||
test("renders without exploding", () => { | ||
const div = document.createElement("div"); | ||
ReactDOM.render( | ||
<MemoryRouter> | ||
<App /> | ||
</MemoryRouter>, | ||
div | ||
<MemoryRouter> | ||
<App /> | ||
</MemoryRouter>, | ||
div, | ||
); | ||
}); | ||
}); |
@@ -1,11 +0,11 @@ | ||
import App from './App'; | ||
import BrowserRouter from 'react-router-dom/BrowserRouter'; | ||
import React from 'react'; | ||
import { hydrate } from 'react-dom'; | ||
import BrowserRouter from "react-router-dom/BrowserRouter"; | ||
import React from "react"; | ||
import { hydrate } from "react-dom"; | ||
import App from "./App"; | ||
hydrate( | ||
<BrowserRouter> | ||
<App /> | ||
</BrowserRouter>, | ||
document.getElementById('root') | ||
<BrowserRouter> | ||
<App /> | ||
</BrowserRouter>, | ||
document.getElementById("root"), | ||
); | ||
@@ -12,0 +12,0 @@ |
@@ -1,22 +0,18 @@ | ||
import React from 'react'; | ||
import logo from './react.svg'; | ||
import './Home.css'; | ||
import React from "react"; | ||
import logo from "./react.svg"; | ||
import "./Home.css"; | ||
class Home extends React.Component { | ||
render() { | ||
return ( | ||
<div className="Home"> | ||
const Home = () => ( | ||
<div className="Home"> | ||
<div className="Home-header"> | ||
<img src={logo} className="Home-logo" alt="logo" /> | ||
<h2>Welcome to Cayde</h2> | ||
<img src={logo} className="Home-logo" alt="logo" /> | ||
<h2>Welcome to Cayde</h2> | ||
</div> | ||
<p className="Home-intro"> | ||
To get started, edit <code>src/App.js</code> or{' '} | ||
<code>src/Home.js</code> and save to reload. | ||
To get started, edit <code>src/App.js</code> or{" "} | ||
<code>src/Home.js</code> and save to reload. | ||
</p> | ||
</div> | ||
); | ||
} | ||
} | ||
</div> | ||
); | ||
export default Home; |
@@ -1,4 +0,4 @@ | ||
import http from 'http'; | ||
import http from "http"; | ||
let app = require('./server').default; | ||
let app = require("./server").default; | ||
@@ -9,3 +9,3 @@ const server = http.createServer(app); | ||
server.listen(process.env.PORT || 3000, error => { | ||
server.listen(process.env.PORT || 3000, (error) => { | ||
if (error) { | ||
@@ -15,15 +15,15 @@ console.log(error); | ||
console.log('🚀 started'); | ||
console.log("🚀 started"); | ||
}); | ||
if (module.hot) { | ||
console.log('✅ Server-side HMR Enabled!'); | ||
console.log("✅ Server-side HMR Enabled!"); | ||
module.hot.accept('./server', () => { | ||
console.log('🔁 HMR Reloading `./server`...'); | ||
module.hot.accept("./server", () => { | ||
console.log("🔁 HMR Reloading `./server`..."); | ||
try { | ||
app = require('./server').default; | ||
server.removeListener('request', currentApp); | ||
server.on('request', app); | ||
app = require("./server").default; | ||
server.removeListener("request", currentApp); | ||
server.on("request", app); | ||
currentApp = app; | ||
@@ -30,0 +30,0 @@ } catch (error) { |
@@ -1,6 +0,6 @@ | ||
import App from './App'; | ||
import React from 'react'; | ||
import { StaticRouter } from 'react-router-dom'; | ||
import express from 'express'; | ||
import { renderToString } from 'react-dom/server'; | ||
import React from "react"; | ||
import { StaticRouter } from "react-router-dom"; | ||
import express from "express"; | ||
import { renderToString } from "react-dom/server"; | ||
import App from "./App"; | ||
@@ -11,10 +11,10 @@ const assets = require(process.env.CAYDE_ASSETS_MANIFEST); | ||
server | ||
.disable('x-powered-by') | ||
.disable("x-powered-by") | ||
.use(express.static(process.env.CAYDE_PUBLIC_DIR)) | ||
.get('/*', (req, res) => { | ||
.get("/*", (req, res) => { | ||
const context = {}; | ||
const markup = renderToString( | ||
<StaticRouter context={context} location={req.url}> | ||
<App /> | ||
</StaticRouter> | ||
<StaticRouter context={context} location={req.url}> | ||
<App /> | ||
</StaticRouter>, | ||
); | ||
@@ -33,17 +33,15 @@ | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
${ | ||
assets.client.css | ||
? `<link rel="stylesheet" href="${assets.client.css}">` | ||
: '' | ||
} | ||
${ | ||
process.env.NODE_ENV === 'production' | ||
? `<script src="${assets.client.js}" defer></script>` | ||
: `<script src="${assets.client.js}" defer crossorigin></script>` | ||
} | ||
${assets.client.css | ||
? `<link rel="stylesheet" href="${assets.client.css}">` | ||
: ""} | ||
${process.env.NODE_ENV === "production" | ||
? `<script src="${assets.client.js}" defer></script>` | ||
: `<script src="${assets.client.js}" defer crossorigin></script>`} | ||
</head> | ||
<body> | ||
<div id="root">${markup}</div> | ||
</body> | ||
</html>` | ||
</html>`, | ||
); | ||
@@ -50,0 +48,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
58255
26
467