squared 0.8.6 → 0.9.0.pre1
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 +35 -25
- data/README.md +158 -126
- data/exe/sqd +224 -0
- data/lib/squared/common/base.rb +7 -3
- data/lib/squared/common/format.rb +8 -3
- data/lib/squared/common/prompt.rb +65 -33
- data/lib/squared/common/shell.rb +3 -1
- data/lib/squared/common/system.rb +2 -9
- data/lib/squared/config.rb +3 -3
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +26 -29
- data/lib/squared/workspace/project/base.rb +104 -61
- data/lib/squared/workspace/project/docker.rb +93 -44
- data/lib/squared/workspace/project/git.rb +65 -96
- data/lib/squared/workspace/project/node.rb +14 -12
- data/lib/squared/workspace/project/python.rb +75 -35
- data/lib/squared/workspace/project/ruby.rb +61 -52
- data/lib/squared/workspace/project/support/class.rb +1 -1
- data/lib/squared/workspace/project/support/optionpartition.rb +16 -28
- data/lib/squared/workspace/repo.rb +5 -5
- data/lib/squared/workspace/series.rb +4 -2
- data/squared.gemspec +7 -5
- metadata +21 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ebde7859df22cda9eadd92f6bf88141ba9095a7528a8bba9e469333f1bb14370
|
|
4
|
+
data.tar.gz: af5a6e759a021e46d76f4043dcea544b1a7e25dacaddad8389824782fbd1fe78
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a00a2d227203bd36460e5a3242de692e7ae2822c1f2812a1a2ec271c4f5d8ffe32af050522e3e20e451920f57d8f5d7363933f7c5abdfb5cbe27e5989e7d41c
|
|
7
|
+
data.tar.gz: 29ef41a9d546d00b4701bc763362a61426312b530b8d5378e60f309cd5469960cab206f969da791936f4da68f9d25772bbfa44dd759c90a5a500b8c504defb44
|
data/CHANGELOG.md
CHANGED
|
@@ -1,33 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Unreleased
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
7
|
+
- Gem install global exe command "sqd" was created.
|
|
8
|
+
- Common base argument FORCE for session propagation was created.
|
|
9
|
+
- Common base argument YES for session propagation was created.
|
|
10
|
+
- Common base argument PAGE for prompt choice pagination was created.
|
|
11
|
+
- Ruby command gem action push option dry-run was implemented.
|
|
12
|
+
- Python task depend will install from pylock.toml when detected.
|
|
13
|
+
- Python task depend supports PDM package manager.
|
|
14
|
+
- Common base argument APP for application settings was created.
|
|
15
|
+
- Docker command network action [connect|disconnect] is interactive.
|
|
16
|
+
- Docker command run was implemented.
|
|
17
|
+
- Docker command container is interactive.
|
|
18
|
+
- Docker command network action rm is interactive.
|
|
19
|
+
- Docker command container action rm is interactive.
|
|
20
|
+
- Docker command run action entrypoint is interactive.
|
|
9
21
|
|
|
10
|
-
###
|
|
11
|
-
|
|
12
|
-
- Bundle exec wrapper did not accept boolean values.
|
|
13
|
-
- RuboCop did not resolve config to project directory.
|
|
14
|
-
|
|
15
|
-
## [0.7.13] - 2026-09-25
|
|
16
|
-
|
|
17
|
-
### Fixed
|
|
18
|
-
|
|
19
|
-
- OptionPartition did not parse quoted option values.
|
|
20
|
-
|
|
21
|
-
## [0.6.20] - 2026-09-25
|
|
22
|
-
|
|
23
|
-
### Added
|
|
22
|
+
### Changed
|
|
24
23
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
24
|
+
- Ruby required version was changed to 2.7.0.
|
|
25
|
+
- Git commit hash detection supports up to SHA256.
|
|
26
|
+
- Git module revbuild uses a Monitor for file write synchronization.
|
|
27
|
+
- TypeScript base version was changed to v6.0 with support for v7.0.
|
|
28
|
+
- Common base argument CHOICE can be set to Float::INFINITY.
|
|
29
|
+
- OptionPartition singleton does not include Common::Prompt.
|
|
30
|
+
- Docker command image action ls without arguments is interactive.
|
|
31
|
+
- Application banner attributes with project references are segregated.
|
|
32
|
+
- Docker private method dnsname is compliant with RFC 1035.
|
|
33
|
+
- Node task depend uses automatic CI detection for NPM install.
|
|
34
|
+
- Repo sync option --fetch-submodules was renamed --recurse-submodules.
|
|
35
|
+
- Ruby command script does not run code until it has passed validation.
|
|
36
|
+
- Ruby gem io-console is used for default console size.
|
|
27
37
|
|
|
28
|
-
###
|
|
38
|
+
### Removed
|
|
29
39
|
|
|
30
|
-
-
|
|
40
|
+
- Common prompt method choice keyword auto is implied with a list.
|
|
41
|
+
- Docker private method emptyargs was replaced with OptionPartition.clear.
|
|
42
|
+
- Docker private method charname was replaced with subdomainname.
|
|
43
|
+
- Git command show was relocated into command git action show.
|
|
31
44
|
|
|
32
45
|
## [0.8.5] - 2026-09-23
|
|
33
46
|
|
|
@@ -687,7 +700,7 @@
|
|
|
687
700
|
|
|
688
701
|
### Fixed
|
|
689
702
|
|
|
690
|
-
- See `0.
|
|
703
|
+
- See `0.5.18`.
|
|
691
704
|
|
|
692
705
|
## [0.4.32]
|
|
693
706
|
|
|
@@ -2153,14 +2166,12 @@
|
|
|
2153
2166
|
|
|
2154
2167
|
- Changelog was created.
|
|
2155
2168
|
|
|
2156
|
-
[0.8.6]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.6
|
|
2157
2169
|
[0.8.5]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.5
|
|
2158
2170
|
[0.8.4]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.4
|
|
2159
2171
|
[0.8.3]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.3
|
|
2160
2172
|
[0.8.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.2
|
|
2161
2173
|
[0.8.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.1
|
|
2162
2174
|
[0.8.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.0
|
|
2163
|
-
[0.7.13]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.13
|
|
2164
2175
|
[0.7.12]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.12
|
|
2165
2176
|
[0.7.11]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.11
|
|
2166
2177
|
[0.7.10]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.10
|
|
@@ -2174,7 +2185,6 @@
|
|
|
2174
2185
|
[0.7.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.2
|
|
2175
2186
|
[0.7.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.1
|
|
2176
2187
|
[0.7.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.0
|
|
2177
|
-
[0.6.20]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.20
|
|
2178
2188
|
[0.6.19]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.19
|
|
2179
2189
|
[0.6.18]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.18
|
|
2180
2190
|
[0.6.17]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.17
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# squared 0.
|
|
1
|
+
# squared 0.9
|
|
2
2
|
|
|
3
3
|
* [source](https://github.com/anpham6/squared-ruby)
|
|
4
4
|
* [docs](https://squared.readthedocs.io)
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
| 2024-12-07 | 0.1.0 | 2.4.0 | 3.3.6 | |
|
|
11
11
|
| 2025-01-07 | 0.2.0 | | 3.4.0 | |
|
|
12
12
|
| 2025-02-07 | 0.3.0 | | 3.4.1 | |
|
|
13
|
-
| 2025-03-06 | 0.4.0 | | 3.4.2 |
|
|
13
|
+
| 2025-03-06 | 0.4.0 | | 3.4.2 | |
|
|
14
14
|
| 2025-06-16 | 0.5.0 | 2.5.0 | 3.4.4 | |
|
|
15
15
|
| ---------- | ----- | ----- | ----- | --- |
|
|
16
16
|
| 2025-08-23 | 0.5.5 | | 3.4.5 | |
|
|
17
|
-
| 2025-10-31 | 0.6.0 | | 3.4.7 |
|
|
17
|
+
| 2025-10-31 | 0.6.0 | | 3.4.7 | |
|
|
18
18
|
| 2026-01-07 | 0.7.0 | 2.5.0 | 4.0.0 | * |
|
|
19
19
|
| 2026-06-16 | 0.8.0 | | 4.0.5 | * |
|
|
20
|
+
| 2026-10-12 | 0.9.0 | 2.7.0 | 4.0.7 | * |
|
|
20
21
|
|
|
21
22
|
The range chart indicates the *latest* Ruby tested against at the time of release.
|
|
22
23
|
|
|
@@ -26,6 +27,41 @@ The range chart indicates the *latest* Ruby tested against at the time of releas
|
|
|
26
27
|
gem install squared
|
|
27
28
|
```
|
|
28
29
|
|
|
30
|
+
## CLI - sqd
|
|
31
|
+
|
|
32
|
+
There is an additional program wrapper for ``rake`` to be used when running batch commands and to enable global settings more easily.
|
|
33
|
+
|
|
34
|
+
```xml
|
|
35
|
+
Usage: sqd [options] [rake options] [global...] [:targets...] -- [rake targets...]
|
|
36
|
+
|
|
37
|
+
-R, --ref STR,STR Run global commands by class reference
|
|
38
|
+
-G, --group STR,STR Run global commands by project group
|
|
39
|
+
|
|
40
|
+
-P, --project STR,PAT Run project commands with common arguments
|
|
41
|
+
-a, --project-args STR,STR Provide command arguments for :targets (multiple)
|
|
42
|
+
-e, --project-env KEY=STR Provide command ENV variables for :targets (multiple)
|
|
43
|
+
|
|
44
|
+
-s, --[no-]strict Do not run commands with invalid arguments
|
|
45
|
+
--update Use update strategy for applicable commands
|
|
46
|
+
-F, --force [STR,STR] Enable force through ENV by application
|
|
47
|
+
-y, --yes [STR,STR] Enable auto-approve through ENV by application
|
|
48
|
+
-d, --dry-run Run commands without any modifying actions
|
|
49
|
+
|
|
50
|
+
-S, --select PAGE:CHOICE Prompt menu selection pagination limits
|
|
51
|
+
|
|
52
|
+
-p, --pipe 0|1|2 Set file descriptor for communication
|
|
53
|
+
-o, --pipe-out FILE Write command data stream to a file
|
|
54
|
+
--fail 0..4 Set application exception level
|
|
55
|
+
--log-level SEVERITY Set logger and exception state (debug, info, warn, error, fatal)
|
|
56
|
+
|
|
57
|
+
--[no-]banner Display executing command attributes
|
|
58
|
+
-x, --[no-]color Use enhanced styling for terminal output
|
|
59
|
+
-X, --plain Disable banner and styling for all commands
|
|
60
|
+
-v, --verbose Increase output verbosity (multiple)
|
|
61
|
+
--version Print the current version
|
|
62
|
+
-h, --help Print the command line options
|
|
63
|
+
```
|
|
64
|
+
|
|
29
65
|
## Example - Rakefile
|
|
30
66
|
|
|
31
67
|
Projects from any accessible folder can be added relative to the parent directory or absolutely. Missing projects will simply be excluded from the task runner.
|
|
@@ -54,7 +90,7 @@ require "squared/app" # All workspace related modules
|
|
|
54
90
|
# sqd = /workspaces/squared/sqd
|
|
55
91
|
|
|
56
92
|
# Load external Project classes (optional)
|
|
57
|
-
Workspace::Application.load_ref("/home/user/.gem/ruby/4.0.0/gems/squared-0.
|
|
93
|
+
Workspace::Application.load_ref("/home/user/.gem/ruby/4.0.0/gems/squared-0.9.0/lib/squared/workspace/project") # ref = :node => node.rb (absolute)
|
|
58
94
|
Workspace::Application.load_ref("lib/squared/workspace/project", gem: "squared") # bundle env (relative)
|
|
59
95
|
|
|
60
96
|
Workspace::Application
|
|
@@ -69,38 +105,40 @@ Workspace::Application
|
|
|
69
105
|
"CFLAGS" => "-fPIC -O1"
|
|
70
106
|
})
|
|
71
107
|
.add("optparse", doc: "rake rdoc", gemspec: "optparse.gemspec", group: "default") # Uses bundler/gem_tasks (without C extensions)
|
|
72
|
-
.add("logger", copy: { from: "lib", glob: "**/*.rb", into: "/home/user/.local/gem/ruby/4.0.0/gems/logger-1.7.0" }, clean: ["tmp/"]) do # autodetect: true | "rvm" | "rbenv" | "asdf" | "bundler"
|
|
73
|
-
self.gemdir = "/home/user/.local/gem/ruby/4.0.0/gems/logger-1.7.0"
|
|
108
|
+
.add("logger", copy: { from: "lib", glob: "**/*.rb", into: "/home/user/.local/gem/ruby/4.0.0/gems/logger-1.7.0" }, clean: ["tmp/"]) do # autodetect: true | "rvm" | "rbenv" | "asdf" | "mise" | bundler"
|
|
109
|
+
self.gemdir = "/home/user/.local/gem/ruby/4.0.0/gems/logger-1.7.0" # Default for "into"
|
|
74
110
|
end
|
|
75
|
-
.add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node)
|
|
111
|
+
.add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node)
|
|
76
112
|
.add("pi-r", "pir", copy: { from: "publish", scope: "@pi-r" }, clean: ["publish/**/*.js", "tmp/"]) # Trailing slash required for directories
|
|
77
113
|
.add("squared", init: "pnpm", script: ["build:stage1", "build:stage2"], group: "app") do # Use pnpm/yarn/berry for depend + Copy target (main)
|
|
78
114
|
# Repo (global)
|
|
79
|
-
as(:run, "build:dev", "dev")
|
|
115
|
+
as(:run, "build:dev", "dev") # npm run build:dev -> npm run dev
|
|
80
116
|
as(:run, { "build:dev": "dev", "build:prod": "prod" })
|
|
81
117
|
|
|
82
|
-
add("publish/sqd-cli", "cli", exclude: [:git])
|
|
83
|
-
add("publish/sqd-serve")
|
|
118
|
+
add("publish/sqd-cli", "cli", exclude: [:git]) # rake cli:build
|
|
119
|
+
add("publish/sqd-serve") # rake sqd-serve:build
|
|
84
120
|
add("publish/sqd-admin", group: "sqd", exclude: [:base])
|
|
85
121
|
# OR
|
|
86
|
-
with(exclude: [:base]) { add("publish/*", "packages") }
|
|
122
|
+
with(exclude: [:base]) { add("publish/*", "packages") } # rake packages:sqd-serve:publish
|
|
87
123
|
# OR
|
|
88
|
-
add(["publish/sqd-cli", "publish/sqd-serve"], true, exclude: [:base])
|
|
124
|
+
add(["publish/sqd-cli", "publish/sqd-serve"], true, exclude: [:base]) # rake squared:sqd-serve:publish
|
|
89
125
|
|
|
90
126
|
# Git
|
|
91
|
-
revbuild(include:
|
|
127
|
+
revbuild(include: ["src/", "framework/", "types/"]) # Synchronous is recommended
|
|
92
128
|
end
|
|
93
|
-
.add("squared/sqd", exclude: :git, pass: [:node, "checkout", "bump"]) do
|
|
94
|
-
apply :script, "build:sqd"
|
|
95
|
-
apply :depend, false
|
|
96
|
-
apply :clean, ["build/sqd/"]
|
|
129
|
+
.add("squared/sqd", exclude: :git, pass: [:node, "checkout", "bump"]) do # Skip initialize(:node) + squared:checkout:* + squared:bump:*
|
|
130
|
+
apply :script, "build:sqd" # Override detection
|
|
131
|
+
apply :depend, false #
|
|
132
|
+
apply :clean, ["build/sqd/"] # variable_set (alias)
|
|
97
133
|
end
|
|
98
|
-
.with(:docker, only: ["build", "compose"], hide: [:windows?]) do
|
|
99
|
-
add("squared", "docker", file: "Dockerfile",
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
134
|
+
.with(:docker, only: ["build", "compose"], hide: [:windows?]) do # When true hide entire group
|
|
135
|
+
.add("squared", "docker", file: "Dockerfile", tag: "latest",
|
|
136
|
+
registry: "localhost:5000", username: "squared", # compose publish => { oci: "oci://docker.io" }
|
|
137
|
+
args: "--ssh=default",
|
|
138
|
+
context: ".", # Optional
|
|
139
|
+
client: { config: '/home/user/.docker', tls: true }, # global options
|
|
140
|
+
secrets: ["id=github,env=GITHUB_TOKEN"],
|
|
141
|
+
mounts: ["src=.,dst=/project,ro,bind-propagation=rshared"]) do
|
|
104
142
|
series(:clean) do # run | depend | doc | lint | test | copy | clean
|
|
105
143
|
File.read(basepath("docker-bake.hcl"))
|
|
106
144
|
.scan(/\btags\s+=\s+\["([^"]+)"\]/)
|
|
@@ -108,15 +146,6 @@ Workspace::Application
|
|
|
108
146
|
end
|
|
109
147
|
end
|
|
110
148
|
end
|
|
111
|
-
.assign(:ruby) do # Add or override instance methods
|
|
112
|
-
def vmname(bin: false)
|
|
113
|
-
bin ? ['rbenv', '/usr/bin/rbenv'] : 'rbenv'
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
def copy?
|
|
117
|
-
false
|
|
118
|
-
end
|
|
119
|
-
end
|
|
120
149
|
.pass("pull", group: "default") { test? || doc? } # rake pathname:pull optparse:pull
|
|
121
150
|
.style("banner", 255.255) # 256 colors (fg | fg.bg | -0.bg)
|
|
122
151
|
.build(default: "build", parallel: ["pull", "fetch", "rebase", "archive", "clean", /^outdated:/], pass: ["publish"]) do |workspace|
|
|
@@ -152,11 +181,13 @@ Python.options(:build, "build:dev", opts: ["no-deps"]) # inherits
|
|
|
152
181
|
|
|
153
182
|
Workspace::Application
|
|
154
183
|
.new(ENV["SQUARED_HOME"], prefix: "rb", common: false) # Local styles
|
|
155
|
-
.group("ruby", "default",
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
184
|
+
.group("ruby", "default", rubygems: 3, # legacy: gem 3.6 | bundler 2.7 => ["3", "2.7"]
|
|
185
|
+
run: "rake build", copy: "rake install", clean: "rake clean",
|
|
186
|
+
override: {
|
|
187
|
+
pathname: { run: "rake compile" } # rake rb:pathname:build
|
|
188
|
+
},
|
|
189
|
+
ref: :ruby
|
|
190
|
+
)
|
|
160
191
|
.add("squared") do
|
|
161
192
|
apply :run, proc { # rake rb:squared:build
|
|
162
193
|
tsc(with: scriptname || "build:dev", verbose: true) # Repo (global)
|
|
@@ -174,7 +205,7 @@ Workspace::Application
|
|
|
174
205
|
.each(&:join)
|
|
175
206
|
}
|
|
176
207
|
apply :lint, proc {
|
|
177
|
-
bundle("exec", "-A --cache=true", with: "lint", verbose: true)
|
|
208
|
+
bundle("exec", "-A --cache=true", with: "lint", verbose: true) # bundle exec --gemfile="/squared/Gemfile" rubocop --parallel -A --cache=true
|
|
178
209
|
}
|
|
179
210
|
end
|
|
180
211
|
.with(:python, editable: false) do # ref=Symbol | group=String
|
|
@@ -216,8 +247,8 @@ Workspace::Application
|
|
|
216
247
|
add("android-docs", "android", archive: "https://github.com/anpham6/android-docs/archive/refs/tags/v0.3.0.zip")
|
|
217
248
|
add("chrome-docs", "chrome", archive: {
|
|
218
249
|
uri: "https://github.com/anpham6/chrome-docs/archive/refs/tags/v0.5.0.tar.gz", # URI.open (required)
|
|
219
|
-
digest: "e3d55d2004d4770dd663254c9272dc3baad0d57a5bd14ca767de6546cdf14680", # SHA1 | SHA256 | SHA384 | SHA512 | MD5
|
|
220
|
-
digest: "rmd160:47b7790a511eed675fec1a3e742845fef058799b", # RMD160
|
|
250
|
+
digest: "e3d55d2004d4770dd663254c9272dc3baad0d57a5bd14ca767de6546cdf14680", # SHA1 | SHA256 | SHA384 | SHA512 | MD5 (length)
|
|
251
|
+
digest: "rmd160:47b7790a511eed675fec1a3e742845fef058799b", # RMD160 (prefix)
|
|
221
252
|
ext: "tar.gz", # zip | tar | tar.gz | tgz | tar.xz | txz | 7z
|
|
222
253
|
depth: 1, # nested directories (e.g. --strip-components)
|
|
223
254
|
headers: { # URI.open
|
|
@@ -225,7 +256,7 @@ Workspace::Application
|
|
|
225
256
|
}
|
|
226
257
|
})
|
|
227
258
|
end
|
|
228
|
-
.add("squared", release: "https://github.com/anpham6/squared/archive/refs/tags/??") # squared:unpack:zip[v5.4
|
|
259
|
+
.add("squared", release: "https://github.com/anpham6/squared/archive/refs/tags/??") # squared:unpack:zip[v5.8.4,/tmp/squared]
|
|
229
260
|
```
|
|
230
261
|
|
|
231
262
|
### Clone
|
|
@@ -238,8 +269,8 @@ Workspace::Application
|
|
|
238
269
|
.git(
|
|
239
270
|
"emc": "https://github.com/anpham6/e-mc", # rake emc:clone
|
|
240
271
|
"pir": { # rake pir:clone
|
|
241
|
-
uri: "https://github.com/anpham6/pi-r",
|
|
242
|
-
options: {
|
|
272
|
+
uri: "https://github.com/anpham6/pi-r",
|
|
273
|
+
options: {
|
|
243
274
|
"origin": "github", # --origin=github
|
|
244
275
|
"recurse-submodules": false, # --no-recurse-submodules
|
|
245
276
|
"shallow-exclude": ["v0.0.1", "v0.0.2"] # --shallow-exclude=v0.0.1 --shallow-exclude=v0.0.2
|
|
@@ -261,7 +292,7 @@ Workspace::Application
|
|
|
261
292
|
)
|
|
262
293
|
.with(:node) do # rake clone:node
|
|
263
294
|
add("e-mc", "emc") do # https://github.com/anpham6/e-mc
|
|
264
|
-
revbuild(before:
|
|
295
|
+
revbuild(before: ["status", "squared:status"], # emc:status + squared:status (always)
|
|
265
296
|
after: "refresh") # emc:refresh (changed)
|
|
266
297
|
end #
|
|
267
298
|
add("pi-r", "pir") # https://github.com/anpham6/pi-r
|
|
@@ -304,7 +335,7 @@ Workspace::Application
|
|
|
304
335
|
chain "all", "build", with: "pir" # step: 3
|
|
305
336
|
end
|
|
306
337
|
add("squared") do
|
|
307
|
-
revbuild(include:
|
|
338
|
+
revbuild(include: ["src/", "framework/", "types/"]) # Git revision build command (optional)
|
|
308
339
|
chain "all", "revbuild", after: "express:build" # step: 4
|
|
309
340
|
chain "publish", "bump:patch", "publish:latest", step: 0, sync: true # rake publish
|
|
310
341
|
end
|
|
@@ -318,7 +349,7 @@ Workspace::Application
|
|
|
318
349
|
chain "all", "doc", with: "squared", before: "squared:revbuild" # Same
|
|
319
350
|
end
|
|
320
351
|
end
|
|
321
|
-
.chain("all", "status", with: "squared", after: "android-docs") # Global tasks (
|
|
352
|
+
.chain("all", "status", with: "squared", after: "android-docs") # Global tasks (without ":")
|
|
322
353
|
.build
|
|
323
354
|
```
|
|
324
355
|
|
|
@@ -339,50 +370,50 @@ Threaded is the default when there are two or more tasks. Using ``with`` and eit
|
|
|
339
370
|
```ruby
|
|
340
371
|
Workspace::Application
|
|
341
372
|
.new(main: "squared")
|
|
342
|
-
.graph(["depend"], ref: :git)
|
|
373
|
+
.graph(["depend"], ref: :git) # Optional
|
|
343
374
|
.with(:python) do
|
|
344
|
-
doc(windows? ? ".\make.bat html" : "make html")
|
|
345
|
-
add("android-docs", "android", venv: "/home/user/.venv")
|
|
346
|
-
add("chrome-docs", "chrome", graph: "android", venv:
|
|
347
|
-
apply :dependindex, 1
|
|
375
|
+
doc(windows? ? ".\make.bat html" : "make html") # rake android-docs:doc | rake doc:python
|
|
376
|
+
add("android-docs", "android", venv: "/home/user/.venv") # rake android-docs:depend
|
|
377
|
+
add("chrome-docs", "chrome", graph: "android", venv: [".venv", "--clear"]) do # /workspaces/chrome-docs/.venv
|
|
378
|
+
apply :dependindex, 1 # Use Poetry for dependencies
|
|
348
379
|
end
|
|
349
380
|
end
|
|
350
381
|
.with(:node) do
|
|
351
|
-
graph(["build", "copy"], on: {
|
|
382
|
+
graph(["build", "copy"], on: { # Overrides "git"
|
|
352
383
|
first: proc { puts "1" },
|
|
353
384
|
last: proc { puts "2" }
|
|
354
385
|
})
|
|
355
|
-
script("build:dev")
|
|
386
|
+
script("build:dev") # npm run build:dev
|
|
356
387
|
# OR
|
|
357
|
-
run([nil, "build:dev", { "PATH" => "~/.bin" }, "--workspace", "--silent"])
|
|
388
|
+
run([nil, "build:dev", { "PATH" => "~/.bin" }, "--workspace", "--silent"]) # PATH="~/.bin" npm run build:dev --workspace -- --silent
|
|
358
389
|
# OR
|
|
359
|
-
run({
|
|
360
|
-
script: "build:dev",
|
|
361
|
-
env: { "PATH" => "~/.bin" },
|
|
362
|
-
opts: "--workspace",
|
|
363
|
-
args: "--silent"
|
|
390
|
+
run({
|
|
391
|
+
script: "build:dev",
|
|
392
|
+
env: { "PATH" => "~/.bin" },
|
|
393
|
+
opts: "--workspace",
|
|
394
|
+
args: "--silent"
|
|
364
395
|
})
|
|
365
396
|
|
|
366
397
|
add("e-mc", "emc") do
|
|
367
|
-
first("build", "emc:clean", "emc:depend")
|
|
368
|
-
last("build", out: "123") { |out: nil| puts out }
|
|
369
|
-
error("build") { |err: nil| log.debug err }
|
|
398
|
+
first("build", "emc:clean", "emc:depend") # rake emc:clean && rake emc:depend && rake emc:build && echo "123"
|
|
399
|
+
last("build", out: "123") { |out: nil| puts out } #
|
|
400
|
+
error("build") { |err: nil| log.debug err } #
|
|
370
401
|
end
|
|
371
402
|
add("pi-r", "pir", graph: "emc", first: {
|
|
372
|
-
build: proc { puts self.name }
|
|
403
|
+
build: proc { puts self.name } # puts "pir"
|
|
373
404
|
})
|
|
374
405
|
add("squared-express", "express", graph: "pir")
|
|
375
406
|
add("squared", graph: ["chrome", "express"]) do
|
|
376
|
-
first("git:ls-files") { puts "1" }
|
|
377
|
-
first("git:ls-files", override: true) { puts "2" }
|
|
378
|
-
last("git:ls-files") { puts workspace.root }
|
|
379
|
-
error("git:ls-files") { |err| err.is_a?(TypeError) }
|
|
407
|
+
first("git:ls-files") { puts "1" } # skipped
|
|
408
|
+
first("git:ls-files", override: true) { puts "2" } # puts "2"
|
|
409
|
+
last("git:ls-files") { puts workspace.root } # puts "/workspaces" (does not run when error is raised)
|
|
410
|
+
error("git:ls-files") { |err| err.is_a?(TypeError) } # return true to suppress error
|
|
380
411
|
end
|
|
381
412
|
end
|
|
382
413
|
.with(:ruby) do
|
|
383
|
-
run("gem build")
|
|
414
|
+
run("gem build") # gem build
|
|
384
415
|
# OR
|
|
385
|
-
run("gem build", on: { first: -> { p "2" }, last: -> { p "4" } }) do
|
|
416
|
+
run("gem build", on: { first: -> { p "2" }, last: -> { p "4" } }) do # run | depend | graph | clean | doc | lint | test
|
|
386
417
|
p "1"
|
|
387
418
|
end
|
|
388
419
|
# OR
|
|
@@ -390,42 +421,42 @@ Workspace::Application
|
|
|
390
421
|
p "1"
|
|
391
422
|
end
|
|
392
423
|
# OR
|
|
393
|
-
run(["gem build", "--force", { "RUBY_VERSION" => "4.0.0" }])
|
|
424
|
+
run(["gem build", "--force", { "RUBY_VERSION" => "4.0.0" }]) # RUBY_VERSION="4.0.0" gem build --force
|
|
394
425
|
# OR
|
|
395
|
-
run({
|
|
396
|
-
command: "gem build",
|
|
397
|
-
opts: "--force",
|
|
398
|
-
env: { "PATH" => "~/.bin" },
|
|
399
|
-
args: { silent: true }
|
|
426
|
+
run({
|
|
427
|
+
command: "gem build", # RUBY_VERSION="4.0.0" gem build --silent --force (composable)
|
|
428
|
+
opts: "--force",
|
|
429
|
+
env: { "PATH" => "~/.bin" },
|
|
430
|
+
args: { silent: true }
|
|
400
431
|
})
|
|
401
432
|
# OR
|
|
402
|
-
run(["gem pristine", ["gem build", "gem cleanup"], nil, "--debug"])
|
|
433
|
+
run(["gem pristine", ["gem build", "gem cleanup"], nil, "--debug"]) # gem pristine --debug && gem build --debug && gem cleanup --debug
|
|
403
434
|
#
|
|
404
435
|
# All commands are either Array or Hash
|
|
405
436
|
#
|
|
406
|
-
run([
|
|
407
|
-
["gem pristine", "--all", { "PATH" => "~/.bin" }, "--silent"],
|
|
408
|
-
["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-4.0.0" }]
|
|
409
|
-
])
|
|
437
|
+
run([ # PATH="~/.bin" GEM_HOME="~/.gems/ruby-4.0.0" (merged)
|
|
438
|
+
["gem pristine", "--all", { "PATH" => "~/.bin" }, "--silent"], # gem pristine --silent --all
|
|
439
|
+
["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-4.0.0" }] # gem build --strict
|
|
440
|
+
])
|
|
410
441
|
# OR
|
|
411
|
-
run([
|
|
412
|
-
{
|
|
413
|
-
env: { "PATH" => "~/.bin" },
|
|
414
|
-
command: "gem pristine",
|
|
415
|
-
opts: "--all", args: "--silent"
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
env: { "GEM_HOME" => "~/.gems/ruby-4.0.0" },
|
|
419
|
-
command: "gem build",
|
|
420
|
-
opts: { strict: true }
|
|
421
|
-
}
|
|
442
|
+
run([
|
|
443
|
+
{
|
|
444
|
+
env: { "PATH" => "~/.bin" },
|
|
445
|
+
command: "gem pristine",
|
|
446
|
+
opts: "--all", args: "--silent"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
env: { "GEM_HOME" => "~/.gems/ruby-4.0.0" },
|
|
450
|
+
command: "gem build",
|
|
451
|
+
opts: { strict: true }
|
|
452
|
+
}
|
|
422
453
|
])
|
|
423
454
|
|
|
424
|
-
add("pathname", test: ["rake test", { jobs: ENV["RAKE_JOBS"] }])
|
|
455
|
+
add("pathname", test: ["rake test", { jobs: ENV["RAKE_JOBS"] }]) # rake test --jobs 4
|
|
425
456
|
add("fileutils", graph: "pathname")
|
|
426
|
-
add("optparse", run: "gem build", env: { "PATH" => "~/.bin" }, opts: "-v")
|
|
457
|
+
add("optparse", run: "gem build", env: { "PATH" => "~/.bin" }, opts: "-v") # PATH="~/.bin" gem build -v
|
|
427
458
|
add("rake", graph: ["fileutils", "optparse"])
|
|
428
|
-
banner(command: false)
|
|
459
|
+
banner(command: false) # Always hide banner
|
|
429
460
|
end
|
|
430
461
|
.build
|
|
431
462
|
```
|
|
@@ -545,32 +576,31 @@ Non-task:
|
|
|
545
576
|
|
|
546
577
|
Most project classes will inherit from `Git` which enables these tasks:
|
|
547
578
|
|
|
548
|
-
| Task | Git | Command
|
|
549
|
-
| :-------------- | :--------------- |
|
|
550
|
-
| branch | branch | create track delete move copy list current
|
|
551
|
-
| checkout | checkout | commit branch track detach path
|
|
552
|
-
| commit | commit | add all amend amend-orig fixup
|
|
553
|
-
| diff | diff | head branch files view between contain
|
|
554
|
-
| fetch | fetch | origin remote all
|
|
555
|
-
| files | ls-files | cached modified deleted others
|
|
556
|
-
| git | | add blame clean grep mv revert rm sparse-checkout status |
|
|
557
|
-
| log | log | view between contain
|
|
558
|
-
| merge | merge | commit no-commit send
|
|
559
|
-
| pull | pull | origin remote all
|
|
560
|
-
| push | push | origin remote commit all tags
|
|
561
|
-
| range-diff | range-diff | view between contain
|
|
562
|
-
| rebase | rebase | branch onto send
|
|
563
|
-
| remote | remote | add select
|
|
564
|
-
| refs | ls-remote --refs | heads tags remote
|
|
565
|
-
| reset | reset | commit index patch mode undo
|
|
566
|
-
| restore | restore | source staged worktree
|
|
567
|
-
| rev | rev | commit branch build output
|
|
568
|
-
| sparse-checkout | sparse-checkout | add reapply list clean disable
|
|
569
|
-
|
|
|
570
|
-
|
|
|
571
|
-
|
|
|
572
|
-
|
|
|
573
|
-
| tag | tag | add sign delete list |
|
|
579
|
+
| Task | Git | Command |
|
|
580
|
+
| :-------------- | :--------------- | :------------------------------------------------------------- |
|
|
581
|
+
| branch | branch | create track delete move copy list current |
|
|
582
|
+
| checkout | checkout | commit branch track detach path |
|
|
583
|
+
| commit | commit | add all amend amend-orig fixup |
|
|
584
|
+
| diff | diff | head branch files view between contain |
|
|
585
|
+
| fetch | fetch | origin remote all |
|
|
586
|
+
| files | ls-files | cached modified deleted others |
|
|
587
|
+
| git | | add blame clean grep mv revert rm show sparse-checkout status |
|
|
588
|
+
| log | log | view between contain |
|
|
589
|
+
| merge | merge | commit no-commit send |
|
|
590
|
+
| pull | pull | origin remote all |
|
|
591
|
+
| push | push | origin remote commit all tags |
|
|
592
|
+
| range-diff | range-diff | view between contain |
|
|
593
|
+
| rebase | rebase | branch onto send |
|
|
594
|
+
| remote | remote | add select |
|
|
595
|
+
| refs | ls-remote --refs | heads tags remote |
|
|
596
|
+
| reset | reset | commit index patch mode undo |
|
|
597
|
+
| restore | restore | source staged worktree |
|
|
598
|
+
| rev | rev | commit branch build output |
|
|
599
|
+
| sparse-checkout | sparse-checkout | add reapply list clean disable |
|
|
600
|
+
| stash | stash | push pop apply branch drop clear list all staged worktree |
|
|
601
|
+
| submodule | submodule | status update branch url sync |
|
|
602
|
+
| switch | switch | branch create detach |
|
|
603
|
+
| tag | tag | add sign delete list |
|
|
574
604
|
|
|
575
605
|
You can disable all of them at once using the `exclude` property.
|
|
576
606
|
|
|
@@ -613,7 +643,7 @@ Common::PATH.update({
|
|
|
613
643
|
gem: "~/.rvm/gems/ruby-4.0.0/bin/gem",
|
|
614
644
|
bundle: "~/.rvm/gems/ruby-4.0.0/bin/bundle",
|
|
615
645
|
rake: "~/.rvm/gems/ruby-4.0.0/bin/rake",
|
|
616
|
-
npm: "/opt/node/
|
|
646
|
+
npm: "/opt/node/v26.0.0/bin/npm",
|
|
617
647
|
python: "#{ENV["PYTHONPATH"]}/bin/python"
|
|
618
648
|
})
|
|
619
649
|
```
|
|
@@ -662,7 +692,9 @@ REVBUILD_FORCE=1 # Rebuild all targets (GIT_FORCE)
|
|
|
662
692
|
REVBUILD_FORCE_${NAME}=1 # Rebuild project
|
|
663
693
|
|
|
664
694
|
PREREQS_${NAME}=build,copy # Class method name to invoke
|
|
665
|
-
PREREQS_${REF}=depend # e.g.
|
|
695
|
+
PREREQS_${REF}=depend # e.g. RUBY
|
|
696
|
+
|
|
697
|
+
DRY_RUN=true # 0,false (global: bin)
|
|
666
698
|
```
|
|
667
699
|
|
|
668
700
|
### Graph
|
|
@@ -756,8 +788,8 @@ DOCKER_Y=1 # confirm all
|
|
|
756
788
|
|
|
757
789
|
TAG_${NAME}=1.0.0 # initialize
|
|
758
790
|
|
|
759
|
-
|
|
760
|
-
docker build --no-cache --label=v1 --build-arg="NODE_TAG=
|
|
791
|
+
BUILD_DOCKER_OPTS="NODE_TAG=26 RUBY_VERSION=4.0.0" DOCKER_DOCKER_OPTS="--no-cache --label=v1" rake docker:build # project: docker | ref: :docker
|
|
792
|
+
docker build --no-cache --label=v1 --build-arg="NODE_TAG=26" --build-arg="RUBY_VERSION=4.0.0" .
|
|
761
793
|
```
|
|
762
794
|
|
|
763
795
|
| Command | Flag | ENV |
|
|
@@ -832,8 +864,8 @@ require "squared/workspace/repo"
|
|
|
832
864
|
|
|
833
865
|
Workspace::Application
|
|
834
866
|
.new(main: "squared")
|
|
835
|
-
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], install: "
|
|
836
|
-
ref: %i[node -docker])
|
|
867
|
+
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], install: "/usr/local/bin", # first only (install)
|
|
868
|
+
ref: %i[node -docker]) # -docker (exclude)
|
|
837
869
|
.repo("https://github.com/anpham6/squared-repo", name: "doc", doc: true, test: true, ref: :python)
|
|
838
870
|
.add("squared", script: ["build:stage1", "build:stage2"])
|
|
839
871
|
.with(:python) do
|