a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
101
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(lex-cli): support lone dot path

Mary a6e93b0b 14294388

+10 -7
+2 -2
.changeset/stale-mugs-create.md
··· 45 45 the CLI discovers these mappings from packages listed in the `imports` array. available template 46 46 expansions: 47 47 48 - - `./` at the start of the path is replaced with the package name (e.g., `./types/foo` becomes 49 - `@atcute/atproto/types/foo`) 48 + - `.` or `./` at the start of the path is replaced with the package name (e.g., `./types/foo` becomes 49 + `@atcute/atproto/types/foo`, or `.` becomes `@atcute/atproto`) 50 50 - `{{nsid}}` is replaced with the full NSID (e.g., `com/atproto/sync/subscribeRepos`) 51 51 - `{{nsid_prefix}}` is replaced with the part before the wildcard (e.g., `com/atproto`) 52 52 - `{{nsid_remainder}}` is replaced with the part after the prefix (e.g., `sync/subscribeRepos`)
+2 -2
packages/lexicons/lex-cli/README.md
··· 45 45 46 46 the `path` field supports several template expansions: 47 47 48 - - `./` at the start is replaced with the package name (e.g., `./types/foo` becomes 49 - `@example/my-schemas/types/foo`) 48 + - `.` or `./` at the start is replaced with the package name (e.g., `./types/foo` becomes 49 + `@example/my-schemas/types/foo`, or `.` becomes `@example/my-schemas`) 50 50 - `{{nsid}}` - the full NSID with dots replaced by slashes (e.g., `com/example/foo/bar`) 51 51 - `{{nsid_prefix}}` - the part before the wildcard (e.g., `com/example`) 52 52 - `{{nsid_remainder}}` - the part after the prefix (e.g., `foo/bar`)
+2 -1
packages/lexicons/lex-cli/schema/lexicon-package.schema.json
··· 20 20 ] 21 21 }, 22 22 "path": { 23 - "type": "string" 23 + "type": "string", 24 + "pattern": "^(\\.|\\.\\/)" 24 25 } 25 26 }, 26 27 "required": [
+3 -1
packages/lexicons/lex-cli/src/cli.ts
··· 94 94 .replaceAll('{{nsid_remainder}}', nsidRemainder.replaceAll('.', '/')) 95 95 .replaceAll('{{nsid_prefix}}', nsidPrefix.replaceAll('.', '/')); 96 96 97 - if (expandedPath.startsWith('./')) { 97 + if (expandedPath === '.') { 98 + expandedPath = packageName; 99 + } else if (expandedPath.startsWith('./')) { 98 100 expandedPath = `${packageName}/${expandedPath.slice(2)}`; 99 101 } 100 102
+1 -1
packages/lexicons/lex-cli/src/lexicon-metadata.ts
··· 22 22 */ 23 23 const lexiconMappingEntry = v.object({ 24 24 type: v.picklist(['namespace', 'named']), 25 - path: v.pipe(v.string(), v.startsWith('./')), 25 + path: v.pipe(v.string(), v.regex(/^(\.|\.\/)/)), 26 26 }); 27 27 28 28 /**