lifer 0.14.0 → 0.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4416a9edb890d8d98adc06d1baf7e58b695d85da827b48005d7285b6f5a1dbe
4
- data.tar.gz: 0c45a40304601d473c946315ddea56860041339e029467f8bcecb603ca70a58a
3
+ metadata.gz: 3c77559664e99b814d3c3bd2b34926662fc12f89965e1b51677abb7a616fd254
4
+ data.tar.gz: 1e75c5a25907dd5308331f5b443d8c4a1c2dc9ca5585a835347942e34fc8c79f
5
5
  SHA512:
6
- metadata.gz: b8aa3c53f350191b59ff5105ac1130c62c4a2f690aca83794877b933e7d7bfa23e501d2c91bd90dfc4954a4db9edf57b5db8ea4c4bf75fe78aa3e3e3e7e20e0c
7
- data.tar.gz: f9b729936ec8ef025d9bc6dc8b6deab6d4d63c1d281da50e99df5932cd1f245c581c911378a703f1ddb7e6a5167f21fa746a780ac9e9ad72f29721d93bf34215
6
+ metadata.gz: 7bb00955fd017e0608f4c937750cefc746f657c38676e4b9c8493475caee85a39100b2964a30a8310ffd005252366830e18c6a9ac5efd2aefb2a6c1bbd9093a3
7
+ data.tar.gz: 34055e44ec3254f7415bf3d9c306c6be450c4a9bccb6b28b41f3424c56a72821ea23887024fdfa6c3cd5a6e03e82fa64b584d5abde29d72ea023e1d8bdb72f2f
data/CHANGELOG.md CHANGED
@@ -1,4 +1,21 @@
1
1
  ## Next
2
+ ## v0.15.0
3
+
4
+ The theme for this release is improved error messaging
5
+
6
+ - If the project root is equal to the `Lifer.gem_root`, we now exit before
7
+ attempting to build. This is just a quality-of-life improvement for
8
+ developers, to ensure that the project and Lifer development environment
9
+ are isolated from each other.
10
+ - When building HTML from Liquid templates, we now use the `:strict2`
11
+ error mode and the error-raising `#render!` method for Liquid documents
12
+ now. This results in build failing early rather than Liquid builds succeeding
13
+ with entry contents that include strings like "Liquid error: blah blah."
14
+ - When any entry fails to build for some reason, we now rescue the error,
15
+ inject an error message and entry context into STDOUT, and then re-raise
16
+ the original error. This should improve the experience of debugging template
17
+ bugs in projects.
18
+
2
19
  ## v0.14.0
3
20
 
4
21
  This release includes some really nice improvements and bug fixes:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lifer (0.14.0)
4
+ lifer (0.15.0)
5
5
  base64
6
6
  i18n (< 2)
7
7
  kramdown (~> 2.4)
@@ -11,6 +11,14 @@ class Lifer::Builder
11
11
  # @return [String] The rendered entry.
12
12
  def build(entry:)
13
13
  new(entry: entry).build
14
+ rescue => error
15
+ Lifer::Message.error "builder.catchall_failure", context: {
16
+ entry_path: entry.path,
17
+ collection: entry.collection,
18
+ layout_file: entry.collection&.layout_file,
19
+ error_message: error.message
20
+ }.to_json
21
+ raise(error)
14
22
  end
15
23
  end
16
24
 
@@ -16,7 +16,7 @@ class Lifer::Builder::HTML::FromLiquid
16
16
  # @return [Lifer::Environment]
17
17
  def self.global
18
18
  Liquid::Environment.build do |environment|
19
- environment.error_mode = :strict
19
+ environment.error_mode = :strict2
20
20
 
21
21
  environment.file_system =
22
22
  Liquid::LocalFileSystem.new(Lifer.root, "%s.html.liquid")
@@ -40,7 +40,7 @@ class Lifer::Builder::HTML
40
40
  )
41
41
  document = Liquid::Template
42
42
  .parse(layout_file_contents, **parse_options)
43
- .render(document_context, **render_options)
43
+ .render!(document_context, **render_options)
44
44
 
45
45
  return document unless (relative_layout_path = frontmatter[:layout])
46
46
 
@@ -83,7 +83,7 @@ class Lifer::Builder::HTML
83
83
  def parse_options
84
84
  {
85
85
  environment: liquid_environment,
86
- error_mode: :strict
86
+ error_mode: :strict2
87
87
  }
88
88
  end
89
89
 
data/lib/lifer/cli.rb CHANGED
@@ -66,6 +66,11 @@ module Lifer
66
66
  parser.parse! args
67
67
 
68
68
  brain = Lifer.brain(**{root: @root, config_file: @config_file}.compact)
69
+ if brain.root == Lifer.gem_root
70
+ Lifer::Message.error("cli.pwd_is_gem_root", root: brain.root)
71
+ return
72
+ end
73
+
69
74
  brain.require_user_provided_ruby_files!
70
75
 
71
76
  case subcommand
data/lib/lifer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lifer
2
- VERSION = "0.14.0"
2
+ VERSION = "0.15.0"
3
3
  end
data/locales/en.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  en:
2
2
  builder:
3
+ catchall_failure: "Something failed during the build! Context:\n%{context}."
3
4
  file_conflict_error: "Cannot build HTML file because `%{path}` already exists."
4
5
  prebuild_failure: >
5
6
  Lifer failed to complete building... A prebuild step failed to execute: %{exception}
@@ -21,6 +22,7 @@ en:
21
22
  dump_default_config: Print the default configuration file to STDOUT and exit.
22
23
  port: Specify a custom port for the dev server.
23
24
  root: Specify the path to the Lifer project root.
25
+ pwd_is_gem_root: "Cannot build project at gem root: %{root}."
24
26
  subcommands:
25
27
  build: Build the Lifer project as configured in your Lifer configuration file.
26
28
  help: Display help text for the Lifer commandline interface.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lifer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - benjamin wil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-17 00:00:00.000000000 Z
11
+ date: 2026-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -229,8 +229,8 @@ licenses:
229
229
  - MIT
230
230
  metadata:
231
231
  allowed_push_host: https://rubygems.org
232
- homepage_uri: https://github.com/benjaminwil/lifer/blob/v0.14.0/README.md
233
- source_code_uri: https://github.com/benjaminwil/lifer/tree/v0.14.0
232
+ homepage_uri: https://github.com/benjaminwil/lifer/blob/v0.15.0/README.md
233
+ source_code_uri: https://github.com/benjaminwil/lifer/tree/v0.15.0
234
234
  changelog_uri: https://github.com/benjaminwil/lifer/blob/main/CHANGELOG.md
235
235
  post_install_message:
236
236
  rdoc_options: []