Skip to content

Commit

Permalink
Moving things around, and using babel to compile it into lib
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurara committed May 3, 2015
1 parent 401bf79 commit adc9899
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
node_modules
*~
*.sw[op]
lib
npm-debug.log
dist
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
examples
npm-debug.log
src
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# PouchFlux
Flux with PouchDB

##Simple example
## Simple example

Action
```js
var alt = require('../alt');
var PouchActions = require('pouchflux').PouchActions;
var PouchActions = require('pouchflux/lib/PouchActions');

class ExampleActions extends PouchActions {
}
Expand All @@ -17,7 +17,7 @@ module.exports = alt.createActions(ExampleActions)
Store
```js
var alt = require('../alt');
var PouchStore = require('pouchflux').PouchStore;
var PouchStore = require('pouchflux/lib/PouchStore');

var ExampleActions = require('../actions/ExampleActions');

Expand All @@ -32,6 +32,6 @@ module.exports = exampleStore;
```

You can choose to set the database name with the super function or later with
the PouchActions.changeName({'name':'exampleStore'});
the `PouchActions.changeName({'name':'exampleStore'});`

A more detailed example is in the ported version of the TodoStore from Alt.
2 changes: 1 addition & 1 deletion examples/todomvc/js/actions/TodoActions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var alt = require('../alt')
var PouchActions = require('../../../../src/actions/PouchActions');
var PouchActions = require('../../../../src/PouchActions');

class TodoActions extends PouchActions {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion examples/todomvc/js/stores/TodoStore.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var alt = require('../alt');
var React = require('react');
var merge = require('object-assign')
var PouchStore = require('../../../../src/stores/PouchStore');
var PouchStore = require('../../../../src/PouchStore');

var TodoActions = require('../actions/TodoActions')

Expand Down
1 change: 1 addition & 0 deletions examples/todomvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"local-web-server": "^0.5.18",
"babelify": "^5.0.3"
},
"license": "MIT",
"scripts": {
"build": "browserify js/app.js > js/bundle.js",
"serve": "ws",
Expand Down
22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
{
"name": "pouchflux",
"version": "0.0.5",
"version": "0.0.6",
"description": "PouchDB flux store",
"author": "Olafur Arason <[email protected]>",
"repository": {
"type": "git",
"url": "https://github.com/olafura/PouchFlux"
},
"main": "src/PouchFlux.js",
"main": "lib",
"license": "Apache 2.0",
"dependencies": {
"alt": "~0.16",
"debug": "^2.1.3",
"object-assign": "^2.0.0",
"pouchdb": "~3.4"
},
"devDependencies": {
"babel": "^5.1.11",
"babel-core": "^5.1.11",
"memdown": "^1.0.0",
"es3ify": "~0.1.3",
"rimraf": "^2.3.2"
},
"keywords": [
"flux",
"alt",
"pouchdb",
"react",
"database"
],
"devDependencies": {
"debug": "^2.1.3",
"memdown": "^1.0.0",
"es3ify": "~0.1.3"
"scripts": {
"build": "npm run clean && npm run build-pf",
"build-pf": "babel src --out-dir lib --stage 0",
"clean": "rimraf lib",
"prepublish": "npm run build"
}
}
2 changes: 0 additions & 2 deletions src/actions/PouchActions.js → src/PouchActions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"use strict";

var alt = require('../alt');

class PouchActions {
constructor() {
this.generateActions(
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions src/alt.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/PouchFlux.js → src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* vim: set ts=2 sw=2 sts=2 et : */
"use strict";
var PouchStore = require("./stores/PouchStore");
var PouchActions = require("./actions/PouchActions");
var PouchStore = require("./PouchStore");
var PouchActions = require("./PouchActions");

module.exports = {
"PouchStore": PouchStore,
Expand Down

0 comments on commit adc9899

Please sign in to comment.