bridgetown-core 1.0.0.alpha8 → 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -0
  3. data/bin/bridgetown +14 -2
  4. data/bridgetown-core.gemspec +5 -4
  5. data/lib/bridgetown-core/collection.rb +6 -6
  6. data/lib/bridgetown-core/commands/base.rb +18 -18
  7. data/lib/bridgetown-core/commands/build.rb +1 -1
  8. data/lib/bridgetown-core/commands/clean.rb +2 -2
  9. data/lib/bridgetown-core/commands/concerns/configuration_overridable.rb +7 -0
  10. data/lib/bridgetown-core/commands/console.rb +39 -12
  11. data/lib/bridgetown-core/commands/doctor.rb +8 -5
  12. data/lib/bridgetown-core/commands/esbuild/esbuild.config.js +27 -0
  13. data/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb +216 -0
  14. data/lib/bridgetown-core/commands/esbuild/migrate-from-webpack.rb +47 -0
  15. data/lib/bridgetown-core/commands/esbuild/setup.rb +4 -0
  16. data/lib/bridgetown-core/commands/esbuild/update.rb +4 -0
  17. data/lib/bridgetown-core/commands/esbuild.rb +83 -0
  18. data/lib/bridgetown-core/commands/new.rb +80 -10
  19. data/lib/bridgetown-core/commands/plugins.rb +1 -1
  20. data/lib/bridgetown-core/commands/webpack/enable-postcss.rb +1 -1
  21. data/lib/bridgetown-core/commands/webpack/update.rb +3 -3
  22. data/lib/bridgetown-core/commands/webpack/webpack.defaults.js.erb +1 -1
  23. data/lib/bridgetown-core/commands/webpack.rb +3 -3
  24. data/lib/bridgetown-core/component.rb +9 -3
  25. data/lib/bridgetown-core/concerns/site/configurable.rb +4 -0
  26. data/lib/bridgetown-core/concerns/site/content.rb +4 -4
  27. data/lib/bridgetown-core/concerns/site/extensible.rb +8 -0
  28. data/lib/bridgetown-core/concerns/site/processable.rb +22 -4
  29. data/lib/bridgetown-core/concerns/site/ssr.rb +2 -17
  30. data/lib/bridgetown-core/configurations/minitesting.rb +1 -1
  31. data/lib/bridgetown-core/configurations/purgecss.rb +2 -1
  32. data/lib/bridgetown-core/configurations/render/render.yaml.erb +3 -0
  33. data/lib/bridgetown-core/configurations/stimulus.rb +40 -12
  34. data/lib/bridgetown-core/configurations/tailwindcss/css_imports.css +5 -0
  35. data/lib/bridgetown-core/configurations/tailwindcss.rb +31 -2
  36. data/lib/bridgetown-core/configurations/turbo/turbo_transitions.js +48 -0
  37. data/lib/bridgetown-core/configurations/turbo.rb +15 -5
  38. data/lib/bridgetown-core/converters/erb_templates.rb +2 -2
  39. data/lib/bridgetown-core/converters/ruby_templates.rb +1 -1
  40. data/lib/bridgetown-core/converters/serbea_templates.rb +71 -0
  41. data/lib/bridgetown-core/drops/drop.rb +1 -1
  42. data/lib/bridgetown-core/drops/resource_drop.rb +28 -5
  43. data/lib/bridgetown-core/errors.rb +21 -0
  44. data/lib/bridgetown-core/generators/prototype_generator.rb +3 -3
  45. data/lib/bridgetown-core/helpers.rb +3 -2
  46. data/lib/bridgetown-core/hooks.rb +51 -20
  47. data/lib/bridgetown-core/liquid_renderer/file_system.rb +1 -3
  48. data/lib/bridgetown-core/model/base.rb +24 -1
  49. data/lib/bridgetown-core/model/origin.rb +4 -6
  50. data/lib/bridgetown-core/model/repo_origin.rb +48 -0
  51. data/lib/bridgetown-core/rack/boot.rb +5 -9
  52. data/lib/bridgetown-core/rack/roda.rb +4 -5
  53. data/lib/bridgetown-core/rack/routes.rb +44 -10
  54. data/lib/bridgetown-core/rack/static_indexes.rb +2 -0
  55. data/lib/bridgetown-core/resource/base.rb +2 -0
  56. data/lib/bridgetown-core/ruby_template_view.rb +4 -0
  57. data/lib/bridgetown-core/tags/{webpack_path.rb → asset_path.rb} +7 -9
  58. data/lib/bridgetown-core/tasks/bridgetown_tasks.rake +2 -1
  59. data/lib/bridgetown-core/utils/loaders_manager.rb +11 -0
  60. data/lib/bridgetown-core/utils.rb +88 -30
  61. data/lib/bridgetown-core/version.rb +1 -1
  62. data/lib/bridgetown-core/watcher.rb +74 -70
  63. data/lib/bridgetown-core.rb +1 -1
  64. data/lib/site_template/Gemfile.erb +17 -11
  65. data/lib/site_template/README.md +2 -2
  66. data/lib/site_template/{Rakefile → Rakefile.erb} +15 -0
  67. data/lib/site_template/TEMPLATES/erb/_components/shared/navbar.erb +11 -0
  68. data/lib/site_template/TEMPLATES/erb/_components/shared/navbar.rb +5 -0
  69. data/lib/site_template/TEMPLATES/erb/_layouts/default.erb +15 -0
  70. data/lib/site_template/TEMPLATES/erb/_layouts/page.erb +7 -0
  71. data/lib/site_template/TEMPLATES/erb/_layouts/post.erb +7 -0
  72. data/lib/site_template/TEMPLATES/erb/_partials/_footer.erb +3 -0
  73. data/lib/site_template/TEMPLATES/erb/_partials/_head.erb +10 -0
  74. data/lib/site_template/{src → TEMPLATES/liquid}/_components/footer.liquid +0 -0
  75. data/lib/site_template/TEMPLATES/liquid/_components/head.liquid +10 -0
  76. data/lib/site_template/TEMPLATES/liquid/_components/navbar.liquid +11 -0
  77. data/lib/site_template/{src → TEMPLATES/liquid}/_layouts/default.liquid +2 -2
  78. data/lib/site_template/{src → TEMPLATES/liquid}/_layouts/page.liquid +0 -0
  79. data/lib/site_template/{src → TEMPLATES/liquid}/_layouts/post.liquid +0 -0
  80. data/lib/site_template/TEMPLATES/serbea/_components/shared/navbar.rb +5 -0
  81. data/lib/site_template/TEMPLATES/serbea/_components/shared/navbar.serb +11 -0
  82. data/lib/site_template/TEMPLATES/serbea/_layouts/default.serb +15 -0
  83. data/lib/site_template/TEMPLATES/serbea/_layouts/page.serb +7 -0
  84. data/lib/site_template/TEMPLATES/serbea/_layouts/post.serb +7 -0
  85. data/lib/site_template/TEMPLATES/serbea/_partials/_footer.serb +3 -0
  86. data/lib/site_template/TEMPLATES/serbea/_partials/_head.serb +10 -0
  87. data/lib/site_template/frontend/javascript/index.js.erb +7 -3
  88. data/lib/site_template/frontend/styles/index.css +71 -6
  89. data/lib/site_template/package.json.erb +24 -9
  90. data/lib/site_template/ruby-version.erb +1 -0
  91. data/lib/site_template/server/roda_app.rb +5 -3
  92. data/lib/site_template/server/routes/hello.rb.sample +1 -1
  93. data/lib/site_template/src/images/logo.svg +91 -0
  94. data/lib/site_template/src/index.md.erb +22 -0
  95. data/lib/site_template/src/posts.md.erb +28 -0
  96. metadata +82 -36
  97. data/lib/bridgetown-core/configurations/swup.rb +0 -37
  98. data/lib/site_template/frontend/styles/index.scss +0 -17
  99. data/lib/site_template/src/_components/head.liquid +0 -10
  100. data/lib/site_template/src/_components/navbar.liquid +0 -5
  101. data/lib/site_template/src/_layouts/home.liquid +0 -7
  102. data/lib/site_template/src/images/.keep +0 -1
  103. data/lib/site_template/src/index.md +0 -7
  104. data/lib/site_template/src/posts.md +0 -14
