joosy 1.2.0.alpha.59 → 1.2.0.alpha.62
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/.travis.yml +2 -1
- data/Gruntfile.coffee +50 -217
- data/bin/joosy +1 -1
- data/bower.json +1 -1
- data/build/joosy.js +5 -5
- data/{generators → lib/generators}/base.coffee +1 -1
- data/{generators → lib/generators}/command/command.coffee +1 -1
- data/{generators → lib/generators}/command/help.coffee +0 -0
- data/{generators → lib/generators}/layout.coffee +0 -0
- data/{generators → lib/generators}/page.coffee +0 -0
- data/{generators → lib/generators}/project.coffee +1 -1
- data/{generators → lib/generators}/project/base.coffee +0 -0
- data/{generators → lib/generators}/project/standalone.coffee +9 -4
- data/{generators → lib/generators}/templates/application/base/application.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/helpers/application.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/layouts/application.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/pages/application.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/pages/welcome/index.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/routes.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/templates/layouts/application.jst.hamlc +0 -0
- data/{generators → lib/generators}/templates/application/base/templates/pages/welcome/index.jst.hamlc +0 -0
- data/{generators → lib/generators}/templates/application/standalone/Gruntfile.coffee +11 -25
- data/{generators → lib/generators}/templates/application/standalone/Procfile +0 -0
- data/{generators → lib/generators}/templates/application/standalone/_gitignore +2 -2
- data/{generators/templates/application/standalone/source → lib/generators/templates/application/standalone/app}/haml/index.haml +0 -0
- data/{generators/templates/application/standalone/source → lib/generators/templates/application/standalone/app}/stylesheets/application.styl +0 -0
- data/{generators → lib/generators}/templates/application/standalone/bower.json +0 -0
- data/{generators → lib/generators}/templates/application/standalone/package.json +3 -0
- data/{generators → lib/generators}/templates/application/standalone/spec/application_spec.coffee +0 -0
- data/{generators → lib/generators}/templates/application/standalone/spec/helpers/environment.coffee +0 -0
- data/{generators → lib/generators}/templates/application/standalone/tasks/spec.coffee +0 -0
- data/{generators → lib/generators}/templates/layout/basic.coffee +0 -0
- data/{generators → lib/generators}/templates/layout/namespaced.coffee +0 -0
- data/{generators → lib/generators}/templates/page/basic.coffee +0 -0
- data/{generators → lib/generators}/templates/page/namespaced.coffee +0 -0
- data/{generators → lib/generators}/templates/widget/basic.coffee +0 -0
- data/{generators → lib/generators}/templates/widget/namespaced.coffee +0 -0
- data/{generators → lib/generators}/widget.coffee +0 -0
- data/lib/joosy.rb +2 -2
- data/lib/tasks/build.coffee +16 -0
- data/lib/tasks/doc.coffee +80 -0
- data/lib/tasks/publish.coffee +29 -0
- data/lib/tasks/testem.coffee +58 -0
- data/package.json +10 -15
- data/source/joosy/helpers/widgets.coffee +1 -1
- data/source/joosy/modules/events.coffee +1 -1
- data/source/joosy/router.coffee +2 -2
- data/source/joosy/templaters/jst.coffee +1 -1
- data/source/joosy/widget.coffee +2 -2
- data/spec/joosy/core/helpers/routes_spec.coffee +8 -2
- data/spec/joosy/core/router_spec.coffee +4 -4
- data/tasks/joosy.coffee +2 -0
- metadata +39 -42
- data/Gemfile +0 -6
- data/build/joosy/extensions/preloaders.js +0 -189
- data/source/joosy/extensions/preloaders/caching.coffee +0 -169
- data/source/joosy/extensions/preloaders/index.coffee +0 -1
- data/source/joosy/extensions/preloaders/inline.coffee +0 -56
- data/spec/joosy/extensions/preloaders/caching_spec.coffee +0 -36
- data/spec/joosy/extensions/preloaders/inline_spec.coffee +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3026cc5a8fa556721dea56bca1cd26624997d893
|
4
|
+
data.tar.gz: 7b33f80118d9b346b6e878f65155b5de68c2ddc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12407f1b9f3f29b45cfab2fcacf1a918c2e9a5148fd8b7d9140ec44cb91608cd66ab5d6e71f5413fac82798c6bec8aabf621c93f548473f65b571a74a3c915aa
|
7
|
+
data.tar.gz: f22ccf20ee0fc3b87b19ffe598914fdca3241841f2a7de90d0fb678bb0dd9e2dfbe0264051c5bd4e1914ab8117f3b3bbf0d39fefae79d287f4fc368789e1663b
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gruntfile.coffee
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Sugar = require 'sugar'
|
4
|
-
Mincer = require 'mincer'
|
5
|
-
FS = require 'fs'
|
6
|
-
semver = require 'semver'
|
1
|
+
require 'sugar'
|
7
2
|
|
3
|
+
module.exports = (grunt) ->
|
8
4
|
#
|
9
5
|
# Locations
|
10
6
|
#
|
@@ -14,76 +10,31 @@ module.exports = (grunt) ->
|
|
14
10
|
path: 'source'
|
15
11
|
build: 'build/joosy.js'
|
16
12
|
extensions: (name) ->
|
17
|
-
root: "joosy/extensions/#{name}"
|
18
|
-
build: "build/joosy/extensions/#{name}.js"
|
13
|
+
root: "joosy/extensions/#{name || '*'}"
|
14
|
+
build: "build/joosy/extensions/#{name || '**/*'}.js"
|
19
15
|
specs:
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
build: '.grunt'
|
26
|
-
|
27
|
-
specOptions = (category, specs, vendor=[]) ->
|
28
|
-
host: 'http://localhost:8888/'
|
29
|
-
keepRunner: true
|
30
|
-
outfile: "spec/#{category}.html"
|
31
|
-
vendor: [
|
32
|
-
'bower_components/sinonjs/sinon.js',
|
33
|
-
'bower_components/sugar/release/sugar-full.min.js'
|
34
|
-
].concat(vendor),
|
35
|
-
specs: "#{locations.specs.build}/#{specs}"
|
36
|
-
helpers: locations.specs.build + '/' + locations.specs.helpers
|
16
|
+
helpers: [
|
17
|
+
'bower_components/sinonjs/sinon.js',
|
18
|
+
'bower_components/sugar/release/sugar-full.min.js',
|
19
|
+
'spec/helpers/*.coffee'
|
20
|
+
]
|
37
21
|
|
38
22
|
#
|
39
23
|
# Grunt extensions
|
40
24
|
#
|
41
|
-
grunt.
|
42
|
-
grunt.loadNpmTasks 'grunt-contrib-coffee'
|
43
|
-
grunt.loadNpmTasks 'grunt-contrib-jasmine'
|
44
|
-
grunt.loadNpmTasks 'grunt-contrib-watch'
|
25
|
+
grunt.loadTasks 'lib/tasks'
|
45
26
|
grunt.loadNpmTasks 'grunt-coffeelint'
|
46
27
|
grunt.loadNpmTasks 'grunt-release'
|
47
28
|
|
29
|
+
#
|
30
|
+
# Config
|
31
|
+
#
|
48
32
|
grunt.initConfig
|
49
|
-
release:
|
50
|
-
options:
|
51
|
-
bump: false
|
52
|
-
add: false
|
53
|
-
commit: false
|
54
|
-
push: false
|
55
|
-
|
56
|
-
connect:
|
57
|
-
specs:
|
58
|
-
options:
|
59
|
-
port: 8888
|
60
|
-
|
61
|
-
watch:
|
62
|
-
source:
|
63
|
-
files: [locations.source.path + '/**/*']
|
64
|
-
tasks: ['mince']
|
65
|
-
specs:
|
66
|
-
options:
|
67
|
-
nospawn: true
|
68
|
-
files: [ locations.specs.helpers ].add(Object.values locations.specs.units)
|
69
|
-
tasks: ['coffee']
|
70
|
-
|
71
|
-
coffee:
|
72
|
-
specs:
|
73
|
-
expand: true
|
74
|
-
src: [ locations.specs.helpers ].add(Object.values locations.specs.units)
|
75
|
-
dest: locations.specs.build
|
76
|
-
ext: '.js'
|
77
|
-
|
78
33
|
mince:
|
79
34
|
core:
|
80
35
|
include: [locations.source.path]
|
81
36
|
src: locations.source.root
|
82
37
|
dest: locations.source.build
|
83
|
-
preloaders:
|
84
|
-
include: [locations.source.path]
|
85
|
-
src: locations.source.extensions('preloaders').root
|
86
|
-
dest: locations.source.extensions('preloaders').build
|
87
38
|
resources:
|
88
39
|
include: [locations.source.path]
|
89
40
|
src: locations.source.extensions('resources').root
|
@@ -101,170 +52,52 @@ module.exports = (grunt) ->
|
|
101
52
|
'max_line_length':
|
102
53
|
level: 'ignore'
|
103
54
|
|
104
|
-
|
55
|
+
testem:
|
105
56
|
core:
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
57
|
+
src: locations.specs.helpers
|
58
|
+
.include('bower_components/jquery/jquery.js')
|
59
|
+
.include(locations.source.build)
|
60
|
+
.include('spec/joosy/core/**/*_spec.coffee')
|
111
61
|
zepto:
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
62
|
+
src: locations.specs.helpers
|
63
|
+
.include('bower_components/zepto/zepto.js')
|
64
|
+
.include(locations.source.build)
|
65
|
+
.include('spec/joosy/core/**/*_spec.coffee')
|
117
66
|
'environments-global':
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
67
|
+
src: locations.specs.helpers
|
68
|
+
.include('bower_components/jquery/jquery.js')
|
69
|
+
.include(locations.source.build)
|
70
|
+
.include('spec/joosy/environments/global_spec.coffee')
|
123
71
|
'environments-amd':
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
72
|
+
src: locations.specs.helpers
|
73
|
+
.include('bower_components/jquery/jquery.js')
|
74
|
+
.include('bower_components/requirejs/require.js')
|
75
|
+
.include(locations.source.build)
|
76
|
+
.include('spec/joosy/environments/amd_spec.coffee')
|
130
77
|
extensions:
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
#
|
139
|
-
# Preparations
|
140
|
-
#
|
141
|
-
grunt.registerTask 'prepare', ->
|
142
|
-
complete = @async()
|
143
|
-
|
144
|
-
base = process.cwd()
|
145
|
-
git = (args, callback) ->
|
146
|
-
grunt.util.spawn {cmd: "git", args: args, opts: {stdio: [0,1,2]}}, callback
|
147
|
-
|
148
|
-
if grunt.file.exists 'doc'
|
149
|
-
grunt.fatal "Documentation directory exists. Please remove it"
|
150
|
-
|
151
|
-
git ["clone", "git@github.com:joosy/joosy.git", "doc"], (error, result) ->
|
152
|
-
grunt.fatal "Erorr cloning repo" if error
|
153
|
-
process.chdir 'doc'
|
154
|
-
|
155
|
-
git ["checkout", "gh-pages"], (error, result) ->
|
156
|
-
grunt.fatal "Erorr checking branch out" if error
|
157
|
-
|
158
|
-
process.chdir base
|
159
|
-
complete()
|
160
|
-
|
161
|
-
#
|
162
|
-
# Builders
|
163
|
-
#
|
164
|
-
grunt.registerMultiTask 'mince', ->
|
165
|
-
Mincer.CoffeeEngine.configure bare: false
|
166
|
-
environment = new Mincer.Environment
|
167
|
-
environment.appendPath x for x in @data.include
|
168
|
-
grunt.file.write @data.dest, environment.findAsset(@data.src).toString()
|
169
|
-
|
170
|
-
grunt.registerTask 'default', ['connect', 'build', 'watch']
|
171
|
-
|
172
|
-
grunt.registerTask 'build', ['mince', 'coffee', 'jasmine:core:build', 'jasmine:extensions:build', 'bowerize']
|
173
|
-
|
174
|
-
grunt.registerTask 'test', ['connect', 'mince', 'coffee', 'bowerize', 'jasmine']
|
175
|
-
|
176
|
-
grunt.registerTask 'bowerize', ->
|
177
|
-
bower = require './bower.json'
|
178
|
-
meta = require './package.json'
|
179
|
-
|
180
|
-
bower.version = meta.version
|
181
|
-
FS.writeFileSync 'bower.json', JSON.stringify(bower, null, 2)
|
182
|
-
|
183
|
-
#
|
184
|
-
# Documentation
|
185
|
-
#
|
186
|
-
grunt.registerTask 'doc', ->
|
187
|
-
complete = @async()
|
188
|
-
version = require('./package.json').version.split('-')
|
189
|
-
version = version[0]+'-'+version[1]?.split('.')[0]
|
190
|
-
destination = "doc/#{version}"
|
191
|
-
args = ['source', '--output-dir', destination]
|
192
|
-
|
193
|
-
git = (args, callback) ->
|
194
|
-
grunt.util.spawn {cmd: "git", args: args, opts: {stdio: [0,1,2], cwd: 'doc'}}, callback
|
195
|
-
|
196
|
-
date = (version) ->
|
197
|
-
return undefined unless version
|
198
|
-
Date.create(grunt.file.read "doc/#{version}/DATE").format "{d} {Month} {yyyy}"
|
199
|
-
|
200
|
-
git ['pull'], (error, result) ->
|
201
|
-
grunt.fatal "Error pulling from git" if error
|
202
|
-
|
203
|
-
grunt.file.delete destination if grunt.file.exists destination
|
204
|
-
grunt.util.spawn {cmd: "codo", args: args, opts: {stdio: [0,1,2]}}, (error, result) ->
|
205
|
-
grunt.fatal "Error generating docs" if error
|
206
|
-
grunt.file.write "#{destination}/DATE", (new Date).toISOString()
|
207
|
-
|
208
|
-
versions = []
|
209
|
-
for version in grunt.file.expand({cwd: 'doc'}, '*')
|
210
|
-
versions.push version if semver.valid(version)
|
211
|
-
|
212
|
-
versions = versions.sort(semver.rcompare)
|
213
|
-
edge = versions.find (x) -> x.has('-')
|
214
|
-
stable = versions.find (x) -> !x.has('-')
|
215
|
-
versions = versions.remove edge, stable
|
216
|
-
|
217
|
-
versions = {
|
218
|
-
edge:
|
219
|
-
version: edge
|
220
|
-
date: date(edge)
|
221
|
-
stable:
|
222
|
-
version: stable
|
223
|
-
date: date(stable)
|
224
|
-
versions: versions.map (x) -> { version: x, date: date(x) }
|
225
|
-
}
|
226
|
-
grunt.file.write 'doc/versions.js', "window.versions = #{JSON.stringify(versions)}"
|
227
|
-
|
228
|
-
git ['add', '-A'], (error, result) ->
|
229
|
-
grunt.fatal "Error adding files" if error
|
230
|
-
|
231
|
-
git ['commit', '-m', "Updated at #{(new Date).toISOString()}"], (error, result) ->
|
232
|
-
grunt.fatal "Error commiting" if error
|
233
|
-
|
234
|
-
git ['push', 'origin', 'gh-pages'], (error, result) ->
|
235
|
-
grunt.fatal "Error pushing" if error
|
236
|
-
complete()
|
78
|
+
src: locations.specs.helpers
|
79
|
+
.include('bower_components/jquery/jquery.js')
|
80
|
+
.include('bower_components/jquery-form/jquery.form.js')
|
81
|
+
.include(locations.source.build)
|
82
|
+
.include(locations.source.extensions().build)
|
83
|
+
.include('spec/joosy/extensions/**/*_spec.coffee')
|
237
84
|
|
85
|
+
release:
|
86
|
+
options:
|
87
|
+
bump: false
|
88
|
+
add: false
|
89
|
+
commit: false
|
90
|
+
push: false
|
238
91
|
|
239
92
|
#
|
240
|
-
#
|
93
|
+
# Main tasks
|
241
94
|
#
|
242
|
-
grunt.registerTask '
|
243
|
-
complete = @async()
|
244
|
-
|
245
|
-
grunt.util.spawn {cmd: "git", args: ["status", "--porcelain" ]}, (error, result) ->
|
246
|
-
if !!error || result.stdout.length > 0
|
247
|
-
console.log ""
|
248
|
-
console.log "Uncommited changes found. Please commit prior to release or use `--force`.".bold
|
249
|
-
console.log ""
|
250
|
-
complete false
|
251
|
-
else
|
252
|
-
complete true
|
253
|
-
|
254
|
-
grunt.registerTask 'publish:gem', ->
|
255
|
-
meta = require './package.json'
|
256
|
-
complete = @async()
|
257
|
-
|
258
|
-
grunt.util.spawn {cmd: "gem", args: ["build", "joosy.gemspec"]}, (error, result) ->
|
259
|
-
return complete false if error
|
95
|
+
grunt.registerTask 'default', ['testem:generate', 'testem:ci']
|
260
96
|
|
261
|
-
|
262
|
-
|
97
|
+
grunt.registerTask 'test', ->
|
98
|
+
grunt.fatal "Specify module to run manual tests for" unless @args[0]
|
263
99
|
|
264
|
-
|
265
|
-
|
266
|
-
grunt.log.ok "Published #{gem}"
|
267
|
-
grunt.file.delete gem
|
268
|
-
complete(true)
|
100
|
+
grunt.task.run "testem:generate:#{@args[0]}"
|
101
|
+
grunt.task.run "testem:run:#{@args[0]}"
|
269
102
|
|
270
|
-
grunt.registerTask 'publish', ['
|
103
|
+
grunt.registerTask 'publish', ['testem:ci', 'publish:ensureCommits', 'doc', 'release', 'publish:gem']
|
data/bin/joosy
CHANGED
data/bower.json
CHANGED
data/build/joosy.js
CHANGED
@@ -1965,18 +1965,18 @@
|
|
1965
1965
|
if (this.config.html5) {
|
1966
1966
|
this.config.prefix = ('/' + this.config.prefix + '/').replace(/\/{2,}/g, '/');
|
1967
1967
|
}
|
1968
|
-
if (respond) {
|
1969
|
-
this.respond(this.canonizeLocation());
|
1970
|
-
}
|
1971
1968
|
if (this.config.html5) {
|
1972
|
-
|
1969
|
+
this.listener = this.bind('popstate pushstate', function() {
|
1973
1970
|
return _this.respond(_this.canonizeLocation());
|
1974
1971
|
});
|
1975
1972
|
} else {
|
1976
|
-
|
1973
|
+
$(window).bind('hashchange.JoosyRouter', function() {
|
1977
1974
|
return _this.respond(_this.canonizeLocation());
|
1978
1975
|
});
|
1979
1976
|
}
|
1977
|
+
if (respond) {
|
1978
|
+
return this.respond(this.canonizeLocation());
|
1979
|
+
}
|
1980
1980
|
};
|
1981
1981
|
|
1982
1982
|
Router.reset = function() {
|
File without changes
|
File without changes
|
File without changes
|
@@ -12,7 +12,7 @@ module.exports = class
|
|
12
12
|
"""
|
13
13
|
|
14
14
|
@standalone = new Standalone(@options)
|
15
|
-
@base = new Base(@options, Path.join(@standalone.destination, '
|
15
|
+
@base = new Base(@options, Path.join(@standalone.destination, 'app/javascript'))
|
16
16
|
|
17
17
|
generate: ->
|
18
18
|
@standalone.generate()
|
File without changes
|
@@ -18,11 +18,15 @@ class ProjectStandalone extends @Base
|
|
18
18
|
@copy ['application', 'standalone', 'Gruntfile.coffee'], ['Gruntfile.coffee']
|
19
19
|
@copy ['application', 'standalone', 'Procfile'], ['Procfile']
|
20
20
|
|
21
|
-
@copy ['application', 'standalone', '
|
22
|
-
['
|
21
|
+
@copy ['application', 'standalone', 'app', 'haml', 'index.haml'],
|
22
|
+
['app', 'haml', 'index.haml']
|
23
23
|
|
24
|
-
@copy ['application', 'standalone', '
|
25
|
-
['
|
24
|
+
@copy ['application', 'standalone', 'app', 'stylesheets', 'application.styl'],
|
25
|
+
['app', 'stylesheets', 'application.styl']
|
26
|
+
|
27
|
+
@file ['app', 'images', '.gitkeep']
|
28
|
+
|
29
|
+
@file ['app', 'fonts', '.gitkeep']
|
26
30
|
|
27
31
|
@copy ['application', 'standalone', 'tasks', 'spec.coffee'],
|
28
32
|
['tasks', 'spec.coffee']
|
@@ -35,6 +39,7 @@ class ProjectStandalone extends @Base
|
|
35
39
|
|
36
40
|
@template ['application', 'standalone', 'bower.json'], ['bower.json'],
|
37
41
|
application: @options.name
|
42
|
+
|
38
43
|
@template ['application', 'standalone', 'package.json'], ['package.json'],
|
39
44
|
joosy_version: @version()
|
40
45
|
|