importmap_mocha-rails 0.3.1 → 0.3.2

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: 86ad7a8af87278157916f9355aa84c1eec7564969abaf41335585f667bdc815b
4
- data.tar.gz: 52c7eb3feaafa2f2c3dbefebe343edbe29863bf13d404a56242b13a1604b5dce
3
+ metadata.gz: 956db9517ae928bdba1055e2fa794e0a5268e5cd51fbd5ee77b3d2f581974863
4
+ data.tar.gz: 82ea0c468ab45e738ee23a35b2c3342e20fc2db5e83ffb2cad1695ff32f6d9e4
5
5
  SHA512:
6
- metadata.gz: 298fce026b6f26defde4dd2ec9b23b2a0314b4b803cb719833594fdc47ef2b54307ee0afb2346110bc7f4c3e241b78d11b17c4055ef06e38af07dc7a1896cb6d
7
- data.tar.gz: 147026a848c6ce0d2d2901c38b5fbf88e72c8e3f864fc00d21885f7cf096537e358386bfc91b625975720d4d9fb6d6b8f99f50923d3521f9a640e65fdb1f2767
6
+ metadata.gz: fd744f1ccb15cadea9a96a17950763a518ad8ed752ec01a3ad8c49320e08cd3232dd44b21c4f17ae3cb49e4ab0d828e9c9f38f3387dbe51596af125877cf6646
7
+ data.tar.gz: 6b78eb3f5d241937458ae8ce568fe86eb743db54decd9841fe87f5517371d532e59292fd5b8e694042f36a5e928c75326fe4dd386491e5710316ed635fe97ebb
@@ -0,0 +1,16 @@
1
+ pin "importmap_mocha"
2
+
3
+ pin "@mswjs/interceptors", to: "@mswjs--interceptors.js"
4
+ pin "@mswjs/interceptors/presets/browser" , to: "@mswjs--interceptors--presets--browser.js"
5
+ pin "chai", to: "chai.js"
6
+
7
+ pin "@open-draft/logger", to: "@open-draft--logger.js" # @0.3.0
8
+ pin "is-node-process", to: "is-node-process.js" # @1.2.0
9
+ pin "outvariant", to: "outvariant.js" # @1.4.0
10
+ pin "@open-draft/until", to: "@open-draft--until.js" # @2.1.0
11
+ pin "@open-draft/deferred-promise", to: "@open-draft--deferred-promise.js" # @2.2.0
12
+ pin "strict-event-emitter", to: "strict-event-emitter.js" # @0.5.1
13
+
14
+ Rails.application.config.importmap_mocha_path.each do |path|
15
+ pin_all_from path
16
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ImportmapMocha
4
+ class Engine < ::Rails::Engine
5
+ config.before_initialize do
6
+ Rails.application.config.importmap_mocha_path = []
7
+ %w[test spec].each do |d|
8
+ path = Rails.root.join(d, 'javascripts')
9
+ Rails.application.config.importmap_mocha_path << path if path.exist?
10
+ end
11
+ end
12
+
13
+ initializer 'importmap_mocha.assets' do
14
+ if Rails.application.config.respond_to?(:assets)
15
+ Rails.application.config.assets.paths << Engine.root.join('app/assets/javascripts')
16
+ Rails.application.config.assets.paths << Engine.root.join('app/assets/stylesheets')
17
+ Rails.application.config.assets.paths << Engine.root.join('vendor/javascripts')
18
+ Rails.application.config.assets.paths << Engine.root.join('vendor/stylesheets')
19
+ Rails.application.config.assets.paths += Rails.application.config.importmap_mocha_path
20
+ end
21
+ end
22
+
23
+ PRECOMPILE_ASSETS = %w[importmap_mocha.js chai.js mocha.js mocha.css].freeze
24
+
25
+ initializer 'turbo.assets' do
26
+ Rails.application.config.assets.precompile += PRECOMPILE_ASSETS if Rails.application.config.respond_to?(:assets)
27
+ end
28
+
29
+ initializer 'importmap_mocha.importmap', before: 'importmap' do |app|
30
+ app.config.importmap.paths << Engine.root.join('config/importmap.rb') if Rails.application.respond_to?(:importmap)
31
+ end
32
+
33
+ initializer 'importmap_mocha.routes' do
34
+ Rails.application.routes.prepend do
35
+ scope module: 'importmap_mocha' do
36
+ get '/rails/info/mocha' => 'test#index'
37
+ end
38
+ end
39
+ end
40
+
41
+ initializer 'importmap_mocha.config' do
42
+ unless Rails.application.config.respond_to?(:importmap_mocha_style)
43
+ Rails.application.config.importmap_mocha_style = 'bdd'
44
+ end
45
+ unless Rails.application.config.respond_to?(:importmap_mocha_scripts)
46
+ Rails.application.config.importmap_mocha_scripts = []
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ImportmapMocha
4
+ VERSION = '0.3.2'
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'importmap_mocha/version'
2
+ require 'importmap_mocha/engine'
3
+
4
+ module ImportmapMocha
5
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :importmap_mocha_rails do
3
+ # # Task goes here
4
+ # end