Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
patriksimek committed Jul 5, 2015
0 parents commit 53be042
Show file tree
Hide file tree
Showing 12 changed files with 2,192 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.DS_Store
/lib/*.js
/test/browser/test.js
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.DS_Store
docs
test
Cakefile
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js
node_js:
- "0.10"
- "0.12"
- "1.0"
- "2.0"

before_script:
coffee -c -o ./lib ./src
25 changes: 25 additions & 0 deletions Cakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
task 'compile', 'compile sources', ->
setImmediate -> run [
'coffee -c -o ./lib ./src'
'coffee -c -o ./test/browser ./test/test.coffee'
]

task 'watch', 'watch & compile sources', ->
setImmediate -> run [
'coffee -c -w -o ./lib ./src'
'coffee -c -w -o ./test/browser ./test/test.coffee'
]

# ---------------

run = (cmds) ->
procs = []
for cmd in cmds
cmd = cmd.split ' '

if process.platform is 'win32'
cmd.unshift('/c');
procs.push require('child_process').spawn process.env.comspec, cmd, stdio: 'inherit', cwd: process.cwd()

else
procs.push require('child_process').spawn cmd.shift(), cmd, stdio: 'inherit', cwd: process.cwd()
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# simDOM

JavaScript library for CoffeeScript developers.

## Installation

```html
<script src="sim.js"></script>
```

## Usage

```coffee
sim(body).do ->
@header ->
@h1().text "Welcome to my Blog"

@section ->
for aricle in articles
@article ->
@h1().text article.title
@p().text article.content

@footer ->
@p().text "Thanks for visiting."
```

## Server-side Usage

```coffeescript
sim = require 'simdom'

sim.div '.hello', ->
@span '.world', ->
@text "Sample"

console.log @toString()
```

Results in:

```html
<div class="hello"><span class="world">Sample</span></div>
```

## Notes

```coffee
sim('body') is sim('body') # true
```

<a name="license" />
## License

Copyright (c) 2015 Integromat LLC

The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"author": {
"name": "Patrik Simek",
"url": "https://patriksimek.cz"
},
"name": "simdom",
"description": "JavaScript library for CoffeeScript developers.",
"keywords": [
"dom",
"library",
"jquery",
"browser"
],
"version": "0.1.0",
"main": "lib/sim.js",
"repository": {
"type": "git",
"url": "https://github.com/integromat/simdom"
},
"license": "MIT",
"dependencies": {},
"devDependencies": {
"coffee-script": "^1.9.3",
"mocha": "^2.1.0"
},
"engines": {
"node": ">=0.10"
},
"scripts": {
"prepublish": "coffee -c -o ./lib ./src",
"compile": "coffee -c -o ./lib ./src",
"test": "node_modules/.bin/mocha test"
}
}
Loading

0 comments on commit 53be042

Please sign in to comment.