{"x0":{"title":"Compositor x0","basename":"/x0"},"ava":{"babel":{"plugins":["transform-runtime"],"presets":["env","stage-0","react"]},"files":["test/*","!test/components","!test/output"],"require":["babel-register"]},"bin":{"x0":"cli.js"},"bugs":{"url":"https://github.com/c8r/x0/issues"},"dist":{"shasum":"04e3d3ed70538f377459f31aa2b8f313ad2e3208","tarball":"https://registry.npmjs.org/@compositor/x0/-/x0-5.0.0-1.tgz","fileCount":28,"integrity":"sha512-WtZpuKnZgSjlVI1CHLEZOa4xsHVKhsXvPCMYSespWDX78JlAp7HKpis1aynuCbAmS23cmAmAkg/lfhOOr4W/Gg==","signatures":[{"sig":"MEUCIDCX5CuYSWDRqWorK8egyh8LQwPulxsVLysi6Ni8HlK2AiEAntzzdzDu7G06d3ffCOMOVGwSvihB55zVtlfi3MPIPTY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":229323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbAc6RCRA9TVsSAnZWagAAPYkP/jg4WvhezR7Supg8G+ah\nsyPAXl56Q/4vf/n4PtDkWNKuvK28OfybGoD9MUBQrKCuDE0BB3Wp9qKedZVt\nlkxeEYg5/Tm8yax7bgp/iakpS+rSJl0VgdDbkrmwgiX1+WpexgY8m0q6BX3M\nm+Gz6u29Hw0/C1874LgPCZfRA+ZkdwyUWWa/1TZhbnl06fGKMWlBv4nUp3iR\nESBzEaSTyxK72z2JD35L3LExRUvZ9ij5xAi0Qbpiug1g9PF6pWabeZiy+LIf\neUysZnBJ9KDFa87ILWQ0Q/IJ5BaDZUFUo0V5vUClkPCiNtjXqWPH4DNd82Df\nwOv1ECaMC83W1twFa2hC0DEIcKHmug/Ddpd0PEG7DDrQMh531CC/CKE7RhTN\nizaYatEJ/F8qFzMAfXdB1Lgmlz+1VHAMs8MnKc+6Ce4xJjUnak/CtLsQR9Ir\n7i75jw99bswEs+M0vBBiXkeExez9ZIGJLicuXOsZVy4b2j3F3nNVgHz1hhOE\n6IV65EeKIPhaJw8k2PP3hynVCB5F5vgrXwfuVJYkerpaXH4+/Qf2elpPCC0p\nuvXtUKQNOQ9kQx5Uq8rD1JXHLTP4mONxdRmjeryqo7cfCKaD70ixMXzL7NlD\nQYxk9bQKl7Ka7duD9TAXa1EXU5fgWaU5iphVMf7R0mYMrqG464oWJivQm3fw\nltX6\r\n=ENJZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","name":"@compositor/x0","author":{"name":"Brent Jackson"},"readme":"\n# x0\n\nZero-config React development environment and static site generator\n\n[![Build Status][build-badge]][build]\n\n```sh\nnpm install -g @compositor/x0\n```\n\n[build-badge]: https://img.shields.io/travis/c8r/x0/master.svg?style=flat-square\n[build]: https://travis-ci.org/c8r/x0\n\n![screen-demo](docs/demo.gif)\n\n## Features\n\n- Zero-config\n- Hot-loading development environment\n- Works with virtually any React component\\*\n- No confusing APIs\n- Automatic file system based routing\n- Exports static HTML\n- Exports JS bundles\n- Works with CSS-in-JS libraries like [styled-components][sc]\n- Support for async data fetching\n\n\\* Custom [webpack configuration](#webpack) is required for components that rely on webpack-based features\n\n\n## Isolated development environment\n\n```sh\nx0 components\n```\n\nOptions:\n\n```\n-o --open       Open dev server in default browser\n-p --port       Custom port for dev server\n-t --template   Path to custom HTML template\n--webpack       Path to custom webpack configuration\n```\n\n```sh\nx0 components -op 8080\n```\n\n\n## Static Build\n\nExport static HTML and client-side bundle\n\n```sh\nx0 build components\n```\n\nExport static HTML without bundle\n\n```sh\nx0 build components --static\n```\n\nOptions\n\n```\n-d --out-dir    Output directory (default dist)\n-s --static     Output static HTML without JS bundle\n-t --template   Path to custom HTML template\n--webpack       Path to custom webpack configuration\n```\n\n\n## Fetching Data\n\nUse the async `getInitialProps` static method to fetch data for static rendering.\nThis method was inspired by [Next.js][nextjs].\n\n```jsx\nconst Index = props => (\n  <h1>Hello {props.data}</h1>\n)\n\nIndex.getInitialProps = async () => {\n  const fetch = require('isomorphic-fetch')\n  const res = await fetch('http://example.com/data')\n  const data = await res.json()\n\n  return { data }\n}\n```\n\n## Custom App\n\nA custom `App` component can be provided by including an `_app.js` file.\nThe `App` component uses the [render props][render-props] pattern to provide additional state and props to its child routes.\n\n[render-props]: https://reactjs.org/docs/render-props.html\n\n```jsx\n// example _app.js\nimport React from 'react'\n\nexport default class extends React.Component {\n  state = {\n    count: 0\n  }\n\n  update = fn => this.setState(fn)\n\n  render () {\n    const { render, routes } = this.props\n\n    return render({\n      ...this.state,\n      decrement: () => this.update(s => ({ count: s.count - 1 })),\n      increment: () => this.update(s => ({ count: s.count + 1 }))\n    })\n  }\n}\n```\n\n### Layouts\n\nThe `App` component can also be used to provide a common layout for all routes.\n\n```jsx\n// example _app.js\nimport React from 'react'\nimport Nav from '../components/Nav'\nimport Header from '../components/Header'\nimport Footer from '../components/Footer'\n\nexport default class extends React.Component {\n  render () {\n    const {\n      render,\n      routes\n    } = this.props\n\n    const route = routes.find(route => route.path === props.location.pathname)\n\n    return (\n      <React.Fragment>\n        <Nav />\n        <Header\n          route={route}\n        />\n        {render()}\n        <Footer />\n      </React.Fragment>\n    )\n  }\n}\n```\n\n## CSS-in-JS\n\nx0 supports server-side rendering for [styled-components][sc] with zero configuration.\nTo enable CSS rendering for static output, ensure that `styled-components` is installed as a dependency in your `package.json`\n\n```json\n\"dependencies\": {\n  \"styled-components\": \"^3.2.6\"\n}\n```\n\n## Configuration\n\nDefault options can be set in the `x0` field in `package.json`.\n\n```json\n\"x0\": {\n  \"static\": true,\n  \"outDir\": \"site\",\n  \"title\": \"Hello\",\n}\n```\n\n## Head content\n\nHead elements such as `<title>`, `<meta>`, and `<style>` can be configured with the `x0` field in `package.json`.\n\n```json\n\"x0\": {\n  \"title\": \"My Site\",\n  \"meta\": [\n    { \"name\": \"twitter:card\", \"content\": \"summary\" }\n    { \"name\": \"twitter:image\", \"content\": \"kitten.png\" }\n  ],\n  \"links\": [\n    {\n      \"rel\": \"stylesheet\",\n      \"href\": \"https://fonts.googleapis.com/css?family=Roboto\"\n    }\n  ]\n}\n```\n\n## Custom HTML Template\n\nA custom HTML template can be passed as the `template` option.\n\n```json\n\"x0\": {\n  \"template\": \"./html.js\"\n}\n```\n\n```js\n// example template\nmodule.exports = ({\n  html,\n  css,\n  scripts,\n  title,\n  meta = [],\n  links = [],\n  static: isStatic\n}) => `<!DOCTYPE html>\n<head>\n  <title>{title}</title>\n  ${css}\n</head>\n<div id=root>${html}</div>\n${scripts}\n`\n```\n\n### Routing\n\nx0 creates routes based on the file system, using [react-router][react-router].\nTo set the base URL for static builds, use the `basename` option.\n\n```json\n\"x0\": {\n  \"basename\": \"/my-site\"\n}\n```\n\n### webpack\n\nWebpack configuration files named `webpack.config.js` will automatically be merged with the built-in configuration, using [webpack-merge][webpack-merge].\nTo use a custom filename, pass the file path to the `--webpack` flag.\n\n```js\n// webpack.config.js example\nmodule.exports = {\n  module: {\n    rules: [\n      { test: /\\.txt$/, loader: 'raw-loader' }\n    ]\n  }\n}\n```\n\nSee the [example](examples/webpack-config).\n\n#### Related\n\n- [React Router][react-router]\n- [Mini HTML Webpack Plugin][mini-html]\n- [Styled Components][sc]\n- [webpack][webpack]\n- [Create React App](https://github.com/facebookincubator/create-react-app)\n- [Next.js][nextjs]\n- [Gatsby][gatsby]\n- [React-Static][react-static]\n\n---\n\n[Made by Compositor](https://compositor.io/)\n|\n[MIT License](LICENSE.md)\n\n[nextjs]: https://github.com/zeit/next.js\n[react-router]: https://github.com/ReactTraining/react-router\n[mini-html]: https://github.com/styleguidist/mini-html-webpack-plugin\n[sc]: https://github.com/styled-components/styled-components\n[glamorous]: https://github.com/paypal/glamorous\n[glamor]: https://github.com/threepointone/glamor\n[fela]: https://github.com/rofrischmann/fela\n[gatsby]: https://github.com/gatsbyjs/gatsby\n[react-static]: https://github.com/nozzle/react-static\n[react-loadable]: https://github.com/thejameskyle/react-loadable\n[webpack-merge]: https://github.com/survivejs/webpack-merge\n[webpack]: https://webpack.js.org\n","gitHead":"234ef77e06ab27f5b0ccabe2ef07f17880ec04b2","license":"MIT","scripts":{"test":"nyc ava","build":"./cli.js build docs -d docs -c docs/webpack.config.js","cover":"nyc report --reporter=html --reporter=lcov","start":"./cli.js docs -op 8888","static":"./cli.js build docs --static -d docs"},"_npmUser":{"name":"jxnblk","email":"jxnblk@gmail.com"},"homepage":"https://github.com/c8r/x0#readme","keywords":[],"repository":{"url":"git+https://github.com/c8r/x0.git","type":"git"},"_npmVersion":"6.0.1","description":"Zero-config React development environment and static site generator","directories":{},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"},{"name":"jxnblk","email":"jxnblk@gmail.com"},{"name":"mrmrs","email":"hi@mrmrs.cc"}],"_nodeVersion":"8.1.2","dependencies":{"meow":"^5.0.0","chalk":"^2.4.1","react":"^16.3.2","semver":"^5.5.0","find-up":"^2.1.0","webpack":"^4.8.3","fs-extra":"^6.0.1","pkg-conf":"^2.1.0","react-dom":"^16.3.2","babel-core":"^6.26.3","clipboardy":"^1.2.3","koa-connect":"^2.0.1","read-pkg-up":"^3.0.0","babel-loader":"^7.1.4","react-router":"^4.2.0","html-minifier":"^3.5.15","webpack-merge":"^4.1.2","webpack-serve":"^1.0.2","babel-register":"^6.26.0","emotion-server":"^9.1.3","react-dev-utils":"^5.0.1","update-notifier":"^2.5.0","babel-preset-env":"^1.7.0","react-router-dom":"^4.2.2","babel-preset-react":"^6.24.1","babel-plugin-macros":"^2.2.1","babel-preset-stage-0":"^6.24.1","mini-html-webpack-plugin":"^0.2.3","connect-history-api-fallback":"^1.5.0","babel-plugin-transform-runtime":"^6.23.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^0.24.0","nyc":"^11.8.0","refunk":"^2.2.4","nano-style":"^1.0.0","styled-system":"^1.1.7","isomorphic-fetch":"^2.2.1","styled-components":"^3.2.6"},"_npmOperationalInternal":{"tmp":"tmp/x0_5.0.0-1_1526845072212_0.19340095650250366","host":"s3://npm-registry-packages"},"_id":"@compositor/x0@5.0.0-1","version":"5.0.0-1"}