Skip to content

Instantly share code, notes, and snippets.

View joewiz's full-sized avatar

Joe Wicentowski joewiz

  • Arlington, Virginia
View GitHub Profile
@joewiz
joewiz / claude-code-semver.xq-session-3-log.txt
Last active February 22, 2026 15:55
claude-code-semver.xq-session-3-log
╭─── Claude Code v2.1.50 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │ Tips for getting started │
│ Welcome back Joe! │ Run /init to create a CLAUDE.md file with instructions for Claude │
│ │ ───────────────────────────────────────────────────────────────── │
│ │ Recent activity │
│ │ No recent activity │
│ ✻ │
@joewiz
joewiz / claude-code-semver.xq-session-2-reflections.md
Last active February 22, 2026 15:11
Claude Code semver.xq session 2: Reflections

❯ I plan to repeat this on some other repositories. Do you have any lessons you'd like me to pass on to Claude for the next session, to help proceed more directly toward the solution we adopted?

Key technical facts (things that would have saved the most time if known upfront):

  1. HTTPS on port 8443, not HTTP on 8080 — @existdb/gulp-exist v5 defaults to secure: true; node-exist's compat shim converts that to protocol, overriding any HTTP setting from env vars. Don't fight it — use HTTPS and map port 8443 in CI, matching roaster's approach. Set rejectUnauthorized: false in the test runner for the self-signed cert.
  2. expath-pkg.xml path — Use semver.xqm, not content/semver.xqm. eXist-db's EXPath resolver prepends content/ automatically; doubling it breaks eXist-db 5.0.0 (6.x is forgiving). eXist-db-specific metadata (<author>, <website>, <status>, etc.) belongs only in repo.xml, not expath-pkg.xml.
  3. XQSuite test runner — Use inspect:module-functions(xs:anyURI("xm
@joewiz
joewiz / claude-code-semver.xq-session.txt
Created February 20, 2026 16:36
Claude Code semver.xq session
❯ Take a look around this repository and let me know if you have any suggestions for bug fixes or improvements.
⏺ Explore(Explore repository structure)
⎿  Done (15 tool uses · 56.7k tokens · 45s)
(ctrl+o to expand)
⏺ Let me verify the most notable finding - the potential bug in semver:eq().
⏺ Read 1 file (ctrl+o to expand)
@joewiz
joewiz / fix-straight-quotes.xq
Last active August 8, 2023 15:45
Convert quotes from straight to curly, with XQuery
xquery version "3.1";
(: This uses the eXist cache module to mimic xsl:accumulator approach described
: by Norm Walsh at https://so.nwalsh.com/2023/08/08-accumulators :)
declare function local:initiate-cache() {
cache:destroy("quotes"),
cache:create("quotes", map{}),
cache:put("quotes", "counter", 1)
};
@joewiz
joewiz / maps-to-csv.xq
Last active February 5, 2024 14:35
Convert XQuery maps to CSV (or TSV)
xquery version "3.1";
(: Convert a sequence of XQuery maps into CSV or TSV.
: Each map becomes one row.
: The entries' keys become column headers.
:)
declare variable $local:default-options :=
map {
(: Character to separate cells with :)
@joewiz
joewiz / json-ignore-whitespace-text-nodes-param.xq
Created January 25, 2023 18:43
Sample code using eXist-db json-ignore-whitespace-text-nodes parameter
xquery version "3.1";
(: @see https://github.com/eXist-db/exist/commit/53bdb54c664a8063e43392e0b0fb9eac57baf67d#diff-fc5225a3545e6b6807e7810bc9e40219500842a68dbb49a7eb83670016b160ab :)
declare boundary-space preserve;
let $json-ignore-whitespace-text-nodes-param-xml :=
<output:serialization-parameters xmlns:output="http://www.w3.org/2010/xslt-xquery-serialization">
<output:method value="json"/>
<exist:json-ignore-whitespace-text-nodes value="yes"/>
@joewiz
joewiz / latest-package-versions-csv.xq
Last active January 12, 2023 19:02
Generate a CSV containing the latest versions of packages for different
xquery version "3.1";
import module namespace versions="http://exist-db.org/apps/public-repo/versions" at "/db/apps/public-repo/modules/versions.xqm";
let $exist-versions := ("4.11.0", "5.5.1", "6.1.0")
let $abbrevs := ("shared-resources", "dashboard", "doc", "eXide", "functx", "fundocs", "markdown", "monex", "usermanager")
let $header-row := ("package", $exist-versions ! ("eXist " || .)) => string-join(", ")
let $body-rows :=
for $abbrev in $abbrevs
let $packages := doc("/db/apps/public-repo-data/metadata/package-groups.xml")//package-group[abbrev = $abbrev]//package
@joewiz
joewiz / list-packages.xq
Last active January 3, 2023 17:50
List EXPath Packages installed on an eXist-db system
xquery version "3.1";
declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization";
declare namespace pkg="http://expath.org/ns/pkg";
declare option output:method "html";
declare option output:html-version "5.0";
declare option output:media-type "text/html";
declare function local:sort-packages($packages as element(pkg:package)*) as element(pkg:package)* {
@joewiz
joewiz / system-properties.xq
Created March 10, 2022 18:32
Display all system properties and their values - for eXist-db
xquery version "3.1";
(: @see https://exist-db.org/exist/apps/fundocs/index.html?q=util:system-property
: @see https://github.com/eXist-db/exist/blob/develop/exist-core/src/main/resources-filtered/org/exist/system.properties
:)
let $exist-properties :=
(
"vendor",
"vendor-url",
"product-name",
@joewiz
joewiz / merge-fragments.xq
Last active January 5, 2022 17:03
Merge XML fragments into a composite document
xquery version "3.1";
(:~ Merge XML fragments with the same root node into a composite document.
: Based on a question from the exist-open mailing list.
:
: @see https://markmail.org/message/gdrhscaobyya44we
:)
(: Compare the fragment to the composite document. If the node names match,