metadata CHANGED
@@ -1,43 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha8
4
+ version: 1.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-05 00:00:00.000000000 Z
11
+ date: 2022-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '6.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '8.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '6.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '8.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: activesupport
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - ">="
32
38
  - !ruby/object:Gem::Version
33
39
  version: '6.0'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '8.0'
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - "~>"
47
+ - - ">="
39
48
  - !ruby/object:Gem::Version
40
49
  version: '6.0'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '8.0'
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: addressable
43
55
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +140,14 @@ dependencies:
128
140
  requirements:
129
141
  - - "~>"
130
142
  - !ruby/object:Gem::Version
131
- version: '1.0'
143
+ version: '1.2'
132
144
  type: :runtime
133
145
  prerelease: false
134
146
  version_requirements: !ruby/object:Gem::Requirement
135
147
  requirements:
136
148
  - - "~>"
137
149
  - !ruby/object:Gem::Version
138
- version: '1.0'
150
+ version: '1.2'
139
151
  - !ruby/object:Gem::Dependency
140
152
  name: i18n
141
153
  requirement: !ruby/object:Gem::Requirement
@@ -192,20 +204,6 @@ dependencies:
192
204
  - - "~>"
193
205
  - !ruby/object:Gem::Version
194
206
  version: '5.0'
