Skip to content
Merged
55 changes: 55 additions & 0 deletions .ai/runs/2026-10-30-catalog-launched.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Execution plan: link Open Mercato Modules as a live site

## Goal

Open Mercato Modules answers at https://modules.openmercato.com (200 on `/`, `/modules.json`, `/submit` and module pages under `/m/<package>`, checked 2026-10-30), so the tool links to it as a live site: `describe`, `publish` and `--help` print its links without the pending-launch note, `describe --open` opens the submit page, and the docs stop saying the catalog has not launched.

## Scope

- `src/package.ts`: set `catalogLaunched = true`; add `catalogModuleUrl` for the module page (`<catalog>/m/<package>`), honoring `MERCATO_CATALOG_URL` like `catalogSubmitUrl`.
- `src/describe.ts`, `src/cli.ts`: where the pending note was printed, a live catalog now gets the module page link (describe header comment, publish message). The pending-note branch stays behind the flag.
- Tests in `test/describe.test.cjs`, `test/link-cli.test.cjs`, `test/config-cli.test.cjs`: with the flag on, describe and publish output link the submit page and the module page on https://modules.openmercato.com and print no pending note; `--open` opens the public submit page; `MERCATO_CATALOG_URL` still overrides both links and `--open`.
- `README.md`, `docs/guide.md`: drop the "has not launched yet" texts; `CHANGELOG.md` entry under Unreleased.

## Non-goals

- Removing the `catalogLaunched` flag or the pending-note code path.
- Generated module READMEs (they already link the public submit page) and the catalog badge.
- Changing the `describe` YAML fields (protected surface in `BACKWARD_COMPATIBILITY.md`); only a header comment line changes.

## Risks

- Tests that run `describe --open` must not open a real browser; the existing fixture replaces `open`/`xdg-open`/`explorer` on `PATH`.
- The module page exists only after the catalog lists the module, so the texts say "once listed".

## Implementation Plan

### Phase 1: Live catalog links

1.1 Set `catalogLaunched = true`, add the module page link to describe and publish output, update tests.

### Phase 2: Documentation

2.1 Update README, guide and CHANGELOG.

### Phase 3: Review fixes

3.1 Clear `MERCATO_CATALOG_URL` in the config-cli and link-cli fixtures so a shell override cannot break the live-catalog assertions.

## Progress

PR: #19

> Convention: `- [ ]` pending, `- [x]` done. Append ` - <commit sha>` when a step lands. Do not rename step titles.

### Phase 1: Live catalog links

- [x] 1.1 Set catalogLaunched and link the module page in describe and publish output - 9bf5a39

### Phase 2: Documentation

- [x] 2.1 Update README, guide and CHANGELOG - 3da2fa3

### Phase 3: Review fixes

- [x] 3.1 Isolate the catalog URL override in CLI fixtures - d6e28bc
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- **Open Mercato Modules is live** at https://modules.openmercato.com. `describe`, `publish` and `--help` link it without a pending-launch note, `describe --open` opens its submit page, and `describe` and the message after `publish` also print the page the catalog gives the module once it is listed (`/m/<package>`).
- **Published package layout:** `@tanstack/react-query` and `@tanstack/react-table` are published as `^<installed>` peers with the exact installed version in `devDependencies`, instead of exact runtime `dependencies`. A module that listed them in both could make the app install a second copy, so the module's `useQuery`/`useQueryClient` and DataTable column types no longer matched the app's (TS2321/TS2322, a separate QueryClient at runtime). Republish a module to pick this up.
- A release from a linked repository never lists a package in both `peerDependencies` and `dependencies`. A peer the repository declares for an imported package keeps its range unless that range excludes the installed version. Exact `@tanstack` pins committed by earlier releases move to the peer on the next release.
- Publish and `link @scope/package` work with npm 12, which prints `npm pack --json` as an object keyed by package name and wraps `npm view --json` results in an array.
Expand All @@ -14,7 +15,7 @@
- **Exit code:** cancelling the publish wizard by not retyping the package name now exits with code 1 instead of 0, so wrapping scripts can tell a cancellation from a release.
- SSH locators such as `ssh://git@github.com/owner/repo` no longer read `git@…` as a Git ref, and linked publish compares the configured origin URL, so `insteadOf` rewrites no longer make a valid checkout look foreign.
- Examples in `--help`, the README and the guide install `@fastwhitecat/integration-ksef-direct@0.1.8`, a published module, and link the placeholder `your-org/your-module`, instead of a repository that no longer exists.
- New `describe <module_id>` command prints the module's entry for [Open Mercato Modules](https://modules.openmercato.com) from its saved publish settings; `--open` opens the submit page, and `--package` describes a module before its first publish. After a public release, `publish` prints the submit link, and generated module READMEs mention it. Until the catalog launches, printed links say that it has not launched yet and `--open` does not open them; `MERCATO_CATALOG_URL` points the tool at another deployment of the catalog.
- New `describe <module_id>` command prints the module's entry for [Open Mercato Modules](https://modules.openmercato.com) from its saved publish settings; `--open` opens the submit page, and `--package` describes a module before its first publish. After a public release, `publish` prints the submit link, and generated module READMEs mention it. `MERCATO_CATALOG_URL` points the tool at another deployment of the catalog.
- **Description:** in a terminal, `init` asks what the module does and writes the answer as `description` in the module `metadata` (scripts pass `--description`); it must be 20 to 140 characters of plain text, as the catalog summary is. `publish` and `describe` warn alike when a module has no usable description, instead of silently using `Open Mercato module: <id>`, and name the file to set it in. A linked repository whose `package.json` still has that fallback takes the description from the module metadata.
- `describe` and `publish` read only the module's exported top-level `metadata` (`export const metadata` or `export { metadata }`); a local `metadata` inside a helper no longer overrides its title or description.
- `describe --open` prints the fallback `Open ... in your browser.` on stderr when no browser opens, so `describe <module_id> --open > entry.yml` stays valid YAML.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ This builds a real `.tgz` under `.mercato/module-publish/`, without login or pub

