-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphlex-reactive.gemspec
More file actions
67 lines (59 loc) · 3.25 KB
/
Copy pathphlex-reactive.gemspec
File metadata and controls
67 lines (59 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# frozen_string_literal: true
require_relative "lib/phlex/reactive/version"
Gem::Specification.new do |spec|
spec.name = "phlex-reactive"
spec.version = Phlex::Reactive::VERSION
spec.authors = ["Mikael Henriksson"]
spec.email = ["mikael@mhenrixon.com"]
spec.summary = "Reactive Phlex components for Rails — Livewire-style actions and live cross-tab updates, no Stimulus boilerplate."
spec.description = <<~DESC
phlex-reactive makes Phlex components reactive without writing Stimulus
controllers or hand-picking Turbo Stream targets. Declare actions in Ruby;
a single generic client runtime turns clicks and form input into a server
round trip that re-renders the component and morphs it back in. Components
self-target by a stable DOM id, so the same unit re-renders for client
actions AND server-pushed broadcasts. State lives in the database behind a
signed identity — no attacker-controlled snapshot. Pairs with pgbus for
reliable, transactional, reconnect-safe live updates with no Action Cable
and no Redis.
DESC
spec.homepage = "https://github.com/mhenrixon/phlex-reactive"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.4.0"
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/mhenrixon/phlex-reactive/tree/main"
spec.metadata["changelog_uri"] = "https://github.com/mhenrixon/phlex-reactive/blob/main/CHANGELOG.md"
spec.metadata["rubygems_mfa_required"] = "true"
# List the gem's files. Prefer `git ls-files` (respects .gitignore), but fall
# back to a Dir glob when git or the working tree is unavailable — e.g. when the
# gem is a `path:` dependency in another app's Docker image that ships neither
# git nor a .git directory. Bundler re-evaluates a path gem's gemspec on every
# boot, so a hard git dependency here would crash the app at runtime.
gem_files =
begin
tracked = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL, &:read)
raise "git unavailable" if tracked.nil? || tracked.empty?
tracked.split("\x0")
rescue StandardError
# Constrain the no-git fallback to the source files the gem actually ships
# (.rb/.js/.erb under app|config|lib, the generator USAGE docs, the shipped
# Claude skill under lib/**/*.md — issue #168, plus the three root docs), so
# a glob in a dirty working tree can't sweep in machine-local artifacts
# (logs, .env, tmp, editor backups). This keeps spec.files stable across
# build environments without a hand-written manifest.
patterns = %w[{app,config,lib}/**/*.{rb,js,erb,rake} lib/**/*.md lib/**/USAGE]
patterns.flat_map { |p| Dir.glob(p, base: __dir__) }
.select { |f| File.file?(File.join(__dir__, f)) } +
%w[CHANGELOG.md LICENSE.txt README.md].select { |f| File.file?(File.join(__dir__, f)) }
end
spec.files = gem_files.select do |f|
f.start_with?("app/", "config/", "lib/") ||
%w[CHANGELOG.md LICENSE.txt README.md].include?(f)
end
spec.require_paths = ["lib"]
spec.add_dependency "globalid", "~> 1.0"
spec.add_dependency "phlex-rails", ">= 2.0", "< 3"
spec.add_dependency "railties", ">= 7.1", "< 9.0"
spec.add_dependency "turbo-rails", ">= 1.5", "< 3"
spec.add_dependency "zeitwerk", "~> 2.6"
end