···11+---
22+'@atcute/lex-cli': minor
33+'@atcute/atproto': patch
44+'@atcute/bluesky': patch
55+'@atcute/bluemoji': patch
66+'@atcute/frontpage': patch
77+'@atcute/leaflet': patch
88+'@atcute/lexicon-community': patch
99+'@atcute/ozone': patch
1010+'@atcute/tangled': patch
1111+'@atcute/whitewind': patch
1212+---
1313+1414+add package.json-based lexicon import metadata
1515+1616+instead of manually configuring mappings:
1717+1818+```js
1919+mappings: [
2020+ {
2121+ nsid: ['com.atproto.*'],
2222+ imports: (nsid) => {
2323+ const specifier = nsid.slice('com.atproto.'.length).replaceAll('.', '/');
2424+ return { type: 'namespace', from: `@atcute/atproto/types/${specifier}` };
2525+ },
2626+ },
2727+];
2828+```
2929+3030+you can now simply write:
3131+3232+```js
3333+imports: ['@atcute/atproto'];
3434+```
3535+3636+the package metadata is automatically discovered and used for import resolution.
3737+3838+for lexicon definition packages, add an `atcute:lexicons` field to your package.json with NSID
3939+patterns mapped to import paths:
4040+4141+```json
4242+{
4343+ "atcute:lexicons": {
4444+ "mapping": {
4545+ "com.atproto.*": {
4646+ "type": "namespace",
4747+ "path": "./types/{{nsid_remainder}}"
4848+ }
4949+ }
5050+ }
5151+}
5252+```
5353+5454+the CLI discovers these mappings from packages listed in the `imports` array. available template
5555+expansions:
5656+5757+- `./` at the start of the path is replaced with the package name (e.g., `./types/foo` becomes
5858+ `@atcute/atproto/types/foo`)
5959+- `{{nsid}}` is replaced with the full NSID (e.g., `com/atproto/sync/subscribeRepos`)
6060+- `{{nsid_prefix}}` is replaced with the part before the wildcard (e.g., `com/atproto`)
6161+- `{{nsid_remainder}}` is replaced with the part after the prefix (e.g., `sync/subscribeRepos`)