@odori/cli 0.0.10 → 0.0.12
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/dist/{chunk-AJBK4XRB.js → chunk-FS2BJU5Q.js} +777 -78
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +100 -2
- package/dist/index.js +5 -1
- package/dist/{registry-snapshot-TKH2KAC3.js → registry-snapshot-TSTAA6NT.js} +1815 -245
- package/package.json +5 -4
- package/src/cli.ts +32 -2
- package/src/commands/blocks.ts +188 -0
- package/src/commands/dev.ts +6 -1
- package/src/commands/docs.ts +88 -0
- package/src/commands/doctor.ts +38 -0
- package/src/commands/exportVideo.ts +21 -2
- package/src/commands/graph.ts +141 -0
- package/src/commands/shared.ts +4 -1
- package/src/commands/test.ts +10 -1
- package/src/cues.ts +17 -0
- package/src/discovery.ts +8 -2
- package/src/docs-snapshot.json +130 -0
- package/src/docs.ts +54 -0
- package/src/index.ts +2 -0
- package/src/registry-snapshot.json +1647 -206
- package/src/registry-source.ts +139 -0
- package/src/render.ts +3 -0
- package/src/structure.ts +177 -0
- package/studio/src/components/ExportPanel.tsx +11 -18
- package/studio/src/main.tsx +1 -0
- package/studio/src/studio.css +18 -0
- package/studio/src/views/ComponentsView.tsx +28 -7
- package/studio/src/views/VideosView.tsx +83 -11
package/src/docs.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import snapshot from "./docs-snapshot.json" with {type: "json"};
|
|
2
|
+
|
|
3
|
+
export type DocPage = {
|
|
4
|
+
slug: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
section: string;
|
|
8
|
+
body: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type DocHit = {page: DocPage; line: number; text: string};
|
|
12
|
+
|
|
13
|
+
/** Every page, in the order the snapshot fixed at build time. */
|
|
14
|
+
export const docPages = (): DocPage[] => (snapshot as {pages: DocPage[]}).pages;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The page a reader asked for, by slug or by the tail of one.
|
|
18
|
+
*
|
|
19
|
+
* `odori docs audio` should find `guides/audio` without the reader knowing
|
|
20
|
+
* how the site files things: the section is the site's organisation, not
|
|
21
|
+
* theirs. An exact slug still wins, so a page named after a section is never
|
|
22
|
+
* shadowed by one inside it.
|
|
23
|
+
*/
|
|
24
|
+
export const findDoc = (query: string): DocPage | undefined => {
|
|
25
|
+
const wanted = query.replace(/^\/+|\/+$|\.mdx$/g, "").toLowerCase();
|
|
26
|
+
const pages = docPages();
|
|
27
|
+
return (
|
|
28
|
+
pages.find((page) => page.slug.toLowerCase() === wanted) ??
|
|
29
|
+
pages.find((page) => page.slug.toLowerCase().endsWith(`/${wanted}`)) ??
|
|
30
|
+
pages.find((page) => page.title.toLowerCase() === wanted)
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Lines that mention the query, with the page they came from.
|
|
36
|
+
*
|
|
37
|
+
* Line-level rather than page-level, because "which page mentions ducking"
|
|
38
|
+
* is a worse answer than the sentence that does: an agent can act on the
|
|
39
|
+
* line and open the page only if it needs the rest.
|
|
40
|
+
*/
|
|
41
|
+
export const searchDocs = (query: string, limit = 20): DocHit[] => {
|
|
42
|
+
const needle = query.toLowerCase();
|
|
43
|
+
if (!needle) return [];
|
|
44
|
+
const hits: DocHit[] = [];
|
|
45
|
+
for (const page of docPages()) {
|
|
46
|
+
const lines = page.body.split("\n");
|
|
47
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
48
|
+
if (!lines[index].toLowerCase().includes(needle)) continue;
|
|
49
|
+
hits.push({page, line: index + 1, text: lines[index].trim()});
|
|
50
|
+
if (hits.length >= limit) return hits;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return hits;
|
|
54
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -30,6 +30,8 @@ export {
|
|
|
30
30
|
} from "./jobs";
|
|
31
31
|
export {buildAudioFilter, resolveCueFile, type MixInput} from "./audio-mix";
|
|
32
32
|
export {checkDeterminism, type DeterminismFinding} from "./determinism";
|
|
33
|
+
export {checkStructure, type StructureFinding} from "./structure";
|
|
34
|
+
export {buildGraphArtifact, type GraphArtifact} from "./commands/graph";
|
|
33
35
|
export {FORMATS, alphaWarning, formatNames, resolveFormat, type VideoFormat} from "./formats";
|
|
34
36
|
export {
|
|
35
37
|
CHROME_BUILD,
|