Skip to content

Commit

Permalink
Version 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
supnate committed Mar 26, 2018
1 parent d8c0daa commit 67de450
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 25 deletions.
19 changes: 7 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It helps you focus on business logic rather than dealing with massive libraries,
[![Demo](https://img.shields.io/badge/demo-link-blue.svg)](http://demo.rekit.org)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)

Rekit creates apps using an opinionated folder and code structure. It's designed to be scalable, testable and maintainable by using [feature oriented architecture](https://medium.com/@nate_wang/feature-oriented-architecture-for-web-applications-2b48e358afb0), [one action per file pattern](https://medium.com/@nate_wang/a-new-approach-for-managing-redux-actions-91c26ce8b5da#.9em77fuwk). This ensures application logic is well grouped and decoupled.
Rekit creates apps bootstrapped by [create-react-app](https://github.com/facebook/create-react-app) and uses an opinionated way to organize folder and code. It's designed to be scalable, testable and maintainable by using [feature oriented architecture](https://medium.com/@nate_wang/feature-oriented-architecture-for-web-applications-2b48e358afb0), [one action per file pattern](https://medium.com/@nate_wang/a-new-approach-for-managing-redux-actions-91c26ce8b5da#.9em77fuwk). This ensures application logic is well grouped and decoupled.

Besides creating apps, Rekit provides powerful tools for managing the project:

Expand Down Expand Up @@ -42,20 +42,19 @@ This will install a global command `rekit` to the system. Rekit is developed and
## Usage
Create a new application
```
rekit create <app-name> [--sass] [--clean]
rekit create <app-name> [--sass]
```
This will create a new app named `app-name` in the current directory. The `--sass` flag allows to use [sass](https://sass-lang.com/) instead of default [less](http://lesscss.org/) as the CSS transpiler. The `--clean` flag is used to create a clean app without any sample code. After creating the app, you need to install dependencies and start the dev server:
This will create a new app named `app-name` in the current directory. The `--sass` flag allows to use [sass](https://sass-lang.com/) instead of default [less](http://lesscss.org/) as the CSS transpiler. After creating the app, you need to install dependencies and start the dev server:
```
cd app-name
npm install
npm start
```

It then starts three lightweight express servers by default:
It then starts two express servers by default:

1. Webpack dev server: [http://localhost:6075](http://localhost:6075). This is the dev server your application is running on.
1. Webpack dev server: [http://localhost:6075](http://localhost:6075). Just what create-react-app starts.
2. Rekit Studio: [http://localhost:6076](http://localhost:6076). The IDE for Rekit projects.
3. Build result test server: [http://localhost:6077](http://localhost:6077). This is the server for verifying the build result before deploying to production server.

To change the ports dev-servers running on, edit the `rekit` section in `package.json`:
```
Expand All @@ -64,7 +63,6 @@ To change the ports dev-servers running on, edit the `rekit` section in `package
"rekit": {
"devPort": 6075,
"studioPort": 6076,
"buildPort": 6077,
...
}
...
Expand All @@ -87,19 +85,16 @@ This repo contains multiple packages managed by [yarn workspaces](https://yarnpk
* Zero additional configuration needed after creating an app.
* Dedicated IDE for Rekit development.
* Command line tools to manage actions, reducers, components and pages.
* Embed build script and test server for the build result.
* Bootstrapped by [create-react-app](https://github.com/facebook/create-react-app), all your knowledge about it still works.
* Use [Webpack 3](http://webpack.js.org) for bundling.
* Use [Babel](https://babeljs.io/) for ES2015(ES6)+ support.
* Use [React hot loader](http://gaearon.github.io/react-hot-loader/) for hot module replacement.
* Use [Redux](http://redux.js.org/) for application state management.
* Use [React-router](https://github.com/reactjs/react-router) for routing and it's configured with Redux reducer.
* Use [Webpack dll plugin](http://webpack.github.io/docs/list-of-plugins.html#dllplugin) to improve dev-time build performance.
* Use [Less](http://lesscss.org/) or [Sass](https://sass-lang.com/) as CSS transpilers.
* Use [mocha](https://mochajs.org/), [enzyme](https://github.com/airbnb/enzyme) for testing.
* Use [istanbul](https://github.com/gotwarlost/istanbul) for testing coverage report.
* Use [jest](https://mochajs.org/), [enzyme](https://github.com/airbnb/enzyme) for testing.
* Support [Redux dev tools](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd).
* Proxy to API in DEV like [create-react-app](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#proxying-api-requests-in-development). e.g. fetch(/api/\<your path>)


## Documentation
[http://rekit.js.org](http://rekit.js.org)
Expand Down
47 changes: 47 additions & 0 deletions packages/rekit-core/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

.DS_Store
.nyc_output
coverage

.gitignore
docs
.travis.yml
tests
tools
2 changes: 1 addition & 1 deletion packages/rekit-core/core/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function getRekitProps(file) {
if (propsCache[file] && propsCache[file].content === vio.getContent(file)) {
return propsCache[file].props;
}
const isInFeature = /src\/features\/\w+\//.test(file);
const isInFeature = /src\/features\/[a-z0-9-]+\//.test(file);
if (!isInFeature) {
// all files not under a feature are misc
const props = { type: 'misc' };
Expand Down
Empty file removed packages/rekit-core/index.js
Empty file.
4 changes: 2 additions & 2 deletions packages/rekit-core/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "rekit-core",
"version": "2.2.5",
"version": "2.3.0",
"description": "Rekit core functions.",
"author": "Nate Wang <supnate@gmail.com>",
"license": "MIT",
"homepage": "https://github.com/supnate/rekit-core",
"homepage": "https://github.com/supnate/rekit",
"main": "core/index.js",
"keywords": [
"rekit",
Expand Down
2 changes: 1 addition & 1 deletion packages/rekit-studio/middleware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const format = require('./api/format');

const utils = rekitCore.utils;

rekitCore.utils.setProjectRoot('/Users/pwang7/workspace/rekit-boilerplate-cra');
// rekitCore.utils.setProjectRoot('/Users/pwang7/workspace/rekit-boilerplate-cra');
rekitCore.plugin.loadPlugins(rekitCore);

let lastProjectData = null;
Expand Down
2 changes: 1 addition & 1 deletion packages/rekit-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rekit-studio",
"version": "2.2.6",
"version": "2.3.0",
"description": "Web IDE for Rekit projects.",
"keywords": [
"rekit",
Expand Down
16 changes: 9 additions & 7 deletions packages/rekit/bin/createApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

const path = require('path');
const fs = require('fs');
// const download = require('download-git-repo');
const download = require('download-git-repo');
const utils = require('./utils');

function download(a1, dest, callback) {console.log('creating from: ', a1);
utils.copyFolderRecursiveSync(path.join(__dirname, '../../../../rekit-boilerplate-cra'), dest, p => !/node_modules|\/coverage|\/build/.test(p));
callback();
}
// function download(a1, dest, callback) {console.log('creating from: ', a1);
// utils.copyFolderRecursiveSync(path.join(__dirname, '../../../../rekit-boilerplate-cra'), dest, p => !/node_modules|\/coverage|\/build/.test(p));
// callback();
// }

function createApp(args) {
const prjName = args.name;
Expand All @@ -26,11 +26,12 @@ function createApp(args) {
console.log(`Error: target folder already exists: ${prjPath}`);
process.exit(1);
}
console.log('Welcome to Rekit, now creating your project...');
console.log('Welcome to Rekit!');
fs.mkdirSync(prjPath);

// Download boilerplate from: https://github.com/supnate/rekit-boilerplate dist branch.
// Download boilerplate from: https://github.com/supnate/rekit-boilerplate-xxx dist branch.
const tplRepo = args.template === 'rekit' ? `supnate/rekit-boilerplate#dist` : `supnate/rekit-boilerplate-${args.template}#dist`;
console.log(`Downloading boilerplate from https://github.com/${tplRepo}...`);
download(tplRepo, prjPath, (err) => {
if (err) {
console.log('Failed to download the boilerplate. The project was not created. Please check and retry.');
Expand All @@ -47,6 +48,7 @@ function createApp(args) {
// Execute postCreate in the boilerplate, so that it could handle '--clean', '--sass' flags.
const postCreateScript = path.join(prjPath, 'postCreate.js');
if (fs.existsSync(postCreateScript)) {
console.log('Post creating...');
const postCreate = require(postCreateScript);
postCreate(args);
fs.unlinkSync(postCreateScript);
Expand Down
2 changes: 1 addition & 1 deletion packages/rekit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rekit",
"version": "2.2.1",
"version": "2.3.0",
"description": "Toolkit for building scalable web applications with React, Redux and React-router.",
"license": "MIT",
"bin": {
Expand Down

0 comments on commit 67de450

Please sign in to comment.