195
- - !ruby/object:Gem::Dependency
196
- name: liquid-component
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0.1'
202
- type: :runtime
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0.1'
209
207
  - !ruby/object:Gem::Dependency
210
208
  name: listen
211
209
  requirement: !ruby/object:Gem::Requirement
@@ -276,6 +274,20 @@ dependencies:
276
274
  - - "~>"
277
275
  - !ruby/object:Gem::Version
278
276
  version: '3.0'
277
+ - !ruby/object:Gem::Dependency
278
+ name: serbea
279
+ requirement: !ruby/object:Gem::Requirement
280
+ requirements:
281
+ - - "~>"
282
+ - !ruby/object:Gem::Version
283
+ version: '1.0'
284
+ type: :runtime
285
+ prerelease: false
286
+ version_requirements: !ruby/object:Gem::Requirement
287
+ requirements:
288
+ - - "~>"
289
+ - !ruby/object:Gem::Version
290
+ version: '1.0'
279
291
  - !ruby/object:Gem::Dependency
280
292
  name: terminal-table
281
293
  requirement: !ruby/object:Gem::Requirement
@@ -332,6 +344,20 @@ dependencies:
332
344
  - - "~>"
333
345
  - !ruby/object:Gem::Version
334
346
  version: '1.7'
347
+ - !ruby/object:Gem::Dependency
348
+ name: zeitwerk
349
+ requirement: !ruby/object:Gem::Requirement
350
+ requirements:
351
+ - - "~>"
352
+ - !ruby/object:Gem::Version
353
+ version: '2.5'
354
+ type: :runtime
355
+ prerelease: false
356
+ version_requirements: !ruby/object:Gem::Requirement
357
+ requirements:
358
+ - - "~>"
359
+ - !ruby/object:Gem::Version
360
+ version: '2.5'
335
361
  description: Bridgetown is a Webpack-aware, Ruby-powered static site generator for
336
362
  the modern Jamstack era
337
363
  email: maintainers@bridgetownrb.com
@@ -361,6 +387,12 @@ files:
361
387
  - lib/bridgetown-core/commands/configure.rb
362
388
  - lib/bridgetown-core/commands/console.rb
363
389
  - lib/bridgetown-core/commands/doctor.rb
390
+ - lib/bridgetown-core/commands/esbuild.rb
391
+ - lib/bridgetown-core/commands/esbuild/esbuild.config.js
392
+ - lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb
393
+ - lib/bridgetown-core/commands/esbuild/migrate-from-webpack.rb
394
+ - lib/bridgetown-core/commands/esbuild/setup.rb
395
+ - lib/bridgetown-core/commands/esbuild/update.rb
364
396
  - lib/bridgetown-core/commands/new.rb
365
397
  - lib/bridgetown-core/commands/plugins.rb
366
398
  - lib/bridgetown-core/commands/registrations.rb
@@ -406,11 +438,11 @@ files:
406
438
  - lib/bridgetown-core/configurations/render.rb
407
439
  - lib/bridgetown-core/configurations/render/render.yaml.erb
408
440
  - lib/bridgetown-core/configurations/stimulus.rb
409
- - lib/bridgetown-core/configurations/swup.rb
410
441
  - lib/bridgetown-core/configurations/tailwindcss.rb
411
442
  - lib/bridgetown-core/configurations/tailwindcss/css_imports.css
412
443
  - lib/bridgetown-core/configurations/tailwindcss/postcss.config.js
413
444
  - lib/bridgetown-core/configurations/turbo.rb
445
+ - lib/bridgetown-core/configurations/turbo/turbo_transitions.js
414
446
  - lib/bridgetown-core/converter.rb
415
447
  - lib/bridgetown-core/converters/erb_templates.rb
416
448
  - lib/bridgetown-core/converters/identity.rb
@@ -418,6 +450,7 @@ files:
418
450
  - lib/bridgetown-core/converters/markdown.rb
