embork 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +5 -0
- data/TODO.md +16 -0
- data/bin/embork +63 -0
- data/blueprint/Borkfile +42 -0
- data/blueprint/Gemfile +13 -0
- data/blueprint/README.md +25 -0
- data/blueprint/app/app.js +11 -0
- data/blueprint/app/components/.gitkeep +0 -0
- data/blueprint/app/controllers/.gitkeep +0 -0
- data/blueprint/app/helpers/.gitkeep +0 -0
- data/blueprint/app/index.html.erb +18 -0
- data/blueprint/app/initializers/.gitkeep +0 -0
- data/blueprint/app/mixins/.gitkeep +0 -0
- data/blueprint/app/models/.gitkeep +0 -0
- data/blueprint/app/router.js +8 -0
- data/blueprint/app/routes/.gitkeep +0 -0
- data/blueprint/app/routes/index.js +1 -0
- data/blueprint/app/styles/.gitkeep +0 -0
- data/blueprint/app/styles/app.scss +3 -0
- data/blueprint/app/templates/.gitkeep +0 -0
- data/blueprint/app/templates/application.hbs +3 -0
- data/blueprint/app/templates/components/.gitkeep +0 -0
- data/blueprint/app/utils/.gitkeep +0 -0
- data/blueprint/app/views/.gitkeep +0 -0
- data/blueprint/bower.json +16 -0
- data/blueprint/bowerrc +3 -0
- data/blueprint/config/development/application.css +0 -0
- data/blueprint/config/development/application.js +12 -0
- data/blueprint/config/production/application.css +0 -0
- data/blueprint/config/production/application.js +12 -0
- data/blueprint/dotfiles +3 -0
- data/blueprint/erbfiles +5 -0
- data/blueprint/gitignore +17 -0
- data/blueprint/jshintrc +40 -0
- data/blueprint/package.json +15 -0
- data/blueprint/static/.gitkeep +0 -0
- data/blueprint/tests/.jshintrc +71 -0
- data/blueprint/tests/helpers/resolver.js +7 -0
- data/blueprint/tests/helpers/start-app.js +29 -0
- data/blueprint/tests/index.html +44 -0
- data/blueprint/tests/test-helper.js +6 -0
- data/blueprint/tests/test-loader.js +8 -0
- data/blueprint/tests/unit/.gitkeep +0 -0
- data/embork.gemspec +41 -0
- data/lib/embork.rb +23 -0
- data/lib/embork/borkfile.rb +148 -0
- data/lib/embork/build_versions.rb +21 -0
- data/lib/embork/builder.rb +156 -0
- data/lib/embork/environment.rb +90 -0
- data/lib/embork/forwarder.rb +23 -0
- data/lib/embork/generator.rb +184 -0
- data/lib/embork/logger.rb +40 -0
- data/lib/embork/pushstate.rb +16 -0
- data/lib/embork/server.rb +80 -0
- data/lib/embork/sprockets.rb +6 -0
- data/lib/embork/sprockets/ember_handlebars_compiler.rb +75 -0
- data/lib/embork/sprockets/es6_module_transpiler.rb +120 -0
- data/lib/embork/sprockets/frameworks.rb +34 -0
- data/lib/embork/sprockets/helpers.rb +45 -0
- data/lib/embork/sprockets/support/es6-module-transpiler.js +7190 -0
- data/lib/embork/sprockets/support/node_runner.js +22 -0
- data/lib/embork/version.rb +3 -0
- data/lib/string/strip.rb +27 -0
- data/spec/embork/borkfile/Borkfile.empty +0 -0
- data/spec/embork/borkfile/Borkfile.full +32 -0
- data/spec/embork/borkfile/Borkfile.rack +5 -0
- data/spec/embork/borkfile/Borkfile.relative +3 -0
- data/spec/embork/borkfile_spec.rb +119 -0
- data/spec/embork/builder/Borkfile +20 -0
- data/spec/embork/builder/app/index.html.erb +9 -0
- data/spec/embork/builder/config/production/application.css +0 -0
- data/spec/embork/builder/config/production/application.js +0 -0
- data/spec/embork/builder/config/production/deeply/nested/asset.js +0 -0
- data/spec/embork/builder/static/images/image.png +0 -0
- data/spec/embork/builder_spec.rb +95 -0
- data/spec/embork/environment_spec.rb +78 -0
- data/spec/embork/generator_spec.rb +84 -0
- data/spec/embork/server/example_app/Borkfile +1 -0
- data/spec/embork/server/example_app/app/app.js.erb +3 -0
- data/spec/embork/server/example_app/app/css/main.sass +3 -0
- data/spec/embork/server/example_app/app/index.html +9 -0
- data/spec/embork/server/example_app/build/development/application-12345.js +14 -0
- data/spec/embork/server/example_app/build/development/index.html +9 -0
- data/spec/embork/server/example_app/components/some/component.js +6 -0
- data/spec/embork/server/example_app/config/development/application.css +4 -0
- data/spec/embork/server/example_app/config/development/application.js +2 -0
- data/spec/embork/server/example_app/config/production/application.css +4 -0
- data/spec/embork/server/example_app/config/production/application.js +4 -0
- data/spec/embork/server/example_app/static/fonts/.gitkeep +0 -0
- data/spec/embork/server/example_app/static/images/.gitkeep +0 -0
- data/spec/embork/server/example_app/static/images/image.png +0 -0
- data/spec/embork/server/specimen.css +7 -0
- data/spec/embork/server/specimen.js +14 -0
- data/spec/embork/server_spec.rb +152 -0
- data/spec/embork/sprockets/ember_handlebars_compiler/amd_template.js +26 -0
- data/spec/embork/sprockets/ember_handlebars_compiler/cjs_template.js +24 -0
- data/spec/embork/sprockets/ember_handlebars_compiler/global_handlebars_template.js +17 -0
- data/spec/embork/sprockets/ember_handlebars_compiler/global_hbs_template.js +17 -0
- data/spec/embork/sprockets/ember_handlebars_compiler/my/hbs/template.hbs +5 -0
- data/spec/embork/sprockets/ember_handlebars_compiler/my_handlebars_template.js.handlebars +5 -0
- data/spec/embork/sprockets/ember_handlebars_compiler/my_hbs_template.js.hbs +5 -0
- data/spec/embork/sprockets/ember_handlebars_compiler/transformed_template.js +26 -0
- data/spec/embork/sprockets/ember_handlebars_compiler_spec.rb +82 -0
- data/spec/embork/sprockets/es6_module_transpiler/app/my/transformed/module.js +13 -0
- data/spec/embork/sprockets/es6_module_transpiler/app/my_fancy_module.js +13 -0
- data/spec/embork/sprockets/es6_module_transpiler/compiled_amd.js +20 -0
- data/spec/embork/sprockets/es6_module_transpiler/compiled_cjs.js +20 -0
- data/spec/embork/sprockets/es6_module_transpiler/component.js +1 -0
- data/spec/embork/sprockets/es6_module_transpiler/components/some_component.js +1 -0
- data/spec/embork/sprockets/es6_module_transpiler/config/application.js +1 -0
- data/spec/embork/sprockets/es6_module_transpiler/manifest.js +20 -0
- data/spec/embork/sprockets/es6_module_transpiler/namespaced.js +20 -0
- data/spec/embork/sprockets/es6_module_transpiler/transformed.js +20 -0
- data/spec/embork/sprockets/es6_module_transpiler_spec.rb +97 -0
- data/spec/spec_helper.rb +13 -0
- metadata +468 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 68e08a13835911d3be709a08ed0f8c8e1d33d41f
|
4
|
+
data.tar.gz: 2d1db05b1f2d067446e290a62d69d615e6dfe0d6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c59ae75b4decaa04317aa4b0e32b064969d26a40a1ff2ea0a667baca1bb635294a04d1a85fce506714282047e3f584373c8aeec2a3a4d6e6f0da8bf7b7d2dd15
|
7
|
+
data.tar.gz: 79a46ae25a8232379c62ffc16f84c60b389238a08038fdbc389ecd4ab65c68351d316de644b0a4ac5a2cf46d711895c9d73eb03c6794c92d94f59a0904f916da
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
spec/embork/example_app/.cache
|
19
|
+
spec/embork/builder/build
|
20
|
+
spec/embork/builder/.cache
|
21
|
+
blueprint/components
|
22
|
+
blueprint/node_modules
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Matthew Smart
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Embork
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'embork'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install embork
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/TODO.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
TODO
|
2
|
+
====
|
3
|
+
|
4
|
+
- [x] add helpers to run from built or generated files
|
5
|
+
- [x] Add html files to Borkfile. Discreet list of what to build. Don't assume.
|
6
|
+
- [x] Use no cache for erb files.
|
7
|
+
- [x] Add `:keep_old_versions` to Borkfile to configure the number of old versions
|
8
|
+
- [x] Create full blown example project.
|
9
|
+
- [x] Create blank Borkfile with all options presented and probably commented out.
|
10
|
+
- [x] Make module transpiler ignore components
|
11
|
+
- [x] Create cli to run server.
|
12
|
+
- [x] Add jj-abrams resolver
|
13
|
+
- [ ] Extend cli with clean, and hint
|
14
|
+
- [ ] add hint task
|
15
|
+
- [ ] build in qunit-runner
|
16
|
+
- [ ] build in prerender
|
data/bin/embork
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'embork'
|
4
|
+
require 'thor'
|
5
|
+
|
6
|
+
class EmborkCLI < Thor
|
7
|
+
class_option :borkfile, :type => :string, :default => "./Borkfile",
|
8
|
+
:desc => "Path to the embork config file."
|
9
|
+
|
10
|
+
desc "create PACKAGE_NAME", %{generate an Embork Ember application called "PACKAGE_NAME"}
|
11
|
+
option :use_ember_data, :type => :boolean, :default => false
|
12
|
+
option :directory, :type => :string, :default => nil
|
13
|
+
def create(package_name)
|
14
|
+
puts %{Creating embork app in "%s"} % package_name
|
15
|
+
Embork::Generator.new(package_name, options).generate
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "server [ENVIRONMENT]", %{run the development or production server}
|
19
|
+
option :port, :type => :numeric, :default => 9292
|
20
|
+
option :host, :type => :string, :default => 'localhost'
|
21
|
+
option :bundle_version, :type => :string, :default => nil
|
22
|
+
option :with_latest_bundle, :type => :boolean, :default => false
|
23
|
+
def server(environment = :development)
|
24
|
+
borkfile = Embork::Borkfile.new options[:borkfile], environment
|
25
|
+
Embork::Server.new(borkfile, options).run
|
26
|
+
end
|
27
|
+
|
28
|
+
desc "build [ENVIRONMENT]", %{build the project in the 'build' directory}
|
29
|
+
option :keep_all_old_versions, :type => :boolean, :default => false,
|
30
|
+
:desc => %{By default, older versions of the project are removed, only keeping the last few versions. This flag keeps all old versions.}
|
31
|
+
def build(environment = :production)
|
32
|
+
borkfile = Embork::Borkfile.new options[:borkfile], environment
|
33
|
+
builder = Embork::Builder.new(borkfile)
|
34
|
+
builder.build
|
35
|
+
builder.clean unless options[:keep_all_old_versions]
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "clean", %{Remove all files under the build directory}
|
39
|
+
def clean
|
40
|
+
borkfile = Embork::Borkfile.new options[:borkfile]
|
41
|
+
FileUtils.rm_rf File.expand_path('build', borkfile.project_root)
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "clean-cache", %{Blow away the sprockets cache}
|
45
|
+
def clean_cache
|
46
|
+
borkfile = Embork::Borkfile.new options[:borkfile]
|
47
|
+
FileUtils.rm_rf File.expand_path('.cache', borkfile.project_root)
|
48
|
+
end
|
49
|
+
|
50
|
+
desc "hint", %{run jshint on the app and tests}
|
51
|
+
option :only_app, :type => :boolean, :default => false
|
52
|
+
option :only_tests, :type => :boolean, :default => false
|
53
|
+
def hint
|
54
|
+
borkfile = Embork::Borkfile.new options[:borkfile]
|
55
|
+
Dir.chdir borkfile.project_root do
|
56
|
+
system('npm run hint-app') unless options[:only_tests]
|
57
|
+
system('npm run hint-testss') unless options[:only_app]
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
EmborkCLI.start(ARGV)
|
data/blueprint/Borkfile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# vim: set ft=ruby:
|
2
|
+
# Borkfile
|
3
|
+
|
4
|
+
keep_old_versions 5
|
5
|
+
|
6
|
+
set_project_root '.'
|
7
|
+
|
8
|
+
# Add paths:
|
9
|
+
#
|
10
|
+
# append_asset_path 'foo/bar'
|
11
|
+
|
12
|
+
# Add sprockets pre/post processors and template engines:
|
13
|
+
#
|
14
|
+
# register_postprocessor 'application/javascript', SomeClass
|
15
|
+
# register_engine '.some-ext, SomeEngine
|
16
|
+
|
17
|
+
# Add frameworks. Currently only compass and bootstrap (bootstrap-sass) are
|
18
|
+
# supported. First add either to your Gemfile and bundle.
|
19
|
+
#
|
20
|
+
# use_framework :compass
|
21
|
+
# use_framework :bootstrap
|
22
|
+
|
23
|
+
add_sprockets_helpers do
|
24
|
+
end
|
25
|
+
|
26
|
+
# Pass in a single file or an array.
|
27
|
+
compile_html 'index.html'
|
28
|
+
|
29
|
+
es6_namespace '<%= namespace %>'
|
30
|
+
|
31
|
+
# Call anything of these things inside a `configure <environment>` block to
|
32
|
+
# make it environment specific
|
33
|
+
configure :development do
|
34
|
+
end
|
35
|
+
|
36
|
+
configure :production do
|
37
|
+
end
|
38
|
+
|
39
|
+
# Use :static index to fall back to sprockets-built html files OR pass in
|
40
|
+
# a rack application
|
41
|
+
set_backend :static_index
|
42
|
+
|
data/blueprint/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'embork'
|
4
|
+
|
5
|
+
# To include compass, include the gem, and use the 'use_framework' DSL in the
|
6
|
+
# Borkfile.
|
7
|
+
#
|
8
|
+
# gem 'compass'
|
9
|
+
|
10
|
+
# To include bootstrap, include the gem, and use the 'use_framework' DSL in the
|
11
|
+
# Borkfile.
|
12
|
+
#
|
13
|
+
# gem 'bootstrap-sass'
|
data/blueprint/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# <%= name.substring(0,1).toUpperCase() + name.substring(1) %>
|
2
|
+
|
3
|
+
This README outlines the details of collaborating on this Ember application.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
* `git clone` this repository
|
8
|
+
* `npm install`
|
9
|
+
* `bower install`
|
10
|
+
|
11
|
+
## Running
|
12
|
+
|
13
|
+
* `ember server`
|
14
|
+
* Visit your app at http://localhost:4200.
|
15
|
+
|
16
|
+
## Running Tests
|
17
|
+
|
18
|
+
* `ember test`
|
19
|
+
* `ember test --server`
|
20
|
+
|
21
|
+
## Building
|
22
|
+
|
23
|
+
* `ember build`
|
24
|
+
|
25
|
+
For more information on using ember-cli, visit [http://iamstef.net/ember-cli/](http://iamstef.net/ember-cli/).
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import Resolver from 'ember/resolver';
|
2
|
+
import loadInitializers from 'ember/load-initializers';
|
3
|
+
|
4
|
+
var App = Ember.Application.extend({
|
5
|
+
modulePrefix: "<%= namespace %>",
|
6
|
+
Resolver: Resolver
|
7
|
+
});
|
8
|
+
|
9
|
+
loadInitializers(App, "<%= namespace %>");
|
10
|
+
|
11
|
+
export default App;
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
+
<title><%= namespace %></title>
|
7
|
+
<meta name="description" content="">
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
9
|
+
<%%= stylesheet_link_tag '/application.css' %>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<%%= javascript_include_tag '/application.js' %>
|
13
|
+
<script>
|
14
|
+
window.App = require('<%= namespace %>/app')['default'].create(
|
15
|
+
Ember.merge(window.ENV, { environment: "<%%= Embork.env %>" }));
|
16
|
+
</script>
|
17
|
+
</body>
|
18
|
+
</html>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
export default Ember.Route.extend({});
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"name": "<%= namespace %>",
|
3
|
+
"dependencies": {
|
4
|
+
"handlebars": "~1.3.0",
|
5
|
+
"jquery": "^1.11.1",
|
6
|
+
"qunit": "~1.12.0",
|
7
|
+
"ember-qunit": "~0.1.5",
|
8
|
+
"ember": "1.5.1",
|
9
|
+
"ember-data": "1.0.0-beta.7",
|
10
|
+
"ic-ajax": "~1.x",
|
11
|
+
"loader": "stefanpenner/loader.js#1.0.0",
|
12
|
+
"ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.1",
|
13
|
+
"ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.1",
|
14
|
+
"ember-resolver": "stefanpenner/ember-jj-abrams-resolver#0.1.1"
|
15
|
+
}
|
16
|
+
}
|
data/blueprint/bowerrc
ADDED
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
//= require jquery/dist/jquery
|
2
|
+
//= require handlebars/handlebars
|
3
|
+
//= require ember/ember
|
4
|
+
//= require loader/loader
|
5
|
+
//= require ember-resolver/dist/ember-resolver
|
6
|
+
//= require ic-ajax/dist/named-amd/main
|
7
|
+
//= require ember-data/ember-data
|
8
|
+
//= require ember-cli-shims/app-shims
|
9
|
+
//= require ember-load-initializers/ember-load-initializers
|
10
|
+
//= require_tree ../../app
|
11
|
+
|
12
|
+
window.ENV = {};
|
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
//= require jquery/dist/jquery.min
|
2
|
+
//= require handlebars/handlebars.runtime.min
|
3
|
+
//= require ember/ember.prod
|
4
|
+
//= require loader/loader
|
5
|
+
//= require ember-resolver/dist/ember-resolver.prod
|
6
|
+
//= require ic-ajax/dist/named-amd/main
|
7
|
+
//= require ember-data/ember-data.prod
|
8
|
+
//= require ember-cli-shims/app-shims
|
9
|
+
//= require ember-load-initializers/ember-load-initializers
|
10
|
+
//= require_tree ../../app
|
11
|
+
|
12
|
+
window.ENV = {};
|
data/blueprint/dotfiles
ADDED
data/blueprint/erbfiles
ADDED