bullet_train 1.19.1 → 1.20.0
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 +4 -4
- data/docs/billing/stripe.md +1 -1
- data/docs/field-partials/options.md +1 -0
- data/docs/field-partials.md +22 -21
- data/docs/javascript.md +26 -1
- data/docs/trademark.md +1 -1
- data/docs/upgrades.md +1 -1
- data/lib/bullet_train/resolver.rb +2 -2
- data/lib/bullet_train/version.rb +1 -1
- data/lib/tasks/bullet_train_tasks.rake +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19a424300ea4463b1cd40cd375f81a9783a643a685f532ce54ef7ece2509850b
|
4
|
+
data.tar.gz: cacee499473769cf2fb7ec70bbc5adf23b762d7b15bbdd2535bfb1c4dc01e9ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cc3b2cdecd60971309399675842e3c06266a2d4b6687bcdf88d93955cf776d1d8b78968a13240edf16a9ee34e6163baf843083701f6062eb16e25f758ad2a76
|
7
|
+
data.tar.gz: '083b5681eda4de9d756d2c7ab81a51c5f684833bb641308dfe34bc051c853d9db70fde0fbbdab0da3d55a76625f4d7fba8503136aaf959b54027e8f90177c5fc'
|
data/docs/billing/stripe.md
CHANGED
@@ -290,4 +290,4 @@ As mentioned earlier, all of the links we provided for configuration steps on St
|
|
290
290
|
|
291
291
|
## 10. You should be done!
|
292
292
|
|
293
|
-
[Let us know on Discord](
|
293
|
+
[Let us know on Discord](https://discord.gg/gmfybM8kA6) if any part of this guide was not clear or could be improved!
|
@@ -52,3 +52,4 @@ Most of the field partials have a native Rails form helper working underneath. P
|
|
52
52
|
| `text_field` | [text_field](https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-text_field) |
|
53
53
|
| `number_field` | [number_field](https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-number_field) |
|
54
54
|
| `trix_editor` | [rich_text_editor](https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-rich_text_area) |
|
55
|
+
| `code_editor` | [text_area](https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-text_area) |
|
data/docs/field-partials.md
CHANGED
@@ -142,27 +142,28 @@ Certain form field partials like `buttons` and `super_select` can also have thei
|
|
142
142
|
|
143
143
|
## Available Field Partials
|
144
144
|
|
145
|
-
| Field Partial | Data Type | Multiple Values? | Assignment Helpers | JavaScript Library | Description
|
146
|
-
|
147
|
-
| [`address_field`](/docs/field-partials/address-field.md) | `Address` | | | | Adds a block of address fields. On change, its country super-select auto-updates the state/province/region super-select and postal/zip code field label.
|
148
|
-
| `boolean` | `boolean` | | `assign_boolean` | |
|
149
|
-
| [`buttons`](/docs/field-partials/buttons.md) | `string` | Optionally | `assign_checkboxes` | |
|
150
|
-
| `checkbox` | `boolean` | | `assign_boolean` | |
|
151
|
-
| `image` | `string` or `attachment`* | | | |
|
152
|
-
| `color_picker` | `string` | | | [pickr](https://simonwep.github.io/pickr/) |
|
153
|
-
| `date_and_time_field` | `datetime` | | | [Date Range Picker](https://www.daterangepicker.com) |
|
154
|
-
| `date_field` | `date` | | | [Date Range Picker](https://www.daterangepicker.com) |
|
155
|
-
| `email_field` | `string` | | | |
|
156
|
-
| `emoji_field` | `string` | | | [Emoji Mart](https://missiveapp.com/open/emoji-mart) | A front-end library which allows users to browse and select emojis with ease. |
|
157
|
-
| [`file_field`](/docs/field-partials/file-field.md) | `attachment` | | | [Active Storage](https://edgeguides.rubyonrails.org/active_storage_overview.html) |
|
158
|
-
| `options` | `string` | Optionally | `assign_checkboxes` | |
|
159
|
-
| `password_field` | `string` | | | |
|
160
|
-
| `phone_field` | `string` | | | [International Telephone Input](https://intl-tel-input.com) | Ensures telephone numbers are in a format that can be used by providers like Twilio.
|
161
|
-
| [`super_select`](/docs/field-partials/super-select.md) | `string` | Optionally | `assign_select_options` | [Select2](https://select2.org) | Provides powerful option search, AJAX search, and multi-select functionality.
|
162
|
-
| `text_area` | `text` | | | |
|
163
|
-
| `text_field` | `string` | | | |
|
164
|
-
| `number_field` | `integer` | | | |
|
165
|
-
| `trix_editor` | `text` | | | [Trix](https://github.com/basecamp/trix) | Basic HTML-powered formatting features and support for at-mentions amongst team members.
|
145
|
+
| Field Partial | Data Type | Multiple Values? | Assignment Helpers | JavaScript Library | Description |
|
146
|
+
|----------------------------------------------------------|---------------------------|------------------|-------------------------|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
147
|
+
| [`address_field`](/docs/field-partials/address-field.md) | `Address` | | | | Adds a block of address fields. On change, its country super-select auto-updates the state/province/region super-select and postal/zip code field label. |
|
148
|
+
| `boolean` | `boolean` | | `assign_boolean` | | |
|
149
|
+
| [`buttons`](/docs/field-partials/buttons.md) | `string` | Optionally | `assign_checkboxes` | | |
|
150
|
+
| `checkbox` | `boolean` | | `assign_boolean` | | |
|
151
|
+
| `image` | `string` or `attachment`* | | | | |
|
152
|
+
| `color_picker` | `string` | | | [pickr](https://simonwep.github.io/pickr/) | |
|
153
|
+
| `date_and_time_field` | `datetime` | | | [Date Range Picker](https://www.daterangepicker.com) | |
|
154
|
+
| `date_field` | `date` | | | [Date Range Picker](https://www.daterangepicker.com) | |
|
155
|
+
| `email_field` | `string` | | | | |
|
156
|
+
| `emoji_field` | `string` | | | [Emoji Mart](https://missiveapp.com/open/emoji-mart) | A front-end library which allows users to browse and select emojis with ease. | |
|
157
|
+
| [`file_field`](/docs/field-partials/file-field.md) | `attachment` | | | [Active Storage](https://edgeguides.rubyonrails.org/active_storage_overview.html) | |
|
158
|
+
| `options` | `string` | Optionally | `assign_checkboxes` | | |
|
159
|
+
| `password_field` | `string` | | | | |
|
160
|
+
| `phone_field` | `string` | | | [International Telephone Input](https://intl-tel-input.com) | Ensures telephone numbers are in a format that can be used by providers like Twilio. |
|
161
|
+
| [`super_select`](/docs/field-partials/super-select.md) | `string` | Optionally | `assign_select_options` | [Select2](https://select2.org) | Provides powerful option search, AJAX search, and multi-select functionality. |
|
162
|
+
| `text_area` | `text` | | | | |
|
163
|
+
| `text_field` | `string` | | | | |
|
164
|
+
| `number_field` | `integer` | | | | |
|
165
|
+
| `trix_editor` | `text` | | | [Trix](https://github.com/basecamp/trix) | Basic HTML-powered formatting features and support for at-mentions amongst team members. |
|
166
|
+
| `code_editor` | `text` | | | [Monaco](https://microsoft.github.io/monaco-editor/) | A powerful code editor supporting multiple coding languages (see [languages available by default](https://github.com/microsoft/monaco-editor/tree/main/src/basic-languages)). |
|
166
167
|
|
167
168
|
* The data type for `image` fields will vary based on whether you're using Cloudinary or ActiveStorage.
|
168
169
|
For Cloudinary you should use `string`, and for ActiveStorage you should use `attachment`.
|
data/docs/javascript.md
CHANGED
@@ -4,6 +4,31 @@ Bullet Train leans into the use of [Stimulus](https://stimulus.hotwired.dev) for
|
|
4
4
|
## Writing Custom JavaScript
|
5
5
|
The happy path for writing new custom JavaScript is to [write it as a Stimulus controller](https://stimulus.hotwired.dev/handbook/building-something-real) in `app/javascript/controllers` and invoke it by augmenting the HTML in your views. If you name the file `*_controller.js`, it will be automatically picked up and compiled as part of your application's JavaScript bundle. Be careful to [avoid adding scripts to the body of your pages (see below)](#avoid-scripts-in-the-body).
|
6
6
|
|
7
|
+
## Overriding BulletTrain Stimulus Controllers
|
8
|
+
|
9
|
+
If you need to slightly tweak the behavior of the built-in Bullet Train Stimulus controllers you can do it easily.
|
10
|
+
|
11
|
+
Let's say you want to alter the SuperSelectController.
|
12
|
+
|
13
|
+
First create a file at: `app/javascript/controllers/fields/super_select_controller.js`
|
14
|
+
|
15
|
+
And then update that controller to first `import` the BT controller that you want to override,
|
16
|
+
and then `export` a class that `extends` the controller that you just imported.
|
17
|
+
|
18
|
+
For example, this will make it so that the BT Super Select controller will log a line to the console
|
19
|
+
every time that `connect` is called:
|
20
|
+
|
21
|
+
```javascript
|
22
|
+
import { SuperSelectController } from '@bullet-train/fields'
|
23
|
+
|
24
|
+
export default class extends SuperSelectController {
|
25
|
+
connect() {
|
26
|
+
console.log('super_select_controller connected')
|
27
|
+
super.connect()
|
28
|
+
}
|
29
|
+
}
|
30
|
+
```
|
31
|
+
|
7
32
|
## npm Packages
|
8
33
|
npm packages are managed by [Yarn](https://yarnpkg.com) and any required importing can be done in `app/javascript/application.js`.
|
9
34
|
|
@@ -53,4 +78,4 @@ If you experience slow Turbo interactions, check for script tags in the body of
|
|
53
78
|
<head>
|
54
79
|
<script src="third-party-tracker.js" defer></script>
|
55
80
|
</head>
|
56
|
-
```
|
81
|
+
```
|
data/docs/trademark.md
CHANGED
@@ -22,4 +22,4 @@ Here are some examples that would require explicit permission:
|
|
22
22
|
- "Bullet Train Conference"
|
23
23
|
- "Bullet Train Podcast"
|
24
24
|
|
25
|
-
If you've got an idea and aren't sure about the name, message Andrew Culver privately [on Discord](https://discord.gg/
|
25
|
+
If you've got an idea and aren't sure about the name, message Andrew Culver privately [on Discord](https://discord.gg/gmfybM8kA6) or [via Twitter DM](https://twitter.com/andrewculver). If you know anything about trademarks, you know we're required to enforce our policies, so thank you for understanding! 🙏
|
data/docs/upgrades.md
CHANGED
@@ -120,7 +120,7 @@ git merge v1.4.1
|
|
120
120
|
It's quite possible you'll get some merge conflicts at this point. No big deal! Just go through and
|
121
121
|
resolve them like you would if you were integrating code from another developer on your team. We tend
|
122
122
|
to comment our code heavily, but if you have any questions about the code you're trying to understand,
|
123
|
-
let us know on [Discord!](https://discord.gg/
|
123
|
+
let us know on [Discord!](https://discord.gg/gmfybM8kA6)
|
124
124
|
|
125
125
|
One of the files that's likely to have conflicts, and which can be the most frustrating to resolve is
|
126
126
|
`Gemfile.lock`. You can try to sort it out by hand, or you can checkout a clean copy and then let bundler
|
@@ -53,7 +53,7 @@ module BulletTrain
|
|
53
53
|
else
|
54
54
|
`mkdir -p #{source_file[:project_path].split("/")[0...-1].join("/")}`
|
55
55
|
puts "Ejecting `#{source_file[:absolute_path]}` to `#{source_file[:project_path]}`".green
|
56
|
-
File.open(
|
56
|
+
File.open(source_file[:project_path].to_s, "w+") do |file|
|
57
57
|
case source_file[:project_path].split(".").last
|
58
58
|
when "rb", "yml"
|
59
59
|
file.puts "# Ejected from `#{source_file[:relative_path] || source_file[:package_name]}`.\n\n"
|
@@ -95,7 +95,7 @@ module BulletTrain
|
|
95
95
|
end
|
96
96
|
|
97
97
|
if open
|
98
|
-
path = source_file[:package_name] ? source_file[:absolute_path] :
|
98
|
+
path = source_file[:package_name] ? source_file[:absolute_path] : source_file[:project_path].to_s
|
99
99
|
puts "Opening `#{path}`.\n".green
|
100
100
|
|
101
101
|
# TODO: Use TerminalCommands to open this file
|
data/lib/bullet_train/version.rb
CHANGED
@@ -231,7 +231,9 @@ namespace :bullet_train do
|
|
231
231
|
puts "Run `bin/hack --watch-js` to see which other npm packages you can watch.".blue
|
232
232
|
puts "When you're done, you can hit <Control + C> and we'll clean all off this up.".blue
|
233
233
|
puts ""
|
234
|
-
|
234
|
+
# TODO: On this next line we're disabling standard for now. We should circle back and remove the comment
|
235
|
+
# that disables standard and then try the recommendation that it makes. And test it to make sure it works.
|
236
|
+
bt_package = framework_packages.select { |k, v| k == :bullet_train } # standard:disable Style/HashSlice
|
235
237
|
set_npm_package("--watch-js", bt_package)
|
236
238
|
|
237
239
|
puts ""
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: standard
|
@@ -678,7 +678,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
678
678
|
- !ruby/object:Gem::Version
|
679
679
|
version: '0'
|
680
680
|
requirements: []
|
681
|
-
rubygems_version: 3.6.
|
681
|
+
rubygems_version: 3.6.7
|
682
682
|
specification_version: 4
|
683
683
|
summary: Bullet Train
|
684
684
|
test_files: []
|