bullet_train 1.0.60 → 1.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a31a2c2246fb6f2d9e82e21d6e2a54677c659004925e6a0e05362049784821f
4
- data.tar.gz: 209e1be3698752408c23ccceedd74aabcb15d7d67bc418fed0bcca0ab27a2853
3
+ metadata.gz: '05088afc4affaa18a3a6f9be10681fde1f5b8bd1c68705d21278d39a2bce81e1'
4
+ data.tar.gz: ed81fa3a64317c4229c7e46023f89651836f907f75b6ac1b89450ed56fed9aaf
5
5
  SHA512:
6
- metadata.gz: 01e2fda3d6f57bc96e8f45fac0eda8b32b18384d3af0c15909791b8c97611ffd8c1e4fe998b91b33c687835a68a0063d4d64d53bd278bc025bd935f351c78445
7
- data.tar.gz: f5a8ff518213dc2b9e16c02996e04da2e0a73db51f24021bef3ad6d2d364b36352bbb88f91b69823286d18c46d77f22d8792e5a761d8647e4e2ebaf63b7d498a
6
+ metadata.gz: d1f4dabd1bd84467e2fdb2fa5bfdd4a9e51eabeccf01a547dada961e1c70f079ac589c980241afeabb27752fa1cd5e079c77a6d343177b22bda5f0058aad21be
7
+ data.tar.gz: d37c6cd6b9a3ca59b36b084d594c2979b7ef44c2e6bf1c4b7682ca18260ab502e034dfbcb44c45378b97bed2eeccdef581519d00acfc02f5d10637ddf6f1277f
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.60"
2
+ VERSION = "1.0.63"
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: "bullet-train-co/bullet_train-base",
83
+ npm: "@bullet-train/bullet-train"
84
+ },
85
+ "bullet_train-api" => {
86
+ git: "bullet-train-co/bullet_train-api",
87
+ },
88
+ "bullet_train-fields" => {
89
+ git: "bullet-train-co/bullet_train-fields",
90
+ npm: "@bullet-train/fields"
91
+ },
92
+ "bullet_train-has_uuid" => {
93
+ git: "bullet-train-co/bullet_train-has_uuid",
94
+ },
95
+ "bullet_train-incoming_webhooks" => {
96
+ git: "bullet-train-co/bullet_train-incoming_webhooks",
97
+ },
98
+ "bullet_train-integrations" => {
99
+ git: "bullet-train-co/bullet_train-integrations",
100
+ },
101
+ "bullet_train-integrations-stripe" => {
102
+ git: "bullet-train-co/bullet_train-base-integrations-stripe",
103
+ },
104
+ "bullet_train-obfuscates_id" => {
105
+ git: "bullet-train-co/bullet_train-obfuscates_id",
106
+ },
107
+ "bullet_train-outgoing_webhooks" => {
108
+ git: "bullet-train-co/bullet_train-outgoing_webhooks",
109
+ },
110
+ "bullet_train-outgoing_webhooks-core" => {
111
+ git: "bullet-train-co/bullet_train-outgoing_webhooks-core",
112
+ },
113
+ "bullet_train-scope_questions" => {
114
+ git: "bullet-train-co/bullet_train-scope_questions",
115
+ },
116
+ "bullet_train-scope_validator" => {
117
+ git: "bullet-train-co/bullet_train-scope_validator",
118
+ },
119
+ "bullet_train-sortable" => {
120
+ git: "bullet-train-co/bullet_train-sortable",
121
+ npm: "@bullet-train/bullet-train-sortable"
122
+ },
123
+ "bullet_train-super_scaffolding" => {
124
+ git: "bullet-train-co/bullet_train-super_scaffolding",
125
+ },
126
+ "bullet_train-super_load_and_authorize_resource" => {
127
+ git: "bullet-train-co/bullet_train-super_load_and_authorize_resource",
128
+ },
129
+ "bullet_train-themes" => {
130
+ git: "bullet-train-co/bullet_train-themes",
131
+ },
132
+ "bullet_train-themes-base" => {
133
+ git: "bullet-train-co/bullet_train-themes-base",
134
+ },
135
+ "bullet_train-themes-light" => {
136
+ git: "bullet-train-co/bullet_train-themes-light",
137
+ },
138
+ "bullet_train-themes-tailwind_css" => {
139
+ git: "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 git@github.com:#{details[:git]}.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 && npx yalc link && cd ../.. && npx yalc 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 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.60
4
+ version: 1.0.63
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-06 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