squared 0.4.15 → 0.4.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0cf3c1ed045970581434b5e6571a75ccb21a8ea564d83b1f85c6deca107424d5
4
- data.tar.gz: 2300104c9cf7fcd5babbe2989c9a68af8f8b024546baf3969198df1973ab98fe
3
+ metadata.gz: 4e41d76a0edb3135560234d2a7faf8eba688365316cad1dc9ca38d7fb353759d
4
+ data.tar.gz: b59fa903ae6e7282ef8d3b36039141c9b29f43c0f7d5fdc64063cd191e7cb409
5
5
  SHA512:
6
- metadata.gz: 5983d6fa81ba44335c2af020292f6260a02ffd4c6a8c9c9213b68d50606a14aa33fd4df032a5abfcc0677d44f5e30e69d726b3c5dcc2ac0dfbb378bdd9fa0618
7
- data.tar.gz: dcd11eb155202c2dbbcb1d7a533516c4c0d16381caccb49a0b67612e915297242b7caa74d684afcb9db08530d68a1f0a693512189f8e6b7d9fe6579f2c5e444a
6
+ metadata.gz: 7118f35ce60a5a8008c3163b636b7acbcbfeb637b2cea7aab9fb3be87b5a4701d0f28c8edbe2510a9e596077f578875bea537acebedc4177223a63d377ea418f
7
+ data.tar.gz: '025669293a2bf52bed8c2a25135264faa04363e646f2bd217a1a26e89fddaa4cab84cafedd4c31ba82045c1471d4c82da39e4c15fd353201bcc2b789bcbb0c1d'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,63 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.17] - 2025-08-09
4
+
5
+ ### Added
6
+
7
+ - Node repos can be initialized with specific package manager.
8
+ - Docker Engine options were updated to 28.0.
9
+ - Git commands pull and fetch action all was implemented.
10
+ - Git command reset action undo was implemented.
11
+ - Python command pip action upgrade was implemented.
12
+ - Git commands refs and files can use both pathspec and pattern.
13
+ - Git command submodule was implemented.
14
+ - Git command status was implemented.
15
+ - Git command switch action branch was implemented.
16
+
17
+ ### Changed
18
+
19
+ - Project task events can be assigned to a single proc.
20
+ - Ruby task copy uses require paths from gem specification.
21
+ - Docker task build:bake was renamed bake:build.
22
+ - Project global tasks can be hidden and still expose subtasks.
23
+ - Repo command line options can be overriden with class method.
24
+ - Repo task all variable REPO_DRYRUN was replaced with REPO_STAGE.
25
+ - Repo command sync option no-fail was renamed fail.
26
+
27
+ ### Fixed
28
+
29
+ - Gem command outdated did not work outside main project folder.
30
+ - Node command bump did not reset major and minor trailing digits.
31
+ - Docker image status message was displayed backwards.
32
+
33
+ ## [0.4.16] - 2025-07-27
34
+
35
+ ### Added
36
+
37
+ - Git command blame was implemented.
38
+ - Project property only for task filtering was implemented.
39
+ - Node command copy uses NPM pack to refresh development packages.
40
+ - Docker command bake action check was implemented.
41
+ - Ruby uses gem specification for name and version.
42
+ - Ruby constructor parameter gemspec was implemented.
43
+
44
+ ### Changed
45
+
46
+ - Project boolean property readers were converted into accessors.
47
+ - Workspace hash singleton methods were relocated under Support.
48
+ - Project property version uses setter method for validation.
49
+ - Node command publish will prompt when tag is not semantic.
50
+ - Gem command push without args uses gemspec to locate archive.
51
+ - Prompts will exit process without raising a generic error.
52
+
53
+ ### Fixed
54
+
55
+ - Gem command exec did not separate command and arguments.
56
+ - Project warning messages were not displayed for errors.
57
+ - Python command outdated did not load virtual env in Windows.
58
+ - Python virtual env original options are not modified.
59
+ - Node could not compare semantic versions above double digits.
60
+
3
61
  ## [0.4.15] - 2025-07-16
