Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monorepo #330

Merged
merged 35 commits into from
Dec 9, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
41b4e65
moving to packages
ccpricenytimes Oct 29, 2016
be35691
separating setup into kyt-cli; creating kyt-utils for shared utilitie…
ccpricenytimes Oct 30, 2016
18343c2
set up linting and testing, check versions of packages in setup
ccpricenytimes Oct 30, 2016
a08f76e
tests and e2e tests can now be run from root, eslint not working
ccpricenytimes Oct 30, 2016
d1cc392
moving node version check into a util
ccpricenytimes Oct 30, 2016
deb15ad
change dependency back to latest version from npm
ccpricenytimes Oct 30, 2016
6365996
Adding list selection of starter-kyts
ccpricenytimes Nov 4, 2016
cb68175
updating start command
ccpricenytimes Nov 7, 2016
5a5b6f7
moving kyt-starter-universal
ccpricenytimes Nov 12, 2016
2c4f95f
copying starter-kyt
ccpricenytimes Nov 12, 2016
0bd4a90
adding starter-static, updating starter-universal name
ccpricenytimes Nov 13, 2016
896b09e
setup with static; currently kytconfig is getting installed twice...
ccpricenytimes Nov 13, 2016
96a97f6
removing kyt.config.js from list of files, in static so it doesnt get…
ccpricenytimes Nov 19, 2016
cf39d5b
typo
ccpricenytimes Nov 19, 2016
ea90fd7
merging in master
ccpricenytimes Nov 21, 2016
e501d8f
adding ability to create new directory as part of setup
ccpricenytimes Nov 22, 2016
5d21bd4
updatinG top level lint commanD
ccpricenytimes Nov 23, 2016
d1c9c46
moving enzyme to devDependencies for testing
ccpricenytimes Nov 23, 2016
f00a57e
lint
ccpricenytimes Nov 23, 2016
30debd5
sync up eslint dependencies; changelog docs; moving some starter-kyt …
ccpricenytimes Nov 23, 2016
d67a1e5
updating travis command
ccpricenytimes Nov 23, 2016
72be9f3
more &&
ccpricenytimes Nov 23, 2016
cc655d4
Merge branch 'master' into monorepo
ccpricenytimes Dec 3, 2016
7ca1266
cleanup; kyt now gets added as a devDepency in existingProjectSetup
ccpricenytimes Dec 3, 2016
5700ddb
adds kyt start deprecation command
ccpricenytimes Dec 4, 2016
023b684
updating logging for setup; version check will now be based off depen…
ccpricenytimes Dec 7, 2016
b0ec1a7
code review feedback
ccpricenytimes Dec 9, 2016
0dd30ea
Merge branch 'master' into monorepo
ccpricenytimes Dec 9, 2016
fcfe47c
prepping kyt-utils for prepublish
ccpricenytimes Dec 9, 2016
30faa6d
update utils package.json
delambo Dec 9, 2016
5b7a365
update kyt-utils to point to npm
ccpricenytimes Dec 9, 2016
b8489c0
removing branch specific code and changing cli version to alpha to pr…
ccpricenytimes Dec 9, 2016
99d3401
Merge branch 'monorepo' of github.com:NYTimes/kyt into monorepo
delambo Dec 9, 2016
858ce72
moves package.json.scripts.lint to top level package.json
delambo Dec 9, 2016
3e8f51c
eslint from kyt-core
delambo Dec 9, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
copying starter-kyt
  • Loading branch information
ccpricenytimes committed Nov 12, 2016
commit 2c4f95fdb0b38b3e46ba66460ec8e4648f065926
1 change: 0 additions & 1 deletion packages/starter-kyts/kyt-starter-universal
Submodule kyt-starter-universal deleted from dbc382
13 changes: 13 additions & 0 deletions packages/starter-kyts/kyt-starter-universall/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2016 The New York Times Company

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this library except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
29 changes: 29 additions & 0 deletions packages/starter-kyts/kyt-starter-universall/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Universal React starter-kyt

This starter-kyt should serve as the base for an advanced, server and client-rendered React app.


## Installation

