@metacensus/library-research 0.13.0 → 0.15.0

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.
Files changed (46) hide show
  1. package/README.md +43 -11
  2. package/dist/commands/add.js +29 -12
  3. package/dist/commands/check.js +1 -1
  4. package/dist/commands/dev.js +24 -13
  5. package/dist/commands/reshape.d.ts +2 -0
  6. package/dist/commands/reshape.js +21 -0
  7. package/dist/context.d.ts +3 -1
  8. package/dist/context.js +2 -0
  9. package/dist/corpus.d.ts +432 -0
  10. package/dist/corpus.js +348 -0
  11. package/dist/data.d.ts +16 -12
  12. package/dist/data.js +38 -26
  13. package/dist/datasets.d.ts +8 -0
  14. package/dist/{roles.js → datasets.js} +35 -29
  15. package/dist/dev/host.d.ts +7 -1
  16. package/dist/dev/host.js +15 -13
  17. package/dist/host.d.ts +3 -1
  18. package/dist/host.js +6 -2
  19. package/dist/index.d.ts +3 -2
  20. package/dist/index.js +2 -1
  21. package/dist/mount.d.ts +7 -3
  22. package/dist/mount.js +7 -7
  23. package/dist/papers.js +3 -2
  24. package/dist/playwright.d.ts +1 -1
  25. package/dist/playwright.js +24 -6
  26. package/dist/project-id.d.ts +4 -0
  27. package/dist/project-id.js +7 -0
  28. package/dist/react.d.ts +18 -18
  29. package/dist/react.js +60 -37
  30. package/dist/reader.d.ts +18 -4
  31. package/dist/reader.js +25 -2
  32. package/dist/schema.d.ts +10 -35
  33. package/dist/schema.js +57 -34
  34. package/dist/testing.d.ts +11 -6
  35. package/dist/testing.js +12 -10
  36. package/dist/types.d.ts +62 -13
  37. package/dist/vite-config.js +2 -12
  38. package/dist/vite.d.ts +10 -2
  39. package/dist/vite.js +71 -19
  40. package/dist/zod.d.ts +2 -0
  41. package/dist/zod.js +4 -0
  42. package/package.json +14 -14
  43. package/schema/corpus.schema.json +3949 -29
  44. package/schema/project-id.schema.json +6 -0
  45. package/schema/research.schema.json +33 -7
  46. package/dist/roles.d.ts +0 -7
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "string",
4
+ "pattern": "^[a-z0-9][a-z0-9-]*$",
5
+ "description": "A project id: lower-case letters, digits and hyphens, not starting with a hyphen"
6
+ }
@@ -14,7 +14,8 @@
14
14
  },
15
15
  "additionalProperties": {
16
16
  "type": "string",
17
- "pattern": "^(?!\\/)(?!.*\\.\\.).+$"
17
+ "pattern": "^(?!\\/)(?!.*\\.\\.)(?=.)[^*?[\\]{}()!]*(?:\\*[^*?[\\]{}()!]*)?$",
18
+ "description": "a glob that is relative, has no .., has at most one *, and has none of ?[]{}()!"
18
19
  }
19
20
  },
20
21
  "private": {
@@ -25,20 +26,45 @@
25
26
  },
26
27
  "additionalProperties": {
27
28
  "type": "string",
28
- "pattern": "^(?!\\/)(?!.*\\.\\.).+$"
29
+ "pattern": "^(?!\\/)(?!.*\\.\\.)(?=.)[^*?[\\]{}()!]*\\*[^*?[\\]{}()!]*$",
30
+ "description": "a glob that is relative, has no .., has exactly one *, and has none of ?[]{}()!"
29
31
  }
30
32
  },
33
+ "roles": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "string",
37
+ "pattern": "^[a-z][a-z0-9-]*$"
38
+ },
39
+ "uniqueItems": true
40
+ },
31
41
  "people": {
32
42
  "type": "object",
33
43
  "propertyNames": {
34
44
  "type": "string"
35
45
  },
36
46
  "additionalProperties": {
37
- "type": "array",
38
- "items": {
39
- "type": "string",
40
- "pattern": "^[a-z0-9][a-z0-9-]*$"
41
- }
47
+ "type": "object",
48
+ "properties": {
49
+ "name": {
50
+ "type": "string",
51
+ "minLength": 1
52
+ },
53
+ "role": {
54
+ "type": "string"
55
+ },
56
+ "pages": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "string",
60
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
61
+ }
62
+ }
63
+ },
64
+ "required": [
65
+ "name"
66
+ ],
67
+ "additionalProperties": false
42
68
  }
43
69
  }
44
70
  },
package/dist/roles.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * Reads each data role of the project in `dir`, the folder holding
3
- * research.json, parsed by its schema in ui/roles.ts, and its corpus. A
4
- * private role is read as `{ page: parsed }`, its schema parsing one page's
5
- * file. Throws one line per failure.
6
- */
7
- export declare function load(dir: string): Promise<Record<string, unknown>>;