Full Code of xkawi/create-react-app-now for AI

master 65a14fc8ea50 cached
12 files
8.5 KB
2.5k tokens
4 symbols
1 requests
Download .txt
Repository: xkawi/create-react-app-now
Branch: master
Commit: 65a14fc8ea50
Files: 12
Total size: 8.5 KB

Directory structure:
gitextract_fx40rvmw/

├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── package.json
├── public/
│   └── index.html
└── src/
    ├── About.js
    ├── App.css
    ├── App.js
    ├── App.test.js
    ├── index.css
    └── index.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# See http://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules

# testing
coverage

# production
build

# misc
.DS_Store
.env

# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

================================================
FILE: .travis.yml
================================================
language: node_js

node_js:
  - "4"
  - "5"
  - "6"
  - "stable"

sudo: false

before_script:
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start

script:
  - npm install
  - npm test

================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2016 Kawi Xiao

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.


================================================
FILE: README.md
================================================
# create-react-app-now

Deploy React.js Static Web Apps generated with [facebook/create-react-app](https://github.com/facebook/create-react-app) to Zeit's awesome [Now.sh](https://zeit.co/now/) service.

I wrote an article about this project here: [Zero Configuration Deployment for React app with Zeit Now](https://medium.com/@kawixiao/zero-configuration-deployment-for-react-apps-with-zeits-now-4f002be98c#.eyvj3mjdb)

# Important

UPDATE: create-react-app now officially recommend using "serve" to deploy your create-react-app project. The documentation can be found here: https://create-react-app.dev/docs/deployment

I personally and strongly recommend you to check out [Next.js](https://zeit.co/blog/next) by Zeit team.
That will be my personal go to choice as well when creating new React project, and deploy to now seamlessly.

Though create-react-app-now can serves as an example on how you can use create-react-app and zeit's now together.  

Having said that, it is likely that I will not actively maintain this repo anymore (e.g. update the dependencies). I will still accept PR though.

# Why

create-react-app-now is created using [facebook/create-react-app](https://github.com/facebook/create-react-app).
Although it supports deployment to github pages and heroku, it does not feel intuitive just yet, as we need to run lots of commands.

This project is specifically to solve just that, with just 1 command: `npm run deploy`

This is achieved by using Zeit's awesome [Now.sh](https://zeit.co/now/) service.
It is fast, easy, and intuitive way of deploying your React app.

# How

Simply follow this step from getting started to deployment:

```
$ npm install -g now
$ git clone https://github.com/xkawi/create-react-app-now
$ npm install
$ npm run deploy
```

First command installs the `now` cli globally as npm package. Another (or suggested) approach is to install [Now Desktop](https://zeit.co/desktop) to ensure automatic updates of `now` cli.

Subsequent commands simply clone this repo, install necessary npm packages and deploy it to Now.

Whenever you want to deploy new changes, just run `npm run deploy` again to get new public link, for free! :smile:

You will enjoy all the benefits that Now offers out-of-the-box: real-time and immutable deployments all within 1 command.

## Note

You might see some red text appears or warnings in the log. You can safely ignore this, because your project will still be deployed successfully.

# Alternatives Deployment

If you prefer something else, please refer to create-react-app documentation [here](https://create-react-app.dev/docs/deployment#other-solutions).

# More

Read more about create-react-app [here](https://github.com/facebook/create-react-app)

Read more about Zeit's Now.sh [here](https://zeit.co/now)


================================================
FILE: package.json
================================================
{
  "name": "create-react-app-now",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "react-scripts": "0.9.5",
    "serve": "^6.0.6"
  },
  "dependencies": {
    "react": "^15.4.0",
    "react-dom": "^15.4.0",
    "react-router": "^4.0.0",
    "react-router-dom": "^4.0.0"
  },
  "scripts": {
    "now-start": "cd build && serve -s ./",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "deploy": "now -e REACT_APP_SECRET_CODE=secretcode"
  }
}


================================================
FILE: public/index.html
================================================
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
    <!--
      Notice the use of %PUBLIC_URL% in the tag above.
      It will be replaced with the URL of the `public` folder during the build.
      Only files inside the `public` folder can be referenced from the HTML.

      Unlike "/favicon.ico" or "favico.ico", "%PUBLIC_URL%/favicon.ico" will
      work correctly both with client-side routing and a non-root public URL.
      Learn how to configure a non-root public URL by running `npm run build`.
    -->
    <title>React App</title>
  </head>
  <body>
    <div id="root"></div>
    <!--
      This HTML file is a template.
      If you open it directly in the browser, you will see an empty page.

      You can add webfonts, meta tags, or analytics to this file.
      The build step will place the bundled scripts into the <body> tag.

      To begin the development, run `npm start`.
      To create a production bundle, use `npm run build`.
    -->
  </body>
</html>


================================================
FILE: src/About.js
================================================
import React, { Component } from 'react';
import { Link } from 'react-router-dom';

class About extends Component {
  render() {
    return (
      <div>About page here <Link to='/'>back</Link> | <Link to='/anything'>or Test Not Found Page</Link></div>
    );
  }
}

export default About;


================================================
FILE: src/App.css
================================================
.App {
  text-align: center;
}

.App-logo {
  animation: App-logo-spin infinite 20s linear;
  height: 80px;
}

.App-header {
  background-color: #222;
  height: 150px;
  padding: 20px;
  color: white;
}

.App-intro {
  font-size: large;
}

@keyframes App-logo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


================================================
FILE: src/App.js
================================================
import React, { Component } from 'react';
import {
  BrowserRouter as Router,
  Route,
  Link,
  Switch,
} from 'react-router-dom'
import About from './About';
import logo from './logo.svg';
import './App.css';

const NoMatch = ({ location }) => (
  <div>
    <p>No Match for <code>{location.pathname}</code></p>
    <Link to='/'>go back</Link>
  </div>
)

class App extends Component {
  render() {
    const secretCode = process.env.REACT_APP_SECRET_CODE;
    return (
      <div className="App">
        <div className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <h2>Welcome to React</h2>
        </div>
        <p className="App-intro">
          To get started, edit <code>src/App.js</code> and save to reload.
        </p>
        <p>REACT_APP_SECRET_CODE: { !secretCode ? 'env not set yet' : secretCode }</p>
        <p><Link to='/about'>about us</Link></p>
      </div>
    );
  }
}

const BasicApp = () => (
  <Router>
    <div>
      <Switch>
        <Route exact path="/" component={App} />
        <Route path="/about" component={About} />
        <Route component={NoMatch} />
      </Switch>
    </div>
  </Router>
)

export default BasicApp;


================================================
FILE: src/App.test.js
================================================
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

it('renders without crashing', () => {
  const div = document.createElement('div');
  ReactDOM.render(<App />, div);
});


================================================
FILE: src/index.css
================================================
body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}


================================================
FILE: src/index.js
================================================
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './index.css';

ReactDOM.render(
  <App />,
  document.getElementById('root')
);
Download .txt
gitextract_fx40rvmw/

├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── package.json
├── public/
│   └── index.html
└── src/
    ├── About.js
    ├── App.css
    ├── App.js
    ├── App.test.js
    ├── index.css
    └── index.js
Download .txt
SYMBOL INDEX (4 symbols across 2 files)

FILE: src/About.js
  class About (line 4) | class About extends Component {
    method render (line 5) | render() {

FILE: src/App.js
  class App (line 19) | class App extends Component {
    method render (line 20) | render() {
Condensed preview — 12 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (10K chars).
[
  {
    "path": ".gitignore",
    "chars": 731,
    "preview": "# See http://help.github.com/ignore-files/ for more about ignoring files.\n\n# dependencies\nnode_modules\n\n# testing\ncovera"
  },
  {
    "path": ".travis.yml",
    "chars": 189,
    "preview": "language: node_js\n\nnode_js:\n  - \"4\"\n  - \"5\"\n  - \"6\"\n  - \"stable\"\n\nsudo: false\n\nbefore_script:\n  - export DISPLAY=:99.0\n "
  },
  {
    "path": "LICENSE",
    "chars": 1066,
    "preview": "MIT License\n\nCopyright (c) 2016 Kawi Xiao\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n"
  },
  {
    "path": "README.md",
    "chars": 2787,
    "preview": "# create-react-app-now\n\nDeploy React.js Static Web Apps generated with [facebook/create-react-app](https://github.com/fa"
  },
  {
    "path": "package.json",
    "chars": 572,
    "preview": "{\n  \"name\": \"create-react-app-now\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"devDependencies\": {\n    \"react-scripts\":"
  },
  {
    "path": "public/index.html",
    "chars": 1136,
    "preview": "<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-wid"
  },
  {
    "path": "src/About.js",
    "chars": 289,
    "preview": "import React, { Component } from 'react';\nimport { Link } from 'react-router-dom';\n\nclass About extends Component {\n  re"
  },
  {
    "path": "src/App.css",
    "chars": 341,
    "preview": ".App {\n  text-align: center;\n}\n\n.App-logo {\n  animation: App-logo-spin infinite 20s linear;\n  height: 80px;\n}\n\n.App-head"
  },
  {
    "path": "src/App.js",
    "chars": 1198,
    "preview": "import React, { Component } from 'react';\nimport {\n  BrowserRouter as Router,\n  Route,\n  Link,\n  Switch,\n} from 'react-r"
  },
  {
    "path": "src/App.test.js",
    "chars": 208,
    "preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nit('renders without crashing', ()"
  },
  {
    "path": "src/index.css",
    "chars": 63,
    "preview": "body {\n  margin: 0;\n  padding: 0;\n  font-family: sans-serif;\n}\n"
  },
  {
    "path": "src/index.js",
    "chars": 174,
    "preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport './index.css';\n\nReactDOM.re"
  }
]

About this extraction

This page contains the full source code of the xkawi/create-react-app-now GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 12 files (8.5 KB), approximately 2.5k tokens, and a symbol index with 4 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!