@harperfast/template-react-ssr-studio 1.9.2 → 1.10.1
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/.agents/skills/harper-best-practices/AGENTS.md +916 -338
- package/.agents/skills/harper-best-practices/rules/caching.md +68 -62
- package/.agents/skills/harper-best-practices/rules/custom-resources.md +144 -23
- package/.agents/skills/harper-best-practices/rules/defining-relationships.md +152 -22
- package/.agents/skills/harper-best-practices/rules/extending-tables.md +90 -21
- package/.agents/skills/harper-best-practices/rules/handling-binary-data.md +103 -23
- package/.agents/skills/harper-best-practices/rules/programmatic-table-requests.md +143 -91
- package/.agents/skills/harper-best-practices/rules/schema-design-tooling.md +87 -64
- package/.agents/skills/harper-best-practices/rules/serving-web-content.md +28 -0
- package/.agents/skills/harper-best-practices/rules/using-blob-datatype.md +97 -16
- package/.agents/skills/harper-best-practices/rules/vector-indexing.md +59 -29
- package/.agents/skills/harper-best-practices/rules.manifest.yaml +109 -7
- package/agent/skills/harper-best-practices/AGENTS.md +916 -338
- package/agent/skills/harper-best-practices/rules/caching.md +68 -62
- package/agent/skills/harper-best-practices/rules/custom-resources.md +144 -23
- package/agent/skills/harper-best-practices/rules/defining-relationships.md +152 -22
- package/agent/skills/harper-best-practices/rules/extending-tables.md +90 -21
- package/agent/skills/harper-best-practices/rules/handling-binary-data.md +103 -23
- package/agent/skills/harper-best-practices/rules/programmatic-table-requests.md +143 -91
- package/agent/skills/harper-best-practices/rules/schema-design-tooling.md +87 -64
- package/agent/skills/harper-best-practices/rules/serving-web-content.md +28 -0
- package/agent/skills/harper-best-practices/rules/using-blob-datatype.md +97 -16
- package/agent/skills/harper-best-practices/rules/vector-indexing.md +59 -29
- package/agent/skills/harper-best-practices/rules.manifest.yaml +109 -7
- package/package.json +1 -1
- package/skills-lock.json +1 -1
- package/src/entry-server.jsx +20 -2
- package/vite.config.js +7 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
#
|
|
3
3
|
# Declarative source of truth for rule taxonomy, sources, and generation mode.
|
|
4
4
|
# Owned by humans; the generator reads this file and writes derived artifacts
|
|
5
|
-
# (rule bodies, AGENTS.md). See docs/plans/docs-driven-skills.md for the
|
|
5
|
+
# (rule bodies, AGENTS.md). See docs/plans-archive/docs-driven-skills.md for the
|
|
6
6
|
# full schema definition and Manifest ↔ frontmatter reconciliation semantics.
|
|
7
7
|
#
|
|
8
8
|
# Phase 2 flipped vector-indexing to mode: generate.
|
|
@@ -53,7 +53,20 @@ rules:
|
|
|
53
53
|
category: schema
|
|
54
54
|
priority: 1
|
|
55
55
|
order: 3
|
|
56
|
-
mode:
|
|
56
|
+
mode: generate
|
|
57
|
+
sources:
|
|
58
|
+
- path: reference/v5/database/schema.md
|
|
59
|
+
section: 'Relationships'
|
|
60
|
+
role: primary
|
|
61
|
+
- path: reference/v5/rest/querying.md
|
|
62
|
+
section: 'Relationships and Joins'
|
|
63
|
+
role: supplemental
|
|
64
|
+
must_cover:
|
|
65
|
+
- '@relationship'
|
|
66
|
+
- 'from'
|
|
67
|
+
- 'to'
|
|
68
|
+
- 'one-to-many'
|
|
69
|
+
- 'many-to-one'
|
|
57
70
|
|
|
58
71
|
- rule: vector-indexing
|
|
59
72
|
description: How to enable and query vector indexes for similarity search in Harper.
|
|
@@ -79,14 +92,51 @@ rules:
|
|
|
79
92
|
category: schema
|
|
80
93
|
priority: 1
|
|
81
94
|
order: 5
|
|
82
|
-
mode:
|
|
95
|
+
mode: generate
|
|
96
|
+
sources:
|
|
97
|
+
- path: reference/v5/database/schema.md
|
|
98
|
+
section: 'Blob Type'
|
|
99
|
+
role: primary
|
|
100
|
+
- path: reference/v5/database/api.md
|
|
101
|
+
section: 'Streaming'
|
|
102
|
+
role: supplemental
|
|
103
|
+
- path: reference/v5/database/api.md
|
|
104
|
+
section: '`BlobOptions`'
|
|
105
|
+
role: supplemental
|
|
106
|
+
- path: reference/v5/database/api.md
|
|
107
|
+
section: 'Blob Coercion'
|
|
108
|
+
role: supplemental
|
|
109
|
+
must_cover:
|
|
110
|
+
- 'Blob'
|
|
111
|
+
- 'createBlob'
|
|
112
|
+
- 'saveBeforeCommit'
|
|
113
|
+
- '.bytes()'
|
|
114
|
+
cross_links:
|
|
115
|
+
- handling-binary-data
|
|
83
116
|
|
|
84
117
|
- rule: handling-binary-data
|
|
85
118
|
description: How to store and serve binary data like images or audio in Harper.
|
|
86
119
|
category: schema
|
|
87
120
|
priority: 1
|
|
88
121
|
order: 6
|
|
89
|
-
mode:
|
|
122
|
+
mode: generate
|
|
123
|
+
sources:
|
|
124
|
+
- path: reference/v5/database/api.md
|
|
125
|
+
section: 'Accepting Binary in JSON Requests'
|
|
126
|
+
role: primary
|
|
127
|
+
- path: reference/v5/database/api.md
|
|
128
|
+
section: 'Serving Binary from a Resource'
|
|
129
|
+
role: primary
|
|
130
|
+
- path: reference/v5/rest/content-types.md
|
|
131
|
+
section: 'Storing Arbitrary Content Types'
|
|
132
|
+
role: supplemental
|
|
133
|
+
must_cover:
|
|
134
|
+
- 'createBlob'
|
|
135
|
+
- 'Content-Type'
|
|
136
|
+
- 'application/octet-stream'
|
|
137
|
+
- 'base64'
|
|
138
|
+
cross_links:
|
|
139
|
+
- using-blob-datatype
|
|
90
140
|
|
|
91
141
|
# ===========================================================================
|
|
92
142
|
# API & Communication (priority 2 — HIGH)
|
|
@@ -176,21 +226,73 @@ rules:
|
|
|
176
226
|
category: logic
|
|
177
227
|
priority: 3
|
|
178
228
|
order: 1
|
|
179
|
-
mode:
|
|
229
|
+
mode: generate
|
|
230
|
+
sources:
|
|
231
|
+
- path: reference/v5/resources/overview.md
|
|
232
|
+
section: 'Custom External Data Source'
|
|
233
|
+
role: primary
|
|
234
|
+
- path: reference/v5/resources/overview.md
|
|
235
|
+
section: 'Exporting Resources as Endpoints'
|
|
236
|
+
role: primary
|
|
237
|
+
- path: reference/v5/components/javascript-environment.md
|
|
238
|
+
section: 'Module Loading'
|
|
239
|
+
role: supplemental
|
|
240
|
+
must_cover:
|
|
241
|
+
- 'extends Resource'
|
|
242
|
+
- 'export class'
|
|
243
|
+
- 'server.resources.set('
|
|
244
|
+
- 'static'
|
|
180
245
|
|
|
181
246
|
- rule: extending-tables
|
|
182
247
|
description: How to add custom logic to automatically generated table resources in Harper.
|
|
183
248
|
category: logic
|
|
184
249
|
priority: 3
|
|
185
250
|
order: 2
|
|
186
|
-
mode:
|
|
251
|
+
mode: generate
|
|
252
|
+
sources:
|
|
253
|
+
- path: reference/v5/resources/overview.md
|
|
254
|
+
section: 'Extending a Table'
|
|
255
|
+
role: primary
|
|
256
|
+
- path: reference/v5/resources/resource-api.md
|
|
257
|
+
section: 'Throwing Errors'
|
|
258
|
+
role: supplemental
|
|
259
|
+
must_cover:
|
|
260
|
+
- 'extends tables.'
|
|
261
|
+
- 'super.'
|
|
262
|
+
- '@export'
|
|
263
|
+
- 'statusCode'
|
|
187
264
|
|
|
188
265
|
- rule: programmatic-table-requests
|
|
189
266
|
description: How to interact with Harper tables programmatically using the `tables` object.
|
|
190
267
|
category: logic
|
|
191
268
|
priority: 3
|
|
192
269
|
order: 3
|
|
193
|
-
mode:
|
|
270
|
+
mode: generate
|
|
271
|
+
sources:
|
|
272
|
+
- path: reference/v5/database/api.md
|
|
273
|
+
section: '`tables`'
|
|
274
|
+
role: primary
|
|
275
|
+
- path: reference/v5/resources/resource-api.md
|
|
276
|
+
section: 'Query Object'
|
|
277
|
+
role: primary
|
|
278
|
+
- path: reference/v5/database/api.md
|
|
279
|
+
section: '`transaction(context?, callback)`'
|
|
280
|
+
role: supplemental
|
|
281
|
+
- path: reference/v5/resources/resource-api.md
|
|
282
|
+
section: '`update(target: RequestTarget | Id, updates?: object): Promise<Resource>`'
|
|
283
|
+
role: supplemental
|
|
284
|
+
- path: reference/v5/resources/resource-api.md
|
|
285
|
+
section: '`addTo(property: string, value: number)`'
|
|
286
|
+
role: supplemental
|
|
287
|
+
- path: reference/v5/components/javascript-environment.md
|
|
288
|
+
section: 'Module Loading'
|
|
289
|
+
role: supplemental
|
|
290
|
+
must_cover:
|
|
291
|
+
- 'tables'
|
|
292
|
+
- 'conditions'
|
|
293
|
+
- 'search('
|
|
294
|
+
- 'addTo'
|
|
295
|
+
- 'select'
|
|
194
296
|
|
|
195
297
|
- rule: typescript-type-stripping
|
|
196
298
|
description: How to run TypeScript files directly in Harper without a build step.
|
package/package.json
CHANGED
package/skills-lock.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"source": "harperfast/skills",
|
|
6
6
|
"sourceType": "github",
|
|
7
7
|
"skillPath": "harper-best-practices/SKILL.md",
|
|
8
|
-
"computedHash": "
|
|
8
|
+
"computedHash": "142388c071178e7ae811bfd4f6241e85aef3f715dbfb0ceea1b75e8f370d8080"
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
}
|
package/src/entry-server.jsx
CHANGED
|
@@ -3,8 +3,26 @@ import { StrictMode } from 'react';
|
|
|
3
3
|
import { renderToString } from 'react-dom/server';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Server render entry. The Vite Harper plugin calls this for HTML navigations and
|
|
7
|
-
* returned markup into the `<!--ssr-outlet-->` placeholder in index.html.
|
|
6
|
+
* Server render entry. The Vite Harper plugin calls this (awaiting it) for HTML navigations and
|
|
7
|
+
* injects the returned markup into the `<!--ssr-outlet-->` placeholder in index.html.
|
|
8
|
+
*
|
|
9
|
+
* To render with data already in place (no client-side fetch), read from Harper right here. The
|
|
10
|
+
* `tables` registry is the same live, process-wide object available everywhere in Harper — the SSR
|
|
11
|
+
* entry can reach it via `import { tables } from 'harper'` because Harper symlinks
|
|
12
|
+
* `node_modules/harper` to the running install (and `vite.config.js` keeps `harper` external). Make
|
|
13
|
+
* `render` async and query a table, e.g.:
|
|
14
|
+
*
|
|
15
|
+
* import { tables } from 'harper';
|
|
16
|
+
*
|
|
17
|
+
* // The template's App takes no props — update App.jsx to accept `product`.
|
|
18
|
+
* export async function render(url) {
|
|
19
|
+
* const product = await tables.Product.get(idFromUrl(url));
|
|
20
|
+
* return renderToString(
|
|
21
|
+
* <StrictMode>
|
|
22
|
+
* <App product={product} />
|
|
23
|
+
* </StrictMode>,
|
|
24
|
+
* );
|
|
25
|
+
* }
|
|
8
26
|
*
|
|
9
27
|
* @param {string} _url The request URL — use it to drive routing/data loading per request.
|
|
10
28
|
* @returns {string}
|
package/vite.config.js
CHANGED
|
@@ -12,6 +12,13 @@ export default defineConfig({
|
|
|
12
12
|
'@': path.resolve(import.meta.dirname, './src'),
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
|
+
ssr: {
|
|
16
|
+
// Keep `harper` external so the SSR entry resolves it to Harper's running runtime instead of
|
|
17
|
+
// bundling it. `node_modules/harper` is symlinked to the running install, and symlinked deps
|
|
18
|
+
// aren't reliably auto-externalized for SSR — this is what lets `import { tables } from 'harper'`
|
|
19
|
+
// in entry-server read live data. See src/entry-server.jsx.
|
|
20
|
+
external: ['harper'],
|
|
21
|
+
},
|
|
15
22
|
build: {
|
|
16
23
|
outDir: 'dist',
|
|
17
24
|
emptyOutDir: true,
|