1. Create a new directory and install [kyt](https://github.com/NYTimes/kyt)
2. `node_modules/.bin/kyt setup -r git@github.com:NYTimes/kyt-starter-universal.git`

## Tools

The following are some of the tools included in this starter-kyt:

- [Express](https://expressjs.com/) - Server-side rendering
- [React](https://facebook.github.io/react/) - Component library
- [React Router](https://github.com/reactjs/react-router) - Server and client routing
- [Sass Modules](https://github.com/css-modules/css-modules) - CSS Modules with a Sass pre-processor for styles
- [Enzyme](https://github.com/airbnb/enzyme) - React component testing

## Notes on implementation

- As a performance optimization, React Router routes are loaded dynamically and chunked separately using the ES2015 `System.import` directive. See more about [Webpack 2 support](https://gist.github.com/sokra/27b24881210b56bbaff7#code-splitting-with-es6) and [dynamic routing](https://github.com/reactjs/react-router/blob/master/docs/guides/DynamicRouting.md).

## How To Contribute
Want to build your own starter-kyt?
See directions [here](https://github.com/NYTimes/kyt/blob/master/docs/Starterkyts.md).

## Changelog
8 changes: 8 additions & 0 deletions packages/starter-kyts/kyt-starter-universall/kyt.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

// Base kyt config.
// Edit these properties to make changes.

module.exports = {
reactHotLoader: true,
debug: false,
};
30 changes: 30 additions & 0 deletions packages/starter-kyts/kyt-starter-universall/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "wf-kyt-starter-universal",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
},
"repository": {
"type": "git",
"url": "git+https://github.com/nytm/wf-kyt-starter-universal.git"
},
"author": "",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/nytm/wf-kyt-starter-universal/issues"
},
"homepage": "https://github.com/nytm/wf-kyt-starter-universal#readme",
"kyt": {
"version": "^0.3.0"
},
"dependencies": {
"compression": "^1.6.2",
"enzyme": "^2.4.1",
"express": "^4.14.0",
"react": "^15.3.0",
"react-addons-test-utils": "^15.3.0",
"react-dom": "^15.3.0",
"react-router": "^2.6.1"
}
}
16 changes: 16 additions & 0 deletions packages/starter-kyts/kyt-starter-universall/prototype.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

// This is your prototyping file.
// It is the entry for the webpack dev server
// when you run the kyt proto command.
import React from 'react';
import ReactDom from 'react-dom';

// Import your component here for easy development
import Home from './src/components/Home';

// Attach the component to the root.
const rootEl = document.getElementById('root');
ReactDom.render(
<Home/>,
rootEl
);
14 changes: 14 additions & 0 deletions packages/starter-kyts/kyt-starter-universall/src/client/Root.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

import React from 'react';
import Router from 'react-router/lib/Router';
import browserHistory from 'react-router/lib/browserHistory';
import routes from '../routes';

// We need a Root component for React Hot Loading.
function Root() {
return (
<Router history={browserHistory} routes={routes} />
);
}

export default Root;
26 changes: 26 additions & 0 deletions packages/starter-kyts/kyt-starter-universall/src/client/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

import React from 'react';
import { render } from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import Root from './Root';

const root = document.querySelector('#root');

const mount = (RootComponent) => {
render(
<AppContainer>
<RootComponent />
</AppContainer>,
root
);
};

if (module.hot) {
module.hot.accept('./Root', () => {
// eslint-disable-next-line global-require,import/newline-after-import
const RootComponent = require('./Root').default;
mount(RootComponent);
});
}

mount(Root);
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

import React, { PropTypes } from 'react';
import Link from 'react-router/lib/Link';
import styles from './styles.scss';

function App({ children }) {
return (
<div>
<i className={styles.logo} />
<ul className={styles.nav}>
<li className={styles.navItem}>
<Link className={styles.link} to="/">Home</Link>
</li>
<li className={styles.navItem}>
<Link className={styles.link} to="/tools">Tools</Link>
</li>
</ul>
<div className={styles.content}>
{children}
</div>
</div>
);
}

App.propTypes = {
children: PropTypes.node,
};

export default App;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


import React from 'react';
import { shallow } from 'enzyme';
import App from './';

it('Test example', () => {
const wrapper = shallow(<App />);
expect(wrapper.is('div')).toBeTruthy();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

@import '../../shared-styles/variables';

.header {
text-align: center;
}

.nav {
width: $content-width;
margin: 0 auto;
padding: $padding;
text-align: center;
}

.content {
width: $content-width;
margin: $padding auto;
}

.navItem {
display: inline-block;
}

.link {
padding: $padding;
color: #00a68f;
font-size: 18px;
}

.logo {
display: block;
width: 252px;
height: 252px;
margin: $padding auto;
background: url('../../images/icon-kytLogo_large-252x252.svg');
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

import React from 'react';
import styles from './styles.scss';

function Home() {
return (
<section>
<p className={styles.paragraph}>
Welcome to the <strong>Universal React Starter-kyt</strong>.
This starter kyt should serve as the base for an advanced,
server-rendered React app.
</p>
<p className={styles.paragraph}>
Check out the Tools section for an outline of the libraries that
are used in this Starter-kyt.
</p>
</section>
);
}

export default Home;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


import React from 'react';
import { shallow } from 'enzyme';
import Home from './';

it('Test example', () => {
const wrapper = shallow(<Home />);
expect(wrapper.is('section')).toBeTruthy();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

@import '../../shared-styles/variables';

.paragraph + .paragraph {
padding-top: $padding;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

import React from 'react';
import styles from './styles.scss';

function Tools() {
return (
<ul>
<li className={styles.tool}>
<a href="https://expressjs.com/">Express</a> - server-side rendering
</li>
<li className={styles.tool}>
<a href="https://facebook.github.io/react/">React</a> - component library
</li>
<li className={styles.tool}>
<a href="https://github.com/reactjs/react-router">React Router</a> - server and browser routing
</li>
<li className={styles.tool}>
<a href="https://github.com/css-modules/css-modules">Sass Modules</a> - CSS Modules with a Sass pre-processor for styles
</li>
<li className={styles.tool}>
<a href="https://github.com/airbnb/enzyme">Enzyme</a> - React component testing
</li>
</ul>
);
}

export default Tools;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


import React from 'react';
import { shallow } from 'enzyme';
import Tools from './';

it('Test example', () => {
const wrapper = shallow(<Tools />);
expect(wrapper.is('ul')).toBeTruthy();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

@import '../../shared-styles/variables';

.tool + .tool {
padding-top: 5px;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading