squared 0.6.9 → 0.7.0

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.
data/README.md CHANGED
@@ -1,22 +1,23 @@
1
- # squared 0.6
1
+ # squared 0.7
2
2
 
3
3
  * [source](https://github.com/anpham6/squared-ruby)
4
4
  * [docs](https://squared.readthedocs.io)
5
5
 
6
6
  ## Version Compatibility
7
7
 
8
- | Date | squared | Min | Max |
9
- | :--------: | ------: | -----: | -----: |
10
- | 2024-12-07 | 0.1.0 | 2.4.0 | 3.3.6 |
11
- | 2025-01-07 | 0.2.0 | | 3.4.0 |
12
- | 2025-02-07 | 0.3.0 | | 3.4.1 |
13
- | 2025-03-06 | 0.4.0 | | 3.4.2 |
14
- | 2025-06-16 | 0.5.0 | 2.5.0 | 3.4.3 |
15
- | ---------- | ----- | ----- | ----- |
16
- | 2025-08-23 | 0.5.5 | | 3.4.5 |
17
- | 2025-10-31 | 0.6.0 | | 3.4.7 |
8
+ | Date | squared | Min | Latest | LTS |
9
+ | :--------: | ------: | -----: | -----: | --: |
10
+ | 2024-12-07 | 0.1.0 | 2.4.0 | 3.3.6 | |
11
+ | 2025-01-07 | 0.2.0 | | 3.4.0 | |
12
+ | 2025-02-07 | 0.3.0 | | 3.4.1 | |
13
+ | 2025-03-06 | 0.4.0 | | 3.4.2 | * |
14
+ | 2025-06-16 | 0.5.0 | 2.5.0 | 3.4.3 | * |
15
+ | ---------- | ----- | ----- | ----- | --- |
16
+ | 2025-08-23 | 0.5.5 | | 3.4.5 | |
17
+ | 2025-10-31 | 0.6.0 | | 3.4.7 | * |
18
+ | 2026-01-07 | 0.7.0 | 2.5.0 | 4.0.0 | * |
18
19
 
19
- The range chart indicates the latest Ruby tested against at the time of release.
20
+ The range chart indicates the *latest* Ruby tested against at the time of release.
20
21
 
21
22
  ## Installation
22
23
 
@@ -32,13 +33,12 @@ Projects from any accessible folder can be added relative to the parent director
32
33
  require "squared"
33
34
 
34
35
  require "squared/workspace"
35
- require "squared/workspace/repo" # Optional
36
- require "squared/workspace/project/node" #
37
- require "squared/workspace/project/python" #
38
- require "squared/workspace/project/ruby" #
39
- require "squared/workspace/project/docker" #
36
+ require "squared/workspace/project/node" # Optional (when using ref: :node)
37
+ require "squared/workspace/project/python" #
38
+ require "squared/workspace/project/ruby" #
39
+ require "squared/workspace/project/docker" #
40
40
  # OR
41
- require "squared/app" # All workspace related modules
41
+ require "squared/app" # All workspace related modules
42
42
 
43
43
  # NODE_ENV = production
44
44
 
@@ -54,11 +54,11 @@ require "squared/app" # All workspace related mod
54
54
  # sqd = /workspaces/squared/sqd
55
55
 
56
56
  # Load external Project classes (optional)
57
- Workspace::Application.load_ref('/home/user/.gem/ruby/3.4.0/gems/squared-0.6.0/lib/squared/workspace/project') # ref = :node => node.rb (absolute)
58
- Workspace::Application.load_ref('lib/squared/workspace/project', gem: 'squared') # bundle env (relative)
57
+ Workspace::Application.load_ref("/home/user/.gem/ruby/4.0.0/gems/squared-0.7.0/lib/squared/workspace/project") # ref = :node => node.rb (absolute)
58
+ Workspace::Application.load_ref("lib/squared/workspace/project", gem: "squared") # bundle env (relative)
59
59
 
60
60
  Workspace::Application
61
- .new(Dir.pwd, main: "squared") # Dir.pwd? (main? is implicitly basename)
61
+ .new(Dir.pwd, main: "squared", exception: Logger::ERROR) # Dir.pwd? (main? is implicitly basename) | treat warnings as errors
62
62
  .banner("group", "project", styles: ["yellow", "black"], border: "bold") # name | project | path | ref | group? | parent? | version?
63
63
  .run("rake install", ref: :ruby)
64
64
  .depend(false, group: "default")
@@ -69,8 +69,8 @@ Workspace::Application
69
69
  "CFLAGS" => "-fPIC -O1"
70
70
  })
71
71
  .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/3.4.0/gems/logger-1.7.0" }, clean: ["tmp/"]) do # autodetect: true | "rvm" | "rbenv" | "asdf" | "bundler"
