Repository navigation
Maintenance release. It repairs the XML schemas, which have not compiled since the download element was added to the execute check, fixes three defects in wpkg.js and puts the project under a test suite and CI.
Fixed
- The XML schemas did not compile at all. The
downloadelement of the execute check was declared after the attributes inside anxsd:restrictionand referencedwpkg:download, a type which does not exist inwpkg.xsd. Every other schema importswpkg.xsd, so no configuration file could be validated againstpackages.xsd,profiles.xsd,hosts.xsdorconfig.xsd. Thedownloadtype moved towpkg.xsd, the genericchecktype learned thedownloadelement and thetimeoutattribute, and the execute check restricts them properly. All configuration files of the repository validate again. trim()stripped the leading whitespace only, its regular expression was missing the global flag. WMI reports the operating system caption, the make and model and the serial number with trailing spaces, so a host definition matching them with an anchored expression such asserial="^PF1A2B3C$"never matched.hex()printed 0 as100000000. The value appears in the messages reporting a failed operation.resetHostInformationCache()kept the cached MAC addresses while it dropped every other host attribute.
Added
- A test suite of 110 tests, up from 10, covering the decision making of
wpkg.js: version comparison including the volatile release markers, ISO date parsing in both range modes, host attribute matching (makemodel,serial,macaddresses, the locale lists, the environment conditions), conditional node filtering, the package and command accessors, the checks of typeregistry,execute,hostandlogical, and the network adapter queries. The harness gained stubs forScripting.DictionaryandWScript.Shell, and XML nodes are built bytests/xmlstub.jsinstead of being parsed. Run it withnode --testornpm test, which replaces thenode --test "tests/*.test.js"of 1.3.2, a command current Node.js releases reject. - An
examples/directory with commented definitions: an MSI package with exit codes and reboot handling, a check running a downloaded script, one package adapting to architecture, locale, hardware and network, host matching by model, serial number, MAC address and environment, and profile inheritance. All of them validate against the schemas. - A GitHub Actions workflow running the suite on Node.js 20, 22 and 24 and validating the sample and example configuration against the schemas.
- A rewritten
README.md, packaging metadata inpackage.jsonandcomposer.json, a rootLICENSEand.gitattributespinning the line endings.
Upgrading
Replace wpkg.js on the share. No configuration change is required.
One behaviour changes: host attributes are compared without their trailing whitespace now. A host definition which worked around the old behaviour, for example serial="^PF1A2B3C\s*$", keeps matching, but one which relied on the trailing spaces being present will not.
Full changelog: 1.3.2...1.4.0