bullet_train 1.0.50 β 1.0.53
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/account/users/_oauth.html.erb +2 -0
- data/app/views/account/users/edit.html.erb +1 -2
- data/app/views/layouts/docs.html.erb +6 -0
- data/docs/getting-started.md +1 -1
- data/docs/index.md +1 -0
- data/docs/indirection.md +1 -1
- data/docs/javascript.md +18 -0
- data/docs/permissions.md +1 -1
- data/lib/bullet_train/version.rb +1 -1
- data/lib/bullet_train.rb +8 -5
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07f9ad294898254375ff48a5348d6eb1cc5e4a67b3916b67c2a9948951510a09
|
4
|
+
data.tar.gz: 7b4b57ad229db84f180acabff26a21320891136bff644dfa38e9c44075da1514
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fc988b353bfd0b84f18e5506696402628e321f46ce1cfe0e2ab606c29e0c6a6f20e3be9f5f317ffadc82c8af4f0993fd9a2b1f12481b6eb804a161db3facdca
|
7
|
+
data.tar.gz: a9b1fd87a1017b638b6c3a095cb8d3abbef7e86797f6023791e7f8af111b8889b7623df3f6ab8254adedbf42504967ebd9f72f03e4d12a7c7a8ddcf6515c2f85
|
@@ -23,8 +23,7 @@
|
|
23
23
|
</div>
|
24
24
|
|
25
25
|
<div class="xl:col-span-1 space-y-8">
|
26
|
-
<%= render 'account/oauth
|
27
|
-
<% # π
super scaffolding will insert new oauth providers above this line. %>
|
26
|
+
<%= render 'account/users/oauth' %>
|
28
27
|
|
29
28
|
<%= render 'account/shared/box', divider: true do |p| %>
|
30
29
|
<% p.content_for :title, t('.password.header') %>
|
@@ -104,6 +104,12 @@
|
|
104
104
|
<i class="fal fa-bolt ti ti-bolt"></i>
|
105
105
|
<% end %>
|
106
106
|
<% end %>
|
107
|
+
|
108
|
+
<%= render 'account/shared/menu/item', url: '/docs/javascript', label: 'JavaScript' do |p| %>
|
109
|
+
<% p.content_for :icon do %>
|
110
|
+
<i class="fa-brands fa-js ti ti-pulse"></i>
|
111
|
+
<% end %>
|
112
|
+
<% end %>
|
107
113
|
<% end %>
|
108
114
|
|
109
115
|
<%= render 'account/shared/menu/section', title: 'Developer Tools' do %>
|
data/docs/getting-started.md
CHANGED
@@ -51,5 +51,5 @@ If you're using Bullet Train for the first time, begin by learning these five im
|
|
51
51
|
And then paste any input, e.g.:
|
52
52
|
|
53
53
|
```
|
54
|
-
<!-- BEGIN /Users/andrewculver/.rbenv/versions/3.1.
|
54
|
+
<!-- BEGIN /Users/andrewculver/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/commentary/_box.html.erb -->
|
55
55
|
```
|
data/docs/index.md
CHANGED
@@ -12,6 +12,7 @@
|
|
12
12
|
- [Dealing with Indirection](/docs/indirection.md)
|
13
13
|
- [Overriding the Framework](/docs/overriding.md)
|
14
14
|
- [Setting up a Tunnel](/docs/tunneling.md)
|
15
|
+
- [JavaScript](/docs/javascript.md)
|
15
16
|
|
16
17
|
## Developer Tools
|
17
18
|
- [Super Scaffolding](/docs/super-scaffolding.md)
|
data/docs/indirection.md
CHANGED
@@ -35,7 +35,7 @@ bin/resolve shared/box
|
|
35
35
|
If you're looking at a rendered view in the browser, it can be hard to know which file to open in order to make a change. To help, Bullet Train enables `config.action_view.annotate_rendered_view_with_filenames` by default, so you can right click on any element you see, select "Inspect Element", and you'll see comments in the HTML source telling you which file is powering a particular portion of the view, like this:
|
36
36
|
|
37
37
|
```
|
38
|
-
<!-- BEGIN /Users/andrewculver/.rbenv/versions/3.1.
|
38
|
+
<!-- BEGIN /Users/andrewculver/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/workflow/_box.html.erb -->
|
39
39
|
```
|
40
40
|
|
41
41
|
Note that in the example above, the view in question isn't actually coming from the application repository. Instead, it's being included from the `bullet_train-themes-light` package. For instructions on how to customize it, see [Overriding Framework Defaults](/docs/overriding.md).
|
data/docs/javascript.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# JavaScript
|
2
|
+
Bullet Train leans into the use of [Stimulus](https://stimulus.hotwired.dev) for custom JavaScript. If you haven't read it previously, [the original introductory blog post for Stimulus from 2018](https://medium.com/signal-v-noise/stimulus-1-0-a-modest-javascript-framework-for-the-html-you-already-have-f04307009130) was groundbreaking in its time, and we still consider it required reading for understanding the philosophy of JavaScript in Bullet Train.
|
3
|
+
|
4
|
+
## Writing Custom JavaScript
|
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.
|
6
|
+
|
7
|
+
## npm Packages
|
8
|
+
npm packages are managed by [Yarn](https://yarnpkg.com) and any required importing can be done in `app/javascript/application.js`.
|
9
|
+
|
10
|
+
## Compilation
|
11
|
+
Bullet Train uses [esbuild](https://esbuild.github.io) to compile all local JavaScript and npm package dependencies. If you haven't used esbuild before, it's blazing fast compared to older options like Webpack. Honestly, it makes JavaScript development and deployment in complex applications a joy again, in a way it hasn't been for years.
|
12
|
+
|
13
|
+
In development, the esbuild process that compiles JavaScript is defined as `yarn build` in `package.json`. This script also has an entry in `Procfile.dev`, so it runs automatically when you start your application with `bin/dev`, and when run in this context, it watches the filesystem and automatically recompiles anytime JavaScript files change on disk.
|
14
|
+
|
15
|
+
The resulting JavaScript bundle is output to the `app/assets/builds` directory where it is picked up by the traditional Rails asset pipeline. This directory is listed in `.gitignore`, so the compiled bundles are never committed to the repository.
|
16
|
+
|
17
|
+
## React, Vue.js, etc.
|
18
|
+
We're not against the use of front-end JavaScript frameworks in the specific contexts where they're the best tool for the job, but we solidly subscribe to the "heavy machinery" philosophy put forward in [that original Stimulus blog post](https://medium.com/signal-v-noise/stimulus-1-0-a-modest-javascript-framework-for-the-html-you-already-have-f04307009130), and have no interest in actually supporting them.
|
data/docs/permissions.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
Bullet Train leans heavily on [CanCanCan](https://github.com/CanCanCommunity/cancancan) for implementing authorization and permissions. (Weβre also proud sponsors of its ongoing maintenance.) The original CanCan library by Ryan Bates was, in our opinion, a masterpiece and a software engineering marvel that has stood the test of time. It's truly a diamond among Ruby Gems. If you're not already familiar with CanCanCan, you should [read its documentation](https://github.com/CanCanCommunity/cancancan) to get familiar with its features and DSL.
|
5
5
|
|
6
6
|
## Bullet Train Roles
|
7
|
-
Over many years of successfully implementing applications with CanCanCan, it became apparent to us that a supplemental level of abstraction could help streamline and simplify the definition of many common permissions, especially in large applications. We've since extracted this functionality into [a standalone Ruby Gem](https://github.com/bullet-train-co/bullet_train-roles) and moved the documentation that used to be here into [the README for that project](https://github.com/bullet-train-co/bullet_train-roles
|
7
|
+
Over many years of successfully implementing applications with CanCanCan, it became apparent to us that a supplemental level of abstraction could help streamline and simplify the definition of many common permissions, especially in large applications. We've since extracted this functionality into [a standalone Ruby Gem](https://github.com/bullet-train-co/bullet_train-roles) and moved the documentation that used to be here into [the README for that project](https://github.com/bullet-train-co/bullet_train-roles). Should you encounter situations where this abstraction doesn't meet your specific needs, you can always implement the permissions you need using standard CanCanCan directives in `app/models/ability.rb`.
|
8
8
|
|
9
9
|
## Additional Notes
|
10
10
|
|
data/lib/bullet_train/version.rb
CHANGED
data/lib/bullet_train.rb
CHANGED
@@ -97,11 +97,14 @@ def two_factor_authentication_enabled?
|
|
97
97
|
ENV["TWO_FACTOR_ENCRYPTION_KEY"].present?
|
98
98
|
end
|
99
99
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
100
|
+
# Don't redefine this if an application redefines it locally.
|
101
|
+
unless defined?(any_oauth_enabled?)
|
102
|
+
def any_oauth_enabled?
|
103
|
+
[
|
104
|
+
stripe_enabled?,
|
105
|
+
# π
super scaffolding will insert new oauth provider checks above this line.
|
106
|
+
].select(&:present?).any?
|
107
|
+
end
|
105
108
|
end
|
106
109
|
|
107
110
|
def invitation_only?
|
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.
|
4
|
+
version: 1.0.53
|
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-
|
11
|
+
date: 2022-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|
@@ -490,6 +490,7 @@ files:
|
|
490
490
|
- app/views/account/users/_breadcrumbs.html.erb
|
491
491
|
- app/views/account/users/_fields.html.erb
|
492
492
|
- app/views/account/users/_form.html.erb
|
493
|
+
- app/views/account/users/_oauth.html.erb
|
493
494
|
- app/views/account/users/edit.html.erb
|
494
495
|
- app/views/account/users/show.html.erb
|
495
496
|
- app/views/bullet_train/partial_resolver.html.erb
|
@@ -575,6 +576,7 @@ files:
|
|
575
576
|
- docs/i18n.md
|
576
577
|
- docs/index.md
|
577
578
|
- docs/indirection.md
|
579
|
+
- docs/javascript.md
|
578
580
|
- docs/modeling.md
|
579
581
|
- docs/namespacing.md
|
580
582
|
- docs/oauth.md
|