create-meldly-module
v0.4.2
Published
Start a Meldly module: npm create meldly-module my-module -- --id <key>
Readme
create-meldly-module
Version 0.4.1 starts new projects on SDK 0.3.11, including its current authoring, source-reader and resource guidance. Existing projects keep their own dependency and document-version contracts until explicitly updated.
Starts a Meldly extension. The developer docs are on the web at https://my.meldly.app/developers/extensions.md, and all of them in one file for a coding agent at https://my.meldly.app/developers/llms.txt.
npm create meldly-module my-extension -- --id my-extension --template ops
cd my-extension
npm install
npm run devNeeds Node 20 or later (engines), as the SDK and every starter do: the
build's offline plugin and the test host use Node 20's global Web Crypto. An
older Node is refused before anything is written.
--id is the extension's key: the <key> of the address <handle>/<key>
Meldly shows, without the handle — lower case letters, digits and dashes,
permanent. A key Meldly keeps for itself (note, files, library…) is
refused before anything is written.
Choose ops for a collaborative JSON editor, yjs for live text with peer
carets/selections, or workspace for a workspace view with host-priced file
actions. All use the public SDK/UI kit, en/ru/ja, shared keyboard routing,
presence and tutorial targets. Document templates include a pure agent brain
and tests of conflicts and undo. No private workspace packages are required.
npm run dev opens the dev host at http://localhost:5199/__meldly/: your
page in Meldly's side of the bridge, in memory, with nothing registered. When
it works there, register the key in Meldly (Extensions → Create an extension
→ Register a build) and, in Settings → Extensions → Developer mode, put
http://localhost:5199/ beside your extension and press Load.
The title (--title) is the extension's name and is written under en, ru
and ja alike; every other word of a starter is translated, in
src/words.ts (typed WordCatalogs, so a message that counts takes plural
forms). A fresh project passes npm run check without a warning.
public/manifest.json names its schema ($schema), so your editor completes
and checks it. npm run check checks it the way an upload will, and
npm run build runs that check first: a typo in a permission, a door or an
operation name stops the build with what was probably meant.
Build and upload with npm run pack. It writes the build and the project's
source beside it and prints every file in each; upload both on the extension's
page (Edit extension → Upload a version (.zip)), and any version's build
and source download back from there. The source is what git keeps
(.gitignore is honoured); a file that looks like a secret — .env*,
.dev.vars, .npmrc, .git-credentials, keys and certificates — never goes
in, and one that .gitignore does not exclude stops the pack. So does a file
of either ZIP that holds a credential (a private key, a GitHub, sk-, Stripe,
AWS or Slack token) whatever it is called: the check Meldly's upload makes
too, from @meldly/module-sdk/secrets. The build ZIP carries the
third-party notices of the code it bundles (THIRD_PARTY_NOTICES.txt) and the
release's service worker and warm/ page (@meldly/module-sdk/offline), so
Meldly keeps the extension on a device before anybody opens it there.
Every generated project includes agent-facing UI requirements for desktop, tablet,
phone and canvas cards, plus keyboard focus and touch sizing in its starter styles.
The installed SDK includes GUIDE.md, the complete authoring and release path,
and RUNTIME.md, the bridge's contract.
0.4 depends on @meldly/module-sdk ^0.3.0-next.0: 0.3.0 and every 0.3.x
once 0.3.0 is on npm's latest, its prerelease 0.3.0-next.0 before.
