diff --git a/CHANGELOG.md b/CHANGELOG.md index 06c3b2a8..3ef336e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 6.2.3 (2026-07-23) + +### Fixes + +* `pos-cli deploy` now also includes each module's own `modules//pos-module.json` manifest in the deploy archive (still excluding the rest of a module's authoring content — generators/, package.json, template-values.json, README, etc.). This lets the instance tell "module has no files in this deploy" apart from "module's files are present but stale versus the lock file" and warn accordingly, instead of silently deploying outdated module content when `pos-cli modules install` wasn't rerun after pulling a bumped lock file. + +### Security + +* Bumped `yeoman-environment` from `^5.1.3` to `^6.1.0`, fixing a high-severity arbitrary package installation vulnerability ([GHSA-vv9j-gjw2-j8wp](https://github.com/advisories/GHSA-vv9j-gjw2-j8wp)). +* Replaced the unmaintained `node-notifier` (last published 2022, still on vulnerable `uuid@^8.3.2`) with `toasted-notifier`, an actively maintained fork with the same `.notify()` API, fixing a moderate-severity buffer bounds check issue in `uuid` ([GHSA-w5hq-g745-h8pq](https://github.com/advisories/GHSA-w5hq-g745-h8pq)). + ## 6.2.2 (2026-07-22) ### New Features diff --git a/bin/pos-cli-generate-run.js b/bin/pos-cli-generate-run.js index 71230e55..34662ebd 100755 --- a/bin/pos-cli-generate-run.js +++ b/bin/pos-cli-generate-run.js @@ -156,7 +156,7 @@ const installDependencies = (packageRoot) => { logger.Info('Installing generator dependencies...', { hideTimestamp: false }); try { - spawnCommand('npm', ['install'], { cwd: packageRoot }); + spawnCommand('npm', ['install', '--prefer-offline', '--no-audit', '--no-fund'], { cwd: packageRoot }); logger.Success('Dependencies installed successfully', { hideTimestamp: false }); } catch (e) { throw new Error(`Failed to install dependencies: ${e.message}`); diff --git a/bin/pos-cli-logs.js b/bin/pos-cli-logs.js index 83b778b6..96bf0f4e 100755 --- a/bin/pos-cli-logs.js +++ b/bin/pos-cli-logs.js @@ -8,7 +8,7 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); import { program } from '../lib/program.js'; -import notifier from 'node-notifier'; +import notifier from 'toasted-notifier'; import { fetchSettings } from '../lib/settings.js'; import logger from '../lib/logger.js'; diff --git a/lib/archive.js b/lib/archive.js index 048416c6..4dcaf974 100644 --- a/lib/archive.js +++ b/lib/archive.js @@ -7,7 +7,7 @@ import { loadSettingsFileForModule } from './settings.js'; import logger from './logger.js'; import dir from './directories.js'; import prepareArchive from './prepareArchive.js'; -import { POS_MODULE_LOCK_FILE } from './modules/paths.js'; +import { POS_MODULE_LOCK_FILE, POS_MODULE_FILE } from './modules/paths.js'; import { resolveDeployLock } from './deploy/resolveDeployLock.js'; const isEmpty = d => shell.ls(d).length === 0; @@ -36,6 +36,24 @@ const addModuleToArchive = async (module, archive, withoutAssets, pattern = '{pu const realPath = path.join(dir.MODULES, module, f); archive.appendTemplated(realPath, realPath.split(path.sep).join('/'), moduleTemplateData); } + + addModuleManifestToArchive(module, archive); +}; + +// The instance-side auto-installer that downloads a dependency missing from a deploy (see +// AppBuilder::InstanceModules::DownloadMissingModules on the backend) needs to tell "this module +// has no files at all in this deploy" apart from "this module's files are here, but stale versus +// what pos-module.lock.json declares" (e.g. a developer forgot to rerun `modules install` after +// pulling a bumped lock file) so it can warn appropriately instead of silently deploying stale +// content. That requires shipping *some* per-module version marker — this ships just the +// existing pos-module.json manifest, not the rest of the module's authoring content (generators/, +// package.json, package-lock.json, template-values.json, README, ...), which the instance has no +// use for and would otherwise show up as unmatched files in the deploy report. +const addModuleManifestToArchive = (module, archive) => { + const manifestPath = path.join(dir.MODULES, module, POS_MODULE_FILE); + if (!fs.existsSync(manifestPath)) return; + + archive.addFile(manifestPath, path.join('modules', module, POS_MODULE_FILE).split(path.sep).join('/')); }; const findAppDirectory = async () => { diff --git a/lib/logger.js b/lib/logger.js index 6be9f73d..87f89f04 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,5 +1,5 @@ import path from 'path'; -import notifier from 'node-notifier'; +import notifier from 'toasted-notifier'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; diff --git a/package-lock.json b/package-lock.json index 08147df7..ae687557 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@platformos/pos-cli", - "version": "6.2.2", + "version": "6.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@platformos/pos-cli", - "version": "6.2.2", + "version": "6.2.3", "bundleDependencies": [ "commander", "degit", @@ -42,7 +42,6 @@ "mime": "^4.1.0", "multer": "^2.0.2", "mustache": "^4.2.0", - "node-notifier": "^10.0.1", "normalize-path": "^3.0.0", "open": "^11.0.0", "ora": "^9.3.0", @@ -51,11 +50,12 @@ "shelljs": "^0.10.0", "strip-ansi": "^7.2.0", "text-table": "^0.2.0", + "toasted-notifier": "^10.1.0", "unzipper": "^0.12.3", "update-notifier": "^7.3.1", "yaml": "^2.8.2", "yazl": "^3.3.1", - "yeoman-environment": "^5.1.3", + "yeoman-environment": "^6.1.0", "yeoman-generator": "^7.5.1" }, "bin": { @@ -2091,456 +2091,24 @@ "license": "MIT" }, "node_modules/@yeoman/adapter": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@yeoman/adapter/-/adapter-3.1.1.tgz", - "integrity": "sha512-yhBK+r5LHcUcZi1JvjL6BCg0HsbWkeh+nsTJa0zJxjFeRvMDLTSVb222hVXUMKP9qHjrK1Cu2Nga0EaRlLpm4A==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@yeoman/adapter/-/adapter-4.0.2.tgz", + "integrity": "sha512-4uttbNuZ/guMBRhf7R6TCfnLT6XY1HGpxsq6vpHRM3AVr5G6Qz7xXqxG2kdMzBGtIuH5CkXz0k/Byl27GsvIkg==", "license": "MIT", "dependencies": { - "@inquirer/core": "^10.0.0", - "chalk": "^5.2.0", - "inquirer": "^12.0.0", - "log-symbols": "^7.0.0", - "ora": "^9.0.0", - "p-queue": "^9.0.0", + "@inquirer/core": "^11.1.5", + "@inquirer/prompts": "^8.3.0", + "chalk": "^5.6.2", + "inquirer": "^13.3.0", + "log-symbols": "^7.0.1", + "ora": "^9.3.0", + "p-queue": "^9.1.0", "text-table": "^0.2.0" }, "engines": { "node": "20 || >=22" } }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/ansi": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/ansi/-/ansi-1.0.2.tgz", - "integrity": "sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==", - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/checkbox": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.3.2.tgz", - "integrity": "sha512-VXukHf0RR1doGe6Sm4F0Em7SWYLTHSsbGfJdS9Ja2bX5/D5uwVOEjr07cncLROdBvmnvCATYEWlHqYmXv2IlQA==", - "license": "MIT", - "dependencies": { - "@inquirer/ansi": "^1.0.2", - "@inquirer/core": "^10.3.2", - "@inquirer/figures": "^1.0.15", - "@inquirer/type": "^3.0.10", - "yoctocolors-cjs": "^2.1.3" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/confirm": { - "version": "5.1.21", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.21.tgz", - "integrity": "sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.3.2", - "@inquirer/type": "^3.0.10" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/core": { - "version": "10.3.2", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.3.2.tgz", - "integrity": "sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A==", - "license": "MIT", - "dependencies": { - "@inquirer/ansi": "^1.0.2", - "@inquirer/figures": "^1.0.15", - "@inquirer/type": "^3.0.10", - "cli-width": "^4.1.0", - "mute-stream": "^2.0.0", - "signal-exit": "^4.1.0", - "wrap-ansi": "^6.2.0", - "yoctocolors-cjs": "^2.1.3" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/editor": { - "version": "4.2.23", - "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-4.2.23.tgz", - "integrity": "sha512-aLSROkEwirotxZ1pBaP8tugXRFCxW94gwrQLxXfrZsKkfjOYC1aRvAZuhpJOb5cu4IBTJdsCigUlf2iCOu4ZDQ==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.3.2", - "@inquirer/external-editor": "^1.0.3", - "@inquirer/type": "^3.0.10" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/expand": { - "version": "4.0.23", - "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.23.tgz", - "integrity": "sha512-nRzdOyFYnpeYTTR2qFwEVmIWypzdAx/sIkCMeTNTcflFOovfqUk+HcFhQQVBftAh9gmGrpFj6QcGEqrDMDOiew==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.3.2", - "@inquirer/type": "^3.0.10", - "yoctocolors-cjs": "^2.1.3" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/external-editor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.3.tgz", - "integrity": "sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==", - "license": "MIT", - "dependencies": { - "chardet": "^2.1.1", - "iconv-lite": "^0.7.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/figures": { - "version": "1.0.15", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.15.tgz", - "integrity": "sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g==", - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/input": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.3.1.tgz", - "integrity": "sha512-kN0pAM4yPrLjJ1XJBjDxyfDduXOuQHrBB8aLDMueuwUGn+vNpF7Gq7TvyVxx8u4SHlFFj4trmj+a2cbpG4Jn1g==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.3.2", - "@inquirer/type": "^3.0.10" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/number": { - "version": "3.0.23", - "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-3.0.23.tgz", - "integrity": "sha512-5Smv0OK7K0KUzUfYUXDXQc9jrf8OHo4ktlEayFlelCjwMXz0299Y8OrI+lj7i4gCBY15UObk76q0QtxjzFcFcg==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.3.2", - "@inquirer/type": "^3.0.10" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/password": { - "version": "4.0.23", - "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-4.0.23.tgz", - "integrity": "sha512-zREJHjhT5vJBMZX/IUbyI9zVtVfOLiTO66MrF/3GFZYZ7T4YILW5MSkEYHceSii/KtRk+4i3RE7E1CUXA2jHcA==", - "license": "MIT", - "dependencies": { - "@inquirer/ansi": "^1.0.2", - "@inquirer/core": "^10.3.2", - "@inquirer/type": "^3.0.10" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/prompts": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.10.1.tgz", - "integrity": "sha512-Dx/y9bCQcXLI5ooQ5KyvA4FTgeo2jYj/7plWfV5Ak5wDPKQZgudKez2ixyfz7tKXzcJciTxqLeK7R9HItwiByg==", - "license": "MIT", - "dependencies": { - "@inquirer/checkbox": "^4.3.2", - "@inquirer/confirm": "^5.1.21", - "@inquirer/editor": "^4.2.23", - "@inquirer/expand": "^4.0.23", - "@inquirer/input": "^4.3.1", - "@inquirer/number": "^3.0.23", - "@inquirer/password": "^4.0.23", - "@inquirer/rawlist": "^4.1.11", - "@inquirer/search": "^3.2.2", - "@inquirer/select": "^4.4.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/rawlist": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.1.11.tgz", - "integrity": "sha512-+LLQB8XGr3I5LZN/GuAHo+GpDJegQwuPARLChlMICNdwW7OwV2izlCSCxN6cqpL0sMXmbKbFcItJgdQq5EBXTw==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.3.2", - "@inquirer/type": "^3.0.10", - "yoctocolors-cjs": "^2.1.3" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/search": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-3.2.2.tgz", - "integrity": "sha512-p2bvRfENXCZdWF/U2BXvnSI9h+tuA8iNqtUKb9UWbmLYCRQxd8WkvwWvYn+3NgYaNwdUkHytJMGG4MMLucI1kA==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.3.2", - "@inquirer/figures": "^1.0.15", - "@inquirer/type": "^3.0.10", - "yoctocolors-cjs": "^2.1.3" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/select": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.4.2.tgz", - "integrity": "sha512-l4xMuJo55MAe+N7Qr4rX90vypFwCajSakx59qe/tMaC1aEHWLyw68wF4o0A4SLAY4E0nd+Vt+EyskeDIqu1M6w==", - "license": "MIT", - "dependencies": { - "@inquirer/ansi": "^1.0.2", - "@inquirer/core": "^10.3.2", - "@inquirer/figures": "^1.0.15", - "@inquirer/type": "^3.0.10", - "yoctocolors-cjs": "^2.1.3" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/@inquirer/type": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.10.tgz", - "integrity": "sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@yeoman/adapter/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@yeoman/adapter/node_modules/inquirer": { - "version": "12.11.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-12.11.1.tgz", - "integrity": "sha512-9VF7mrY+3OmsAfjH3yKz/pLbJ5z22E23hENKw3/LNSaA/sAt3v49bDRY+Ygct1xwuKT+U+cBfTzjCPySna69Qw==", - "license": "MIT", - "dependencies": { - "@inquirer/ansi": "^1.0.2", - "@inquirer/core": "^10.3.2", - "@inquirer/prompts": "^7.10.1", - "@inquirer/type": "^3.0.10", - "mute-stream": "^2.0.0", - "run-async": "^4.0.6", - "rxjs": "^7.8.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@yeoman/adapter/node_modules/mute-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz", - "integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==", - "license": "ISC", - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, - "node_modules/@yeoman/adapter/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@yeoman/adapter/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@yeoman/adapter/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@yeoman/conflicter": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@yeoman/conflicter/-/conflicter-4.1.0.tgz", @@ -3368,24 +2936,6 @@ "node": "^20.17.0 || >=22.9.0" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" - }, "node_modules/colors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", @@ -6612,20 +6162,6 @@ "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", "license": "MIT" }, - "node_modules/node-notifier": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-10.0.1.tgz", - "integrity": "sha512-YX7TSyDukOZ0g+gmzjB6abKu+hTGvO8+8+gIFDsRCU2t8fLV/P2unmt+LGFaIa4y64aX98Qksa97rgz4vMNeLQ==", - "license": "MIT", - "dependencies": { - "growly": "^1.3.0", - "is-wsl": "^2.2.0", - "semver": "^7.3.5", - "shellwords": "^0.1.1", - "uuid": "^8.3.2", - "which": "^2.0.2" - } - }, "node_modules/nopt": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-9.0.0.tgz", @@ -8650,6 +8186,25 @@ "node": ">=8.0" } }, + "node_modules/toasted-notifier": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/toasted-notifier/-/toasted-notifier-10.1.0.tgz", + "integrity": "sha512-SvAufC4t75lRqwQtComPeDC93j8Toy3BRsD1cMIZ+YdfxTnIyxQb+YCuhXohNFDGJPI+RgOYImkDX76fTo1YDA==", + "funding": [ + { + "type": "individual", + "url": "https://buymeacoffee.com/aetherinox" + } + ], + "license": "MIT", + "dependencies": { + "growly": "^1.3.0", + "is-wsl": "^2.2.0", + "semver": "^7.7.2", + "shellwords": "^0.1.1", + "which": "^2.0.2" + } + }, "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -8843,16 +8398,6 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -9471,35 +9016,35 @@ } }, "node_modules/yeoman-environment": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/yeoman-environment/-/yeoman-environment-5.1.3.tgz", - "integrity": "sha512-SqxwIDysjTqNG1YX9LgrC5y5c6L9qfBjMD1u81co1Cze6kZwQzW8lzivCug283UbSOhEA0as39rO6EyzDJYhuw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/yeoman-environment/-/yeoman-environment-6.1.0.tgz", + "integrity": "sha512-QSKMfrSx3js9fxbMDBa+sZG0ctF0NDxcO6VA5BnrWdo6wqhdalT2IUU/ZrNakQLZQ76E3B6b0lXHKEA7ivsWxA==", "license": "BSD-2-Clause", "dependencies": { - "@yeoman/adapter": "^3.1.0", - "@yeoman/conflicter": "^4.0.0", - "@yeoman/namespace": "^1.0.1", - "@yeoman/transform": "^2.1.0", - "@yeoman/types": "^1.8.0", + "@yeoman/adapter": "^4.0.2", + "@yeoman/conflicter": "^4.1.0", + "@yeoman/namespace": "^2.1.0", + "@yeoman/transform": "^2.1.1", + "@yeoman/types": "^1.11.0", "arrify": "^3.0.0", - "chalk": "^5.5.0", - "commander": "^14.0.0", - "debug": "^4.4.1", - "execa": "^9.6.0", + "chalk": "^5.6.2", + "commander": "^14.0.3", + "debug": "^4.4.3", + "execa": "^9.6.1", "fly-import": "^1.0.0", - "globby": "^16.0.0", + "globby": "^16.2.0", "grouped-queue": "^2.1.0", "locate-path": "^8.0.0", - "lodash-es": "^4.17.21", - "mem-fs": "^4.1.2", - "mem-fs-editor": "^11.1.4", - "semver": "^7.7.2", + "lodash-es": "^4.18.1", + "mem-fs": "^4.1.4", + "mem-fs-editor": "^12.0.4", + "semver": "^7.7.4", "slash": "^5.1.0", "untildify": "^6.0.0", "which-package-manager": "^1.0.1" }, "acceptDependencies": { - "@yeoman/adapter": ">=3.0.0" + "@yeoman/adapter": ">=4.0.2" }, "bin": { "yoe": "bin/bin.cjs" @@ -9508,9 +9053,81 @@ "node": "^20.17.0 || >=22.9.0" }, "peerDependencies": { - "@yeoman/adapter": "^3.0.0", - "@yeoman/types": "^1.8.0", - "mem-fs": "^4.1.2" + "@yeoman/adapter": "^4.0.2", + "@yeoman/types": "^1.10.3", + "mem-fs": "^4.1.4" + } + }, + "node_modules/yeoman-environment/node_modules/@yeoman/namespace": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@yeoman/namespace/-/namespace-2.1.0.tgz", + "integrity": "sha512-/BxsZlALPRp34juAzzh9QUr2hR9w9o+dBSw8sF/iv7NfUU/A/QI0xOyVtQJz2uCPuvtY6nkGDxYxZoKI/lnFQg==", + "license": "MIT", + "engines": { + "node": "^16.13.0 || >=18.12.0" + } + }, + "node_modules/yeoman-environment/node_modules/ejs": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-6.0.1.tgz", + "integrity": "sha512-UaaM14yby8U3k02ihS1Bmj5Kz2d7CCQM1scxpgs4Mhkq8F1wR2gl3+Ts4h5Ne4Mnt7M9m4Dw7jsuMr3+xO4vZA==", + "license": "Apache-2.0", + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.12.18" + } + }, + "node_modules/yeoman-environment/node_modules/mem-fs-editor": { + "version": "12.0.6", + "resolved": "https://registry.npmjs.org/mem-fs-editor/-/mem-fs-editor-12.0.6.tgz", + "integrity": "sha512-I8SCe5xl6kVaoiJTJg33aW/s5wsvjG61kXy3TzH17tr8ZfgkBZFDTBQqwcZMSKx7VBAYgQFJEj3f38qXIWE44Q==", + "license": "MIT", + "dependencies": { + "@types/ejs": "^3.1.5", + "@types/picomatch": "^4.0.2", + "binaryextensions": "^6.11.0", + "commondir": "^1.0.0", + "debug": "^4.4.3", + "deep-extend": "^0.6.0", + "ejs": "^6.0.1", + "isbinaryfile": "5.0.7", + "minimatch": "^10.2.5", + "multimatch": "^8.0.0", + "normalize-path": "^3.0.0", + "textextensions": "^6.11.0", + "tinyglobby": "^0.2.15", + "vinyl": "^3.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "peerDependencies": { + "@types/node": ">=20", + "mem-fs": "^4.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/yeoman-environment/node_modules/multimatch": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-8.0.0.tgz", + "integrity": "sha512-0D10M2/MnEyvoog7tmozlpSqL3HEU1evxUFa3v1dsKYmBDFSP1dLSX4CH2rNjpQ+4Fps8GKmUkCwiKryaKqd9A==", + "license": "MIT", + "dependencies": { + "array-differ": "^4.0.0", + "array-union": "^3.0.1", + "minimatch": "^10.2.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/yeoman-generator": { @@ -9696,18 +9313,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/yoctocolors-cjs": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz", - "integrity": "sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/zod": { "version": "3.25.76", "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", diff --git a/package.json b/package.json index 827be55c..a37770c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@platformos/pos-cli", - "version": "6.2.2", + "version": "6.2.3", "description": "Manage your platformOS application", "type": "module", "imports": { @@ -68,7 +68,6 @@ "mime": "^4.1.0", "multer": "^2.0.2", "mustache": "^4.2.0", - "node-notifier": "^10.0.1", "normalize-path": "^3.0.0", "open": "^11.0.0", "ora": "^9.3.0", @@ -77,11 +76,12 @@ "shelljs": "^0.10.0", "strip-ansi": "^7.2.0", "text-table": "^0.2.0", + "toasted-notifier": "^10.1.0", "unzipper": "^0.12.3", "update-notifier": "^7.3.1", "yaml": "^2.8.2", "yazl": "^3.3.1", - "yeoman-environment": "^5.1.3", + "yeoman-environment": "^6.1.0", "yeoman-generator": "^7.5.1" }, "preferGlobal": true, diff --git a/test/fixtures/deploy/correct/modules/testModule/pos-module.json b/test/fixtures/deploy/correct/modules/testModule/pos-module.json new file mode 100644 index 00000000..81873f48 --- /dev/null +++ b/test/fixtures/deploy/correct/modules/testModule/pos-module.json @@ -0,0 +1,5 @@ +{ + "name": "TestModule", + "machine_name": "testModule", + "version": "1.0.0" +} diff --git a/test/unit/archive.test.js b/test/unit/archive.test.js index 22242324..ac124dc1 100644 --- a/test/unit/archive.test.js +++ b/test/unit/archive.test.js @@ -202,9 +202,10 @@ describe('Archive utilities', () => { expect(content.dependencies).toEqual({ core: '2.1.9', user: '5.2.11' }); }); - test('only includes module files under public/ or private/, not sibling directories', async () => { + test('only includes module files under public/, private/, or its own pos-module.json, not sibling directories', async () => { // fixture has testModule/generators/crud.js and testModule/react-app/node_modules/.../page.png - // alongside testModule/public/ — neither should appear in the archive + // alongside testModule/public/ and testModule/pos-module.json — only the latter two should + // appear in the archive process.chdir(path.join(fixturesPath, 'correct')); const { makeArchive } = await import('#lib/archive.js'); const zipPath = path.join(tmpDir, 'release.zip'); @@ -216,6 +217,30 @@ describe('Archive utilities', () => { expect(entries.some(e => e.includes('node_modules'))).toBe(false); expect(entries.some(e => e.includes('hello-test-module.liquid'))).toBe(true); }); + + test('includes a module\'s own pos-module.json manifest, untemplated, at modules//pos-module.json', async () => { + process.chdir(path.join(fixturesPath, 'correct')); + const { makeArchive } = await import('#lib/archive.js'); + const zipPath = path.join(tmpDir, 'release.zip'); + + await makeArchive({ TARGET: zipPath }, { withoutAssets: false }); + + const entries = await listZipEntries(zipPath); + expect(entries).toContain('modules/testModule/pos-module.json'); + + const content = JSON.parse(await readZipEntry(zipPath, 'modules/testModule/pos-module.json')); + expect(content).toEqual({ name: 'TestModule', machine_name: 'testModule', version: '1.0.0' }); + }); + + test('does not fail when a module has no pos-module.json', async () => { + process.chdir(path.join(fixturesPath, 'modules_root_lock')); + const { makeArchive } = await import('#lib/archive.js'); + const zipPath = path.join(tmpDir, 'release.zip'); + + const count = await makeArchive({ TARGET: zipPath }, { withoutAssets: true }); + + expect(count).toBeGreaterThan(0); + }); }); describe('packAssets', () => { diff --git a/test/unit/generators.test.js b/test/unit/generators.test.js index 89ef5fbb..f0f4301d 100644 --- a/test/unit/generators.test.js +++ b/test/unit/generators.test.js @@ -645,7 +645,7 @@ describe('pos-cli generate command', () => { // Verify dependencies were installed const installed = await fileExists(nodeModulesPath); expect(installed).toBe(true); - }); + }, 20000); }); describe('error handling and validation', () => {