migflow 0.2.0 → 0.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d55af79f429534cba3daaff17a931b4ab66da0d78e0d183c96beb1101a70c91
4
- data.tar.gz: cf93ff82fddc5c3e14d969fc0b25a8aea21415ec601d841f8406661dadb677b6
3
+ metadata.gz: 012fe80fa7f62c207288c4ceef538501c183d19894320a96dec797571d23470b
4
+ data.tar.gz: 13fbba968d1a19f618673e69c06c9df475f5b1a4c9ead12b0d10de38c012e22f
5
5
  SHA512:
6
- metadata.gz: ac99ca3d89000e918cadeb4964abf7398ec5b80f4776b6ffac93e53f35eb4407d3964a3ca057028d3bafa14f7e6ab07406a36c09222c1ac996ada95f56c460c3
7
- data.tar.gz: ba27f668b0d91263c48a4050bb42a2e2bd796f4e099c76beb59160edb62a039b8f75bf32e4d11ab7756664c5eefa80e3c06d3df582f19a7b72e0b7107d5b6235
6
+ metadata.gz: 341eea85492c25ac9a5118d947496ac8dcad2e78302591bd4f50c83fe392c968ff2fa7bf6497cf9bd818301b3f59d8525113d82dc58ce5b210e63070a864b79f
7
+ data.tar.gz: '019754ee7ff40de379f153e5eb52697f488ce86515ba9f07812c13654020d7c69858ad16ed4faea0faabb4cc7ec85b3c7aa1f66ab88306342298afda1dac7e24'
data/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.2] - 2026-04-30
11
+
12
+ ### Fixed
13
+ - `ActionController::InvalidCrossOriginRequest` raised when the browser loads `app.js` via a `<script>` tag. Rails' same-origin JavaScript protection was firing on the `StaticController` asset responses; forgery protection is now skipped since these are public static assets.
14
+
15
+ ## [0.2.1] - 2026-04-29
16
+
17
+ ### Fixed
18
+ - Dashboard assets (JS/CSS) failed to load in API-only Rails apps (`config.api_only = true`) because `stylesheet_link_tag` and `javascript_include_tag` fall back to dead paths when there is no asset pipeline. Assets are now served by a dedicated `StaticController` via engine-relative routes, so the dashboard loads correctly in both API-only and full-stack apps.
19
+
10
20
  ## [0.2.0] - 2026-04-22
11
21
 
12
22
  ### Fixed
data/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  Migflow is a Rails engine that mounts at `/migflow` and gives your team a visual timeline, schema diffs, and audit warnings — so you can understand migration impact before it reaches production.
6
6
 
7
+ [![Gem Version](https://img.shields.io/gem/v/migflow)](https://rubygems.org/gems/migflow)
7
8
  [![CI](https://img.shields.io/github/actions/workflow/status/jv4lentim/migflow/ci.yml?branch=main&label=CI&style=flat)](https://github.com/jv4lentim/migflow/actions/workflows/ci.yml)
8
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE.txt)
9
10
  [![Ruby](https://img.shields.io/badge/Ruby-%3E%3D%203.2-red)](https://www.ruby-lang.org/)
@@ -41,10 +42,10 @@ Tested in CI against every combination below:
41
42
 
42
43
  ## Installation
43
44
 
44
- Add Migflow to your `Gemfile` (Git source until the first RubyGems release):
45
+ Add Migflow to your `Gemfile`:
45
46
 
46
47
  ```ruby
47
- gem "migflow", git: "https://github.com/jv4lentim/migflow"
48
+ gem "migflow"
48
49
  ```
49
50
 
50
51
  ```bash
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Migflow
4
+ class StaticController < ActionController::Base
5
+ layout false
6
+ skip_forgery_protection
7
+
8
+ def app_js
9
+ send_file Migflow::Engine.root.join("app/assets/migflow/app.js"),
10
+ type: "application/javascript",
11
+ disposition: "inline"
12
+ end
13
+
14
+ def app_css
15
+ send_file Migflow::Engine.root.join("app/assets/migflow/app.css"),
16
+ type: "text/css",
17
+ disposition: "inline"
18
+ end
19
+ end
20
+ end
@@ -4,13 +4,13 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Migflow</title>
7
- <%= stylesheet_link_tag "migflow/app" %>
7
+ <link rel="stylesheet" href="<%= migflow.root_path %>assets/migflow/app.css" />
8
8
  </head>
9
9
  <body>
10
10
  <div
11
11
  id="schema-trail-root"
12
12
  data-api-base="<%= migflow.root_path %>api"
13
13
  ></div>
14
- <%= javascript_include_tag "migflow/app", defer: true %>
14
+ <script src="<%= migflow.root_path %>assets/migflow/app.js" defer></script>
15
15
  </body>
16
16
  </html>
data/config/routes.rb CHANGED
@@ -3,6 +3,9 @@
3
3
  Migflow::Engine.routes.draw do
4
4
  root to: "application#index"
5
5
 
6
+ get "assets/migflow/app.js", to: "static#app_js"
7
+ get "assets/migflow/app.css", to: "static#app_css"
8
+
6
9
  namespace :api do
7
10
  resources :migrations, only: %i[index show]
8
11
  get "diff", to: "diff#show"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Migflow
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joao Victor Valentim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-23 00:00:00.000000000 Z
11
+ date: 2026-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -55,6 +55,7 @@ files:
55
55
  - app/controllers/migflow/api/diff_controller.rb
56
56
  - app/controllers/migflow/api/migrations_controller.rb
57
57
  - app/controllers/migflow/application_controller.rb
58
+ - app/controllers/migflow/static_controller.rb
58
59
  - app/views/migflow/application/index.html.erb
59
60
  - config/routes.rb
60
61
  - docs/architecture.md