squared 0.8.5 → 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 +43 -1
- data/README.md +157 -116
- 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 +64 -30
- 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 +24 -13
- data/lib/squared/workspace/project/base.rb +101 -46
- data/lib/squared/workspace/project/docker.rb +93 -44
- data/lib/squared/workspace/project/git.rb +53 -76
- data/lib/squared/workspace/project/node.rb +13 -11
- data/lib/squared/workspace/project/python.rb +58 -19
- data/lib/squared/workspace/project/ruby.rb +39 -28
- data/lib/squared/workspace/project/support/class.rb +1 -1
- data/lib/squared/workspace/project/support/optionpartition.rb +15 -14
- data/lib/squared/workspace/repo.rb +5 -5
- data/lib/squared/workspace/series.rb +4 -2
- data/squared.gemspec +7 -5
- metadata +20 -4
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,5 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
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.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
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.
|
|
37
|
+
|
|
38
|
+
### Removed
|
|
39
|
+
|
|
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.
|
|
44
|
+
|
|
3
45
|
## [0.8.5] - 2026-09-23
|
|
4
46
|
|
|
5
47
|
### Added
|
|
@@ -658,7 +700,7 @@
|
|
|
658
700
|
|
|
659
701
|
### Fixed
|
|
660
702
|
|
|
661
|
-
- See `0.
|
|
703
|
+
- See `0.5.18`.
|
|
662
704
|
|
|
663
705
|
## [0.4.32]
|
|
664
706
|
|
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,46 +105,48 @@ 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",
|
|
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" }
|
|
100
137
|
args: "--ssh=default",
|
|
138
|
+
context: ".", # Optional
|
|
101
139
|
client: { config: '/home/user/.docker', tls: true }, # global options
|
|
102
140
|
secrets: ["id=github,env=GITHUB_TOKEN"],
|
|
103
|
-
mounts: ["src=.,dst=/project,ro,bind-propagation=rshared"]) do
|
|
104
|
-
series(:clean) do
|
|
141
|
+
mounts: ["src=.,dst=/project,ro,bind-propagation=rshared"]) do
|
|
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+\["([^"]+)"\]/)
|
|
107
145
|
.each { |val| image(:rm, tag: val.first) }
|
|
108
146
|
end
|
|
109
147
|
end
|
|
110
148
|
end
|
|
111
|
-
.pass("pull", group: "default") { test? || doc? } # rake pathname:pull
|
|
149
|
+
.pass("pull", group: "default") { test? || doc? } # rake pathname:pull optparse:pull
|
|
112
150
|
.style("banner", 255.255) # 256 colors (fg | fg.bg | -0.bg)
|
|
113
151
|
.build(default: "build", parallel: ["pull", "fetch", "rebase", "archive", "clean", /^outdated:/], pass: ["publish"]) do |workspace|
|
|
114
152
|
workspace
|
|
@@ -143,11 +181,13 @@ Python.options(:build, "build:dev", opts: ["no-deps"]) # inherits
|
|
|
143
181
|
|
|
144
182
|
Workspace::Application
|
|
145
183
|
.new(ENV["SQUARED_HOME"], prefix: "rb", common: false) # Local styles
|
|
146
|
-
.group("ruby", "default",
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
+
)
|
|
151
191
|
.add("squared") do
|
|
152
192
|
apply :run, proc { # rake rb:squared:build
|
|
153
193
|
tsc(with: scriptname || "build:dev", verbose: true) # Repo (global)
|
|
@@ -165,7 +205,7 @@ Workspace::Application
|
|
|
165
205
|
.each(&:join)
|
|
166
206
|
}
|
|
167
207
|
apply :lint, proc {
|
|
168
|
-
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
|
|
169
209
|
}
|
|
170
210
|
end
|
|
171
211
|
.with(:python, editable: false) do # ref=Symbol | group=String
|
|
@@ -207,8 +247,8 @@ Workspace::Application
|
|
|
207
247
|
add("android-docs", "android", archive: "https://github.com/anpham6/android-docs/archive/refs/tags/v0.3.0.zip")
|
|
208
248
|
add("chrome-docs", "chrome", archive: {
|
|
209
249
|
uri: "https://github.com/anpham6/chrome-docs/archive/refs/tags/v0.5.0.tar.gz", # URI.open (required)
|
|
210
|
-
digest: "e3d55d2004d4770dd663254c9272dc3baad0d57a5bd14ca767de6546cdf14680", # SHA1 | SHA256 | SHA384 | SHA512 | MD5
|
|
211
|
-
digest: "rmd160:47b7790a511eed675fec1a3e742845fef058799b", # RMD160
|
|
250
|
+
digest: "e3d55d2004d4770dd663254c9272dc3baad0d57a5bd14ca767de6546cdf14680", # SHA1 | SHA256 | SHA384 | SHA512 | MD5 (length)
|
|
251
|
+
digest: "rmd160:47b7790a511eed675fec1a3e742845fef058799b", # RMD160 (prefix)
|
|
212
252
|
ext: "tar.gz", # zip | tar | tar.gz | tgz | tar.xz | txz | 7z
|
|
213
253
|
depth: 1, # nested directories (e.g. --strip-components)
|
|
214
254
|
headers: { # URI.open
|
|
@@ -216,7 +256,7 @@ Workspace::Application
|
|
|
216
256
|
}
|
|
217
257
|
})
|
|
218
258
|
end
|
|
219
|
-
.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]
|
|
220
260
|
```
|
|
221
261
|
|
|
222
262
|
### Clone
|
|
@@ -229,8 +269,8 @@ Workspace::Application
|
|
|
229
269
|
.git(
|
|
230
270
|
"emc": "https://github.com/anpham6/e-mc", # rake emc:clone
|
|
231
271
|
"pir": { # rake pir:clone
|
|
232
|
-
uri: "https://github.com/anpham6/pi-r",
|
|
233
|
-
options: {
|
|
272
|
+
uri: "https://github.com/anpham6/pi-r",
|
|
273
|
+
options: {
|
|
234
274
|
"origin": "github", # --origin=github
|
|
235
275
|
"recurse-submodules": false, # --no-recurse-submodules
|
|
236
276
|
"shallow-exclude": ["v0.0.1", "v0.0.2"] # --shallow-exclude=v0.0.1 --shallow-exclude=v0.0.2
|
|
@@ -252,7 +292,7 @@ Workspace::Application
|
|
|
252
292
|
)
|
|
253
293
|
.with(:node) do # rake clone:node
|
|
254
294
|
add("e-mc", "emc") do # https://github.com/anpham6/e-mc
|
|
255
|
-
revbuild(before:
|
|
295
|
+
revbuild(before: ["status", "squared:status"], # emc:status + squared:status (always)
|
|
256
296
|
after: "refresh") # emc:refresh (changed)
|
|
257
297
|
end #
|
|
258
298
|
add("pi-r", "pir") # https://github.com/anpham6/pi-r
|
|
@@ -295,7 +335,7 @@ Workspace::Application
|
|
|
295
335
|
chain "all", "build", with: "pir" # step: 3
|
|
296
336
|
end
|
|
297
337
|
add("squared") do
|
|
298
|
-
revbuild(include:
|
|
338
|
+
revbuild(include: ["src/", "framework/", "types/"]) # Git revision build command (optional)
|
|
299
339
|
chain "all", "revbuild", after: "express:build" # step: 4
|
|
300
340
|
chain "publish", "bump:patch", "publish:latest", step: 0, sync: true # rake publish
|
|
301
341
|
end
|
|
@@ -309,7 +349,7 @@ Workspace::Application
|
|
|
309
349
|
chain "all", "doc", with: "squared", before: "squared:revbuild" # Same
|
|
310
350
|
end
|
|
311
351
|
end
|
|
312
|
-
.chain("all", "status", with: "squared", after: "android-docs") # Global tasks (
|
|
352
|
+
.chain("all", "status", with: "squared", after: "android-docs") # Global tasks (without ":")
|
|
313
353
|
.build
|
|
314
354
|
```
|
|
315
355
|
|
|
@@ -330,50 +370,50 @@ Threaded is the default when there are two or more tasks. Using ``with`` and eit
|
|
|
330
370
|
```ruby
|
|
331
371
|
Workspace::Application
|
|
332
372
|
.new(main: "squared")
|
|
333
|
-
.graph(["depend"], ref: :git)
|
|
373
|
+
.graph(["depend"], ref: :git) # Optional
|
|
334
374
|
.with(:python) do
|
|
335
|
-
doc(windows? ? ".\make.bat html" : "make html")
|
|
336
|
-
add("android-docs", "android", venv: "/home/user/.venv")
|
|
337
|
-
add("chrome-docs", "chrome", graph: "android", venv:
|
|
338
|
-
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
|
|
339
379
|
end
|
|
340
380
|
end
|
|
341
381
|
.with(:node) do
|
|
342
|
-
graph(["build", "copy"], on: {
|
|
382
|
+
graph(["build", "copy"], on: { # Overrides "git"
|
|
343
383
|
first: proc { puts "1" },
|
|
344
384
|
last: proc { puts "2" }
|
|
345
385
|
})
|
|
346
|
-
script("build:dev")
|
|
386
|
+
script("build:dev") # npm run build:dev
|
|
347
387
|
# OR
|
|
348
|
-
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
|
|
349
389
|
# OR
|
|
350
|
-
run({
|
|
351
|
-
script: "build:dev",
|
|
352
|
-
env: { "PATH" => "~/.bin" },
|
|
353
|
-
opts: "--workspace",
|
|
354
|
-
args: "--silent"
|
|
390
|
+
run({
|
|
391
|
+
script: "build:dev",
|
|
392
|
+
env: { "PATH" => "~/.bin" },
|
|
393
|
+
opts: "--workspace",
|
|
394
|
+
args: "--silent"
|
|
355
395
|
})
|
|
356
396
|
|
|
357
397
|
add("e-mc", "emc") do
|
|
358
|
-
first("build", "emc:clean", "emc:depend")
|
|
359
|
-
last("build", out: "123") { |out: nil| puts out }
|
|
360
|
-
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 } #
|
|
361
401
|
end
|
|
362
402
|
add("pi-r", "pir", graph: "emc", first: {
|
|
363
|
-
build: proc { puts self.name }
|
|
403
|
+
build: proc { puts self.name } # puts "pir"
|
|
364
404
|
})
|
|
365
405
|
add("squared-express", "express", graph: "pir")
|
|
366
406
|
add("squared", graph: ["chrome", "express"]) do
|
|
367
|
-
first("git:ls-files") { puts "1" }
|
|
368
|
-
first("git:ls-files", override: true) { puts "2" }
|
|
369
|
-
last("git:ls-files") { puts workspace.root }
|
|
370
|
-
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
|
|
371
411
|
end
|
|
372
412
|
end
|
|
373
413
|
.with(:ruby) do
|
|
374
|
-
run("gem build")
|
|
414
|
+
run("gem build") # gem build
|
|
375
415
|
# OR
|
|
376
|
-
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
|
|
377
417
|
p "1"
|
|
378
418
|
end
|
|
379
419
|
# OR
|
|
@@ -381,42 +421,42 @@ Workspace::Application
|
|
|
381
421
|
p "1"
|
|
382
422
|
end
|
|
383
423
|
# OR
|
|
384
|
-
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
|
|
385
425
|
# OR
|
|
386
|
-
run({
|
|
387
|
-
command: "gem build",
|
|
388
|
-
opts: "--force",
|
|
389
|
-
env: { "PATH" => "~/.bin" },
|
|
390
|
-
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 }
|
|
391
431
|
})
|
|
392
432
|
# OR
|
|
393
|
-
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
|
|
394
434
|
#
|
|
395
435
|
# All commands are either Array or Hash
|
|
396
436
|
#
|
|
397
|
-
run([
|
|
398
|
-
["gem pristine", "--all", { "PATH" => "~/.bin" }, "--silent"],
|
|
399
|
-
["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-4.0.0" }]
|
|
400
|
-
])
|
|
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
|
+
])
|
|
401
441
|
# OR
|
|
402
|
-
run([
|
|
403
|
-
{
|
|
404
|
-
env: { "PATH" => "~/.bin" },
|
|
405
|
-
command: "gem pristine",
|
|
406
|
-
opts: "--all", args: "--silent"
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
env: { "GEM_HOME" => "~/.gems/ruby-4.0.0" },
|
|
410
|
-
command: "gem build",
|
|
411
|
-
opts: { strict: true }
|
|
412
|
-
}
|
|
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
|
+
}
|
|
413
453
|
])
|
|
414
454
|
|
|
415
|
-
add("pathname", test: ["rake test", { jobs: ENV["RAKE_JOBS"] }])
|
|
455
|
+
add("pathname", test: ["rake test", { jobs: ENV["RAKE_JOBS"] }]) # rake test --jobs 4
|
|
416
456
|
add("fileutils", graph: "pathname")
|
|
417
|
-
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
|
|
418
458
|
add("rake", graph: ["fileutils", "optparse"])
|
|
419
|
-
banner(command: false)
|
|
459
|
+
banner(command: false) # Always hide banner
|
|
420
460
|
end
|
|
421
461
|
.build
|
|
422
462
|
```
|
|
@@ -536,32 +576,31 @@ Non-task:
|
|
|
536
576
|
|
|
537
577
|
Most project classes will inherit from `Git` which enables these tasks:
|
|
538
578
|
|
|
539
|
-
| Task | Git | Command
|
|
540
|
-
| :-------------- | :--------------- |
|
|
541
|
-
| branch | branch | create track delete move copy list current
|
|
542
|
-
| checkout | checkout | commit branch track detach path
|
|
543
|
-
| commit | commit | add all amend amend-orig fixup
|
|
544
|
-
| diff | diff | head branch files view between contain
|
|
545
|
-
| fetch | fetch | origin remote all
|
|
546
|
-
| files | ls-files | cached modified deleted others
|
|
547
|
-
| git | | add blame clean grep mv revert rm sparse-checkout status |
|
|
548
|
-
| log | log | view between contain
|
|
549
|
-
| merge | merge | commit no-commit send
|
|
550
|
-
| pull | pull | origin remote all
|
|
551
|
-
| push | push | origin remote commit all tags
|
|
552
|
-
| range-diff | range-diff | view between contain
|
|
553
|
-
| rebase | rebase | branch onto send
|
|
554
|
-
| remote | remote | add select
|
|
555
|
-
| refs | ls-remote --refs | heads tags remote
|
|
556
|
-
| reset | reset | commit index patch mode undo
|
|
557
|
-
| restore | restore | source staged worktree
|
|
558
|
-
| rev | rev | commit branch build output
|
|
559
|
-
| sparse-checkout | sparse-checkout | add reapply list clean disable
|
|
560
|
-
|
|
|
561
|
-
|
|
|
562
|
-
|
|
|
563
|
-
|
|
|
564
|
-
| 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 |
|
|
565
604
|
|
|
566
605
|
You can disable all of them at once using the `exclude` property.
|
|
567
606
|
|
|
@@ -604,7 +643,7 @@ Common::PATH.update({
|
|
|
604
643
|
gem: "~/.rvm/gems/ruby-4.0.0/bin/gem",
|
|
605
644
|
bundle: "~/.rvm/gems/ruby-4.0.0/bin/bundle",
|
|
606
645
|
rake: "~/.rvm/gems/ruby-4.0.0/bin/rake",
|
|
607
|
-
npm: "/opt/node/
|
|
646
|
+
npm: "/opt/node/v26.0.0/bin/npm",
|
|
608
647
|
python: "#{ENV["PYTHONPATH"]}/bin/python"
|
|
609
648
|
})
|
|
610
649
|
```
|
|
@@ -653,7 +692,9 @@ REVBUILD_FORCE=1 # Rebuild all targets (GIT_FORCE)
|
|
|
653
692
|
REVBUILD_FORCE_${NAME}=1 # Rebuild project
|
|
654
693
|
|
|
655
694
|
PREREQS_${NAME}=build,copy # Class method name to invoke
|
|
656
|
-
PREREQS_${REF}=depend # e.g.
|
|
695
|
+
PREREQS_${REF}=depend # e.g. RUBY
|
|
696
|
+
|
|
697
|
+
DRY_RUN=true # 0,false (global: bin)
|
|
657
698
|
```
|
|
658
699
|
|
|
659
700
|
### Graph
|
|
@@ -747,8 +788,8 @@ DOCKER_Y=1 # confirm all
|
|
|
747
788
|
|
|
748
789
|
TAG_${NAME}=1.0.0 # initialize
|
|
749
790
|
|
|
750
|
-
|
|
751
|
-
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" .
|
|
752
793
|
```
|
|
753
794
|
|
|
754
795
|
| Command | Flag | ENV |
|
|
@@ -823,8 +864,8 @@ require "squared/workspace/repo"
|
|
|
823
864
|
|
|
824
865
|
Workspace::Application
|
|
825
866
|
.new(main: "squared")
|
|
826
|
-
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], install: "
|
|
827
|
-
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)
|
|
828
869
|
.repo("https://github.com/anpham6/squared-repo", name: "doc", doc: true, test: true, ref: :python)
|
|
829
870
|
.add("squared", script: ["build:stage1", "build:stage2"])
|
|
830
871
|
.with(:python) do
|