bpm 1.0.0.beta.13 → 1.0.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +35 -1
- data/README.md +1 -1
- data/bin/bpm +18 -1
- data/bpm.gemspec +3 -3
- data/lib/bpm.rb +34 -1
- data/lib/bpm/cli/base.rb +32 -44
- data/lib/bpm/errors.rb +15 -3
- data/lib/bpm/execjs_ext.rb +99 -0
- data/lib/bpm/local.rb +1 -1
- data/lib/bpm/package.rb +53 -51
- data/lib/bpm/pipeline.rb +21 -14
- data/lib/bpm/pipeline/directive_processor.rb +9 -0
- data/lib/bpm/pipeline/generated_asset.rb +59 -13
- data/lib/bpm/pipeline/package_pipeline.rb +2 -2
- data/lib/bpm/pipeline/plugin_asset.rb +1 -1
- data/lib/bpm/pipeline/plugin_context.rb +12 -2
- data/lib/bpm/pipeline/plugin_processor.rb +27 -4
- data/lib/bpm/project.rb +171 -139
- data/lib/bpm/server.rb +14 -9
- data/lib/bpm/version.rb +1 -1
- data/man/{bpm-compile.1.ronn → bpm-rebuild.1.ronn} +0 -0
- data/man/bpm.1.ronn +112 -9
- data/spec/cli/add_spec.rb +15 -6
- data/spec/cli/init_spec.rb +7 -7
- data/spec/cli/pack_spec.rb +13 -8
- data/spec/cli/preview_spec.rb +10 -0
- data/spec/cli/rebuild_spec.rb +5 -5
- data/spec/cli/remove_spec.rb +1 -1
- data/spec/fixtures/gems/core-test-0.4.9.bpkg +0 -0
- data/spec/fixtures/packages/backbone/package.json +2 -2
- data/spec/fixtures/packages/core-test/package.json +1 -1
- data/spec/fixtures/projects/coffee/coffee.json +4 -4
- data/spec/fixtures/projects/coffee/{packages → vendor}/coffee-script/compiler.js +0 -0
- data/spec/fixtures/projects/coffee/{packages → vendor}/coffee-script/lib/main.js +0 -0
- data/spec/fixtures/projects/coffee/{packages → vendor}/coffee-script/package.json +0 -0
- data/spec/fixtures/projects/coffee/{packages/handlebars → vendor/handlebars-format}/format.js +0 -0
- data/spec/fixtures/projects/coffee/{packages/handlebars → vendor/handlebars-format}/lib/main.js +0 -0
- data/spec/fixtures/projects/coffee/{packages/handlebars → vendor/handlebars-format}/package.json +2 -2
- data/spec/fixtures/projects/coffee/vendor/handlebars/package.json +15 -0
- data/spec/fixtures/projects/coffee/vendor/spade-coffee/package.json +15 -0
- data/spec/fixtures/projects/coffee/vendor/spade-handlebars/package.json +15 -0
- data/spec/fixtures/projects/coffee/vendor/spade/lib/main.js +1 -0
- data/spec/fixtures/projects/coffee/{packages → vendor}/spade/package.json +0 -0
- data/spec/fixtures/projects/coffee/{packages → vendor}/spade/transport.js +0 -0
- data/spec/fixtures/projects/hello2/{packages → vendor}/a/lib/main.js +0 -0
- data/spec/fixtures/projects/hello2/{packages → vendor}/a/package.json +0 -0
- data/spec/fixtures/projects/hello2/{packages → vendor}/b/lib/main.js +0 -0
- data/spec/fixtures/projects/hello2/{packages → vendor}/b/package.json +0 -0
- data/spec/fixtures/projects/hello2/{packages → vendor}/c/lib/main.js +0 -0
- data/spec/fixtures/projects/hello2/{packages → vendor}/c/package.json +0 -0
- data/spec/fixtures/projects/hello_dev/{packages → vendor}/style_package/css/some_style.css +0 -0
- data/spec/fixtures/projects/hello_dev/{packages → vendor}/style_package/package.json +0 -0
- data/spec/fixtures/projects/hello_world/another/one.js +1 -0
- data/spec/fixtures/projects/hello_world/another/two.js +1 -0
- data/spec/fixtures/projects/hello_world/hello_world.json +6 -5
- data/spec/fixtures/projects/hello_world/lib2/something.js +1 -0
- data/spec/fixtures/projects/hello_world/{packages → vendor}/custom_package/assets/dummy.txt +0 -0
- data/spec/fixtures/projects/hello_world/{packages → vendor}/custom_package/css/sample_styles.css +0 -0
- data/spec/fixtures/projects/hello_world/{packages → vendor}/custom_package/custom_dir/basic-module.js +0 -0
- data/spec/fixtures/projects/hello_world/{packages → vendor}/custom_package/lib/main.js +0 -0
- data/spec/fixtures/projects/hello_world/{packages → vendor}/custom_package/package.json +1 -1
- data/spec/fixtures/projects/hello_world/vendor/prerelease_package/package.json +4 -0
- data/spec/fixtures/projects/init_app/new_project.json +3 -3
- data/spec/fixtures/projects/init_default/new_project.json +2 -2
- data/spec/fixtures/projects/minitest/minitest.json +1 -1
- data/spec/fixtures/projects/minitest/{packages → vendor}/uglyduck/lib/main.js +0 -0
- data/spec/fixtures/projects/minitest/{packages → vendor}/uglyduck/minifier/main.js +0 -0
- data/spec/fixtures/projects/minitest/{packages → vendor}/uglyduck/package.json +0 -0
- data/spec/fixtures/projects/minitrans/minitrans.json +1 -1
- data/spec/fixtures/projects/minitrans/{packages → vendor}/transport/lib/main.js +0 -0
- data/spec/fixtures/projects/minitrans/{packages → vendor}/transport/package.json +0 -0
- data/spec/fixtures/projects/minitrans/{packages → vendor}/transport/transports/wrapper.js +0 -0
- data/spec/fixtures/projects/minitrans/{packages → vendor}/uglyduck/lib/main.js +0 -0
- data/spec/fixtures/projects/minitrans/{packages → vendor}/uglyduck/minifier/main.js +0 -0
- data/spec/fixtures/projects/minitrans/{packages → vendor}/uglyduck/package.json +0 -0
- data/spec/fixtures/projects/transporter/{packages → vendor}/transport/lib/main.js +0 -0
- data/spec/fixtures/projects/transporter/{packages → vendor}/transport/package.json +0 -0
- data/spec/fixtures/projects/transporter/{packages → vendor}/transport/transports/wrapper.js +0 -0
- data/spec/package_pipeline_spec.rb +8 -5
- data/spec/package_spec.rb +31 -26
- data/spec/pipeline_spec.rb +72 -64
- data/spec/plugins/format_spec.rb +7 -7
- data/spec/project_spec.rb +6 -5
- data/spec/spec_helper.rb +5 -4
- data/spec/support/cli.rb +9 -7
- data/spec/support/env.rb +7 -4
- data/spec/support/path.rb +1 -0
- data/support/es5-shim.js +935 -0
- data/templates/init/project.json +2 -3
- metadata +112 -97
- data/lib/bpm/pipeline/transport_processor.rb +0 -34
- data/spec/fixtures/projects/coffee/packages/spade/lib/main.js +0 -1
- data/spec/fixtures/projects/hello_world/vendor/lib/something.js +0 -1
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'sprockets'
|
2
|
-
|
3
|
-
module BPM
|
4
|
-
|
5
|
-
class TransportProcessor < Sprockets::Processor
|
6
|
-
|
7
|
-
def evaluate(context, locals)
|
8
|
-
environment = context.environment
|
9
|
-
project = environment.project
|
10
|
-
pkg, module_id = project.package_and_module_from_path file
|
11
|
-
transport_plugins = Array(pkg.bpm_use_transport || pkg.find_transport_plugins(project))
|
12
|
-
|
13
|
-
transport_plugins = [] if transport_plugins.first == 'none'
|
14
|
-
|
15
|
-
# No transport, just return the existing data
|
16
|
-
return data if transport_plugins.size == 0
|
17
|
-
|
18
|
-
if transport_plugins.size > 1
|
19
|
-
# TODO: Maybe make custom error for this
|
20
|
-
raise "#{pkg.name} depends on #{transport_plugins.size} packages that define transport plugins. " \
|
21
|
-
"Select a plugin by adding a `bpm:use:transport` property to the package.json"
|
22
|
-
end
|
23
|
-
|
24
|
-
plugin_ctx = environment.plugin_context_for transport_plugins.first
|
25
|
-
filepath = file.to_s
|
26
|
-
|
27
|
-
plugin_ctx["DATA"] = data
|
28
|
-
plugin_ctx["CTX"] = BPM::PluginContext.new(pkg, module_id)
|
29
|
-
plugin_ctx.eval("BPM_PLUGIN.compileTransport(DATA, CTX, '#{filepath}');") + "\n\n"
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
//spade/lib/main
|
@@ -1 +0,0 @@
|
|
1
|
-
// Placeholder - something.js
|