bullet_train 1.0.59 ā†’ 1.0.62

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e225ef758a613ea94fab2eda36d525fc45b0f2ba653738e19a2aea46e052986d
4
- data.tar.gz: baaec7829142167aa347ee70492fe1296ad47786247338e40eb112a07416149b
3
+ metadata.gz: 188f9aba4071a8ef1db98f58161fa6de1a628a14aac6d014603d4f26b8329485
4
+ data.tar.gz: 89634b98cbf891e2abdab6aa7402981ce84baafcf4856232e1d7c71ce0bcd528
5
5
  SHA512:
6
- metadata.gz: 9979e0d2bf28ff5ac16e87050a05ba5367735dd7b59712c028ee4a81073c692b6fd42e6ad1815ed89086d528774adcb711fe8b65fec375e578f6545ee626dc5d
7
- data.tar.gz: b0651097134d46b506eecb3564c1ac0c083f61cf67a14c80215e3a0bdfd26a2abee89f9e66b9da83d66a590584076179687ad3b5723d2edfbb4f2297dcbfb846
6
+ metadata.gz: 0c8f25a33a221d65680d5617bf28b2d2ebb136576a193075664ad37704675ebf31f98b60eceeb923835ebec208a49ba973aaa63964a0bd401e250768cf2b73c0
7
+ data.tar.gz: 350ab842c7f67119fe65ffc1cc80e03e354bd00ad45187b4fdd722f5439fbb56d0a507187c6c619859397c06b1b3c531e2edad43dfad4fd955e5054fd1cf7625
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.59"
2
+ VERSION = "1.0.62"
3
3
  end
@@ -56,4 +56,178 @@ namespace :bullet_train do
56
56
  warn "\nšŸš… Usage: `bin/resolve [path, partial, or URL] (--eject) (--open)`\n".blue
57
57
  end
58
58
  end
