@featurevisor/core 0.53.2 → 0.53.3
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/.eslintcache +1 -1
- package/CHANGELOG.md +8 -0
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/lib/builder/allocator.js.html +1 -1
- package/coverage/lcov-report/lib/builder/index.html +1 -1
- package/coverage/lcov-report/lib/builder/traffic.js.html +1 -1
- package/coverage/lcov-report/src/builder/allocator.ts.html +1 -1
- package/coverage/lcov-report/src/builder/index.html +1 -1
- package/coverage/lcov-report/src/builder/traffic.ts.html +1 -1
- package/lib/builder/buildDatafile.d.ts +1 -1
- package/lib/builder/buildDatafile.js +241 -168
- package/lib/builder/buildDatafile.js.map +1 -1
- package/lib/builder/buildProject.d.ts +1 -1
- package/lib/builder/buildProject.js +99 -40
- package/lib/builder/buildProject.js.map +1 -1
- package/lib/builder/getFeatureRanges.d.ts +1 -1
- package/lib/builder/getFeatureRanges.js +92 -31
- package/lib/builder/getFeatureRanges.js.map +1 -1
- package/lib/datasource/datasource.d.ts +16 -16
- package/lib/datasource/datasource.js +123 -67
- package/lib/datasource/datasource.js.map +1 -1
- package/lib/find-duplicate-segments/findDuplicateSegments.d.ts +1 -1
- package/lib/find-duplicate-segments/findDuplicateSegments.js +75 -18
- package/lib/find-duplicate-segments/findDuplicateSegments.js.map +1 -1
- package/lib/find-duplicate-segments/index.d.ts +1 -1
- package/lib/find-duplicate-segments/index.js +56 -9
- package/lib/find-duplicate-segments/index.js.map +1 -1
- package/lib/generate-code/index.d.ts +1 -1
- package/lib/generate-code/index.js +67 -23
- package/lib/generate-code/index.js.map +1 -1
- package/lib/generate-code/typescript.d.ts +1 -1
- package/lib/generate-code/typescript.js +139 -72
- package/lib/generate-code/typescript.js.map +1 -1
- package/lib/linter/checkCircularDependency.d.ts +1 -1
- package/lib/linter/checkCircularDependency.js +78 -22
- package/lib/linter/checkCircularDependency.js.map +1 -1
- package/lib/linter/groupSchema.js +79 -28
- package/lib/linter/groupSchema.js.map +1 -1
- package/lib/linter/lintProject.js +122 -101
- package/lib/linter/lintProject.js.map +1 -1
- package/lib/restore.d.ts +1 -1
- package/lib/restore.js +53 -11
- package/lib/restore.js.map +1 -1
- package/lib/site/exportSite.d.ts +1 -1
- package/lib/site/exportSite.js +64 -21
- package/lib/site/exportSite.js.map +1 -1
- package/lib/site/generateSiteSearchIndex.d.ts +1 -1
- package/lib/site/generateSiteSearchIndex.js +203 -111
- package/lib/site/generateSiteSearchIndex.js.map +1 -1
- package/lib/tester/testFeature.d.ts +1 -1
- package/lib/tester/testFeature.js +127 -59
- package/lib/tester/testFeature.js.map +1 -1
- package/lib/tester/testProject.d.ts +1 -1
- package/lib/tester/testProject.js +105 -48
- package/lib/tester/testProject.js.map +1 -1
- package/lib/tester/testSegment.d.ts +1 -1
- package/lib/tester/testSegment.js +69 -21
- package/lib/tester/testSegment.js.map +1 -1
- package/package.json +2 -2
- package/src/builder/buildDatafile.ts +9 -9
- package/src/builder/buildProject.ts +2 -2
- package/src/builder/getFeatureRanges.ts +4 -4
- package/src/datasource/datasource.ts +22 -69
- package/src/find-duplicate-segments/findDuplicateSegments.ts +9 -6
- package/src/find-duplicate-segments/index.ts +5 -2
- package/src/generate-code/index.ts +2 -2
- package/src/generate-code/typescript.ts +42 -25
- package/src/linter/checkCircularDependency.ts +4 -4
- package/src/linter/groupSchema.ts +3 -3
- package/src/linter/lintProject.ts +39 -39
- package/src/restore.ts +1 -1
- package/src/site/exportSite.ts +2 -2
- package/src/site/generateSiteSearchIndex.ts +14 -14
- package/src/tester/testFeature.ts +8 -6
- package/src/tester/testProject.ts +8 -5
- package/src/tester/testSegment.ts +3 -3
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.buildDatafile = void 0;
|
|
4
40
|
var fs = require("fs");
|
|
@@ -6,182 +42,219 @@ var utils_1 = require("../utils");
|
|
|
6
42
|
var traffic_1 = require("./traffic");
|
|
7
43
|
var getFeatureRanges_1 = require("./getFeatureRanges");
|
|
8
44
|
function buildDatafile(projectConfig, datasource, options, existingState) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return attributeKeysUsedByTag.add(attributeKey);
|
|
71
|
-
});
|
|
72
|
-
return {
|
|
73
|
-
conditions: JSON.stringify(override.conditions),
|
|
74
|
-
value: override.value,
|
|
75
|
-
};
|
|
45
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
+
var datafileContent, segmentKeysUsedByTag, attributeKeysUsedByTag, _a, featureRanges, featureIsInGroup, features, featuresDirectory, featureFiles, _i, featureFiles_1, featureKey, parsedFeature, _b, _c, parsedRule, extractedSegmentKeys, feature, segments, segmentsDirectory, segmentFiles, _d, segmentFiles_1, segmentKey, parsedSegment, extractedAttributeKeys, segment, attributes, attributesDirectory, attributeFiles, _e, attributeFiles_1, attributeKey, parsedAttribute, attribute;
|
|
47
|
+
return __generator(this, function (_f) {
|
|
48
|
+
switch (_f.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
datafileContent = {
|
|
51
|
+
schemaVersion: options.schemaVersion,
|
|
52
|
+
revision: options.revision,
|
|
53
|
+
attributes: [],
|
|
54
|
+
segments: [],
|
|
55
|
+
features: [],
|
|
56
|
+
};
|
|
57
|
+
segmentKeysUsedByTag = new Set();
|
|
58
|
+
attributeKeysUsedByTag = new Set();
|
|
59
|
+
return [4 /*yield*/, (0, getFeatureRanges_1.getFeatureRanges)(projectConfig, datasource)];
|
|
60
|
+
case 1:
|
|
61
|
+
_a = _f.sent(), featureRanges = _a.featureRanges, featureIsInGroup = _a.featureIsInGroup;
|
|
62
|
+
features = [];
|
|
63
|
+
featuresDirectory = projectConfig.featuresDirectoryPath;
|
|
64
|
+
if (!fs.existsSync(featuresDirectory)) return [3 /*break*/, 6];
|
|
65
|
+
return [4 /*yield*/, datasource.listFeatures()];
|
|
66
|
+
case 2:
|
|
67
|
+
featureFiles = _f.sent();
|
|
68
|
+
_i = 0, featureFiles_1 = featureFiles;
|
|
69
|
+
_f.label = 3;
|
|
70
|
+
case 3:
|
|
71
|
+
if (!(_i < featureFiles_1.length)) return [3 /*break*/, 6];
|
|
72
|
+
featureKey = featureFiles_1[_i];
|
|
73
|
+
return [4 /*yield*/, datasource.readFeature(featureKey)];
|
|
74
|
+
case 4:
|
|
75
|
+
parsedFeature = _f.sent();
|
|
76
|
+
if (parsedFeature.archived === true) {
|
|
77
|
+
return [3 /*break*/, 5];
|
|
78
|
+
}
|
|
79
|
+
if (options.tag && parsedFeature.tags.indexOf(options.tag) === -1) {
|
|
80
|
+
return [3 /*break*/, 5];
|
|
81
|
+
}
|
|
82
|
+
if (options.features && options.features.indexOf(featureKey) === -1) {
|
|
83
|
+
return [3 /*break*/, 5];
|
|
84
|
+
}
|
|
85
|
+
if (parsedFeature.environments[options.environment].expose === false) {
|
|
86
|
+
return [3 /*break*/, 5];
|
|
87
|
+
}
|
|
88
|
+
for (_b = 0, _c = parsedFeature.environments[options.environment].rules; _b < _c.length; _b++) {
|
|
89
|
+
parsedRule = _c[_b];
|
|
90
|
+
extractedSegmentKeys = (0, utils_1.extractSegmentKeysFromGroupSegments)(parsedRule.segments);
|
|
91
|
+
extractedSegmentKeys.forEach(function (segmentKey) { return segmentKeysUsedByTag.add(segmentKey); });
|
|
92
|
+
}
|
|
93
|
+
feature = {
|
|
94
|
+
key: featureKey,
|
|
95
|
+
deprecated: parsedFeature.deprecated === true ? true : undefined,
|
|
96
|
+
bucketBy: parsedFeature.bucketBy || projectConfig.defaultBucketBy,
|
|
97
|
+
required: parsedFeature.required,
|
|
98
|
+
variations: Array.isArray(parsedFeature.variations)
|
|
99
|
+
? parsedFeature.variations.map(function (variation) {
|
|
100
|
+
var mappedVariation = {
|
|
101
|
+
value: variation.value,
|
|
102
|
+
weight: variation.weight, // @TODO: added so state files can maintain weight info, but datafiles don't need this. find a way to remove it from datafiles later
|
|
103
|
+
};
|
|
104
|
+
if (!variation.variables) {
|
|
105
|
+
return mappedVariation;
|
|
76
106
|
}
|
|
77
|
-
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
|
|
107
|
+
mappedVariation.variables = variation.variables.map(function (variable) {
|
|
108
|
+
var mappedVariable = {
|
|
109
|
+
key: variable.key,
|
|
110
|
+
value: variable.value,
|
|
111
|
+
};
|
|
112
|
+
if (!variable.overrides) {
|
|
113
|
+
return mappedVariable;
|
|
114
|
+
}
|
|
115
|
+
mappedVariable.overrides = variable.overrides.map(function (override) {
|
|
116
|
+
if (typeof override.conditions !== "undefined") {
|
|
117
|
+
var extractedAttributeKeys = (0, utils_1.extractAttributeKeysFromConditions)(override.conditions);
|
|
118
|
+
extractedAttributeKeys.forEach(function (attributeKey) {
|
|
119
|
+
return attributeKeysUsedByTag.add(attributeKey);
|
|
120
|
+
});
|
|
121
|
+
return {
|
|
122
|
+
conditions: JSON.stringify(override.conditions),
|
|
123
|
+
value: override.value,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
if (typeof override.segments !== "undefined") {
|
|
127
|
+
var extractedSegmentKeys = (0, utils_1.extractSegmentKeysFromGroupSegments)(override.segments);
|
|
128
|
+
extractedSegmentKeys.forEach(function (segmentKey) {
|
|
129
|
+
return segmentKeysUsedByTag.add(segmentKey);
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
segments: JSON.stringify(override.segments),
|
|
133
|
+
value: override.value,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return override;
|
|
81
137
|
});
|
|
138
|
+
return mappedVariable;
|
|
139
|
+
});
|
|
140
|
+
return mappedVariation;
|
|
141
|
+
})
|
|
142
|
+
: undefined,
|
|
143
|
+
traffic: (0, traffic_1.getTraffic)(parsedFeature.variations, parsedFeature.environments[options.environment].rules, existingState.features[featureKey], featureRanges.get(featureKey) || []),
|
|
144
|
+
ranges: featureRanges.get(featureKey) || undefined,
|
|
145
|
+
};
|
|
146
|
+
// update state in memory, so that next datafile build can use it (in case it contains the same feature)
|
|
147
|
+
existingState.features[featureKey] = {
|
|
148
|
+
variations: Array.isArray(feature.variations)
|
|
149
|
+
? feature.variations.map(function (v) {
|
|
150
|
+
return {
|
|
151
|
+
value: v.value,
|
|
152
|
+
weight: v.weight || 0,
|
|
153
|
+
};
|
|
154
|
+
})
|
|
155
|
+
: undefined,
|
|
156
|
+
traffic: feature.traffic.map(function (t) {
|
|
157
|
+
return {
|
|
158
|
+
key: t.key,
|
|
159
|
+
percentage: t.percentage,
|
|
160
|
+
allocation: t.allocation.map(function (a) {
|
|
82
161
|
return {
|
|
83
|
-
|
|
84
|
-
|
|
162
|
+
variation: a.variation,
|
|
163
|
+
range: a.range,
|
|
85
164
|
};
|
|
86
|
-
}
|
|
87
|
-
return override;
|
|
88
|
-
});
|
|
89
|
-
return mappedVariable;
|
|
90
|
-
});
|
|
91
|
-
return mappedVariation;
|
|
92
|
-
})
|
|
93
|
-
: undefined,
|
|
94
|
-
traffic: (0, traffic_1.getTraffic)(parsedFeature.variations, parsedFeature.environments[options.environment].rules, existingState.features[featureKey], featureRanges.get(featureKey) || []),
|
|
95
|
-
ranges: featureRanges.get(featureKey) || undefined,
|
|
96
|
-
};
|
|
97
|
-
// update state in memory, so that next datafile build can use it (in case it contains the same feature)
|
|
98
|
-
existingState.features[featureKey] = {
|
|
99
|
-
variations: Array.isArray(feature.variations)
|
|
100
|
-
? feature.variations.map(function (v) {
|
|
101
|
-
return {
|
|
102
|
-
value: v.value,
|
|
103
|
-
weight: v.weight || 0,
|
|
104
|
-
};
|
|
105
|
-
})
|
|
106
|
-
: undefined,
|
|
107
|
-
traffic: feature.traffic.map(function (t) {
|
|
108
|
-
return {
|
|
109
|
-
key: t.key,
|
|
110
|
-
percentage: t.percentage,
|
|
111
|
-
allocation: t.allocation.map(function (a) {
|
|
112
|
-
return {
|
|
113
|
-
variation: a.variation,
|
|
114
|
-
range: a.range,
|
|
165
|
+
}),
|
|
115
166
|
};
|
|
116
167
|
}),
|
|
117
168
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
169
|
+
if (featureIsInGroup[featureKey] === true) {
|
|
170
|
+
feature.ranges = featureRanges.get(feature.key);
|
|
171
|
+
}
|
|
172
|
+
if (parsedFeature.variablesSchema) {
|
|
173
|
+
feature.variablesSchema = parsedFeature.variablesSchema;
|
|
174
|
+
}
|
|
175
|
+
if (parsedFeature.environments[options.environment].force) {
|
|
176
|
+
feature.force = parsedFeature.environments[options.environment].force;
|
|
177
|
+
}
|
|
178
|
+
features.push(feature);
|
|
179
|
+
_f.label = 5;
|
|
180
|
+
case 5:
|
|
181
|
+
_i++;
|
|
182
|
+
return [3 /*break*/, 3];
|
|
183
|
+
case 6:
|
|
184
|
+
segments = [];
|
|
185
|
+
segmentsDirectory = projectConfig.segmentsDirectoryPath;
|
|
186
|
+
if (!fs.existsSync(segmentsDirectory)) return [3 /*break*/, 11];
|
|
187
|
+
return [4 /*yield*/, datasource.listSegments()];
|
|
188
|
+
case 7:
|
|
189
|
+
segmentFiles = _f.sent();
|
|
190
|
+
_d = 0, segmentFiles_1 = segmentFiles;
|
|
191
|
+
_f.label = 8;
|
|
192
|
+
case 8:
|
|
193
|
+
if (!(_d < segmentFiles_1.length)) return [3 /*break*/, 11];
|
|
194
|
+
segmentKey = segmentFiles_1[_d];
|
|
195
|
+
return [4 /*yield*/, datasource.readSegment(segmentKey)];
|
|
196
|
+
case 9:
|
|
197
|
+
parsedSegment = _f.sent();
|
|
198
|
+
if (parsedSegment.archived === true) {
|
|
199
|
+
return [3 /*break*/, 10];
|
|
200
|
+
}
|
|
201
|
+
if (segmentKeysUsedByTag.has(segmentKey) === false) {
|
|
202
|
+
return [3 /*break*/, 10];
|
|
203
|
+
}
|
|
204
|
+
extractedAttributeKeys = (0, utils_1.extractAttributeKeysFromConditions)(parsedSegment.conditions);
|
|
205
|
+
extractedAttributeKeys.forEach(function (attributeKey) { return attributeKeysUsedByTag.add(attributeKey); });
|
|
206
|
+
segment = {
|
|
207
|
+
key: segmentKey,
|
|
208
|
+
conditions: typeof parsedSegment.conditions !== "string"
|
|
209
|
+
? JSON.stringify(parsedSegment.conditions)
|
|
210
|
+
: parsedSegment.conditions,
|
|
211
|
+
};
|
|
212
|
+
segments.push(segment);
|
|
213
|
+
_f.label = 10;
|
|
214
|
+
case 10:
|
|
215
|
+
_d++;
|
|
216
|
+
return [3 /*break*/, 8];
|
|
217
|
+
case 11:
|
|
218
|
+
attributes = [];
|
|
219
|
+
attributesDirectory = projectConfig.attributesDirectoryPath;
|
|
220
|
+
if (!fs.existsSync(attributesDirectory)) return [3 /*break*/, 16];
|
|
221
|
+
return [4 /*yield*/, datasource.listAttributes()];
|
|
222
|
+
case 12:
|
|
223
|
+
attributeFiles = _f.sent();
|
|
224
|
+
_e = 0, attributeFiles_1 = attributeFiles;
|
|
225
|
+
_f.label = 13;
|
|
226
|
+
case 13:
|
|
227
|
+
if (!(_e < attributeFiles_1.length)) return [3 /*break*/, 16];
|
|
228
|
+
attributeKey = attributeFiles_1[_e];
|
|
229
|
+
return [4 /*yield*/, datasource.readAttribute(attributeKey)];
|
|
230
|
+
case 14:
|
|
231
|
+
parsedAttribute = _f.sent();
|
|
232
|
+
if (parsedAttribute.archived === true) {
|
|
233
|
+
return [3 /*break*/, 15];
|
|
234
|
+
}
|
|
235
|
+
if (attributeKeysUsedByTag.has(attributeKey) === false && !parsedAttribute.capture) {
|
|
236
|
+
return [3 /*break*/, 15];
|
|
237
|
+
}
|
|
238
|
+
attribute = {
|
|
239
|
+
key: attributeKey,
|
|
240
|
+
type: parsedAttribute.type,
|
|
241
|
+
};
|
|
242
|
+
if (parsedAttribute.capture === true) {
|
|
243
|
+
attribute.capture = true;
|
|
244
|
+
}
|
|
245
|
+
attributes.push(attribute);
|
|
246
|
+
_f.label = 15;
|
|
247
|
+
case 15:
|
|
248
|
+
_e++;
|
|
249
|
+
return [3 /*break*/, 13];
|
|
250
|
+
case 16:
|
|
251
|
+
datafileContent.attributes = attributes;
|
|
252
|
+
datafileContent.segments = segments;
|
|
253
|
+
datafileContent.features = features;
|
|
254
|
+
return [2 /*return*/, datafileContent];
|
|
177
255
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
datafileContent.attributes = attributes;
|
|
182
|
-
datafileContent.segments = segments;
|
|
183
|
-
datafileContent.features = features;
|
|
184
|
-
return datafileContent;
|
|
256
|
+
});
|
|
257
|
+
});
|
|
185
258
|
}
|
|
186
259
|
exports.buildDatafile = buildDatafile;
|
|
187
260
|
//# sourceMappingURL=buildDatafile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildDatafile.js","sourceRoot":"","sources":["../../src/builder/buildDatafile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildDatafile.js","sourceRoot":"","sources":["../../src/builder/buildDatafile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAyB;AAsBzB,k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AAY,CAAA;;;oBA6BjC,UAAU,GAAgB,EAAE,CAAC;oBAC7B,mBAAmB,GAAG,aAAa,CAAC,uBAAuB,CAAC;yBAE9D,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAlC,yBAAkC;oBACb,qBAAM,UAAU,CAAC,cAAc,EAAE,EAAA;;oBAAlD,cAAc,GAAG,SAAiC;0BAEf,EAAd,iCAAc;;;yBAAd,CAAA,4BAAc,CAAA;oBAA9B,YAAY;oBACG,qBAAM,UAAU,CAAC,aAAa,CAAC,YAAY,CAAC,EAAA;;oBAA9D,eAAe,GAAG,SAA4C;oBAEpE,IAAI,eAAe,CAAC,QAAQ,KAAK,IAAI,EAAE;wBACrC,yBAAS;qBACV;oBAED,IAAI,sBAAsB,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,KAAK,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE;wBAClF,yBAAS;qBACV;oBAEK,SAAS,GAAc;wBAC3B,GAAG,EAAE,YAAY;wBACjB,IAAI,EAAE,eAAe,CAAC,IAAI;qBAC3B,CAAC;oBAEF,IAAI,eAAe,CAAC,OAAO,KAAK,IAAI,EAAE;wBACpC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;qBAC1B;oBAED,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;;;oBApBF,IAAc,CAAA;;;oBAwB3C,eAAe,CAAC,UAAU,GAAG,UAAU,CAAC;oBACxC,eAAe,CAAC,QAAQ,GAAG,QAAQ,CAAC;oBACpC,eAAe,CAAC,QAAQ,GAAG,QAAQ,CAAC;oBAEpC,sBAAO,eAAe,EAAC;;;;CACxB;AAzOD,sCAyOC"}
|
|
@@ -5,4 +5,4 @@ export declare function getExistingStateFilePath(projectConfig: ProjectConfig, e
|
|
|
5
5
|
export interface BuildCLIOptions {
|
|
6
6
|
revision?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function buildProject(rootDirectoryPath: any, projectConfig: ProjectConfig, cliOptions?: BuildCLIOptions): void
|
|
8
|
+
export declare function buildProject(rootDirectoryPath: any, projectConfig: ProjectConfig, cliOptions?: BuildCLIOptions): Promise<void>;
|