Browse Source

0.43.0 outputs: punkexe moduledoc 0.2.0 minted + promoted to vfscommon; templates modpod resync (layout _config minted copies)

Batched punkcheck-managed outputs per src/AGENTS.md carve-out.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 1 week ago
parent
commit
2aadd55a4f
  1. 13
      src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/make.tcl
  2. 52
      src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/vfs/_config/project_main.tcl
  3. 52
      src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/vfs/_config/punk_main.tcl
  4. 13
      src/project_layouts/vendor/punk/basic/src/make.tcl
  5. 13
      src/project_layouts/vendor/punk/project-0.1/src/make.tcl
  6. 373
      src/vfs/_vfscommon.vfs/modules/punk/args/moduledoc/punkexe-0.1.1.tm
  7. BIN
      src/vfs/_vfscommon.vfs/modules/punk/mix/templates-0.2.0.tm

13
src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/make.tcl vendored

@ -2618,7 +2618,7 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " - canonical origin trusted by default; other servers (incl. PUNKBIN_URL overrides) require -trust-server" \n \n
append h " $scriptname vfscommonupdate" \n
append h " - promotion gate: update the src/vfs/_vfscommon.vfs kit payload from the minted <projectdir> module/lib trees" \n
append h " - before calling this (followed by '$scriptname bake') - you can test using '<builtexe>(.exe) dev'" \n
append h " - before calling this (followed by '$scriptname bake') - you can test using '<builtexe>(.exe) minted'" \n
append h " this will load modules from your <projectdir>/module <projectdir>/lib paths instead of from the kit/zipkit" \n \n
append h " $scriptname info" \n
append h " - show the name and base folder of the project" \n \n
@ -2919,9 +2919,10 @@ KEY / NOTES
[K7] Testing hooks along the way:
- src/tests/runtests.tcl exercises the src/ trees directly (dev modules).
- '<builtkit>.exe dev' (or '<builtkit> src') runs a built shell against the
project dev modules - useful for testing minted packages before they are
baked into kits via vfscommonupdate + bake.
- '<builtkit>.exe minted' runs a built shell against the mint output trees
(<projectroot>/modules etc) - useful for testing minted packages before
they are baked into kits via vfscommonupdate + bake; '<builtkit> src'
runs against the unbuilt src/ dev modules.
[K8] What is VCS-tracked where (checkin targets after a make.tcl run):
tracked: src/** (sources, src/bootsupport, src/project_layouts copies,
@ -3053,7 +3054,7 @@ proc ::punkboot::punkboot_availability_note {} {
}
#todo? process and remove first arg dev os internal (and combinations such as dev-os etc)
#todo? process and remove first arg minted os internal (and combinations such as minted-os etc)
##############################################################################################################
##############################################################################################################
##############################################################################################################
@ -3263,7 +3264,7 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"
Update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc.
Before calling this (followed by 'make.tcl bake') - you can test using
'<builtexe>(.exe) dev' - this will load modules from your <projectdir>/modules,
'<builtexe>(.exe) minted' - this will load modules from your <projectdir>/modules,
<projectdir>/lib paths instead of from the kit/zipkit.
Replacing the _vfscommon.vfs contents requires confirmation - see -confirm."
info

52
src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/vfs/_config/project_main.tcl vendored

@ -1,8 +1,8 @@
#source is at /src/vfs/_config/project_main.tcl
#This main script will consume a first argument of the form dev|os|internal
# or any dash-delimited combination such as dev-os
#This main script will consume a first argument of the form minted|os|internal
# or any dash-delimited combination such as minted-os
#
#The default when omitted is 'internal' which limits the auto_path and tcl::tm::path to packages
#provided from within the executable's vfs (either metakit or zipkit based)
@ -20,7 +20,7 @@
# a metakit data portion seems to need to be add the end of the file (from looking at sdx.kit code)
# - todo - investigate if zipfs can be inserted between starkit head executable and metakit tail data
#The logic below will add appropriate package paths from starkit and zipfs vfs paths
# - and restrict package paths to those coming from a vfs (if not launched with 'dev' or 'os' first arg which allows external paths to remain)
# - and restrict package paths to those coming from a vfs (if not launched with 'minted' or 'os' first arg which allows external paths to remain)
apply { args {
set tclmajorv [lindex [split [info tclversion] .] 0]
@ -315,7 +315,7 @@ apply { args {
#our internal 'quick' search for starkit failed.
#either we are in a pure zipfs system, or cookfs - or the starkit package is somewhere more devious
#for pure zipfs or cookfs - it's a little wasteful to perform exhaustive search for starkit
#review - only keep searching if not 'dev' first arg?
#review - only keep searching if not 'minted' first arg?
#Initially we've done no scans of auto_path/tcl::tm::list - but there will already be a core set of packages known by the kit
#retain it so we can 'forget' the difference after our first 'package require' forces a full scan which includes some paths we may not wish to include or at least include with different preferences
@ -373,7 +373,7 @@ apply { args {
#firstly it includes env(TCLLIBPATH)
#then it adds the tcl_library folder and its parent
#e.g //zipfs:/app/tcl_library and //zipfs:/app
#when 'dev' or 'os' is not supplied - any non internal paths (usually those from env(TCLLIBPATH) will be stripped
#when 'minted' or 'os' is not supplied - any non internal paths (usually those from env(TCLLIBPATH) will be stripped
#so that everything is self-contained in the kit/zipkit
#puts "\x1b\[1\;33m main.tcl original auto_path: $::auto_path"
@ -458,35 +458,35 @@ apply { args {
# -----------------------------------------------------------------------------------------------------------
# dev - refers to module and library paths relative to the project (executable path)
# minted - refers to module and library paths relative to the project (executable path)
# os - refers to modules and library paths gleaned from ::env (TCLLIBPATH and TCL<MAJOR>_<MINOR>_TM_PATH)
# internal - refers to modules and libraries supplied from the mounted filesystem of a kit or zipfs based executable
# -----------------------------------------------------------------------------------------------------------
# Note that unlike standard 'package unknown' punk::libunknown does not stop searching for packages when a .tm file is found that matches requirements,
# The auto_path is still examined. (avoids quirks where higher versioned pkgIndex based package not always found)
# -----------------------------------------------------------------------------------------------------------
set all_package_modes [list dev os internal]
#package_mode is specified as a dash-delimited ordered value e.g dev-os
set all_package_modes [list minted os internal]
#package_mode is specified as a dash-delimited ordered value e.g minted-os
#"internal" is the default and if not present is always added to the list
#i.e "dev-os" is equivalent to "dev-os-internal"
#i.e "minted-os" is equivalent to "minted-os-internal"
#"os" is equivalent to "os-internal"
#"internal-os" and "internal" are left as is.
#The effective package_mode has 1 2 or 3 members.
# The only case where it has 1 member is if just "internal" is specified.
#This gives the number of permutations as how many ways to choose 3 items plus how many ways to choose 2 of the 3 items (one must be 'internal') plus the sole allowable way to choose 1
#for a total of 11 possible final orderings.
#(16 possible values for package_mode argument when you include the short-forms "",os,dev,os-dev,dev-os which always have 'internal' appended)
#(16 possible values for package_mode argument when you include the short-forms "",os,minted,os-minted,minted-os which always have 'internal' appended)
set test_package_mode [lindex $args 0]
switch -exact -- $test_package_mode {
internal -
os-internal - dev-internal - internal-os - internal-dev -
os-dev-internal - os-internal-dev - dev-os-internal - dev-internal-os - internal-os-dev - internal-dev-os {
os-internal - minted-internal - internal-os - internal-minted -
os-minted-internal - os-internal-minted - minted-os-internal - minted-internal-os - internal-os-minted - internal-minted-os {
#fully specified ('internal' is present)
set package_modes [split $test_package_mode -]
set arglist [lrange $args 1 end]
}
os - dev - os-dev - dev-os {
os - minted - os-minted - minted-os {
#partially specified - 'internal' ommitted but implied at tail
set package_modes [list {*}[split $test_package_mode -] internal]
set arglist [lrange $args 1 end]
@ -518,7 +518,7 @@ apply { args {
#It may be desired for performance or testing reasons to preference the library outside of the kit - and raising the version number may not always be possible/practical.
#If the executable is a kit - we don't know what packages it contains or whether it allows loading from env based external paths.
#For app-punk projects - the lib/module paths based on the project being run should take preference if 'dev' is earlier in the list, even if the version number is the same.
#For app-punk projects - the lib/module paths based on the project being run should take preference if 'minted' is earlier in the list, even if the version number is the same.
#(these are the 'info nameofexecutable' or 'info script' or 'pwd' relative paths that are added here)
#Some kits will remove lib/module paths (from auto_path & tcl::tm::list) that have been added via TCLLIBPATH / TCLX_Y_TM_PATH environment variables
#Some kits will remove those env-provided lib paths but fail to remove the env-provided module paths
@ -538,7 +538,7 @@ apply { args {
#original tm list at this point consists of whatever the kit decided + some prepended internal kit paths that punk decided on.
#we want to bring the existing external paths to the position specified by package_mode (probably from the kit looking at various env TCL* values)
#we want to maintain the order of the internal paths.
#we want to add our external dev paths to the position specified by package_mode
#we want to add our external minted paths to the position specified by package_mode
#assert [llength [package names]] should be small at this point ~ <10 ?
@ -584,7 +584,7 @@ apply { args {
#case differences could represent different paths on unix-like platforms.
#It's perhaps a little unwise to configure matching paths with only case differences for a cross-platform tool .. but we should support it for those who use it and have no interest in windows - todo! review
if {"dev" in $package_modes} {
if {"minted" in $package_modes} {
set normexe_dir [file dirname $normexe]
if {[file tail $normexe_dir] eq "bin"} {
#underlying exe in a bin dir - backtrack 1
@ -609,7 +609,7 @@ apply { args {
# set lc_external_tm_dirs [string tolower $external_tm_dirs]
# set lc_modulefolder [string tolower $modulefolder]
# if {$lc_modulefolder in [string tolower $original_external_tm_dirs]} {
# #perhaps we have an env var set pointing to one of our dev foldersl. We don't want to rely on how the kit ordered it.
# #perhaps we have an env var set pointing to one of our minted foldersl. We don't want to rely on how the kit ordered it.
# #bring to front if not already there.
# #assert it must be present in $lc_external_tm_dirs if it's in $original_external_tm_dirs
# set posn [lsearch $lc_external_tm_dirs $lc_modulefolder]
@ -691,7 +691,7 @@ apply { args {
}
}
}
dev {
minted {
foreach n $tm_additions_dev {
if {$n ni $new_tm_path} {
lappend new_tm_path $n
@ -717,7 +717,7 @@ apply { args {
##tcl::tm::add internals first (so they end up at the end of the tmlist) as in 'dev' mode (dev as first argument on launch) we preference external modules
##tcl::tm::add internals first (so they end up at the end of the tmlist) as in 'minted' mode (minted as first argument on launch) we preference external modules
##note use of lreverse to maintain same order
#foreach p [lreverse $internal_tm_dirs] {
# if {$p ni [tcl::tm::list]} {
@ -749,7 +749,7 @@ apply { args {
#we can't rely on builtin ledit (tcl9+) or loadable version such as punk::lib::compat::ledit at this point
#so we prepend to auto_path using a slightly inefficient method. Should be fine on relatively small list like this
#eventually it should just be something like 'ledit ::auto_path -1 -1 $libfolder'
if {"dev" in $package_modes} {
if {"minted" in $package_modes} {
set platform [::punkboot::platform_punk]
#on windows - case differences dont matter - but can stop us finding path in auto_path
#on other platforms, case differences could represent different paths
@ -839,7 +839,7 @@ apply { args {
}
}
}
dev {
minted {
foreach n $auto_path_additions_dev {
if {$n ni $new_auto_path} {
lappend new_auto_path $n
@ -901,7 +901,7 @@ apply { args {
tcl::tm::add {*}[lreverse $new_tm_list]
#If it looks like we are running the vfs/_build/exename.vfs/main.tcl from an external tclsh - try to use vfs folders to simulate kit state
#If it looks like we are running the vfs/_bake/exename.vfs/main.tcl from an external tclsh - try to use vfs folders to simulate kit state
#set script_relative_lib [file normalize [file join [file dirname [info script]] lib]]
#set scriptdir [file dirname [info script]]
set scriptdir [file dirname $normscript]
@ -917,9 +917,9 @@ apply { args {
#presumably running the vfs/xxx.vfs/main.tcl script using a non-kit tclsh that doesn't have starkit lib or mounted zipfs/cookfs available.. lets see if we can move forward anyway
set vfscontainer [file normalize [file dirname $scriptdir]]
#set vfscommon [file join $vfscontainer _vfscommon]
#we shouldn't be targetting the src/vfs folders - use src/_build/exename.vfs instead
#we shouldn't be targetting the src/vfs folders - use src/_bake/exename.vfs instead
set vfsdir [file normalize $scriptdir]
set projectroot [file dirname [file dirname $vfscontainer]] ;#back below src/_build/exename.vfs/main.tcl
set projectroot [file dirname [file dirname $vfscontainer]] ;#back below src/_bake/exename.vfs/main.tcl
puts stdout "no starkit. projectroot?: $projectroot executable:[info nameofexecutable]"
puts stdout "info lib: [info library]"
@ -1009,9 +1009,9 @@ apply { args {
#Now that new 'package unknown' mechanism is in place - we can use package require
#assert arglist has had 'dev|os|os-dev etc' first arg removed if it was present.
#assert arglist has had 'minted|os|os-minted etc' first arg removed if it was present.
if {[lindex $arglist 0] eq "tclsh"} {
#called as <executable> dev tclsh ?script? ?args...? or <executable> tclsh ...
#called as <executable> minted tclsh ?script? ?args...? or <executable> tclsh ...
#we would like to drop through to standard tclsh repl without launching another process
#tclMain.c doesn't allow it unless patched (TCLSH_PIPEREPL piperepl patch).
#This branch mirrors the punk_main.tcl tclsh subcommand dispatch (G-118 parity).

52
src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/vfs/_config/punk_main.tcl vendored

@ -1,8 +1,8 @@
#source is at src/vfs/_config/punk_main.tcl
#This main script will consume a first argument of the form dev|os|internal
# or any dash-delimited combination such as dev-os
#This main script will consume a first argument of the form minted|os|internal
# or any dash-delimited combination such as minted-os
#
#The default when omitted is 'internal' which limits the auto_path and tcl::tm::path to packages
#provided from within the executable's vfs (either metakit or zipkit based)
@ -20,7 +20,7 @@
# a metakit data portion seems to need to be add the end of the file (from looking at sdx.kit code)
# - todo - investigate if zipfs can be inserted between starkit head executable and metakit tail data
#The logic below will add appropriate package paths from starkit and zipfs vfs paths
# - and restrict package paths to those coming from a vfs (if not launched with 'dev' or 'os' first arg which allows external paths to remain)
# - and restrict package paths to those coming from a vfs (if not launched with 'minted' or 'os' first arg which allows external paths to remain)
apply { args {
set ::punkargv $args
@ -446,7 +446,7 @@ apply { args {
#our internal 'quick' search for starkit failed.
#either we are in a pure zipfs system, or cookfs - or the starkit package is somewhere more devious
#for pure zipfs or cookfs - it's a little wasteful to perform exhaustive search for starkit
#review - only keep searching if not 'dev' first arg?
#review - only keep searching if not 'minted' first arg?
#Initially we've done no scans of auto_path/tcl::tm::list - but there will already be a core set of packages known by the kit
#retain it so we can 'forget' the difference after our first 'package require' forces a full scan which includes some paths we may not wish to include or at least include with different preferences
@ -506,7 +506,7 @@ apply { args {
#firstly it includes env(TCLLIBPATH)
#then it adds the tcl_library folder and its parent
#e.g //zipfs:/app/tcl_library and //zipfs:/app
#when 'dev' or 'os' is not supplied - any non internal paths (usually those from env(TCLLIBPATH) will be stripped
#when 'minted' or 'os' is not supplied - any non internal paths (usually those from env(TCLLIBPATH) will be stripped
#so that everything is self-contained in the kit/zipkit
#puts "\x1b\[1\;33m main.tcl original auto_path: $::auto_path"
@ -591,7 +591,7 @@ apply { args {
# -----------------------------------------------------------------------------------------------------------
# dev - refers to module and library paths relative to the project (executable path)
# minted - refers to module and library paths relative to the project (executable path)
# os - refers to modules and library paths gleaned from ::env (TCLLIBPATH and TCL<MAJOR>_<MINOR>_TM_PATH)
# internal - refers to modules and libraries supplied from the mounted filesystem of a kit or zipfs based executable
# src - refers to unbuilt modules and libraries under the project's src/ tree (src/modules, src/lib, src/bootsupport, src/vendormodules)
@ -599,10 +599,10 @@ apply { args {
# Note that unlike standard 'package unknown' punk::libunknown does not stop searching for packages when a .tm file is found that matches requirements,
# The auto_path is still examined. (avoids quirks where higher versioned pkgIndex based package not always found)
# -----------------------------------------------------------------------------------------------------------
set all_package_modes [list dev os internal src]
#package_mode is specified as a dash-delimited ordered value e.g dev-os
set all_package_modes [list minted os internal src]
#package_mode is specified as a dash-delimited ordered value e.g minted-os
#"internal" is the default and if not present is always added to the list
#i.e "dev-os" is equivalent to "dev-os-internal"
#i.e "minted-os" is equivalent to "minted-os-internal"
#"os" is equivalent to "os-internal"
#"internal-os" and "internal" are left as is.
#The effective package_mode has 1 2 3 or 4 members.
@ -655,7 +655,7 @@ apply { args {
#It may be desired for performance or testing reasons to preference the library outside of the kit - and raising the version number may not always be possible/practical.
#If the executable is a kit - we don't know what packages it contains or whether it allows loading from env based external paths.
#For app-punk projects - the lib/module paths based on the project being run should take preference if 'dev' is earlier in the list, even if the version number is the same.
#For app-punk projects - the lib/module paths based on the project being run should take preference if 'minted' is earlier in the list, even if the version number is the same.
#(these are the 'info nameofexecutable' or 'info script' or 'pwd' relative paths that are added here)
#Some kits will remove lib/module paths (from auto_path & tcl::tm::list) that have been added via TCLLIBPATH / TCLX_Y_TM_PATH environment variables
#Some kits will remove those env-provided lib paths but fail to remove the env-provided module paths
@ -675,7 +675,7 @@ apply { args {
#original tm list at this point consists of whatever the kit decided + some prepended internal kit paths that punk decided on.
#we want to bring the existing external paths to the position specified by package_mode (probably from the kit looking at various env TCL* values)
#we want to maintain the order of the internal paths.
#we want to add our external dev paths to the position specified by package_mode
#we want to add our external minted paths to the position specified by package_mode
#assert [llength [package names]] should be small at this point ~ <10 ?
@ -721,7 +721,7 @@ apply { args {
#case differences could represent different paths on unix-like platforms.
#It's perhaps a little unwise to configure matching paths with only case differences for a cross-platform tool .. but we should support it for those who use it and have no interest in windows - todo! review
if {"dev" in $package_modes} {
if {"minted" in $package_modes} {
set normexe_dir [file dirname $normexe]
if {[file tail $normexe_dir] eq "bin"} {
#underlying exe in a bin dir - backtrack 1
@ -746,7 +746,7 @@ apply { args {
# set lc_external_tm_dirs [string tolower $external_tm_dirs]
# set lc_modulefolder [string tolower $modulefolder]
# if {$lc_modulefolder in [string tolower $original_external_tm_dirs]} {
# #perhaps we have an env var set pointing to one of our dev foldersl. We don't want to rely on how the kit ordered it.
# #perhaps we have an env var set pointing to one of our minted foldersl. We don't want to rely on how the kit ordered it.
# #bring to front if not already there.
# #assert it must be present in $lc_external_tm_dirs if it's in $original_external_tm_dirs
# set posn [lsearch $lc_external_tm_dirs $lc_modulefolder]
@ -773,10 +773,10 @@ apply { args {
}
#src mode: discover the project's src/ tree and add unbuilt module paths.
#Unlike dev mode (which points at built output in <projectroot>/modules),
#Unlike minted mode (which points at built output in <projectroot>/modules),
#src mode points at the unbuilt source in <projectroot>/src/modules etc.
if {"src" in $package_modes} {
#reuse the dev-mode project root discovery (exe in bin/ -> backtrack 1)
#reuse the minted-mode project root discovery (exe in bin/ -> backtrack 1)
set src_project_root ""
set normexe_dir_for_src [file dirname $normexe]
if {[file tail $normexe_dir_for_src] eq "bin"} {
@ -876,7 +876,7 @@ apply { args {
}
}
}
dev {
minted {
foreach n $tm_additions_dev {
if {$n ni $new_tm_path} {
lappend new_tm_path $n
@ -909,7 +909,7 @@ apply { args {
##tcl::tm::add internals first (so they end up at the end of the tmlist) as in 'dev' mode (dev as first argument on launch) we preference external modules
##tcl::tm::add internals first (so they end up at the end of the tmlist) as in 'minted' mode (minted as first argument on launch) we preference external modules
##note use of lreverse to maintain same order
#foreach p [lreverse $internal_tm_dirs] {
# if {$p ni [tcl::tm::list]} {
@ -941,7 +941,7 @@ apply { args {
#we can't rely on builtin ledit (tcl9+) or loadable version such as punk::lib::compat::ledit at this point
#so we prepend to auto_path using a slightly inefficient method. Should be fine on relatively small list like this
#eventually it should just be something like 'ledit ::auto_path -1 -1 $libfolder'
if {"dev" in $package_modes} {
if {"minted" in $package_modes} {
set platform [::punkboot::platform_punk]
#on windows - case differences dont matter - but can stop us finding path in auto_path
#on other platforms, case differences could represent different paths
@ -1067,7 +1067,7 @@ apply { args {
}
}
}
dev {
minted {
foreach n $auto_path_additions_dev {
if {$n ni $new_auto_path} {
lappend new_auto_path $n
@ -1136,7 +1136,7 @@ apply { args {
tcl::tm::add {*}[lreverse $new_tm_list]
#If it looks like we are running the vfs/_build/exename.vfs/main.tcl from an external tclsh - try to use vfs folders to simulate kit state
#If it looks like we are running the vfs/_bake/exename.vfs/main.tcl from an external tclsh - try to use vfs folders to simulate kit state
#set script_relative_lib [file normalize [file join [file dirname [info script]] lib]]
#set scriptdir [file dirname [info script]]
set scriptdir [file dirname $normscript]
@ -1152,9 +1152,9 @@ apply { args {
#presumably running the vfs/xxx.vfs/main.tcl script using a non-kit tclsh that doesn't have starkit lib or mounted zipfs/cookfs available.. lets see if we can move forward anyway
set vfscontainer [file normalize [file dirname $scriptdir]]
#set vfscommon [file join $vfscontainer _vfscommon]
#we shouldn't be targetting the src/vfs folders - use src/_build/exename.vfs instead
#we shouldn't be targetting the src/vfs folders - use src/_bake/exename.vfs instead
set vfsdir [file normalize $scriptdir]
set projectroot [file dirname [file dirname $vfscontainer]] ;#back below src/_build/exename.vfs/main.tcl
set projectroot [file dirname [file dirname $vfscontainer]] ;#back below src/_bake/exename.vfs/main.tcl
puts stdout "no starkit. projectroot?: $projectroot executable:[info nameofexecutable]"
puts stdout "info lib: [info library]"
@ -1243,7 +1243,7 @@ apply { args {
#--------------------------------------------------------
#Now that new 'package unknown' mechanism is in place - we can use package require
#assert arglist has had 'dev|os|os-dev etc' first arg removed if it was present.
#assert arglist has had 'minted|os|os-minted etc' first arg removed if it was present.
#--------------------------------------------------------
@ -1267,8 +1267,8 @@ apply { args {
#recursive glob for #modpod-* directories (Tcl 8.6+ supports ** in glob)
set modpod_dirs [list]
foreach found [glob -nocomplain -type d -directory $src_modules_dir ** #modpod-*] {
#skip _build subdirectories
if {[string match "*_build*" $found]} { continue }
#skip staging subdirectories (_mint; legacy _build; _bake defensively)
if {[string match "*_build*" $found] || [string match "*_mint*" $found] || [string match "*_bake*" $found]} { continue }
lappend modpod_dirs $found
}
foreach modpod_dir $modpod_dirs {
@ -1344,7 +1344,7 @@ apply { args {
switch -- $subcommand {
tclsh {
#called as <executable> dev tclsh or <executable> tclsh
#called as <executable> minted tclsh or <executable> tclsh
#we would like to drop through to standard tclsh repl without launching another process
#tclMain.c doesn't allow it unless patched.
if {![info exists ::env(TCLSH_PIPEREPL)]} {

13
src/project_layouts/vendor/punk/basic/src/make.tcl vendored

@ -2618,7 +2618,7 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " - canonical origin trusted by default; other servers (incl. PUNKBIN_URL overrides) require -trust-server" \n \n
append h " $scriptname vfscommonupdate" \n
append h " - promotion gate: update the src/vfs/_vfscommon.vfs kit payload from the minted <projectdir> module/lib trees" \n
append h " - before calling this (followed by '$scriptname bake') - you can test using '<builtexe>(.exe) dev'" \n
append h " - before calling this (followed by '$scriptname bake') - you can test using '<builtexe>(.exe) minted'" \n
append h " this will load modules from your <projectdir>/module <projectdir>/lib paths instead of from the kit/zipkit" \n \n
append h " $scriptname info" \n
append h " - show the name and base folder of the project" \n \n
@ -2919,9 +2919,10 @@ KEY / NOTES
[K7] Testing hooks along the way:
- src/tests/runtests.tcl exercises the src/ trees directly (dev modules).
- '<builtkit>.exe dev' (or '<builtkit> src') runs a built shell against the
project dev modules - useful for testing minted packages before they are
baked into kits via vfscommonupdate + bake.
- '<builtkit>.exe minted' runs a built shell against the mint output trees
(<projectroot>/modules etc) - useful for testing minted packages before
they are baked into kits via vfscommonupdate + bake; '<builtkit> src'
runs against the unbuilt src/ dev modules.
[K8] What is VCS-tracked where (checkin targets after a make.tcl run):
tracked: src/** (sources, src/bootsupport, src/project_layouts copies,
@ -3053,7 +3054,7 @@ proc ::punkboot::punkboot_availability_note {} {
}
#todo? process and remove first arg dev os internal (and combinations such as dev-os etc)
#todo? process and remove first arg minted os internal (and combinations such as minted-os etc)
##############################################################################################################
##############################################################################################################
##############################################################################################################
@ -3263,7 +3264,7 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"
Update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc.
Before calling this (followed by 'make.tcl bake') - you can test using
'<builtexe>(.exe) dev' - this will load modules from your <projectdir>/modules,
'<builtexe>(.exe) minted' - this will load modules from your <projectdir>/modules,
<projectdir>/lib paths instead of from the kit/zipkit.
Replacing the _vfscommon.vfs contents requires confirmation - see -confirm."
info

13
src/project_layouts/vendor/punk/project-0.1/src/make.tcl vendored

@ -2618,7 +2618,7 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " - canonical origin trusted by default; other servers (incl. PUNKBIN_URL overrides) require -trust-server" \n \n
append h " $scriptname vfscommonupdate" \n
append h " - promotion gate: update the src/vfs/_vfscommon.vfs kit payload from the minted <projectdir> module/lib trees" \n
append h " - before calling this (followed by '$scriptname bake') - you can test using '<builtexe>(.exe) dev'" \n
append h " - before calling this (followed by '$scriptname bake') - you can test using '<builtexe>(.exe) minted'" \n
append h " this will load modules from your <projectdir>/module <projectdir>/lib paths instead of from the kit/zipkit" \n \n
append h " $scriptname info" \n
append h " - show the name and base folder of the project" \n \n
@ -2919,9 +2919,10 @@ KEY / NOTES
[K7] Testing hooks along the way:
- src/tests/runtests.tcl exercises the src/ trees directly (dev modules).
- '<builtkit>.exe dev' (or '<builtkit> src') runs a built shell against the
project dev modules - useful for testing minted packages before they are
baked into kits via vfscommonupdate + bake.
- '<builtkit>.exe minted' runs a built shell against the mint output trees
(<projectroot>/modules etc) - useful for testing minted packages before
they are baked into kits via vfscommonupdate + bake; '<builtkit> src'
runs against the unbuilt src/ dev modules.
[K8] What is VCS-tracked where (checkin targets after a make.tcl run):
tracked: src/** (sources, src/bootsupport, src/project_layouts copies,
@ -3053,7 +3054,7 @@ proc ::punkboot::punkboot_availability_note {} {
}
#todo? process and remove first arg dev os internal (and combinations such as dev-os etc)
#todo? process and remove first arg minted os internal (and combinations such as minted-os etc)
##############################################################################################################
##############################################################################################################
##############################################################################################################
@ -3263,7 +3264,7 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"
Update the src/vfs/_vfscommon.vfs from compiled src/modules and src/lib etc.
Before calling this (followed by 'make.tcl bake') - you can test using
'<builtexe>(.exe) dev' - this will load modules from your <projectdir>/modules,
'<builtexe>(.exe) minted' - this will load modules from your <projectdir>/modules,
<projectdir>/lib paths instead of from the kit/zipkit.
Replacing the _vfscommon.vfs contents requires confirmation - see -confirm."
info

373
src/vfs/_vfscommon.vfs/modules/punk/args/moduledoc/punkexe-0.1.1.tm

@ -1,373 +0,0 @@
# -*- tcl -*-
# Maintenance Instruction: leave the 999999.xxx.x as is and use punkshell 'dev make' or bin/punkmake to update from <pkg>-buildversion.txt
# module template: punkshell/src/decktemplates/vendor/punk/modules/template_module-0.0.3.tm
#
# Please consider using a BSD or MIT style license for greatest compatibility with the Tcl ecosystem.
# Code using preferred Tcl licenses can be eligible for inclusion in Tcllib, Tklib and the punk package repository.
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
# (C) 2026
#
# @@ Meta Begin
# Application punk::args::moduledoc::punkexe 0.1.1
# Meta platform tcl
# Meta license BSD
# @@ Meta End
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
# doctools header
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[manpage_begin punkshell_module_punk::args::moduledoc::punkexe 0 0.1.1]
#[copyright "2026"]
#[titledesc {punk executable launch documentation}] [comment {-- Name section and table of contents description --}]
#[moddesc {-}] [comment {-- Description at end of page heading --}]
#[require punk::args::moduledoc::punkexe]
#[keywords module launch subcommand tclsh]
#[description]
#[para] punk::args definitions documenting the punk executable launch dispatch
#[para] (the subcommand family implemented in the kit boot script src/vfs/_config/punk_main.tcl)
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[section Overview]
#[para] These definitions are the documentation home for the launch subcommand
#[para] family of the punk executables: tclsh, script, shell, punk, shellspy
#[para] (G-118 item 10). They are authored to be consumable by the future
#[para] launcher help/parse wiring (goal G-032) - rendering, option parsing and
#[para] degradation wiring stay with that goal. Id convention follows the
#[para] make.tcl precedent for script-level surfaces: (script)::punkexe and
#[para] (script)::punkexe::<subcommand>, with explicit @form -synopsis overrides
#[para] since a constructed id is not an invocable command name.
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
## Requirements
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[subsection dependencies]
#[para] packages used by punk::args::moduledoc::punkexe
#[list_begin itemized]
package require Tcl 8.6-
#*** !doctools
#[item] [package {Tcl 8.6}]
#*** !doctools
#[list_end]
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[section API]
tcl::namespace::eval punk::args::moduledoc::punkexe {
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
# Base namespace
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[subsection {Namespace punk::args::moduledoc::punkexe}]
#[para] punk::args definitions for the punk executable launch dispatch
#[list_begin definitions]
variable PUNKARGS
namespace eval argdoc {
#Top-level launch dispatch (kit boot script punk_main.tcl, mirrored in
#project_main.tcl for generated projects). Display-first definitions:
#the dispatch itself does not parse via punk::args yet (goal G-032).
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
lappend PUNKARGS [list {
@id -id (script)::punkexe
@cmd -name punkexe\
-summary\
"punk executable launch: package modes and subcommand dispatch."\
-help\
"Launch surface of the punk shell executables ('<punkexe>' below
stands for any punk kit executable, e.g punk905, or a generated
project's kit).
An optional FIRST argument selects package modes: one or more of
the tokens dev, os, src, internal joined with '-' when combined
(e.g 'dev', 'src', 'dev-src'), optionally scoped with the
'proj:' prefix (e.g 'proj:internal-src') so dev/src resolve
against the project containing the current directory instead of
the executable's own (G-033 visitor mode). Modes decide which
module sources the shell trusts and their precedence; 'internal'
(kit-bundled modules) is always appended when absent. Full
contract: the packagemode leader below and bin/AGENTS.md
'launch package modes' in the punkshell source tree.
The next argument selects a subcommand from the choices below.
When the first non-mode argument is not a known subcommand:
with no arguments at all the interactive punk shell is launched
('shell'); any other first argument is treated as a script
invocation (handled as for the 'script' subcommand)."
@form -synopsis "<punkexe> ?packagemode? ?subcommand? ?arg ...?"
@leaders -min 0 -max 2
packagemode -type string -optional 1 -default internal -help\
"Package-source mode: an ordered dash-separated list of path
blocks, optionally scoped with the 'proj:' prefix.
Blocks (each adds a group of module/library paths):
internal - paths inside the executable's kit (always included;
appended last unless listed explicitly)
dev - the project's built output (<projectroot>/modules ...)
src - the project's unbuilt source (src/modules,
src/bootsupport/modules, src/vendormodules, src/lib)
os - ad-hoc .tm paths from the current directory/environment
Without 'proj:', dev/src resolve against the executable's own
project (executable in <projectroot>/bin). With 'proj:', they
resolve against the nearest project root at or above the current
directory (a git or fossil repository root) - for an installed
punkshell binary visiting a project that builds no shell of its
own.
ORDER MATTERS: earlier blocks win when the same version of a
module exists in more than one location.
Examples:
src work on the executable's own project source
proj:internal-src explore the cwd project; the executable's own
copies win version ties (robust visitor default)
proj:src explore the cwd project; ITS copies win version
ties (faithful to the project's snapshot vintage)
The launch reports the detected project root and effective
precedence."
subcommand -type string -optional 1 -choicerestricted 0 -choices {tclsh script shell punk shellspy} -choicelabels {
tclsh
" Run as a (near) stock tclsh - no punk modules loaded."
script
" Run a script non-interactively in the punk script environment; honest exit codes."
shell
" Interactive punk shell (repl); can run a script first and stay interactive."
punk
" punk shell launch; piped-stdin friendly (echo cmds | <punkexe> punk)."
shellspy
" Experimental shellspy command-line processor."
} -help\
"Subcommand to run. Each subcommand's own contract is documented
under its definition id (script)::punkexe::<subcommand>."
@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
"Arguments for the selected subcommand."
}]
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
#tclsh subcommand: full contract (G-118). The documented-as-intended
#divergences below record G-118 item decisions: item 2 (tcl_interactive
#early link), item 6 (piped whole-buffer eval + honest exit codes),
#item 8 (istty read-only by convention). The 'no -e one-liner' note is
#the G-077 boundary: stock parity INSIDE this subcommand is deliberate;
#one-liner affordances belong to the top-level/'script' surfaces (G-077).
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
lappend PUNKARGS [list {
@id -id (script)::punkexe::tclsh
@cmd -name "punkexe tclsh"\
-summary\
"Run the punk executable as a (near) stock tclsh - no punk modules."\
-help\
"Run the executable as a plain tclsh: no punk modules are loaded
and behaviour matches stock 'tclsh' as closely as the kit boot
allows. The subcommand is an EXTENSION of standard tclsh
behaviour, not an exact emulator - the divergences are listed
below and are intended.
Stock argument-form parity (tclMain.c): the only recognised
leading option is '-encoding name scriptfile', and only when
scriptfile does not itself begin with '-'. Any other leading '-'
argument means NO script file: all arguments stay in ::argv and
input comes from stdin. In particular there is no -e/-c
one-liner flag - '<punkexe> tclsh -e (script)' puts '-e' and the
script text into ::argv and reads stdin, exactly like stock
tclsh. That parity is deliberate; one-liner affordances belong
to the punk-level launch surfaces, not this subcommand.
A scriptfile of the form 'lib:name' is refused with a pointer to
the 'script' subcommand: scriptlib resolution is a punk
facility and the tclsh subcommand keeps plain-tclsh semantics.
A missing scriptfile is a clean error (exit 1); errors raised by
an existing script keep their full trace.
Piperepl runtimes: kits on a 'punk' family runtime carry the
TCLSH_PIPEREPL patch (disable with env TCLSH_PIPEREPL=0; a kit
on an unpatched runtime notes the missing patch on stderr for
the forms that would use it). With the gate open the runtime
publishes launch state in the ::tclsh array before any script
runs:
istty launch-time fact: was stdin a tty? Never updated
afterwards (still 0 after a console reopen).
Read-only by convention - no readonly trace is
installed; a script write corrupts the
Tcl-visible value without affecting behaviour.
Its existence is also the patch-presence probe.
dorepl linked control: a script (or piped input) sets
this to 1 to enter the interactive repl after
the script/stdin completes - on piped launches
stdin is reopened from the console (CONIN$ on
windows, /dev/tty elsewhere).
evalinput linked control: piped input a script-arg run
did not consume is BUFFERED, not evaluated,
unless the script sets evalinput to 1.
inputbuffer set at console reopen: holds the unconsumed
piped input.
reopened 0 at gate-open startup; republished as 1 after
a successful console reopen.
Env TCLSH_PIPEREPL_DEBUG=1 enables patch diagnostics on stderr
(e.g the console-reopen notice, silent by default).
Intended divergences from stock tclsh:
- tcl_interactive: with the piperepl gate open it is linked
to the tty flag BEFORE the startup script runs; a
script-arg launch from a console therefore reads 1 where
stock reads 0 (piped launches read 0 either way). The
early link is load-bearing: a piped script that sets
dorepl writes ::tcl_interactive to opt into prompts/echo
in the reopened repl.
- piped no-arg evaluation WITHOUT the machinery (unpatched
runtime, or TCLSH_PIPEREPL=0): stdin is read to eof and
evaluated as one script - output appears at eof on slow
pipes, a mid-script error aborts the remainder, and the
exit code is honest (nonzero on error) where stock tclsh
streams per command, continues after errors and exits 0.
(With the machinery present, evaluation is the stock
per-command repl loop.) On machinery-less runtimes the
interactive form (console stdin, no script) fails fast
with a usage error instead of blocking in a console read."
@form -form {scriptfile} -synopsis "<punkexe> tclsh ?-encoding name? scriptfile ?arg ...?"
@leaders -min 0 -max 0
@opts
-encoding -type string -optional 1 -typesynopsis name -help\
"Encoding used to read scriptfile (as for 'source -encoding').
Recognised only immediately after 'tclsh' and only when the
following argument does not begin with '-'; an incomplete
-encoding form falls through to the no-script form (stock
behaviour)."
@values -min 1 -max -1
scriptfile -type string -optional 0 -help\
"Script file to source and exit. ::argv0 and 'info script' are
the (normalized) script path; remaining args are ::argv. The
script may set ::tclsh(dorepl) 1 (piperepl runtimes) to enter
the interactive repl after it completes."
arg -type any -optional 1 -multiple 1 -help\
"Arguments passed to the script in ::argv."
@form -form {stdin} -synopsis "<punkexe> tclsh ?arg ...?"
@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
"With no script file all arguments (including any leading '-'
arguments) stay in ::argv; ::argv0 is the executable path.
Input comes from stdin: the interactive repl on a console
(piperepl runtimes), evaluation of piped input otherwise."
}]
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
#Sibling subcommands: summary-level contracts. Deep punk::args parse
#definitions for these surfaces are G-032's lane ('script' is its
#natural first parsed subcommand).
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
lappend PUNKARGS [list {
@id -id (script)::punkexe::script
@cmd -name "punkexe script"\
-summary\
"Run a script non-interactively in the punk script environment."\
-help\
"Run a Tcl script and exit with an honest exit code
(app-punkscript): script errors exit nonzero and the launch
plumbing emits nothing of its own on stdout/stderr, so
exec-style callers see only the script's output. The default
punk module/alias environment is loaded (unlike 'tclsh').
The script comes from the file argument, from piped stdin when
no argument is given (terminal stdin without a script argument
is a usage error - no interactive fallback), or via scriptlib
resolution when the argument has the form 'lib:name' (resolved
from the scriptlib locations associated with the executable,
including extensionless and shebang'd scripts)."
@form -synopsis "<punkexe> script ?scriptfile|lib:name? ?arg ...?"
@values -min 0 -max -1
scriptfile -type string -optional 1 -help\
"Script file path, or lib:name for scriptlib resolution.
Omitted: the script is read from piped stdin."
arg -type any -optional 1 -multiple 1 -help\
"Arguments passed to the script in ::argv."
}]
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
lappend PUNKARGS [list {
@id -id (script)::punkexe::shell
@cmd -name "punkexe shell"\
-summary\
"Interactive punk shell (repl)."\
-help\
"Launch the interactive punk shell (app-punkshell). With
arguments, a script can be run first with the interactive
shell maintained afterwards. This is also the default when the
executable is launched with no arguments at all."
@form -synopsis "<punkexe> shell ?arg ...?"
@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
"Arguments passed through to the shell launch."
}]
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
lappend PUNKARGS [list {
@id -id (script)::punkexe::punk
@cmd -name "punkexe punk"\
-summary\
"punk shell launch; piped-stdin friendly."\
-help\
"Launch the punk shell. With arguments the app-punkshell launch
path is used (as for 'shell'); without arguments the
interactive shell is launched directly. Commands piped into
stdin are supported (e.g: echo 'puts hello' | <punkexe> punk)
and stderr is kept clean of launch chatter so exec-style
callers do not misreport failure."
@form -synopsis "<punkexe> punk ?arg ...?"
@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
"Arguments passed through to the shell launch."
}]
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
lappend PUNKARGS [list {
@id -id (script)::punkexe::shellspy
@cmd -name "punkexe shellspy"\
-summary\
"Experimental shellspy command-line processor."\
-help\
"Pass all arguments to the experimental shellspy command-line
processor (app-shellspy). Note: 'shellspy' is only this launch
subcommand - it is not the project name (the project is
punkshell)."
@form -synopsis "<punkexe> shellspy ?arg ...?"
@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
"Arguments for the shellspy processor."
}]
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
}
#*** !doctools
#[list_end] [comment {--- end definitions namespace punk::args::moduledoc::punkexe ---}]
}
# -----------------------------------------------------------------------------
# register namespace(s) to have PUNKARGS,PUNKARGS_aliases variables checked
# -----------------------------------------------------------------------------
# variable PUNKARGS
# variable PUNKARGS_aliases
namespace eval ::punk::args::register {
#use fully qualified so 8.6 doesn't find existing var in global namespace
lappend ::punk::args::register::NAMESPACES ::punk::args::moduledoc::punkexe ::punk::args::moduledoc::punkexe::argdoc
}
# -----------------------------------------------------------------------------
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
## Ready
package provide punk::args::moduledoc::punkexe [tcl::namespace::eval punk::args::moduledoc::punkexe {
variable pkg punk::args::moduledoc::punkexe
variable version
set version 0.1.1
}]
return
#*** !doctools
#[manpage_end]

BIN
src/vfs/_vfscommon.vfs/modules/punk/mix/templates-0.2.0.tm

Binary file not shown.
Loading…
Cancel
Save