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.
Files changed (93) hide show
  1. data/CHANGELOG.md +35 -1
  2. data/README.md +1 -1
  3. data/bin/bpm +18 -1
  4. data/bpm.gemspec +3 -3
  5. data/lib/bpm.rb +34 -1
  6. data/lib/bpm/cli/base.rb +32 -44
  7. data/lib/bpm/errors.rb +15 -3
  8. data/lib/bpm/execjs_ext.rb +99 -0
  9. data/lib/bpm/local.rb +1 -1
  10. data/lib/bpm/package.rb +53 -51
  11. data/lib/bpm/pipeline.rb +21 -14
  12. data/lib/bpm/pipeline/directive_processor.rb +9 -0
  13. data/lib/bpm/pipeline/generated_asset.rb +59 -13
  14. data/lib/bpm/pipeline/package_pipeline.rb +2 -2
  15. data/lib/bpm/pipeline/plugin_asset.rb +1 -1
  16. data/lib/bpm/pipeline/plugin_context.rb +12 -2
  17. data/lib/bpm/pipeline/plugin_processor.rb +27 -4
  18. data/lib/bpm/project.rb +171 -139
  19. data/lib/bpm/server.rb +14 -9
  20. data/lib/bpm/version.rb +1 -1
  21. data/man/{bpm-compile.1.ronn → bpm-rebuild.1.ronn} +0 -0
  22. data/man/bpm.1.ronn +112 -9
  23. data/spec/cli/add_spec.rb +15 -6
  24. data/spec/cli/init_spec.rb +7 -7
  25. data/spec/cli/pack_spec.rb +13 -8
  26. data/spec/cli/preview_spec.rb +10 -0
  27. data/spec/cli/rebuild_spec.rb +5 -5
  28. data/spec/cli/remove_spec.rb +1 -1
  29. data/spec/fixtures/gems/core-test-0.4.9.bpkg +0 -0
  30. data/spec/fixtures/packages/backbone/package.json +2 -2
  31. data/spec/fixtures/packages/core-test/package.json +1 -1
  32. data/spec/fixtures/projects/coffee/coffee.json +4 -4
  33. data/spec/fixtures/projects/coffee/{packages → vendor}/coffee-script/compiler.js +0 -0
  34. data/spec/fixtures/projects/coffee/{packages → vendor}/coffee-script/lib/main.js +0 -0
  35. data/spec/fixtures/projects/coffee/{packages → vendor}/coffee-script/package.json +0 -0
  36. data/spec/fixtures/projects/coffee/{packages/handlebars → vendor/handlebars-format}/format.js +0 -0
  37. data/spec/fixtures/projects/coffee/{packages/handlebars → vendor/handlebars-format}/lib/main.js +0 -0
  38. data/spec/fixtures/projects/coffee/{packages/handlebars → vendor/handlebars-format}/package.json +2 -2
  39. data/spec/fixtures/projects/coffee/vendor/handlebars/package.json +15 -0
  40. data/spec/fixtures/projects/coffee/vendor/spade-coffee/package.json +15 -0
  41. data/spec/fixtures/projects/coffee/vendor/spade-handlebars/package.json +15 -0
  42. data/spec/fixtures/projects/coffee/vendor/spade/lib/main.js +1 -0
  43. data/spec/fixtures/projects/coffee/{packages → vendor}/spade/package.json +0 -0
  44. data/spec/fixtures/projects/coffee/{packages → vendor}/spade/transport.js +0 -0
  45. data/spec/fixtures/projects/hello2/{packages → vendor}/a/lib/main.js +0 -0
  46. data/spec/fixtures/projects/hello2/{packages → vendor}/a/package.json +0 -0
  47. data/spec/fixtures/projects/hello2/{packages → vendor}/b/lib/main.js +0 -0
  48. data/spec/fixtures/projects/hello2/{packages → vendor}/b/package.json +0 -0
  49. data/spec/fixtures/projects/hello2/{packages → vendor}/c/lib/main.js +0 -0
  50. data/spec/fixtures/projects/hello2/{packages → vendor}/c/package.json +0 -0
  51. data/spec/fixtures/projects/hello_dev/{packages → vendor}/style_package/css/some_style.css +0 -0
  52. data/spec/fixtures/projects/hello_dev/{packages → vendor}/style_package/package.json +0 -0
  53. data/spec/fixtures/projects/hello_world/another/one.js +1 -0
  54. data/spec/fixtures/projects/hello_world/another/two.js +1 -0
  55. data/spec/fixtures/projects/hello_world/hello_world.json +6 -5
  56. data/spec/fixtures/projects/hello_world/lib2/something.js +1 -0
  57. data/spec/fixtures/projects/hello_world/{packages → vendor}/custom_package/assets/dummy.txt +0 -0
  58. data/spec/fixtures/projects/hello_world/{packages → vendor}/custom_package/css/sample_styles.css +0 -0
  59. data/spec/fixtures/projects/hello_world/{packages → vendor}/custom_package/custom_dir/basic-module.js +0 -0
  60. data/spec/fixtures/projects/hello_world/{packages → vendor}/custom_package/lib/main.js +0 -0
  61. data/spec/fixtures/projects/hello_world/{packages → vendor}/custom_package/package.json +1 -1
  62. data/spec/fixtures/projects/hello_world/vendor/prerelease_package/package.json +4 -0
  63. data/spec/fixtures/projects/init_app/new_project.json +3 -3
  64. data/spec/fixtures/projects/init_default/new_project.json +2 -2
  65. data/spec/fixtures/projects/minitest/minitest.json +1 -1
  66. data/spec/fixtures/projects/minitest/{packages → vendor}/uglyduck/lib/main.js +0 -0
  67. data/spec/fixtures/projects/minitest/{packages → vendor}/uglyduck/minifier/main.js +0 -0
  68. data/spec/fixtures/projects/minitest/{packages → vendor}/uglyduck/package.json +0 -0
  69. data/spec/fixtures/projects/minitrans/minitrans.json +1 -1
  70. data/spec/fixtures/projects/minitrans/{packages → vendor}/transport/lib/main.js +0 -0
  71. data/spec/fixtures/projects/minitrans/{packages → vendor}/transport/package.json +0 -0
  72. data/spec/fixtures/projects/minitrans/{packages → vendor}/transport/transports/wrapper.js +0 -0
  73. data/spec/fixtures/projects/minitrans/{packages → vendor}/uglyduck/lib/main.js +0 -0
  74. data/spec/fixtures/projects/minitrans/{packages → vendor}/uglyduck/minifier/main.js +0 -0
  75. data/spec/fixtures/projects/minitrans/{packages → vendor}/uglyduck/package.json +0 -0
  76. data/spec/fixtures/projects/transporter/{packages → vendor}/transport/lib/main.js +0 -0
  77. data/spec/fixtures/projects/transporter/{packages → vendor}/transport/package.json +0 -0
  78. data/spec/fixtures/projects/transporter/{packages → vendor}/transport/transports/wrapper.js +0 -0
  79. data/spec/package_pipeline_spec.rb +8 -5
  80. data/spec/package_spec.rb +31 -26
  81. data/spec/pipeline_spec.rb +72 -64
  82. data/spec/plugins/format_spec.rb +7 -7
  83. data/spec/project_spec.rb +6 -5
  84. data/spec/spec_helper.rb +5 -4
  85. data/spec/support/cli.rb +9 -7
  86. data/spec/support/env.rb +7 -4
  87. data/spec/support/path.rb +1 -0
  88. data/support/es5-shim.js +935 -0
  89. data/templates/init/project.json +2 -3
  90. metadata +112 -97
  91. data/lib/bpm/pipeline/transport_processor.rb +0 -34
  92. data/spec/fixtures/projects/coffee/packages/spade/lib/main.js +0 -1
  93. 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