Skip to content

Commit

Permalink
update README, add package.json, release version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-brade committed Oct 5, 2015
1 parent fc37f50 commit 2d77198
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/index.css
/package.json
57 changes: 30 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A Perfect Derby CRUD Component
# A Perfect DerbyJS CRUD Component

This is a completely generic, responsive, and realtime collaborative Derby component to create, read, update,
This is a completely generic, responsive, and realtime collaborative DerbyJS component to create, read, update,
and delete entities in a database using Racer. The items of an entity are displayed using
the great jQuery DataTables plugin. Realtime collaboration and conflict resolution is achieved
through RacerJS and ShareJS.
Expand All @@ -16,36 +16,37 @@ TODO

## Prerequisites

`derby-entity` depends on the following packages:

* **LiveScript**: this component is written in LiveScript, so add `require('livescript');` to your `server.js` and `liveify`
to browserify transforms
* **lodash**
* **my Derby 0.6 fork** because I added
* **[my Derby 0.6 fork](https://github.com/michael-brade/derby)** because I added
- support for LiveScript components
- support for component styles
- support for subcomponents
all of which are needed for derby-entity.
* **derby-entities-lib**, which contains some purely model- and entity-specific functions that are needed and shared by
derby-entity and derby-entity-visualization
* **derby-entity-select2**
* **[derby-entities-lib](https://github.com/michael-brade/derby-entities-lib)**, which contains some purely model- and
entity-specific functions as well as view components that are needed and shared by derby-entity and derby-entity-visualization
* **[derby-entity-select2](https://github.com/michael-brade/derby-entity-select2)**
* **derby-sass** for being able to compile scss files on the fly... actually, a better way is to do it using gulp, see below.
* **derby-modal**
* **modal from [d-comp-palette](https://github.com/shuslav/d-comp-palette)**
* i18n: **derby-lang** and **derby-locale**, plus the following shortcut view functions:
- `l($locale)` to return the current lowercase locale (en, de, ...)
- `t($locale, path, params)` to return the translation of path in the current locale
See below for detailed i18n information.
* a browserify bundle that provides jQuery and exposes the following DataTables requires:

require('datatables')
require('datatables.bootstrap')
require('datatables.responsive')
require('datatables.colReorder')
require('datatables.colResize')
require('jquery.highlight')
require('datatables.searchHighlight')

* **my Bootstrap fork** where I added proper placement support for popovers when combining `trigger: manual` with
`container` and `selector`
* **Font-Awesome**
```
require('datatables')
require('datatables.bootstrap')
require('datatables.responsive')
require('datatables.colReorder')
require('datatables.colResize')
require('jquery.highlight')
require('datatables.searchHighlight')
```
* **[my Bootstrap fork](https://github.com/michael-brade/bootstrap)** where I added proper placement support for popovers
when combining `trigger: manual` with `container` and `selector`.
* **Font-Awesome**, use bower for that one.


## Usage
Expand All @@ -65,7 +66,8 @@ In addition to that, each entity attribute needs to be defined.

The actions and dialogs of this component are using these strings:

* actions
```
actions
{
"title": "Actions",
Expand All @@ -75,34 +77,35 @@ The actions and dialogs of this component are using these strings:
"delete": "Delete",
"done": "Done",
"cancel": "Cancel"
}
},
* dialogs
dialogs
{
"deleteEntityTitle": "Delete {ENTITY}",
"referencePopoverTitle": "<em>{ITEM}</em> is used by:",
"referencePopoverUnused": "This {ENTITY} is not referenced."
},
* messages
messages
{
"entityAdded": "New {ENTITY} \"{ITEM}\" added.",
"deleteEntity": "Do you really want to delete this {ENTITY}?",
"entityDeleted": "{ENTITY} \"{ITEM}\" deleted.",
"itemReferenced": "Cannot delete {ENTITY} because it is still referenced by:"
}

```

### Style

To be more flexible I added some fine-graned color definition variables to the standard `$brand-primary`. derby-entity
uses:
```sass
$brand-primary
$brand-primary-light
$brand-secondary
$brand-aux-1-med-light

```

#### Compilation

Expand Down Expand Up @@ -145,7 +148,7 @@ uses:

## TODO

* create a proper NPM package
* more documentation...
* drop jQuery DataTables, it is just too fat and slow (takes at least 500ms to display *after* the page
has been rendered, and with just around 150 items it slows down to 1.5s)
* reimplement the DataTables features using what Derby already provides, as well as using:
Expand Down
57 changes: 57 additions & 0 deletions package.json.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/local/bin/lsc -cj

name: 'derby-entity'
description: 'A Perfect DerbyJS CRUD Component'
version: '1.0.0'

author:
name: 'Michael Brade'
email: '[email protected]'

keywords:
'derby'
'entity'


repository:
type: 'git'
url: 'michael-brade/derby-entity'

dependencies:
# utils
'lodash': '3.x'

# the following are commented out because they are not immediate
# dependencies - the app needs to depend on those

# derby
#'derby': 'michael-brade/derby'

# racer
#'racer': 'michael-brade/racer'
#'racer-bundle': 'michael-brade/racer-bundle'


# derby components
'derby-entities-lib': '1.0.x'
'derby-entity-select2': '1.0.x'

'derby-ui-toast': '*'
'd-comp-palette': '*'

devDependencies:
'livescript': '1.x'
'node-sass': '3.3.x'

# possibly, depending on how you set it up
'browserify-livescript': '0.2.x'

engines:
node: '4.x'

license: 'MIT'

bugs:
url: 'https://github.com/michael-brade/derby-entity/issues'

homepage: 'https://github.com/michael-brade/derby-entity#readme'

0 comments on commit 2d77198

Please sign in to comment.