bpm 1.0.0.beta.10 → 1.0.0.beta.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bpm/cli/base.rb +12 -11
- data/lib/bpm/cli/owner.rb +1 -1
- data/lib/bpm/package.rb +12 -11
- data/lib/bpm/pipeline/generated_asset.rb +1 -2
- data/lib/bpm/project.rb +7 -4
- data/lib/bpm/version.rb +1 -1
- data/spec/cli/init_spec.rb +3 -1
- data/spec/fixtures/gems/uglify-js-1.0.4.bpkg +0 -0
- data/spec/fixtures/packages/uglify-js/package.json +3 -1
- data/spec/fixtures/projects/minitest/packages/uglyduck/package.json +4 -3
- data/spec/fixtures/projects/minitrans/packages/uglyduck/package.json +4 -3
- metadata +20 -20
data/lib/bpm/cli/base.rb
CHANGED
@@ -66,7 +66,7 @@ module BPM
|
|
66
66
|
method_option :project, :type => :string, :default => nil, :aliases => ['-p'], :desc => 'Specify project location other than working directory'
|
67
67
|
method_option :prerelease, :type => :boolean, :default => false, :aliases => ['--pre'], :desc => 'Install a prerelease version'
|
68
68
|
method_option :development, :type => :boolean, :default => false, :aliases => ['--dev'], :desc => "Add as a development dependency"
|
69
|
-
method_option :mode, :type => :string, :default => :production, :aliases => ['-m'], :desc => "Build mode for compile
|
69
|
+
method_option :mode, :type => :string, :default => :production, :aliases => ['-m'], :desc => "Build mode for compile"
|
70
70
|
def add(*package_names)
|
71
71
|
# map to dependencies
|
72
72
|
if package_names.empty?
|
@@ -100,7 +100,7 @@ module BPM
|
|
100
100
|
|
101
101
|
desc "remove [PACKAGE]", "Remove one or more packages from a bpm project"
|
102
102
|
method_option :project, :type => :string, :default => nil, :aliases => ['-p'], :desc => 'Specify project location other than working directory'
|
103
|
-
method_option :mode, :type => :string, :default => :production, :aliases => ['-m'], :desc => "Build mode for compile
|
103
|
+
method_option :mode, :type => :string, :default => :production, :aliases => ['-m'], :desc => "Build mode for compile"
|
104
104
|
def remove(*package_names)
|
105
105
|
|
106
106
|
# map to dependencies
|
@@ -119,7 +119,7 @@ module BPM
|
|
119
119
|
end
|
120
120
|
|
121
121
|
desc "preview", "Preview server that will autocompile assets as you request them. Useful for hacking"
|
122
|
-
method_option :mode, :type => :string, :default => :debug, :aliases => ['-m'], :desc => 'Build mode for compile
|
122
|
+
method_option :mode, :type => :string, :default => :debug, :aliases => ['-m'], :desc => 'Build mode for compile'
|
123
123
|
method_option :project, :type => :string, :default => nil, :aliases => ['-p'], :desc => 'Specify project location other than working directory'
|
124
124
|
method_option :port, :type => :string, :default => '4020', :desc => "Port to host server on"
|
125
125
|
def preview
|
@@ -129,7 +129,7 @@ module BPM
|
|
129
129
|
end
|
130
130
|
|
131
131
|
desc "rebuild", "Rebuilds bpm assets, does not update versions"
|
132
|
-
method_option :mode, :type => :string, :default => :production, :aliases => ['-m'], :desc => 'Build mode for compile
|
132
|
+
method_option :mode, :type => :string, :default => :production, :aliases => ['-m'], :desc => 'Build mode for compile'
|
133
133
|
method_option :project, :type => :string, :default => nil, :aliases => ['-p'], :desc => 'Specify project location other than working directory'
|
134
134
|
method_option :update, :type => :boolean, :default => false, :aliases => ['-u'], :desc => 'Updates dependencies to latest compatible version'
|
135
135
|
def rebuild
|
@@ -176,7 +176,7 @@ module BPM
|
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
179
|
-
desc "push", "Distribute your bpm package"
|
179
|
+
desc "push PACKAGE", "Distribute your bpm package"
|
180
180
|
def push(package)
|
181
181
|
remote = BPM::Remote.new
|
182
182
|
if remote.logged_in?
|
@@ -236,8 +236,8 @@ module BPM
|
|
236
236
|
desc "init [PATHS]", "Configure a project to use bpm for management"
|
237
237
|
method_option :name, :type => :string, :default => nil, :desc => 'Specify a different name for the project'
|
238
238
|
method_option :skip, :type => :boolean, :default => false, :desc => 'Skip any conflicting files'
|
239
|
-
method_option :app, :type => :boolean, :default => false, :desc => 'Manage app as well as packages'
|
240
|
-
method_option :package, :type => :string, :default => nil, :desc => 'Specify a package template to build from'
|
239
|
+
method_option :app, :type => :boolean, :default => false, :desc => 'Manage app files as well as packages. (Always true for new directories.)'
|
240
|
+
#method_option :package, :type => :string, :default => nil, :desc => 'Specify a package template to build from'
|
241
241
|
def init(*paths)
|
242
242
|
paths = [Dir.pwd] if paths.empty?
|
243
243
|
paths.map!{|p| File.expand_path(p) }
|
@@ -259,7 +259,8 @@ module BPM
|
|
259
259
|
if File.directory?(path)
|
260
260
|
run_init(name, options[:app], path)
|
261
261
|
else
|
262
|
-
package = install_package(options[:package])
|
262
|
+
#package = install_package(options[:package])
|
263
|
+
package = nil
|
263
264
|
template_path = package ? package.template_path(:project) : nil
|
264
265
|
generator = get_generator(:project, package)
|
265
266
|
success = generator.new(self, name, path, template_path, package).run
|
@@ -308,9 +309,9 @@ module BPM
|
|
308
309
|
end
|
309
310
|
end
|
310
311
|
|
311
|
-
desc "debug [OPTION]", "Display various options for debugging"
|
312
|
-
method_option :project,
|
313
|
-
method_option :mode, :type => :string, :default => :debug, :aliases => ['-m'], :desc => 'Build mode
|
312
|
+
desc "debug [OPTION]", "Display various options for debugging.\n build - Shows all project build settings\n repair - Verify and repair project"
|
313
|
+
method_option :project, :type => :string, :default => nil, :aliases => ['-p'], :desc => 'Specify project location other than working directory'
|
314
|
+
method_option :mode, :type => :string, :default => :debug, :aliases => ['-m'], :desc => 'Build mode'
|
314
315
|
def debug(option)
|
315
316
|
case option
|
316
317
|
when 'build'
|
data/lib/bpm/cli/owner.rb
CHANGED
@@ -32,7 +32,7 @@ module BPM::CLI
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
desc "remove [PACKAGE] [EMAIL]", "
|
35
|
+
desc "remove [PACKAGE] [EMAIL]", "Remove user's permission to push new versions of your bpm package"
|
36
36
|
def remove(package, email)
|
37
37
|
remote = BPM::Remote.new
|
38
38
|
if remote.logged_in?
|
data/lib/bpm/package.rb
CHANGED
@@ -24,19 +24,17 @@ module BPM
|
|
24
24
|
"dependencies:development" => :hash,
|
25
25
|
"bpm:build" => :hash,
|
26
26
|
"bpm:formats" => :hash,
|
27
|
-
"bpm:transport" => :string,
|
28
27
|
"bpm:use:transport" => :string,
|
29
|
-
"bpm:minifier" => :string,
|
30
28
|
"bpm:provides" => :hash
|
31
29
|
}
|
32
30
|
|
33
|
-
|
34
|
-
|
31
|
+
PLUGIN_TYPES = %w[minifier]
|
32
|
+
|
35
33
|
# Fields that can be loaded straight into the gemspec
|
36
34
|
SPEC_FIELDS = %w[name email]
|
37
35
|
|
38
36
|
# Fields that should be bundled up into JSON in the gemspec
|
39
|
-
METADATA_FIELDS = %w[keywords licenses engines main bin directories pipeline bpm:build bpm:formats
|
37
|
+
METADATA_FIELDS = %w[keywords licenses engines main bin directories pipeline bpm:build bpm:formats]
|
40
38
|
|
41
39
|
REQUIRED_FIELDS = %w[name author version]
|
42
40
|
|
@@ -150,8 +148,8 @@ module BPM
|
|
150
148
|
hash['directories'] || hash['assets']
|
151
149
|
end
|
152
150
|
|
153
|
-
build_names +=
|
154
|
-
val =
|
151
|
+
build_names += PLUGIN_TYPES.map do |type|
|
152
|
+
val = bpm_provides[type]
|
155
153
|
val = val && val =~ /^#{name}\// ? val[name.size+1..-1]+'.js' : nil
|
156
154
|
val
|
157
155
|
end
|
@@ -190,7 +188,7 @@ module BPM
|
|
190
188
|
pkg.name == pkg_name
|
191
189
|
end
|
192
190
|
raise "Could not find dependency: #{pkg_name}" unless dep
|
193
|
-
dep.
|
191
|
+
dep.provided_transport
|
194
192
|
end.compact
|
195
193
|
end
|
196
194
|
|
@@ -399,9 +397,12 @@ module BPM
|
|
399
397
|
def used_transports(project)
|
400
398
|
pkgs=project.map_to_packages used_dependencies(project)
|
401
399
|
pkgs.map { |pkg| pkg.provided_transport }.compact.flatten
|
402
|
-
end
|
403
|
-
|
404
|
-
|
400
|
+
end
|
401
|
+
|
402
|
+
def provided_minifier
|
403
|
+
bpm_provides['minifier']
|
404
|
+
end
|
405
|
+
|
405
406
|
# TODO: Make better errors
|
406
407
|
# TODO: This might not work well with conflicting versions
|
407
408
|
def local_deps(search_path=nil)
|
@@ -39,7 +39,7 @@ module BPM
|
|
39
39
|
raise MinifierNotFoundError.new(minifier_name)
|
40
40
|
end
|
41
41
|
|
42
|
-
minifier_plugin_name = pkg.
|
42
|
+
minifier_plugin_name = pkg.provided_minifier
|
43
43
|
if minifier_plugin_name.nil?
|
44
44
|
raise MinifierNotFoundError.new(minifier_name)
|
45
45
|
end
|
@@ -111,7 +111,6 @@ module BPM
|
|
111
111
|
project = environment.project
|
112
112
|
settings = project.build_settings(environment.mode)[asset_name]
|
113
113
|
pkgs = settings.keys.map do |pkg_name|
|
114
|
-
next if pkg_name == 'bpm:minifier'
|
115
114
|
if pkg_name == project.name
|
116
115
|
project
|
117
116
|
else
|
data/lib/bpm/project.rb
CHANGED
@@ -483,7 +483,9 @@ module BPM
|
|
483
483
|
# Name of minifier
|
484
484
|
|
485
485
|
def minifier_name(asset_name)
|
486
|
-
build_settings[asset_name] &&
|
486
|
+
build_settings[asset_name] &&
|
487
|
+
build_settings[asset_name]['bpm:provides'] &&
|
488
|
+
build_settings[asset_name]['bpm:provides']['minifier']
|
487
489
|
end
|
488
490
|
|
489
491
|
def load_json
|
@@ -754,11 +756,12 @@ module BPM
|
|
754
756
|
end
|
755
757
|
|
756
758
|
if opts['minifier']
|
759
|
+
ret[target_name]['bpm:provides'] ||= {}
|
757
760
|
if opts['minifier'].is_a? String
|
758
|
-
ret[target_name]['bpm:minifier'] = {}
|
759
|
-
ret[target_name]['bpm:minifier'][opts['minifier']] = '>= 0'
|
761
|
+
ret[target_name]['bpm:provides']['minifier'] = {}
|
762
|
+
ret[target_name]['bpm:provides']['minifier'][opts['minifier']] = '>= 0'
|
760
763
|
else
|
761
|
-
ret[target_name]['bpm:minifier'] = opts['minifier']
|
764
|
+
ret[target_name]['bpm:provides']['minifier'] = opts['minifier']
|
762
765
|
end
|
763
766
|
end
|
764
767
|
|
data/lib/bpm/version.rb
CHANGED
data/spec/cli/init_spec.rb
CHANGED
@@ -118,7 +118,7 @@ describe "bpm init on a non-existant directory" do
|
|
118
118
|
bpm 'init', 'BpmTest'
|
119
119
|
|
120
120
|
|
121
|
-
files = %w(LICENSE README.md index.html
|
121
|
+
files = %w(LICENSE README.md index.html lib/main.js BpmTest.json)
|
122
122
|
generated_files = %w(assets/bpm_libs.js assets/bpm_styles.css)
|
123
123
|
|
124
124
|
# output without coloration
|
@@ -145,6 +145,7 @@ describe "bpm init on a non-existant directory" do
|
|
145
145
|
|
146
146
|
end
|
147
147
|
|
148
|
+
=begin
|
148
149
|
describe "package templates" do
|
149
150
|
|
150
151
|
describe "with custom generator" do
|
@@ -201,5 +202,6 @@ describe "bpm init on a non-existant directory" do
|
|
201
202
|
end
|
202
203
|
|
203
204
|
end
|
205
|
+
=end
|
204
206
|
|
205
207
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.beta.
|
4
|
+
version: 1.0.0.beta.11
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-08-
|
13
|
+
date: 2011-08-04 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: libgems
|
17
|
-
requirement: &
|
17
|
+
requirement: &2151996900 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 0.0.5
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2151996900
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: gemcutter
|
28
|
-
requirement: &
|
28
|
+
requirement: &2152165560 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 0.6.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2152165560
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: highline
|
39
|
-
requirement: &
|
39
|
+
requirement: &2156015900 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 1.6.1
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2156015900
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: json_pure
|
50
|
-
requirement: &
|
50
|
+
requirement: &2156555820 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: 1.4.6
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2156555820
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: thor
|
61
|
-
requirement: &
|
61
|
+
requirement: &2157061380 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: 0.14.3
|
67
67
|
type: :runtime
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *2157061380
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: therubyracer
|
72
|
-
requirement: &
|
72
|
+
requirement: &2157268420 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: 0.9.3beta1
|
78
78
|
type: :runtime
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *2157268420
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: sprockets
|
83
|
-
requirement: &
|
83
|
+
requirement: &2157683060 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ~>
|
@@ -88,10 +88,10 @@ dependencies:
|
|
88
88
|
version: 2.0.0.beta.12
|
89
89
|
type: :runtime
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *2157683060
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: rspec
|
94
|
-
requirement: &
|
94
|
+
requirement: &2158161380 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - ! '>='
|
@@ -99,10 +99,10 @@ dependencies:
|
|
99
99
|
version: '0'
|
100
100
|
type: :development
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
102
|
+
version_requirements: *2158161380
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rack
|
105
|
-
requirement: &
|
105
|
+
requirement: &2158272440 !ruby/object:Gem::Requirement
|
106
106
|
none: false
|
107
107
|
requirements:
|
108
108
|
- - ~>
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
version: 1.2.1
|
111
111
|
type: :development
|
112
112
|
prerelease: false
|
113
|
-
version_requirements: *
|
113
|
+
version_requirements: *2158272440
|
114
114
|
description: Browser Package Manager
|
115
115
|
email:
|
116
116
|
- charles@sproutcore.com
|