Repository navigation
feat: describe modules for Open Mercato Modules and tag them for discovery - #13
Conversation
…overy New describe <module_id> prints the module's catalog entry from saved publish settings and its metadata, without network access; --open opens the submit page. Generated package.json files carry the open-mercato and open-mercato-module keywords, the metadata description, and homepage and bugs links for a dedicated repository; linked releases merge the keywords. Once npm accepts a release, the dedicated repository gets the matching topics, best effort like the tag. A public release ends with the submit link.
On macOS os.tmpdir() is /var/folders/..., a symlink to /private/var, and scaffold() rejects module paths whose realpath differs. The tests now build their temp apps under fs.realpathSync(os.tmpdir()), as install and framework-peers tests already did, so node --test is green with the default TMPDIR. The real CLI is unaffected: findApp resolves the start directory.
…pull request The submit page opens a new file on GitHub with the entry filled in; the author commits it and opens the pull request. Agents can check the catalog, they do not search it on their own yet.
… untouched The catalog check rejects any file that still has a # TODO comment, even when the value beside it is right. The header now says to delete those comments, category gets a plain comment so a fitting default needs no edit, and a blank line after the header keeps the file in the catalog's canonical form.
After linking pkarw/marketing-consents the README switched to visits for publish, link and unlink. Use marketing_consents there, say that publishing needs push and npm rights, and keep visits only as the own local module case.
Published packages pinned @open-mercato/*, React, Next.js and MikroORM peers to the source app's exact versions, so every app on a later compatible release got Yarn peer warnings and Open Mercato Modules reported peer-exact-pin for every module this tool publishes. Peers are now ^<installed version>; devDependencies keep the exact versions the module repository builds against.
…nother origin modules.openmercato.com does not answer yet, and the github.io origin is 404 while the catalog repository is private, yet publish, describe and --help printed the submit link as if it worked and describe --open opened it. The origin now lives in one place in package.ts: - printed links carry a note that the catalog has not launched, and --open does not open it, until catalogLaunched is set; - MERCATO_CATALOG_URL (http or https) points describe, --open and the message after publish at another deployment, such as a local copy; - generated module READMEs, which stay on npm, always link the public origin.
The help, the wizard prompt and two validation messages suggested @your-name/visits, and authors who follow them publish a package whose bare name equals the listed @piotrkarwatka/visits; Open Mercato Modules then reads it as a look-alike and a curator has to review the name. The examples now say @your-name/mercato-visits, as the README already did for packages, and the README says why the package needs a name of its own.
…kage describe stopped with "no saved npm package" until the first publish, so an author could not prepare the catalog entry next to the release. --package names the package; saved settings of another package, such as its repository, are left out, and the entry reminds the author to publish to npm before submitting until a release is recorded.
…cribe have none A module without a description in its metadata was published as "Open Mercato module: <id>" and described with a placeholder summary, and nothing told the author. Now: - init asks in a terminal for one sentence of 20 to 140 characters of plain text, the catalog summary rule, and writes it into metadata; scripts and agents pass --description; Enter skips; - publish (including dry runs) warns when the package would carry the fallback description; - describe warns on stderr when the description is missing or cannot be the summary, and says where to set it.
…alike A linked repository's package.json kept "Open Mercato module: <id>" from its first export, and exportLinkedPackage preferred it over the module metadata, so following the warning changed nothing: describe printed the new summary while every publish still warned and npm still got the fallback. Now: - a linked repository's description that is empty or still the fallback gives way to the metadata, as describe already assumed; - describe and publish share moduleDescription and descriptionWarning, so they name the same file (the checkout package.json when its own description wins) and publish also warns about a description that cannot be the catalog summary; restricted packages only get the missing warning; - the warning says the description reaches the next version you publish instead of "before you publish", and interactively adds how to include it in this version.
…until then The guide still told authors to open the submit link that publish prints, its sample describe output lacked the pending-launch line, and README and guide linked modules.openmercato.com, which does not answer yet, as a catalog that lists modules today. Name the site without a link, say it will list modules, explain what to do before launch (prepare the entry with describe, submit once the site opens, npm keywords meanwhile), and show the header lines describe prints before launch and before the first release.
…ommands install and link read a bare name as a repository of the signed-in GitHub user, so the generated README and the release summary sent an unscoped package such as mercato-visits to GitHub. They now print npm:mercato-visits, which the documented locator rules route to npm. Scoped names are unchanged.
…no warning publish now warns about a module without a description, so the local release checks failed their own no-warning assertion on the first release. init gets a description, and a unit test runs the harness's publish arguments as a dry run to keep the assertion true.
The help text, README and guide used @piotrkarwatka/marketing-consents and pkarw/marketing-consents for install and link. The npm examples now install @fastwhitecat/integration-ksef-direct@0.1.8, the version Open Mercato Modules verifies on 0.8, 0.9 and next. That package has no dedicated module repository, so link examples use the placeholder your-org/your-module (module ID your_module) instead.
Generated module READMEs keep one line that links the submit page for the package, built from the public catalog origin, and show no badge: the catalog serves a badge only for a listed module. The guide gives the badge snippet as the step after listing, and a test keeps badges out of the generated README.
The README step that installs a published module still used @your-name/mercato-visits as its command, while --help and the guide install @fastwhitecat/integration-ksef-direct@0.1.8. The step now installs that package and says that the author's own module installs the same way under its package name.
The catalog schema now carries the summary and whenToUse length rules and the optional screenshots field. describe output still validates.
|
🤖 Claiming this PR. Starting |
|
🤖 |
describe printed the saved packageName and repository from .mercato/module-tool.json as they were. A hand-edited value with a line break could add a line to the YAML entry and reached the browser opener. describe now checks both with the rules publish uses.
…iption The module description now becomes the description of a new GitHub repository. A description with a control character, such as one written as a TS escape, falls back to Open Mercato module: <id>, as a long one already did, so repository creation does not fail on it.
wojciechszyjka
left a comment
There was a problem hiding this comment.
🤖 om-auto-review-pr: code review (autofix pass)
Verdict: approvable by severity. No blocker or major finding remains. This is a comment review: the PR author and the reviewing account are the same, and this run does not approve.
Fixed in this pass
- minor
src/describe.ts:describeused the savedpackageNameandrepositoryfrom.mercato/module-tool.jsonwithout validation. A hand-edited value with a line break added a line to the YAML entry and reached the browser opener. Both are now checked with the publish rules. Fixed in 8e19602, test intest/describe.test.cjs. - nit
src/publish.ts: the metadata description now goes togh repo create --description. A control character (a TS escape such as\x07) could make repository creation fail. It now falls back toOpen Mercato module: <id>, as a long description does. Fixed in fe87a68, test intest/module.test.cjs.
Left for follow-up issues (non-blocking)
- minor
src/describe.tsopenCatalogPage: the opener runs synchronously with captured output. On Linuxxdg-opencan block until the browser exits (up to the 120 s timeout). On Windowsexplorerexits with status 1, so the fallback line always prints. Only reachable withMERCATO_CATALOG_URLwhilecatalogLaunchedis off. - nit
src/publish.tsaddTopics: a refused topic request prints nothing, while the summary says the topics are added. A warning liketagWarningwould be clearer.
Declined
- Quoting
yes/no/on/offindescribeoutput: the catalog parses entries withyaml2.9 (YAML 1.2), which reads them as strings.
Decision for a maintainer (not a defect)
- Caret peer ranges (f914d4d) change the peer rules of the published package layout, a surface in
BACKWARD_COMPATIBILITY.md. The PR body lists it under "Decisions to review". This run leaves it as it is.
Checked against the catalog source
Routes /submit?npm=, /m/<package>, /badge/<package>.svg and the npm query parameter match open-mercato/modules at 587b293. catalogLaunched stays false.
Validation (head fe87a68, Node 24)
| Command | Result |
|---|---|
npm run typecheck |
pass |
npm test |
pass: 237 tests, 232 passed, 0 failed, 5 skipped (opt-in framework tests) |
npm pack --dry-run |
pass, 59 files |
npm run lint |
pass |
CI for fe87a68 is still running. This review does not claim it green.
|
🤖
Next: once CI is green, |
|
🤖 |
|
🤖 Claimed by an om-auto-fix-pr run: exported-metadata-only lookup, stderr fallback for describe --open, PR body corrections. |
…n stdout clean
moduleInfo looks only at top-level statements and takes the metadata
declaration that is exported directly or named in export { metadata }, so a
local metadata inside a helper no longer overrides the title or description.
The fallback 'Open ... in your browser.' goes to stderr, so redirected
describe --open output stays valid YAML.
|
🤖 om-auto-fix-pr result for head 948c2f2:
Local gate (Node 24.21.0, npm 12.1.0): typecheck, lint, No follow-up issues were filed. This run does not approve or merge. Next step: a maintainer reviews the PR. The stacked #14 should merge |
…efault-license Brings the exported-metadata fix and the describe --open stderr fix from #13. moduleInfo now reads title, description and license from the exported top-level metadata binding only.
Base:
main· Head:catalog/metadata🎯 What changes
Modules published with this tool become easy to list in Open Mercato Modules, the module catalog (open-mercato/modules). People and coding agents use it to find modules and check which Open Mercato versions they install on.
describe <module_id>command. It prints the module's catalog entry as YAML from the saved publish settings.--openopens the submit page.--packagedescribes a module before its first publish.initasks what the module does and saves it asdescriptionin the modulemetadata(scripts pass--description). It must be 20 to 140 characters of plain text, the same rule as the catalog summary.publishanddescribewarn when a module has no usable description and name the file to fix. Before, they silently usedOpen Mercato module: <id>.package.jsonfiles get the keywordsopen-mercatoandopen-mercato-module, the description and, with a dedicated repository,homepageandbugs. Linked releases keep their own keywords and add the two when missing. After npm accepts a release, the dedicated repository gets the same two GitHub topics (best effort, like the release tag).publishprints the submit link (/submit?npm=<package>). Generated module READMEs link it too. They show no catalog badge, because the badge exists only for a listed module. The guide explains how to add it once the module is listed.^0.9.0instead of0.9.0). Apps on later compatible releases install them without Yarn peer warnings, and the catalog stops reportingpeer-exact-pin.devDependencieskeep exact versions.npm:<name>, because a bare name means a GitHub repository. Examples install@fastwhitecat/integration-ksef-direct@0.1.8, a module that exists on npm, and useyour-org/your-moduleas the link placeholder. The suite resolves the temp directory, so it passes on macOS withoutTMPDIR=/private/tmp.describereads only the exported top-levelmetadatabinding (alsoexport { metadata }); a localmetadatainside a helper no longer overrides it.describe --openprints the fallback 'Open ... in your browser.' on stderr, so redirected stdout stays valid YAML.BACKWARD_COMPATIBILITY.md, published package layout). This PR makes that decision: caret ranges. It needs a maintainer's yes. If you want exact peers, revertfix(package): declare framework peers as caret rangesand its changelog line; nothing else depends on it.catalogLaunchedinsrc/package.tsisfalse. While it is off, every printed catalog link carries "Open Mercato Modules has not launched yet" anddescribe --opendoes not open the browser.MERCATO_CATALOG_URL(any http(s) origin, with or without a path) points the tool at another deployment and counts as open. Keep it off until the site answers. Flip it, and the "has not launched" wording in the README and the guide, in one small commit oncehttps://modules.openmercato.com/serves the catalog. Ideally that lands before the next release of this tool.BACKWARD_COMPATIBILITY.mdnow protects the two keywords and topics, and thedescribeoutput, which must stay valid for the catalog'sdescriptor-1.json.🌐 Catalog URLs
The site will be served from the root of
https://modules.openmercato.com/(BASE_PATH/) once the Cloudflare deploy is switched on. Every URL this PR prints or documents uses that root:/submit?npm=<package>(the submit form reads thenpmparameter)/m/<package>and/badge/<package>.svg/schema/descriptor-1.jsonI checked each route against the catalog's current build. Until the Cloudflare deploy goes live, these URLs answer
404 page not foundfrom a wildcard host. That is expected and matches the "has not launched" note.💥 Compatibility
describe, new flags--description,--packageand--open. Nothing removed.initasks one more question in a terminal. Scripts are not prompted.peerDependenciesbecome caret ranges (see above).package.jsonkeywords,homepageandbugs, and two repository topics. Linked repositories keep their own keywords.🧪 Validation
Rebased onto
mainafter #12. No conflicts: this branch was built on #12's branch, and #12's squash has the same tree. On Node 24.21.0, npm 12.1.0 (head 948c2f2):npm run typecheck: passed.npm run lint: passed.npm test: 238 tests, 233 passed, 0 failed, 5 skipped (the opt-in framework tests that needOPEN_MERCATO_ROOT; CI's framework-tests job runs them).npm pack --dry-run: passed, 59 files.git diff --check: clean.test/describe.test.cjschecks thedescribeYAML against a copy of the catalog'sdescriptor-1.json. The copy is refreshed in this PR to the schema the catalog publishes today (summary andwhenToUselength rules, optionalscreenshots).npm run test:release:localpassed on 25 Oct oncreate-mercato-app@0.9.0with this branch plus the first license commits (recorded in the stacked license PR). Later changes here touch only help text and docs. CI's release-checks jobs (npm run test:release:local) passed on head fe87a68 for create-mercato-app@0.9.0 and @latest. They passed again on head 948c2f2, as did the unit-test matrix (node 24 with npm bundled and npm 12, node 26) and the framework-tests job.📋 Follow-up