glib-web 6.10.2 → 7.0.0.beta1
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 +4 -4
- data/app/controllers/concerns/glib/auth/policy.rb +1 -5
- data/app/helpers/glib/json_ui/action_builder/bottom_banners.rb +0 -1
- data/app/helpers/glib/json_ui/action_builder/components.rb +1 -16
- data/app/helpers/glib/json_ui/action_builder/logics.rb +1 -2
- data/app/helpers/glib/json_ui/action_builder/snackbars.rb +0 -16
- data/app/helpers/glib/json_ui/response_helper.rb +0 -12
- data/app/helpers/glib/json_ui/view_builder/fields.rb +4 -86
- data/app/views/json_ui/garage/actions/_components.json.jbuilder +2 -2
- data/app/views/json_ui/garage/forms/bulk_edit_post.json.jbuilder +1 -1
- data/app/views/json_ui/garage/forms/checkboxes.json.jbuilder +3 -3
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +5 -5
- data/app/views/json_ui/garage/forms/update_options.json.jbuilder +1 -1
- data/app/views/json_ui/garage/panels/flow.json.jbuilder +6 -6
- data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +10 -10
- data/app/views/json_ui/garage/panels/responsive.json.jbuilder +10 -10
- data/app/views/json_ui/garage/panels/ul.json.jbuilder +2 -2
- data/app/views/json_ui/garage/panels/vertical.json.jbuilder +10 -10
- data/app/views/json_ui/garage/tables/bulk_edit.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/calendar.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/carousel.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/charts.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/column.json.jbuilder +3 -3
- data/app/views/json_ui/garage/test_page/components.json.jbuilder +7 -7
- data/app/views/json_ui/garage/test_page/custom.json.jbuilder +3 -3
- data/app/views/json_ui/garage/test_page/dialog.json.jbuilder +0 -21
- data/app/views/json_ui/garage/test_page/fields_creditCard.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_date_time.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_dynamicSelect.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_location.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_otp.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_phone.json.jbuilder +9 -9
- data/app/views/json_ui/garage/test_page/fields_radio.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/fields_rating.json.jbuilder +10 -10
- data/app/views/json_ui/garage/test_page/fields_richText.json.jbuilder +10 -10
- data/app/views/json_ui/garage/test_page/fields_select.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_sign.json.jbuilder +8 -56
- data/app/views/json_ui/garage/test_page/fields_stripeExternalAccount.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_stripeToken.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_text.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/fields_timer.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/flow.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/form.json.jbuilder +9 -9
- data/app/views/json_ui/garage/test_page/grid.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/horizontal.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/image.json.jbuilder +9 -9
- data/app/views/json_ui/garage/test_page/lifecycle.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/list.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/multimedia_docx.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/multimedia_video.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/pagination.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/panels_bulkEdit2.json.jbuilder +13 -13
- data/app/views/json_ui/garage/test_page/panels_bulkEdit3.json.jbuilder +1 -1
- data/app/views/json_ui/garage/test_page/progressCircle.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/responsive.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/scroll.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/split.json.jbuilder +1 -1
- data/app/views/json_ui/garage/test_page/table.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/timeline.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/ul.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/vertical.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/web.json.jbuilder +5 -5
- data/app/views/json_ui/garage/views/_expand_shrink_ex.json.jbuilder +4 -4
- data/app/views/json_ui/garage/views/controls.json.jbuilder +4 -4
- data/app/views/json_ui/garage/views/{components_set.json.jbuilder → logics_set.json.jbuilder} +2 -2
- data/lib/glib/engine.rb +0 -32
- data/lib/glib/json_crawler/router.rb +0 -24
- data/lib/glib/json_ui/config.rb +1 -1
- data/lib/glib/test/changed_files_rubocop.rb +55 -0
- data/lib/glib/test_helpers.rb +6 -9
- metadata +5 -35
- data/app/controllers/concerns/glib/auth/token_authenticatable.rb +0 -37
- data/app/controllers/glib/api_controller.rb +0 -52
- data/app/jobs/glib/purge_unattached_job.rb +0 -28
- data/app/models/concerns/glib/snapshot_v2.rb +0 -462
- data/app/models/glib/model.rb +0 -40
- data/app/models/glib/plain_model.rb +0 -23
- data/app/models/snapshot_blob_reference.rb +0 -20
- data/lib/generators/glib/snapshot_v2_generator.rb +0 -54
- data/lib/generators/templates/snapshot_v2/add_snapshot_v2_columns.rb +0 -18
- data/lib/generators/templates/snapshot_v2/create_snapshot_blob_references.rb +0 -10
- data/lib/glib/test/full_suite_rubocop.rb +0 -87
- data/lib/glib/test/rubocop_guards.rb +0 -42
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
class AddSnapshotV2Columns < ActiveRecord::Migration[8.0]
|
|
2
|
-
def change
|
|
3
|
-
# PostgreSQL has jsonb (binary, indexable); SQLite (used by glib-web's dummy-app) and MySQL
|
|
4
|
-
# only have json. Pick the richest type the adapter supports so consumers on PG get indexable
|
|
5
|
-
# diffs while greenfield adopters on SQLite/MySQL still work without edits.
|
|
6
|
-
diff_type = connection.adapter_name.match?(/PostgreSQL/i) ? :jsonb : :json
|
|
7
|
-
|
|
8
|
-
change_table :snapshots, bulk: true do |t|
|
|
9
|
-
t.string :action
|
|
10
|
-
t.integer :version
|
|
11
|
-
t.column :diff, diff_type
|
|
12
|
-
t.string :source
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
add_index :snapshots, [:action, :item_type, :item_id]
|
|
16
|
-
add_index :snapshots, [:item_type, :item_id, :version]
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
class CreateSnapshotBlobReferences < ActiveRecord::Migration[8.0]
|
|
2
|
-
def change
|
|
3
|
-
create_table :snapshot_blob_references do |t|
|
|
4
|
-
t.belongs_to :snapshot, null: false, foreign_key: { to_table: :snapshots }
|
|
5
|
-
t.belongs_to :blob, null: false, foreign_key: { to_table: :active_storage_blobs }
|
|
6
|
-
t.timestamps
|
|
7
|
-
end
|
|
8
|
-
add_index :snapshot_blob_references, [:snapshot_id, :blob_id], unique: true
|
|
9
|
-
end
|
|
10
|
-
end
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'English'
|
|
4
|
-
|
|
5
|
-
module Glib
|
|
6
|
-
module Test
|
|
7
|
-
# Suite-wide RuboCop auto-remediation, lifted from the per-project
|
|
8
|
-
# `test/linters/rubocop_test.rb` convention (originated in neowork-str) so
|
|
9
|
-
# projects get it from the gem via a CONSCIOUS opt-in: include
|
|
10
|
-
# Glib::Test::RubocopGuards once in the test setup. Never auto-require
|
|
11
|
-
# this from Glib::TestHelpers — that would enable a file-rewriting test
|
|
12
|
-
# in every project without a decision. It lints the WHOLE repo, so files
|
|
13
|
-
# nobody touches cannot silently accumulate offenses.
|
|
14
|
-
#
|
|
15
|
-
# Runs `rubocop -a` (safe autocorrect), which REWRITES files on disk to
|
|
16
|
-
# fix offenses, then asserts nothing remains AND nothing was rewritten.
|
|
17
|
-
# The mutation is deliberate (the repo's auto-remediation convention —
|
|
18
|
-
# i18n-tasks normalize runs the same way): a run that dirties a file is
|
|
19
|
-
# reported as a FAILURE so the rewrite cannot go unnoticed — that is the
|
|
20
|
-
# drift signal. Do NOT strip the `-a`; review the diff, keep the corrected
|
|
21
|
-
# output, and re-run. If a long-passing test suddenly breaks, investigate
|
|
22
|
-
# WHY first: usually a non-canonical file was committed, or a rubocop
|
|
23
|
-
# version bump changed a cop's rules.
|
|
24
|
-
#
|
|
25
|
-
# It self-registers with Minitest, so it runs on EVERY `rails test`
|
|
26
|
-
# invocation, single-file runs included. That is cheap on purpose: RuboCop
|
|
27
|
-
# caches per-file results, so a full-repo run on an unchanged tree costs
|
|
28
|
-
# about a second on a mid-size app.
|
|
29
|
-
#
|
|
30
|
-
# Deliberately does NOT skip under ENV['CI']: the local rails-test
|
|
31
|
-
# wrapper sets CI=true, and skipping here would silence this layer
|
|
32
|
-
# exactly where it runs. Opt out per-run with SKIP_FULL_SUITE_RUBOCOP=1.
|
|
33
|
-
class FullSuiteRubocop < ::ActiveSupport::TestCase
|
|
34
|
-
# `--format simple` offense lines: "C: 12: 3: [Correctable] Cop/Name: message"
|
|
35
|
-
# (line/column right-aligned to width 3, so the padding is 0-2 spaces).
|
|
36
|
-
OFFENSE_LINE = /^[A-Z]: *\d+: *\d+: /
|
|
37
|
-
|
|
38
|
-
def test_rubocop_autocorrect_then_clean
|
|
39
|
-
skip 'opted out via SKIP_FULL_SUITE_RUBOCOP' if ENV['SKIP_FULL_SUITE_RUBOCOP'] == '1'
|
|
40
|
-
|
|
41
|
-
# `scrub`: stderr is merged in, and one invalid byte would turn the
|
|
42
|
-
# scans below into an ArgumentError instead of a lint failure.
|
|
43
|
-
output = `bundle exec rubocop -a --format simple 2>&1`.scrub
|
|
44
|
-
clean = $CHILD_STATUS.success?
|
|
45
|
-
|
|
46
|
-
# Three distinct outcomes hide in one output, and each needs a
|
|
47
|
-
# different action — the message must say which, or an agent told
|
|
48
|
-
# only "offenses detected" reaches for a `rubocop:disable`:
|
|
49
|
-
# [Corrected] -a already rewrote it on disk (exit 0 if that's all)
|
|
50
|
-
# [Correctable] survived -a because only the UNSAFE -A can fix it
|
|
51
|
-
# neither no autocorrect exists — semantic, read the cop
|
|
52
|
-
# Counted on the offense LINES only, so a cop message that happens to
|
|
53
|
-
# contain a marker cannot shift a bucket.
|
|
54
|
-
offenses = output.lines.grep(OFFENSE_LINE)
|
|
55
|
-
corrected = offenses.count { |line| line.include?('[Corrected]') }
|
|
56
|
-
unsafe = offenses.count { |line| line.include?('[Correctable]') }
|
|
57
|
-
semantic = offenses.size - corrected - unsafe
|
|
58
|
-
|
|
59
|
-
# A Proc message is built only on failure (Minitest calls it lazily).
|
|
60
|
-
assert(clean && corrected.zero?, -> { failure_message(output, corrected: corrected, unsafe: unsafe, semantic: semantic) })
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
private
|
|
64
|
-
def failure_message(output, corrected:, unsafe:, semantic:)
|
|
65
|
-
parts = []
|
|
66
|
-
if corrected.positive?
|
|
67
|
-
parts << "`rubocop -a` REWROTE #{corrected} offense(s) on disk (the [Corrected] lines below). That is the " \
|
|
68
|
-
'drift signal, not a problem with this test: review `git diff`, keep the corrected output, ' \
|
|
69
|
-
'and re-run — do not strip the -a.'
|
|
70
|
-
end
|
|
71
|
-
if unsafe.positive?
|
|
72
|
-
parts << "#{unsafe} offense(s) marked [Correctable] survived `-a` because their fix is UNSAFE: apply it " \
|
|
73
|
-
'with `rubocop -A <file>` only after checking what it changes, or fix by hand.'
|
|
74
|
-
end
|
|
75
|
-
if semantic.positive?
|
|
76
|
-
parts << "#{semantic} offense(s) have NO autocorrect, so they are semantic, not mechanical: fix each the " \
|
|
77
|
-
"way the cop's own message prescribes — DevDoc cops name their prescribed alternative in the " \
|
|
78
|
-
"offense itself (full docs: the dev-doc repo's docs/cops/). A `rubocop:disable` is only for " \
|
|
79
|
-
"the case a cop's own doc calls genuinely unavoidable; disables already present in a file are " \
|
|
80
|
-
'narrow exceptions, not precedent.'
|
|
81
|
-
end
|
|
82
|
-
parts << 'RuboCop did not finish cleanly (see output below).' if parts.empty?
|
|
83
|
-
"#{parts.join("\n\n")}\n\n#{output}"
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
end
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Glib
|
|
4
|
-
module Test
|
|
5
|
-
# Conscious opt-in for the suite-time RuboCop guard. Including this module
|
|
6
|
-
# ONCE in the project's test setup IS the project's explicit decision to
|
|
7
|
-
# run it. It must stay a separate include precisely because
|
|
8
|
-
# Glib::TestHelpers is mixed in for unrelated reasons (crawlers, travel
|
|
9
|
-
# helpers): auto-requiring the guard from there would enable it without
|
|
10
|
-
# any conscious decision, and FullSuiteRubocop runs `rubocop -a`, which
|
|
11
|
-
# REWRITES files on disk.
|
|
12
|
-
#
|
|
13
|
-
# class ActiveSupport::TestCase
|
|
14
|
-
# include Glib::Test::RubocopGuards # opts in: full-suite `rubocop -a`
|
|
15
|
-
# end
|
|
16
|
-
#
|
|
17
|
-
# This module is defined as soon as the gem loads (glib/test_helpers
|
|
18
|
-
# requires it at file level), so the include works on its own — in
|
|
19
|
-
# ActiveSupport::TestCase or in a single test class — with no ordering
|
|
20
|
-
# dependency on Glib::TestHelpers.
|
|
21
|
-
#
|
|
22
|
-
# What the include switches on: Glib::Test::FullSuiteRubocop — `rubocop -a`
|
|
23
|
-
# over the whole repo on every `rails test` invocation, failing when
|
|
24
|
-
# anything was rewritten or remains (runs under CI too).
|
|
25
|
-
#
|
|
26
|
-
# MIGRATION NOTE: in the published releases before this change (6.9.3 and
|
|
27
|
-
# earlier as released), Glib::TestHelpers auto-required a report-only
|
|
28
|
-
# ChangedFilesRubocop guard (working-tree edits only, skipped under CI),
|
|
29
|
-
# so every project had it without asking. That guard is retired:
|
|
30
|
-
# FullSuiteRubocop is a superset, and the local rails-test wrapper sets
|
|
31
|
-
# CI=true, where the old guard never ran anyway. A project bumping to the
|
|
32
|
-
# first release that contains this change must add the include line above
|
|
33
|
-
# or it silently has no suite-time RuboCop guard at all.
|
|
34
|
-
module RubocopGuards
|
|
35
|
-
extend ActiveSupport::Concern
|
|
36
|
-
|
|
37
|
-
included do
|
|
38
|
-
require 'glib/test/full_suite_rubocop'
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|