Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Composer redesign #779

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 39 additions & 46 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ module.exports = (grunt) ->
# Compilation
# -----------
coffee:
compile:
src:
files: [
expand: true
dest: 'temp/'
cwd: 'src'
src: '**/*.coffee'
dest: 'temp/'
ext: '.js'
expand: true
]

test:
files: [
expand: true
dest: 'test/temp/'
cwd: 'test/spec'
src: '**/*.coffee'
dest: 'test/temp/'
ext: '.js'
expand: true
]

options:
Expand Down Expand Up @@ -150,10 +150,10 @@ module.exports = (grunt) ->
copy:
universal:
files: [
expand: true
dest: 'temp/'
cwd: 'temp'
src: '**/*.js'
dest: 'temp/'
expand: true
]

options:
Expand All @@ -169,10 +169,10 @@ module.exports = (grunt) ->

amd:
files: [
expand: true
dest: 'temp/'
cwd: 'temp'
src: '**/*.js'
dest: 'temp/'
expand: true
]

options:
Expand All @@ -182,26 +182,26 @@ module.exports = (grunt) ->

test:
files: [
expand: true
dest: 'test/temp/'
cwd: 'temp'
src: '**/*.js'
dest: 'test/temp/'
expand: true
]

beforeInstrument:
files: [
expand: true
dest: 'test/temp-original/'
cwd: 'test/temp'
src: '**/*.js'
dest: 'test/temp-original/'
expand: true
]

afterInstrument:
files: [
expand: true
dest: 'test/temp/'
cwd: 'test/temp-original'
src: '**/*.js'
dest: 'test/temp/'
expand: true
]

# Module concatenation
Expand Down Expand Up @@ -256,25 +256,13 @@ module.exports = (grunt) ->
'''
footer: '''

var regDeps = function(Backbone, _) {
loader.register('backbone', function(exports, require, module) {
module.exports = Backbone;
});
loader.register('underscore', function(exports, require, module) {
module.exports = _;
});
};

if (typeof define === 'function' && define.amd) {
define(['backbone', 'underscore'], function(Backbone, _) {
regDeps(Backbone, _);
return loader('chaplin');
});
} else if (typeof module === 'object' && module && module.exports) {
regDeps(require('backbone'), require('underscore'));
module.exports = loader('chaplin');
} else if (typeof require === 'function') {
regDeps(window.Backbone, window._ || window.Backbone.utils);
window.Chaplin = loader('chaplin');
} else {
throw new Error('Chaplin requires Common.js or AMD modules');
Expand Down Expand Up @@ -317,7 +305,7 @@ module.exports = (grunt) ->
bower:
install:
options:
targetDir: "./test/#{ componentsFolder }"
targetDir: "./test/#{componentsFolder}"
cleanup: true

# Test runner
Expand Down Expand Up @@ -353,10 +341,9 @@ module.exports = (grunt) ->
coffee:
files: ['src/**/*.coffee']
tasks: [
'coffee:compile'
'coffee:src'
'urequire'
'copy:amd'
'copy:test'
'mocha'
]

Expand All @@ -367,6 +354,14 @@ module.exports = (grunt) ->
'mocha'
]

test_browser:
files: ['src/**/*.coffee', 'test/spec/*.coffee']
tasks: [
'prepareTest'
]
options:
spawn: false

# Events
# ======
grunt.event.on 'mocha.coverage', (coverage) ->
Expand All @@ -393,7 +388,7 @@ module.exports = (grunt) ->
# -----

grunt.registerTask 'build', [
'coffee:compile'
'coffee:src'
'copy:universal'
'concat:universal'
'uglify'
Expand All @@ -405,23 +400,28 @@ module.exports = (grunt) ->

# Test
# ----
grunt.registerTask 'test', [
'coffee:compile'
grunt.registerTask 'prepareTest', [
'coffee:test'
'coffee:src'
'urequire'
'copy:amd'
'copy:test'
'coffee:test'
]

grunt.registerTask 'test', [
'prepareTest'
'mocha'
]

grunt.registerTask 'test-watch', [
'test'
'watch'
]

# Coverage
# --------
grunt.registerTask 'cover', [
'coffee:compile'
'urequire'
'copy:amd'
'copy:test'
'coffee:test'
'prepareTest'
'copy:beforeInstrument'
'instrument'
'mocha'
Expand All @@ -430,13 +430,6 @@ module.exports = (grunt) ->
'makeReport'
]

# Test Watcher
# ------------
grunt.registerTask 'test-watch', [
'test'
'watch'
]

# Releasing
# ---------

Expand Down
33 changes: 14 additions & 19 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,28 @@
"name": "chaplin",
"version": "1.0.0",
"dependencies": {
"mocha": "1.13.x",
"expect": "0.2.x",
"jquery": "1.9.x",
"lodash": "2.3.x",
"backbone": "1.1.x",
"benchmark": "git://github.com/bestiejs/benchmark.js.git",
"sinon": "http://sinonjs.org/releases/sinon-1.7.1.js",
"requirejs": "~2.1.8",
"davy": "~0.0.4",
"exoskeleton": "~0.6.0"
"mocha": "~1.18.0",
"expect": "~0.3.1",
"jquery": "~1.11.0",
"lodash": "~2.4.1",
"backbone": "~1.1.2",
"benchmark": "~1.0.0",
"sinon": "http://sinonjs.org/releases/sinon-1.9.0.js",
"requirejs": "~2.1.11",
"davy": "~0.1.1",
"exoskeleton": "~0.6.3",
"subsequent": "~0.0.6"
},
"exportsOverride": {
"mocha": {
"scripts/..": "mocha.js",
"styles/..": "mocha.css"
},
"expect": {
".": "expect.js"
".": "index.js"
},
"backbone": {
".": "backbone.js"
},
"requirejs": {
".": "require.js"
},
"jquery": {
".": "jquery.js"
"benchmark": {
".": "benchmark.js"
}
}
}
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
"description": "An Application Architecture Using Backbone.js",
"repository": "git://github.com/chaplinjs/chaplin.git",
"devDependencies": {
"grunt": "0.4.x",
"grunt-contrib-coffee": "0.4.x",
"grunt-contrib-clean": "0.4.x",
"grunt-contrib-concat": "0.1.x",
"grunt-contrib-copy": "0.4.x",
"grunt-contrib-compress": "0.4.x",
"grunt-contrib-watch": "0.1.4",
"grunt-bower-task": "0.3.x",
"grunt-contrib-uglify": "0.2.x",
"grunt-istanbul": "0.2.x",
"grunt": "~0.4.4",
"grunt-contrib-coffee": "~0.10.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-compress": "~0.7.0",
"grunt-contrib-watch": "~0.6.0",
"grunt-bower-task": "~0.3.4",
"grunt-contrib-uglify": "~0.4.0",
"grunt-istanbul": "~0.2.4",
"grunt-urequire": "git://github.com/concordusapps/grunt-urequire",
"grunt-coffeelint": "0.0.x",
"grunt-mocha": "0.2.x",
"grunt-coffeelint": "~0.0.8",
"grunt-mocha": "~0.4.10",
"grunt-transbrute": "~0.2.0",
"prompt": "0.2.x",
"phantomjs": "1.9.x"
"prompt": "~0.2.12",
"phantomjs": "~1.9.7-1"
},
"main": "build/chaplin.js",
"scripts": {
Expand Down
Loading