@ossy/web 1.16.2 → 1.16.3
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 +50 -8
- package/package.json +3 -3
- package/src/index.js +4 -4
- package/src/{link.resource.js → link.schema.js} +1 -1
- package/src/{page-view.resource.js → page-view.schema.js} +1 -1
- package/src/{page.resource.js → page.schema.js} +1 -1
- package/src/{profile.resource.js → profile.schema.js} +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,54 @@
|
|
|
1
1
|
# @ossy/web
|
|
2
2
|
|
|
3
|
-
Web
|
|
3
|
+
Web **schema package** for the Ossy platform — document types for pages, links, profiles, and page-view analytics.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Schemas (ADR 0006)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
|
7
|
+
Schema definitions live in `*.schema.js` and are discovered at build time.
|
|
8
|
+
|
|
9
|
+
| Schema | Id | Purpose |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Link | `@ossy/web/schema/link` | Navigation links (`label`, `url`, `icon`) |
|
|
12
|
+
| Page | `@ossy/web/schema/page` | Web pages (`title`, `description`, `body`) |
|
|
13
|
+
| Page View | `@ossy/web/schema/page-view` | Analytics events (`path`, `referrer`, `visitorId`, `eventAt`, …) |
|
|
14
|
+
| Profile | `@ossy/web/schema/profile` | Public profile content (`name`, `bio`) |
|
|
15
|
+
|
|
16
|
+
Page-view documents are typically written to `/@ossy/analytics/page-views/` by `@ossy/resources` tasks.
|
|
17
|
+
|
|
18
|
+
## Exports
|
|
19
|
+
|
|
20
|
+
| Export | Description |
|
|
21
|
+
|---|---|
|
|
22
|
+
| `linkSchema` | Link schema definition |
|
|
23
|
+
| `pageSchema` | Page schema definition |
|
|
24
|
+
| `pageViewSchema` | Page-view analytics schema definition |
|
|
25
|
+
| `profileSchema` | Profile schema definition |
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @ossy/web
|
|
31
|
+
npm run build
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import { pageSchema, pageViewSchema } from '@ossy/web'
|
|
36
|
+
|
|
37
|
+
pageSchema.id
|
|
38
|
+
// => '@ossy/web/schema/page'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Migration from resource templates
|
|
42
|
+
|
|
43
|
+
This package migrated from `*.resource.js` to ADR 0006 schemas. Stored `resource.type` values and export names changed:
|
|
44
|
+
|
|
45
|
+
| Before | After |
|
|
46
|
+
|---|---|
|
|
47
|
+
| `@ossy/web/link` | `@ossy/web/schema/link` |
|
|
48
|
+
| `@ossy/web/page` | `@ossy/web/schema/page` |
|
|
49
|
+
| `@ossy/web/page-view` | `@ossy/web/schema/page-view` |
|
|
50
|
+
| `@ossy/web/profile` | `@ossy/web/schema/profile` |
|
|
51
|
+
| `linkResource` export | `linkSchema` |
|
|
52
|
+
| `pageResource` export | `pageSchema` |
|
|
53
|
+
| `pageViewResource` export | `pageViewSchema` |
|
|
54
|
+
| `profileResource` export | `profileSchema` |
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/web",
|
|
3
|
-
"description": "Web
|
|
4
|
-
"version": "1.16.
|
|
3
|
+
"description": "Web schema package — page, link, profile, and page-view document types for Ossy web properties",
|
|
4
|
+
"version": "1.16.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"module": "./src/index.js",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"/src",
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "a0d89185a17f8de8ce328c3a648c108ff1d61d8f"
|
|
25
25
|
}
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
1
|
+
export { default as linkSchema } from './link.schema.js'
|
|
2
|
+
export { default as pageSchema } from './page.schema.js'
|
|
3
|
+
export { default as pageViewSchema } from './page-view.schema.js'
|
|
4
|
+
export { default as profileSchema } from './profile.schema.js'
|