59
+
60
+ task :develop, [:all_options] => :environment do |t, arguments|
61
+ def stream(command, prefix = " ")
62
+ puts ""
63
+
64
+ begin
65
+ trap("SIGINT") { throw :ctrl_c }
66
+
67
+ IO.popen(command) do |io|
68
+ while (line = io.gets)
69
+ puts "#{prefix}#{line}"
70
+ end
71
+ end
72
+ rescue UncaughtThrowError
73
+ puts "Received a <Control + C>. Exiting the child process.".blue
74
+ end
75
+
76
+ puts ""
77
+ end
78
+
79
+ # TODO Extract this into a YAML file.
80
+ framework_packages = {
81
+ "bullet_train" => {
82
+ git: "https://github.com/bullet-train-co/bullet_train-base",
83
+ npm: "@bullet-train/bullet-train"
84
+ },
85
+ "bullet_train-api" => {
86
+ git: "https://github.com/bullet-train-co/bullet_train-api",
87
+ },
88
+ "bullet_train-fields" => {
89
+ git: "https://github.com/bullet-train-co/bullet_train-fields",
90
+ npm: "@bullet-train/fields"
91
+ },
92
+ "bullet_train-has_uuid" => {
93
+ git: "https://github.com/bullet-train-co/bullet_train-has_uuid",
94
+ },
95
+ "bullet_train-incoming_webhooks" => {
96
+ git: "https://github.com/bullet-train-co/bullet_train-incoming_webhooks",
97
+ },
98
+ "bullet_train-integrations" => {
99
+ git: "https://github.com/bullet-train-co/bullet_train-integrations",
100
+ },
101
+ "bullet_train-integrations-stripe" => {
102
+ git: "https://github.com/bullet-train-co/bullet_train-base-integrations-stripe",
103
+ },
104
+ "bullet_train-obfuscates_id" => {
105
+ git: "https://github.com/bullet-train-co/bullet_train-obfuscates_id",
106
+ },
107
+ "bullet_train-outgoing_webhooks" => {
108
+ git: "https://github.com/bullet-train-co/bullet_train-outgoing_webhooks",
109
+ },
110
+ "bullet_train-outgoing_webhooks-core" => {
111
+ git: "https://github.com/bullet-train-co/bullet_train-outgoing_webhooks-core",
112
+ },
113
+ "bullet_train-scope_questions" => {
114
+ git: "https://github.com/bullet-train-co/bullet_train-scope_questions",
115
+ },
116
+ "bullet_train-scope_validator" => {
117
+ git: "https://github.com/bullet-train-co/bullet_train-scope_validator",
118
+ },
119
+ "bullet_train-sortable" => {
120
+ git: "https://github.com/bullet-train-co/bullet_train-sortable",
121
+ npm: "@bullet-train/bullet-train-sortable"
122
+ },
123
+ "bullet_train-super_scaffolding" => {
124
+ git: "https://github.com/bullet-train-co/bullet_train-super_scaffolding",
125
+ },
126
+ "bullet_train-super_load_and_authorize_resource" => {
127
+ git: "https://github.com/bullet-train-co/bullet_train-super_load_and_authorize_resource",
128
+ },
129
+ "bullet_train-themes" => {
130
+ git: "https://github.com/bullet-train-co/bullet_train-themes",
131
+ },
132
+ "bullet_train-themes-base" => {
133
+ git: "https://github.com/bullet-train-co/bullet_train-themes-base",
134
+ },
135
+ "bullet_train-themes-light" => {
136
+ git: "https://github.com/bullet-train-co/bullet_train-themes-light",
137
+ },
138
+ "bullet_train-themes-tailwind_css" => {
139
+ git: "https://github.com/bullet-train-co/bullet_train-themes-tailwind_css",
140
+ },
141
+ }
142
+
143
+ puts "Which framework package do you want to work on?".blue
144
+ puts ""
145
+ framework_packages.each do |gem, details|
146
+ puts " #{framework_packages.keys.find_index(gem) + 1}. #{gem}".blue
147
+ end
148
+ puts ""
149
+ puts "Enter a number below and hit <Enter>:".blue
150
+ number = $stdin.gets.chomp
151
+
152
+ gem = framework_packages.keys[number.to_i - 1]
153
+
154
+ if gem
155
+ details = framework_packages[gem]
156
+
157
+ puts "OK! Let's work on `#{gem}` together!".green
158
+ puts ""
159
+ puts "First, we're going to clone a copy of the package repository.".blue
160
+
161
+ # TODO Prompt whether they want to check out their own forked version of the repository.
162
+
163
+ if File.exist?("local/#{gem}")
164
+ puts "Can't clone into `local/#{gem}` because it already exists. We will try to use what's already there.".yellow
165
+ puts "However, it will be up to you to make sure that working copy of the repository is in a clean state and checked out to the `main` branch or whatever you want to work on.".yellow
166
+ puts "Hit <Enter> to continue.".blue
167
+ $stdin.gets
168
+
169
+ # TODO We should check whether the local copy is in a clean state, and if it is, check out `main`.
170
+ # TODO We should also pull `origin/main` to make sure we're on the most up-to-date version of the package.
171
+ else
172
+ stream "git clone #{details[:git]} local/#{gem}"
173
+ end
174
+
175
+ # TODO Ask them whether they want to check out a specific branch to work on. (List available remote branches.)
176
+
177
+ puts ""
178
+ puts "Now we'll try to link up that repository in the `Gemfile`.".blue
179
+ if `cat Gemfile | grep "gem \\\"#{gem}\\\", path: \\\"local/#{gem}\\\""`.chomp.present?
180
+ puts "This gem is already linked to a checked out copy in `local` in the `Gemfile`.".green
181
+ elsif `cat Gemfile | grep "gem \\\"#{gem}\\\","`.chomp.present?
182
+ puts "This gem already has some sort of alternative source configured in the `Gemfile`.".yellow
183
+ puts "We can't do anything with this. Sorry! We'll proceed, but you have to link this package yourself.".red
184
+ elsif `cat Gemfile | grep "gem \\\"#{gem}\\\""`.chomp.present?
185
+ puts "This gem is directly present in the `Gemfile`, so we'll update that line.".green
186
+
187
+ text = File.read("Gemfile")
188
+ new_contents = text.gsub(/gem "#{gem}"/, "gem \"#{gem}\", path: \"local/#{gem}\"")
189
+ File.open("Gemfile", "w") { |file| file.puts new_contents }
190
+ else
191
+ puts "This gem isn't directly present in the `Gemfile`, so we'll add it temporarily.".green
192
+ File.open("Gemfile", "a+") { |file|
193
+ file.puts
194
+ file.puts "gem \"#{gem}\", path: \"local/#{gem}\" # Added by \`bin/develop\`."
195
+ }
196
+ end
197
+
198
+ puts ""
199
+ puts "Now we'll run `bundle install`.".blue
200
+ stream "bundle install"
201
+
202
+ puts ""
203
+ puts "We'll restart any running Rails server now.".blue
204
+ stream "rails restart"
205
+
206
+ puts ""
207
+ puts "OK, we're opening that package in your IDE, `#{ENV["IDE"] || "code"}`. (You can configure this with `export IDE=whatever`.)".blue
208
+ `#{ENV["IDE"] || "code"} local/#{gem}`
209
+
210
+ puts ""
211
+ if details[:npm]
212
+ puts "This package also has an npm package, so we'll link that up as well.".blue
213
+ stream "cd local/#{gem} && yarn install && yarn link && cd ../.. && yarn link \"#{details[:npm]}\""
214
+
215
+ puts ""
216
+ puts "And now we're going to watch for any changes you make to the JavaScript and recompile as we go.".blue
217
+ puts "When you're done, you can hit <Control + C> and we'll clean all off this up.".blue
218
+ stream "cd local/#{gem} && yarn build --watch"
219
+ else
220
+ puts "This package has no npm package, so we'll just hang out here and do nothing. However, when you hit <Enter> here, we'll start the process of cleaning all of this up.".blue
221
+ $stdin.gets
222
+ end
223
+
224
+ puts ""
225
+ puts "OK, here's a list of things this script still doesn't do you for you:".yellow
226
+ puts "1. It doesn't clean up the repository that was cloned into `local`.".yellow
227
+ puts "2. Unless you remove it, it won't update that repository the next time you link to it.".yellow
228
+ else
229
+ puts ""
230
+ puts "Invalid option, \"#{number}\". Try again.".red
231
+ end
232
+ end
59
233
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.59
4
+ version: 1.0.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-30 00:00:00.000000000 Z
11
+ date: 2022-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -634,7 +634,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
634
634
  - !ruby/object:Gem::Version
635
635
  version: '0'
636
636
  requirements: []
637
- rubygems_version: 3.2.32
637
+ rubygems_version: 3.3.7
638
638
  signing_key:
639
639
  specification_version: 4
640
640
  summary: Bullet Train