73
- self.gemdir = "/home/user/.local/gem/ruby/3.4.0/gems/logger-1.7.0" # Default for "into"
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" # Default for "into"
74
74
  end
75
75
  .add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node) # Node
76
76
  .add("pi-r", "pir", copy: { from: "publish", scope: "@pi-r" }, clean: ["publish/**/*.js", "tmp/"]) # Trailing slash required for directories
@@ -96,8 +96,8 @@ Workspace::Application
96
96
  apply :depend, false #
97
97
  apply :clean, ["build/sqd/"] # variable_set (alias)
98
98
  end
99
- .with(:docker, only: ["build", "compose"]) do
100
- .add("squared", "docker", file: "Dockerfile", context: ".", tag: "latest", registry: "localhost:5000", username: "squared",
99
+ .with(:docker, only: ["build", "compose"], hide: [:windows?]) do # When true hide entire group (formerly pass 0.6.0)
100
+ .add("squared", "docker", file: "Dockerfile", context: ".", tag: "latest", registry: "localhost:5000", username: "squared", # compose publish => { oci: "oci://docker.io" }
101
101
  args: "--ssh=default",
102
102
  secrets: ["id=github,env=GITHUB_TOKEN"],
103
103
  mounts: ["src=.,dst=/project,ro,bind-propagation=rshared"]) do # Docker
@@ -143,7 +143,7 @@ Python.options(:build, "build:dev", opts: ["no-deps"]) # inherits
143
143
 
144
144
  Workspace::Application
145
145
  .new(ENV["SQUARED_HOME"], prefix: "rb", common: false) # Local styles
146
- .group("ruby", "default", run: "rake build", copy: "rake install", clean: "rake clean", ref: :ruby, override: {
146
+ .group("ruby", "default", run: "rake build", copy: "rake install", clean: "rake clean", rubygems: 3, ref: :ruby, override: { # legacy: gem 3.6 | bundler 2.7 => ["3", "2.7"]
147
147
  pathname: {
148
148
  run: "rake compile" # rake rb:pathname:build
149
149
  }
@@ -168,19 +168,20 @@ Workspace::Application
168
168
  bundle("exec", "-A --cache=true", with: "lint", verbose: true) # bundle exec --gemfile="/squared/Gemfile" rubocop --parallel -A --cache=true
169
169
  }
170
170
  end
171
- .with(:python, editable: false) do # ref=Symbol | group=String
172
- banner([:name, ": ", :version], "path") # chrome-docs: 0.1.0 | /workspaces/chrome-docs
173
- doc("make html") # rake rb:doc:python
174
- run(false) # rake rb:build:python (disabled)
175
- exclude(%i[base git]) # Project::Git.ref (superclass)
176
- add("android-docs", "android") # rake rb:android:doc
177
- add("chrome-docs", "chrome") do # rake rb:chrome:doc
171
+ .with(:python, editable: false) do # ref=Symbol | group=String
172
+ banner([:name, ": ", :version], "path") # chrome-docs: 0.1.0 | /workspaces/chrome-docs
173
+ doc("make html") # rake rb:doc:python
174
+ run(false) # rake rb:build:python (disabled)
175
+ exclude(%i[base git]) # Project::Git.ref (superclass)
176
+ add("android-docs", "android", venv: [".venv", "virtualenv", "--clean"]) # directory,virtualenv?,options (python -m virtualenv) | virtualenv.ini
177
+ add("chrome-docs", "chrome", venv: ".venv") do # rake rb:chrome:doc (python -m venv)
178
178
  apply :run, proc {
179
- pip("wheel", with: "build:dev") # pip wheel -r '/chrome-docs/requirements.txt' --no-deps
179
+ pip("wheel", with: "build:dev") # pip wheel -r "/chrome-docs/requirements.txt" --no-deps
180
180
  }
181
181
  end
182
182
  end
183
183
  .style("inline", "bold")
184
+ .stage("init:project") { puts self.path } # modify attributes before building tasks (init | begin | project:begin/end | populate | extensions | series | finalize | end)
184
185
  .build
185
186
  ```
186
187
 
@@ -189,10 +190,10 @@ Workspace::Application
189
190
  ### Archive
190
191
 
191
192
  ```ruby
192
- # HEADERS={"Authorization":"Bearer RANDOM-TOKEN"} | hash/json
193
- # ZIP_DEPTH=0 | default=1
194
- # TAR_DEPTH=0 | TAR_DEPTH_SQUARED
195
- # UNPACK_FORCE=1 | Remove target directory
193
+ # HEADERS='{"Authorization":"Bearer RANDOM-TOKEN"}' | hash/json
194
+ # ZIP_DEPTH=0 | default=1
195
+ # TAR_DEPTH=0 | TAR_DEPTH_SQUARED
196
+ # UNPACK_FORCE=1 | Remove target directory
196
197
 
197
198
  Workspace::Application
198
199
  .new(main: "squared")
@@ -360,8 +361,9 @@ Workspace::Application
360
361
  add("squared", graph: ["chrome", "express"]) do
361
362
  first("git:ls-files") { puts "1" } # skipped
362
363
  first("git:ls-files", override: true) { puts "2" } # puts "2"
363
- last("git:ls-files") { puts workspace.root } # puts "/workspaces"
364
- end
364
+ last("git:ls-files") { puts workspace.root } # puts "/workspaces" (does not run when error is raised)
365
+ error("git:ls-files") { |err| err.is_a?(TypeError) } # return true to suppress error
366
+ end
365
367
  end
366
368
  .with(:ruby) do
367
369
  run("gem build") # gem build
@@ -374,10 +376,10 @@ Workspace::Application
374
376
  p "1"
375
377
  end
376
378
  # OR
377
- run(["gem build", "--force", { "RUBY_VERSION" => "3.4.0" }]) # RUBY_VERSION="3.4.0" gem build --force
379
+ run(["gem build", "--force", { "RUBY_VERSION" => "4.0.0" }]) # RUBY_VERSION="4.0.0" gem build --force
378
380
  # OR
379
381
  run({ #
380
- command: "gem build", # RUBY_VERSION="3.4.0" gem build --silent --force
382
+ command: "gem build", # RUBY_VERSION="4.0.0" gem build --silent --force
381
383
  opts: "--force", # composable
382
384
  env: { "PATH" => "~/.bin" }, #
383
385
  args: { silent: true } #
@@ -387,9 +389,9 @@ Workspace::Application
387
389
  #
388
390
  # All commands are either Array or Hash
389
391
  #
390
- run([ # PATH="~/.bin" GEM_HOME="~/.gems/ruby-3.4.0" (merged)
392
+ run([ # PATH="~/.bin" GEM_HOME="~/.gems/ruby-4.0.0" (merged)
391
393
  ["gem pristine", "--all", { "PATH" => "~/.bin" }, "--silent"], # gem pristine --silent --all
392
- ["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-3.4.0" }] # gem build --strict
394
+ ["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-4.0.0" }] # gem build --strict
393
395
  ]) #
394
396
  # OR
395
397
  run([ # Same
@@ -399,7 +401,7 @@ Workspace::Application
399
401
  opts: "--all", args: "--silent" #
400
402
  }, #
401
403
  { #
402
- env: { "GEM_HOME" => "~/.gems/ruby-3.4.0" }, #
404
+ env: { "GEM_HOME" => "~/.gems/ruby-4.0.0" }, #
403
405
  command: "gem build", #
404
406
  opts: { strict: true } #
405
407
  } #
@@ -415,15 +417,15 @@ Workspace::Application
415
417
  ```
416
418
 
417
419
  ```sh
418
- rake pir:graph # emc + pir
419
- rake express:graph # emc + pir + express
420
- rake chrome:graph # android + chrome
421
- rake graph:python # same
422
- rake squared:graph # android + chrome + emc + pir + express + squared
423
- rake graph:node # same
424
- rake rake:graph # pathname + fileutils + optparse + rake
425
- rake graph:ruby # same
426
- rake graph # graph:node + graph:ruby
420
+ rake pir:graph # emc + pir
421
+ rake express:graph # emc + pir + express
422
+ rake chrome:graph # android + chrome
423
+ rake graph:python # same
424
+ rake squared:graph # android + chrome + emc + pir + express + squared
425
+ rake graph:node # same
426
+ rake rake:graph # pathname + fileutils + optparse + rake
427
+ rake graph:ruby # same
428
+ rake graph # graph:node + graph:ruby
427
429
 
428
430
  rake squared:graph:run[express,pir] # emc + pir + express + squared
429
431
  rake squared:graph:run[node,-emc] # pir + express + squared
@@ -432,41 +434,51 @@ rake squared:graph:run[node,-emc] # pir + express + squared
432
434
  ### Tasks
433
435
 
434
436
  ```ruby
435
- Workspace::Series.batch(:ruby, :node, {
436
- stage: %i[graph test],
437
- reset: %i[stash pull]
438
- })
439
-
440
- Workspace::Series.rename("depend", "install")
437
+ Workspace::Application
438
+ .new(prefix: "rb")
439
+ .batch(:ruby, :node, {
440
+ stage: [%i[graph test], true], # stage? (optional)
441
+ reset: %i[stash pull] # reset? (required)
442
+ })
443
+ .rename("depend", "install")
444
+ .add("squared", timeout: { ruby: 10 }, ref: :ruby) do # Overrides ruby=5,8
445
+ scope("nested:version") { puts self.version } # rake rb:squared:nested:version
446
+ end
447
+ .add("chrome-docs", timeout: 30, ref: :python) # Does not override ruby/python
448
+ .timeout({ ruby: 5, python: 5 }) # global (seconds/fraction)
449
+ .timeout({ ruby: 8, gem: 5, gem_update: 20, bundle_install: 30 }, ref: :ruby) # Overrides global (group | ref)
450
+ .build
441
451
  ```
442
452
 
453
+ Some global tasks and local git commands do not support using process shell timeout.
454
+
443
455
  ## Usage
444
456
 
445
457
  ```sh
446
- rake -T # List tasks
447
- rake # rake status (usually "build")
458
+ rake -T # List tasks
459
+ rake # rake status (usually "build")
448
460
 
449
461
  # GIT_OPTIONS=rebase
450
- rake pull # All except "default" + "app"
451
- rake pull:ruby # pathname + optparse + logger
452
- rake pull:default # pathname + optparse
453
- rake pull:app # squared
454
- rake pull:node # emc + pir + squared
455
-
456
- rake build # All except "android"
457
- rake doc # optparse + android
458
- rake depend # All except "default"
459
-
460
- rake build:ruby # rake compile + rake install + rake install
461
-
462
- rake clean # All except "default" + "app"
463
- rake clean:ruby # rake clean + rake clean + ["tmp/"]
464
- rake clean:default # rake clean + rake clean + skip
465
- rake clean:app # none + skip + ["build/"]
466
- rake clean:node # none + ["publish/**/*.js", "tmp/"] + ["build/"]
467
-
468
- rake squared:run[#] # List scripts (node)
469
- rake squared:rake[#] # List tasks (ruby)
462
+ rake pull # All except "default" + "app"
463
+ rake pull:ruby # pathname + optparse + logger
464
+ rake pull:default # pathname + optparse
465
+ rake pull:app # squared
466
+ rake pull:node # emc + pir + squared
467
+
468
+ rake build # All except "android"
469
+ rake doc # optparse + android
470
+ rake depend # All except "default"
471
+
472
+ rake build:ruby # rake compile + rake install + rake install
473
+
474
+ rake clean # All except "default" + "app"
475
+ rake clean:ruby # rake clean + rake clean + ["tmp/"]
476
+ rake clean:default # rake clean + rake clean + skip
477
+ rake clean:app # none + skip + ["build/"]
478
+ rake clean:node # none + ["publish/**/*.js", "tmp/"] + ["build/"]
479
+
480
+ rake squared:run[#] # List scripts (node)
481
+ rake squared:rake[#] # List tasks (ruby)
470
482
  ```
471
483
 
472
484
  ```sh
@@ -519,37 +531,37 @@ Non-task:
519
531
 
520
532
  Most project classes will inherit from `Git` which enables these tasks:
521
533
 
522
- | Task | Git | Command |
523
- | :--------- | :--------------- | :-------------------------------------------------------- |
524
- | branch | branch | create track delete move copy list current |
525
- | checkout | checkout | commit branch track detach path |
526
- | commit | commit | add all amend amend-orig fixup |
527
- | diff | diff | head branch files view between contain |
528
- | fetch | fetch | origin remote all |
529
- | files | ls-files | cached modified deleted others |
530
- | git | | add blame clean grep mv revert rm status |
531
- | log | log | view between contain |
532
- | merge | merge | commit no-commit send |
533
- | pull | pull | origin remote all |
534
- | rebase | rebase | branch onto send |
535
- | refs | ls-remote --refs | heads tags remote |
536
- | reset | reset | commit index patch mode undo |
537
- | restore | restore | source staged worktree |
538
- | rev | rev | commit build output |
539
- | show | show | format oneline textconv |
540
- | stash | stash | push pop apply branch drop clear list all staged worktree |
541
- | submodule | submodule | status update branch url sync |
542
- | switch | switch | branch create detach |
543
- | tag | tag | add sign delete list |
534
+ | Task | Git | Command |
535
+ | :-------------- | :--------------- | :-------------------------------------------------------- |
536
+ | branch | branch | create track delete move copy list current |
537
+ | checkout | checkout | commit branch track detach path |
538
+ | commit | commit | add all amend amend-orig fixup |
539
+ | diff | diff | head branch files view between contain |
540
+ | fetch | fetch | origin remote all |
541
+ | files | ls-files | cached modified deleted others |
542
+ | git | | add blame clean grep mv revert rm sparse-checkout status |
543
+ | log | log | view between contain |
544
+ | merge | merge | commit no-commit send |
545
+ | pull | pull | origin remote all |
546
+ | rebase | rebase | branch onto send |
547
+ | refs | ls-remote --refs | heads tags remote |
548
+ | reset | reset | commit index patch mode undo |
549
+ | restore | restore | source staged worktree |
550
+ | rev | rev | commit branch build output |
551
+ | sparse-checkout | sparse-checkout | add reapply list clean disable |
552
+ | show | show | format oneline textconv |
553
+ | stash | stash | push pop apply branch drop clear list all staged worktree |
554
+ | submodule | submodule | status update branch url sync |
555
+ | switch | switch | branch create detach |
556
+ | tag | tag | add sign delete list |
544
557
 
545
558
  You can disable all of them at once using the `exclude` property.
546
559
 
547
560
  ```ruby
548
- Workspace::Application.exclude('autostash', 'rebase')
549
-
550
561
  Workspace::Application
551
562
  .new
552
563
  .add("squared", exclude: :git)
564
+ .build(exclude: ["autostash", "rebase"])
553
565
  ```
554
566
 
555
567
  You can disable one or more of them using the `pass` property as a *string*.
@@ -578,14 +590,14 @@ All project binary programs can have their executable path set to a non-global a
578
590
 
579
591
  ```ruby
580
592
  Common::PATH.update({
581
- GIT: "/usr/bin/git", # PATH_GIT=/usr/bin/git
582
- TAR: "/opt/archivers/tar", # PATH_TAR=/opt/archivers/tar
583
- UNZIP: "/opt/archivers/unzip",
584
- GEM: "~/.rvm/gems/ruby-3.4.0/bin/gem",
585
- BUNDLE: "~/.rvm/gems/ruby-3.4.0/bin/bundle",
586
- RAKE: "~/.rvm/gems/ruby-3.4.0/bin/rake",
587
- NPM: "/opt/node/v22.0.0/bin/npm",
588
- PYTHON: "#{ENV["PYTHONPATH"]}/bin/python"
593
+ git: "/usr/bin/git", # PATH_GIT=/usr/bin/git
594
+ tar: "/opt/archivers/tar", # PATH_TAR=/opt/archivers/tar
595
+ unzip: "/opt/archivers/unzip",
596
+ gem: "~/.rvm/gems/ruby-4.0.0/bin/gem",
597
+ bundle: "~/.rvm/gems/ruby-4.0.0/bin/bundle",
598
+ rake: "~/.rvm/gems/ruby-4.0.0/bin/rake",
599
+ npm: "/opt/node/v22.0.0/bin/npm",
600
+ python: "#{ENV["PYTHONPATH"]}/bin/python"
589
601
  })
590
602
  ```
591
603
 
@@ -658,57 +670,57 @@ LOG_LEVEL # See gem "logger"
658
670
  * Version: [2.51](https://github.com/git/git/blob/v2.51.0/Documentation/RelNotes/2.51.0.adoc)
659
671
 
660
672
  ```sh
661
- GIT_OPTIONS=q,strategy=ort # all
662
- GIT_OPTIONS_${NAME}=v,ff # project only
663
- GIT_AUTOSTASH=1 # rebase (all)
664
- GIT_AUTOSTASH_${NAME}=0 # rebase (project only)
673
+ GIT_OPTIONS=q,strategy=ort # all
674
+ GIT_OPTIONS_${NAME}=v,ff # project only
675
+ GIT_AUTOSTASH=1 # rebase (all)
676
+ GIT_AUTOSTASH_${NAME}=0 # rebase (project only)
665
677
  ```
666
678
 
667
- | Command | Flag | ENV |
668
- | :--------- | :---------------- | :-------------------------------------------------------------------- |
669
- | branch | create | TRACK=0,1,s F|FORCE |
670
- | branch | move copy | F|FORCE |
671
- | branch | delete | COUNT=n |
672
- | branch | global | SYNC |
673
- | checkout | branch | DETACH TRACK=s COUNT=n |
674
- | checkout | detach | REFLOG=1 |
675
- | checkout | track | COUNT=n |
676
- | checkout | global path | HEAD=s PATHSPEC=s |
677
- | checkout | * | F|FORCE MERGE |
678
- | clone | * | DEPTH=n ORIGIN=s BRANCH=s REVISION=s BARE=1 LOCAL=0,1 |
679
- | | | SINGLE_BRANCH=0,1 NO_CHECKOUT=1 NO_TAGS=1 QUIET=1 |
680
- | commit | * | UPSTREAM=s DRY_RUN EDIT=0 M|MESSAGE=s |
681
- | diff | -between -contain | MERGE_BASE |
682
- | diff | head branch | INDEX=n |
683
- | diff | * | PATHSPEC=s |
684
- | fetch | -remote | ALL |
685
- | fetch | remote | REFSPEC=s |
686
- | fetch | * | F|FORCE RECURSE_SUBMODULES=0,1,s |
687
- | git | rm | PATHSPEC=s |
688
- | log | * | PATHSPEC=s |
689
- | pull | remote | REFSPEC=s |
690
- | pull | -remote | REBASE=0,1 ALL |
691
- | pull | all | FF_ONLY=0 |
692
- | pull | * | AUTOSTASH F|FORCE RECURSE_SUBMODULES=0,1,s |
693
- | rebase | branch | HEAD=s |
694
- | rebase | onto | INTERACTIVE I HEAD=s |
695
- | reset | mode (mixed) | N REFRESH=0 |
696
- | reset | index | PATHSPEC=s |
697
- | reset | commit | COUNT=n REFLOG=1 |
698
- | reset | -commit | HEAD=s |
699
- | restore | * | PATHSPEC=s |
700
- | revbuild | global | UNTRACKED_FILES=s IGNORE_SUBMODULES=s IGNORED=s (status) |
701
- | stash | push | PATHSPEC=s |
702
- | stash | global | ALL=0,1 KEEP_INDEX=0,1 INCLUDE_UNTRACKED=0,1 STAGED=0,1 M|MESSAGE=s |
703
- | status | global | BRANCH LONG IGNORE_SUBMODULES=s,0-3 PATHSPEC=s |
704
- | submodule | -branch -url | R|RECURSIVE |
705
- | switch | detach | REFLOG=1 |
706
- | switch | -detach | HEAD=s |
707
- | switch | * | F|FORCE |
708
- | tag | add | SIGN FORCE HEAD=s M|MESSAGE=s |
709
- | tag | sign | F|FORCE HEAD=s M|MESSAGE=s |
710
- | tag | delete | COUNT=n |
711
- | rev | commit branch | HEAD=s |
679
+ | Command | Flag | ENV |
680
+ | :--------- | :---------------- | :------------------------------------------------------------------ |
681
+ | branch | create | TRACK=0,1,s F|FORCE |
682
+ | branch | move copy | F|FORCE |
683
+ | branch | delete | COUNT=n |
684
+ | branch | global | SYNC |
685
+ | checkout | branch | DETACH TRACK=s COUNT=n |
686
+ | checkout | detach | REFLOG=1 |
687
+ | checkout | track | COUNT=n |
688
+ | checkout | global path | HEAD=s PATHSPEC=s |
689
+ | checkout | * | F|FORCE MERGE |
690
+ | clone | * | DEPTH=n ORIGIN=s BRANCH=s REVISION=s BARE=1 LOCAL=0,1 |
691
+ | | | SINGLE_BRANCH=0,1 NO_CHECKOUT=1 NO_TAGS=1 QUIET=1 |
692
+ | commit | * | UPSTREAM=s DRY_RUN EDIT=0 M|MESSAGE=s |
693
+ | diff | -between -contain | MERGE_BASE |
694
+ | diff | head branch | INDEX=n |
695
+ | diff | * | PATHSPEC=s |
696
+ | fetch | -remote | ALL |
697
+ | fetch | remote | REFSPEC=s |
698
+ | fetch | * | F|FORCE RECURSE_SUBMODULES=0,1,s |
699
+ | git | rm | PATHSPEC=s |
700
+ | log | * | PATHSPEC=s |
701
+ | pull | remote | REFSPEC=s |
702
+ | pull | -remote | REBASE=0,1 ALL |
703
+ | pull | all | FF_ONLY=0 |
704
+ | pull | * | AUTOSTASH F|FORCE RECURSE_SUBMODULES=0,1,s |
705
+ | rebase | branch | HEAD=s |
706
+ | rebase | onto | INTERACTIVE I HEAD=s |
707
+ | reset | mode (mixed) | N REFRESH=0 |
708
+ | reset | index | PATHSPEC=s |
709
+ | reset | commit | COUNT=n REFLOG=1 |
710
+ | reset | -commit | HEAD=s |
711
+ | restore | * | PATHSPEC=s |
712
+ | revbuild | global | UNTRACKED_FILES=s IGNORE_SUBMODULES=s IGNORED=s (status) |
713
+ | stash | push | PATHSPEC=s |
714
+ | stash | global | ALL=0,1 KEEP_INDEX=0,1 INCLUDE_UNTRACKED=0,1 STAGED=0,1 M|MESSAGE=s |
715
+ | status | global | BRANCH LONG IGNORE_SUBMODULES=s,0-3 PATHSPEC=s |
716
+ | submodule | -branch -url | R|RECURSIVE |
717
+ | switch | detach | REFLOG=1 |
718
+ | switch | -detach | HEAD=s |
719
+ | switch | * | F|FORCE |
720
+ | tag | add | SIGN FORCE HEAD=s M|MESSAGE=s |
721
+ | tag | sign | F|FORCE HEAD=s M|MESSAGE=s |
722
+ | tag | delete | COUNT=n |
723
+ | rev | commit branch | HEAD=s |
712
724
 
713
725
  ### Docker
714
726
 
@@ -722,8 +734,8 @@ DOCKER_TAG_${NAME}=v0.1.0 # project only (override)
722
734
  DOCKER_ALL=1 # list every image/container
723
735
  DOCKER_Y=1 # confirm all
724
736
 
725
- BUILD_SQUARED_OPTS="NODE_TAG=24 RUBY_VERSION=3.4.0" DOCKER_SQUARED_OPTS="--no-cache --label=v1" rake squared:build
726
- docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_VERSION=3.4.0" .
737
+ BUILD_SQUARED_OPTS="NODE_TAG=24 RUBY_VERSION=4.0.0" DOCKER_SQUARED_OPTS="--no-cache --label=v1" rake squared:build
738
+ docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_VERSION=4.0.0" .
727
739
  ```
728
740
 
729
741
  | Command | Flag | ENV |
@@ -732,6 +744,7 @@ docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_V
732
744
  | buildx | bake | SERVICE=s |
733
745
  | compose | build | TARGET=s |
734
746
  | compose | run | VERSION=s |
747
+ | compose | publish | TAG=s REGISTRY=s |
735
748
  | container | commit | REGISTRY=s PLATFORM=s DISABLE_CONTENT_TRUST=0,1 |
736
749
  | container | -run -create -exec | ALL=1 |
737
750
  | | -update -commit | |
@@ -744,17 +757,25 @@ docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_V
744
757
 
745
758
  * Version: [15](https://asdf-vm.com/guide/getting-started-legacy.html) | [16+](https://asdf-vm.com/guide/getting-started.html)
746
759
 
747
- | Command | Options | Arguments |
748
- | :--------- | :---------------- | :---------------|
749
- | set | u|home p|parent | version |
750
- | exec | | command,args* |
751
- | current | | |
760
+ | Command | Options | Arguments |
761
+ | :--------- | :----------------- | :------------ |
762
+ | set | u|home p|parent | version |
763
+ | exec | | command,args* |
764
+ | current | | |
752
765
 
753
766
  ```ruby
754
767
  Workspace::Application
755
768
  .new
756
- .add("squared", asdf: "ruby", ref: :node) # Any command is supported (default: nodejs)
757
- .add("squared-ruby", "squared") # Uses default command "ruby"
769
+ .add("squared", asdf: "ruby", ref: :node) # Detects ruby instead of nodejs
770
+ .add("squared-ruby", "squared", ref: :ruby) # Uses asdf program alias "ruby"
771
+ ```
772
+
773
+ ```sh
774
+ # ~/.bashrc (legacy)
775
+
776
+ export ASDF_DIR=/opt/asdf-vm
777
+
778
+ . $ASDF_DIR/asdf.sh
758
779
  ```
759
780
 
760
781
  ### Repo
@@ -772,6 +793,9 @@ chmod a+rx ~/.bin/repo
772
793
  ```
773
794
 
774
795
  ```ruby
796
+ require "squared/workspace"
797
+ require "squared/workspace/repo"
798
+
775
799
  # REPO_ROOT = /workspaces |
776
800
  # REPO_HOME = /workspaces/squared | Dir.pwd
777
801
  # rake = /workspaces/squared/Rakefile | main?
@@ -784,17 +808,31 @@ chmod a+rx ~/.bin/repo
784
808
 
785
809
  Workspace::Application
786
810
  .new(main: "squared")
787
- .repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], install: "#{ENV["HOME"]}/.bin", ref: :node)
811
+ .repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], install: "#{ENV["HOME"]}/.bin", # install: first only
812
+ ref: %i[node -docker]) # exclude: -docker
813
+ .repo("https://github.com/anpham6/squared-repo", name: "doc", doc: true, test: true, ref: :python)
788
814
  .add("squared", script: ["build:stage1", "build:stage2"])
815
+ .with(:python) do
816
+ add "android-docs"
817
+ add "chrome-docs"
818
+ end
789
819
  .build
790
820
  ```
791
821
 
822
+ ```sh
823
+ REPO_ROOT=/workspace/node rake repo:init
824
+
825
+ REPO_ROOT=/workspace/python rake repo:doc:init
826
+ ```
827
+
792
828
  These global options also can target the application main suffix `${NAME}`. (e.g. *REPO_ROOT_SQUARED*)
793
829
 
794
830
  ```sh
795
831
  REPO_ROOT # parent dir
796
832
  REPO_HOME # project dir (main)
833
+ REPO_OPTIONS # appended to application command
797
834
  REPO_BUILD # script,run (e.g. build:dev | build:dev,make install | make)
835
+ REPO_SERIES # depend,build:parallel,doc:detect,lint (task order)
798
836
  REPO_GROUP # string
799
837
  REPO_REF # e.g. ruby,node
800
838
  REPO_DEV # pattern,0,1
@@ -804,8 +842,8 @@ REPO_SYNC # 0,1
804
842
  REPO_GIT # manifest repository
805
843
  REPO_MANIFEST # e.g. latest,nightly,prod
806
844
  REPO_GROUPS # e.g. base,prod,docs
807
- REPO_STAGE # 0,1,2,3,4
808
- REPO_SUBMODULLES # 0,1
845
+ REPO_STAGE # 0,1|sync,2|depend,4|build,8|copy,16|lint,512|dev
846
+ REPO_SUBMODULES # 0,1
809
847
  REPO_Y # 0,1
810
848
  REPO_TIMEOUT # confirm dialog (seconds)
811
849
  ```
@@ -820,41 +858,42 @@ Features can be enabled through ENV when calling global tasks such as through *C
820
858
 
821
859
  * Prefix: BUNDLE/GEM/RBS
822
860
 
823
- | Command | Flag | ENV |
824
- | :--------- | :-------- | :---------------------------------------------------------------- |
825
- | depend | - | BINSTUBS=s JOBS=n |
826
- | outdated | - | U|UPDATE=major|minor|patch ONLY_EXPLICIT DRY_RUN |
827
- | gem | outdated | DOCUMENT=0,1 USER_INSTALL=0,1 |
828
- | rbs | prototype | Y=0,1 |
861
+ | Command | Flag | ENV |
862
+ | :--------- | :-------- | :-------------------------------------------------------- |
863
+ | depend | - | BINSTUBS=s JOBS=n |
864
+ | depend | update | VERSION=major|minor|patch STRICT CONSERVATIVE |
865
+ | outdated | - | U|UPDATE=major|minor|patch ONLY_EXPLICIT DRY_RUN |
866
+ | gem | outdated | DOCUMENT=0,1 USER_INSTALL=0,1 |
867
+ | rbs | prototype | Y=0,1 |
829
868
 
830
869
  #### Node
831
870
 
832
871
  * Prefix: NPM/PNPM/YARN
833
872
 
834
- | Command | Flag | ENV |
835
- | :------------- | :------------- | :------------------------------------------------------- |
836
- | depend | - | FORCE CI IGNORE_SCRIPTS |
837
- | outdated | - | U|UPDATE=major|minor|patch DIFF DRY_RUN |
838
- | publish | - | OTP=s TAG=s ACCESS=0,1,s DRY_RUN |
839
- | depend package | * | PACAKGE_LOCK|LOCKFILE=0 NO_LOCKFILE=1 Y |
840
- | npm pnpm | depend package | CPU=s OS=s LIBC=s |
841
- | npm | package | SAVE IGNORE_SCRIPTS STRICT_PEER_DEPS |
842
- | pnpm | depend | PUBLIC_HOIST_PATTERN=s APPROVE_BUILDS |
843
- | pnpm | depend:add | ALLOW_BUILD=s |
844
- | yarn | depend package | IGNORE_ENGINES=0 |
873
+ | Command | Flag | ENV |
874
+ | :------------- | :------------- | :----------------------------------------------- |
875
+ | depend | - | FORCE CI IGNORE_SCRIPTS |
876
+ | outdated | - | U|UPDATE=major|minor|patch DIFF DRY_RUN |
877
+ | publish | - | OTP=s TAG=s ACCESS=0,1,s DRY_RUN |
878
+ | depend package | * | PACAKGE_LOCK|LOCKFILE=0 NO_LOCKFILE=1 Y |
879
+ | npm pnpm | depend package | CPU=s OS=s LIBC=s |
880
+ | npm | package | SAVE IGNORE_SCRIPTS STRICT_PEER_DEPS |
881
+ | pnpm | depend | PUBLIC_HOIST_PATTERN=s APPROVE_BUILDS |
882
+ | pnpm | depend:add | ALLOW_BUILD=s |
883
+ | yarn | depend package | IGNORE_ENGINES |
845
884
 
846
885
  #### Python
847
886
 
848
887
  * Prefix: PIP/POETRY
849
888
 
850
- | Command | Flag | ENV |
851
- | :--------- | :-------- | :---------------------------------------------------------------- |
852
- | global | * | CACHE_DIR=0,s PROXY=s PYTHON=s COLOR=0 |
853
- | depend | - | E|EDITABLE=0,s BUILD_ISOLATION=0 |
854
- | outdated | - | U|UPDATE=major|minor|patch NOT_REQUIRED=0 L|LOCAL DRY_RUN |
855
- | venv | exec | INTERACTIVE=0 |
856
- | poetry | * | PROJECT=s |
857
- | poetry | depend | NO_ROOT |
889
+ | Command | Flag | ENV |
890
+ | :--------- | :-------- | :-------------------------------------------------------- |
891
+ | global | * | CACHE_DIR=0,s PROXY=s PYTHON=s COLOR=0 |
892
+ | depend | - | E|EDITABLE=0,s BUILD_ISOLATION=0 |
893
+ | outdated | - | U|UPDATE=major|minor|patch NOT_REQUIRED=0 L|LOCAL DRY_RUN |
894
+ | venv | exec | INTERACTIVE=0 |
895
+ | poetry | * | PROJECT=s |
896
+ | poetry | depend | NO_ROOT |
858
897
 
859
898
  ## LICENSE
860
899