relaton-cli 2.2.0.pre.alpha.1 → 3.0.0.pre.alpha.4
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/.gitignore +4 -0
- data/CLAUDE.md +407 -1
- data/Gemfile +7 -7
- data/Rakefile +15 -0
- data/docs/README.adoc +183 -6
- data/frontend/dist/404.html +18 -0
- data/frontend/dist/app.iife.js +1 -0
- data/frontend/dist/style.css +3 -0
- data/lib/relaton/cli/command.rb +116 -0
- data/lib/relaton/cli/frontend_assets.rb +58 -0
- data/lib/relaton/cli/index_item_normalizer.rb +380 -0
- data/lib/relaton/cli/index_site_generator.rb +860 -0
- data/lib/relaton/cli/subcommand_collection.rb +3 -0
- data/lib/relaton/cli/version.rb +7 -1
- data/lib/relaton/cli.rb +5 -3
- data/lib/relaton-cli.rb +5 -0
- data/relaton-cli.gemspec +24 -9
- data/templates/index/page.liquid +20 -0
- metadata +18 -16
- data/.github/workflows/rake.yml +0 -14
- data/.github/workflows/release.yml +0 -24
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require "pubid"
|
|
1
2
|
require "relaton/cli/full_text_search"
|
|
2
3
|
|
|
3
4
|
module Relaton
|
|
@@ -130,6 +131,8 @@ module Relaton
|
|
|
130
131
|
File.write colfile, coll.to_yaml, encoding: "UTF-8"
|
|
131
132
|
else Util.info "No matching bibliographic entry found"
|
|
132
133
|
end
|
|
134
|
+
rescue Pubid::Errors::Error
|
|
135
|
+
Util.error %("#{code}" is not a recognized standards identifier)
|
|
133
136
|
end
|
|
134
137
|
|
|
135
138
|
desc "import FILE", "Import document or collection from an XML file " \
|
data/lib/relaton/cli/version.rb
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
# relaton-cli ships in lockstep with the combined `relaton` gem, so its version
|
|
2
|
+
# is that gem's version — the single source of truth in Relaton::VERSION. relaton
|
|
3
|
+
# is a hard runtime dependency, so requiring its lightweight version file always
|
|
4
|
+
# resolves. Don't hardcode a string here; it would silently drift on a bump.
|
|
5
|
+
require "relaton/version"
|
|
6
|
+
|
|
1
7
|
module Relaton
|
|
2
8
|
module Cli
|
|
3
|
-
VERSION =
|
|
9
|
+
VERSION = Relaton::VERSION
|
|
4
10
|
end
|
|
5
11
|
end
|
data/lib/relaton/cli.rb
CHANGED
|
@@ -43,12 +43,14 @@ module Relaton
|
|
|
43
43
|
def version
|
|
44
44
|
require "relaton/bib"
|
|
45
45
|
registry = Relaton::Db::Registry.instance
|
|
46
|
+
# Every flavor now ships inside the single `relaton` gem, so they all
|
|
47
|
+
# report Relaton::VERSION rather than a separate gem version.
|
|
46
48
|
puts "CLI => #{Relaton::Cli::VERSION}"
|
|
47
|
-
puts "relaton => #{
|
|
48
|
-
puts "relaton-bib => #{
|
|
49
|
+
puts "relaton => #{Relaton::VERSION}"
|
|
50
|
+
puts "relaton-bib => #{Relaton::VERSION}"
|
|
49
51
|
registry.processors.each_key do |k|
|
|
50
52
|
name = k.to_s.sub("_", "-")
|
|
51
|
-
puts "#{name} => #{
|
|
53
|
+
puts "#{name} => #{Relaton::VERSION}"
|
|
52
54
|
end
|
|
53
55
|
end
|
|
54
56
|
|
data/lib/relaton-cli.rb
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# The per-flavor `autoload` lines live in `relaton.rb`, not `relaton/db`.
|
|
2
|
+
# `index_name_for`/`pubid_class_for` resolve `Relaton::<Flavor>::INDEXFILE`, so
|
|
3
|
+
# without the umbrella every `--pubid-flavor` fails with "no relaton flavor".
|
|
4
|
+
# Declaring autoloads is cheap: no flavor is loaded until it is referenced.
|
|
5
|
+
require "relaton"
|
|
1
6
|
require "relaton/db"
|
|
2
7
|
|
|
3
8
|
module Relaton
|
data/relaton-cli.gemspec
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# relaton-cli is released in lockstep with the combined `relaton` gem from this
|
|
2
|
+
# repo. Derive the version (and the relaton dependency pin) from the single
|
|
3
|
+
# source of truth — root lib/relaton/version.rb — so `gem bump` on that one file
|
|
4
|
+
# re-stamps both gems. No separate version to hand-sync.
|
|
5
|
+
root_version_file = File.expand_path("../../lib/relaton/version.rb", __dir__)
|
|
6
|
+
relaton_version = File.read(root_version_file)[/VERSION\s*=\s*["']([^"']+)["']/, 1] or
|
|
7
|
+
raise "could not parse Relaton::VERSION from #{root_version_file}"
|
|
4
8
|
|
|
5
9
|
Gem::Specification.new do |spec|
|
|
6
10
|
spec.name = "relaton-cli"
|
|
7
|
-
spec.version =
|
|
11
|
+
spec.version = relaton_version
|
|
8
12
|
spec.authors = ["Ribose Inc."]
|
|
9
13
|
spec.email = ["open.source@ribose.com"]
|
|
10
14
|
|
|
@@ -13,9 +17,13 @@ Gem::Specification.new do |spec|
|
|
|
13
17
|
spec.homepage = "https://github.com/metanorma/relaton-cli"
|
|
14
18
|
spec.license = "BSD-2-Clause"
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
# Ship lib/, exe/, templates/ and the COMPILED frontend, but not the frontend
|
|
21
|
+
# sources/tooling. `frontend/dist` is gitignored (built by `rake build_frontend`
|
|
22
|
+
# at package/release time), so `git ls-files` won't list it — append it
|
|
23
|
+
# explicitly. Reject the tracked `frontend/` sources so they don't bloat the gem.
|
|
24
|
+
spec.files = (`git ls-files -z`.split("\x0").reject do |f|
|
|
25
|
+
f.match(%r{^(test|spec|features|docs|frontend)/})
|
|
26
|
+
end + Dir.glob("frontend/dist/*")).uniq
|
|
19
27
|
spec.extra_rdoc_files = %w[docs/README.adoc LICENSE]
|
|
20
28
|
spec.bindir = "exe"
|
|
21
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
@@ -23,8 +31,15 @@ Gem::Specification.new do |spec|
|
|
|
23
31
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
|
|
24
32
|
|
|
25
33
|
spec.add_dependency "liquid", "~> 5"
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
# The CLI requires "pubid" directly to rescue Pubid::Errors::Error when a
|
|
35
|
+
# reference is unparseable (see command.rb / subcommand_collection.rb). It is
|
|
36
|
+
# already a runtime dep of `relaton`, but declare it here too so the require
|
|
37
|
+
# is self-supporting rather than dependent on relaton's transitive graph.
|
|
38
|
+
# 2.0.0.pre.alpha.11 is the first pubid with `Pubid::Errors`.
|
|
39
|
+
spec.add_dependency "pubid", "~> 2.0.0.pre.alpha.13"
|
|
40
|
+
# relaton bundles every flavor plus Relaton::Bib, so depending on `relaton`
|
|
41
|
+
# alone is sufficient — relaton-bib is no longer published standalone.
|
|
42
|
+
spec.add_dependency "relaton", "= #{relaton_version}"
|
|
28
43
|
spec.add_dependency "thor"
|
|
29
44
|
spec.add_dependency "thor-hollaback"
|
|
30
45
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>{{ title | strip_html }}</title>
|
|
7
|
+
{%- if description %}
|
|
8
|
+
<meta name="description" content="{{ description | escape }}">
|
|
9
|
+
{%- endif %}
|
|
10
|
+
<meta name="generator" content="relaton-cli index">
|
|
11
|
+
{%- if favicon %}
|
|
12
|
+
<link rel="icon" href="{{ favicon | escape }}"{% if favicon_type %} type="{{ favicon_type }}"{% endif %}>
|
|
13
|
+
{%- endif %}
|
|
14
|
+
<style>{{ css }}</style>
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<div id="relaton-index-app" data-title="{{ title | escape }}" data-generated="{{ generated }}"{% if description %} data-description="{{ description | escape }}"{% endif %} data-total="{{ total }}" data-shards="{{ shards }}" data-shard-size="{{ shard_size }}" data-detail-shards="{{ detail_shards }}" data-detail-shard-size="{{ detail_shard_size }}"></div>
|
|
18
|
+
<script>{{ iife }}</script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0.pre.alpha.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: liquid
|
|
@@ -25,33 +24,33 @@ dependencies:
|
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: '5'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
27
|
+
name: pubid
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
30
|
- - "~>"
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 2.
|
|
32
|
+
version: 2.0.0.pre.alpha.13
|
|
34
33
|
type: :runtime
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - "~>"
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 2.
|
|
39
|
+
version: 2.0.0.pre.alpha.13
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
41
|
name: relaton
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
44
43
|
requirements:
|
|
45
|
-
- -
|
|
44
|
+
- - '='
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
46
|
+
version: 3.0.0.pre.alpha.4
|
|
48
47
|
type: :runtime
|
|
49
48
|
prerelease: false
|
|
50
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
50
|
requirements:
|
|
52
|
-
- -
|
|
51
|
+
- - '='
|
|
53
52
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
53
|
+
version: 3.0.0.pre.alpha.4
|
|
55
54
|
- !ruby/object:Gem::Dependency
|
|
56
55
|
name: thor
|
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -87,11 +86,9 @@ executables:
|
|
|
87
86
|
- relaton
|
|
88
87
|
extensions: []
|
|
89
88
|
extra_rdoc_files:
|
|
90
|
-
- docs/README.adoc
|
|
91
89
|
- LICENSE
|
|
90
|
+
- docs/README.adoc
|
|
92
91
|
files:
|
|
93
|
-
- ".github/workflows/rake.yml"
|
|
94
|
-
- ".github/workflows/release.yml"
|
|
95
92
|
- ".gitignore"
|
|
96
93
|
- ".hound.yml"
|
|
97
94
|
- ".rspec"
|
|
@@ -105,6 +102,9 @@ files:
|
|
|
105
102
|
- bin/setup
|
|
106
103
|
- docs/README.adoc
|
|
107
104
|
- exe/relaton
|
|
105
|
+
- frontend/dist/404.html
|
|
106
|
+
- frontend/dist/app.iife.js
|
|
107
|
+
- frontend/dist/style.css
|
|
108
108
|
- i18n.yaml
|
|
109
109
|
- lib/relaton-cli.rb
|
|
110
110
|
- lib/relaton/bibcollection.rb
|
|
@@ -113,7 +113,10 @@ files:
|
|
|
113
113
|
- lib/relaton/cli/base_convertor.rb
|
|
114
114
|
- lib/relaton/cli/command.rb
|
|
115
115
|
- lib/relaton/cli/data_fetcher.rb
|
|
116
|
+
- lib/relaton/cli/frontend_assets.rb
|
|
116
117
|
- lib/relaton/cli/full_text_search.rb
|
|
118
|
+
- lib/relaton/cli/index_item_normalizer.rb
|
|
119
|
+
- lib/relaton/cli/index_site_generator.rb
|
|
117
120
|
- lib/relaton/cli/relaton_file.rb
|
|
118
121
|
- lib/relaton/cli/subcommand_collection.rb
|
|
119
122
|
- lib/relaton/cli/subcommand_db.rb
|
|
@@ -127,11 +130,11 @@ files:
|
|
|
127
130
|
- templates/_document.liquid
|
|
128
131
|
- templates/_index.liquid
|
|
129
132
|
- templates/index-style.css
|
|
133
|
+
- templates/index/page.liquid
|
|
130
134
|
homepage: https://github.com/metanorma/relaton-cli
|
|
131
135
|
licenses:
|
|
132
136
|
- BSD-2-Clause
|
|
133
137
|
metadata: {}
|
|
134
|
-
post_install_message:
|
|
135
138
|
rdoc_options: []
|
|
136
139
|
require_paths:
|
|
137
140
|
- lib
|
|
@@ -146,8 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
146
149
|
- !ruby/object:Gem::Version
|
|
147
150
|
version: '0'
|
|
148
151
|
requirements: []
|
|
149
|
-
rubygems_version:
|
|
150
|
-
signing_key:
|
|
152
|
+
rubygems_version: 4.0.17
|
|
151
153
|
specification_version: 4
|
|
152
154
|
summary: Relaton Command-line Interface
|
|
153
155
|
test_files: []
|
data/.github/workflows/rake.yml
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Auto-generated by Cimas: Do not edit it manually!
|
|
2
|
-
# See https://github.com/metanorma/cimas
|
|
3
|
-
name: rake
|
|
4
|
-
|
|
5
|
-
on:
|
|
6
|
-
push:
|
|
7
|
-
branches: [ master, main, lutaml-integration ]
|
|
8
|
-
tags: [ v* ]
|
|
9
|
-
pull_request:
|
|
10
|
-
workflow_dispatch:
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
rake:
|
|
14
|
-
uses: relaton/support/.github/workflows/rake.yml@main
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Auto-generated by Cimas: Do not edit it manually!
|
|
2
|
-
# See https://github.com/metanorma/cimas
|
|
3
|
-
name: release
|
|
4
|
-
|
|
5
|
-
on:
|
|
6
|
-
workflow_dispatch:
|
|
7
|
-
inputs:
|
|
8
|
-
next_version:
|
|
9
|
-
description: |
|
|
10
|
-
Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
|
|
11
|
-
Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
|
|
12
|
-
required: true
|
|
13
|
-
default: 'skip'
|
|
14
|
-
repository_dispatch:
|
|
15
|
-
types: [ do-release ]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
jobs:
|
|
19
|
-
release:
|
|
20
|
-
uses: relaton/support/.github/workflows/release.yml@main
|
|
21
|
-
with:
|
|
22
|
-
next_version: ${{ github.event.inputs.next_version }}
|
|
23
|
-
secrets:
|
|
24
|
-
rubygems-api-key: ${{ secrets.RELATON_CI_RUBYGEMS_API_KEY }}
|