4
62
 
5
63
  ### Added
@@ -833,6 +891,8 @@
833
891
 
834
892
  - Changelog was created.
835
893
 
894
+ [0.4.17]: https://github.com/anpham6/squared/releases/tag/v0.4.17-ruby
895
+ [0.4.16]: https://github.com/anpham6/squared/releases/tag/v0.4.16-ruby
836
896
  [0.4.15]: https://github.com/anpham6/squared/releases/tag/v0.4.15-ruby
837
897
  [0.4.14]: https://github.com/anpham6/squared/releases/tag/v0.4.14-ruby
838
898
  [0.4.13]: https://github.com/anpham6/squared/releases/tag/v0.4.13-ruby
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # squared 5.5
1
+ # squared 5.6
2
2
 
3
3
  ## Documentation
4
4
 
@@ -140,13 +140,13 @@ rake clone # node + docs
140
140
  # PIPE_FAIL={0,1}
141
141
  # PORT=3000
142
142
  docker build -t squared --build-arg MANIFEST=prod --build-arg NODE_ENV=production .
143
- docker build -t node --build-arg NODE_TAG=22 --build-arg NODE_INSTALL=pnpm -f slim.Dockerfile .
143
+ docker build -t node --build-arg NODE_TAG=22 --build-arg NODE_INSTALL=pnpm -f Dockerfile.slim .
144
144
  NODE=22 docker buildx bake node
145
145
  # OR
146
- docker build -t ruby --build-arg RUBY_TAG=3.4.0 --build-arg NODE_VERSION=22 --build-arg PIPE_FAIL=0 -f ruby.Dockerfile .
146
+ docker build -t ruby --build-arg RUBY_TAG=3.4.0 --build-arg NODE_VERSION=22 --build-arg PIPE_FAIL=0 -f Dockerfile.ruby .
147
147
  RUBY=3.4.0 docker buildx bake ruby
148
148
  # OR
149
- docker build -t nginx --build-arg NGINX_VERSION=1.27 --build-arg PORT=3000 --build-arg NODE_VERSION=20 -f nginx.Dockerfile .
149
+ docker build -t nginx --build-arg NGINX_VERSION=1.27 --build-arg PORT=3000 --build-arg NODE_VERSION=20 -f Dockerfile.nginx .
150
150
  NGINX=1.27 docker buildx bake nginx
151
151
 
152
152
  # Express
@@ -175,6 +175,9 @@ docker run -it --name debian squared /bin/bash # irb
175
175
  > * https://unpkg.com/squared/dist/squared.min.js
176
176
  > * https://unpkg.com/squared/dist/vdom-lite.framework.min.js
177
177
 
178
+ > [!WARNING]
179
+ > Safari is completely untested and is not an officially supported browser.
180
+
178
181
  ## Usage
179
182
 
180
183
  Library files are in the `/dist` folder. A minimum of **two** files are required to run *squared*.
@@ -378,7 +381,7 @@ Used primarly for developing single page layouts but can also bundle assets usin
378
381
 
379
382
  ### Example: vdom
380
383
 
381
- The most minimal framework possible (*55kb gzipped*) and can be useful when debugging through DevTools. The `lite` version is about half the bundle size and is recommended for most browser applications.
384
+ The most minimal framework possible (*80kb gzipped*) and can be useful when debugging through DevTools. The `lite` version is about half the bundle size and is recommended for most browser applications.
382
385
 
383
386
  * ES2018
384
387
 
