Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
heimdallrj committed Aug 9, 2020
0 parents commit 564e350
Show file tree
Hide file tree
Showing 29 changed files with 20,911 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": ["env"],
"plugins": [
"transform-object-rest-spread",
"transform-react-jsx"
]
}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# dependencies
node_modules

# builds
dist
.rpt2_cache

# misc
.DS_Store

npm-debug.log*
yarn-debug.log*
yarn-error.log*
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
testbed
.babelrc
webpack.config.js
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# react-jetpack

> An opinionated toolkit for efficient React.js development
[![NPM](https://img.shields.io/npm/v/react-jetpack.svg)](https://www.npmjs.com/package/react-jetpack) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save react-jetpack
```

## License

MIT
6,543 changes: 6,543 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "react-jetpack",
"version": "1.0.0-alpha.1",
"description": "An opinionated toolkit for efficient React.js development",
"main": "./",
"source": "src/",
"author": "thinkholic",
"license": "MIT",
"scripts": {
"setup": "npm install && cd testbed/ && npm install",
"build": "npm run build:webpack && npm run copy:assets && npm run symlink",
"build:webpack": "webpack",
"copy:assets": "cp package.json README.md dist/",
"symlink": "cd dist/ && npm link && cd .. && cd testbed/ && npm link react-jetpack",
"start": "concurrently \"npm run build:webpack:watch\" \"cd testbed/ && npm start\"",
"build:webpack:watch": "webpack --watch"
},
"peerDependencies": {
"react": "^16.0.0",
"react-dom": "^16.0.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.21.0",
"babel-loader": "^7.1.4",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-env": "^1.6.1",
"concurrently": "^5.3.0",
"path": "^0.12.7",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"webpack": "^4.5.0",
"webpack-cli": "^3.2.1"
},
"files": [
"dist"
]
}
10 changes: 10 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import utilsHandler from './utils';

const DummyComponent = () => {
return (<p>Hello!</p>)
}

export const utils = utilsHandler;

export default DummyComponent;
22 changes: 22 additions & 0 deletions src/utils/createContext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React, { useReducer } from 'react'

export default (reducer = () => {}, actions = {}, initialState) => {
const Context = React.createContext()

const Provider = ({ children }) => {
const [state, dispatch] = useReducer(reducer, initialState)

const boundActions = {}
for (const key in actions) {
boundActions[key] = actions[key](dispatch)
}

return (
<Context.Provider value={{ state, ...boundActions }}>
{children}
</Context.Provider>
)
}

return { Context, Provider }
}
3 changes: 3 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import createContextHandler from './createContext';

export const createContext = createContextHandler;
1 change: 1 addition & 0 deletions testbed/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
23 changes: 23 additions & 0 deletions testbed/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
68 changes: 68 additions & 0 deletions testbed/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

### Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

### Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

### Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

### Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

### `npm run build` fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
Loading

0 comments on commit 564e350

Please sign in to comment.