## List your module in the catalog

Open Mercato Modules, the catalog at modules.openmercato.com, will list official and community modules for people and coding agents. It has not launched yet, so its links do not open; until it does, npm search finds your package by its keywords. Prepare the entry now and submit it once the site opens. After launch, the link that `publish` prints after a public release adds yours. To prepare the entry yourself:
[Open Mercato Modules](https://modules.openmercato.com), the catalog at modules.openmercato.com, lists official and community modules for people and coding agents. After a public release, `publish` prints the submit link for your package and the page the catalog gives the module once it is listed. To prepare the entry yourself:

```bash
npx create-mercato-module describe visits
```

It prints the catalog entry from your saved publish settings; `--open` also opens the submit page. The catalog site has not launched yet: until it does, the printed links say so and `--open` does not open them. Published packages carry the `open-mercato` and `open-mercato-module` keywords, and dedicated repositories get the `open-mercato-module` and `open-mercato` topics.
It prints the catalog entry from your saved publish settings; `--open` also opens the submit page. Published packages carry the `open-mercato` and `open-mercato-module` keywords, and dedicated repositories get the `open-mercato-module` and `open-mercato` topics.

## Documentation

Expand Down
10 changes: 5 additions & 5 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,13 @@ Prints the module's Open Mercato Modules entry as YAML. It reads the saved publi
| `--open` | Also open the catalog's submit page for the package in your browser |
| `--package @your-name/mercato-visits` | Describe the module as this package, for example before its first publish; the saved repository of another package is left out |

Open Mercato Modules has not launched yet. Until it does, `describe`, `publish` and `--help` print its links with a note saying so, and `--open` does not open them. To use another deployment of the catalog, such as a local copy of the site, set `MERCATO_CATALOG_URL` to its origin, for example `MERCATO_CATALOG_URL=http://127.0.0.1:4321`; `describe`, `--open` and the message after `publish` then use it. Generated module READMEs always link the public catalog.
`describe` and the message after `publish` link the submit page and the page the catalog gives the module once it is listed (`https://modules.openmercato.com/m/<package>`). To use another deployment of the catalog, such as a local copy of the site, set `MERCATO_CATALOG_URL` to its origin, for example `MERCATO_CATALOG_URL=http://127.0.0.1:4321`; `describe`, `--open` and the message after `publish` then link it instead. Generated module READMEs always link the public catalog.

## List your module

Open Mercato Modules, the catalog at modules.openmercato.com, will list official and community modules with what they add to an app and the Open Mercato versions they install on. Coding agents will be able to check it before they build a feature (see For agents on the catalog site). The catalog lists public npm packages and GitHub repositories.
Open Mercato Modules, the catalog at modules.openmercato.com, lists official and community modules with what they add to an app and the Open Mercato versions they install on. Coding agents can check it before they build a feature (see For agents on the catalog site). The catalog lists public npm packages and GitHub repositories.

The catalog has not launched yet, so its submit page does not open and no module can be listed yet. Until it launches, prepare the entry with `describe` below and submit it once the site opens; npm search already finds your package by the keywords every release carries. After launch, `publish` prints the submit link for your package after a public release. Open it and check the entry. The page builds the entry and opens GitHub with the file filled in; commit it and open the pull request. To prepare the entry in the terminal instead:
After a public release, `publish` prints the submit link for your package and the page the catalog gives the module once it is listed. Open the submit link and check the entry. The page builds the entry and opens GitHub with the file filled in; commit it and open the pull request. To prepare the entry in the terminal instead:

```bash
npx create-mercato-module describe visits
Expand All @@ -304,7 +304,7 @@ npx create-mercato-module describe visits
# Write each value marked TODO, then delete those TODO comments (the catalog rejects a file that still has them).
# Submit the module at
# https://modules.openmercato.com/submit?npm=@your-name/mercato-visits
# Open Mercato Modules has not launched yet, so this link does not open until it does.
# Once listed, its page is https://modules.openmercato.com/m/@your-name/mercato-visits

npm: "@your-name/mercato-visits"
github: your-name/mercato-visits
Expand All @@ -314,7 +314,7 @@ summary: Visits module for Open Mercato apps. # TODO: what it adds, 20 to 140 ch
whenToUse: Use when an Open Mercato app needs the Visits module. # TODO: when an app needs it, 40 to 240 characters
```

Before the package's first release, which you describe with `--package`, the header also says `# Publish the package to npm before you submit: the catalog reads it from npm.` The pending-launch line goes once the catalog launches, or when `MERCATO_CATALOG_URL` names another deployment.
Before the package's first release, which you describe with `--package`, the header also says `# Publish the package to npm before you submit: the catalog reads it from npm.`

`summary` comes from `description` in the module's `metadata` (`src/modules/<id>/index.ts`) when it is 20 to 140 characters of plain text; set it there and the same text becomes the npm package description. Write each value marked `TODO` and delete the `# TODO` comments before you submit: the catalog's check rejects a file that still has them, even when the value next to a comment is right. Keep `category: operations` if it fits. Restricted packages cannot be listed, so `describe` stops for them.

Expand Down
3 changes: 2 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { findApp, validateId, run } from './common.js'
import { scaffold } from './scaffold.js'
import {
ageGateNote,
catalogModuleUrl,
catalogOpen,
catalogPendingNote,
catalogSubmitUrl,
Expand Down Expand Up @@ -555,7 +556,7 @@ async function main(argv = process.argv.slice(2)) {
console.log(`\n🏷️ Tagged ${settings.repository} ${released.tag}.`)
if (released.tagWarning) console.log(`\n⚠️ ${released.tagWarning}`)
console.log(
`\n✅ Submitted ${settings.packageName}@${settings.version} to npm. Registry scanning may delay availability.\nInstall in another app once available:\n npx create-mercato-module install ${npmInstallLocator(settings.packageName)}@${settings.version}${released.tag ? `\n npx create-mercato-module install ${settings.repository}@${released.tag}` : ''}\n⏳ ${ageGateNote}${settings.access === 'public' ? `\n📚 Add it to the catalog: ${catalogSubmitUrl(settings.packageName)}${catalogOpen ? '' : `\n ${catalogPendingNote}`}\n Print its catalog entry: npx create-mercato-module describe ${args.id}` : ''}`,
`\n✅ Submitted ${settings.packageName}@${settings.version} to npm. Registry scanning may delay availability.\nInstall in another app once available:\n npx create-mercato-module install ${npmInstallLocator(settings.packageName)}@${settings.version}${released.tag ? `\n npx create-mercato-module install ${settings.repository}@${released.tag}` : ''}\n⏳ ${ageGateNote}${settings.access === 'public' ? `\n📚 Add it to the catalog: ${catalogSubmitUrl(settings.packageName)}\n ${catalogOpen ? `Its page once listed: ${catalogModuleUrl(settings.packageName)}` : catalogPendingNote}\n Print its catalog entry: npx create-mercato-module describe ${args.id}` : ''}`,
)
} finally {
prompt?.close()
Expand Down
5 changes: 4 additions & 1 deletion src/describe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
catalogOpen,
catalogPendingNote,
catalogSubmitUrl,
catalogModuleUrl,
fallbackDescription,
moduleInfo,
validatePackageName,
Expand Down Expand Up @@ -177,7 +178,9 @@ export function describeModule(
'# Write each value marked TODO, then delete those TODO comments (the catalog rejects a file that still has them).',
'# Submit the module at',
`# ${catalogSubmitUrl(saved.packageName)}`,
...(catalogOpen ? [] : [`# ${catalogPendingNote}`]),
catalogOpen
? `# Once listed, its page is ${catalogModuleUrl(saved.packageName)}`
: `# ${catalogPendingNote}`,
...(saved.lastPublishedVersion || saved.development
? []
: [
Expand Down
12 changes: 9 additions & 3 deletions src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const hostProvidedPackages = ['@tanstack/react-query', '@tanstack/react-table']
// these keywords; the catalog also reads the GitHub topics of the same names.
const moduleKeywords = ['open-mercato', 'open-mercato-module']

// The public Open Mercato Modules site. Until it launches, printed links carry
// catalogPendingNote; set catalogLaunched once the site answers.
// The public Open Mercato Modules site, live since 2026-10-29. While
// catalogLaunched is false, printed links carry catalogPendingNote instead.
const publicCatalogUrl = 'https://modules.openmercato.com'
const catalogLaunched = false
const catalogLaunched = true
// MERCATO_CATALOG_URL points the tool at another deployment of the catalog,
// such as a local copy of the site. Only http(s) origins are accepted.
const catalogOverride = /^https?:\/\/[^\s/]+(?:\/[^\s]*)?$/.test(
Expand All @@ -46,6 +46,11 @@ function catalogSubmitUrl(packageName: string, origin = catalogUrl): string {
return `${origin}/submit?npm=${packageName}`
}

// The module's own catalog page; it answers once the catalog lists the module.
function catalogModuleUrl(packageName: string, origin = catalogUrl): string {
return `${origin}/m/${packageName}`
}

// install and link read a bare name as a repository of the signed-in GitHub
// user, so printed commands name an unscoped package with the npm: prefix.
function npmInstallLocator(packageName: string): string {
Expand Down Expand Up @@ -351,6 +356,7 @@ export {
catalogOpen,
catalogPendingNote,
catalogSubmitUrl,
catalogModuleUrl,
fallbackDescription,
npmInstallLocator,
}
10 changes: 7 additions & 3 deletions test/config-cli.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ function fixture(context) {
npm(true)
const preload = path.join(root, 'interactive.cjs')
fs.writeFileSync(preload, `Object.defineProperty(process.stdin,'isTTY',{value:true});require('node:readline/promises').createInterface=()=>({question:async(label)=>{console.log('PROMPT:'+label);return label.includes('Publish this module')?(process.env.FIXTURE_CONFIRMATION||'n'):''},close(){}})\n`)
function cli(args, interactive = true) {
const result = spawnSync(process.execPath, [...(interactive ? ['--require', preload] : []), path.resolve(__dirname, '../dist/cli.js'), ...args], { cwd: app.directory, encoding: 'utf8', env: { ...process.env, PATH: `${binary}${path.delimiter}${process.env.PATH}`, NPM_TOKEN: '', NODE_AUTH_TOKEN: '' } })
function cli(args, interactive = true, env = {}) {
const result = spawnSync(process.execPath, [...(interactive ? ['--require', preload] : []), path.resolve(__dirname, '../dist/cli.js'), ...args], { cwd: app.directory, encoding: 'utf8', env: { ...process.env, MERCATO_CATALOG_URL: '', PATH: `${binary}${path.delimiter}${process.env.PATH}`, NPM_TOKEN: '', NODE_AUTH_TOKEN: '', ...env } })
return { ...result, output: `${result.stdout}\n${result.stderr}` }
}
return { root, app, npm, cli }
Expand Down Expand Up @@ -194,9 +194,13 @@ test('publication needs the package name retyped interactively and explicit appr
const confirmed = cli(arguments_)
assert.equal(confirmed.status, 0, confirmed.output)
assert.match(confirmed.output, /Submitted @fixture\/visits@0\.1\.0/)
assert.match(confirmed.output, /Add it to the catalog: https:\/\/modules\.openmercato\.com\/submit\?npm=@fixture\/visits/)
assert.match(confirmed.output, /Add it to the catalog: https:\/\/modules\.openmercato\.com\/submit\?npm=@fixture\/visits\n {3}Its page once listed: https:\/\/modules\.openmercato\.com\/m\/@fixture\/visits\n/)
assert.doesNotMatch(confirmed.output, /not launched/, 'the live catalog needs no pending note')
assert.equal(JSON.parse(fs.readFileSync(process.env.FIXTURE_REGISTRY, 'utf8'))[0], 'publish')
assert.equal(loadConfig(app).modules.visits.lastPublishedVersion, '0.1.0')
const overridden = cli(arguments_.map(value => (value === settings.version ? '0.1.1' : value)), true, { MERCATO_CATALOG_URL: 'http://127.0.0.1:4321/' })
assert.equal(overridden.status, 0, overridden.output)
assert.match(overridden.output, /Add it to the catalog: http:\/\/127\.0\.0\.1:4321\/submit\?npm=@fixture\/visits\n {3}Its page once listed: http:\/\/127\.0\.0\.1:4321\/m\/@fixture\/visits\n/, 'MERCATO_CATALOG_URL names the catalog deployment after publish')
delete process.env.FIXTURE_CONFIRMATION
delete process.env.FIXTURE_REGISTRY
fs.rmSync(path.join(app.directory, '.mercato/module-tool.json'))
Expand Down
Loading
Loading