Skip to content

Commit 6c8bd4d

Browse files
chore(generator): stop injecting webauthn-json dependency
1 parent 6f85070 commit 6c8bd4d

2 files changed

Lines changed: 0 additions & 19 deletions

File tree

lib/generators/webauthn/rails/install_generator.rb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,6 @@ def copy_stimulus_controllers
2727
end
2828
end
2929

30-
def inject_js_packages
31-
if using_importmap?
32-
say %(Appending: pin "@github/webauthn-json", to: "https://ga.jspm.io/npm:@github/webauthn-json@2.1.1/dist/esm/webauthn-json.js")
33-
append_to_file "config/importmap.rb", %(pin "@github/webauthn-json", to: "https://ga.jspm.io/npm:@github/webauthn-json@2.1.1/dist/esm/webauthn-json.js"\n)
34-
elsif using_bun?
35-
say "Adding webauthn-json to your package manager"
36-
run "bun add @github/webauthn-json"
37-
elsif has_package_json?
38-
say "Adding webauthn-json to your package manager"
39-
run "yarn add @github/webauthn-json"
40-
else
41-
puts "You must either be running with node (package.json) or importmap-rails (config/importmap.rb) to use this gem."
42-
end
43-
end
44-
4530
def copy_initializer_file
4631
template "config/initializers/webauthn.rb"
4732
end

test/generators/install_generator_test.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ class InstallGeneratorTest < Rails::Generators::TestCase
2828
assert_migration "db/migrate/create_webauthn_credentials.rb", /create_table :webauthn_credentials/
2929

3030
assert_file "config/routes.rb", /mount Webauthn::Rails::Engine/
31-
32-
assert_file "config/importmap.rb", /pin "@github\/webauthn-json"/
3331
end
3432

3533
test "assert all files are properly created when user model already exists" do
@@ -49,8 +47,6 @@ class InstallGeneratorTest < Rails::Generators::TestCase
4947
assert_migration "db/migrate/create_webauthn_credentials.rb", /create_table :webauthn_credentials/
5048

5149
assert_file "config/routes.rb", /mount Webauthn::Rails::Engine/
52-
53-
assert_file "config/importmap.rb", /pin "@github\/webauthn-json"/
5450
end
5551

5652
private

0 commit comments

Comments
 (0)