fact-kit-facts 0.5.0 → 0.6.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.
- package/dist/index.json +325 -1
- package/package.json +1 -1
package/dist/index.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"entry": ".",
|
|
5
5
|
"component": "fact-kit-facts.npm",
|
|
6
6
|
"describes": {
|
|
7
|
-
"fact-kit-js": "0.
|
|
7
|
+
"fact-kit-js": "0.11.0"
|
|
8
8
|
},
|
|
9
9
|
"publish": {
|
|
10
10
|
"target": "npm",
|
|
@@ -777,6 +777,178 @@
|
|
|
777
777
|
}
|
|
778
778
|
]
|
|
779
779
|
}
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"since": "next",
|
|
783
|
+
"content": {
|
|
784
|
+
"value": [
|
|
785
|
+
{
|
|
786
|
+
"code": "format",
|
|
787
|
+
"rule": "A fact, index, schema file or example does not fit its meta-schema.",
|
|
788
|
+
"reads": "sources and built indexes"
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
"code": "duplicate-id",
|
|
792
|
+
"rule": "Two facts have one id.",
|
|
793
|
+
"reads": "sources and built indexes"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"code": "id-prefix",
|
|
797
|
+
"rule": "A fact id does not start with its tool and a dot.",
|
|
798
|
+
"reads": "sources and built indexes"
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
"code": "local-path",
|
|
802
|
+
"rule": "A fact holds a local absolute path.",
|
|
803
|
+
"reads": "sources and built indexes"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"code": "unregistered-domain",
|
|
807
|
+
"rule": "A fact holds a URL whose host is not in `allowedDomains`.",
|
|
808
|
+
"reads": "sources and built indexes"
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
"code": "unknown-fact-id",
|
|
812
|
+
"rule": "`replacement`, `derivedFrom` or an example names a fact that does not exist.",
|
|
813
|
+
"reads": "sources and built indexes"
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"code": "missing-schema-file",
|
|
817
|
+
"rule": "A `$ref` points at a file under `schemas/` that is not there.",
|
|
818
|
+
"reads": "sources and built indexes"
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
"code": "describes",
|
|
822
|
+
"rule": "`describes` names more than one component, or the entries of one package disagree (different components, or `{}` mixed with one).",
|
|
823
|
+
"reads": "sources"
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
"code": "publish",
|
|
827
|
+
"rule": "The entries of one package disagree on `publish` (different targets or names, or one entry without it).",
|
|
828
|
+
"reads": "sources"
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
"code": "since-format",
|
|
832
|
+
"rule": "A `since` is not a version, `next`, or an array of versions that may end in `next`.",
|
|
833
|
+
"reads": "sources and built indexes"
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
"code": "same-line",
|
|
837
|
+
"rule": "A `since` array has two versions on one release line.",
|
|
838
|
+
"reads": "sources and built indexes"
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
"code": "ambiguous-rows",
|
|
842
|
+
"rule": "Two rows apply to the same readers with the same bound, so a reader can not choose.",
|
|
843
|
+
"reads": "sources and built indexes"
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"code": "relation-cycle",
|
|
847
|
+
"rule": "Facts are derived from each other in a loop through `derivedFrom`.",
|
|
848
|
+
"reads": "sources and built indexes"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"code": "relates-foreign",
|
|
852
|
+
"rule": "`relates` or `factLink` holds a fact object that is not a fact of this package, such as one imported from another package.",
|
|
853
|
+
"reads": "sources"
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
"code": "history",
|
|
857
|
+
"rule": "A `history` row does not fit: a key that matches no item, a key that is already there, an array that is not keyed, a bad pointer, or a pointer that goes into an array by index. Name an item by its key, or replace the whole array.",
|
|
858
|
+
"reads": "sources"
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
"code": "derive",
|
|
862
|
+
"rule": "`derive` finds no installed upstream package, no such fact in it, or `map` returns something that is not an object.",
|
|
863
|
+
"reads": "the installed upstream package"
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
"code": "derive-version",
|
|
867
|
+
"rule": "`derived.lock.json`, or a built index passed with `--index`, records another upstream version than the one installed.",
|
|
868
|
+
"reads": "the installed upstream package, `derived.lock.json`"
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
"code": "lib-rows",
|
|
872
|
+
"rule": "A row with `since` in `facts/_lib`, which holds only functions and constants.",
|
|
873
|
+
"reads": "source code, parsed with oxc"
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
"code": "since-ahead",
|
|
877
|
+
"rule": "A `since` is newer than `describes`, or than the `--train` version of its component when one is given.",
|
|
878
|
+
"reads": "sources, `--train`"
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
"code": "train-next",
|
|
882
|
+
"rule": "A component named by `--train` still has a row that says `next` and is not pending.",
|
|
883
|
+
"reads": "sources, `--train`"
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
"code": "pending-untested",
|
|
887
|
+
"rule": "A `pending` label is not passed as `include` by any test in `testDirs`.",
|
|
888
|
+
"reads": "`testDirs`, parsed with oxc"
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
"code": "doc-unknown-id",
|
|
892
|
+
"rule": "A `fact:<id>` or `fact:<spec>:<id>` in `docsDirs` names a fact that does not exist.",
|
|
893
|
+
"reads": "`docsDirs`"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"code": "impl-imports-facts",
|
|
897
|
+
"rule": "Code in `implDirs` imports a `-facts` package, with or without the publish target suffix `.<target>` of `fact-kit.facts-package-naming`, as in `fact-kit-facts.npm`.",
|
|
898
|
+
"reads": "`implDirs`, parsed with oxc"
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
"code": "impl-reads-facts-dist",
|
|
902
|
+
"rule": "A string in `implDirs` code, or a fixed part of a template, holds `facts/dist` as a path part (bounded by the start, the end, `/` or `\\`). It covers an import, `require`, `readFileSync` and `new URL`. It matches the literal text, so a path built as `join('facts', 'dist')` is not found, and implementations in other languages are out of scope.",
|
|
903
|
+
"reads": "`implDirs`, parsed with oxc"
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"code": "impl-depends-on-facts",
|
|
907
|
+
"rule": "A package that is not a facts package lists a `-facts` package in `dependencies`. A name with the publish target suffix, such as `fact-kit-facts.npm`, is a `-facts` package too.",
|
|
908
|
+
"reads": "every package.json under `repoRoot`"
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
"code": "top-level-content",
|
|
912
|
+
"rule": "A warning. No row applies to a reader that names no platform, so the top-level content is a guess.",
|
|
913
|
+
"reads": "sources and built indexes"
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
"code": "load",
|
|
917
|
+
"rule": "A source module, example or index file can not be run or parsed.",
|
|
918
|
+
"reads": "sources"
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
"code": "builder",
|
|
922
|
+
"rule": "A builder, `mf.*`, `contentOf` or `subsetOf` got input that does not fit, such as a name with a leading dot, rows whose first row is not the kind of the method, a subset whose parent is not a fact object, or a state machine, relations or sequence with an end that is not declared, or an entity, value object, aggregate or use case whose names do not match (an identity or `required` name that is not a field, a layer that is not one of three). `history` also raises it when a row makes what a builder checked invalid. The message names the row and the key. Only `check` prints the code. `build` stops with the message.",
|
|
923
|
+
"reads": "sources"
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
"code": "subset-of",
|
|
927
|
+
"rule": "A list declared with `subsetOf` has, at some version boundary, a value that the list of its parent lacks, or the parent has no row that applies there. The boundaries are those of `ambiguous-rows`, taken over the rows of both facts. The message names the oldest version where it happens and the value. `build` runs this rule too.",
|
|
928
|
+
"reads": "sources"
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
"code": "ref",
|
|
932
|
+
"rule": "A `ref(fact, field?)` does not resolve. At some version boundary of the two facts, the reader gets a row of the fact that writes the `ref` but no row of the target applies, the target lacks the field (a field name with a dot can not be referenced), the target is a statement and the `ref` has a field, or the target is not a schema where the `ref` is a `$ref`. Also: a field path with an empty part, `$defs` that already has the key with another schema, schemas that embed each other in a loop, a schema of another entry with a file `$ref` embedded here, a `$dynamicRef` or `$recursiveRef`, or a `$ref` to the root inside a subschema with an `$id`, in an embedded schema, which can not be moved into the schema that embeds it, and a target with several rows whose rows can not be aligned with the rows of the fact that writes the `ref`, so some reader gets a schema in `$defs` that is not the one it gets from the target. The message names the oldest version where it happens. `build` runs this rule too.",
|
|
933
|
+
"reads": "sources"
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
"code": "schema-property",
|
|
937
|
+
"rule": "An `x-identity` names a field that is not in the `properties` of the same schema. It reads every schema of a fact, in every row, and every file under `schemas/`. A `required` list that builders make is checked by `builder`, not by this rule.",
|
|
938
|
+
"reads": "sources and built indexes"
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
"code": "policy-scope",
|
|
942
|
+
"rule": "The `release-policy.json` at `repoRoot` has `access: \"restricted\"` at the top or in a unit, and no top-level `scope`. `check` reports it itself and does not leave it to the schema of the policy. A repository with no `release-policy.json` is not checked. See `fact-kit.facts-package-naming`.",
|
|
943
|
+
"reads": "`release-policy.json`"
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
"code": "facts-name",
|
|
947
|
+
"rule": "In an aggregate package (the config has `aggregate`), the name of the aggregate or of a component package is not the one `fact-kit.facts-package-naming` works out from `release-policy.json`: a missing or extra `@<scope>/` prefix, a missing or extra publish target suffix, or a shared base name with no publish target to tell the packages apart. The message names the expected name. A repository with no `release-policy.json` is not checked. A component that is not found in node_modules or in the workspace, or whose facts cannot be loaded, gets a warning with code `facts-name` and is not checked.",
|
|
948
|
+
"reads": "`release-policy.json`, `release-please-config.json`, the component packages and their facts sources"
|
|
949
|
+
}
|
|
950
|
+
]
|
|
951
|
+
}
|
|
780
952
|
}
|
|
781
953
|
],
|
|
782
954
|
"tool": "fact-kit",
|
|
@@ -2727,6 +2899,46 @@
|
|
|
2727
2899
|
"schema-property"
|
|
2728
2900
|
]
|
|
2729
2901
|
}
|
|
2902
|
+
},
|
|
2903
|
+
{
|
|
2904
|
+
"since": "next",
|
|
2905
|
+
"content": {
|
|
2906
|
+
"value": [
|
|
2907
|
+
"format",
|
|
2908
|
+
"duplicate-id",
|
|
2909
|
+
"id-prefix",
|
|
2910
|
+
"local-path",
|
|
2911
|
+
"unregistered-domain",
|
|
2912
|
+
"unknown-fact-id",
|
|
2913
|
+
"missing-schema-file",
|
|
2914
|
+
"describes",
|
|
2915
|
+
"publish",
|
|
2916
|
+
"since-format",
|
|
2917
|
+
"ambiguous-rows",
|
|
2918
|
+
"top-level-content",
|
|
2919
|
+
"load",
|
|
2920
|
+
"history",
|
|
2921
|
+
"relates-foreign",
|
|
2922
|
+
"derive",
|
|
2923
|
+
"derive-version",
|
|
2924
|
+
"same-line",
|
|
2925
|
+
"relation-cycle",
|
|
2926
|
+
"lib-rows",
|
|
2927
|
+
"since-ahead",
|
|
2928
|
+
"train-next",
|
|
2929
|
+
"pending-untested",
|
|
2930
|
+
"doc-unknown-id",
|
|
2931
|
+
"impl-imports-facts",
|
|
2932
|
+
"impl-reads-facts-dist",
|
|
2933
|
+
"impl-depends-on-facts",
|
|
2934
|
+
"builder",
|
|
2935
|
+
"subset-of",
|
|
2936
|
+
"ref",
|
|
2937
|
+
"schema-property",
|
|
2938
|
+
"policy-scope",
|
|
2939
|
+
"facts-name"
|
|
2940
|
+
]
|
|
2941
|
+
}
|
|
2730
2942
|
}
|
|
2731
2943
|
],
|
|
2732
2944
|
"tool": "fact-kit",
|
|
@@ -2954,6 +3166,67 @@
|
|
|
2954
3166
|
}
|
|
2955
3167
|
}
|
|
2956
3168
|
}
|
|
3169
|
+
},
|
|
3170
|
+
{
|
|
3171
|
+
"since": "next",
|
|
3172
|
+
"content": {
|
|
3173
|
+
"value": {
|
|
3174
|
+
"config": {
|
|
3175
|
+
"aggregate": {
|
|
3176
|
+
".": "<component package>",
|
|
3177
|
+
"<sub-path>": "<component package>"
|
|
3178
|
+
}
|
|
3179
|
+
},
|
|
3180
|
+
"componentPackage": {
|
|
3181
|
+
"name": "<publish name without @<org>/>-facts, e.g. `promptex-macos-facts`. When that is also the base of another component package or of the aggregate in the repository, every one of them adds `.<publish target>`, e.g. `fact-kit-facts.npm` and `fact-kit-facts.go`. `@<scope>/` is added to every one of these names when the access of the unit that publishes the aggregate package is restricted, whatever the access of the unit a component describes",
|
|
3182
|
+
"private": true,
|
|
3183
|
+
"dependedOnBy": "devDependencies of the aggregate, \"workspace:*\""
|
|
3184
|
+
},
|
|
3185
|
+
"placement": [
|
|
3186
|
+
{
|
|
3187
|
+
"component": "root, one entry",
|
|
3188
|
+
"dir": ".",
|
|
3189
|
+
"spec": "<aggregate>"
|
|
3190
|
+
},
|
|
3191
|
+
{
|
|
3192
|
+
"component": "root, several entries",
|
|
3193
|
+
"dir": "<entry>",
|
|
3194
|
+
"spec": "<aggregate>/<entry>",
|
|
3195
|
+
"conflict": "the entry has the name of another sub-path"
|
|
3196
|
+
},
|
|
3197
|
+
{
|
|
3198
|
+
"component": "sub-path, one entry",
|
|
3199
|
+
"dir": "<sub-path>",
|
|
3200
|
+
"spec": "<aggregate>/<sub-path>"
|
|
3201
|
+
},
|
|
3202
|
+
{
|
|
3203
|
+
"component": "sub-path, several entries",
|
|
3204
|
+
"dir": "<sub-path>/<entry>",
|
|
3205
|
+
"spec": "<aggregate>/<sub-path>/<entry>"
|
|
3206
|
+
}
|
|
3207
|
+
],
|
|
3208
|
+
"exports": [
|
|
3209
|
+
"./<dir>/index.json",
|
|
3210
|
+
"./<dir>/schemas/*",
|
|
3211
|
+
"./<sub-path>/examples.json (`./examples.json` for the root), for each component that built examples"
|
|
3212
|
+
],
|
|
3213
|
+
"rewrittenInIndex": {
|
|
3214
|
+
"package": "the aggregate package name",
|
|
3215
|
+
"entry": "the path of <dir>, `.` for the root",
|
|
3216
|
+
"component": "the component package name"
|
|
3217
|
+
},
|
|
3218
|
+
"rewrittenInFacts": "derivedFrom and movedTo that name a component package become the published spec",
|
|
3219
|
+
"examples": {
|
|
3220
|
+
"file": "examples.json",
|
|
3221
|
+
"dir": "<sub-path> (empty for the root), whatever number of entries the component has",
|
|
3222
|
+
"spec": "<aggregate>/<sub-path>, which is what `diff --impact` prints as `spec` of an example",
|
|
3223
|
+
"rewritten": {
|
|
3224
|
+
"package": "the aggregate package name"
|
|
3225
|
+
},
|
|
3226
|
+
"copied": "the groups as built by the component, unchanged"
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
2957
3230
|
}
|
|
2958
3231
|
],
|
|
2959
3232
|
"tool": "fact-kit",
|
|
@@ -3019,6 +3292,57 @@
|
|
|
3019
3292
|
}
|
|
3020
3293
|
}
|
|
3021
3294
|
},
|
|
3295
|
+
{
|
|
3296
|
+
"id": "fact-kit.facts-package-naming",
|
|
3297
|
+
"topics": [
|
|
3298
|
+
"check",
|
|
3299
|
+
"build",
|
|
3300
|
+
"config"
|
|
3301
|
+
],
|
|
3302
|
+
"title": {
|
|
3303
|
+
"en": "Names of the facts packages of an aggregate, checked against release-policy.json"
|
|
3304
|
+
},
|
|
3305
|
+
"description": {
|
|
3306
|
+
"en": "What `check` expects the package names of an aggregate and its component packages to be, and the two problem codes it reports. The names are `<base>`, with a publish target suffix when the base is shared and `@<scope>/` in front when the aggregate unit is restricted."
|
|
3307
|
+
},
|
|
3308
|
+
"when": {
|
|
3309
|
+
"since": "next"
|
|
3310
|
+
},
|
|
3311
|
+
"content": {
|
|
3312
|
+
"value": {
|
|
3313
|
+
"policy": {
|
|
3314
|
+
"file": "`release-policy.json` at `repoRoot`. A repository without it gets neither `policy-scope` nor `facts-name`.",
|
|
3315
|
+
"access": "`public` or `restricted`, at the top and, to override it, in a unit. `restricted` means the package is non-public once published.",
|
|
3316
|
+
"scope": "Top-level, such as `@carlos-space`. Required when the top or any unit is `restricted`, and `check` reports `policy-scope` when it is missing."
|
|
3317
|
+
},
|
|
3318
|
+
"checkedIn": "The aggregate package, the one whose config has `aggregate`. `check` reads its own name and every component package it can find: in node_modules under the aggregate, else in a directory that the `packages` patterns of `pnpm-workspace.yaml` at `repoRoot` match and whose package.json has that name. The sources are read from the `factsDir` of the component's own config. A component that is not found, whose facts do not load, or whose facts name no unit is not checked, and `check` prints a warning with code `facts-name` that says why, so the name is not skipped silently.",
|
|
3319
|
+
"aggregateUnit": "The `component` that `release-please-config.json` gives to the directory of the aggregate package, else the unit named like the aggregate package without its scope. When the policy `units` has neither, the access of the repository applies.",
|
|
3320
|
+
"base": {
|
|
3321
|
+
"aggregate": "<name without @<scope>/>, which must end in `-facts`: `<RepoName>-facts` in a product repository, `<SourceTypeName>-facts` in a facts repository.",
|
|
3322
|
+
"component": "<publish.name without @<org>/>-facts when the entry has `publish`, else <the one key of describes>-facts, else <the sub-path of the component in `aggregate`>-facts. The component at the root sub-path `.` that has none of the three gets a warning and is not checked."
|
|
3323
|
+
},
|
|
3324
|
+
"prefix": "`@<scope>/` on the aggregate and on every component when the access of the aggregate unit is `restricted`, and none when it is `public`. The access of the unit a component describes is not read, whether or not the policy lists that unit.",
|
|
3325
|
+
"suffix": "`.<publish.target>` on every component whose base name is also the base name of the aggregate or of another component, the npm one included. A shared base name with no publish target is reported, and the unit has to be renamed.",
|
|
3326
|
+
"examples": {
|
|
3327
|
+
"fact-kit (public)": [
|
|
3328
|
+
"fact-kit-facts",
|
|
3329
|
+
"fact-kit-facts.npm",
|
|
3330
|
+
"fact-kit-facts.pypi",
|
|
3331
|
+
"fact-kit-facts.go"
|
|
3332
|
+
],
|
|
3333
|
+
"restricted, scope @carlos-space": [
|
|
3334
|
+
"@carlos-space/demo-facts",
|
|
3335
|
+
"@carlos-space/demo-facts.npm",
|
|
3336
|
+
"@carlos-space/other-facts"
|
|
3337
|
+
]
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
},
|
|
3341
|
+
"tool": "fact-kit",
|
|
3342
|
+
"source": {
|
|
3343
|
+
"kind": "published"
|
|
3344
|
+
}
|
|
3345
|
+
},
|
|
3022
3346
|
{
|
|
3023
3347
|
"id": "fact-kit.read-facts",
|
|
3024
3348
|
"topics": [
|