@neo-reckoning/ical 0.1.0-alpha.1 → 0.1.0-alpha.2
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/README.md +52 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @neo-reckoning/ical
|
|
2
|
+
|
|
3
|
+
Browser-compatible iCal (.ics) parsing adapter for [@neo-reckoning/core](https://www.npmjs.com/package/@neo-reckoning/core).
|
|
4
|
+
|
|
5
|
+
Parses external calendar feeds and produces `CalendarEvent[]` for the same rendering pipeline as native date ranges.
|
|
6
|
+
|
|
7
|
+
## Status
|
|
8
|
+
|
|
9
|
+
**This package is a placeholder.** The types and interface are defined but the implementation is pending. It will use:
|
|
10
|
+
|
|
11
|
+
- [ical.js](https://github.com/nicjansma/ical.js) (Mozilla's browser-compatible parser) for .ics text parsing
|
|
12
|
+
- [rrule](https://github.com/jakubroztocil/rrule) for RRULE recurrence expansion
|
|
13
|
+
|
|
14
|
+
## Planned API
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { parseICS, fetchAndParse } from '@neo-reckoning/ical';
|
|
18
|
+
import type { CacheAdapter } from '@neo-reckoning/core';
|
|
19
|
+
|
|
20
|
+
// Parse raw .ics text into normalized events
|
|
21
|
+
const events = parseICS(icsText, { from: windowStart, to: windowEnd });
|
|
22
|
+
|
|
23
|
+
// Fetch via a CORS proxy and parse in one call
|
|
24
|
+
const events = await fetchAndParse(
|
|
25
|
+
'/api/subscription/abc-123/proxy',
|
|
26
|
+
{ from: windowStart, to: windowEnd },
|
|
27
|
+
{
|
|
28
|
+
cache: myAdapter, // pluggable: localStorage, AsyncStorage, etc.
|
|
29
|
+
cacheTTL: 300000, // 5 minutes
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Intended flow
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
External .ics URL (Google Calendar, Outlook, etc.)
|
|
38
|
+
→ API proxy endpoint fetches server-side (avoids CORS)
|
|
39
|
+
→ Raw .ics text returned to browser
|
|
40
|
+
→ This package parses + expands RRULE occurrences
|
|
41
|
+
→ CalendarEvent[] feeds into the same pipeline as native DateRanges
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Design decisions
|
|
45
|
+
|
|
46
|
+
- **Browser-first** — no Node.js APIs. Works in web browsers and React Native.
|
|
47
|
+
- **RRULE stays as RRULE** — imported recurrence is expanded by the `rrule` library, not converted to neo-reckoning's native model. Two parallel evaluation paths converge into one `CalendarEvent[]` shape.
|
|
48
|
+
- **Pluggable cache** — `CacheAdapter` interface supports sync (localStorage) and async (AsyncStorage/MMKV) implementations.
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo-reckoning/ical",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
|
-
"url": "https://github.com/sdougbrown/neo-reckoning.git",
|
|
26
|
+
"url": "git+https://github.com/sdougbrown/neo-reckoning.git",
|
|
27
27
|
"directory": "packages/ical"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|