You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
3.9 KiB
94 lines
3.9 KiB
# -*- tcl -*- |
|
# Maintenance Instruction: leave the 999999.xxx.x as is and use 'pmix make' or src/make.tcl to update from <pkg>-buildversion.txt |
|
# |
|
# 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) 2023 |
|
# |
|
# @@ Meta Begin |
|
# Application punk::mix::templates 0.1.0 |
|
# Meta platform tcl |
|
# Meta license BSD |
|
# @@ Meta End |
|
|
|
|
|
|
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
|
## Requirements |
|
##e.g package require frobz |
|
package require punk::cap |
|
|
|
|
|
|
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
|
namespace eval punk::mix::templates { |
|
variable pkg punk::mix::templates |
|
variable cap_provider |
|
|
|
namespace eval capsystem { |
|
if {[info commands capprovider.registration] eq ""} { |
|
punk::cap::class::interface_capprovider.registration create capprovider.registration |
|
oo::objdefine capprovider.registration { |
|
method get_declarations {} { |
|
set decls [list] |
|
lappend decls [list punk.templates {path templates pathtype adhoc vendor _project}] ;#todo - split out to a different provider package? |
|
|
|
lappend decls [list punk.templates {path templates pathtype module vendor punk}] |
|
#only punk::templates is allowed to register a _multivendor path - review |
|
#other punk.template providers should use module, absolute, currentproject and shellproject pathtypes only |
|
lappend decls [list punk.templates {path src/decktemplates pathtype currentproject_multivendor vendor punk}] |
|
lappend decls [list punk.templates {path decktemplates pathtype shellproject_multivendor vendor punk}] |
|
|
|
|
|
#we need a way to ensure we don't pull updates from a remote repo into a local project that is actually the same project ? review! |
|
#need flags as to whether/how provider allows template updates that are out of sync with the provider pkg version |
|
#perhaps a separate .txt file (alongside buildversion and description txt files) that has some package require statements (we can't put them in the template itself as the filled template may have nothing to do with the punk.templates provider) |
|
lappend decls [list punk.templates {path src/decktemplates/vendor/punk pathtype currentproject vendor punk allowupdates 0 repo "https://www.gitea1.intx.com.au/jn/punkshell" reposubdir "src/decktemplates/vendor/punk"}] |
|
lappend decls [list punk.isbogus {provider punk::mix::templates something blah}] ;#some capability for which there is no handler to validate - therefore no warning will result. |
|
#review - we should report unhandled caps somewhere, or provide a mechanism to detect/report. |
|
#we don't want to warn at the time this provider is loaded - as handler may legitimately be loaded later. |
|
return $decls |
|
} |
|
} |
|
} |
|
} |
|
|
|
if {[info commands provider] eq ""} { |
|
punk::cap::class::interface_capprovider.provider create provider punk::mix::templates |
|
oo::objdefine provider { |
|
method register {{capabilityname_glob *}} { |
|
#puts registering punk::mix::templates $capabilityname |
|
next $capabilityname_glob |
|
} |
|
method capabilities {} { |
|
next |
|
} |
|
} |
|
} |
|
|
|
# -- --- |
|
#provider api |
|
# -- --- |
|
#none - declarations only |
|
#todo - template folder install/update/status methods? |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
|
## Ready |
|
package provide punk::mix::templates [namespace eval punk::mix::templates { |
|
variable version |
|
set version 0.1.0 |
|
}] |
|
return |