@okfit/core 0.16.0 → 0.17.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/Diagnostic.js +8 -1
- package/GeneratedAtFuture.js +4 -6
- package/LintTable.js +292 -0
- package/OkfitConfig.js +213 -256
- package/Reference.js +65 -0
- package/RepoIdentity.js +46 -0
- package/index.d.ts +236 -50
- package/index.js +5 -2
- package/internal/linkScan.js +2 -2
- package/internal/lintRules.js +4 -2
- package/internal/position.js +2 -2
- package/package.json +8 -6
package/index.d.ts
CHANGED
|
@@ -313,11 +313,11 @@ export declare const ConformanceCode: Schema.Literals<readonly ["frontmatter-unc
|
|
|
313
313
|
/** @public */
|
|
314
314
|
export type ConformanceCode = typeof ConformanceCode.Type;
|
|
315
315
|
/** Severity from `OkfitConfig` (D-34). @public */
|
|
316
|
-
export declare const LintCode: Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "verified-before-change", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "config-okf-version-stale", "stale", "walk-unreadable", "read-changed", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked", "resource-outside-project", "superseded-by-orphan", "superseded-by-unresolved", "index-metadata-invalid", "entry-ignored", "value-malformed", "value-unknown", "frontmatter-missing", "type-missing", "symlink-escape", "non-concept-unlisted", "computation-missing", "generated-at-future"]>;
|
|
316
|
+
export declare const LintCode: Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "verified-before-change", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "config-okf-version-stale", "stale", "walk-unreadable", "read-changed", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked", "resource-outside-project", "superseded-by-orphan", "superseded-by-unresolved", "index-metadata-invalid", "entry-ignored", "value-malformed", "value-unknown", "frontmatter-missing", "type-missing", "symlink-escape", "non-concept-unlisted", "computation-missing", "generated-at-future", "reference-not-mounted", "reference-missing", "reference-undeclared", "reference-local-only", "config-misplaced-key", "config-local-tracked", "bundle-config-invalid"]>;
|
|
317
317
|
/** @public */
|
|
318
318
|
export type LintCode = typeof LintCode.Type;
|
|
319
319
|
/** @public */
|
|
320
|
-
export declare const DiagnosticCode: Schema.Union<readonly [Schema.Literals<readonly ["frontmatter-unclosed", "frontmatter-unparseable", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>, Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "verified-before-change", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "config-okf-version-stale", "stale", "walk-unreadable", "read-changed", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked", "resource-outside-project", "superseded-by-orphan", "superseded-by-unresolved", "index-metadata-invalid", "entry-ignored", "value-malformed", "value-unknown", "frontmatter-missing", "type-missing", "symlink-escape", "non-concept-unlisted", "computation-missing", "generated-at-future"]>]>;
|
|
320
|
+
export declare const DiagnosticCode: Schema.Union<readonly [Schema.Literals<readonly ["frontmatter-unclosed", "frontmatter-unparseable", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>, Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "verified-before-change", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "config-okf-version-stale", "stale", "walk-unreadable", "read-changed", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked", "resource-outside-project", "superseded-by-orphan", "superseded-by-unresolved", "index-metadata-invalid", "entry-ignored", "value-malformed", "value-unknown", "frontmatter-missing", "type-missing", "symlink-escape", "non-concept-unlisted", "computation-missing", "generated-at-future", "reference-not-mounted", "reference-missing", "reference-undeclared", "reference-local-only", "config-misplaced-key", "config-local-tracked", "bundle-config-invalid"]>]>;
|
|
321
321
|
/** @public */
|
|
322
322
|
export type DiagnosticCode = typeof DiagnosticCode.Type;
|
|
323
323
|
declare const DiagnosticRange_base: Schema.Class<DiagnosticRange, Schema.Struct<{
|
|
@@ -360,7 +360,7 @@ export declare class DiagnosticRange extends DiagnosticRange_base {
|
|
|
360
360
|
declare const Diagnostic_base: Schema.Class<Diagnostic, Schema.Struct<{
|
|
361
361
|
readonly file: Schema.String;
|
|
362
362
|
readonly range: Schema.optionalKey<typeof DiagnosticRange>;
|
|
363
|
-
readonly code: Schema.Union<readonly [Schema.Literals<readonly ["frontmatter-unclosed", "frontmatter-unparseable", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>, Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "verified-before-change", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "config-okf-version-stale", "stale", "walk-unreadable", "read-changed", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked", "resource-outside-project", "superseded-by-orphan", "superseded-by-unresolved", "index-metadata-invalid", "entry-ignored", "value-malformed", "value-unknown", "frontmatter-missing", "type-missing", "symlink-escape", "non-concept-unlisted", "computation-missing", "generated-at-future"]>]>;
|
|
363
|
+
readonly code: Schema.Union<readonly [Schema.Literals<readonly ["frontmatter-unclosed", "frontmatter-unparseable", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>, Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "verified-before-change", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "config-okf-version-stale", "stale", "walk-unreadable", "read-changed", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked", "resource-outside-project", "superseded-by-orphan", "superseded-by-unresolved", "index-metadata-invalid", "entry-ignored", "value-malformed", "value-unknown", "frontmatter-missing", "type-missing", "symlink-escape", "non-concept-unlisted", "computation-missing", "generated-at-future", "reference-not-mounted", "reference-missing", "reference-undeclared", "reference-local-only", "config-misplaced-key", "config-local-tracked", "bundle-config-invalid"]>]>;
|
|
364
364
|
readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
|
|
365
365
|
readonly message: Schema.String;
|
|
366
366
|
}>, {}>;
|
|
@@ -806,8 +806,8 @@ export declare class Derive {
|
|
|
806
806
|
*/
|
|
807
807
|
export declare const GENERATED_AT_TOLERANCE: Duration.Duration;
|
|
808
808
|
/**
|
|
809
|
-
* {@link GENERATED_AT_TOLERANCE} in words ("5 minutes"), for messages. Derived from the constant
|
|
810
|
-
* tolerance changes every message that names it.
|
|
809
|
+
* {@link GENERATED_AT_TOLERANCE} in words ("5 minutes"), for messages. Derived from the constant with
|
|
810
|
+
* `DurationWords.format`, so changing the tolerance changes every message that names it.
|
|
811
811
|
*
|
|
812
812
|
* @public
|
|
813
813
|
*/
|
|
@@ -955,50 +955,6 @@ export declare const LintLevel: Schema.Literals<readonly ["off", "info", "warn",
|
|
|
955
955
|
* @public
|
|
956
956
|
*/
|
|
957
957
|
export type LintLevel = typeof LintLevel.Type;
|
|
958
|
-
/**
|
|
959
|
-
* `lifecycle.default_stale_after` codec: `^(\d+)(h|d|w)$` or Effect's
|
|
960
|
-
* `"<n> <unit>"` form decodes to a `Duration` (D-30). Encoding emits the
|
|
961
|
-
* shortest exact `w`/`d`/`h` spelling, otherwise `"<n> millis"`.
|
|
962
|
-
*
|
|
963
|
-
* @remarks
|
|
964
|
-
* `@effected/toml` has no duration syntax and `Schema.DurationFromString`
|
|
965
|
-
* rejects `"90d"`, so this is core's own codec (effected-yaml-toml-config-file-app.md §2).
|
|
966
|
-
*
|
|
967
|
-
* @public
|
|
968
|
-
*/
|
|
969
|
-
export declare const StaleAfterDuration: Schema.Codec<Duration.Duration, string>;
|
|
970
|
-
/**
|
|
971
|
-
* A `types.<Name>.fields.<key>` declaration (spec 4.2): a description plus
|
|
972
|
-
* either an enum of values with descriptions or `kind = "path"`.
|
|
973
|
-
* @public
|
|
974
|
-
*/
|
|
975
|
-
export declare const FieldDeclaration: Schema.Struct<{
|
|
976
|
-
readonly description: Schema.String;
|
|
977
|
-
readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
978
|
-
readonly kind: Schema.optionalKey<Schema.Literal<"path">>;
|
|
979
|
-
}>;
|
|
980
|
-
/**
|
|
981
|
-
* A `types.<Name>` declaration (spec 4.2).
|
|
982
|
-
* @public
|
|
983
|
-
*/
|
|
984
|
-
export declare const TypeDeclaration: Schema.Struct<{
|
|
985
|
-
readonly description: Schema.optionalKey<Schema.String>;
|
|
986
|
-
readonly guidance: Schema.optionalKey<Schema.String>;
|
|
987
|
-
readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
988
|
-
readonly require_verified: Schema.optionalKey<Schema.Boolean>;
|
|
989
|
-
readonly fields: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
990
|
-
readonly description: Schema.String;
|
|
991
|
-
readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
992
|
-
readonly kind: Schema.optionalKey<Schema.Literal<"path">>;
|
|
993
|
-
}>>>;
|
|
994
|
-
}>;
|
|
995
|
-
/**
|
|
996
|
-
* A `tags.<name>` declaration (spec 4.2).
|
|
997
|
-
* @public
|
|
998
|
-
*/
|
|
999
|
-
export declare const TagDeclaration: Schema.Struct<{
|
|
1000
|
-
readonly description: Schema.optionalKey<Schema.String>;
|
|
1001
|
-
}>;
|
|
1002
958
|
/**
|
|
1003
959
|
* The `[lint]` table: one optional `LintLevel` per lint code, snake_case (D-34).
|
|
1004
960
|
* @public
|
|
@@ -1040,6 +996,13 @@ export declare const LintTable: Schema.Struct<{
|
|
|
1040
996
|
readonly generated_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1041
997
|
readonly computation_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1042
998
|
readonly generated_at_future: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
999
|
+
readonly reference_not_mounted: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1000
|
+
readonly reference_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1001
|
+
readonly reference_undeclared: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1002
|
+
readonly reference_local_only: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1003
|
+
readonly config_misplaced_key: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1004
|
+
readonly config_local_tracked: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1005
|
+
readonly bundle_config_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1043
1006
|
readonly publication_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1044
1007
|
readonly publication_orphan: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1045
1008
|
readonly surface_unmatched: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
@@ -1049,6 +1012,61 @@ export declare const LintTable: Schema.Struct<{
|
|
|
1049
1012
|
readonly value_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1050
1013
|
readonly non_concept_unlisted: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1051
1014
|
}>;
|
|
1015
|
+
/**
|
|
1016
|
+
* `lifecycle.default_stale_after` codec: `^(\d+)(h|d|w)$` or Effect's
|
|
1017
|
+
* `"<n> <unit>"` form decodes to a `Duration` (D-30). Encoding emits the
|
|
1018
|
+
* shortest exact `w`/`d`/`h` spelling, otherwise `"<n> millis"`.
|
|
1019
|
+
*
|
|
1020
|
+
* @remarks
|
|
1021
|
+
* `@effected/toml` has no duration syntax and `Schema.DurationFromString`
|
|
1022
|
+
* rejects `"90d"`, so this is core's own codec (effected-yaml-toml-config-file-app.md §2).
|
|
1023
|
+
*
|
|
1024
|
+
* @public
|
|
1025
|
+
*/
|
|
1026
|
+
export declare const StaleAfterDuration: Schema.Codec<Duration.Duration, string>;
|
|
1027
|
+
/**
|
|
1028
|
+
* A `types.<Name>.fields.<key>` declaration (spec 4.2): a description plus
|
|
1029
|
+
* either an enum of values with descriptions or `kind = "path"`.
|
|
1030
|
+
* @public
|
|
1031
|
+
*/
|
|
1032
|
+
export declare const FieldDeclaration: Schema.Struct<{
|
|
1033
|
+
readonly description: Schema.String;
|
|
1034
|
+
readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
1035
|
+
readonly kind: Schema.optionalKey<Schema.Literal<"path">>;
|
|
1036
|
+
}>;
|
|
1037
|
+
/**
|
|
1038
|
+
* A `types.<Name>` declaration (spec 4.2).
|
|
1039
|
+
* @public
|
|
1040
|
+
*/
|
|
1041
|
+
export declare const TypeDeclaration: Schema.Struct<{
|
|
1042
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
1043
|
+
readonly guidance: Schema.optionalKey<Schema.String>;
|
|
1044
|
+
readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1045
|
+
readonly require_verified: Schema.optionalKey<Schema.Boolean>;
|
|
1046
|
+
readonly fields: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
1047
|
+
readonly description: Schema.String;
|
|
1048
|
+
readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
1049
|
+
readonly kind: Schema.optionalKey<Schema.Literal<"path">>;
|
|
1050
|
+
}>>>;
|
|
1051
|
+
}>;
|
|
1052
|
+
/**
|
|
1053
|
+
* A `tags.<name>` declaration (spec 4.2).
|
|
1054
|
+
* @public
|
|
1055
|
+
*/
|
|
1056
|
+
export declare const TagDeclaration: Schema.Struct<{
|
|
1057
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
1058
|
+
}>;
|
|
1059
|
+
/**
|
|
1060
|
+
* What an agent may do with a bundle or checkout.
|
|
1061
|
+
*
|
|
1062
|
+
* @public
|
|
1063
|
+
*/
|
|
1064
|
+
export declare const Access: Schema.Literals<readonly ["read", "read-write"]>;
|
|
1065
|
+
/**
|
|
1066
|
+
* The type of `Access`.
|
|
1067
|
+
* @public
|
|
1068
|
+
*/
|
|
1069
|
+
export type Access = typeof Access.Type;
|
|
1052
1070
|
/**
|
|
1053
1071
|
* The `OkfitConfig` struct schema. Exported only so the `OkfitConfigFields`
|
|
1054
1072
|
* type below is reachable from the rollup; the barrel never re-exports this
|
|
@@ -1057,7 +1075,9 @@ export declare const LintTable: Schema.Struct<{
|
|
|
1057
1075
|
*/
|
|
1058
1076
|
declare const okfitConfigFields: Schema.Struct<{
|
|
1059
1077
|
readonly okf_version: Schema.optionalKey<Schema.String>;
|
|
1078
|
+
readonly repo: Schema.optionalKey<Schema.String>;
|
|
1060
1079
|
readonly bundle: Schema.optionalKey<Schema.Struct<{
|
|
1080
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
1061
1081
|
readonly path: Schema.optionalKey<Schema.String>;
|
|
1062
1082
|
readonly profile: Schema.optionalKey<Schema.String>;
|
|
1063
1083
|
readonly non_concepts: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
@@ -1112,6 +1132,13 @@ declare const okfitConfigFields: Schema.Struct<{
|
|
|
1112
1132
|
readonly generated_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1113
1133
|
readonly computation_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1114
1134
|
readonly generated_at_future: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1135
|
+
readonly reference_not_mounted: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1136
|
+
readonly reference_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1137
|
+
readonly reference_undeclared: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1138
|
+
readonly reference_local_only: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1139
|
+
readonly config_misplaced_key: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1140
|
+
readonly config_local_tracked: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1141
|
+
readonly bundle_config_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1115
1142
|
readonly publication_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1116
1143
|
readonly publication_orphan: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1117
1144
|
readonly surface_unmatched: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
@@ -1135,6 +1162,36 @@ declare const okfitConfigFields: Schema.Struct<{
|
|
|
1135
1162
|
readonly tags: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
1136
1163
|
readonly description: Schema.optionalKey<Schema.String>;
|
|
1137
1164
|
}>>>;
|
|
1165
|
+
readonly bundle_set: Schema.optionalKey<Schema.Struct<{
|
|
1166
|
+
readonly discover: Schema.$Array<Schema.String>;
|
|
1167
|
+
}>>;
|
|
1168
|
+
readonly bundles: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
1169
|
+
readonly path: Schema.String;
|
|
1170
|
+
readonly access: Schema.optionalKey<Schema.Literals<readonly ["read", "read-write"]>>;
|
|
1171
|
+
}>>>;
|
|
1172
|
+
readonly checkouts: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
1173
|
+
readonly repo: Schema.String;
|
|
1174
|
+
readonly path: Schema.String;
|
|
1175
|
+
readonly kind: Schema.optionalKey<Schema.Literals<readonly ["submodule", "clone", "path"]>>;
|
|
1176
|
+
readonly branch: Schema.optionalKey<Schema.String>;
|
|
1177
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
1178
|
+
readonly bundles: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1179
|
+
readonly access: Schema.optionalKey<Schema.Literals<readonly ["read", "read-write"]>>;
|
|
1180
|
+
readonly purpose: Schema.optionalKey<Schema.String>;
|
|
1181
|
+
readonly layout: Schema.optionalKey<Schema.String>;
|
|
1182
|
+
readonly start_here: Schema.optionalKey<Schema.String>;
|
|
1183
|
+
}>>>;
|
|
1184
|
+
readonly references: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
1185
|
+
readonly repo: Schema.String;
|
|
1186
|
+
readonly path: Schema.optionalKey<Schema.String>;
|
|
1187
|
+
}>>>;
|
|
1188
|
+
readonly contribute: Schema.optionalKey<Schema.Struct<{
|
|
1189
|
+
readonly flow: Schema.optionalKey<Schema.Literals<readonly ["pull-request", "push"]>>;
|
|
1190
|
+
readonly branch: Schema.optionalKey<Schema.String>;
|
|
1191
|
+
readonly merge: Schema.optionalKey<Schema.Literals<readonly ["auto-squash", "squash", "none"]>>;
|
|
1192
|
+
readonly signed: Schema.optionalKey<Schema.Boolean>;
|
|
1193
|
+
readonly needs_approval: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1194
|
+
}>>;
|
|
1138
1195
|
readonly extensions: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
1139
1196
|
}>;
|
|
1140
1197
|
/**
|
|
@@ -1182,11 +1239,43 @@ export declare const SCHEMA_DIRECTIVE: string;
|
|
|
1182
1239
|
*/
|
|
1183
1240
|
export declare const okfitConfigDocumentFields: Schema.StructWithRest<Schema.Struct<{
|
|
1184
1241
|
readonly okf_version: Schema.optionalKey<Schema.String>;
|
|
1242
|
+
readonly repo: Schema.optionalKey<Schema.String>;
|
|
1185
1243
|
readonly bundle: Schema.optionalKey<Schema.Struct<{
|
|
1244
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
1186
1245
|
readonly path: Schema.optionalKey<Schema.String>;
|
|
1187
1246
|
readonly profile: Schema.optionalKey<Schema.String>;
|
|
1188
1247
|
readonly non_concepts: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1189
1248
|
}>>;
|
|
1249
|
+
readonly bundle_set: Schema.optionalKey<Schema.Struct<{
|
|
1250
|
+
readonly discover: Schema.$Array<Schema.String>;
|
|
1251
|
+
}>>;
|
|
1252
|
+
readonly bundles: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
1253
|
+
readonly path: Schema.String;
|
|
1254
|
+
readonly access: Schema.optionalKey<Schema.Literals<readonly ["read", "read-write"]>>;
|
|
1255
|
+
}>>>;
|
|
1256
|
+
readonly checkouts: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
1257
|
+
readonly repo: Schema.String;
|
|
1258
|
+
readonly path: Schema.String;
|
|
1259
|
+
readonly kind: Schema.optionalKey<Schema.Literals<readonly ["submodule", "clone", "path"]>>;
|
|
1260
|
+
readonly branch: Schema.optionalKey<Schema.String>;
|
|
1261
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
1262
|
+
readonly bundles: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1263
|
+
readonly access: Schema.optionalKey<Schema.Literals<readonly ["read", "read-write"]>>;
|
|
1264
|
+
readonly purpose: Schema.optionalKey<Schema.String>;
|
|
1265
|
+
readonly layout: Schema.optionalKey<Schema.String>;
|
|
1266
|
+
readonly start_here: Schema.optionalKey<Schema.String>;
|
|
1267
|
+
}>>>;
|
|
1268
|
+
readonly references: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
1269
|
+
readonly repo: Schema.String;
|
|
1270
|
+
readonly path: Schema.optionalKey<Schema.String>;
|
|
1271
|
+
}>>>;
|
|
1272
|
+
readonly contribute: Schema.optionalKey<Schema.Struct<{
|
|
1273
|
+
readonly flow: Schema.optionalKey<Schema.Literals<readonly ["pull-request", "push"]>>;
|
|
1274
|
+
readonly branch: Schema.optionalKey<Schema.String>;
|
|
1275
|
+
readonly merge: Schema.optionalKey<Schema.Literals<readonly ["auto-squash", "squash", "none"]>>;
|
|
1276
|
+
readonly signed: Schema.optionalKey<Schema.Boolean>;
|
|
1277
|
+
readonly needs_approval: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1278
|
+
}>>;
|
|
1190
1279
|
readonly concepts: Schema.optionalKey<Schema.Struct<{
|
|
1191
1280
|
readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1192
1281
|
readonly tags: Schema.optionalKey<Schema.Struct<{
|
|
@@ -1237,6 +1326,13 @@ export declare const okfitConfigDocumentFields: Schema.StructWithRest<Schema.Str
|
|
|
1237
1326
|
readonly generated_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1238
1327
|
readonly computation_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1239
1328
|
readonly generated_at_future: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1329
|
+
readonly reference_not_mounted: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1330
|
+
readonly reference_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1331
|
+
readonly reference_undeclared: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1332
|
+
readonly reference_local_only: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1333
|
+
readonly config_misplaced_key: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1334
|
+
readonly config_local_tracked: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1335
|
+
readonly bundle_config_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1240
1336
|
readonly publication_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1241
1337
|
readonly publication_orphan: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
1242
1338
|
readonly surface_unmatched: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
@@ -1295,7 +1391,9 @@ export declare const OkfitConfig: Schema.Codec<OkfitConfig, Record<string, unkno
|
|
|
1295
1391
|
};
|
|
1296
1392
|
declare const OkfitConfigFile_base: import("effect/Context").ServiceClass<OkfitConfigFile, "@okfit/core/OkfitConfigFile", import("@effected/config-file").ConfigFileShape<{
|
|
1297
1393
|
readonly okf_version?: string;
|
|
1394
|
+
readonly repo?: string;
|
|
1298
1395
|
readonly bundle?: {
|
|
1396
|
+
readonly name?: string;
|
|
1299
1397
|
readonly path?: string;
|
|
1300
1398
|
readonly profile?: string;
|
|
1301
1399
|
readonly non_concepts?: readonly string[];
|
|
@@ -1350,6 +1448,13 @@ declare const OkfitConfigFile_base: import("effect/Context").ServiceClass<OkfitC
|
|
|
1350
1448
|
readonly generated_missing?: "error" | "info" | "off" | "warn";
|
|
1351
1449
|
readonly computation_missing?: "error" | "info" | "off" | "warn";
|
|
1352
1450
|
readonly generated_at_future?: "error" | "info" | "off" | "warn";
|
|
1451
|
+
readonly reference_not_mounted?: "error" | "info" | "off" | "warn";
|
|
1452
|
+
readonly reference_missing?: "error" | "info" | "off" | "warn";
|
|
1453
|
+
readonly reference_undeclared?: "error" | "info" | "off" | "warn";
|
|
1454
|
+
readonly reference_local_only?: "error" | "info" | "off" | "warn";
|
|
1455
|
+
readonly config_misplaced_key?: "error" | "info" | "off" | "warn";
|
|
1456
|
+
readonly config_local_tracked?: "error" | "info" | "off" | "warn";
|
|
1457
|
+
readonly bundle_config_invalid?: "error" | "info" | "off" | "warn";
|
|
1353
1458
|
readonly publication_drift?: "error" | "info" | "off" | "warn";
|
|
1354
1459
|
readonly publication_orphan?: "error" | "info" | "off" | "warn";
|
|
1355
1460
|
readonly surface_unmatched?: "error" | "info" | "off" | "warn";
|
|
@@ -1381,6 +1486,42 @@ declare const OkfitConfigFile_base: import("effect/Context").ServiceClass<OkfitC
|
|
|
1381
1486
|
readonly description?: string;
|
|
1382
1487
|
};
|
|
1383
1488
|
};
|
|
1489
|
+
readonly bundle_set?: {
|
|
1490
|
+
readonly discover: readonly string[];
|
|
1491
|
+
};
|
|
1492
|
+
readonly bundles?: {
|
|
1493
|
+
readonly [x: string]: {
|
|
1494
|
+
readonly path: string;
|
|
1495
|
+
readonly access?: "read" | "read-write";
|
|
1496
|
+
};
|
|
1497
|
+
};
|
|
1498
|
+
readonly checkouts?: {
|
|
1499
|
+
readonly [x: string]: {
|
|
1500
|
+
readonly repo: string;
|
|
1501
|
+
readonly path: string;
|
|
1502
|
+
readonly kind?: "clone" | "path" | "submodule";
|
|
1503
|
+
readonly branch?: string;
|
|
1504
|
+
readonly url?: string;
|
|
1505
|
+
readonly bundles?: readonly string[];
|
|
1506
|
+
readonly access?: "read" | "read-write";
|
|
1507
|
+
readonly purpose?: string;
|
|
1508
|
+
readonly layout?: string;
|
|
1509
|
+
readonly start_here?: string;
|
|
1510
|
+
};
|
|
1511
|
+
};
|
|
1512
|
+
readonly references?: {
|
|
1513
|
+
readonly [x: string]: {
|
|
1514
|
+
readonly repo: string;
|
|
1515
|
+
readonly path?: string;
|
|
1516
|
+
};
|
|
1517
|
+
};
|
|
1518
|
+
readonly contribute?: {
|
|
1519
|
+
readonly flow?: "pull-request" | "push";
|
|
1520
|
+
readonly branch?: string;
|
|
1521
|
+
readonly merge?: "auto-squash" | "none" | "squash";
|
|
1522
|
+
readonly signed?: boolean;
|
|
1523
|
+
readonly needs_approval?: readonly string[];
|
|
1524
|
+
};
|
|
1384
1525
|
readonly extensions: {
|
|
1385
1526
|
readonly [x: string]: unknown;
|
|
1386
1527
|
};
|
|
@@ -1424,6 +1565,51 @@ export declare class OkfVersion {
|
|
|
1424
1565
|
/** Whether the v0.2 fallbacks apply to this bundle: `allowsLegacyFallbacks(declared(bundle))`. */
|
|
1425
1566
|
static readonly legacyFallbacks: (bundle: LoadedBundle) => boolean;
|
|
1426
1567
|
}
|
|
1568
|
+
/** A parsed named reference: the declared reference name and the path inside its root. @public */
|
|
1569
|
+
interface NamedReference {
|
|
1570
|
+
readonly name: string;
|
|
1571
|
+
readonly path: string;
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* Named-reference parsing: `name:path` where `name` is a declared reference root.
|
|
1575
|
+
* URL schemes are reserved so a link such as `https://x.dev` is never read as a reference. @public
|
|
1576
|
+
*/
|
|
1577
|
+
export declare class Reference {
|
|
1578
|
+
private constructor();
|
|
1579
|
+
/** URL schemes a reference name may not take. */
|
|
1580
|
+
static readonly RESERVED_SCHEMES: ReadonlySet<string>;
|
|
1581
|
+
/**
|
|
1582
|
+
* The shape of a valid name, as a Unicode-mode RegExp so a JSON Schema `pattern` can be derived from it.
|
|
1583
|
+
* The reserved schemes are excluded separately, by {@link Reference.isValidName}.
|
|
1584
|
+
*/
|
|
1585
|
+
static readonly NAME_PATTERN: RegExp;
|
|
1586
|
+
/** Lower-case letter first, then letters, digits or hyphens, two to 32 characters, not reserved; two characters minimum so a drive letter is never a name. */
|
|
1587
|
+
static readonly isValidName: (name: string) => boolean;
|
|
1588
|
+
/** `Some` only when the text before the first `:` is a declared name and the rest does not start with `//`. */
|
|
1589
|
+
static readonly parse: (value: string, names: ReadonlySet<string>) => Option.Option<NamedReference>;
|
|
1590
|
+
}
|
|
1591
|
+
/**
|
|
1592
|
+
* Canonical repository identity: `host/owner/name`, lower-case, with no `.git` suffix and no trailing slash.
|
|
1593
|
+
* Accepts `owner/name` shorthand (GitHub), URL remotes (user, port and `[::1]` hosts allowed), and scp-like
|
|
1594
|
+
* `git@host:owner/name` remotes. Pure string work with no `node:` imports. @public
|
|
1595
|
+
*
|
|
1596
|
+
* @remarks
|
|
1597
|
+
* The address is read by `GitRemote.parseIdentity` from `@effected/git` (URL, scp or path form, as git reads it, so
|
|
1598
|
+
* an IPv6 literal and the scp-versus-path ambiguity are decided there) with `defaultHost: "github.com"`,
|
|
1599
|
+
* `foldCase: "always"`, `minSegments: 2` and `strict: true`: a scheme-less path is exactly `owner/name` shorthand or
|
|
1600
|
+
* `host/owner/name`, and the path needs at least two segments after the host. okfit's own rule is the pre-check: a value
|
|
1601
|
+
* carrying whitespace, `?` or `#` does not normalise, and a run of trailing slashes is collapsed to one before the kit
|
|
1602
|
+
* reads it (`strict` takes one on a URL, scp or scheme-less `host/owner/name/` address, and the shorthand `owner/name/` has no identity). Under `strict` an empty, bare `.git` or doubled-`.git` name has no
|
|
1603
|
+
* identity either. An owner containing a dot is not shorthand (`my.group/proj`), because the kit reads a first segment
|
|
1604
|
+
* holding a dot as a host; it needs its host spelled out, as in `gitlab.com/my.group/proj`.
|
|
1605
|
+
*/
|
|
1606
|
+
export declare class RepoIdentity {
|
|
1607
|
+
private constructor();
|
|
1608
|
+
/** The canonical identity of a repository reference, or `None` when it does not normalise. */
|
|
1609
|
+
static readonly normalize: (value: string) => Option.Option<string>;
|
|
1610
|
+
/** True when both values normalize and the identities match. */
|
|
1611
|
+
static readonly equals: (a: string, b: string) => boolean;
|
|
1612
|
+
}
|
|
1427
1613
|
/**
|
|
1428
1614
|
* A decoded OKF timestamp: always a UTC instant.
|
|
1429
1615
|
* @public
|
|
@@ -1464,5 +1650,5 @@ export declare class Validate {
|
|
|
1464
1650
|
* @public
|
|
1465
1651
|
*/
|
|
1466
1652
|
export declare const OKF_SPEC_VERSION: "0.3";
|
|
1467
|
-
export type { ActorForm, BundleLoadError, BundleLoadOptions, EntryFamily, FallbackRule, GraphEdge, GraphLink, GraphNode, LinkResolution, LogEntry, MalformedStaleAfter, OkfVersionNumber, OkfitConfigFields, PathField, RenderIndexOptions, StaleConcept, ValidateOptions, ValidationReport };
|
|
1653
|
+
export type { ActorForm, BundleLoadError, BundleLoadOptions, EntryFamily, FallbackRule, GraphEdge, GraphLink, GraphNode, LinkResolution, LogEntry, MalformedStaleAfter, NamedReference, OkfVersionNumber, OkfitConfigFields, PathField, RenderIndexOptions, StaleConcept, ValidateOptions, ValidationReport };
|
|
1468
1654
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -12,9 +12,12 @@ import { Graph, GraphNodeKind, LinkGraph } from "./Graph.js";
|
|
|
12
12
|
import { IndexDocument, IndexEntry, IndexSection } from "./IndexDocument.js";
|
|
13
13
|
import { Digest, INTEGRITY_KEY, Integrity, IntegrityGenerated, IntegrityVerified, OKFIT_KEY_PREFIX } from "./Integrity.js";
|
|
14
14
|
import { LogDocument, LogGroup, LogItem } from "./LogDocument.js";
|
|
15
|
-
import { CONFIG_SCHEMA_VERSION, FieldDeclaration,
|
|
15
|
+
import { Access, CONFIG_SCHEMA_VERSION, FieldDeclaration, OkfitConfig, OkfitConfigFile, SCHEMA_DIRECTIVE, StaleAfterDuration, TagDeclaration, TypeDeclaration, okfitConfigDocumentFields, okfitConfigSchemaHost } from "./OkfitConfig.js";
|
|
16
16
|
import { OkfVersion } from "./OkfVersion.js";
|
|
17
|
+
import { Reference } from "./Reference.js";
|
|
18
|
+
import { RepoIdentity } from "./RepoIdentity.js";
|
|
17
19
|
import { Source, UsageWindow } from "./Source.js";
|
|
20
|
+
import { LintLevel, LintTable } from "./LintTable.js";
|
|
18
21
|
import { DerivedStatus, Status } from "./Status.js";
|
|
19
22
|
import { Timestamp } from "./Timestamp.js";
|
|
20
23
|
import { Validate } from "./Validate.js";
|
|
@@ -28,4 +31,4 @@ import { Verification } from "./Verification.js";
|
|
|
28
31
|
*/
|
|
29
32
|
const OKF_SPEC_VERSION = "0.3";
|
|
30
33
|
|
|
31
|
-
export { ATTESTED_COMPUTATION_TYPE, Actor, ActorPattern, AttestedComputation, Bundle, BundleDepthExceededError, BundleReadError, BundleRootNotFoundError, CONFIG_SCHEMA_VERSION, ComputationAttester, ComputationExecutor, ComputationParameter, Concept, ConceptId, ConfinementError, ConformanceCode, Derive, DerivedStatus, Diagnostic, DiagnosticCode, DiagnosticRange, DiagnosticSeverity, Digest, EntryPaths, FieldDeclaration, GENERATED_AT_TOLERANCE, GENERATED_AT_TOLERANCE_TEXT, Generated, Graph, GraphNodeKind, INTEGRITY_KEY, IndexDocument, IndexEntry, IndexSection, Integrity, IntegrityGenerated, IntegrityVerified, LinkGraph, LintCode, LintLevel, LintTable, LoadedBundle, LoadedConcept, LogDocument, LogGroup, LogItem, OKFIT_KEY_PREFIX, OKF_SPEC_VERSION, OkfVersion, OkfitConfig, OkfitConfigFile, SCHEMA_DIRECTIVE, Source, StaleAfterDuration, Staleness, Status, TagDeclaration, Timestamp, TrustTier, TypeDeclaration, UsageWindow, Validate, Verification, changedWhileRead, generatedAtIsFuture, okfitConfigDocumentFields, okfitConfigSchemaHost, readConfinedBytes, readConfinedString, verificationBlockingRestamp };
|
|
34
|
+
export { ATTESTED_COMPUTATION_TYPE, Access, Actor, ActorPattern, AttestedComputation, Bundle, BundleDepthExceededError, BundleReadError, BundleRootNotFoundError, CONFIG_SCHEMA_VERSION, ComputationAttester, ComputationExecutor, ComputationParameter, Concept, ConceptId, ConfinementError, ConformanceCode, Derive, DerivedStatus, Diagnostic, DiagnosticCode, DiagnosticRange, DiagnosticSeverity, Digest, EntryPaths, FieldDeclaration, GENERATED_AT_TOLERANCE, GENERATED_AT_TOLERANCE_TEXT, Generated, Graph, GraphNodeKind, INTEGRITY_KEY, IndexDocument, IndexEntry, IndexSection, Integrity, IntegrityGenerated, IntegrityVerified, LinkGraph, LintCode, LintLevel, LintTable, LoadedBundle, LoadedConcept, LogDocument, LogGroup, LogItem, OKFIT_KEY_PREFIX, OKF_SPEC_VERSION, OkfVersion, OkfitConfig, OkfitConfigFile, Reference, RepoIdentity, SCHEMA_DIRECTIVE, Source, StaleAfterDuration, Staleness, Status, TagDeclaration, Timestamp, TrustTier, TypeDeclaration, UsageWindow, Validate, Verification, changedWhileRead, generatedAtIsFuture, okfitConfigDocumentFields, okfitConfigSchemaHost, readConfinedBytes, readConfinedString, verificationBlockingRestamp };
|
package/internal/linkScan.js
CHANGED
|
@@ -41,11 +41,11 @@ const scanLinks = (root, links, options) => Effect.gen(function* () {
|
|
|
41
41
|
});
|
|
42
42
|
continue;
|
|
43
43
|
}
|
|
44
|
-
const reason = yield* confineReal(root, path.join(root, link.path)).pipe(Effect.match({
|
|
44
|
+
const reason = yield* confineReal(root, path.join(root, link.path), { allowBase: true }).pipe(Effect.match({
|
|
45
45
|
onFailure: (error) => error.reason,
|
|
46
46
|
onSuccess: () => void 0
|
|
47
47
|
}));
|
|
48
|
-
if (reason === void 0
|
|
48
|
+
if (reason === void 0) continue;
|
|
49
49
|
directories.push({
|
|
50
50
|
file: link.path,
|
|
51
51
|
message: `symbolic link to a directory ${reason === "outside" ? RESOLVES_OUTSIDE : COULD_NOT_RESOLVE}; nothing under it is read or part of the bundle`
|
package/internal/lintRules.js
CHANGED
|
@@ -85,8 +85,10 @@ const requiredKeyMissing = perConcept("required-key-missing", (concept, context)
|
|
|
85
85
|
path: [key]
|
|
86
86
|
}));
|
|
87
87
|
});
|
|
88
|
+
/** The declaration of concept type `type`, an own entry of `types` only (a type named `constructor` is not `Object`). */
|
|
89
|
+
const typeSpec = (config, type) => config.types !== void 0 && Object.hasOwn(config.types, type) ? config.types[type] : void 0;
|
|
88
90
|
const fieldValueUnknown = perConcept("field-value-unknown", (concept, context) => {
|
|
89
|
-
const fields = context.config
|
|
91
|
+
const fields = typeSpec(context.config, concept.frontmatter.type)?.fields ?? {};
|
|
90
92
|
const out = [];
|
|
91
93
|
for (const [key, declaration] of Object.entries(fields)) {
|
|
92
94
|
if (declaration.values === void 0 || !present(concept.frontmatter.raw, key)) continue;
|
|
@@ -98,7 +100,7 @@ const fieldValueUnknown = perConcept("field-value-unknown", (concept, context) =
|
|
|
98
100
|
}
|
|
99
101
|
return out;
|
|
100
102
|
});
|
|
101
|
-
const requireVerifiedUnmet = perConcept("require-verified-unmet", (concept, context) => context.config
|
|
103
|
+
const requireVerifiedUnmet = perConcept("require-verified-unmet", (concept, context) => typeSpec(context.config, concept.frontmatter.type)?.require_verified === true && concept.frontmatter.status !== "draft" && (concept.frontmatter.verified ?? []).length === 0 ? [{
|
|
102
104
|
message: Derive.status(concept.frontmatter) === "unknown" ? `Type "${concept.frontmatter.type}" requires a verified entry; status "${Derive.rawStatus(concept.frontmatter)}" is not draft, stable or deprecated, so set it first or verify with okfit verify --stable or --draft` : `Type "${concept.frontmatter.type}" requires a verified entry`,
|
|
103
105
|
path: ["status"]
|
|
104
106
|
}] : []);
|
package/internal/position.js
CHANGED
|
@@ -3,10 +3,10 @@ import { FrontmatterSource } from "@effected/markdown";
|
|
|
3
3
|
// src/internal/position.ts
|
|
4
4
|
/**
|
|
5
5
|
* Map a `YamlDiagnostic.offset` or `YamlNode.offset` inside the frontmatter value to a whole-file
|
|
6
|
-
* offset. Only meaningful when `text` opens a closed frontmatter block.
|
|
6
|
+
* offset. Only meaningful when `text` opens a closed frontmatter block; a leading BOM is stepped over and counted.
|
|
7
7
|
*
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
|
-
const toFileOffset = (text, yamlOffset) => (FrontmatterSource.split(text).frontmatter?.valueStart ?? 0) + yamlOffset;
|
|
10
|
+
const toFileOffset = (text, yamlOffset) => (FrontmatterSource.split(text, { bom: "skip" }).frontmatter?.valueStart ?? 0) + yamlOffset;
|
|
11
11
|
|
|
12
12
|
export { toFileOffset };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okfit/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Spec-level Open Knowledge Format (OKF) v0.3 schemas, bundle loading, graph, derivation, and validation for Effect.",
|
|
6
6
|
"keywords": [
|
|
@@ -37,14 +37,16 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@effected/config-file": "^0.
|
|
40
|
+
"@effected/config-file": "^0.34.0",
|
|
41
|
+
"@effected/git": "^0.36.0",
|
|
41
42
|
"@effected/glob": "^0.23.0",
|
|
42
43
|
"@effected/jsonc": "^0.25.0",
|
|
43
|
-
"@effected/
|
|
44
|
-
"@effected/
|
|
44
|
+
"@effected/kit": "^0.15.0",
|
|
45
|
+
"@effected/markdown": "^0.34.0",
|
|
46
|
+
"@effected/schemastore": "^0.35.0",
|
|
45
47
|
"@effected/source": "^0.5.0",
|
|
46
|
-
"@effected/toml": "^0.
|
|
47
|
-
"@effected/walker": "^0.
|
|
48
|
+
"@effected/toml": "^0.21.0",
|
|
49
|
+
"@effected/walker": "^0.33.0",
|
|
48
50
|
"@effected/yaml": "^0.31.0",
|
|
49
51
|
"effect": "~4.1.0"
|
|
50
52
|
},
|