bullet_train 1.0.49 β†’ 1.0.52

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: 19e5c8305a3e7ce83247284b23e76be08322536689153e4a1cf7befef4acde70
4
- data.tar.gz: 89eb7c47e0373d460be3112c7b908297f59e68e9987a8465940403d64aa6a841
3
+ metadata.gz: 1684991a84caecbd6443e86aee17ac146ff70e71bec64607205e3266642c7af5
4
+ data.tar.gz: 9e00e826c90b30ac09e5daf147b0d10e29e036ff29b039f321a6c9de04441936
5
5
  SHA512:
6
- metadata.gz: 256d4903dc195d2bbd353f8b5baa9c0d5bfad13a45f3e7a6414ee098e2cc8864d18dcd7f37ad6804709e41daa226c1d4632f64d0275e1a2d780e953c3e1d3cac
7
- data.tar.gz: 81e6a40fc87106333eb12dfc97de853ed1ec342d8f5e2889791cc2a9043a1ff641f1bf5055f6633121ec0043a31ab3ebfb10999322072d277a410354b134ed31
6
+ metadata.gz: 44d566105ccc88677771b87a23e0fd11b9ac8548bff4d6a26bed538a5ac94fdb57bfde0c0f8222fded9afbcf7c3d6de5e2bf04f8b7603eb9c92507ebd529bb36
7
+ data.tar.gz: b72dfdb3f0369bf6829ba8e47bddf50781bd33e39ac21f877923b389cb2fb690572f479107eaa83e120fd88dcfdd240e7cd18ad7ed18f42b98f87d5a79e46ced
@@ -0,0 +1,2 @@
1
+ <%= render 'account/oauth/stripe_accounts/index', context: @user, stripe_accounts: @user.oauth_stripe_accounts if stripe_enabled? %>
2
+ <% # πŸš… super scaffolding will insert new oauth providers above this line. %>
@@ -23,8 +23,7 @@
23
23
  </div>
24
24
 
25
25
  <div class="xl:col-span-1 space-y-8">
26
- <%= render 'account/oauth/stripe_accounts/index', context: @user, stripe_accounts: @user.oauth_stripe_accounts if stripe_enabled? %>
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 %>
@@ -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.1/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/commentary/_box.html.erb -->
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.1/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/workflow/_box.html.erb -->
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).
@@ -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 already, we consider [the original introductory blog post for Stimulus](https://medium.com/signal-v-noise/stimulus-1-0-a-modest-javascript-framework-for-the-html-you-already-have-f04307009130) to be a seminal work in the Rails ecosystem and 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 [the 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/blob/main/README.md). 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`.
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
 
@@ -23,7 +23,7 @@ Bullet Train's Super Scaffolding engine is a unique approach to code generation,
23
23
 
24
24
  ## Prerequisites
25
25
 
26
- Before getting started with Super Scaffolding, we recommend reading about [the philosophy of domain modeling in Bullet Train](/docs/topics/domain-modeling.md).
26
+ Before getting started with Super Scaffolding, we recommend reading about [the philosophy of domain modeling in Bullet Train](/docs/modeling.md).
27
27
 
28
28
  ## Usage
29
29
 
@@ -0,0 +1,18 @@
1
+ require "unicode/emoji"
2
+
3
+ module BulletTrain
4
+ module CoreExt
5
+ module StringEmojiHelper
6
+ def strip_emojis
7
+ gsub(Unicode::Emoji::REGEX, "")
8
+ end
9
+
10
+ def only_emoji?
11
+ return false if strip.empty?
12
+ strip_emojis.strip.empty?
13
+ end
14
+ end
15
+ end
16
+ end
17
+
18
+ String.include(BulletTrain::CoreExt::StringEmojiHelper)
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.49"
2
+ VERSION = "1.0.52"
3
3
  end
data/lib/bullet_train.rb CHANGED
@@ -9,7 +9,7 @@ require "bullet_train/has_uuid"
9
9
  require "bullet_train/scope_validator"
10
10
 
11
11
  require "colorizer"
12
- require "string/emoji"
12
+ require "bullet_train/core_ext/string_emoji_helper"
13
13
 
14
14
  require "devise"
15
15
  # require "devise-two-factor"
@@ -97,11 +97,14 @@ def two_factor_authentication_enabled?
97
97
  ENV["TWO_FACTOR_ENCRYPTION_KEY"].present?
98
98
  end
99
99
 
100
- def any_oauth_enabled?
101
- [
102
- stripe_enabled?,
103
- # πŸš… super scaffolding will insert new oauth provider checks above this line.
104
- ].select(&:present?).any?
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.49
4
+ version: 1.0.52
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-08 00:00:00.000000000 Z
11
+ date: 2022-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -360,6 +360,20 @@ dependencies:
360
360
  - - ">="
361
361
  - !ruby/object:Gem::Version
362
362
  version: '0'
363
+ - !ruby/object:Gem::Dependency
364
+ name: unicode-emoji
365
+ requirement: !ruby/object:Gem::Requirement
366
+ requirements:
367
+ - - ">="
368
+ - !ruby/object:Gem::Version
369
+ version: '0'
370
+ type: :runtime
371
+ prerelease: false
372
+ version_requirements: !ruby/object:Gem::Requirement
373
+ requirements:
374
+ - - ">="
375
+ - !ruby/object:Gem::Version
376
+ version: '0'
363
377
  description: Bullet Train
364
378
  email:
365
379
  - andrew.culver@gmail.com
@@ -476,6 +490,7 @@ files:
476
490
  - app/views/account/users/_breadcrumbs.html.erb
477
491
  - app/views/account/users/_fields.html.erb
478
492
  - app/views/account/users/_form.html.erb
493
+ - app/views/account/users/_oauth.html.erb
479
494
  - app/views/account/users/edit.html.erb
480
495
  - app/views/account/users/show.html.erb
481
496
  - app/views/bullet_train/partial_resolver.html.erb
@@ -561,6 +576,7 @@ files:
561
576
  - docs/i18n.md
562
577
  - docs/index.md
563
578
  - docs/indirection.md
579
+ - docs/javascript.md
564
580
  - docs/modeling.md
565
581
  - docs/namespacing.md
566
582
  - docs/oauth.md
@@ -578,11 +594,11 @@ files:
578
594
  - docs/webhooks/incoming.md
579
595
  - docs/webhooks/outgoing.md
580
596
  - lib/bullet_train.rb
597
+ - lib/bullet_train/core_ext/string_emoji_helper.rb
581
598
  - lib/bullet_train/engine.rb
582
599
  - lib/bullet_train/resolver.rb
583
600
  - lib/bullet_train/version.rb
584
601
  - lib/colorizer.rb
585
- - lib/string/emoji.rb
586
602
  - lib/tasks/bullet_train_tasks.rake
587
603
  homepage: https://github.com/bullet-train-co/bullet_train
588
604
  licenses:
data/lib/string/emoji.rb DELETED
@@ -1,10 +0,0 @@
1
- class String
2
- def strip_emojis
3
- gsub(Unicode::Emoji::REGEX, "")
4
- end
5
-
6
- def only_emoji?
7
- return false if strip.empty?
8
- strip_emojis.strip.empty?
9
- end
10
- end