@@ -416,6 +419,7 @@ squared.settings = {
416
419
  targetAPI: 35,
417
420
  supportRTL: true,
418
421
  supportNegativeLeftTop: true,
422
+ supportUnicode: ["emoji"], // true | "utf-16" | "emoji"
419
423
  preloadImages: true,
420
424
  preloadFonts: true,
421
425
  preloadLocalFonts: true, // Chromium
@@ -464,6 +468,7 @@ squared.settings = {
464
468
  outputMainFileName: "activity_main.xml",
465
469
  outputFragmentFileName: "fragment_main.xml",
466
470
  /* Project - parseDocument (first only) */
471
+ supportUnicode: "utf-16",
467
472
  resourceQualifier: "", // "land" -> "res/layout-land" | "port" -> "res/layout-port" (appended to every "res" folder)
468
473
  resourceSystemColors: {
469
474
  "system_accent1_100": "white", // Will be converted to ARGB
data/README.ruby.md CHANGED
@@ -65,6 +65,7 @@ require "squared/app" # All workspace related mod
65
65
  # log = /workspaces/logger
66
66
  # emc = /workspaces/e-mc
67
67
  # pir = /workspaces/pi-r
68
+ # pir2 = /workspaces/pi-r2
68
69
  # squared = /workspaces/squared
69
70
  # cli = /workspaces/squared/publish/sqd-cli
70
71
  # sqd-serve = /workspaces/squared/publish/sqd-serve
@@ -82,11 +83,12 @@ Workspace::Application
82
83
  .add("pathname", run: "rake compile", copy: "rake install", test: "rake test", group: "default", env: { # Ruby (with C extensions)
83
84
  "CFLAGS" => "-fPIC -O1"
84
85
  })
85
- .add("optparse", doc: "rake rdoc", group: "default") # Uses bundler/gem_tasks (without C extensions)
86
+ .add("optparse", doc: "rake rdoc", gemspec: "optparse.gemspec", group: "default") # Uses bundler/gem_tasks (without C extensions)
86
87
  .add("logger", copy: { from: "lib", glob: "**/*.rb", into: "~/.rvm/gems/ruby-3.4.0/gems/logger-1.6.1" }, clean: ["tmp/"]) # autodetect: true | "rvm" | "rbenv" | "asdf" | "bundler"
87
88
  .add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node) # Node
88
89
  .add("pi-r", "pir", copy: { from: "publish", scope: "@pi-r" }, clean: ["publish/**/*.js", "tmp/"]) # Trailing slash required for directories
89
- .add("squared", script: ["build:stage1", "build:stage2"], group: "app") do # Copy target (main)
90
+ .add("pi-r2", "pir2", copy: { from: :npm, also: %i[squared express], files: ["LICENSE", ["README.md.ruby", "README.md"]] }) # Uses dist files from NPM package spec
91
+ .add("squared", init: 'pnpm', script: ["build:stage1", "build:stage2"], group: "app") do # Use pnpm/yarn/berry for depend + Copy target (main)
90
92
  # Repo (global)
91
93
  as(:run, "build:dev", "dev") # npm run build:dev -> npm run dev
92
94
  as(:run, { "build:dev": "dev", "build:prod": "prod" })
@@ -107,7 +109,7 @@ Workspace::Application
107
109
  variable_set :depend, false
108
110
  variable_set :clean, ["build/sqd/"]
109
111
  end
110
- .with(:docker, pass: ["unpack"]) do
112
+ .with(:docker, only: ["build", "compose"]) do
111
113
  .add("squared", "docker", file: "Dockerfile", context: ".", tag: "latest", registry: "localhost:5000", username: "squared",
112
114
  args: "--ssh=default",
113
115
  secrets: ["id=github,env=GITHUB_TOKEN"],
@@ -497,11 +499,11 @@ Most project classes will inherit from `Git` which enables these tasks:
497
499
  | checkout | checkout | commit branch track detach path |
498
500
  | commit | commit | add all amend amend-orig fixup |
499
501
  | diff | diff | head cached branch files between contain |
500
- | fetch | fetch | origin remote |
502
+ | fetch | fetch | origin remote all |
501
503
  | files | ls-files | cached modified deleted others |
502
- | git | | add clean mv rm revert |
504
+ | git | | add blame clean mv rm revert |
503
505
  | merge | merge | commit no-commit send |
504
- | pull | pull | origin remote |
506
+ | pull | pull | origin remote all |
505
507
  | rebase | rebase | branch onto send |
506
508
  | refs | ls-remote --refs | heads tags remote |
507
509
  | reset | reset | commit index patch mode |
@@ -509,7 +511,7 @@ Most project classes will inherit from `Git` which enables these tasks:
509
511
  | rev | rev | commit output |
510
512
  | show | show | format oneline |
511
513
  | stash | stash | push pop apply branch drop clear list |
512
- | switch | switch | create detach merge |
514
+ | switch | switch | branch create detach |
513
515
  | tag | tag | add sign delete list |
514
516
 
515
517
  You can disable all of them at once using the `exclude` property.
@@ -623,6 +625,8 @@ LOG_LEVEL # See gem "logger"
623
625
 
624
626
  ### Git
625
627
 
628
+ * Version: 2.50
629
+
626
630
  ```sh
627
631
  GIT_OPTIONS=q,strategy=ort # all
628
632
  GIT_OPTIONS_${NAME}=v,ff # project only
@@ -632,15 +636,15 @@ GIT_AUTOSTASH_${NAME}=0 # rebase (project only)
632
636
 
633
637
  | Command | Flag | ENV |
634
638
  | :--------- | :---------------- | :-------------------------------------------------------------------- |
635
- | branch | create | TRACK=0,1,s FORCE |
636
- | branch | move copy | FORCE |
639
+ | branch | create | TRACK=0,1,s F|FORCE |
640
+ | branch | move copy | F|FORCE |
637
641
  | branch | set delete | COUNT=n |
638
642
  | branch | global | SYNC |
639
643
  | checkout | branch | DETACH TRACK=s COUNT=n |
640
644
  | checkout | detach | REFLOG=1 |
641
645
  | checkout | track | COUNT=n |
642
646
  | checkout | global path | HEAD=s PATHSPEC=s |
643
- | checkout | * | FORCE MERGE |
647
+ | checkout | * | F|FORCE MERGE |
644
648
  | clone | * | DEPTH=n ORIGIN=s BRANCH=s REVISION=s LOCAL=0,1 |
645
649
  | commit | * | UPSTREAM=s DRY_RUN EDIT=0 M|MESSAGE=s |
646
650
  | diff | -between -contain | MERGE_BASE |
@@ -648,13 +652,13 @@ GIT_AUTOSTASH_${NAME}=0 # rebase (project only)
648
652
  | diff | * | PATHSPEC=s |
649
653
  | fetch | -remote | ALL |
650
654
  | fetch | remote | REFSPEC=s |
651
- | fetch | * | FORCE RECURSE_SUBMODULES=0,1,s |
655
+ | fetch | * | F|FORCE RECURSE_SUBMODULES=0,1,s |
652
656
  | git | rm | PATHSPEC=s |
653
657
  | log | * | PATHSPEC=s |
654
658
  | pull | rebase | AUTOSTASH |
655
659
  | pull | remote | REFSPEC=s |
656
660
  | pull | -remote | ALL |
657
- | pull | * | REBASE=0,1 FORCE RECURSE_SUBMODULES=0,1,s |
661
+ | pull | * | REBASE=0,1 F|FORCE RECURSE_SUBMODULES=0,1,s |
658
662
  | rebase | branch | HEAD=s |
659
663
  | rebase | onto | INTERACTIVE I HEAD=s |
660
664
  | reset | mode (mixed) | N REFRESH=0 |
@@ -668,14 +672,16 @@ GIT_AUTOSTASH_${NAME}=0 # rebase (project only)
668
672
  | status | global | BRANCH LONG IGNORE_SUBMODULES=s,0-3 PATHSPEC=s |
669
673
  | switch | detach | REFLOG=1 |
670
674
  | switch | -detach | HEAD=s |
671
- | switch | * | FORCE |
675
+ | switch | * | F|FORCE |
672
676
  | tag | add | SIGN FORCE HEAD=s M|MESSAGE=s |
673
- | tag | sign | FORCE HEAD=s M|MESSAGE=s |
677
+ | tag | sign | F|FORCE HEAD=s M|MESSAGE=s |
674
678
  | tag | delete | COUNT=n |
675
679
  | rev | commit branch | HEAD=s |
676
680
 
677
681
  ### Docker
678
682
 
683
+ * Version: 28.3
684
+
679
685
  ```sh
680
686
  DOCKER_OPTIONS=q,no-cache # all
681
687
  DOCKER_OPTIONS_${NAME}=v,no-cache=false # project only (override)
@@ -710,7 +716,7 @@ REPO_WARN # 0,1
710
716
  REPO_SYNC # 0,1
711
717
  REPO_URL # manifest repository
712
718
  REPO_MANIFEST # e.g. latest,nightly,prod
713
- REPO_DRYRUN # 0,1,2
719
+ REPO_STAGE # 0,1,2,3
714
720
  REPO_TIMEOUT # confirm dialog (seconds)
715
721
  ```
716
722
 
@@ -73,9 +73,9 @@ module Squared
73
73
  end
74
74
  attempts -= 1
75
75
  next if attempts > 0
76
- break unless force
77
76
 
78
- exit 1
77
+ exit 1 if force
78
+ break
79
79
  end
80
80
  rescue Interrupt
81
81
  puts
@@ -109,7 +109,7 @@ module Squared
109
109
  end
110
110
  ret = (prompt.call || '').strip
111
111
  multiline.each { |val| break if ret.delete_suffix!(val) } if multiline.is_a?(::Enumerable)
112
- raise_error 'user cancelled' if force && ret.empty?
112
+ exit 1 if force && ret.empty?
113
113
  ret
114
114
  else
115
115
  prompt.call
@@ -86,8 +86,7 @@ module Squared
86
86
  end
87
87
 
88
88
  def shell_split(val, quote: false, force: false, join: nil)
89
- ret = val.shellsplit
90
- ret.map! { |opt| shell_escape(opt, quote: quote, force: force, double: true, option: true) }
89
+ ret = val.shellsplit.map! { |opt| shell_escape(opt, quote: quote, force: force, double: true, option: true) }
91
90
  return ret unless join
92
91
 
93
92
  ret.join(join.is_a?(::String) ? join : ' ')
@@ -12,9 +12,9 @@ module Squared
12
12
  if RUBY_ENGINE == 'jruby' && Rake::Win32.windows?
13
13
  e = kwargs[:exception]
14
14
  if (dir = kwargs[:chdir]) && ((pwd = Dir.pwd) != dir)
15
- Dir.chdir(dir)
15
+ Dir.chdir dir
16
16
  ret = Kernel.send(name, *args)
17
- Dir.chdir(pwd)
17
+ Dir.chdir pwd
18
18
  else
19
19
  ret = Kernel.send(name, *args)
20
20
  end
@@ -57,23 +57,24 @@ module Squared
57
57
  soft = 0
58
58
  subdir.each do |dir, files|
59
59
  if link
60
- items = files.dup
61
- files.clear
62
- items.each do |file|
63
- if file.exist?
64
- if file.symlink?
65
- next unless force
60
+ files.dup.tap do |items|
61
+ files.clear
62
+ items.each do |file|
63
+ if file.exist?
64
+ if file.symlink?
65
+ next unless force
66
+ else
67
+ files << file
68
+ next
69
+ end
70
+ end
71
+ if link == 'hard'
72
+ FileUtils.ln(file, dir, force: force, verbose: false)
66
73
  else
67
- files << file
68
- next
74
+ FileUtils.ln_s(file, dir, force: force, verbose: false)
69
75
  end
76
+ soft += 1
70
77
  end
71
- if link == 'hard'
72
- FileUtils.ln(file, dir, force: force, verbose: false)
73
- else
74
- FileUtils.ln_s(file, dir, force: force, verbose: false)
75
- end
76
- soft += 1
77
78
  end
78
79
  end
79
80
  next if files.empty?
@@ -105,6 +105,15 @@ module Squared
105
105
  Time.now.utc.strftime(s).to_i - Time.parse(val).utc.strftime(s).to_i
106
106
  end
107
107
 
108
+ def rand_s(size)
109
+ if RUBY_VERSION >= '3.1'
110
+ require 'random/formatter'
111
+ Random.new.alphanumeric(size)
112
+ else
113
+ (0...size).map { rand(97..122).chr }.join
114
+ end
115
+ end
116
+
108
117
  def env(key, default = nil, suffix: nil, strict: false, equals: nil, ignore: nil)
109
118
  ret = env_value(key, suffix: suffix, strict: strict)
110
119
  return ret == equals.to_s unless equals.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.4.15'
4
+ VERSION = '0.4.17'
5
5
  end
@@ -26,7 +26,7 @@ module Squared
26
26
  next unless base || obj < impl_project
27
27
 
28
28
  if base
29
- @impl_project = obj
29
+ self.impl_project = obj
30
30
  impl_series.base_set(obj)
31
31
  else
32
32
  kind_project.unshift(obj)
@@ -39,7 +39,7 @@ module Squared
39
39
  impl_series.alias(*args)
40
40
  end
41
41
  if (args = obj.bannerargs)
42
- @attr_banner.merge(args)
42
+ attr_banner.merge(args)
43
43
  end
44
44
  end
45
45
  end
@@ -92,7 +92,7 @@ module Squared
92
92
  @prefix = prefix
93
93
  @series = Application.series_wrap(self)
94
94
  @project = {}
95
- @kind = Workspace.hashlist
95
+ @kind = Support.hashlist
96
96
  @extensions = []
97
97
  @envname = env_key(@main).freeze
98
98
  @pipe = env_pipe(pipe, (ARG[:OUT] && env(ARG[:OUT])) || 1, root: @home)
@@ -106,20 +106,20 @@ module Squared
106
106
  else
107
107
  @theme = {}
108
108
  end
109
- @chain = Workspace.hashlist
109
+ @chain = Support.hashlist
110
110
  @script = {
111
- group: Workspace.hashobj,
112
- ref: Workspace.hashobj,
111
+ group: Support.hashobj,
112
+ ref: Support.hashobj,
113
113
  group!: {},
114
114
  ref!: {}
115
115
  }.freeze
116
116
  @events = {
117
- group: Workspace.hashobj,
118
- ref: Workspace.hashobj
117
+ group: Support.hashobj,
118
+ ref: Support.hashobj
119
119
  }.freeze
120
120
  @pass = {
121
- group: Workspace.hashobj,
122
- ref: Workspace.hashobj,
121
+ group: Support.hashobj,
122
+ ref: Support.hashobj,
123
123
  global: {},
124
124
  pattern: []
125
125
  }.freeze
@@ -630,12 +630,16 @@ module Squared
630
630
  Rake::Win32.windows?
631
631
  end
632
632
 
633
+ def mri?
634
+ RUBY_ENGINE == 'ruby'
635
+ end
636
+
633
637
  def jruby?
634
638
  RUBY_ENGINE == 'jruby'
635
639
  end
636
640
 
637
- def jruby_win?
638
- jruby? && windows?
641
+ def truffleruby?
642
+ RUBY_ENGINE == 'truffleruby'
639
643
  end
640
644
 
641
645
  def docker?
@@ -687,9 +691,14 @@ module Squared
687
691
  private
688
692
 
689
693
  def __build__(default: nil, **)
690
- return unless default && task_defined?(out = task_name(default))
691
-
692
- task Rake.application.default_task_name => out
694
+ unless task_defined?('squared:version')
695
+ task 'squared:version' do
696
+ puts Squared::VERSION
697
+ end
698
+ end
699
+ if default && task_defined?(out = task_name(default))
700
+ task Rake.application.default_task_name => out
701
+ end
693
702
  end
694
703
 
695
704
  def __chain__(*)