Permalink
Browse files

feat(project): Rename project to remove spoonx prefix. enable npm ins…

…tallation

BREAKING CHANGE: `spoonx/` prefix dropped from install name for orm and api. Update `package.json` and `config.js` accordingly.
  • Loading branch information...
doktordirk committed Mar 31, 2016
1 parent 59a7fa7 commit c2b977fea01b1a629acfe69291fb0380088a6b27
@@ -11,6 +11,10 @@ This library plays nice with the [Sails.js framework](http://sailsjs.org).
> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.durandal.io/). If you have questions, we invite you to [join us on Gitter](https://gitter.im/aurelia/discuss). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting [the framework board](https://github.com/aurelia/framework#boards).
## Important note
We've simplified installation and usage! This plugin should now be installed using `jspm i aurelia-orm` or (for webpack) `npm i aurelia-orm`. Make sure you update all references to `spoonx/aurelia-orm` and `spoonx/aurelia-api` and remove the `spoonx/` prefix (don't forget your config.js, package.json, imports and bundles).
## Polyfills
* None
@@ -27,7 +31,7 @@ This library can be used in the **browser** only.
Installing this module is fairly simple.
Run `jspm install github:spoonx/aurelia-orm` from your project root.
Run `jspm install aurelia-orm` from your project root.
## Example
@@ -36,7 +40,7 @@ Here's a snippet to give you an idea of what this module does.
### entity/user.js
```javascript
import {Entity, validatedResource} from 'spoonx/aurelia-orm';
import {Entity, validatedResource} from 'aurelia-orm';
import {ensure} from 'aurelia-validation';
@validatedResource('user')
@@ -55,7 +59,7 @@ export class UserEntity extends Entity {
### page/some-view-model.js
```javascript
import {EntityManager} from 'spoonx/aurelia-orm';
import {EntityManager} from 'aurelia-orm';
import {inject} from 'aurelia-framework';
@inject(EntityManager)
@@ -7,36 +7,24 @@ System.config({
},
map: {
"aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.3.0",
"aurelia-api": "npm:aurelia-api@2.1.2",
"aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.3.1",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.2.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0",
"aurelia-pal-browser": "npm:aurelia-pal-browser@1.0.0-beta.1.2.0",
"aurelia-polyfills": "npm:aurelia-polyfills@1.0.0-beta.1.1.0",
"aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.2.0",
"aurelia-polyfills": "npm:aurelia-polyfills@1.0.0-beta.1.1.1",
"aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.2.1",
"aurelia-validation": "npm:aurelia-validation@0.6.6",
"extend": "npm:extend@3.0.0",
"fetch": "github:github/fetch@0.11.0",
"spoonx/aurelia-api": "github:spoonx/aurelia-api@2.1.2",
"typer": "npm:typer@1.1.0",
"github:jspm/nodelibs-assert@0.1.0": {
"assert": "npm:assert@1.3.0"
},
"github:jspm/nodelibs-process@0.1.2": {
"process": "npm:process@0.11.2"
},
"github:jspm/nodelibs-util@0.1.0": {
"util": "npm:util@0.10.3"
},
"github:spoonx/aurelia-api@2.1.2": {
"npm:aurelia-api@2.1.2": {
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.2.0",
"aurelia-fetch-client": "npm:aurelia-fetch-client@1.0.0-beta.1.2.0",
"extend": "npm:extend@3.0.0",
"qs": "npm:qs@6.1.0"
},
"npm:assert@1.3.0": {
"util": "npm:util@0.10.3"
},
"npm:aurelia-binding@1.0.0-beta.1.3.0": {
"npm:aurelia-binding@1.0.0-beta.1.3.1": {
"aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0",
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0",
"aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.2.0"
@@ -56,14 +44,14 @@ System.config({
"npm:aurelia-pal-browser@1.0.0-beta.1.2.0": {
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0"
},
"npm:aurelia-polyfills@1.0.0-beta.1.1.0": {
"npm:aurelia-polyfills@1.0.0-beta.1.1.1": {
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0"
},
"npm:aurelia-task-queue@1.0.0-beta.1.2.0": {
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0"
},
"npm:aurelia-templating@1.0.0-beta.1.2.0": {
"aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.3.0",
"npm:aurelia-templating@1.0.0-beta.1.2.1": {
"aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.3.1",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.2.0",
"aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.2.0",
"aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0",
@@ -73,21 +61,11 @@ System.config({
"aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.2.0"
},
"npm:aurelia-validation@0.6.6": {
"aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.3.0",
"aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.3.1",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.2.0",
"aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0",
"aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.2.0"
},
"npm:inherits@2.0.1": {
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:process@0.11.2": {
"assert": "github:jspm/nodelibs-assert@0.1.0"
},
"npm:util@0.10.3": {
"inherits": "npm:inherits@2.0.1",
"process": "github:jspm/nodelibs-process@0.1.2"
"aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.2.1"
}
}
});
@@ -24,7 +24,7 @@ A `Repository` instance.
```javascript
import {inject} from 'aurelia-framework';
import {EntityManager} from 'spoonx/aurelia-orm';
import {EntityManager} from 'aurelia-orm';
import UserEntity from 'entity/user';
@inject(EntityManager)
@@ -59,15 +59,15 @@ An `Entity` instance.
```javascript
import {inject} from 'aurelia-framework';
import {EntityManager} from 'spoonx/aurelia-orm';
import {EntityManager} from 'aurelia-orm';
import UserEntity from 'entity/user';
@inject(EntityManager)
export class SomeUpdateViewModel {
constructor (entityManager) {
// Get a custom Entity instance for the User entity
entityManager.getEntity(UserEntity);
// Get a default entity for the 'article' resource
entityManager.getEntity('article');
}
@@ -96,7 +96,7 @@ Itself to allow chaining.
```javascript
import {inject} from 'aurelia-framework';
import {EntityManager} from 'spoonx/aurelia-orm';
import {EntityManager} from 'aurelia-orm';
import UserEntity from 'entity/user';
@inject(EntityManager)
@@ -127,7 +127,7 @@ Itself to allow chaining.
```javascript
import {inject} from 'aurelia-framework';
import {EntityManager} from 'spoonx/aurelia-orm';
import {EntityManager} from 'aurelia-orm';
import UserEntity from 'entity/user';
import CategoryEntity from 'entity/category';
@@ -1,7 +1,7 @@
Docs for the {`Entity`} class
=======
This class can optionally be used with validation.
This class can optionally be used with validation.
The following is a full example, with validation included.
For a larger example, take a look at the end of this document.
@@ -149,13 +149,13 @@ A new `Promise` to be resolved when `.destroy()` has completed.
```javascript
import {inject} from 'aurelia-framework';
import {EntityManager} from 'spoonx/aurelia-orm';
import {EntityManager} from 'aurelia-orm';
@inject(EntityManager)
export class SomeViewModel {
constructor (entityManager) {
let repository = entityManager.getRepository('user');
// Find a single record.
repository.find(7)
.then(entity => {
@@ -25,13 +25,13 @@ A new `Promise` to be resolved when `.find()` has completed.
```javascript
import {inject} from 'aurelia-framework';
import {EntityManager} from 'spoonx/aurelia-orm';
import {EntityManager} from 'aurelia-orm';
@inject(EntityManager)
export class SomeViewModel {
constructor (entityManager) {
let repository = entityManager.getRepository('user');
// Find a single record.
repository.find(7)
.then(console.log)
@@ -63,13 +63,13 @@ A new `Entity` instance with the populated data.
```javascript
import {inject} from 'aurelia-framework';
import {EntityManager} from 'spoonx/aurelia-orm';
import {EntityManager} from 'aurelia-orm';
@inject(EntityManager)
export class SomeViewModel {
constructor (entityManager) {
let repository = entityManager.getRepository('user');
// Create a new entity
repository
.getPopulatedEntity({username: 'bob', password: 'bacon'})
@@ -101,13 +101,13 @@ A new `Entity` instance with the populated data, or an array or `Entity` instanc
```javascript
import {inject} from 'aurelia-framework';
import {EntityManager} from 'spoonx/aurelia-orm';
import {EntityManager} from 'aurelia-orm';
@inject(EntityManager)
export class SomeViewModel {
constructor (entityManager) {
let repository = entityManager.getRepository('notes');
// entities is an array of Entity instances.
let entities = repository.populateEntities([{note: 'laundry'}, {note: 'bacon'}]);
}
@@ -5,10 +5,9 @@ Aurelia-orm ships with a couple of decorators that help you configure your entit
## Small example
Here's an example using (almost) all decorators available:
```javascript
import {Entity, resource, repository, validation, association} from 'spoonx/aurelia-orm';
import {Entity, resource, repository, validation, association} from 'aurelia-orm';
import {ensure} from 'aurelia-validation';
import {CustomRepository} from 'repository/custom-repository';
@@ -18,11 +17,11 @@ validation()
export class MyEntity extends Entity {
@ensure(it => it.isNotEmpty().hasLengthBetween(3, 20))
name = null;
// Will use string 'onetoone' as resource name.
@association()
oneToOne = null
// Will use 'multiple' as resource name.
@association('multiple')
oneManyToMany = null
@@ -64,7 +63,7 @@ class HelloWorld {}
Usually, you won't need the `@repository()` decorator. It's used to define a custom repository for your entity (which can be useful if you wish to implement different methods).
```javascript
import {Entity, repository} from 'spoonx/aurelia-orm';
import {Entity, repository} from 'aurelia-orm';
import {CustomRepository} from 'repository/custom-repository';
@repository(CustomRepository)
@@ -94,15 +93,15 @@ This decorator allows you to add types to your properties. These types will be u
### Example
```javascript
import {Entity, type} from 'spoonx/aurelia-orm';
import {Entity, type} from 'aurelia-orm';
export class MyEntity extends Entity {
@type('string')
name = null;
@type('date')
created = null;
@type('boolean')
disabled = false;
}
@@ -135,7 +134,7 @@ When not set, the orm will use the defaultEndpoint.
An example for a User entity
```javascript
import {Entity, endpoint} from 'spoonx/aurelia-orm';
import {Entity, endpoint} from 'aurelia-orm';
@endpoint('auth')
export class User extends Entity {}
@@ -146,7 +145,7 @@ export class User extends Entity {}
An example for a weather entity
```javascript
import {Entity, endpoint} from 'spoonx/aurelia-orm';
import {Entity, endpoint} from 'aurelia-orm';
@endpoint('weather')
export class Weather extends Entity {}
@@ -159,7 +158,7 @@ To add validation for associations, simply use the .hasAssociation() rule like s
```javascript
import {ensure} from 'aurelia-validation';
import {association, validatedResource, Entity} from 'spoonx/aurelia-orm';
import {association, validatedResource, Entity} from 'aurelia-orm';
validatedResource()
export class SomeEntity extends Entity {
@@ -9,7 +9,7 @@ Following is a small, but more complete example of how you would implement a cre
### File: entity/user-entity.js
```javascript
import {Entity, validatedResource} from 'spoonx/aurelia-orm';
import {Entity, validatedResource} from 'aurelia-orm';
import {ensure} from 'aurelia-validation';
@validatedResource('user')
@@ -28,7 +28,7 @@ export default class UserEntity extends Entity {
### File: page/user/create.js
```javascript
import {EntityManager} from 'spoonx/aurelia-orm';
import {EntityManager} from 'aurelia-orm';
import {inject} from 'aurelia-framework';
@inject(EntityManager)
Oops, something went wrong.

0 comments on commit c2b977f

Please sign in to comment.