419
451
  - lib/bridgetown-core/converters/markdown/kramdown_parser.rb
420
452
  - lib/bridgetown-core/converters/ruby_templates.rb
453
+ - lib/bridgetown-core/converters/serbea_templates.rb
421
454
  - lib/bridgetown-core/converters/smartypants.rb
422
455
  - lib/bridgetown-core/core_ext/psych.rb
423
456
  - lib/bridgetown-core/current.rb
@@ -483,6 +516,7 @@ files:
483
516
  - lib/bridgetown-core/ruby_template_view.rb
484
517
  - lib/bridgetown-core/site.rb
485
518
  - lib/bridgetown-core/static_file.rb
519
+ - lib/bridgetown-core/tags/asset_path.rb
486
520
  - lib/bridgetown-core/tags/class_map.rb
487
521
  - lib/bridgetown-core/tags/find.rb
488
522
  - lib/bridgetown-core/tags/highlight.rb
@@ -491,7 +525,6 @@ files:
491
525
  - lib/bridgetown-core/tags/post_url.rb
492
526
  - lib/bridgetown-core/tags/render_content.rb
493
527
  - lib/bridgetown-core/tags/t.rb
494
- - lib/bridgetown-core/tags/webpack_path.rb
495
528
  - lib/bridgetown-core/tags/with.rb
496
529
  - lib/bridgetown-core/tasks/bridgetown_tasks.rake
497
530
  - lib/bridgetown-core/url.rb
@@ -508,34 +541,47 @@ files:
508
541
  - lib/site_template/.gitignore
509
542
  - lib/site_template/Gemfile.erb
510
543
  - lib/site_template/README.md
511
- - lib/site_template/Rakefile
544
+ - lib/site_template/Rakefile.erb
545
+ - lib/site_template/TEMPLATES/erb/_components/shared/navbar.erb
546
+ - lib/site_template/TEMPLATES/erb/_components/shared/navbar.rb
547
+ - lib/site_template/TEMPLATES/erb/_layouts/default.erb
548
+ - lib/site_template/TEMPLATES/erb/_layouts/page.erb
549
+ - lib/site_template/TEMPLATES/erb/_layouts/post.erb
550
+ - lib/site_template/TEMPLATES/erb/_partials/_footer.erb
551
+ - lib/site_template/TEMPLATES/erb/_partials/_head.erb
552
+ - lib/site_template/TEMPLATES/liquid/_components/footer.liquid
553
+ - lib/site_template/TEMPLATES/liquid/_components/head.liquid
554
+ - lib/site_template/TEMPLATES/liquid/_components/navbar.liquid
555
+ - lib/site_template/TEMPLATES/liquid/_layouts/default.liquid
556
+ - lib/site_template/TEMPLATES/liquid/_layouts/page.liquid
557
+ - lib/site_template/TEMPLATES/liquid/_layouts/post.liquid
558
+ - lib/site_template/TEMPLATES/serbea/_components/shared/navbar.rb
559
+ - lib/site_template/TEMPLATES/serbea/_components/shared/navbar.serb
560
+ - lib/site_template/TEMPLATES/serbea/_layouts/default.serb
561
+ - lib/site_template/TEMPLATES/serbea/_layouts/page.serb
562
+ - lib/site_template/TEMPLATES/serbea/_layouts/post.serb
563
+ - lib/site_template/TEMPLATES/serbea/_partials/_footer.serb
564
+ - lib/site_template/TEMPLATES/serbea/_partials/_head.serb
512
565
  - lib/site_template/bridgetown.config.yml
513
566
  - lib/site_template/config.ru
514
567
  - lib/site_template/config/puma.rb
515
568
  - lib/site_template/frontend/javascript/index.js.erb
516
569
  - lib/site_template/frontend/styles/index.css
517
- - lib/site_template/frontend/styles/index.scss
518
570
  - lib/site_template/package.json.erb
519
571
  - lib/site_template/plugins/builders/.keep
520
572
  - lib/site_template/plugins/site_builder.rb
521
573
  - lib/site_template/postcss.config.js.erb
574
+ - lib/site_template/ruby-version.erb
522
575
  - lib/site_template/server/roda_app.rb
523
576
  - lib/site_template/server/routes/hello.rb.sample
524
577
  - lib/site_template/src/404.html
525
- - lib/site_template/src/_components/footer.liquid
526
- - lib/site_template/src/_components/head.liquid
527
- - lib/site_template/src/_components/navbar.liquid
528
578
  - lib/site_template/src/_data/site_metadata.yml
