@featurevisor/core 4.3.0 → 4.5.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/lib/cli/cli.d.ts +2 -1
- package/lib/cli/cli.js +9 -6
- package/lib/cli/cli.js.map +1 -1
- package/lib/cli/options.js +69 -0
- package/lib/cli/options.js.map +1 -1
- package/lib/cli/plugins.js +7 -1
- package/lib/cli/plugins.js.map +1 -1
- package/lib/config/projectConfig.d.ts +10 -0
- package/lib/config/projectConfig.js +14 -0
- package/lib/config/projectConfig.js.map +1 -1
- package/lib/convert/check.d.ts +33 -0
- package/lib/convert/check.js +411 -0
- package/lib/convert/check.js.map +1 -0
- package/lib/convert/config.d.ts +20 -0
- package/lib/convert/config.js +147 -0
- package/lib/convert/config.js.map +1 -0
- package/lib/convert/documents.d.ts +40 -0
- package/lib/convert/documents.js +154 -0
- package/lib/convert/documents.js.map +1 -0
- package/lib/convert/index.d.ts +7 -0
- package/lib/convert/index.js +47 -0
- package/lib/convert/index.js.map +1 -0
- package/lib/convert/plan.d.ts +53 -0
- package/lib/convert/plan.js +669 -0
- package/lib/convert/plan.js.map +1 -0
- package/lib/convert/project.d.ts +29 -0
- package/lib/convert/project.js +109 -0
- package/lib/convert/project.js.map +1 -0
- package/lib/convert/run.d.ts +3 -0
- package/lib/convert/run.js +241 -0
- package/lib/convert/run.js.map +1 -0
- package/lib/convert/tests.d.ts +22 -0
- package/lib/convert/tests.js +267 -0
- package/lib/convert/tests.js.map +1 -0
- package/lib/datasource/conditionLocations.d.ts +9 -0
- package/lib/datasource/conditionLocations.js +70 -0
- package/lib/datasource/conditionLocations.js.map +1 -0
- package/lib/datasource/datasource.d.ts +11 -0
- package/lib/datasource/datasource.js +26 -6
- package/lib/datasource/datasource.js.map +1 -1
- package/lib/datasource/expressions.d.ts +36 -0
- package/lib/datasource/expressions.js +118 -0
- package/lib/datasource/expressions.js.map +1 -0
- package/lib/datasource/parseError.d.ts +11 -0
- package/lib/datasource/parseError.js +33 -19
- package/lib/datasource/parseError.js.map +1 -1
- package/lib/diff/conditions.d.ts +23 -0
- package/lib/diff/conditions.js +86 -0
- package/lib/diff/conditions.js.map +1 -0
- package/lib/diff/details.d.ts +7 -1
- package/lib/diff/details.js +54 -25
- package/lib/diff/details.js.map +1 -1
- package/lib/diff/index.d.ts +5 -0
- package/lib/diff/index.js +17 -2
- package/lib/diff/index.js.map +1 -1
- package/lib/evaluate/explain.d.ts +4 -1
- package/lib/evaluate/explain.js +35 -14
- package/lib/evaluate/explain.js.map +1 -1
- package/lib/evaluate/index.js +9 -5
- package/lib/evaluate/index.js.map +1 -1
- package/lib/formatter/expressions.d.ts +21 -0
- package/lib/formatter/expressions.js +79 -0
- package/lib/formatter/expressions.js.map +1 -0
- package/lib/formatter/formatDefinition.d.ts +46 -0
- package/lib/formatter/formatDefinition.js +201 -0
- package/lib/formatter/formatDefinition.js.map +1 -0
- package/lib/formatter/formatProject.d.ts +70 -0
- package/lib/formatter/formatProject.js +186 -0
- package/lib/formatter/formatProject.js.map +1 -0
- package/lib/formatter/index.d.ts +6 -0
- package/lib/formatter/index.js +53 -0
- package/lib/formatter/index.js.map +1 -0
- package/lib/formatter/layout.d.ts +26 -0
- package/lib/formatter/layout.js +175 -0
- package/lib/formatter/layout.js.map +1 -0
- package/lib/formatter/printFormatResult.d.ts +9 -0
- package/lib/formatter/printFormatResult.js +100 -0
- package/lib/formatter/printFormatResult.js.map +1 -0
- package/lib/formatter/run.d.ts +6 -0
- package/lib/formatter/run.js +97 -0
- package/lib/formatter/run.js.map +1 -0
- package/lib/formatter/simplify.d.ts +14 -0
- package/lib/formatter/simplify.js +21 -0
- package/lib/formatter/simplify.js.map +1 -0
- package/lib/formatter/since.d.ts +6 -0
- package/lib/formatter/since.js +80 -0
- package/lib/formatter/since.js.map +1 -0
- package/lib/formatter/style.d.ts +105 -0
- package/lib/formatter/style.js +248 -0
- package/lib/formatter/style.js.map +1 -0
- package/lib/linter/conditionKinds.js +2 -54
- package/lib/linter/conditionKinds.js.map +1 -1
- package/lib/linter/conditionSchema.js +42 -13
- package/lib/linter/conditionSchema.js.map +1 -1
- package/lib/linter/diagnostics.d.ts +14 -14
- package/lib/linter/expressionDiagnostics.d.ts +28 -0
- package/lib/linter/expressionDiagnostics.js +127 -0
- package/lib/linter/expressionDiagnostics.js.map +1 -0
- package/lib/linter/featureSchema.d.ts +2 -2
- package/lib/linter/featureSchema.js +14 -13
- package/lib/linter/featureSchema.js.map +1 -1
- package/lib/linter/lintProject.d.ts +7 -0
- package/lib/linter/lintProject.js +300 -52
- package/lib/linter/lintProject.js.map +1 -1
- package/lib/linter/listTypes.d.ts +7 -0
- package/lib/linter/listTypes.js +19 -0
- package/lib/linter/listTypes.js.map +1 -0
- package/lib/linter/printError.d.ts +2 -0
- package/lib/linter/printError.js +1 -0
- package/lib/linter/printError.js.map +1 -1
- package/lib/linter/requiredVariablesSchema.js +129 -13
- package/lib/linter/requiredVariablesSchema.js.map +1 -1
- package/lib/migrate/definitions.d.ts +46 -0
- package/lib/migrate/definitions.js +488 -0
- package/lib/migrate/definitions.js.map +1 -0
- package/lib/migrate/index.d.ts +6 -0
- package/lib/migrate/index.js +30 -0
- package/lib/migrate/index.js.map +1 -0
- package/lib/migrate/migrateProject.d.ts +33 -0
- package/lib/migrate/migrateProject.js +195 -0
- package/lib/migrate/migrateProject.js.map +1 -0
- package/lib/migrate/project.d.ts +31 -0
- package/lib/migrate/project.js +153 -0
- package/lib/migrate/project.js.map +1 -0
- package/lib/migrate/run.d.ts +3 -0
- package/lib/migrate/run.js +81 -0
- package/lib/migrate/run.js.map +1 -0
- package/lib/migrate/write.d.ts +10 -0
- package/lib/migrate/write.js +150 -0
- package/lib/migrate/write.js.map +1 -0
- package/lib/promoter/index.js +85 -4
- package/lib/promoter/index.js.map +1 -1
- package/lib/rewrite/conditions.d.ts +73 -0
- package/lib/rewrite/conditions.js +485 -0
- package/lib/rewrite/conditions.js.map +1 -0
- package/lib/rewrite/diff.d.ts +2 -0
- package/lib/rewrite/diff.js +76 -0
- package/lib/rewrite/diff.js.map +1 -0
- package/lib/rewrite/documents.d.ts +25 -0
- package/lib/rewrite/documents.js +54 -0
- package/lib/rewrite/documents.js.map +1 -0
- package/lib/rewrite/files.d.ts +6 -0
- package/lib/rewrite/files.js +66 -0
- package/lib/rewrite/files.js.map +1 -0
- package/lib/rewrite/lines.d.ts +56 -0
- package/lib/rewrite/lines.js +205 -0
- package/lib/rewrite/lines.js.map +1 -0
- package/package.json +5 -4
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type ExpressionOptions } from "@featurevisor/expressions";
|
|
2
|
+
import type { Document } from "yaml";
|
|
3
|
+
import { type ConditionPath } from "../datasource/conditionLocations";
|
|
4
|
+
/**
|
|
5
|
+
* Writes a definition's conditions another way, editing its YAML document so every other line
|
|
6
|
+
* stays as written. convert writes them as expressions or as trees, building exactly the same
|
|
7
|
+
* trees, key order included, so datafiles stay byte identical: a tree becomes an expression
|
|
8
|
+
* only where the expression reads back to that tree, and an expression becomes the tree it
|
|
9
|
+
* builds. fmt's --simplify writes each condition in its simplest form that evaluates the same,
|
|
10
|
+
* which may change a datafile's shape but never what it evaluates to. Comment lines move with
|
|
11
|
+
* the condition they sit above.
|
|
12
|
+
*/
|
|
13
|
+
export type ConditionKind = "feature" | "segment" | "variable";
|
|
14
|
+
export declare const CONDITION_KINDS: string[];
|
|
15
|
+
/** What writing a definition's conditions another way did */
|
|
16
|
+
export interface ConditionsResult {
|
|
17
|
+
/** Trees or expressions written the other way */
|
|
18
|
+
changed: number;
|
|
19
|
+
/** Paths of leaves that stay trees, having no expression form */
|
|
20
|
+
kept: ConditionPath[];
|
|
21
|
+
/** Expressions with errors, which have no tree to write */
|
|
22
|
+
invalid: ConditionPath[];
|
|
23
|
+
/** Expressions kept as written with the ignore comment, written as trees all the same */
|
|
24
|
+
unmarked: ConditionPath[];
|
|
25
|
+
/** Comment lines moved from the YAML into expressions, trimmed as parsers list them */
|
|
26
|
+
moved: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Writes each condition tree in a definition as an expression, wherever the expression reads
|
|
30
|
+
* back to exactly the tree. The comments inside a tree move above the condition they sat
|
|
31
|
+
* beside. `# featurevisor-ignore-line` keeps a value as written, with everything below it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function writeTreesAsExpressions(doc: Document, kind: ConditionKind, definition: unknown, options: ExpressionOptions, { joinOnly }?: {
|
|
34
|
+
joinOnly?: boolean;
|
|
35
|
+
}): ConditionsResult;
|
|
36
|
+
/**
|
|
37
|
+
* A `conditions` value in the simplest form that evaluates the same, as `simplifyConditions`
|
|
38
|
+
* writes it, apart from joining expressions: an `and` or `or` of one condition is that
|
|
39
|
+
* condition, and a whole value's list of one condition, or its `and` group, is that condition
|
|
40
|
+
* or the list it holds. Conditions that evaluate the same compare equal in this form.
|
|
41
|
+
*/
|
|
42
|
+
export declare function simplestConditions(value: unknown, root?: boolean): unknown;
|
|
43
|
+
/**
|
|
44
|
+
* A `conditions` value written as expressions wherever an expression reads back to exactly the
|
|
45
|
+
* tree, as `convert --to=expressions --exact` writes it: the whole value when it can be one
|
|
46
|
+
* expression, otherwise each list item and group child.
|
|
47
|
+
*/
|
|
48
|
+
export declare function conditionsAsExpressions(value: unknown, options: ExpressionOptions, root?: boolean): unknown;
|
|
49
|
+
/**
|
|
50
|
+
* A definition whose `conditions` values follow the project's settings, apart from those `keep`
|
|
51
|
+
* accepts: in their simplest form with `simplify`, and as expressions with `expressions`.
|
|
52
|
+
* Promote writes the conditions it changes this way.
|
|
53
|
+
*/
|
|
54
|
+
export declare function withConfiguredConditions<T>(kind: ConditionKind, definition: T, settings: {
|
|
55
|
+
simplify: boolean;
|
|
56
|
+
expressions?: ExpressionOptions;
|
|
57
|
+
keep: (conditions: unknown) => boolean;
|
|
58
|
+
}): T;
|
|
59
|
+
/**
|
|
60
|
+
* Writes each condition in a definition in its simplest form that evaluates the same. A whole
|
|
61
|
+
* value's list of one condition becomes that condition, and its `and` group the list it holds.
|
|
62
|
+
* An `and` or `or` of one condition becomes that condition anywhere. With `expressions`, in a
|
|
63
|
+
* project that allows them, expressions side by side then join into one, where it builds
|
|
64
|
+
* exactly the same tree. Tree leaves stay trees. `# featurevisor-ignore-line` keeps a value as
|
|
65
|
+
* written, with everything below it.
|
|
66
|
+
*/
|
|
67
|
+
export declare function simplifyConditions(doc: Document, kind: ConditionKind, definition: unknown, expressions?: ExpressionOptions): ConditionsResult;
|
|
68
|
+
/**
|
|
69
|
+
* Writes each expression in a definition as the tree it builds. Each comment line inside an
|
|
70
|
+
* expression goes above the condition below it, and an expression with an error stays as
|
|
71
|
+
* written, reported in `invalid`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function writeExpressionsAsTrees(doc: Document, kind: ConditionKind, definition: unknown, options: ExpressionOptions): ConditionsResult;
|
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONDITION_KINDS = void 0;
|
|
4
|
+
exports.writeTreesAsExpressions = writeTreesAsExpressions;
|
|
5
|
+
exports.simplestConditions = simplestConditions;
|
|
6
|
+
exports.conditionsAsExpressions = conditionsAsExpressions;
|
|
7
|
+
exports.withConfiguredConditions = withConfiguredConditions;
|
|
8
|
+
exports.simplifyConditions = simplifyConditions;
|
|
9
|
+
exports.writeExpressionsAsTrees = writeExpressionsAsTrees;
|
|
10
|
+
const expressions_1 = require("@featurevisor/expressions");
|
|
11
|
+
const parsers_1 = require("@featurevisor/parsers");
|
|
12
|
+
const yaml_1 = require("yaml");
|
|
13
|
+
const conditionLocations_1 = require("../datasource/conditionLocations");
|
|
14
|
+
const style_1 = require("../formatter/style");
|
|
15
|
+
exports.CONDITION_KINDS = ["feature", "segment", "variable"];
|
|
16
|
+
function emptyResult() {
|
|
17
|
+
return { changed: 0, kept: [], invalid: [], unmarked: [], moved: [] };
|
|
18
|
+
}
|
|
19
|
+
function isObject(value) {
|
|
20
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
21
|
+
}
|
|
22
|
+
function isIgnoreComment(comment) {
|
|
23
|
+
return !!comment && comment.trim() === parsers_1.IGNORE_LINE_COMMENT;
|
|
24
|
+
}
|
|
25
|
+
function keyOf(pair) {
|
|
26
|
+
return (0, yaml_1.isScalar)(pair.key) ? String(pair.key.value) : undefined;
|
|
27
|
+
}
|
|
28
|
+
/** The node at `path` in a document, without resolving scalars to values */
|
|
29
|
+
function nodeAt(doc, path) {
|
|
30
|
+
const node = path.length === 0 ? doc.contents : doc.getIn(path, true);
|
|
31
|
+
return (0, yaml_1.isNode)(node) ? node : undefined;
|
|
32
|
+
}
|
|
33
|
+
/** The pair whose value is the node at `path`, when its parent is a map */
|
|
34
|
+
function pairAt(doc, path) {
|
|
35
|
+
const parent = nodeAt(doc, path.slice(0, -1));
|
|
36
|
+
if (!(0, yaml_1.isMap)(parent))
|
|
37
|
+
return undefined;
|
|
38
|
+
return parent.items.find((pair) => keyOf(pair) === String(path[path.length - 1]));
|
|
39
|
+
}
|
|
40
|
+
/** Puts `node` in place of the node at `path` */
|
|
41
|
+
function replaceAt(doc, path, node) {
|
|
42
|
+
const parent = nodeAt(doc, path.slice(0, -1));
|
|
43
|
+
const last = path[path.length - 1];
|
|
44
|
+
if ((0, yaml_1.isSeq)(parent) && typeof last === "number")
|
|
45
|
+
parent.items[last] = node;
|
|
46
|
+
else {
|
|
47
|
+
const pair = pairAt(doc, path);
|
|
48
|
+
if (pair)
|
|
49
|
+
pair.value = node;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The comments inside a list or map, each at the path of the item it belongs to. A comment on
|
|
54
|
+
* a map's key or on a plain value in it belongs to the map, and so does the comment written on
|
|
55
|
+
* a list or map below a key. `own` adds the node's own comments, at its own path.
|
|
56
|
+
*/
|
|
57
|
+
function collectComments(node, at, out, own) {
|
|
58
|
+
const add = (comment, path) => {
|
|
59
|
+
if (comment)
|
|
60
|
+
out.push({ path, text: comment });
|
|
61
|
+
};
|
|
62
|
+
if (own) {
|
|
63
|
+
add(node.commentBefore, at);
|
|
64
|
+
add(node.comment, at);
|
|
65
|
+
}
|
|
66
|
+
if ((0, yaml_1.isSeq)(node)) {
|
|
67
|
+
node.items.forEach((item, index) => {
|
|
68
|
+
if ((0, yaml_1.isNode)(item))
|
|
69
|
+
collectComments(item, [...at, index], out, true);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
else if ((0, yaml_1.isMap)(node)) {
|
|
73
|
+
for (const pair of node.items) {
|
|
74
|
+
if ((0, yaml_1.isScalar)(pair.key)) {
|
|
75
|
+
add(pair.key.commentBefore, at);
|
|
76
|
+
add(pair.key.comment, at);
|
|
77
|
+
}
|
|
78
|
+
const value = pair.value;
|
|
79
|
+
if ((0, yaml_1.isMap)(value) || (0, yaml_1.isSeq)(value)) {
|
|
80
|
+
add(value.commentBefore, at);
|
|
81
|
+
add(value.comment, at);
|
|
82
|
+
collectComments(value, [...at, keyOf(pair) ?? ""], out, false);
|
|
83
|
+
}
|
|
84
|
+
else if ((0, yaml_1.isNode)(value)) {
|
|
85
|
+
add(value.commentBefore, at);
|
|
86
|
+
add(value.comment, at);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Whether a line inside the value, or the line of its key, is kept as written */
|
|
92
|
+
function isKeptAsWritten(doc, path, node) {
|
|
93
|
+
const comments = [];
|
|
94
|
+
collectComments(node, [], comments, true);
|
|
95
|
+
const pair = pairAt(doc, path);
|
|
96
|
+
const key = pair && (0, yaml_1.isScalar)(pair.key) ? pair.key : undefined;
|
|
97
|
+
return (comments.some((comment) => isIgnoreComment(comment.text)) ||
|
|
98
|
+
isIgnoreComment(key?.comment) ||
|
|
99
|
+
isIgnoreComment(key?.commentBefore));
|
|
100
|
+
}
|
|
101
|
+
/** Each condition a `conditions` value holds, as a whole value, a list item or a group child */
|
|
102
|
+
function eachPosition(value, at, root, visit) {
|
|
103
|
+
// a condition written as a whole needs none of its parts written
|
|
104
|
+
if (visit(value, at, root))
|
|
105
|
+
return;
|
|
106
|
+
if (Array.isArray(value)) {
|
|
107
|
+
value.forEach((item, index) => eachPosition(item, [...at, index], false, visit));
|
|
108
|
+
}
|
|
109
|
+
else if (isObject(value) && Object.keys(value).length === 1) {
|
|
110
|
+
for (const key of ["and", "or", "not"]) {
|
|
111
|
+
const children = value[key];
|
|
112
|
+
if (Array.isArray(children)) {
|
|
113
|
+
children.forEach((child, index) => eachPosition(child, [...at, key, index], false, visit));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/** Whether a value holds a condition leaf written as a tree, at any depth */
|
|
119
|
+
function hasLeaf(value) {
|
|
120
|
+
if (Array.isArray(value))
|
|
121
|
+
return value.some(hasLeaf);
|
|
122
|
+
if (!isObject(value))
|
|
123
|
+
return false;
|
|
124
|
+
const keys = Object.keys(value);
|
|
125
|
+
const group = keys.length === 1 && ["and", "or", "not"].includes(keys[0]);
|
|
126
|
+
return group && Array.isArray(value[keys[0]]) ? hasLeaf(value[keys[0]]) : true;
|
|
127
|
+
}
|
|
128
|
+
/** Whether a value is a condition leaf, rather than a list, a group or a string */
|
|
129
|
+
function isLeaf(value) {
|
|
130
|
+
if (!isObject(value))
|
|
131
|
+
return false;
|
|
132
|
+
const keys = Object.keys(value);
|
|
133
|
+
return !(keys.length === 1 && ["and", "or", "not"].some((key) => Array.isArray(value[key])));
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Writes each condition tree in a definition as an expression, wherever the expression reads
|
|
137
|
+
* back to exactly the tree. The comments inside a tree move above the condition they sat
|
|
138
|
+
* beside. `# featurevisor-ignore-line` keeps a value as written, with everything below it.
|
|
139
|
+
*/
|
|
140
|
+
function writeTreesAsExpressions(doc, kind, definition, options, { joinOnly = false } = {}) {
|
|
141
|
+
const result = emptyResult();
|
|
142
|
+
(0, conditionLocations_1.visitConditionLocations)(kind, definition, (_location, conditions, path) => {
|
|
143
|
+
if (conditions === undefined)
|
|
144
|
+
return;
|
|
145
|
+
const top = nodeAt(doc, path);
|
|
146
|
+
if (top && isKeptAsWritten(doc, path, top))
|
|
147
|
+
return;
|
|
148
|
+
eachPosition(conditions, path, true, (value, at, root) => {
|
|
149
|
+
if (typeof value === "string" || value === null || typeof value !== "object")
|
|
150
|
+
return true;
|
|
151
|
+
const node = nodeAt(doc, at);
|
|
152
|
+
if (!node || !((0, yaml_1.isMap)(node) || (0, yaml_1.isSeq)(node)))
|
|
153
|
+
return true;
|
|
154
|
+
if (isKeptAsWritten(doc, at, node))
|
|
155
|
+
return true;
|
|
156
|
+
// joining expressions side by side leaves every tree leaf to convert
|
|
157
|
+
if (joinOnly && hasLeaf(value))
|
|
158
|
+
return false;
|
|
159
|
+
// a key's value takes its own comments into the expression, a list item keeps them above
|
|
160
|
+
const own = root;
|
|
161
|
+
const comments = [];
|
|
162
|
+
collectComments(node, [], comments, own);
|
|
163
|
+
let text = (0, expressions_1.treeToExpression)(value, {
|
|
164
|
+
...options,
|
|
165
|
+
root,
|
|
166
|
+
indent: style_1.HOUSE_STYLE.indent,
|
|
167
|
+
comments,
|
|
168
|
+
});
|
|
169
|
+
if (text === undefined) {
|
|
170
|
+
if (isLeaf(value))
|
|
171
|
+
result.kept.push(at);
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
if (style_1.HOUSE_STYLE.expressions.finalNewline && text.includes("\n"))
|
|
175
|
+
text += "\n";
|
|
176
|
+
const scalar = new yaml_1.Scalar(text);
|
|
177
|
+
if (text.includes("\n"))
|
|
178
|
+
scalar.type = yaml_1.Scalar.BLOCK_LITERAL;
|
|
179
|
+
scalar.spaceBefore = node.spaceBefore;
|
|
180
|
+
if (!own) {
|
|
181
|
+
scalar.commentBefore = node.commentBefore;
|
|
182
|
+
scalar.comment = node.comment;
|
|
183
|
+
}
|
|
184
|
+
replaceAt(doc, at, scalar);
|
|
185
|
+
result.changed++;
|
|
186
|
+
for (const comment of comments) {
|
|
187
|
+
result.moved.push(...comment.text.split("\n").map((line) => line.trim()));
|
|
188
|
+
}
|
|
189
|
+
return true;
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
/** A group written as a map of one `and`, `or` or `not` key over a list, with its parts */
|
|
195
|
+
function groupOf(node) {
|
|
196
|
+
if (!(0, yaml_1.isMap)(node) || node.items.length !== 1)
|
|
197
|
+
return undefined;
|
|
198
|
+
const pair = node.items[0];
|
|
199
|
+
const key = keyOf(pair);
|
|
200
|
+
if (!key || !["and", "or", "not"].includes(key) || !(0, yaml_1.isSeq)(pair.value))
|
|
201
|
+
return undefined;
|
|
202
|
+
return { key, pair, seq: pair.value };
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Puts `to` in place of the node at `path`, which wraps it, carrying the wrappers' comments.
|
|
206
|
+
* Above a whole value they go above its key, where a plain value cannot show them.
|
|
207
|
+
*/
|
|
208
|
+
function lift(doc, path, to, wrappers) {
|
|
209
|
+
const nodes = wrappers.filter(yaml_1.isNode);
|
|
210
|
+
const before = joinComments(...nodes.map((node) => node.commentBefore), to.commentBefore);
|
|
211
|
+
const after = joinComments(to.comment, ...nodes.map((node) => node.comment));
|
|
212
|
+
to.spaceBefore = nodes[0]?.spaceBefore;
|
|
213
|
+
const key = pairAt(doc, path)?.key;
|
|
214
|
+
if ((0, yaml_1.isScalar)(to) && (0, yaml_1.isScalar)(key)) {
|
|
215
|
+
key.commentBefore = joinComments(key.commentBefore, before);
|
|
216
|
+
to.commentBefore = undefined;
|
|
217
|
+
}
|
|
218
|
+
else
|
|
219
|
+
to.commentBefore = before;
|
|
220
|
+
to.comment = after;
|
|
221
|
+
replaceAt(doc, path, to);
|
|
222
|
+
}
|
|
223
|
+
/** Simplifies the condition at `path` and the conditions inside it, saying how many changed */
|
|
224
|
+
function simplifyNode(doc, path, root) {
|
|
225
|
+
let node = nodeAt(doc, path);
|
|
226
|
+
if (!node || isKeptAsWritten(doc, path, node))
|
|
227
|
+
return 0;
|
|
228
|
+
let changed = 0;
|
|
229
|
+
if ((0, yaml_1.isSeq)(node)) {
|
|
230
|
+
node.items.forEach((item, index) => {
|
|
231
|
+
if ((0, yaml_1.isNode)(item))
|
|
232
|
+
changed += simplifyNode(doc, [...path, index], false);
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
const group = groupOf(node);
|
|
237
|
+
group?.seq.items.forEach((item, index) => {
|
|
238
|
+
if ((0, yaml_1.isNode)(item))
|
|
239
|
+
changed += simplifyNode(doc, [...path, group.key, index], false);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
// an `and` or `or` of one condition is that condition
|
|
243
|
+
const group = groupOf(node);
|
|
244
|
+
const only = group?.seq.items[0];
|
|
245
|
+
if (group && group.key !== "not" && group.seq.items.length === 1 && (0, yaml_1.isNode)(only)) {
|
|
246
|
+
lift(doc, path, only, [node, group.pair.key, group.seq]);
|
|
247
|
+
node = only;
|
|
248
|
+
changed++;
|
|
249
|
+
}
|
|
250
|
+
if (!root)
|
|
251
|
+
return changed;
|
|
252
|
+
// a whole value's `and` group is the list it holds, and a list of one is that condition,
|
|
253
|
+
// until neither applies, since a list of one can hold an `and` group
|
|
254
|
+
for (;;) {
|
|
255
|
+
const whole = groupOf(node);
|
|
256
|
+
if (whole?.key === "and" && whole.seq.items.length > 1) {
|
|
257
|
+
lift(doc, path, whole.seq, [node, whole.pair.key]);
|
|
258
|
+
node = whole.seq;
|
|
259
|
+
changed++;
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
const item = (0, yaml_1.isSeq)(node) ? node.items[0] : undefined;
|
|
263
|
+
if ((0, yaml_1.isSeq)(node) && node.items.length === 1 && (0, yaml_1.isNode)(item)) {
|
|
264
|
+
lift(doc, path, item, [node]);
|
|
265
|
+
node = item;
|
|
266
|
+
changed++;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
return changed;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/** A value's group of one `and`, `or` or `not` key over a list, as its key and list */
|
|
273
|
+
function groupIn(value) {
|
|
274
|
+
if (!isObject(value) || Object.keys(value).length !== 1)
|
|
275
|
+
return undefined;
|
|
276
|
+
const key = Object.keys(value)[0];
|
|
277
|
+
return ["and", "or", "not"].includes(key) && Array.isArray(value[key])
|
|
278
|
+
? [key, value[key]]
|
|
279
|
+
: undefined;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* A `conditions` value in the simplest form that evaluates the same, as `simplifyConditions`
|
|
283
|
+
* writes it, apart from joining expressions: an `and` or `or` of one condition is that
|
|
284
|
+
* condition, and a whole value's list of one condition, or its `and` group, is that condition
|
|
285
|
+
* or the list it holds. Conditions that evaluate the same compare equal in this form.
|
|
286
|
+
*/
|
|
287
|
+
function simplestConditions(value, root = true) {
|
|
288
|
+
let result = value;
|
|
289
|
+
const group = groupIn(value);
|
|
290
|
+
if (Array.isArray(value))
|
|
291
|
+
result = value.map((item) => simplestConditions(item, false));
|
|
292
|
+
else if (group) {
|
|
293
|
+
result = { [group[0]]: group[1].map((item) => simplestConditions(item, false)) };
|
|
294
|
+
}
|
|
295
|
+
else
|
|
296
|
+
return value;
|
|
297
|
+
const simplified = groupIn(result);
|
|
298
|
+
if (simplified && simplified[0] !== "not" && simplified[1].length === 1)
|
|
299
|
+
return simplified[1][0];
|
|
300
|
+
if (root && simplified?.[0] === "and" && simplified[1].length > 1)
|
|
301
|
+
result = simplified[1];
|
|
302
|
+
if (root && Array.isArray(result) && result.length === 1) {
|
|
303
|
+
return simplestConditions(result[0], true);
|
|
304
|
+
}
|
|
305
|
+
return result;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* A `conditions` value written as expressions wherever an expression reads back to exactly the
|
|
309
|
+
* tree, as `convert --to=expressions --exact` writes it: the whole value when it can be one
|
|
310
|
+
* expression, otherwise each list item and group child.
|
|
311
|
+
*/
|
|
312
|
+
function conditionsAsExpressions(value, options, root = true) {
|
|
313
|
+
if (value === null || typeof value !== "object")
|
|
314
|
+
return value;
|
|
315
|
+
const text = (0, expressions_1.treeToExpression)(value, {
|
|
316
|
+
...options,
|
|
317
|
+
root,
|
|
318
|
+
indent: style_1.HOUSE_STYLE.indent,
|
|
319
|
+
});
|
|
320
|
+
if (text !== undefined) {
|
|
321
|
+
return style_1.HOUSE_STYLE.expressions.finalNewline && text.includes("\n") ? `${text}\n` : text;
|
|
322
|
+
}
|
|
323
|
+
if (Array.isArray(value)) {
|
|
324
|
+
return value.map((item) => conditionsAsExpressions(item, options, false));
|
|
325
|
+
}
|
|
326
|
+
const group = groupIn(value);
|
|
327
|
+
return group
|
|
328
|
+
? { [group[0]]: group[1].map((child) => conditionsAsExpressions(child, options, false)) }
|
|
329
|
+
: value;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* A definition whose `conditions` values follow the project's settings, apart from those `keep`
|
|
333
|
+
* accepts: in their simplest form with `simplify`, and as expressions with `expressions`.
|
|
334
|
+
* Promote writes the conditions it changes this way.
|
|
335
|
+
*/
|
|
336
|
+
function withConfiguredConditions(kind, definition, settings) {
|
|
337
|
+
const paths = [];
|
|
338
|
+
(0, conditionLocations_1.visitConditionLocations)(kind, definition, (_location, conditions, path) => {
|
|
339
|
+
if (conditions !== undefined && !settings.keep(conditions))
|
|
340
|
+
paths.push(path);
|
|
341
|
+
});
|
|
342
|
+
if (paths.length === 0)
|
|
343
|
+
return definition;
|
|
344
|
+
const copy = structuredClone(definition);
|
|
345
|
+
for (const path of paths) {
|
|
346
|
+
let parent = copy;
|
|
347
|
+
for (const part of path.slice(0, -1))
|
|
348
|
+
parent = parent[part];
|
|
349
|
+
const last = path[path.length - 1];
|
|
350
|
+
let value = parent[last];
|
|
351
|
+
if (settings.simplify)
|
|
352
|
+
value = simplestConditions(value);
|
|
353
|
+
if (settings.expressions)
|
|
354
|
+
value = conditionsAsExpressions(value, settings.expressions);
|
|
355
|
+
parent[last] = value;
|
|
356
|
+
}
|
|
357
|
+
return copy;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Writes each condition in a definition in its simplest form that evaluates the same. A whole
|
|
361
|
+
* value's list of one condition becomes that condition, and its `and` group the list it holds.
|
|
362
|
+
* An `and` or `or` of one condition becomes that condition anywhere. With `expressions`, in a
|
|
363
|
+
* project that allows them, expressions side by side then join into one, where it builds
|
|
364
|
+
* exactly the same tree. Tree leaves stay trees. `# featurevisor-ignore-line` keeps a value as
|
|
365
|
+
* written, with everything below it.
|
|
366
|
+
*/
|
|
367
|
+
function simplifyConditions(doc, kind, definition, expressions) {
|
|
368
|
+
const result = emptyResult();
|
|
369
|
+
(0, conditionLocations_1.visitConditionLocations)(kind, definition, (_location, conditions, path) => {
|
|
370
|
+
if (conditions !== undefined)
|
|
371
|
+
result.changed += simplifyNode(doc, path, true);
|
|
372
|
+
});
|
|
373
|
+
if (expressions) {
|
|
374
|
+
const joined = writeTreesAsExpressions(doc, kind, doc.toJS(), expressions, { joinOnly: true });
|
|
375
|
+
result.changed += joined.changed;
|
|
376
|
+
result.moved.push(...joined.moved);
|
|
377
|
+
}
|
|
378
|
+
return result;
|
|
379
|
+
}
|
|
380
|
+
/** Whole line comments in an expression, with where each starts */
|
|
381
|
+
function commentLines(source) {
|
|
382
|
+
const comments = [];
|
|
383
|
+
let offset = 0;
|
|
384
|
+
for (const line of source.split("\n")) {
|
|
385
|
+
const text = line.trim();
|
|
386
|
+
if (text.startsWith("#"))
|
|
387
|
+
comments.push({ offset: offset + line.indexOf("#"), text });
|
|
388
|
+
offset += line.length + 1;
|
|
389
|
+
}
|
|
390
|
+
return comments;
|
|
391
|
+
}
|
|
392
|
+
/** The node at `path` inside a node made for a tree */
|
|
393
|
+
function nodeInside(node, path) {
|
|
394
|
+
let current = node;
|
|
395
|
+
for (const part of path) {
|
|
396
|
+
if ((0, yaml_1.isSeq)(current) && typeof part === "number")
|
|
397
|
+
current = current.items[part];
|
|
398
|
+
else if ((0, yaml_1.isMap)(current)) {
|
|
399
|
+
current = current.items.find((pair) => keyOf(pair) === String(part))?.value;
|
|
400
|
+
}
|
|
401
|
+
else
|
|
402
|
+
return undefined;
|
|
403
|
+
}
|
|
404
|
+
return (0, yaml_1.isNode)(current) ? current : undefined;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* A tree with each variable path as the dotted text that builds the same path, as authors write
|
|
408
|
+
* it, such as `routing.enabled`. A path whose keys hold a dot, or a key made of digits that a
|
|
409
|
+
* dotted path would read as an index, stays a list.
|
|
410
|
+
*/
|
|
411
|
+
function withDottedPaths(value) {
|
|
412
|
+
if (Array.isArray(value))
|
|
413
|
+
return value.map(withDottedPaths);
|
|
414
|
+
if (!isObject(value))
|
|
415
|
+
return value;
|
|
416
|
+
const result = {};
|
|
417
|
+
for (const [key, child] of Object.entries(value)) {
|
|
418
|
+
const dotted = key === "path" &&
|
|
419
|
+
typeof value.variable === "string" &&
|
|
420
|
+
Array.isArray(child) &&
|
|
421
|
+
child.length > 0 &&
|
|
422
|
+
child.every((part) => (typeof part === "number" && Number.isInteger(part) && part >= 0) ||
|
|
423
|
+
(typeof part === "string" &&
|
|
424
|
+
part !== "" &&
|
|
425
|
+
!part.includes(".") &&
|
|
426
|
+
!/^(0|[1-9]\d*)$/.test(part)));
|
|
427
|
+
result[key] = dotted ? child.join(".") : withDottedPaths(child);
|
|
428
|
+
}
|
|
429
|
+
return result;
|
|
430
|
+
}
|
|
431
|
+
function joinComments(...comments) {
|
|
432
|
+
const joined = comments.filter(Boolean).join("\n");
|
|
433
|
+
return joined || undefined;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Writes each expression in a definition as the tree it builds. Each comment line inside an
|
|
437
|
+
* expression goes above the condition below it, and an expression with an error stays as
|
|
438
|
+
* written, reported in `invalid`.
|
|
439
|
+
*/
|
|
440
|
+
function writeExpressionsAsTrees(doc, kind, definition, options) {
|
|
441
|
+
const result = emptyResult();
|
|
442
|
+
(0, conditionLocations_1.visitConditionLocations)(kind, definition, (_location, conditions, path) => {
|
|
443
|
+
if (conditions === undefined)
|
|
444
|
+
return;
|
|
445
|
+
const expanded = (0, expressions_1.expandConditions)(conditions, options);
|
|
446
|
+
for (const expression of expanded.expressions) {
|
|
447
|
+
const at = [...path, ...expression.path];
|
|
448
|
+
if (expression.errors.length > 0) {
|
|
449
|
+
result.invalid.push(at);
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
const written = nodeAt(doc, at);
|
|
453
|
+
if (!written)
|
|
454
|
+
continue;
|
|
455
|
+
let tree = expanded.conditions;
|
|
456
|
+
for (const part of expression.path)
|
|
457
|
+
tree = tree[part];
|
|
458
|
+
const node = doc.createNode(withDottedPaths(tree));
|
|
459
|
+
// each comment above the first condition after it, in the tree's own terms
|
|
460
|
+
const spans = [...expression.spans].sort((a, b) => a.start.offset - b.start.offset);
|
|
461
|
+
for (const comment of commentLines(expression.source)) {
|
|
462
|
+
const next = spans.find((span) => span.start.offset > comment.offset);
|
|
463
|
+
const target = next ? nodeInside(node, next.path.slice(expression.path.length)) : undefined;
|
|
464
|
+
const text = comment.text.slice(1);
|
|
465
|
+
if (target)
|
|
466
|
+
target.commentBefore = joinComments(target.commentBefore, text);
|
|
467
|
+
else
|
|
468
|
+
node.comment = joinComments(node.comment, text);
|
|
469
|
+
}
|
|
470
|
+
// an expression kept as written with the ignore comment is written as a tree all the same,
|
|
471
|
+
// since the project stops allowing expressions, so the comment has nothing left to keep
|
|
472
|
+
const own = (comment) => isIgnoreComment(comment) ? undefined : comment;
|
|
473
|
+
if (isIgnoreComment(written.comment) || isIgnoreComment(written.commentBefore)) {
|
|
474
|
+
result.unmarked.push(at);
|
|
475
|
+
}
|
|
476
|
+
node.commentBefore = joinComments(own(written.commentBefore), node.commentBefore);
|
|
477
|
+
node.spaceBefore = written.spaceBefore;
|
|
478
|
+
node.comment = joinComments(node.comment, own(written.comment));
|
|
479
|
+
replaceAt(doc, at, node);
|
|
480
|
+
result.changed++;
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
return result;
|
|
484
|
+
}
|
|
485
|
+
//# sourceMappingURL=conditions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../src/rewrite/conditions.ts"],"names":[],"mappings":";;;AA6KA,0DAqDC;AA2FD,gDAcC;AAOD,0DAqBC;AAOD,4DAyBC;AAUD,gDAgBC;AAgED,0DA8CC;AA/gBD,2DAKmC;AACnC,mDAA4D;AAE5D,+BAA8D;AAG9D,yEAA+F;AAC/F,8CAAiD;AAcpC,QAAA,eAAe,GAAa,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAgB5E,SAAS,WAAW;IAClB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AACxE,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAED,SAAS,eAAe,CAAC,OAAkC;IACzD,OAAO,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,KAAK,6BAAmB,CAAC;AAC7D,CAAC;AAED,SAAS,KAAK,CAAC,IAAU;IACvB,OAAO,IAAA,eAAQ,EAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC;AAED,4EAA4E;AAC5E,SAAS,MAAM,CAAC,GAAa,EAAE,IAAmB;IAChD,MAA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