velvet-components 0.0.1

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.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +24 -0
  3. data/app/assets/stylesheets/application.css +10 -0
  4. data/app/controllers/application_controller.rb +4 -0
  5. data/app/helpers/application_helper.rb +2 -0
  6. data/app/javascript/application.js +3 -0
  7. data/app/javascript/controllers/application.js +9 -0
  8. data/app/javascript/controllers/hello_controller.js +7 -0
  9. data/app/javascript/controllers/index.js +8 -0
  10. data/app/jobs/application_job.rb +7 -0
  11. data/app/mailers/application_mailer.rb +4 -0
  12. data/app/models/application_record.rb +3 -0
  13. data/app/views/layouts/application.html.erb +29 -0
  14. data/app/views/layouts/mailer.html.erb +13 -0
  15. data/app/views/layouts/mailer.text.erb +1 -0
  16. data/app/views/pwa/manifest.json.erb +22 -0
  17. data/app/views/pwa/service-worker.js +26 -0
  18. data/config/application.rb +27 -0
  19. data/config/boot.rb +4 -0
  20. data/config/bundler-audit.yml +5 -0
  21. data/config/cable.yml +17 -0
  22. data/config/cache.yml +16 -0
  23. data/config/ci.rb +22 -0
  24. data/config/credentials.yml.enc +1 -0
  25. data/config/database.yml +41 -0
  26. data/config/deploy.yml +117 -0
  27. data/config/environment.rb +5 -0
  28. data/config/environments/development.rb +78 -0
  29. data/config/environments/production.rb +90 -0
  30. data/config/environments/test.rb +53 -0
  31. data/config/initializers/assets.rb +7 -0
  32. data/config/initializers/content_security_policy.rb +29 -0
  33. data/config/initializers/filter_parameter_logging.rb +8 -0
  34. data/config/initializers/inflections.rb +16 -0
  35. data/config/locales/en.yml +31 -0
  36. data/config/master.key +1 -0
  37. data/config/puma.rb +42 -0
  38. data/config/queue.yml +18 -0
  39. data/config/recurring.yml +15 -0
  40. data/config/routes.rb +14 -0
  41. data/config/storage.yml +27 -0
  42. data/lib/velvet.rb +5 -0
  43. metadata +143 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: aa8e6cd083179c1522c9ec42d42363039a80d8f9f2a0bfea59657d0cb8f77ef6