529
- - lib/site_template/src/_layouts/default.liquid
530
- - lib/site_template/src/_layouts/home.liquid
531
- - lib/site_template/src/_layouts/page.liquid
532
- - lib/site_template/src/_layouts/post.liquid
533
579
  - lib/site_template/src/_posts/0000-00-00-welcome-to-bridgetown.md.erb
534
580
  - lib/site_template/src/about.md
535
581
  - lib/site_template/src/favicon.ico
536
- - lib/site_template/src/images/.keep
537
- - lib/site_template/src/index.md
538
- - lib/site_template/src/posts.md
582
+ - lib/site_template/src/images/logo.svg
583
+ - lib/site_template/src/index.md.erb
584
+ - lib/site_template/src/posts.md.erb
539
585
  homepage: https://www.bridgetownrb.com
540
586
  licenses:
541
587
  - MIT
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # rubocop:disable all
4
-
5
- packages = "swup @swup/body-class-plugin @swup/scroll-plugin @swup/fade-theme"
6
- say_status :swup, "Adding the following yarn packages: #{packages}"
7
- system("yarn add #{packages}")
8
-
9
- javascript_import do
10
- <<~JS
11
- import Swup from "swup"
12
- import SwupBodyClassPlugin from "@swup/body-class-plugin"
13
- import SwupScrollPlugin from "@swup/scroll-plugin"
14
- import SwupFadeTheme from "@swup/fade-theme"
15
- const swup = new Swup({
16
- plugins: [
17
- new SwupBodyClassPlugin(),
18
- new SwupScrollPlugin(),
19
- new SwupFadeTheme(),
20
- ]
21
- })
22
- JS
23
- end
24
-
25
- css_index = File.exist?(File.expand_path("frontend/styles/index.scss", destination_root)) ? "frontend/styles/index.scss" : "frontend/styles/index.css"
26
- append_to_file css_index do
27
- <<~CSS
28
- .swup-transition-main {
29
- transition: opacity .2s;
30
- }
31
- CSS
32
- end
33
-
34
- say_status :swup, "All done! Edit .swup-transition-main in #{css_index} if you wish to adjust the transition animation"
35
- say_status :swup, "Make sure you add id=\"swup\" to the primary container of your HTML layout (perhaps <main>)"
36
-
37
- # rubocop:enable all
@@ -1,17 +0,0 @@
1
- $body-background: #fafafa;
2
- $body-color: #444;
3
-
4
- body {
5
- background: $body-background;
6
- color: $body-color;
7
- font-family: sans-serif;
8
- }
9
-
10
- h1, nav, footer {
11
- text-align: center;
12
- }
13
-
14
- main {
15
- margin: 4rem auto;
16
- max-width: 60rem;
17
- }
@@ -1,10 +0,0 @@
1
- <meta charset="utf-8" />
2
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
3
- {% capture page_title %}{{ title | strip_html | strip_newlines }}{% endcapture %}
4
- <title>{% if page_title != "Index" %}{{ page_title | escape }} | {{ metadata.title | escape }}{% else %}{{ metadata.title | escape }}: {{ metadata.tagline | escape }}{% endif %}</title>
5
-
6
- <meta name="description" content="{{ metadata.description }}" />
7
-
8
- <link rel="stylesheet" href="{% webpack_path css %}" />
9
- <script src="{% webpack_path js %}" defer></script>
10
- {% live_reload_dev_js %}
@@ -1,5 +0,0 @@
1
- <nav>
2
- <a href="/">Home</a>
3
- <a href="/about">About</a>
4
- <a href="/posts">Posts</a>
5
- </nav>
@@ -1,7 +0,0 @@
1
- ---
2
- layout: default
3
- ---
4
-
5
- <h1>Home Page</h1>
6
-
7
- {{ content }}
@@ -1 +0,0 @@
1
-
@@ -1,7 +0,0 @@
1
- ---
2
- # Feel free to add content and custom Front Matter to this file.
3
-
4
- layout: home
5
- ---
6
-
7
- Welcome to Bridgetown!
@@ -1,14 +0,0 @@
1
- ---
2
- layout: page
3
- title: Posts
4
- ---
5
-
6
- <ul>
7
- {% for post in collections.posts.resources %}
8
- <li>
9
- <a href="{{ post.relative_url }}">{{ post.title }}</a>
10
- </li>
11
- {% endfor %}
12
- </ul>
13
-
14
- If you have a lot of posts, you may want to consider adding [pagination](https://www.bridgetownrb.com/docs/content/pagination)!