@sybelblue/prairielearn-navigator 1.0.1 → 1.1.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/README.md +26 -0
- package/dist/{cli.js → cli.cjs} +1 -1
- package/dist/core/config.d.ts +46 -0
- package/dist/core/course.d.ts +7 -0
- package/dist/core/courseFiles.d.ts +14 -0
- package/dist/core/diagnostic.d.ts +36 -0
- package/dist/core/html.d.ts +20 -0
- package/dist/core/json.d.ts +32 -0
- package/dist/core/plVersion.d.ts +23 -0
- package/dist/core/questionFileResolver.d.ts +30 -0
- package/dist/core/questionPaths.d.ts +10 -0
- package/dist/core/referenceIndex.d.ts +58 -0
- package/dist/core/references/bases.d.ts +13 -0
- package/dist/core/references/extract.d.ts +34 -0
- package/dist/core/references/specs.d.ts +272 -0
- package/dist/core/rules/impls.d.ts +14 -0
- package/dist/core/rules/registry.d.ts +26 -0
- package/dist/core/rules/run.d.ts +18 -0
- package/dist/core/rules/types.d.ts +29 -0
- package/dist/core/schemas.d.ts +51 -0
- package/dist/index.js +1 -0
- package/dist/library.d.ts +1 -0
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -127,3 +127,29 @@ the pull request. Run it from the repository root so annotation paths resolve:
|
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
Requires Node.js 22 or newer.
|
|
130
|
+
|
|
131
|
+
## Library API
|
|
132
|
+
|
|
133
|
+
The package also exposes a typed, headless resolver for tools that need the
|
|
134
|
+
files used by each question without starting VS Code or invoking the CLI:
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
import { createQuestionFileResolver } from "@sybelblue/prairielearn-navigator";
|
|
138
|
+
|
|
139
|
+
const resolver = createQuestionFileResolver({
|
|
140
|
+
courseRoot: "/path/to/course",
|
|
141
|
+
questions: [
|
|
142
|
+
{ qid: "vectors/addition", directory: "questions/vectors/addition" },
|
|
143
|
+
],
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const initial = await resolver.resolveAll();
|
|
147
|
+
const changed = await resolver.update(["clientFilesCourse/plots.js"]);
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`resolveAll()` returns a `Map` from QID to a `QuestionFileResolution` with
|
|
151
|
+
course-relative file paths, `question-local`, `template-local`, or
|
|
152
|
+
`course-level` provenance, and diagnostics for dependencies that cannot be
|
|
153
|
+
resolved statically. `update()` maintains the dependency graph and returns
|
|
154
|
+
only questions affected by the supplied course-relative paths. The resolver
|
|
155
|
+
does not watch the filesystem; callers decide how and when to batch changes.
|