4
+ data.tar.gz: d1c0df7624d957bedbbe66902bd73832f13b444ceebe4d62a6f5a3fa4d971d2a
5
+ SHA512:
6
+ metadata.gz: 365e7378bcdf35170a0486ae42722f23b59f00a6a5cdfcc5269dcad29bea415f22a86744d56b5c39c89da3cd23591e13e440e8949b3d24bbcfe56b9604bc118a
7
+ data.tar.gz: dc60b41b6650fa73c942463d87b91d607312f5793755c4fdeb198eaf2ce9aec6d09b4d5ce2db908f208392f533290d047581501056b8b31d80c011e4e2610eb7
data/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
@@ -0,0 +1,10 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css.
3
+ *
4
+ * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
5
+ * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
6
+ * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
7
+ * depending on specificity.
8
+ *
9
+ * Consider organizing styles into separate files for maintainability.
10
+ */
@@ -0,0 +1,4 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
3
+ allow_browser versions: :modern
4
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,3 @@
1
+ // Entry point for the build script in your package.json
2
+ import "@hotwired/turbo-rails"
3
+ import "./controllers"
@@ -0,0 +1,9 @@
1
+ import { Application } from "@hotwired/stimulus"
2
+
3
+ const application = Application.start()
4
+
5
+ // Configure Stimulus development experience
6
+ application.debug = false
7
+ window.Stimulus = application
8
+
9
+ export { application }
@@ -0,0 +1,7 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ connect() {
5
+ this.element.textContent = "Hello World!"
6
+ }
7
+ }
@@ -0,0 +1,8 @@
1
+ // This file is auto-generated by ./bin/rails stimulus:manifest:update
2
+ // Run that command whenever you add a new controller or create them with
3
+ // ./bin/rails generate stimulus controllerName
4
+
5
+ import { application } from "./application"
6
+
7
+ import HelloController from "./hello_controller"
8
+ application.register("hello", HelloController)
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: "from@example.com"
3
+ layout "mailer"
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ primary_abstract_class
3
+ end
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= content_for(:title) || "Velvet Components" %></title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <meta name="apple-mobile-web-app-capable" content="yes">
7
+ <meta name="application-name" content="Velvet Components">
8
+ <meta name="mobile-web-app-capable" content="yes">
9
+ <%= csrf_meta_tags %>
10
+ <%= csp_meta_tag %>
11
+
12
+ <%= yield :head %>
13
+
14
+ <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
15
+ <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
16
+
17
+ <link rel="icon" href="/icon.png" type="image/png">
18
+ <link rel="icon" href="/icon.svg" type="image/svg+xml">
19
+ <link rel="apple-touch-icon" href="/icon.png">
20
+
21
+ <%# Includes all stylesheet files in app/assets/stylesheets %>
22
+ <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
23
+ <%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>
24
+ </head>
25
+
26
+ <body>
27
+ <%= yield %>
28
+ </body>
29
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "VelvetComponents",
3
+ "icons": [
4
+ {
5
+ "src": "/icon.png",
6
+ "type": "image/png",
7
+ "sizes": "512x512"
8
+ },
9
+ {
10
+ "src": "/icon.png",
11
+ "type": "image/png",
12
+ "sizes": "512x512",
13
+ "purpose": "maskable"
14
+ }
15
+ ],
16
+ "start_url": "/",
17
+ "display": "standalone",
18
+ "scope": "/",
19
+ "description": "VelvetComponents.",
20
+ "theme_color": "red",
21
+ "background_color": "red"
22
+ }
@@ -0,0 +1,26 @@
1
+ // Add a service worker for processing Web Push notifications:
2
+ //
3
+ // self.addEventListener("push", async (event) => {
4
+ // const { title, options } = await event.data.json()
5
+ // event.waitUntil(self.registration.showNotification(title, options))
6
+ // })
7
+ //
8
+ // self.addEventListener("notificationclick", function(event) {
9
+ // event.notification.close()
10
+ // event.waitUntil(
11
+ // clients.matchAll({ type: "window" }).then((clientList) => {
12
+ // for (let i = 0; i < clientList.length; i++) {
13
+ // let client = clientList[i]
14
+ // let clientPath = (new URL(client.url)).pathname
15
+ //
16
+ // if (clientPath == event.notification.data.path && "focus" in client) {
17
+ // return client.focus()
18
+ // }
19
+ // }
20
+ //
21
+ // if (clients.openWindow) {
22
+ // return clients.openWindow(event.notification.data.path)
23
+ // }
24
+ // })
25
+ // )
26
+ // })
@@ -0,0 +1,27 @@
1
+ require_relative "boot"
2
+
3
+ require "rails/all"
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
8
+
9
+ module VelvetComponents
10
+ class Application < Rails::Application
11
+ # Initialize configuration defaults for originally generated Rails version.
12
+ config.load_defaults 8.1
13
+
14
+ # Please, add to the `ignore` list any other `lib` subdirectories that do
15
+ # not contain `.rb` files, or that should not be reloaded or eager loaded.
16
+ # Common ones are `templates`, `generators`, or `middleware`, for example.
17
+ config.autoload_lib(ignore: %w[assets tasks])
18
+
19
+ # Configuration for the application, engines, and railties goes here.
20
+ #
21
+ # These settings can be overridden in specific environments using the files
22
+ # in config/environments, which are processed later.
23
+ #
24
+ # config.time_zone = "Central Time (US & Canada)"
25
+ # config.eager_load_paths << Rails.root.join("extras")
26
+ end
27
+ end
data/config/boot.rb ADDED
@@ -0,0 +1,4 @@
1
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2
+
3
+ require "bundler/setup" # Set up gems listed in the Gemfile.
4
+ require "bootsnap/setup" # Speed up boot time by caching expensive operations.
@@ -0,0 +1,5 @@
1
+ # Audit all gems listed in the Gemfile for known security problems by running bin/bundler-audit.
2
+ # CVEs that are not relevant to the application can be enumerated on the ignore list below.
3
+
4
+ ignore:
5
+ - CVE-THAT-DOES-NOT-APPLY
data/config/cable.yml ADDED
@@ -0,0 +1,17 @@
1
+ # Async adapter only works within the same process, so for manually triggering cable updates from a console,
2
+ # and seeing results in the browser, you must do so from the web console (running inside the dev process),
3
+ # not a terminal started via bin/rails console! Add "console" to any action or any ERB template view
4
+ # to make the web console appear.
5
+ development:
6
+ adapter: async
7
+
8
+ test:
9
+ adapter: test
10
+
11
+ production:
12
+ adapter: solid_cable
13
+ connects_to:
14
+ database:
15
+ writing: cable
16
+ polling_interval: 0.1.seconds
17
+ message_retention: 1.day
data/config/cache.yml ADDED
@@ -0,0 +1,16 @@
1
+ default: &default
2
+ store_options:
3
+ # Cap age of oldest cache entry to fulfill retention policies
4
+ # max_age: <%= 60.days.to_i %>
5
+ max_size: <%= 256.megabytes %>
6
+ namespace: <%= Rails.env %>
7
+
8
+ development:
9
+ <<: *default
10
+
11
+ test:
12
+ <<: *default
13
+
14
+ production:
15
+ database: cache
16
+ <<: *default
data/config/ci.rb ADDED
@@ -0,0 +1,22 @@
1
+ # Run using bin/ci
2
+
3
+ CI.run do
4
+ step "Setup", "bin/setup --skip-server"
5
+
6
+ step "Style: Ruby", "bin/rubocop"
7
+
8
+ step "Security: Gem audit", "bin/bundler-audit"
9
+ step "Security: Brakeman code analysis", "bin/brakeman --quiet --no-pager --exit-on-warn --exit-on-error"
10
+
11
+ step "Tests: Rails", "bin/rails test"
12
+ step "Tests: System", "bin/rails test:system"
13
+ step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant"
14
+
15
+ # Optional: set a green GitHub commit status to unblock PR merge.
16
+ # Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`.
17
+ # if success?
18
+ # step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff"
19
+ # else
20
+ # failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again."
21
+ # end
22
+ end
@@ -0,0 +1 @@
1
+ KMNdBXXKU8RKFdMEikK2pOymtUeVY5Qsnc+TQKOues6u3ylUlE2oHnNtw7cVeXWWvUOaBbxCoiQayIy08EnLNxQQpSldek8yoBp7iKYPKRrW3DCV9s0LymZo8qgZlnj9XKRY/MX8LL7Zzm0+QSOCuBeNvmRf8E/OpFstStC2DW7igf+kERgJP3sQHnxgoKJoonBFjt83RtcqkZLxEJSvPNyT7RCdVOvwxQpKFksSfROSr6PE3hXSQdn7oQvRsYDvgWoJ1szSAZqG4Gsw8prEl1kkfNB032gATOil/GzSv9q6xO3YPWf/SYK+5bFgv4y6Uvft8c8ibK2NIujr0sEnheX/c+T73dUDgoQNrbHW8KB0yoETR3b3k9n0AmyjBV5thRac8syhDP8oszkl8yc33ZYDsYACG3aXpGe3ZBfUrjq/38ZTQ6WDrcCKQmai0IDGRUpGylsACMBKllPurA9PuWhdZC/7ez1K7Jhd8QVPyhDoYxqtDV0VvpQX--Z7tNJsyx4BwdajbJ--4MyZ/ZkuNVkB3v+pUIYQdw==
@@ -0,0 +1,41 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem "sqlite3"
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ max_connections: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: storage/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: storage/test.sqlite3
22
+
23
+
24
+ # Store production database in the storage/ directory, which by default
25
+ # is mounted as a persistent Docker volume in config/deploy.yml.
26
+ production:
27
+ primary:
28
+ <<: *default
29
+ database: storage/production.sqlite3
30
+ cache:
31
+ <<: *default
32
+ database: storage/production_cache.sqlite3
33
+ migrations_paths: db/cache_migrate
34
+ queue:
35
+ <<: *default
36
+ database: storage/production_queue.sqlite3
37
+ migrations_paths: db/queue_migrate
38
+ cable:
39
+ <<: *default
40
+ database: storage/production_cable.sqlite3
41
+ migrations_paths: db/cable_migrate
data/config/deploy.yml ADDED
@@ -0,0 +1,117 @@
1
+ # Name of your application. Used to uniquely configure containers.
2
+ service: velvet_components
3
+
4
+ # Name of the container image (use your-user/app-name on external registries).
5
+ image: velvet_components
6
+
7
+ # Deploy to these servers.
8
+ servers:
9
+ web:
10
+ - 192.168.0.1
11
+ # job:
12
+ # hosts:
13
+ # - 192.168.0.1
14
+ # cmd: bin/jobs
15
+
16
+ # Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server.
17
+ # Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer.
18
+ #
19
+ # Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption.
20
+ # proxy:
21
+ # ssl: true
22
+ # host: app.example.com
23
+
24
+ # Where you keep your container images.
25
+ registry:
26
+ # Alternatives: hub.docker.com / registry.digitalocean.com / ghcr.io / ...
27
+ server: localhost:5555
28
+
29
+ # Needed for authenticated registries.
30
+ # username: your-user
31
+
32
+ # Always use an access token rather than real password when possible.
33
+ # password:
34
+ # - KAMAL_REGISTRY_PASSWORD
35
+
36
+ # Inject ENV variables into containers (secrets come from .kamal/secrets).
37
+ env:
38
+ secret:
39
+ - RAILS_MASTER_KEY
40
+ clear:
41
+ # Run the Solid Queue Supervisor inside the web server's Puma process to do jobs.
42
+ # When you start using multiple servers, you should split out job processing to a dedicated machine.
43
+ SOLID_QUEUE_IN_PUMA: true
44
+
45
+ # Set number of processes dedicated to Solid Queue (default: 1)
46
+ # JOB_CONCURRENCY: 3
47
+
48
+ # Set number of cores available to the application on each server (default: 1).
49
+ # WEB_CONCURRENCY: 2
50
+
51
+ # Match this to any external database server to configure Active Record correctly
52
+ # Use velvet_components-db for a db accessory server on same machine via local kamal docker network.
53
+ # DB_HOST: 192.168.0.2
54
+
55
+ # Log everything from Rails
56
+ # RAILS_LOG_LEVEL: debug
57
+
58
+ # Aliases are triggered with "bin/kamal <alias>". You can overwrite arguments on invocation:
59
+ # "bin/kamal logs -r job" will tail logs from the first server in the job section.
60
+ aliases:
61
+ console: app exec --interactive --reuse "bin/rails console"
62
+ shell: app exec --interactive --reuse "bash"
63
+ logs: app logs -f
64
+ dbc: app exec --interactive --reuse "bin/rails dbconsole --include-password"
65
+
66
+ # Use a persistent storage volume for sqlite database files and local Active Storage files.
67
+ # Recommended to change this to a mounted volume path that is backed up off server.
68
+ volumes:
69
+ - "velvet_components_storage:/rails/storage"
70
+
71
+ # Bridge fingerprinted assets, like JS and CSS, between versions to avoid
72
+ # hitting 404 on in-flight requests. Combines all files from new and old
73
+ # version inside the asset_path.
74
+ asset_path: /rails/public/assets
75
+
76
+
77
+ # Configure the image builder.
78
+ builder:
79
+ arch: amd64
80
+
81
+ # # Build image via remote server (useful for faster amd64 builds on arm64 computers)
82
+ # remote: ssh://docker@docker-builder-server
83
+ #
84
+ # # Pass arguments and secrets to the Docker build process
85
+ # args:
86
+ # RUBY_VERSION: 3.4.5
87
+ # secrets:
88
+ # - GITHUB_TOKEN
89
+ # - RAILS_MASTER_KEY
90
+
91
+ # Use a different ssh user than root
92
+ # ssh:
93
+ # user: app
94
+
95
+ # Use accessory services (secrets come from .kamal/secrets).
96
+ # accessories:
97
+ # db:
98
+ # image: mysql:8.0
99
+ # host: 192.168.0.2
100
+ # # Change to 3306 to expose port to the world instead of just local network.
101
+ # port: "127.0.0.1:3306:3306"
102
+ # env:
103
+ # clear:
104
+ # MYSQL_ROOT_HOST: '%'
105
+ # secret:
106
+ # - MYSQL_ROOT_PASSWORD
107
+ # files:
108
+ # - config/mysql/production.cnf:/etc/mysql/my.cnf
109
+ # - db/production.sql:/docker-entrypoint-initdb.d/setup.sql
110
+ # directories:
111
+ # - data:/var/lib/mysql
112
+ # redis:
113
+ # image: valkey/valkey:8
114
+ # host: 192.168.0.2
115
+ # port: 6379
116
+ # directories:
117
+ # - data:/data
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require_relative "application"
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,78 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # Make code changes take effect immediately without server restart.
7
+ config.enable_reloading = true
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
14
+
15
+ # Enable server timing.
16
+ config.server_timing = true
17
+
18
+ # Enable/disable Action Controller caching. By default Action Controller caching is disabled.
19
+ # Run rails dev:cache to toggle Action Controller caching.
20
+ if Rails.root.join("tmp/caching-dev.txt").exist?
21
+ config.action_controller.perform_caching = true
22
+ config.action_controller.enable_fragment_cache_logging = true
23
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
24
+ else
25
+ config.action_controller.perform_caching = false
26
+ end
27
+
28
+ # Change to :null_store to avoid any caching.
29
+ config.cache_store = :memory_store
30
+
31
+ # Store uploaded files on the local file system (see config/storage.yml for options).
32
+ config.active_storage.service = :local
33
+
34
+ # Don't care if the mailer can't send.
35
+ config.action_mailer.raise_delivery_errors = false
36
+
37
+ # Make template changes take effect immediately.
38
+ config.action_mailer.perform_caching = false
39
+
40
+ # Set localhost to be used by links generated in mailer templates.
41
+ config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
42
+
43
+ # Print deprecation notices to the Rails logger.
44
+ config.active_support.deprecation = :log
45
+
46
+ # Raise an error on page load if there are pending migrations.
47
+ config.active_record.migration_error = :page_load
48
+
49
+ # Highlight code that triggered database queries in logs.
50
+ config.active_record.verbose_query_logs = true
51
+
52
+ # Append comments with runtime information tags to SQL queries in logs.
53
+ config.active_record.query_log_tags_enabled = true
54
+
55
+ # Highlight code that enqueued background job in logs.
56
+ config.active_job.verbose_enqueue_logs = true
57
+
58
+ # Highlight code that triggered redirect in logs.
59
+ config.action_dispatch.verbose_redirect_logs = true
60
+
61
+ # Suppress logger output for asset requests.
62
+ config.assets.quiet = true
63
+
64
+ # Raises error for missing translations.
65
+ # config.i18n.raise_on_missing_translations = true
66
+
67
+ # Annotate rendered view with file names.
68
+ config.action_view.annotate_rendered_view_with_filenames = true
69
+
70
+ # Uncomment if you wish to allow Action Cable access from any origin.
71
+ # config.action_cable.disable_request_forgery_protection = true
72
+
73
+ # Raise error when a before_action's only/except options reference missing actions.
74
+ config.action_controller.raise_on_missing_callback_actions = true
75
+
76
+ # Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
77
+ # config.generators.apply_rubocop_autocorrect_after_generate!
78
+ end
@@ -0,0 +1,90 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # Code is not reloaded between requests.
7
+ config.enable_reloading = false
8
+
9
+ # Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
10
+ config.eager_load = true
11
+
12
+ # Full error reports are disabled.
13
+ config.consider_all_requests_local = false
14
+
15
+ # Turn on fragment caching in view templates.
16
+ config.action_controller.perform_caching = true
17
+
18
+ # Cache assets for far-future expiry since they are all digest stamped.
19
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
20
+
21
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
22
+ # config.asset_host = "http://assets.example.com"
23
+
24
+ # Store uploaded files on the local file system (see config/storage.yml for options).
25
+ config.active_storage.service = :local
26
+
27
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
28
+ config.assume_ssl = true
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ config.force_ssl = true
32
+
33
+ # Skip http-to-https redirect for the default health check endpoint.
34
+ # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
35
+
36
+ # Log to STDOUT with the current request id as a default log tag.
37
+ config.log_tags = [ :request_id ]
38
+ config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
39
+
40
+ # Change to "debug" to log everything (including potentially personally-identifiable information!).
41
+ config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
42
+
43
+ # Prevent health checks from clogging up the logs.
44
+ config.silence_healthcheck_path = "/up"
45
+
46
+ # Don't log any deprecations.
47
+ config.active_support.report_deprecations = false
48
+
49
+ # Replace the default in-process memory cache store with a durable alternative.
50
+ config.cache_store = :solid_cache_store
51
+
52
+ # Replace the default in-process and non-durable queuing backend for Active Job.
53
+ config.active_job.queue_adapter = :solid_queue
54
+ config.solid_queue.connects_to = { database: { writing: :queue } }
55
+
56
+ # Ignore bad email addresses and do not raise email delivery errors.
57
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
58
+ # config.action_mailer.raise_delivery_errors = false
59
+
60
+ # Set host to be used by links generated in mailer templates.
61
+ config.action_mailer.default_url_options = { host: "example.com" }
62
+
63
+ # Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit.
64
+ # config.action_mailer.smtp_settings = {
65
+ # user_name: Rails.application.credentials.dig(:smtp, :user_name),
66
+ # password: Rails.application.credentials.dig(:smtp, :password),
67
+ # address: "smtp.example.com",
68
+ # port: 587,
69
+ # authentication: :plain
70
+ # }
71
+
72
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
73
+ # the I18n.default_locale when a translation cannot be found).
74
+ config.i18n.fallbacks = true
75
+
76
+ # Do not dump schema after migrations.
77
+ config.active_record.dump_schema_after_migration = false
78
+
79
+ # Only use :id for inspections in production.
80
+ config.active_record.attributes_for_inspect = [ :id ]
81
+
82
+ # Enable DNS rebinding protection and other `Host` header attacks.
83
+ # config.hosts = [
84
+ # "example.com", # Allow requests from example.com
85
+ # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
86
+ # ]
87
+ #
88
+ # Skip DNS rebinding protection for the default health check endpoint.
89
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
90
+ end
@@ -0,0 +1,53 @@
1
+ # The test environment is used exclusively to run your application's
2
+ # test suite. You never need to work with it otherwise. Remember that
3
+ # your test database is "scratch space" for the test suite and is wiped
4
+ # and recreated between test runs. Don't rely on the data there!
5
+
6
+ Rails.application.configure do
7
+ # Settings specified here will take precedence over those in config/application.rb.
8
+
9
+ # While tests run files are not watched, reloading is not necessary.
10
+ config.enable_reloading = false
11
+
12
+ # Eager loading loads your entire application. When running a single test locally,
13
+ # this is usually not necessary, and can slow down your test suite. However, it's
14
+ # recommended that you enable it in continuous integration systems to ensure eager
15
+ # loading is working properly before deploying your code.
16
+ config.eager_load = ENV["CI"].present?
17
+
18
+ # Configure public file server for tests with cache-control for performance.
19
+ config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
20
+
21
+ # Show full error reports.
22
+ config.consider_all_requests_local = true
23
+ config.cache_store = :null_store
24
+
25
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
26
+ config.action_dispatch.show_exceptions = :rescuable
27
+
28
+ # Disable request forgery protection in test environment.
29
+ config.action_controller.allow_forgery_protection = false
30
+
31
+ # Store uploaded files on the local file system in a temporary directory.
32
+ config.active_storage.service = :test
33
+
34
+ # Tell Action Mailer not to deliver emails to the real world.
35
+ # The :test delivery method accumulates sent emails in the
36
+ # ActionMailer::Base.deliveries array.
37
+ config.action_mailer.delivery_method = :test
38
+
39
+ # Set host to be used by links generated in mailer templates.
40
+ config.action_mailer.default_url_options = { host: "example.com" }
41
+
42
+ # Print deprecation notices to the stderr.
43
+ config.active_support.deprecation = :stderr
44
+
45
+ # Raises error for missing translations.
46
+ # config.i18n.raise_on_missing_translations = true
47
+
48
+ # Annotate rendered view with file names.
49
+ # config.action_view.annotate_rendered_view_with_filenames = true
50
+
51
+ # Raise error when a before_action's only/except options reference missing actions.
52
+ config.action_controller.raise_on_missing_callback_actions = true
53
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = "1.0"
5
+
6
+ # Add additional assets to the asset load path.
7
+ # Rails.application.config.assets.paths << Emoji.images_path
@@ -0,0 +1,29 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Define an application-wide content security policy.
4
+ # See the Securing Rails Applications Guide for more information:
5
+ # https://guides.rubyonrails.org/security.html#content-security-policy-header
6
+
7
+ # Rails.application.configure do
8
+ # config.content_security_policy do |policy|
9
+ # policy.default_src :self, :https
10
+ # policy.font_src :self, :https, :data
11
+ # policy.img_src :self, :https, :data
12
+ # policy.object_src :none
13
+ # policy.script_src :self, :https
14
+ # policy.style_src :self, :https
15
+ # # Specify URI for violation reports
16
+ # # policy.report_uri "/csp-violation-report-endpoint"
17
+ # end
18
+ #
19
+ # # Generate session nonces for permitted importmap, inline scripts, and inline styles.
20
+ # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21
+ # config.content_security_policy_nonce_directives = %w(script-src style-src)
22
+ #
23
+ # # Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag`
24
+ # # if the corresponding directives are specified in `content_security_policy_nonce_directives`.
25
+ # # config.content_security_policy_nonce_auto = true
26
+ #
27
+ # # Report violations without enforcing the policy.
28
+ # # config.content_security_policy_report_only = true
29
+ # end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
4
+ # Use this to limit dissemination of sensitive information.
5
+ # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6
+ Rails.application.config.filter_parameters += [
7
+ :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
8
+ ]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, "\\1en"
8
+ # inflect.singular /^(ox)en/i, "\\1"
9
+ # inflect.irregular "person", "people"
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym "RESTful"
16
+ # end
@@ -0,0 +1,31 @@
1
+ # Files in the config/locales directory are used for internationalization and
2
+ # are automatically loaded by Rails. If you want to use locales other than
3
+ # English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t "hello"
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t("hello") %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more about the API, please read the Rails Internationalization guide
20
+ # at https://guides.rubyonrails.org/i18n.html.
21
+ #
22
+ # Be aware that YAML interprets the following case-insensitive strings as
23
+ # booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
24
+ # must be quoted to be interpreted as strings. For example:
25
+ #
26
+ # en:
27
+ # "yes": yup
28
+ # enabled: "ON"
29
+
30
+ en:
31
+ hello: "Hello world"
data/config/master.key ADDED
@@ -0,0 +1 @@
1
+ 75d1ebc4e6ee4b6d050c6c3c798d6533
data/config/puma.rb ADDED
@@ -0,0 +1,42 @@
1
+ # This configuration file will be evaluated by Puma. The top-level methods that
2
+ # are invoked here are part of Puma's configuration DSL. For more information
3
+ # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
4
+ #
5
+ # Puma starts a configurable number of processes (workers) and each process
6
+ # serves each request in a thread from an internal thread pool.
7
+ #
8
+ # You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
9
+ # should only set this value when you want to run 2 or more workers. The
10
+ # default is already 1. You can set it to `auto` to automatically start a worker
11
+ # for each available processor.
12
+ #
13
+ # The ideal number of threads per worker depends both on how much time the
14
+ # application spends waiting for IO operations and on how much you wish to
15
+ # prioritize throughput over latency.
16
+ #
17
+ # As a rule of thumb, increasing the number of threads will increase how much
18
+ # traffic a given process can handle (throughput), but due to CRuby's
19
+ # Global VM Lock (GVL) it has diminishing returns and will degrade the
20
+ # response time (latency) of the application.
21
+ #
22
+ # The default is set to 3 threads as it's deemed a decent compromise between
23
+ # throughput and latency for the average Rails application.
24
+ #
25
+ # Any libraries that use a connection pool or another resource pool should
26
+ # be configured to provide at least as many connections as the number of
27
+ # threads. This includes Active Record's `pool` parameter in `database.yml`.
28
+ threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
29
+ threads threads_count, threads_count
30
+
31
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
32
+ port ENV.fetch("PORT", 3000)
33
+
34
+ # Allow puma to be restarted by `bin/rails restart` command.
35
+ plugin :tmp_restart
36
+
37
+ # Run the Solid Queue supervisor inside of Puma for single-server deployments.
38
+ plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
39
+
40
+ # Specify the PID file. Defaults to tmp/pids/server.pid in development.
41
+ # In other environments, only set the PID file if requested.
42
+ pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
data/config/queue.yml ADDED
@@ -0,0 +1,18 @@
1
+ default: &default
2
+ dispatchers:
3
+ - polling_interval: 1
4
+ batch_size: 500
5
+ workers:
6
+ - queues: "*"
7
+ threads: 3
8
+ processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %>
9
+ polling_interval: 0.1
10
+
11
+ development:
12
+ <<: *default
13
+
14
+ test:
15
+ <<: *default
16
+
17
+ production:
18
+ <<: *default
@@ -0,0 +1,15 @@
1
+ # examples:
2
+ # periodic_cleanup:
3
+ # class: CleanSoftDeletedRecordsJob
4
+ # queue: background
5
+ # args: [ 1000, { batch_size: 500 } ]
6
+ # schedule: every hour
7
+ # periodic_cleanup_with_command:
8
+ # command: "SoftDeletedRecord.due.delete_all"
9
+ # priority: 2
10
+ # schedule: at 5am every day
11
+
12
+ production:
13
+ clear_solid_queue_finished_jobs:
14
+ command: "SolidQueue::Job.clear_finished_in_batches(sleep_between_batches: 0.3)"
15
+ schedule: every hour at minute 12
data/config/routes.rb ADDED
@@ -0,0 +1,14 @@
1
+ Rails.application.routes.draw do
2
+ # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
3
+
4
+ # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
5
+ # Can be used by load balancers and uptime monitors to verify that the app is live.
6
+ get "up" => "rails/health#show", as: :rails_health_check
7
+
8
+ # Render dynamic PWA files from app/views/pwa/* (remember to link manifest in application.html.erb)
9
+ # get "manifest" => "rails/pwa#manifest", as: :pwa_manifest
10
+ # get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker
11
+
12
+ # Defines the root path route ("/")
13
+ # root "posts#index"
14
+ end
@@ -0,0 +1,27 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
4
+
5
+ local:
6
+ service: Disk
7
+ root: <%= Rails.root.join("storage") %>
8
+
9
+ # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
+ # amazon:
11
+ # service: S3
12
+ # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
+ # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
+ # region: us-east-1
15
+ # bucket: your_own_bucket-<%= Rails.env %>
16
+
17
+ # Remember not to checkin your GCS keyfile to a repository
18
+ # google:
19
+ # service: GCS
20
+ # project: your_project
21
+ # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
+ # bucket: your_own_bucket-<%= Rails.env %>
23
+
24
+ # mirror:
25
+ # service: Mirror
26
+ # primary: local
27
+ # mirrors: [ amazon, google, microsoft ]
data/lib/velvet.rb ADDED
@@ -0,0 +1,5 @@
1
+ class Velvet
2
+ def self.hello_world!
3
+ "Hello World!"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: velvet-components
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Github Open Source
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: actionview
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: 7.2.0
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: 7.2.0
26
+ - !ruby/object:Gem::Dependency
27
+ name: activesupport
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 7.2.0
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 7.2.0
40
+ - !ruby/object:Gem::Dependency
41
+ name: octicons
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 18.0.0
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 18.0.0
54
+ - !ruby/object:Gem::Dependency
55
+ name: view_component
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '3.1'
61
+ - - "<"
62
+ - !ruby/object:Gem::Version
63
+ version: '5.0'
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '3.1'
71
+ - - "<"
72
+ - !ruby/object:Gem::Version
73
+ version: '5.0'
74
+ email:
75
+ - components@velvet.com
76
+ executables: []
77
+ extensions: []
78
+ extra_rdoc_files: []
79
+ files:
80
+ - README.md
81
+ - app/assets/stylesheets/application.css
82
+ - app/controllers/application_controller.rb
83
+ - app/helpers/application_helper.rb
84
+ - app/javascript/application.js
85
+ - app/javascript/controllers/application.js
86
+ - app/javascript/controllers/hello_controller.js
87
+ - app/javascript/controllers/index.js
88
+ - app/jobs/application_job.rb
89
+ - app/mailers/application_mailer.rb
90
+ - app/models/application_record.rb
91
+ - app/views/layouts/application.html.erb
92
+ - app/views/layouts/mailer.html.erb
93
+ - app/views/layouts/mailer.text.erb
94
+ - app/views/pwa/manifest.json.erb
95
+ - app/views/pwa/service-worker.js
96
+ - config/application.rb
97
+ - config/boot.rb
98
+ - config/bundler-audit.yml
99
+ - config/cable.yml
100
+ - config/cache.yml
101
+ - config/ci.rb
102
+ - config/credentials.yml.enc
103
+ - config/database.yml
104
+ - config/deploy.yml
105
+ - config/environment.rb
106
+ - config/environments/development.rb
107
+ - config/environments/production.rb
108
+ - config/environments/test.rb
109
+ - config/initializers/assets.rb
110
+ - config/initializers/content_security_policy.rb
111
+ - config/initializers/filter_parameter_logging.rb
112
+ - config/initializers/inflections.rb
113
+ - config/locales/en.yml
114
+ - config/master.key
115
+ - config/puma.rb
116
+ - config/queue.yml
117
+ - config/recurring.yml
118
+ - config/routes.rb
119
+ - config/storage.yml
120
+ - lib/velvet.rb
121
+ homepage: https://github.com/velvet-components/velvet_components
122
+ licenses:
123
+ - MIT
124
+ metadata:
125
+ allowed_push_host: https://rubygems.org
126
+ rdoc_options: []
127
+ require_paths:
128
+ - lib
129
+ required_ruby_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: 3.2.0
134
+ required_rubygems_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ requirements: []
140
+ rubygems_version: 3.7.1
141
+ specification_version: 4
142
+ summary: ViewComponents for the Velvet Design System
143
+ test_files: []