mbeditor 0.7.3 → 0.7.4

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: 720ab9c5f06c65a444d4e7a4d9204926a91e31941ed5d21df9a8cb234c322124
4
- data.tar.gz: 3c31e3387d38ba23e997dd71051328678bd225ea6ec2078c7d8cae72b44b09c6
3
+ metadata.gz: dd301d5fbcf6d107417270314be0561ac408505b9fc5d9c3862077ce17c68d10
4
+ data.tar.gz: 60bf4c608bf64ee929bde7c1ba537c4d07b26374e35233fdc2c0563b350eb20d
5
5
  SHA512:
6
- metadata.gz: aa5177a8fb2e8511a4452dc33d3965c5838001991883360e2767ad598edefcb0b3f4feeeb54cd9692b0d7e7527cdf87463faeef2713edcb48cdd672aadfc961b
7
- data.tar.gz: 1634701e852db9e3273f0217e5268c6298f3443fdfc5b598d53cfff6a462771a754c7f4ed187cbc247429e0d19ba27913d188715e3846856c034f3382facab5b
6
+ metadata.gz: eb42152a396ec834bf84207e1e9c6a77a5a21c11d6a3c63be839c19f48856cdd08b95e3921ad6acf843a0f2d0debefc6e769ef14a1813c162d02a5912d3691cb
7
+ data.tar.gz: ffe883ef2af226e85c53978f4165c04bbe62cf83364f4a6b25bdf7cbbdcc7b52d984733b0ed549e2a978b953366153ca944f4df184c0cb69c80c40b6ad3fd1a2
data/CHANGELOG.md CHANGED
@@ -5,10 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.7.4] - 2026-06-03
9
+
10
+ ### Fixed
11
+ - **Custom path reverse lookup (frontend)** — the v0.7.3 backend fix was complete, but the frontend's `resourceLabelFromPath` still returned `null` for paths under `app/` that weren't `controllers|models|views|helpers`, so custom paths like `app/assets/javascripts/…` were never recognized. Moved the custom-path check to the top of the function, matching the backend approach.
12
+
13
+ ---
14
+
8
15
  ## [0.7.3] - 2026-06-03
9
16
 
10
17
  ### Fixed
11
- - **Custom path reverse lookup** — moved the custom-path check in `extract_resource_names` before the `case` statement so paths under `app/assets/`, `app/javascript/`, etc. are handled. Stripped `_controller`/`_model`/`_helper`/`_service` suffixes from custom-path filenames in both backend and frontend for consistent label/grouping.
18
+ - **Custom path reverse lookup (backend)** — moved the custom-path check in `extract_resource_names` before the `case` statement so paths under `app/assets/`, `app/javascript/`, etc. are handled. Stripped `_controller`/`_model`/`_helper`/`_service` suffixes from custom-path filenames for consistent label/grouping.
12
19
  - **Schema modal `self.table_name` support** — reads `self.table_name` from the model file before falling back to `ActiveSupport::Inflector.tableize`, enabling custom table names.
13
20
  - **Structure.sql broader schema-prefix regex** — handles quoted schemas, non-public schemas, and no prefix.
14
21
  - **PostgreSQL type coverage** — expanded `sql_type_to_rails` with full PostgreSQL type coverage (timestamptz, double precision, citext, hstore, geometric types, etc.).
@@ -1610,6 +1610,26 @@ var MbeditorApp = function MbeditorApp() {
1610
1610
 
1611
1611
  var resourceLabelFromPath = function(p) {
1612
1612
  if (!p) return null;
1613
+
1614
+ // Custom paths are checked first so they work regardless of top-level prefix.
1615
+ // Paths under app/assets/, app/javascript/, etc. never match standard
1616
+ // app/controllers|models|views|helpers, so the check must happen first.
1617
+ var customPaths = customPathsRef.current;
1618
+ for (var ci = 0; ci < customPaths.length; ci++) {
1619
+ var base = customPaths[ci];
1620
+ if (p.startsWith(base + '/')) {
1621
+ var rest = p.slice(base.length + 1);
1622
+ var resource = rest.split('/')[0].replace(/\.[^.]+$/, '');
1623
+ resource = resource.replace(/_(controller|model|helper|service)$/, '');
1624
+ if (resource) {
1625
+ var seg = resource.replace(/ies$/, 'y')
1626
+ .replace(/([^aeiou])es$/, '$1')
1627
+ .replace(/([^s])s$/, '$1');
1628
+ return seg.replace(/_/g, ' ').replace(/\b\w/g, function(c) { return c.toUpperCase(); });
1629
+ }
1630
+ }
1631
+ }
1632
+
1613
1633
  var parts = p.split('/');
1614
1634
  var file = parts[parts.length - 1];
1615
1635
  var name;
@@ -1624,22 +1644,9 @@ var MbeditorApp = function MbeditorApp() {
1624
1644
  else if (parts[1] === 'models') name = file.replace(/_(test|spec)\.rb$/, '');
1625
1645
  else return null;
1626
1646
  } else {
1627
- // Check custom paths
1628
- var customPaths = customPathsRef.current;
1629
- for (var ci = 0; ci < customPaths.length; ci++) {
1630
- var base = customPaths[ci];
1631
- if (p.startsWith(base + '/')) {
1632
- var rest = p.slice(base.length + 1);
1633
- var resource = rest.split('/')[0].replace(/\.[^.]+$/, '');
1634
- // Strip Rails-style suffixes so custom-path files group with their controller/model
1635
- resource = resource.replace(/_(controller|model|helper|service)$/, '');
1636
- if (resource) { name = resource; break; }
1637
- }
1638
- }
1639
- if (!name) return null;
1647
+ return null;
1640
1648
  }
1641
1649
  var seg = (name || '').split('/').pop() || name || '';
1642
- // Normalize plural→singular so views/users and models/user share one group
1643
1650
  seg = seg.replace(/ies$/, 'y')
1644
1651
  .replace(/([^aeiou])es$/, '$1')
1645
1652
  .replace(/([^s])s$/, '$1');
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mbeditor
4
- VERSION = "0.7.3"
4
+ VERSION = "0.7.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mbeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Noonan