utopia 3.0.3 → 3.0.5

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.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -161,14 +161,14 @@ dependencies:
161
161
  requirements:
162
162
  - - "~>"
163
163
  - !ruby/object:Gem::Version
164
- version: '0.70'
164
+ version: '0.71'
165
165
  type: :runtime
166
166
  prerelease: false
167
167
  version_requirements: !ruby/object:Gem::Requirement
168
168
  requirements:
169
169
  - - "~>"
170
170
  - !ruby/object:Gem::Version
171
- version: '0.70'
171
+ version: '0.71'
172
172
  - !ruby/object:Gem::Dependency
173
173
  name: protocol-media
174
174
  requirement: !ruby/object:Gem::Requirement
@@ -272,8 +272,8 @@ extensions: []
272
272
  extra_rdoc_files: []
273
273
  files:
274
274
  - bake/utopia.rb
275
+ - bake/utopia/components.rb
275
276
  - bake/utopia/environment.rb
276
- - bake/utopia/node.rb
277
277
  - bake/utopia/server.rb
278
278
  - bake/utopia/shell.rb
279
279
  - bake/utopia/site.rb
@@ -285,8 +285,12 @@ files:
285
285
  - context/server-setup.md
286
286
  - context/updating-utopia.md
287
287
  - context/what-is-xnode.md
288
+ - lib/traces/provider/utopia.rb
289
+ - lib/traces/provider/utopia/content/middleware.rb
290
+ - lib/traces/provider/utopia/static/middleware.rb
288
291
  - lib/utopia.rb
289
292
  - lib/utopia/application.rb
293
+ - lib/utopia/components.rb
290
294
  - lib/utopia/content.rb
291
295
  - lib/utopia/content/builder.rb
292
296
  - lib/utopia/content/document.rb
@@ -310,6 +314,7 @@ files:
310
314
  - lib/utopia/controller/rewrite.rb
311
315
  - lib/utopia/controller/variables.rb
312
316
  - lib/utopia/exceptions.rb
317
+ - lib/utopia/exceptions/application_errors.rb
313
318
  - lib/utopia/exceptions/handler.rb
314
319
  - lib/utopia/exceptions/mailer.rb
315
320
  - lib/utopia/extensions/array_split.rb
metadata.gz.sig CHANGED
Binary file
data/bake/utopia/node.rb DELETED
@@ -1,87 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Released under the MIT License.
4
- # Copyright, 2016-2025, by Samuel Williams.
5
-
6
- NPM = ENV["NPM"] || "npm"
7
-
8
- def update
9
- require "fileutils"
10
- require "utopia/path"
11
-
12
- root = Pathname.new(context.root)
13
- package_root = root + "node_modules"
14
-
15
- # This is a legacy path:
16
- unless package_root.directory?
17
- package_root = root + "lib/components"
18
- end
19
-
20
- install_root = root + "public/_components"
21
-
22
- # Fetch only production dependencies using `npm ls --production`
23
- production_packages = fetch_production_packages(package_root)
24
- package_paths = expand_package_paths(package_root).select do |path|
25
- package_name = path.relative_path_from(package_root).to_s
26
- production_packages.include?(package_name)
27
- end
28
-
29
- package_paths.each do |package_path|
30
- package_directory = package_path.relative_path_from(package_root)
31
- install_path = install_root + package_directory
32
-
33
- dist_path = package_path + "dist"
34
-
35
- FileUtils::Verbose.rm_rf(install_path)
36
- FileUtils::Verbose.mkpath(install_path.dirname)
37
-
38
- # If a package has a dist directory, we only symlink that... otherwise we have to do the entire package, and hope that bower's ignore was setup correctly:
39
- if dist_path.exist?
40
- link_path = Utopia::Path.shortest_path(dist_path, install_path)
41
- else
42
- link_path = Utopia::Path.shortest_path(package_path, install_path)
43
- end
44
-
45
- FileUtils::Verbose.cp_r File.expand_path(link_path, install_path), install_path
46
- end
47
- end
48
-
49
- private
50
-
51
- def fetch_production_packages(package_root)
52
- require "json"
53
- require "open3"
54
-
55
- stdout, _status = Open3.capture2(NPM, "ls", "--production", "--json", chdir: package_root.to_s)
56
-
57
- json = JSON.parse(stdout)
58
-
59
- flatten_package_dependencies(json).sort.uniq
60
- end
61
-
62
- def flatten_package_dependencies(json, into = [])
63
- if json["dependencies"]
64
- json["dependencies"].each do |name, details|
65
- into << name
66
- flatten_package_dependencies(details, into)
67
- end
68
- end
69
-
70
- return into
71
- end
72
-
73
- def expand_package_paths(root, into = [])
74
- paths = root.children.select(&:directory?)
75
-
76
- paths.each do |path|
77
- basename = path.basename.to_s
78
- # Handle organisation sub-directories which start with an '@' symbol:
79
- if basename.start_with?("@")
80
- expand_package_paths(path, into)
81
- else
82
- into << path
83
- end
84
- end
85
-
86
- return into
87
- end