@aturi.to/waypoints 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/dist/index.cjs +1351 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +262 -0
- package/dist/index.d.ts +262 -0
- package/dist/index.js +1327 -0
- package/dist/index.js.map +1 -0
- package/package.json +66 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dame.art
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# @aturi.to/waypoints
|
|
2
|
+
|
|
3
|
+
Aturi's curated catalog of Atmosphere (AT Protocol) clients — "waypoints" — plus
|
|
4
|
+
the logic to turn an AT URI into per-client "Open in…" links, recommend the best
|
|
5
|
+
client for a record type, and reverse-resolve a pasted URL back into an AT URI.
|
|
6
|
+
|
|
7
|
+
Zero runtime dependencies. Works in the browser, Node 18+, and edge runtimes.
|
|
8
|
+
Ships ESM + CJS with full type definitions.
|
|
9
|
+
|
|
10
|
+
For a drop-in React picker UI, see [`@aturi.to/waypoints-react`](../waypoints-react).
|
|
11
|
+
|
|
12
|
+
> **Beta — early release.** This is a `0.x` package that hasn't been
|
|
13
|
+
> thoroughly tested in production yet. Expect rough edges, and possible
|
|
14
|
+
> breaking changes between minor versions while the API settles. Bug reports
|
|
15
|
+
> and feedback are very welcome at
|
|
16
|
+
> [github.com/atpota-to/aturi/issues](https://github.com/atpota-to/aturi/issues).
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm install @aturi.to/waypoints
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick start
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { resolveAtUri, resolveUrl, buildWaypointsForParsed } from '@aturi.to/waypoints';
|
|
28
|
+
|
|
29
|
+
// AT URI -> waypoints
|
|
30
|
+
const result = resolveAtUri('at://did:plc:abc/app.bsky.feed.post/3k7');
|
|
31
|
+
result?.waypoints; // [{ id: 'anisota', name: 'Anisota', category, url }, ...]
|
|
32
|
+
result?.recommended; // { ids: ['bluesky', 'anisota', ...], label: 'Recommended for Posts' }
|
|
33
|
+
|
|
34
|
+
// Pasted page URL -> waypoints (offline pattern match)
|
|
35
|
+
const fromUrl = await resolveUrl('https://bsky.app/profile/alice.bsky.social/post/3k7');
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## What's included
|
|
39
|
+
|
|
40
|
+
- **Catalog**: `WAYPOINT_DESTINATIONS_DATA`, `WAYPOINT_ORDER`, `WAYPOINT_CATEGORIES_DATA`,
|
|
41
|
+
`COMPAT_FAMILIES`, and the `WaypointData` / `WaypointType` types.
|
|
42
|
+
- **Link builders & recommendations**: `getWaypointDataForType`,
|
|
43
|
+
`getCategorizedWaypointsData`, `getRecommendedWaypointsData`,
|
|
44
|
+
`getFeaturedWaypointData`, `waypointActivity`.
|
|
45
|
+
- **AT URI parsing**: `parseURI`, `resolveHandle`, `getDisplayName`.
|
|
46
|
+
- **Reverse resolution**: `matchSupportedUrl`, `parseAtUri`, `SUPPORTED_HOSTS`.
|
|
47
|
+
- **High-level resolvers** (`resolve.ts`):
|
|
48
|
+
- `buildWaypointsForParsed(parsed, { did?, excludeSourceId? })`
|
|
49
|
+
- `resolveAtUri(uri)`
|
|
50
|
+
- `resolveUrl(url, { fetchHead?, resolveHandle? })`
|
|
51
|
+
- `resolveViaApi(input, { endpoint? })` — typed client for the hosted
|
|
52
|
+
`aturi.to/api/resolve` endpoint.
|
|
53
|
+
|
|
54
|
+
### DID-only waypoints
|
|
55
|
+
|
|
56
|
+
A handful of destinations (`pdsls`, `atptools`, `margin`, `grain`, `popfeed`)
|
|
57
|
+
only produce useful URLs when a DID is known. They're filtered out unless a DID
|
|
58
|
+
is available — pass one in, or supply a `resolveHandle` to `resolveUrl`.
|
|
59
|
+
|
|
60
|
+
### Hosted vs. local resolution
|
|
61
|
+
|
|
62
|
+
`resolveUrl` matches URL patterns locally (no network). The optional `fetchHead`
|
|
63
|
+
flag and `resolveViaApi` let you fall back to fetching the page and probing for a
|
|
64
|
+
`<link href="at://…">` — useful for sites without a recognizable URL shape.
|
|
65
|
+
`resolveViaApi` is the right choice from a browser, where fetching arbitrary
|
|
66
|
+
pages is blocked by CORS.
|
|
67
|
+
|
|
68
|
+
## A note on drift
|
|
69
|
+
|
|
70
|
+
The four canonical logic/icon files (`waypoints.data.ts`, `uriParser.ts`,
|
|
71
|
+
`reverseParsers.ts`, and the React icon catalog) are the single source of truth
|
|
72
|
+
inside the [`aturi.to`](https://github.com/atpota-to/aturi) app under `src/`.
|
|
73
|
+
This package ships **copies** so it can build standalone, kept in lockstep by a
|
|
74
|
+
sync script:
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
npm run sync # copy the canonical files into the packages
|
|
78
|
+
npm run sync:check # exit non-zero if any copy is stale (wire into CI/pre-publish)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
If you change waypoint data or parsing logic in the app, re-run `npm run sync`.
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
MIT © dame.art. (The Aturi app itself is GPL-3.0; these packages are
|
|
86
|
+
dual-licensed MIT by the copyright holder to remove the adoption barrier.)
|