squared 0.5.23 → 0.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +89 -227
- data/README.md +104 -72
- data/lib/squared/common/base.rb +1 -22
- data/lib/squared/common/format.rb +40 -38
- data/lib/squared/common/prompt.rb +58 -40
- data/lib/squared/common/shell.rb +71 -56
- data/lib/squared/common/system.rb +70 -38
- data/lib/squared/common/utils.rb +29 -6
- data/lib/squared/config.rb +27 -34
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +86 -104
- data/lib/squared/workspace/project/base.rb +544 -412
- data/lib/squared/workspace/project/docker.rb +397 -293
- data/lib/squared/workspace/project/git.rb +358 -343
- data/lib/squared/workspace/project/node.rb +500 -283
- data/lib/squared/workspace/project/python.rb +370 -249
- data/lib/squared/workspace/project/ruby.rb +696 -396
- data/lib/squared/workspace/project/support/class.rb +209 -212
- data/lib/squared/workspace/repo.rb +47 -44
- data/lib/squared/workspace/series.rb +13 -21
- data/lib/squared/workspace/support/base.rb +3 -24
- data/lib/squared/workspace/support/variables.rb +48 -0
- data/lib/squared/workspace/support.rb +1 -1
- data/lib/squared/workspace.rb +4 -6
- metadata +3 -3
- data/lib/squared/workspace/support/data.rb +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed078210213186745643650b4a73f7f376b5aba7033643c850b48d555c198501
|
|
4
|
+
data.tar.gz: d4d8c0e6308f3bdc3aca66891980259ad52ce11f3a53112c7a22ae4de9e31f40
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fcf308f894ee49566103575561b74459afc1aa7e03af8d5c5397c7bb7432dfce996cbb1291f4f81af792d5b1dd8ed6a9075ce7b2fab6f41dca0c56431e38b78c
|
|
7
|
+
data.tar.gz: 19f25542363b33fa567cbfcb0267c79fbc55a313ce0fba8ab25ec17dd43f276b004b00304e8bfe38dba1338a2e554170a8f1535d1bdc5981407fae6e9bff2bf8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,214 +1,97 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.
|
|
4
|
-
|
|
5
|
-
### Fixed
|
|
6
|
-
|
|
7
|
-
- See `0.4.37`.
|
|
8
|
-
|
|
9
|
-
## [0.4.37] - 2026-04-29
|
|
10
|
-
|
|
11
|
-
### Changed
|
|
12
|
-
|
|
13
|
-
- Project base method dependindex replaces private instance variable.
|
|
14
|
-
|
|
15
|
-
### Fixed
|
|
16
|
-
|
|
17
|
-
- Ruby command version did not abort asdf "Not installed" error.
|
|
18
|
-
- Git command pull action all did not pass option flags to branches.
|
|
19
|
-
- Python command exec did not activate virtual environment.
|
|
20
|
-
- Docker command bake did not reinsert failed check for context directory.
|
|
21
|
-
- Common method shell_quote argument preserve did not bypass requoting.
|
|
22
|
-
|
|
23
|
-
## [0.5.22] - 2026-03-11
|
|
24
|
-
|
|
25
|
-
### Fixed
|
|
26
|
-
|
|
27
|
-
- Project base run command was not covered due to lack of type checking.
|
|
28
|
-
|
|
29
|
-
## [0.4.36] - 2026-03-11
|
|
30
|
-
|
|
31
|
-
### Added
|
|
32
|
-
|
|
33
|
-
- Python venv initialization installs setuptools when detected.
|
|
34
|
-
- Node task depend adds prod option flags when NODE_ENV=production.
|
|
35
|
-
|
|
36
|
-
### Changed
|
|
37
|
-
|
|
38
|
-
- Application method with using hide and pass compatibility was implemented.
|
|
39
|
-
|
|
40
|
-
### Fixed
|
|
41
|
-
|
|
42
|
-
- Docker task clean does not run in parallel without ENV override.
|
|
43
|
-
- OptionPartition methods with escape parameter were reordered.
|
|
44
|
-
- OptionPartition methods with quote parameter were revised.
|
|
45
|
-
|
|
46
|
-
## [0.5.21] - 2025-12-31
|
|
47
|
-
|
|
48
|
-
### Fixed
|
|
49
|
-
|
|
50
|
-
- See `0.4.35`.
|
|
51
|
-
|
|
52
|
-
## [0.4.35] - 2025-12-31
|
|
53
|
-
|
|
54
|
-
### Changed
|
|
55
|
-
|
|
56
|
-
- Ruby task copy uses GEM_HOME as fallback for autodetect.
|
|
57
|
-
|
|
58
|
-
### Fixed
|
|
59
|
-
|
|
60
|
-
- Git commands [rebase|clone] did not forward sync flag.
|
|
61
|
-
- Pip command install carelessly used an undefined method.
|
|
62
|
-
- Common prompt method readline with multiline did not permit empty lines.
|
|
63
|
-
- Application method with using pass did not ignore exceptions.
|
|
64
|
-
|
|
65
|
-
## [0.5.20] - 2025-12-26
|
|
66
|
-
|
|
67
|
-
### Fixed
|
|
68
|
-
|
|
69
|
-
- Bundle config get method did not always discard newline.
|
|
70
|
-
|
|
71
|
-
## [0.4.34] - 2025-12-26
|
|
3
|
+
## [0.6.0] - 2025-10-31
|
|
72
4
|
|
|
73
5
|
### Added
|
|
74
6
|
|
|
75
|
-
-
|
|
76
|
-
-
|
|
7
|
+
- Docker command compose action create was implemented.
|
|
8
|
+
- Docker command compose action ps was implemented.
|
|
9
|
+
- Docker command compose action ps is interactive.
|
|
10
|
+
- Project base asdf commands [latest|where|update] were implemented.
|
|
11
|
+
- Pip command options were updated to 25.2.
|
|
12
|
+
- Command line programs who do not assign with equals are supported.
|
|
13
|
+
- Docker command ls with column formatting was implemented.
|
|
14
|
+
- Git command stash action staged and worktree were implemented.
|
|
15
|
+
- Git command diff action files can output to a patch file.
|
|
16
|
+
- Repo task init with REPO_Y can auto-accept overwrite confirmation.
|
|
17
|
+
- Caller locations for errors can be excluded using ARG[:BACKTRACE].
|
|
18
|
+
- Node command package action reinstall was implemented.
|
|
19
|
+
- Node class method and command tsc was implemented.
|
|
20
|
+
- Python command pip action reinstall was implemented.
|
|
21
|
+
- Project command options can be stored by class ref and project name.
|
|
22
|
+
- Bundler command config is interactive.
|
|
23
|
+
- Ruby method bundle supports stored command options.
|
|
24
|
+
- Ruby method rake supports stored command options.
|
|
25
|
+
- Ruby method ruby supports stored command options.
|
|
26
|
+
- Ruby method gem supports stored command options.
|
|
27
|
+
- Python method pip supports stored command options.
|
|
28
|
+
- Python command pip action wheel was implemented.
|
|
29
|
+
- Ruby method irb supports stored command options.
|
|
30
|
+
- Ruby command gem action command was implemented.
|
|
31
|
+
- ENV supplementary command options can be space delimited.
|
|
32
|
+
- Project command options can extend other stored options.
|
|
33
|
+
- Ruby command gem action outdated can update without being interactive.
|
|
34
|
+
- Ruby command gem action update system can accept a specific version.
|
|
35
|
+
- Ruby command gem action outdated supports threading.
|
|
36
|
+
- Git command grep was implemented.
|
|
37
|
+
- Common format bright colors fallback to standard colors when not enabled.
|
|
38
|
+
- Project base command unpack action gz was implemented.
|
|
39
|
+
- Common format defined String instance method subhint.
|
|
40
|
+
- Application readers [exception|pipe|verbose|warning] were converted into accessors.
|
|
41
|
+
- Node private projects can publish entire workspace with tags.
|
|
42
|
+
- Node command outdated can select a range of packages to update.
|
|
43
|
+
- Gem command outdated can select a range of packages to update.
|
|
44
|
+
- Python command outdated can select a range of packages to update.
|
|
45
|
+
- Node command outdated option diff was implemented.
|
|
46
|
+
- Bundler command outdated can select a range of packages to update.
|
|
47
|
+
- Common prompt method choice can select all items with "\*".
|
|
48
|
+
- Node command bump can auto-commit package.json using GIT_MESSAGE.
|
|
49
|
+
- Git command options were updated to version 2.51.
|
|
77
50
|
|
|
78
51
|
### Changed
|
|
79
52
|
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
- Docker
|
|
87
|
-
- Project base method
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- Ruby
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
### Fixed
|
|
120
|
-
|
|
121
|
-
-
|
|
122
|
-
- JoinSet method include? did not always search to start of delimiter.
|
|
123
|
-
- Config viewer did not check for a readable package registry document.
|
|
124
|
-
- Powershell executable did not check for alternate path location.
|
|
125
|
-
|
|
126
|
-
## [0.5.17] - 2025-11-22
|
|
127
|
-
|
|
128
|
-
### Fixed
|
|
129
|
-
|
|
130
|
-
- See `0.4.31`.
|
|
131
|
-
|
|
132
|
-
## [0.4.31] - 2025-11-22
|
|
133
|
-
|
|
134
|
-
### Changed
|
|
135
|
-
|
|
136
|
-
- Project base attribute project was converted into an accessor.
|
|
137
|
-
- Ruby command flag is given precedence to a program file.
|
|
138
|
-
|
|
139
|
-
### Fixed
|
|
140
|
-
|
|
141
|
-
- Repo application tasks are not created on Windows.
|
|
142
|
-
- Repo module used conflicting REPO_URL with Repo application.
|
|
143
|
-
- Project task outdated did not check pass and only exclusions.
|
|
144
|
-
- Workspace static method resolve did nothing when given a String.
|
|
145
|
-
- Project base run command types did not include Struct.
|
|
146
|
-
- Project change directory context did not always restore when raised.
|
|
147
|
-
- Ruby file method attributes did not always return nil.
|
|
148
|
-
- JoinSet with a delimiter did not report correct size.
|
|
149
|
-
|
|
150
|
-
## [0.5.16] - 2025-11-14
|
|
151
|
-
|
|
152
|
-
### Fixed
|
|
153
|
-
|
|
154
|
-
- See `0.4.30`.
|
|
155
|
-
|
|
156
|
-
## [0.4.30] - 2025-11-14
|
|
157
|
-
|
|
158
|
-
### Added
|
|
159
|
-
|
|
160
|
-
- Config viewer can read items by index in an Array.
|
|
161
|
-
|
|
162
|
-
### Fixed
|
|
163
|
-
|
|
164
|
-
- Node command add uses event name "add" and not "depend".
|
|
165
|
-
- Node command add did not include packages with Yarn and PNPM.
|
|
166
|
-
- Git method revbuild did not splat build arguments.
|
|
167
|
-
|
|
168
|
-
## [0.5.15] - 2025-11-08
|
|
169
|
-
|
|
170
|
-
### Fixed
|
|
171
|
-
|
|
172
|
-
- See `0.4.29`.
|
|
173
|
-
|
|
174
|
-
## [0.4.29] - 2025-11-08
|
|
175
|
-
|
|
176
|
-
### Fixed
|
|
177
|
-
|
|
178
|
-
- OptionPartition was created by mistake and is unreliable in every way.
|
|
179
|
-
|
|
180
|
-
## [0.5.14] - 2025-11-08
|
|
181
|
-
|
|
182
|
-
### Fixed
|
|
183
|
-
|
|
184
|
-
- See `0.4.28`.
|
|
185
|
-
|
|
186
|
-
## [0.4.28] - 2025-11-08
|
|
187
|
-
|
|
188
|
-
### Fixed
|
|
189
|
-
|
|
190
|
-
- Project base method build as arrays parsed unrelated arguments.
|
|
191
|
-
- OptionPartition method arg? does not check after "--" delimiter.
|
|
192
|
-
- OptionPartition did not support duplicate values after "--" delimiter.
|
|
193
|
-
- OptionPartition method opt? did not type check for String.
|
|
194
|
-
|
|
195
|
-
## [0.5.13] - 2025-11-05
|
|
196
|
-
|
|
197
|
-
### Fixed
|
|
198
|
-
|
|
199
|
-
- See `0.4.27`.
|
|
200
|
-
|
|
201
|
-
## [0.4.27] - 2025-11-05
|
|
202
|
-
|
|
203
|
-
### Changed
|
|
204
|
-
|
|
205
|
-
- OptionPartition does not add quotes when an option flag is detected.
|
|
206
|
-
- Common shell method argument option only parses options with values.
|
|
207
|
-
- Shell options with empty flags are treated as quoted strings.
|
|
208
|
-
|
|
209
|
-
### Fixed
|
|
210
|
-
|
|
211
|
-
- OptionPartition did not detect flags with middle dashes.
|
|
53
|
+
- Git method source will raise error when checking exit status.
|
|
54
|
+
- Date gem is no longer globally required.
|
|
55
|
+
- Global task git:all was removed.
|
|
56
|
+
- Common base method as_a was relocated to Utils.
|
|
57
|
+
- Python command build and publish detects only one backend.
|
|
58
|
+
- Docker command compose action ps was renamed service.
|
|
59
|
+
- Docker command image action list was renamed ls.
|
|
60
|
+
- Project base method success? conditionally calls print_success method.
|
|
61
|
+
- Error classes were not specified for invalid operation.
|
|
62
|
+
- Common format methods stripstyle and stripext are String instance methods.
|
|
63
|
+
- Common format method alias puts_oe was removed.
|
|
64
|
+
- Git commands without a valid action will exit with error status.
|
|
65
|
+
- Errno exceptions are used in place of SystemCallError.
|
|
66
|
+
- Common format method raise_error defaults to RuntimeError.
|
|
67
|
+
- OptionPartition delegator method delete_at was renamed remove_at.
|
|
68
|
+
- Node event name "publish" was renamed to "npm:publish".
|
|
69
|
+
- Project task run with a Method passes self as first argument.
|
|
70
|
+
- Ruby command check was removed.
|
|
71
|
+
- Ruby method gem! was renamed gem.
|
|
72
|
+
- Ruby methods ruby and irb first argument was converted into kwargs.
|
|
73
|
+
- Ruby method rake executes all tasks in one run command.
|
|
74
|
+
- Ruby project file methods return nil instead of false.
|
|
75
|
+
- Ruby commands [exec|cache|config] were relocated under bundle namespace.
|
|
76
|
+
- Ruby command gem action update without arguments is not modified.
|
|
77
|
+
- Ruby command install was replaced with reinstall under bundle namespace.
|
|
78
|
+
- Ruby command update was relocated under bundle namespace.
|
|
79
|
+
- Common prompt confirm timeout was revised for non-immediate responses.
|
|
80
|
+
- Project relative paths are stripped from banner when context is displayed.
|
|
81
|
+
- Workspace module Support extend submodules private methods.
|
|
82
|
+
- Workspace method add passes parent through Project constructor.
|
|
83
|
+
- Project base method run_s uses last argument for ENV hash.
|
|
84
|
+
- Project base method inject does not exit program when raised.
|
|
85
|
+
- Reline gem is installed only when using at least Ruby 3.0.
|
|
86
|
+
- Python method install arguments strategy and user were removed.
|
|
87
|
+
- Project command outdated does not support threading when interactive.
|
|
88
|
+
- Project base accessor global was converted into a reader and setter.
|
|
89
|
+
- Repo build can simultaneously use script and run through REPO_BUILD.
|
|
90
|
+
- Repo static method read_manifest was made an instance method named repo_manifest.
|
|
91
|
+
|
|
92
|
+
### Fixed
|
|
93
|
+
|
|
94
|
+
- Node task update did not check equivalent ENV install options.
|
|
212
95
|
|
|
213
96
|
## [0.5.12] - 2025-10-31
|
|
214
97
|
|
|
@@ -1367,7 +1250,7 @@
|
|
|
1367
1250
|
- Rake did not set original rakefile when calling itself.
|
|
1368
1251
|
- Extended tasks were not associated to their supporting class method.
|
|
1369
1252
|
|
|
1370
|
-
## [0.1.0] - 2024-12-
|
|
1253
|
+
## [0.1.0] - 2024-12-7
|
|
1371
1254
|
|
|
1372
1255
|
### Added
|
|
1373
1256
|
|
|
@@ -1388,23 +1271,13 @@
|
|
|
1388
1271
|
- Git pull did not display colors for diff bar chart.
|
|
1389
1272
|
- Git commit did not fetch latest refs before submitting.
|
|
1390
1273
|
|
|
1391
|
-
## [0.0.12] - 2024-12-
|
|
1274
|
+
## [0.0.12] - 2024-12-1
|
|
1392
1275
|
|
|
1393
1276
|
### Added
|
|
1394
1277
|
|
|
1395
1278
|
- Changelog was created.
|
|
1396
1279
|
|
|
1397
|
-
[0.
|
|
1398
|
-
[0.5.22]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.22
|
|
1399
|
-
[0.5.21]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.21
|
|
1400
|
-
[0.5.20]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.20
|
|
1401
|
-
[0.5.19]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.19
|
|
1402
|
-
[0.5.18]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.18
|
|
1403
|
-
[0.5.17]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.17
|
|
1404
|
-
[0.5.16]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.16
|
|
1405
|
-
[0.5.15]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.15
|
|
1406
|
-
[0.5.14]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.14
|
|
1407
|
-
[0.5.13]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.13
|
|
1280
|
+
[0.6.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.0
|
|
1408
1281
|
[0.5.12]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.12
|
|
1409
1282
|
[0.5.11]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.11
|
|
1410
1283
|
[0.5.10]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.10
|
|
@@ -1418,17 +1291,6 @@
|
|
|
1418
1291
|
[0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
|
|
1419
1292
|
[0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
|
|
1420
1293
|
[0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
|
|
1421
|
-
[0.4.37]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.37
|
|
1422
|
-
[0.4.36]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.36
|
|
1423
|
-
[0.4.35]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.35
|
|
1424
|
-
[0.4.34]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.34
|
|
1425
|
-
[0.4.33]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.33
|
|
1426
|
-
[0.4.32]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.32
|
|
1427
|
-
[0.4.31]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.31
|
|
1428
|
-
[0.4.30]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.30
|
|
1429
|
-
[0.4.29]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.29
|
|
1430
|
-
[0.4.28]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.28
|
|
1431
|
-
[0.4.27]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.27
|
|
1432
1294
|
[0.4.26]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.26
|
|
1433
1295
|
[0.4.25]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.25
|
|
1434
1296
|
[0.4.24]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.24
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# squared 0.
|
|
1
|
+
# squared 0.6
|
|
2
2
|
|
|
3
3
|
* [source](https://github.com/anpham6/squared-ruby)
|
|
4
4
|
* [docs](https://squared.readthedocs.io)
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
| 2025-06-16 | 0.5.0 | 2.5.0 | 3.4.3 |
|
|
15
15
|
| ---------- | ----- | ----- | ----- |
|
|
16
16
|
| 2025-08-23 | 0.5.5 | | 3.4.5 |
|
|
17
|
+
| 2025-10-31 | 0.6.0 | | 3.4.7 |
|
|
17
18
|
|
|
18
19
|
The range chart indicates the latest Ruby tested against at the time of release.
|
|
19
20
|
|
|
@@ -23,9 +24,23 @@ The range chart indicates the latest Ruby tested against at the time of release.
|
|
|
23
24
|
gem install squared
|
|
24
25
|
```
|
|
25
26
|
|
|
27
|
+
### Optional
|
|
28
|
+
|
|
29
|
+
* [Repo](https://source.android.com/docs/setup/reference/repo)
|
|
30
|
+
* https://github.com/anpham6/squared-repo
|
|
31
|
+
* Python 3.6
|
|
32
|
+
* Not compatible with Windows
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
mkdir -p ~/.bin
|
|
36
|
+
PATH="${HOME}/.bin:${PATH}"
|
|
37
|
+
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
|
|
38
|
+
chmod a+rx ~/.bin/repo
|
|
39
|
+
```
|
|
40
|
+
|
|
26
41
|
## Example - Rakefile
|
|
27
42
|
|
|
28
|
-
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.
|
|
43
|
+
Projects from any accessible folder can be added relative to the parent directory (e.g. *REPO_ROOT*) or absolutely. The same Rakefile can also manage other similarly cloned `Repo` repositories remotely by setting the `REPO_ROOT` environment variable to the location. Missing projects will simply be excluded from the task runner.
|
|
29
44
|
|
|
30
45
|
```ruby
|
|
31
46
|
require "squared"
|
|
@@ -41,6 +56,14 @@ require "squared/app" # All workspace related mod
|
|
|
41
56
|
|
|
42
57
|
# NODE_ENV = production
|
|
43
58
|
|
|
59
|
+
# REPO_ROOT = /workspaces |
|
|
60
|
+
# REPO_HOME = /workspaces/squared | Dir.pwd
|
|
61
|
+
# rake = /workspaces/squared/Rakefile | main?
|
|
62
|
+
# OR
|
|
63
|
+
# REPO_ROOT = /workspaces | Dir.pwd
|
|
64
|
+
# rake = /workspaces/Rakefile |
|
|
65
|
+
# REPO_HOME = /workspaces/squared | main: "squared"
|
|
66
|
+
|
|
44
67
|
# pathname = /workspaces/pathname
|
|
45
68
|
# optparse = /workspaces/optparse
|
|
46
69
|
# log = /workspaces/logger
|
|
@@ -55,6 +78,7 @@ require "squared/app" # All workspace related mod
|
|
|
55
78
|
Workspace::Application
|
|
56
79
|
.new(Dir.pwd, main: "squared") # Dir.pwd? (main? is implicitly basename)
|
|
57
80
|
.banner("group", "project", styles: ["yellow", "black"], border: "bold") # name | project | path | ref | group? | parent? | version?
|
|
81
|
+
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "build:prod"], ref: :node) # Repo (optional)
|
|
58
82
|
.run("rake install", ref: :ruby)
|
|
59
83
|
.depend(false, group: "default")
|
|
60
84
|
.clean("rake clean", group: "default")
|
|
@@ -68,7 +92,7 @@ Workspace::Application
|
|
|
68
92
|
.add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node) # Node
|
|
69
93
|
.add("pi-r", "pir", copy: { from: "publish", scope: "@pi-r" }, clean: ["publish/**/*.js", "tmp/"]) # Trailing slash required for directories
|
|
70
94
|
.add("pi-r2", "pir2", copy: { from: :npm, also: %i[squared express], files: ["LICENSE", ["README.md.ruby", "README.md"]] }) # Uses dist files from NPM package spec
|
|
71
|
-
.add("squared", init:
|
|
95
|
+
.add("squared", init: 'pnpm', script: ["build:stage1", "build:stage2"], group: "app") do # Use pnpm/yarn/berry for depend + Copy target (main)
|
|
72
96
|
# Repo (global)
|
|
73
97
|
as(:run, "build:dev", "dev") # npm run build:dev -> npm run dev
|
|
74
98
|
as(:run, { "build:dev": "dev", "build:prod": "prod" })
|
|
@@ -119,20 +143,59 @@ Workspace::Application
|
|
|
119
143
|
# android = /workspaces/android-docs
|
|
120
144
|
# chrome = /workspaces/chrome-docs
|
|
121
145
|
|
|
146
|
+
# ...symbol?, string, ...string?, ...symbol?
|
|
147
|
+
# extend name args project
|
|
148
|
+
|
|
149
|
+
Node = Workspace::Project::Node # tsc
|
|
150
|
+
Node.options("build:dev", "target=es2022", project: "tsconfig.json") # :node (ref)
|
|
151
|
+
Node.options("build:dev", "outDir=tmp", :squared) # squared (project name)
|
|
152
|
+
|
|
153
|
+
Ruby = Workspace::Project::Ruby # ruby | gem | rake | bundle | irb
|
|
154
|
+
Ruby.options("lint", "rubocop", opts: ["gemfile=Gemfile"]) # :ruby
|
|
155
|
+
Ruby.options("lint", "--parallel", :squared)
|
|
156
|
+
|
|
157
|
+
Python = Workspace::Project::Python # pip
|
|
158
|
+
Python.options("build", opts: ["r=requirements.txt"]) # :python
|
|
159
|
+
Python.options(:build, "build:dev", opts: ["no-deps"])
|
|
160
|
+
|
|
122
161
|
Workspace::Application
|
|
123
|
-
.new(ENV["SQUARED_HOME"], prefix: "rb", common: false)
|
|
162
|
+
.new(ENV["SQUARED_HOME"], prefix: "rb", common: false) # Local styles
|
|
124
163
|
.group("ruby", "default", run: "rake build", copy: "rake install", clean: "rake clean", ref: :ruby, override: {
|
|
125
164
|
pathname: {
|
|
126
|
-
run: "rake compile"
|
|
165
|
+
run: "rake compile" # rake rb:pathname:build
|
|
127
166
|
}
|
|
128
167
|
})
|
|
129
|
-
.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
168
|
+
.add("squared") do
|
|
169
|
+
apply :run, proc { # rake rb:squared:build
|
|
170
|
+
tsc(with: scriptname || "build:dev", verbose: true) # Repo (global)
|
|
171
|
+
# OR
|
|
172
|
+
tsc("target=es2022", "outDir=tmp", project: "tsconfig.json") # 1
|
|
173
|
+
tsc("clean=true", "./sqd/tsconfig.json", build: true) # 2
|
|
174
|
+
run("npm run build:dev", { "RUBYOPT" => "-W2" }, from: :run) # 3
|
|
175
|
+
|
|
176
|
+
# Parallel
|
|
177
|
+
[
|
|
178
|
+
Thread.new { tsc(sync: false) },
|
|
179
|
+
Thread.new { tsc(sync: false) },
|
|
180
|
+
Thread.new { run(sync: false) }
|
|
181
|
+
]
|
|
182
|
+
.each(&:join)
|
|
183
|
+
}
|
|
184
|
+
apply :lint, proc {
|
|
185
|
+
bundle("exec", "-A --cache=true", with: "lint", verbose: true) # bundle exec --gemfile='/squared/Gemfile' rubocop --parallel -A --cache=true
|
|
186
|
+
}
|
|
187
|
+
end
|
|
188
|
+
.with(:python, editable: false) do # ref=Symbol | group=String
|
|
189
|
+
banner([:name, ": ", :version], "path") # chrome-docs: 0.1.0 | /workspaces/chrome-docs
|
|
190
|
+
doc("make html") # rake rb:doc:python
|
|
191
|
+
run(false) # rake rb:build:python (disabled)
|
|
192
|
+
exclude(%i[base git]) # Project::Git.ref (superclass)
|
|
193
|
+
add("android-docs", "android") # rake rb:android:doc
|
|
194
|
+
add("chrome-docs", "chrome") do # rake rb:chrome:doc
|
|
195
|
+
apply :run, proc {
|
|
196
|
+
pip("wheel", with: "build:dev") # pip wheel -r '/chrome-docs/requirements.txt' --no-deps
|
|
197
|
+
}
|
|
198
|
+
end
|
|
136
199
|
end
|
|
137
200
|
.style("inline", "bold")
|
|
138
201
|
.build
|
|
@@ -473,28 +536,28 @@ Non-task:
|
|
|
473
536
|
|
|
474
537
|
Most project classes will inherit from `Git` which enables these tasks:
|
|
475
538
|
|
|
476
|
-
| Task | Git | Command
|
|
477
|
-
| :--------- | :--------------- |
|
|
478
|
-
| branch | branch | create track delete move copy list current
|
|
479
|
-
| checkout | checkout | commit branch track detach path
|
|
480
|
-
| commit | commit | add all amend amend-orig fixup
|
|
481
|
-
| diff | diff | head branch files view between contain
|
|
482
|
-
| fetch | fetch | origin remote all
|
|
483
|
-
| files | ls-files | cached modified deleted others
|
|
484
|
-
| git | | add blame clean mv revert rm status
|
|
485
|
-
| log | log | view between contain
|
|
486
|
-
| merge | merge | commit no-commit send
|
|
487
|
-
| pull | pull | origin remote all
|
|
488
|
-
| rebase | rebase | branch onto send
|
|
489
|
-
| refs | ls-remote --refs | heads tags remote
|
|
490
|
-
| reset | reset | commit index patch mode undo
|
|
491
|
-
| restore | restore | source staged worktree
|
|
492
|
-
| rev | rev | commit build output
|
|
493
|
-
| show | show | format oneline textconv
|
|
494
|
-
| stash | stash | push pop apply branch drop clear list all
|
|
495
|
-
| submodule | submodule | status update branch url sync
|
|
496
|
-
| switch | switch | branch create detach
|
|
497
|
-
| tag | tag | add sign delete list
|
|
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 status |
|
|
548
|
+
| log | log | view between contain |
|
|
549
|
+
| merge | merge | commit no-commit send |
|
|
550
|
+
| pull | pull | origin remote all |
|
|
551
|
+
| rebase | rebase | branch onto send |
|
|
552
|
+
| refs | ls-remote --refs | heads tags remote |
|
|
553
|
+
| reset | reset | commit index patch mode undo |
|
|
554
|
+
| restore | restore | source staged worktree |
|
|
555
|
+
| rev | rev | commit build output |
|
|
556
|
+
| show | show | format oneline textconv |
|
|
557
|
+
| stash | stash | push pop apply branch drop clear list all staged worktree |
|
|
558
|
+
| submodule | submodule | status update branch url sync |
|
|
559
|
+
| switch | switch | branch create detach |
|
|
560
|
+
| tag | tag | add sign delete list |
|
|
498
561
|
|
|
499
562
|
You can disable all of them at once using the `exclude` property.
|
|
500
563
|
|
|
@@ -521,7 +584,7 @@ Commands which use commit hashes are parsed using a ":" prefix as to not be conf
|
|
|
521
584
|
|
|
522
585
|
```sh
|
|
523
586
|
rake squared:log:view[:af012345] # git log af012345
|
|
524
|
-
rake squared:log:view[H1,HEAD^5,all,lib,./H12345] # git log --all @~1 @^5 --
|
|
587
|
+
rake squared:log:view[H1,HEAD^5,all,lib,./H12345] # git log --all @~1 @^5 -- 'lib' 'H12345'
|
|
525
588
|
```
|
|
526
589
|
|
|
527
590
|
## Environment
|
|
@@ -609,7 +672,7 @@ LOG_LEVEL # See gem "logger"
|
|
|
609
672
|
|
|
610
673
|
### Git
|
|
611
674
|
|
|
612
|
-
* Version: [2.
|
|
675
|
+
* Version: [2.51](https://github.com/git/git/blob/v2.51.0/Documentation/RelNotes/2.51.0.adoc)
|
|
613
676
|
|
|
614
677
|
```sh
|
|
615
678
|
GIT_OPTIONS=q,strategy=ort # all
|
|
@@ -676,7 +739,7 @@ DOCKER_ALL=1 # list every image/container
|
|
|
676
739
|
DOCKER_Y=1 # confirm all
|
|
677
740
|
|
|
678
741
|
BUILD_SQUARED_OPTS="NODE_TAG=24 RUBY_VERSION=3.4.0" DOCKER_SQUARED_OPTS="--no-cache --label=v1" rake squared:build
|
|
679
|
-
docker build --no-cache --label=v1 --build-arg=
|
|
742
|
+
docker build --no-cache --label=v1 --build-arg='NODE_TAG=24' --build-arg='RUBY_VERSION=3.4.0' .
|
|
680
743
|
```
|
|
681
744
|
|
|
682
745
|
| Command | Flag | ENV |
|
|
@@ -707,58 +770,27 @@ Workspace::Application
|
|
|
707
770
|
|
|
708
771
|
### Repo
|
|
709
772
|
|
|
710
|
-
|
|
711
|
-
* https://github.com/anpham6/squared-repo
|
|
712
|
-
* Python 3.6
|
|
713
|
-
* Not compatible with Windows
|
|
714
|
-
|
|
715
|
-
```sh
|
|
716
|
-
mkdir -p ~/.bin
|
|
717
|
-
PATH="${HOME}/.bin:${PATH}"
|
|
718
|
-
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
|
|
719
|
-
chmod a+rx ~/.bin/repo
|
|
720
|
-
```
|
|
721
|
-
|
|
722
|
-
```ruby
|
|
723
|
-
# REPO_ROOT = /workspaces |
|
|
724
|
-
# REPO_HOME = /workspaces/squared | Dir.pwd
|
|
725
|
-
# rake = /workspaces/squared/Rakefile | main?
|
|
726
|
-
#
|
|
727
|
-
# OR
|
|
728
|
-
#
|
|
729
|
-
# REPO_ROOT = /workspaces | Dir.pwd
|
|
730
|
-
# rake = /workspaces/Rakefile |
|
|
731
|
-
# REPO_HOME = /workspaces/squared | main: "squared"
|
|
732
|
-
|
|
733
|
-
Workspace::Application
|
|
734
|
-
.new(main: "squared")
|
|
735
|
-
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], ref: :node)
|
|
736
|
-
.add("squared", script: ["build:stage1", "build:stage2"])
|
|
737
|
-
.build
|
|
738
|
-
```
|
|
739
|
-
|
|
740
|
-
These global options also can target the application main suffix `${NAME}`. (e.g. *REPO_ROOT_SQUARED*)
|
|
773
|
+
These global options also can target the application main suffix `${NAME}`. (e.g. REPO_ROOT_SQUARED)
|
|
741
774
|
|
|
742
775
|
```sh
|
|
743
776
|
REPO_ROOT # parent dir
|
|
744
777
|
REPO_HOME # project dir (main)
|
|
745
|
-
REPO_BUILD # run,
|
|
778
|
+
REPO_BUILD # script,run (e.g. build:dev | build:dev,make install | make)
|
|
746
779
|
REPO_GROUP # string
|
|
747
780
|
REPO_REF # e.g. ruby,node
|
|
748
781
|
REPO_DEV # pattern,0,1
|
|
749
782
|
REPO_PROD # pattern,0,1
|
|
750
783
|
REPO_WARN # 0,1
|
|
751
784
|
REPO_SYNC # 0,1
|
|
752
|
-
|
|
785
|
+
REPO_URL # manifest repository
|
|
753
786
|
REPO_MANIFEST # e.g. latest,nightly,prod
|
|
754
787
|
REPO_GROUPS # e.g. base,prod,docs
|
|
755
788
|
REPO_STAGE # 0,1,2,3,4
|
|
756
789
|
REPO_SUBMODULLES # 0,1
|
|
790
|
+
REPO_Y # 0,1
|
|
757
791
|
REPO_TIMEOUT # confirm dialog (seconds)
|
|
758
792
|
```
|
|
759
793
|
|
|
760
|
-
Other similarly cloned `Repo` repositories can be managed remotely by setting the `REPO_ROOT` environment variable to the location.
|
|
761
|
-
|
|
762
794
|
## LICENSE
|
|
763
795
|
|
|
764
796
|
BSD 3-Clause
|