dkit 0.3.0 → 0.3.3
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 +14 -0
- data/bin/dkit +15 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b0b4a5d2779f046a28fd08f82a5564621b5856617507e5e9a7891981818318ff
|
|
4
|
+
data.tar.gz: e5f0e728e94bc3b45a80f7834dfc3cdc76458689eda7b5000e6851d1e6ed31a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7236faaaad611849ad0446036ab189bfd16fd54f39f7f032569658859a21c64236fc103b9516ca90369ae454ed5616f681ee1ce912a2729e5a2d321d7d86f1de
|
|
7
|
+
data.tar.gz: b0d487ab8e2df9f522bc7d6a9fd58a697492020f1dc8bd71ec8946e25f152b3a686d1489b7986e42fd128fa5a7cddb2f2f0a69550f2ce30089344e3839ddfb08
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.3] - 2026-04-13
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Verbose fallback messages are now printed in red and include a `(fallback)` label: `[dkit] bundle → host (fallback)`
|
|
12
|
+
|
|
13
|
+
## [0.3.1] - 2026-04-13
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- Verbose fallback message: when a command falls back to the host (container not running), prints `[dkit] <cmd> → host` to stderr if verbose is enabled
|
|
17
|
+
- Fallback messages respect the same config as container messages: `verbose: false` in `.devcontainer/dkit-intercept` or `DKIT_VERBOSE=0` env var suppress them
|
|
18
|
+
|
|
19
|
+
### Notes
|
|
20
|
+
- Requires `exec zsh` after gem update to reload the shell hook with the updated function templates
|
|
21
|
+
|
|
8
22
|
## [0.3.0] - 2026-04-13
|
|
9
23
|
|
|
10
24
|
### Added
|
data/bin/dkit
CHANGED
|
@@ -16,7 +16,7 @@ require 'pathname'
|
|
|
16
16
|
require 'shellwords'
|
|
17
17
|
require 'fileutils'
|
|
18
18
|
|
|
19
|
-
VERSION = "0.3.
|
|
19
|
+
VERSION = "0.3.3"
|
|
20
20
|
DC_CONFIG = ".devcontainer/devcontainer.json"
|
|
21
21
|
DC_INTERCEPT = ".devcontainer/dkit-intercept"
|
|
22
22
|
|
|
@@ -237,6 +237,13 @@ def cmd_hook
|
|
|
237
237
|
_DKIT_ACTIVE_CMDS=()
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
_dkit_verbose_fallback() {
|
|
241
|
+
[[ "${DKIT_VERBOSE}" == "0" || -z "${_DKIT_ROOT}" ]] && return
|
|
242
|
+
local _ic="${_DKIT_ROOT}/.devcontainer/dkit-intercept"
|
|
243
|
+
grep -qxF 'verbose: false' "$_ic" 2>/dev/null && return
|
|
244
|
+
printf '\033[31m[dkit] %s → host (fallback)\033[0m\n' "$1" >&2
|
|
245
|
+
}
|
|
246
|
+
|
|
240
247
|
_dkit_load() {
|
|
241
248
|
local root="$1"
|
|
242
249
|
local intercept="$root/.devcontainer/dkit-intercept"
|
|
@@ -252,6 +259,7 @@ def cmd_hook
|
|
|
252
259
|
if dkit status --quiet 2>/dev/null; then
|
|
253
260
|
dkit run ${cmd} \"\$@\"
|
|
254
261
|
else
|
|
262
|
+
_dkit_verbose_fallback \"${cmd}\"
|
|
255
263
|
command ${cmd} \"\$@\"
|
|
256
264
|
fi
|
|
257
265
|
}"
|
|
@@ -277,6 +285,7 @@ def cmd_hook
|
|
|
277
285
|
if dkit status --quiet 2>/dev/null; then
|
|
278
286
|
dkit code "$@"
|
|
279
287
|
else
|
|
288
|
+
_dkit_verbose_fallback "code"
|
|
280
289
|
command code "$@"
|
|
281
290
|
fi
|
|
282
291
|
}
|
|
@@ -285,6 +294,7 @@ def cmd_hook
|
|
|
285
294
|
if dkit status --quiet 2>/dev/null; then
|
|
286
295
|
dkit claude "$@"
|
|
287
296
|
else
|
|
297
|
+
_dkit_verbose_fallback "claude"
|
|
288
298
|
command claude "$@"
|
|
289
299
|
fi
|
|
290
300
|
}
|
|
@@ -297,14 +307,14 @@ end
|
|
|
297
307
|
|
|
298
308
|
def cmd_exec(ctx, args)
|
|
299
309
|
abort_err("exec: no command given") if args.empty?
|
|
300
|
-
warn "[dkit] #{args.join(" ")} → #{ctx.container}" if verbose_enabled?(ctx.project_root)
|
|
310
|
+
warn "\e[32m[dkit] #{args.join(" ")} → #{ctx.container}\e[0m" if verbose_enabled?(ctx.project_root)
|
|
301
311
|
system("docker", "exec", "--user", ctx.user, "--workdir", ctx.cwd, ctx.container, *args)
|
|
302
312
|
exit $?.exitstatus
|
|
303
313
|
end
|
|
304
314
|
|
|
305
315
|
def cmd_run(ctx, args)
|
|
306
316
|
abort_err("run: no command given") if args.empty?
|
|
307
|
-
warn "[dkit] #{args.join(" ")} → #{ctx.container}" if verbose_enabled?(ctx.project_root)
|
|
317
|
+
warn "\e[32m[dkit] #{args.join(" ")} → #{ctx.container}\e[0m" if verbose_enabled?(ctx.project_root)
|
|
308
318
|
exec("docker", "exec", "-it", "--user", ctx.user, "--workdir", ctx.cwd, ctx.container, *args)
|
|
309
319
|
end
|
|
310
320
|
|
|
@@ -313,10 +323,12 @@ def cmd_shell(ctx)
|
|
|
313
323
|
end
|
|
314
324
|
|
|
315
325
|
def cmd_claude(ctx, args)
|
|
326
|
+
warn "\e[32m[dkit] claude → #{ctx.container}\e[0m" if verbose_enabled?(ctx.project_root)
|
|
316
327
|
exec("docker", "exec", "-it", "--user", ctx.user, "--workdir", ctx.cwd, ctx.container, "claude", *args)
|
|
317
328
|
end
|
|
318
329
|
|
|
319
330
|
def cmd_code(ctx, path_arg)
|
|
331
|
+
warn "\e[32m[dkit] code → #{ctx.container}\e[0m" if verbose_enabled?(ctx.project_root)
|
|
320
332
|
host_path = path_arg ? File.expand_path(path_arg) : ctx.project_root
|
|
321
333
|
rel = begin
|
|
322
334
|
Pathname(host_path).relative_path_from(Pathname(ctx.project_root)).to_s
|