squared 0.4.14 → 0.4.16
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/CHANGELOG.md +64 -0
- data/README.ruby.md +4 -2
- data/lib/squared/common/prompt.rb +3 -3
- data/lib/squared/common/shell.rb +1 -2
- data/lib/squared/common/utils.rb +9 -0
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +25 -19
- data/lib/squared/workspace/project/base.rb +173 -124
- data/lib/squared/workspace/project/docker.rb +21 -24
- data/lib/squared/workspace/project/git.rb +41 -41
- data/lib/squared/workspace/project/node.rb +67 -25
- data/lib/squared/workspace/project/python.rb +18 -11
- data/lib/squared/workspace/project/ruby.rb +95 -59
- data/lib/squared/workspace/project/support/class.rb +2 -4
- data/lib/squared/workspace/series.rb +8 -8
- data/lib/squared/workspace/support/base.rb +17 -0
- data/lib/squared/workspace/support.rb +1 -0
- data/squared.gemspec +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42a856b40866dc4f90ff4def50a0d8ef6f7134ce5cd8f0c40064b55aea2735a4
|
4
|
+
data.tar.gz: 1ee4f68f6f3a40ed0d45fac5fbb7e3817787f9c86be7770331edbaff541e7ad1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffb1e276cc3fa97d5de20158a5d0833c8cd140506cc8ee2fd61e0c19fe446e12edba1dca5cc0cda49a4e5d0e393bae4db1fa8f5320aa8bfb892c1dd8608d31ae
|
7
|
+
data.tar.gz: e6460b7953fd893b7560a051d93e86630faf134d831e173d25924562775186a6f46dd0a9cb13014a4adc8c2ff3ed734719925653ccd9ef140e4fa572e36db15c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,64 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.4.16] - 2025-07-27
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- Git command blame was implemented.
|
8
|
+
- Project property only for task filtering was implemented.
|
9
|
+
- Node command copy uses NPM pack to refresh development packages.
|
10
|
+
- Docker command bake action check was implemented.
|
11
|
+
- Ruby uses gem specification for name and version.
|
12
|
+
- Ruby constructor parameter gemspec was implemented.
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
|
16
|
+
- Project boolean property readers were converted into accessors.
|
17
|
+
- Workspace hash singleton methods were relocated under Support.
|
18
|
+
- Project property version uses setter method for validation.
|
19
|
+
- Node command publish will prompt when tag is not semantic.
|
20
|
+
- Gem command push without args uses gemspec to locate archive.
|
21
|
+
- Prompts will exit process without raising a generic error.
|
22
|
+
|
23
|
+
### Fixed
|
24
|
+
|
25
|
+
- Gem command exec did not separate command and arguments.
|
26
|
+
- Project warning messages were not displayed for errors.
|
27
|
+
- Python command outdated did not load virtual env in Windows.
|
28
|
+
- Python virtual env original options are not modified.
|
29
|
+
- Node could not compare semantic versions above double digits.
|
30
|
+
|
31
|
+
## [0.4.15] - 2025-07-16
|
32
|
+
|
33
|
+
### Added
|
34
|
+
|
35
|
+
- Python command outdated option user was implemented.
|
36
|
+
- Git command commit action amend and amend-orig are interactive.
|
37
|
+
|
38
|
+
### Changed
|
39
|
+
|
40
|
+
- Ruby task copy does not guess Gem directory when version is used.
|
41
|
+
- Workspace hash-based data uses global method for key creation.
|
42
|
+
|
43
|
+
## [0.3.13] - 2025-07-16
|
44
|
+
|
45
|
+
### Fixed
|
46
|
+
|
47
|
+
- See `0.2.13`.
|
48
|
+
|
49
|
+
## [0.2.13] - 2025-07-16
|
50
|
+
|
51
|
+
### Fixed
|
52
|
+
|
53
|
+
- Project graph did not ignore circular references.
|
54
|
+
|
55
|
+
## [0.1.10] - 2025-07-16
|
56
|
+
|
57
|
+
### Fixed
|
58
|
+
|
59
|
+
- Module namespaces were not combined in the right order.
|
60
|
+
- Workspace group tasks were not registered.
|
61
|
+
|
3
62
|
## [0.4.14] - 2025-07-05
|
4
63
|
|
5
64
|
### Added
|
@@ -802,6 +861,8 @@
|
|
802
861
|
|
803
862
|
- Changelog was created.
|
804
863
|
|
864
|
+
[0.4.16]: https://github.com/anpham6/squared/releases/tag/v0.4.16-ruby
|
865
|
+
[0.4.15]: https://github.com/anpham6/squared/releases/tag/v0.4.15-ruby
|
805
866
|
[0.4.14]: https://github.com/anpham6/squared/releases/tag/v0.4.14-ruby
|
806
867
|
[0.4.13]: https://github.com/anpham6/squared/releases/tag/v0.4.13-ruby
|
807
868
|
[0.4.12]: https://github.com/anpham6/squared/releases/tag/v0.4.12-ruby
|
@@ -817,6 +878,7 @@
|
|
817
878
|
[0.4.2]: https://github.com/anpham6/squared/releases/tag/v0.4.2-ruby
|
818
879
|
[0.4.1]: https://github.com/anpham6/squared/releases/tag/v0.4.1-ruby
|
819
880
|
[0.4.0]: https://github.com/anpham6/squared/releases/tag/v0.4.0-ruby
|
881
|
+
[0.3.13]: https://github.com/anpham6/squared/releases/tag/v0.3.13-ruby
|
820
882
|
[0.3.12]: https://github.com/anpham6/squared/releases/tag/v0.3.12-ruby
|
821
883
|
[0.3.11]: https://github.com/anpham6/squared/releases/tag/v0.3.11-ruby
|
822
884
|
[0.3.10]: https://github.com/anpham6/squared/releases/tag/v0.3.10-ruby
|
@@ -830,6 +892,7 @@
|
|
830
892
|
[0.3.2]: https://github.com/anpham6/squared/releases/tag/v0.3.2-ruby
|
831
893
|
[0.3.1]: https://github.com/anpham6/squared/releases/tag/v0.3.1-ruby
|
832
894
|
[0.3.0]: https://github.com/anpham6/squared/releases/tag/v0.3.0-ruby
|
895
|
+
[0.2.13]: https://github.com/anpham6/squared/releases/tag/v0.2.13-ruby
|
833
896
|
[0.2.12]: https://github.com/anpham6/squared/releases/tag/v0.2.12-ruby
|
834
897
|
[0.2.11]: https://github.com/anpham6/squared/releases/tag/v0.2.11-ruby
|
835
898
|
[0.2.10]: https://github.com/anpham6/squared/releases/tag/v0.2.10-ruby
|
@@ -843,6 +906,7 @@
|
|
843
906
|
[0.2.2]: https://github.com/anpham6/squared/releases/tag/v0.2.2-ruby
|
844
907
|
[0.2.1]: https://github.com/anpham6/squared/releases/tag/v0.2.1-ruby
|
845
908
|
[0.2.0]: https://github.com/anpham6/squared/releases/tag/v0.2.0-ruby
|
909
|
+
[0.1.10]: https://github.com/anpham6/squared/releases/tag/v0.1.10-ruby
|
846
910
|
[0.1.9]: https://github.com/anpham6/squared/releases/tag/v0.1.9-ruby
|
847
911
|
[0.1.8]: https://github.com/anpham6/squared/releases/tag/v0.1.8-ruby
|
848
912
|
[0.1.7]: https://github.com/anpham6/squared/releases/tag/v0.1.7-ruby
|
data/README.ruby.md
CHANGED
@@ -65,6 +65,7 @@ require "squared/app" # All workspace related mod
|
|
65
65
|
# log = /workspaces/logger
|
66
66
|
# emc = /workspaces/e-mc
|
67
67
|
# pir = /workspaces/pi-r
|
68
|
+
# pir2 = /workspaces/pi-r2
|
68
69
|
# squared = /workspaces/squared
|
69
70
|
# cli = /workspaces/squared/publish/sqd-cli
|
70
71
|
# sqd-serve = /workspaces/squared/publish/sqd-serve
|
@@ -82,10 +83,11 @@ Workspace::Application
|
|
82
83
|
.add("pathname", run: "rake compile", copy: "rake install", test: "rake test", group: "default", env: { # Ruby (with C extensions)
|
83
84
|
"CFLAGS" => "-fPIC -O1"
|
84
85
|
})
|
85
|
-
.add("optparse", doc: "rake rdoc", group: "default") # Uses bundler/gem_tasks (without C extensions)
|
86
|
+
.add("optparse", doc: "rake rdoc", gemspec: "optparse.gemspec", group: "default") # Uses bundler/gem_tasks (without C extensions)
|
86
87
|
.add("logger", copy: { from: "lib", glob: "**/*.rb", into: "~/.rvm/gems/ruby-3.4.0/gems/logger-1.6.1" }, clean: ["tmp/"]) # autodetect: true | "rvm" | "rbenv" | "asdf" | "bundler"
|
87
88
|
.add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node) # Node
|
88
89
|
.add("pi-r", "pir", copy: { from: "publish", scope: "@pi-r" }, clean: ["publish/**/*.js", "tmp/"]) # Trailing slash required for directories
|
90
|
+
.add("pi-r2", "pir2", copy: { from: :npm, also: %i[squared express], files: ["LICENSE", ["README.md.ruby", "README.md"]] }) # Uses dist files from NPM package spec
|
89
91
|
.add("squared", script: ["build:stage1", "build:stage2"], group: "app") do # Copy target (main)
|
90
92
|
# Repo (global)
|
91
93
|
as(:run, "build:dev", "dev") # npm run build:dev -> npm run dev
|
@@ -107,7 +109,7 @@ Workspace::Application
|
|
107
109
|
variable_set :depend, false
|
108
110
|
variable_set :clean, ["build/sqd/"]
|
109
111
|
end
|
110
|
-
.with(:docker,
|
112
|
+
.with(:docker, only: ["build", "compose"]) do
|
111
113
|
.add("squared", "docker", file: "Dockerfile", context: ".", tag: "latest", registry: "localhost:5000", username: "squared",
|
112
114
|
args: "--ssh=default",
|
113
115
|
secrets: ["id=github,env=GITHUB_TOKEN"],
|
@@ -73,9 +73,9 @@ module Squared
|
|
73
73
|
end
|
74
74
|
attempts -= 1
|
75
75
|
next if attempts > 0
|
76
|
-
break unless force
|
77
76
|
|
78
|
-
exit 1
|
77
|
+
exit 1 if force
|
78
|
+
break
|
79
79
|
end
|
80
80
|
rescue Interrupt
|
81
81
|
puts
|
@@ -109,7 +109,7 @@ module Squared
|
|
109
109
|
end
|
110
110
|
ret = (prompt.call || '').strip
|
111
111
|
multiline.each { |val| break if ret.delete_suffix!(val) } if multiline.is_a?(::Enumerable)
|
112
|
-
|
112
|
+
exit 1 if force && ret.empty?
|
113
113
|
ret
|
114
114
|
else
|
115
115
|
prompt.call
|
data/lib/squared/common/shell.rb
CHANGED
@@ -86,8 +86,7 @@ module Squared
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def shell_split(val, quote: false, force: false, join: nil)
|
89
|
-
ret = val.shellsplit
|
90
|
-
ret.map! { |opt| shell_escape(opt, quote: quote, force: force, double: true, option: true) }
|
89
|
+
ret = val.shellsplit.map! { |opt| shell_escape(opt, quote: quote, force: force, double: true, option: true) }
|
91
90
|
return ret unless join
|
92
91
|
|
93
92
|
ret.join(join.is_a?(::String) ? join : ' ')
|
data/lib/squared/common/utils.rb
CHANGED
@@ -105,6 +105,15 @@ module Squared
|
|
105
105
|
Time.now.utc.strftime(s).to_i - Time.parse(val).utc.strftime(s).to_i
|
106
106
|
end
|
107
107
|
|
108
|
+
def rand_s(size)
|
109
|
+
if RUBY_VERSION >= '3.1'
|
110
|
+
require 'random/formatter'
|
111
|
+
Random.new.alphanumeric(size)
|
112
|
+
else
|
113
|
+
(0...size).map { rand(97..122).chr }.join
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
108
117
|
def env(key, default = nil, suffix: nil, strict: false, equals: nil, ignore: nil)
|
109
118
|
ret = env_value(key, suffix: suffix, strict: strict)
|
110
119
|
return ret == equals.to_s unless equals.nil?
|
data/lib/squared/version.rb
CHANGED
@@ -92,7 +92,7 @@ module Squared
|
|
92
92
|
@prefix = prefix
|
93
93
|
@series = Application.series_wrap(self)
|
94
94
|
@project = {}
|
95
|
-
@kind =
|
95
|
+
@kind = Support.hashlist
|
96
96
|
@extensions = []
|
97
97
|
@envname = env_key(@main).freeze
|
98
98
|
@pipe = env_pipe(pipe, (ARG[:OUT] && env(ARG[:OUT])) || 1, root: @home)
|
@@ -106,20 +106,20 @@ module Squared
|
|
106
106
|
else
|
107
107
|
@theme = {}
|
108
108
|
end
|
109
|
-
@chain =
|
109
|
+
@chain = Support.hashlist
|
110
110
|
@script = {
|
111
|
-
group:
|
112
|
-
ref:
|
111
|
+
group: Support.hashobj,
|
112
|
+
ref: Support.hashobj,
|
113
113
|
group!: {},
|
114
114
|
ref!: {}
|
115
115
|
}.freeze
|
116
116
|
@events = {
|
117
|
-
group:
|
118
|
-
ref:
|
117
|
+
group: Support.hashobj,
|
118
|
+
ref: Support.hashobj
|
119
119
|
}.freeze
|
120
120
|
@pass = {
|
121
|
-
group:
|
122
|
-
ref:
|
121
|
+
group: Support.hashobj,
|
122
|
+
ref: Support.hashobj,
|
123
123
|
global: {},
|
124
124
|
pattern: []
|
125
125
|
}.freeze
|
@@ -225,7 +225,7 @@ module Squared
|
|
225
225
|
end
|
226
226
|
end
|
227
227
|
data = Struct::ChainData.new(action, step, ns.call(with), ns.call(before), ns.call(after), sync)
|
228
|
-
|
228
|
+
@chain[task_name(task.to_s)] << data
|
229
229
|
self
|
230
230
|
end
|
231
231
|
|
@@ -267,9 +267,9 @@ module Squared
|
|
267
267
|
|
268
268
|
def pass(name, group: @group, ref: @ref, &blk)
|
269
269
|
data = if group
|
270
|
-
@pass[:group][group]
|
270
|
+
@pass[:group][group]
|
271
271
|
elsif ref
|
272
|
-
@pass[:ref][ref]
|
272
|
+
@pass[:ref][ref]
|
273
273
|
else
|
274
274
|
@pass[:global]
|
275
275
|
end
|
@@ -630,12 +630,16 @@ module Squared
|
|
630
630
|
Rake::Win32.windows?
|
631
631
|
end
|
632
632
|
|
633
|
+
def mri?
|
634
|
+
RUBY_ENGINE == 'ruby'
|
635
|
+
end
|
636
|
+
|
633
637
|
def jruby?
|
634
638
|
RUBY_ENGINE == 'jruby'
|
635
639
|
end
|
636
640
|
|
637
|
-
def
|
638
|
-
|
641
|
+
def truffleruby?
|
642
|
+
RUBY_ENGINE == 'truffleruby'
|
639
643
|
end
|
640
644
|
|
641
645
|
def docker?
|
@@ -826,8 +830,8 @@ module Squared
|
|
826
830
|
items = as_a(ref, :to_sym)
|
827
831
|
end
|
828
832
|
items.each do |name|
|
829
|
-
|
830
|
-
|
833
|
+
@script[label][name][task] = val
|
834
|
+
@events[label][name][task] = on if on.is_a?(Hash)
|
831
835
|
end
|
832
836
|
self
|
833
837
|
end
|
@@ -844,15 +848,17 @@ module Squared
|
|
844
848
|
end
|
845
849
|
|
846
850
|
def data_get(*args, group: nil, ref: nil, target: nil)
|
847
|
-
target[:group]
|
848
|
-
|
851
|
+
if group && target[:group].key?(key = group.to_sym)
|
852
|
+
target[:group][key]
|
853
|
+
elsif ref.is_a?(Enumerable)
|
849
854
|
ref.each do |key|
|
850
|
-
next unless
|
855
|
+
next unless target[:ref].key?(key)
|
851
856
|
|
857
|
+
ret = target[:ref][key]
|
852
858
|
return ret if args.empty? || args.any? { |val| ret.key?(val) }
|
853
859
|
end
|
854
860
|
nil
|
855
|
-
elsif ref
|
861
|
+
elsif ref && target[:ref].key?(ref)
|
856
862
|
target[:ref][ref]
|
857
863
|
end
|
858
864
|
end
|