staticky 0.1.1 → 0.3.0
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/.rubocop.yml +3 -0
- data/CHANGELOG.md +14 -0
- data/README.md +378 -18
- data/lib/staticky/application.rb +36 -0
- data/lib/staticky/builder.rb +4 -2
- data/lib/staticky/cli/commands/build.rb +13 -0
- data/lib/staticky/cli/commands/generate.rb +67 -0
- data/lib/staticky/cli/commands/version.rb +13 -0
- data/lib/staticky/cli/commands.rb +13 -0
- data/lib/staticky/cli.rb +0 -60
- data/lib/staticky/deps.rb +1 -1
- data/lib/staticky/filesystem.rb +0 -3
- data/lib/staticky/phlex/view_helpers.rb +12 -2
- data/lib/staticky/pluggable.rb +35 -0
- data/lib/staticky/resource.rb +14 -15
- data/lib/staticky/resources/plugins/phlex.rb +42 -0
- data/lib/staticky/resources/plugins/prelude.rb +76 -0
- data/lib/staticky/resources/plugins.rb +9 -0
- data/lib/staticky/router.rb +13 -18
- data/lib/staticky/routing/plugins/prelude.rb +97 -0
- data/lib/staticky/routing/plugins.rb +9 -0
- data/lib/staticky/server.rb +5 -16
- data/lib/staticky/server_plugin.rb +37 -0
- data/lib/staticky/server_plugins/live_reloading.rb +58 -0
- data/lib/staticky/utils.rb +63 -0
- data/lib/staticky/version.rb +1 -1
- data/lib/staticky.rb +23 -11
- data/site_template/.gitignore +14 -0
- data/site_template/.ruby-version +1 -1
- data/site_template/Gemfile +5 -5
- data/site_template/Procfile.dev +2 -2
- data/site_template/README.md +27 -7
- data/site_template/Rakefile +33 -2
- data/site_template/{lib/component.rb → app/views/application_component.rb} +1 -1
- data/site_template/app/views/application_layout.rb +4 -0
- data/site_template/app/views/application_page.rb +5 -0
- data/site_template/app/views/errors/not_found.rb +1 -1
- data/site_template/app/views/errors/service_error.rb +1 -1
- data/site_template/app/views/layouts/error.rb +4 -6
- data/site_template/app/views/layouts/head.rb +5 -3
- data/site_template/app/views/layouts/site.rb +10 -23
- data/site_template/app/views/pages/home.rb +1 -1
- data/site_template/app/views/ui/footer.rb +1 -1
- data/site_template/app/views/ui/navbar.rb +1 -1
- data/site_template/bin/{lint → setup} +8 -2
- data/site_template/config/boot.rb +1 -2
- data/site_template/config/puma.rb +11 -0
- data/site_template/config/staticky.rb +3 -0
- data/site_template/config/vite.json +3 -1
- data/site_template/frontend/entrypoints/application.js +0 -1
- data/site_template/frontend/tailwindcss/variable_font_plugin.js +1 -1
- data/site_template/lib/icon.rb +2 -2
- data/site_template/nginx.conf +8 -1
- data/site_template/package.json +10 -15
- data/site_template/tailwind.config.js +12 -8
- data/site_template/vite.config.ts +0 -5
- metadata +50 -11
- data/lib/staticky/container.rb +0 -26
- data/lib/staticky/router/definition.rb +0 -49
- data/lib/staticky/view_context.rb +0 -17
- data/site_template/frontend/turbo_transitions.js +0 -54
- data/site_template/lib/layout.rb +0 -4
- data/site_template/lib/page.rb +0 -11
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: staticky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nolan J Tait
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-cli
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: dry-container
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.11'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.11'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: dry-events
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +66,20 @@ dependencies:
|
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: dry-inflector
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.1'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.1'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: dry-logger
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -166,21 +194,32 @@ files:
|
|
166
194
|
- Rakefile
|
167
195
|
- bin/staticky
|
168
196
|
- lib/staticky.rb
|
197
|
+
- lib/staticky/application.rb
|
169
198
|
- lib/staticky/builder.rb
|
170
199
|
- lib/staticky/cli.rb
|
171
|
-
- lib/staticky/
|
200
|
+
- lib/staticky/cli/commands.rb
|
201
|
+
- lib/staticky/cli/commands/build.rb
|
202
|
+
- lib/staticky/cli/commands/generate.rb
|
203
|
+
- lib/staticky/cli/commands/version.rb
|
172
204
|
- lib/staticky/deps.rb
|
173
205
|
- lib/staticky/environment.rb
|
174
206
|
- lib/staticky/error.rb
|
175
207
|
- lib/staticky/filesystem.rb
|
176
208
|
- lib/staticky/generator.rb
|
177
209
|
- lib/staticky/phlex/view_helpers.rb
|
210
|
+
- lib/staticky/pluggable.rb
|
178
211
|
- lib/staticky/resource.rb
|
212
|
+
- lib/staticky/resources/plugins.rb
|
213
|
+
- lib/staticky/resources/plugins/phlex.rb
|
214
|
+
- lib/staticky/resources/plugins/prelude.rb
|
179
215
|
- lib/staticky/router.rb
|
180
|
-
- lib/staticky/
|
216
|
+
- lib/staticky/routing/plugins.rb
|
217
|
+
- lib/staticky/routing/plugins/prelude.rb
|
181
218
|
- lib/staticky/server.rb
|
219
|
+
- lib/staticky/server_plugin.rb
|
220
|
+
- lib/staticky/server_plugins/live_reloading.rb
|
221
|
+
- lib/staticky/utils.rb
|
182
222
|
- lib/staticky/version.rb
|
183
|
-
- lib/staticky/view_context.rb
|
184
223
|
- site_template/.dockerignore
|
185
224
|
- site_template/.gitignore
|
186
225
|
- site_template/.prettierrc
|
@@ -192,6 +231,9 @@ files:
|
|
192
231
|
- site_template/Procfile.dev
|
193
232
|
- site_template/README.md
|
194
233
|
- site_template/Rakefile
|
234
|
+
- site_template/app/views/application_component.rb
|
235
|
+
- site_template/app/views/application_layout.rb
|
236
|
+
- site_template/app/views/application_page.rb
|
195
237
|
- site_template/app/views/errors/not_found.rb
|
196
238
|
- site_template/app/views/errors/service_error.rb
|
197
239
|
- site_template/app/views/layouts/error.rb
|
@@ -203,10 +245,11 @@ files:
|
|
203
245
|
- site_template/app/views/ui/navbar.rb
|
204
246
|
- site_template/bin/console
|
205
247
|
- site_template/bin/dev
|
206
|
-
- site_template/bin/
|
248
|
+
- site_template/bin/setup
|
207
249
|
- site_template/bin/staticky
|
208
250
|
- site_template/config.ru
|
209
251
|
- site_template/config/boot.rb
|
252
|
+
- site_template/config/puma.rb
|
210
253
|
- site_template/config/routes.rb
|
211
254
|
- site_template/config/site.erb
|
212
255
|
- site_template/config/staticky.rb
|
@@ -221,11 +264,7 @@ files:
|
|
221
264
|
- site_template/frontend/stylesheets/application.css
|
222
265
|
- site_template/frontend/stylesheets/syntax.css
|
223
266
|
- site_template/frontend/tailwindcss/variable_font_plugin.js
|
224
|
-
- site_template/frontend/turbo_transitions.js
|
225
|
-
- site_template/lib/component.rb
|
226
267
|
- site_template/lib/icon.rb
|
227
|
-
- site_template/lib/layout.rb
|
228
|
-
- site_template/lib/page.rb
|
229
268
|
- site_template/lib/vite_helpers.rb
|
230
269
|
- site_template/logs/.keep
|
231
270
|
- site_template/nginx.conf
|
@@ -267,7 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
306
|
- !ruby/object:Gem::Version
|
268
307
|
version: '0'
|
269
308
|
requirements: []
|
270
|
-
rubygems_version: 3.5.
|
309
|
+
rubygems_version: 3.5.22
|
271
310
|
signing_key:
|
272
311
|
specification_version: 4
|
273
312
|
summary: Static site
|
data/lib/staticky/container.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Staticky
|
4
|
-
class Container < Dry::System::Container
|
5
|
-
use :env
|
6
|
-
use :zeitwerk
|
7
|
-
use :monitoring
|
8
|
-
|
9
|
-
configure do |config|
|
10
|
-
config.root = Pathname(__dir__).join("..").join("..")
|
11
|
-
config.inflector = Dry::Inflector.new do |inflections|
|
12
|
-
inflections.acronym("CLI")
|
13
|
-
end
|
14
|
-
config.component_dirs.add "lib" do |dir|
|
15
|
-
dir.add_to_load_path = false
|
16
|
-
dir.auto_register = false
|
17
|
-
dir.namespaces.add "staticky", key: nil
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
register(:files, Staticky::Filesystem.real)
|
22
|
-
register(:router, Staticky::Router.new)
|
23
|
-
register(:builder, Staticky::Builder.new)
|
24
|
-
register(:generator, Staticky::Generator.new)
|
25
|
-
end
|
26
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Staticky
|
4
|
-
class Router
|
5
|
-
class Definition
|
6
|
-
attr_reader :resources
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
@routes_by_path = {}
|
10
|
-
@routes_by_component = {}
|
11
|
-
@resources = []
|
12
|
-
end
|
13
|
-
|
14
|
-
def match(path, to:)
|
15
|
-
component = to.then do |object|
|
16
|
-
object.is_a?(Class) ? object.new : object
|
17
|
-
end
|
18
|
-
|
19
|
-
@resources << resource = Resource.new(url: path, component:)
|
20
|
-
@routes_by_path[path] = resource
|
21
|
-
@routes_by_component[component.class] = resource
|
22
|
-
end
|
23
|
-
|
24
|
-
def root(to:)
|
25
|
-
match("/", to:)
|
26
|
-
end
|
27
|
-
|
28
|
-
def resolve(path)
|
29
|
-
@routes_by_path.fetch(path) { @routes_by_component.fetch(path) }
|
30
|
-
end
|
31
|
-
|
32
|
-
def delete(path)
|
33
|
-
@routes.delete(path)
|
34
|
-
end
|
35
|
-
|
36
|
-
def filepaths
|
37
|
-
@resources.map { |resource| rename_key(resource.url) }
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
|
42
|
-
def rename_key(key)
|
43
|
-
return "index.html" if key == "/"
|
44
|
-
|
45
|
-
"#{key}.html"
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
document.addEventListener("turbo:visit", () => {
|
2
|
-
let main = document.querySelector("main");
|
3
|
-
if (main.dataset.turboTransition == "false") return;
|
4
|
-
|
5
|
-
let [movement, scale] = ["15px", "0.99"];
|
6
|
-
|
7
|
-
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
8
|
-
[movement, scale] = ["7px", "1"];
|
9
|
-
}
|
10
|
-
|
11
|
-
main.style.transformOrigin = "50% 0%";
|
12
|
-
main.dataset.animatingOut = true;
|
13
|
-
|
14
|
-
main.animate(
|
15
|
-
[
|
16
|
-
{ opacity: 1, transform: "translateY(0px) scale(1)" },
|
17
|
-
{ opacity: 0, transform: `translateY(${movement}) scale(${scale})` },
|
18
|
-
],
|
19
|
-
{
|
20
|
-
duration: 300,
|
21
|
-
easing: "cubic-bezier(0.45, 0, 0.55, 1)",
|
22
|
-
fill: "forwards",
|
23
|
-
},
|
24
|
-
);
|
25
|
-
|
26
|
-
Promise.all(main.getAnimations().map((animation) => animation.finished)).then(
|
27
|
-
() => {
|
28
|
-
if (main.dataset.animatingOut) main.style.visibility = "hidden";
|
29
|
-
},
|
30
|
-
);
|
31
|
-
});
|
32
|
-
|
33
|
-
document.addEventListener("turbo:load", () => {
|
34
|
-
let main = document.querySelector("main");
|
35
|
-
if (main.dataset.turboTransition == "false") return;
|
36
|
-
|
37
|
-
let [movement, scale] = ["-10px", "0.99"];
|
38
|
-
|
39
|
-
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
40
|
-
[movement, scale] = ["-5px", "1"];
|
41
|
-
}
|
42
|
-
|
43
|
-
main.style.visibility = "visible";
|
44
|
-
main.style.transformOrigin = "50% 0%";
|
45
|
-
delete main.dataset.animatingOut;
|
46
|
-
|
47
|
-
main.animate(
|
48
|
-
[
|
49
|
-
{ opacity: 0, transform: `translateY(${movement}) scale(${scale})` },
|
50
|
-
{ opacity: 1, transform: "translateY(0px) scale(1)" },
|
51
|
-
],
|
52
|
-
{ duration: 150, easing: "cubic-bezier(0.45, 0, 0.55, 1)" },
|
53
|
-
);
|
54
|
-
});
|
data/site_template/lib/layout.rb
DELETED