@fgv/ts-res 5.0.1-8 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.js +53 -0
- package/dist/index.js +45 -0
- package/dist/packlets/bundle/bundleBuilder.js +130 -0
- package/dist/packlets/bundle/bundleLoader.js +101 -0
- package/dist/packlets/bundle/bundleNormalizer.js +138 -0
- package/dist/packlets/bundle/bundleUtils.js +113 -0
- package/dist/packlets/bundle/convert.js +75 -0
- package/dist/packlets/bundle/index.js +42 -0
- package/dist/packlets/bundle/model.js +23 -0
- package/dist/packlets/common/conditions.js +47 -0
- package/dist/packlets/common/convert.js +172 -0
- package/dist/packlets/common/helpers/conditions.js +66 -0
- package/dist/packlets/common/helpers/context.js +70 -0
- package/dist/packlets/common/helpers/index.js +26 -0
- package/dist/packlets/common/helpers/qualifierDefaultValues.js +66 -0
- package/dist/packlets/common/helpers/resources.js +93 -0
- package/dist/packlets/common/index.js +28 -0
- package/dist/packlets/common/resources.js +27 -0
- package/dist/packlets/common/validate/conditions.js +544 -0
- package/dist/packlets/common/validate/index.js +26 -0
- package/dist/packlets/common/validate/regularExpressions.js +84 -0
- package/dist/packlets/common/validate/resources.js +209 -0
- package/dist/packlets/conditions/condition.js +252 -0
- package/dist/packlets/conditions/conditionCollector.js +69 -0
- package/dist/packlets/conditions/conditionDecls.js +23 -0
- package/dist/packlets/conditions/conditionSet.js +247 -0
- package/dist/packlets/conditions/conditionSetCollector.js +89 -0
- package/dist/packlets/conditions/conditionSetDecls.js +23 -0
- package/dist/packlets/conditions/conditionToken.js +147 -0
- package/dist/packlets/conditions/convert/conditionSetDecls.js +51 -0
- package/dist/packlets/conditions/convert/decls.js +75 -0
- package/dist/packlets/conditions/convert/index.js +24 -0
- package/dist/packlets/conditions/index.js +31 -0
- package/dist/packlets/config/common.js +78 -0
- package/dist/packlets/config/configInitFactory.js +258 -0
- package/dist/packlets/config/convert.js +56 -0
- package/dist/packlets/config/index.browser.js +34 -0
- package/dist/packlets/config/index.js +28 -0
- package/dist/packlets/config/json.js +23 -0
- package/dist/packlets/config/predefined/default.js +138 -0
- package/dist/packlets/config/predefined/extended.js +190 -0
- package/dist/packlets/config/predefined/index.js +25 -0
- package/dist/packlets/config/systemConfiguration.js +147 -0
- package/dist/packlets/context/contextDecls.js +23 -0
- package/dist/packlets/context/contextToken.js +202 -0
- package/dist/packlets/context/convert/decls.js +91 -0
- package/dist/packlets/context/convert/index.js +23 -0
- package/dist/packlets/context/index.js +26 -0
- package/dist/packlets/decisions/abstractDecision.js +68 -0
- package/dist/packlets/decisions/abstractDecisionCollector.js +90 -0
- package/dist/packlets/decisions/candidate.js +76 -0
- package/dist/packlets/decisions/common.js +23 -0
- package/dist/packlets/decisions/concreteDecision.js +111 -0
- package/dist/packlets/decisions/decision.js +126 -0
- package/dist/packlets/decisions/index.js +28 -0
- package/dist/packlets/import/fsItem.js +134 -0
- package/dist/packlets/import/importContext.js +129 -0
- package/dist/packlets/import/importManager.js +129 -0
- package/dist/packlets/import/importable.js +32 -0
- package/dist/packlets/import/importers/collectionImporter.js +118 -0
- package/dist/packlets/import/importers/fsItemImporter.js +116 -0
- package/dist/packlets/import/importers/importer.js +23 -0
- package/dist/packlets/import/importers/index.browser.js +29 -0
- package/dist/packlets/import/importers/index.js +27 -0
- package/dist/packlets/import/importers/jsonImporter.js +94 -0
- package/dist/packlets/import/importers/pathImporter.js +84 -0
- package/dist/packlets/import/index.browser.js +34 -0
- package/dist/packlets/import/index.js +28 -0
- package/dist/packlets/qualifier-types/config/convert.js +124 -0
- package/dist/packlets/qualifier-types/config/index.js +25 -0
- package/dist/packlets/qualifier-types/config/json.js +32 -0
- package/dist/packlets/qualifier-types/convert.js +56 -0
- package/dist/packlets/qualifier-types/helpers.js +82 -0
- package/dist/packlets/qualifier-types/index.js +32 -0
- package/dist/packlets/qualifier-types/languageQualifierType.js +142 -0
- package/dist/packlets/qualifier-types/literalQualifierType.js +200 -0
- package/dist/packlets/qualifier-types/literalValueHierarchy.js +236 -0
- package/dist/packlets/qualifier-types/qualifierType.js +184 -0
- package/dist/packlets/qualifier-types/qualifierTypeCollector.js +66 -0
- package/dist/packlets/qualifier-types/territoryQualifierType.js +200 -0
- package/dist/packlets/qualifiers/convert/decls.js +70 -0
- package/dist/packlets/qualifiers/convert/index.js +24 -0
- package/dist/packlets/qualifiers/convert/qualifier.js +40 -0
- package/dist/packlets/qualifiers/index.js +29 -0
- package/dist/packlets/qualifiers/qualifier.js +108 -0
- package/dist/packlets/qualifiers/qualifierCollector.js +123 -0
- package/dist/packlets/qualifiers/qualifierDecl.js +23 -0
- package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js +23 -0
- package/dist/packlets/qualifiers/qualifierDefaultValueToken.js +175 -0
- package/dist/packlets/resource-json/compiled/common.js +23 -0
- package/dist/packlets/resource-json/compiled/convert.js +132 -0
- package/dist/packlets/resource-json/compiled/index.js +26 -0
- package/dist/packlets/resource-json/compiled/json.js +2 -0
- package/dist/packlets/resource-json/convert.js +171 -0
- package/dist/packlets/resource-json/helpers.js +241 -0
- package/dist/packlets/resource-json/index.js +31 -0
- package/dist/packlets/resource-json/json.js +36 -0
- package/dist/packlets/resource-json/normalized.js +23 -0
- package/dist/packlets/resource-json/resourceDeclCollection.js +88 -0
- package/dist/packlets/resource-json/resourceDeclContainer.js +23 -0
- package/dist/packlets/resource-json/resourceDeclTree.js +94 -0
- package/dist/packlets/resource-types/config/convert.js +35 -0
- package/dist/packlets/resource-types/config/index.js +25 -0
- package/dist/packlets/resource-types/config/json.js +23 -0
- package/dist/packlets/resource-types/helpers.js +42 -0
- package/dist/packlets/resource-types/index.js +28 -0
- package/dist/packlets/resource-types/jsonResourceType.js +66 -0
- package/dist/packlets/resource-types/resourceType.js +95 -0
- package/dist/packlets/resource-types/resourceTypeCollector.js +61 -0
- package/dist/packlets/resources/candidateReducer.js +246 -0
- package/dist/packlets/resources/candidateValue.js +92 -0
- package/dist/packlets/resources/candidateValueCollector.js +94 -0
- package/dist/packlets/resources/common.js +23 -0
- package/dist/packlets/resources/deltaGenerator.js +338 -0
- package/dist/packlets/resources/index.js +31 -0
- package/dist/packlets/resources/resource.js +207 -0
- package/dist/packlets/resources/resourceBuilder.js +183 -0
- package/dist/packlets/resources/resourceCandidate.js +216 -0
- package/dist/packlets/resources/resourceManagerBuilder.js +890 -0
- package/dist/packlets/runtime/cacheListener.js +58 -0
- package/dist/packlets/runtime/cacheMetrics.js +149 -0
- package/dist/packlets/runtime/compiledResourceCollection.js +473 -0
- package/dist/packlets/runtime/conditionSetResolutionResult.js +134 -0
- package/dist/packlets/runtime/context/contextQualifierProvider.js +29 -0
- package/dist/packlets/runtime/context/contextQualifierProviderValidator.js +146 -0
- package/dist/packlets/runtime/context/index.js +26 -0
- package/dist/packlets/runtime/context/simpleContextQualifierProvider.js +196 -0
- package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +60 -0
- package/dist/packlets/runtime/iResourceManager.js +23 -0
- package/dist/packlets/runtime/index.js +34 -0
- package/dist/packlets/runtime/resource-tree/common.js +23 -0
- package/dist/packlets/runtime/resource-tree/index.js +26 -0
- package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js +216 -0
- package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js +97 -0
- package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +161 -0
- package/dist/packlets/runtime/resourceResolver.js +481 -0
- package/dist/packlets/runtime/resourceTreeResolver.js +220 -0
- package/dist/packlets/runtime/validate.js +47 -0
- package/dist/packlets/zip-archive/convert.js +100 -0
- package/dist/packlets/zip-archive/index.browser.js +54 -0
- package/dist/packlets/zip-archive/index.js +47 -0
- package/dist/packlets/zip-archive/json.js +23 -0
- package/dist/packlets/zip-archive/types.js +36 -0
- package/dist/packlets/zip-archive/zipArchiveCreator.js +191 -0
- package/dist/packlets/zip-archive/zipArchiveFormat.js +140 -0
- package/dist/packlets/zip-archive/zipArchiveLoader.js +282 -0
- package/dist/test/data/sample.json +32 -0
- package/dist/test/unit/qualifier-types/testQualifierType.js +76 -0
- package/dist/test/unit/resource-types/testDerivedResourceType.js +109 -0
- package/dist/test/unit/resources/deltaGenerator.helpers.js +282 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/index.browser.d.ts +24 -0
- package/lib/index.browser.js +116 -0
- package/lib/packlets/config/index.browser.d.ts +7 -0
- package/lib/packlets/config/index.browser.js +74 -0
- package/lib/packlets/import/importers/index.browser.d.ts +4 -0
- package/lib/packlets/import/importers/index.browser.js +45 -0
- package/lib/packlets/import/index.browser.d.ts +7 -0
- package/lib/packlets/import/index.browser.js +74 -0
- package/lib/packlets/zip-archive/index.browser.d.ts +27 -0
- package/lib/packlets/zip-archive/index.browser.js +102 -0
- package/package.json +21 -7
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Erik Fortune
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
* in the Software without restriction, including without limitation the rights
|
|
7
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
* furnished to do so, subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
* copies or substantial portions of the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
* SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
import { captureResult, fail, succeed } from '@fgv/ts-utils';
|
|
23
|
+
import * as TsRes from '../../../index';
|
|
24
|
+
export class TestQualifierType extends TsRes.QualifierTypes.QualifierType {
|
|
25
|
+
constructor(params) {
|
|
26
|
+
var _a;
|
|
27
|
+
super({
|
|
28
|
+
name: (_a = params === null || params === void 0 ? void 0 : params.name) !== null && _a !== void 0 ? _a : 'test',
|
|
29
|
+
allowContextList: (params === null || params === void 0 ? void 0 : params.allowContextList) === 'true',
|
|
30
|
+
index: params === null || params === void 0 ? void 0 : params.index
|
|
31
|
+
});
|
|
32
|
+
this.systemTypeName = TsRes.Convert.qualifierTypeName
|
|
33
|
+
.convert('test')
|
|
34
|
+
.orThrow();
|
|
35
|
+
}
|
|
36
|
+
static create(params) {
|
|
37
|
+
return captureResult(() => new TestQualifierType(params));
|
|
38
|
+
}
|
|
39
|
+
isValidConditionValue(value) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
validateCondition(value, operator) {
|
|
43
|
+
return this.isValidConditionValue(value) ? succeed(value) : fail(`Invalid condition value: ${value}`);
|
|
44
|
+
}
|
|
45
|
+
getConfigurationJson() {
|
|
46
|
+
return succeed({
|
|
47
|
+
name: this.name,
|
|
48
|
+
systemType: 'test',
|
|
49
|
+
configuration: {}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
validateConfigurationJson(from) {
|
|
53
|
+
// Simple validation for test class
|
|
54
|
+
if (typeof from !== 'object' || from === null) {
|
|
55
|
+
return fail('Expected object');
|
|
56
|
+
}
|
|
57
|
+
const obj = from;
|
|
58
|
+
if (typeof obj.name !== 'string') {
|
|
59
|
+
return fail('name must be string');
|
|
60
|
+
}
|
|
61
|
+
if (obj.systemType !== 'test') {
|
|
62
|
+
return fail('systemType must be test');
|
|
63
|
+
}
|
|
64
|
+
return succeed(from);
|
|
65
|
+
}
|
|
66
|
+
_matchOne(condition, context, operator) {
|
|
67
|
+
if (condition === context) {
|
|
68
|
+
return TsRes.PerfectMatch;
|
|
69
|
+
}
|
|
70
|
+
if (condition.toLowerCase() === context.toLowerCase()) {
|
|
71
|
+
return 0.5;
|
|
72
|
+
}
|
|
73
|
+
return TsRes.NoMatch;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=testQualifierType.js.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Erik Fortune
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
* in the Software without restriction, including without limitation the rights
|
|
7
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
* furnished to do so, subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
* copies or substantial portions of the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
* SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
import { captureResult, fail, succeed } from '@fgv/ts-utils';
|
|
23
|
+
import { Convert } from '../../../packlets/common';
|
|
24
|
+
// eslint-disable-next-line @rushstack/packlets/mechanics
|
|
25
|
+
import { ResourceType } from '../../../packlets/resource-types/resourceType';
|
|
26
|
+
/**
|
|
27
|
+
* A derived resource type for testing that demonstrates:
|
|
28
|
+
* 1. Custom validation logic
|
|
29
|
+
* 2. Using a resource resolver to look up template values
|
|
30
|
+
* 3. Type-specific defaults and error handling
|
|
31
|
+
*/
|
|
32
|
+
export class TestDerivedResourceType extends ResourceType {
|
|
33
|
+
constructor(key, index, template, templateResourceId) {
|
|
34
|
+
super(key, index, template);
|
|
35
|
+
this.systemTypeName = Convert.resourceTypeName
|
|
36
|
+
.convert('test-derived')
|
|
37
|
+
.orThrow();
|
|
38
|
+
this._templateResourceId = templateResourceId;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Factory method to create a new TestDerivedResourceType instance.
|
|
42
|
+
*/
|
|
43
|
+
static create(params) {
|
|
44
|
+
var _a;
|
|
45
|
+
return Convert.resourceTypeName.convert((_a = params === null || params === void 0 ? void 0 : params.key) !== null && _a !== void 0 ? _a : 'test-derived').onSuccess((key) => {
|
|
46
|
+
return captureResult(() => new TestDerivedResourceType(key, params === null || params === void 0 ? void 0 : params.index, params === null || params === void 0 ? void 0 : params.template, params === null || params === void 0 ? void 0 : params.templateResourceId));
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Validates a resource candidate declaration with custom logic.
|
|
51
|
+
*/
|
|
52
|
+
validateDeclaration(props) {
|
|
53
|
+
// Custom validation: merge method must be 'replace' for full candidates
|
|
54
|
+
if (props.completeness === 'full' && props.mergeMethod !== 'replace') {
|
|
55
|
+
return fail(`${this.key}: Full candidates must use 'replace' merge method, got '${props.mergeMethod}'`);
|
|
56
|
+
}
|
|
57
|
+
return this.validate(props.json, props.completeness);
|
|
58
|
+
}
|
|
59
|
+
validate(json, completeness) {
|
|
60
|
+
if (typeof json !== 'object' || json === null || Array.isArray(json)) {
|
|
61
|
+
return fail(`${this.key}: Expected JSON object, got ${typeof json}`);
|
|
62
|
+
}
|
|
63
|
+
const obj = json;
|
|
64
|
+
// Validate required title field for full resources
|
|
65
|
+
if (completeness === 'full' && (typeof obj.title !== 'string' || !obj.title.trim())) {
|
|
66
|
+
return fail(`${this.key}: 'title' field is required and must be a non-empty string`);
|
|
67
|
+
}
|
|
68
|
+
// Validate optional description
|
|
69
|
+
if (obj.description !== undefined && typeof obj.description !== 'string') {
|
|
70
|
+
return fail(`${this.key}: 'description' field must be a string if provided`);
|
|
71
|
+
}
|
|
72
|
+
// Validate optional metadata
|
|
73
|
+
if (obj.metadata !== undefined) {
|
|
74
|
+
if (typeof obj.metadata !== 'object' || obj.metadata === null || Array.isArray(obj.metadata)) {
|
|
75
|
+
return fail(`${this.key}: 'metadata' field must be an object if provided`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const result = Object.assign(Object.assign(Object.assign({}, (obj.title && { title: obj.title })), (obj.description && { description: obj.description })), (obj.metadata && { metadata: obj.metadata }));
|
|
79
|
+
return succeed(result);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Override to demonstrate looking up template values from another resource.
|
|
83
|
+
*/
|
|
84
|
+
getDefaultTemplateCandidate(json, conditions, resolver) {
|
|
85
|
+
// If a template resource ID is configured and resolver is available, try to resolve it
|
|
86
|
+
if (this._templateResourceId && resolver && !json) {
|
|
87
|
+
return resolver
|
|
88
|
+
.resolveComposedResourceValue(this._templateResourceId)
|
|
89
|
+
.onFailure((error) => fail(`${this.key}: Failed to resolve template resource '${this._templateResourceId}': ${error}`))
|
|
90
|
+
.onSuccess((resolvedValue) => {
|
|
91
|
+
// Use the resolved value as our JSON template
|
|
92
|
+
return super.getDefaultTemplateCandidate(resolvedValue, conditions, resolver);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// Use provided JSON or fall back to base implementation
|
|
96
|
+
return super.getDefaultTemplateCandidate(json, conditions, resolver);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Override createTemplate to add additional validation for the derived type.
|
|
100
|
+
*/
|
|
101
|
+
createTemplate(resourceId, init, conditions, resolver) {
|
|
102
|
+
// Additional validation: warn if trying to use resolver functionality without a resolver
|
|
103
|
+
if (this._templateResourceId && !resolver) {
|
|
104
|
+
return fail(`${this.key}: Template resource ID '${this._templateResourceId}' is configured but no resolver provided`);
|
|
105
|
+
}
|
|
106
|
+
return super.createTemplate(resourceId, init, conditions, resolver);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=testDerivedResourceType.js.map
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Erik Fortune
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
* in the Software without restriction, including without limitation the rights
|
|
7
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
* furnished to do so, subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
* copies or substantial portions of the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
* SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
import '@fgv/ts-utils-jest';
|
|
23
|
+
import { succeed, fail } from '@fgv/ts-utils';
|
|
24
|
+
import * as TsRes from '../../../index';
|
|
25
|
+
/**
|
|
26
|
+
* Common test data and setup utilities for DeltaGenerator tests
|
|
27
|
+
*/
|
|
28
|
+
// Test resource candidates for baseline and delta scenarios
|
|
29
|
+
export const baselineResources = [
|
|
30
|
+
{
|
|
31
|
+
id: 'greeting.hello',
|
|
32
|
+
json: { message: 'Hello', casual: 'Hi' },
|
|
33
|
+
conditions: { language: 'en' },
|
|
34
|
+
resourceTypeName: 'json'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'greeting.goodbye',
|
|
38
|
+
json: { message: 'Goodbye', casual: 'Bye' },
|
|
39
|
+
conditions: { language: 'en' },
|
|
40
|
+
resourceTypeName: 'json'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 'numbers.count',
|
|
44
|
+
json: { one: 'one', two: 'two', three: 'three' },
|
|
45
|
+
conditions: { language: 'en' },
|
|
46
|
+
resourceTypeName: 'json'
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
export const deltaResources = [
|
|
50
|
+
// Updated resource - some changes
|
|
51
|
+
{
|
|
52
|
+
id: 'greeting.hello',
|
|
53
|
+
json: { message: 'Hello World', casual: 'Hi there' },
|
|
54
|
+
conditions: { language: 'en' },
|
|
55
|
+
resourceTypeName: 'json'
|
|
56
|
+
},
|
|
57
|
+
// New resource - not in baseline
|
|
58
|
+
{
|
|
59
|
+
id: 'greeting.welcome',
|
|
60
|
+
json: { message: 'Welcome', casual: 'Hey' },
|
|
61
|
+
conditions: { language: 'en' },
|
|
62
|
+
resourceTypeName: 'json'
|
|
63
|
+
},
|
|
64
|
+
// Unchanged resource - identical to baseline
|
|
65
|
+
{
|
|
66
|
+
id: 'numbers.count',
|
|
67
|
+
json: { one: 'one', two: 'two', three: 'three' },
|
|
68
|
+
conditions: { language: 'en' },
|
|
69
|
+
resourceTypeName: 'json'
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
/**
|
|
73
|
+
* Creates the base test setup with qualifier types, qualifiers, and resource types
|
|
74
|
+
*/
|
|
75
|
+
export function createBaseTestSetup() {
|
|
76
|
+
// Set up qualifier types
|
|
77
|
+
const qualifierTypes = TsRes.QualifierTypes.QualifierTypeCollector.create({
|
|
78
|
+
qualifierTypes: [
|
|
79
|
+
TsRes.QualifierTypes.LanguageQualifierType.create().orThrow(),
|
|
80
|
+
TsRes.QualifierTypes.TerritoryQualifierType.create().orThrow()
|
|
81
|
+
]
|
|
82
|
+
}).orThrow();
|
|
83
|
+
// Set up qualifiers
|
|
84
|
+
const qualifiers = TsRes.Qualifiers.QualifierCollector.create({
|
|
85
|
+
qualifierTypes,
|
|
86
|
+
qualifiers: [
|
|
87
|
+
{ name: 'language', typeName: 'language', defaultPriority: 100 },
|
|
88
|
+
{ name: 'territory', typeName: 'territory', defaultPriority: 90 }
|
|
89
|
+
]
|
|
90
|
+
}).orThrow();
|
|
91
|
+
// Set up resource types
|
|
92
|
+
const resourceTypes = TsRes.ResourceTypes.ResourceTypeCollector.create({
|
|
93
|
+
resourceTypes: [TsRes.ResourceTypes.JsonResourceType.create().orThrow()]
|
|
94
|
+
}).orThrow();
|
|
95
|
+
// Set up context provider
|
|
96
|
+
const contextProvider = TsRes.Runtime.ValidatingSimpleContextQualifierProvider.create({
|
|
97
|
+
qualifiers,
|
|
98
|
+
qualifierValues: {
|
|
99
|
+
language: 'en',
|
|
100
|
+
territory: 'US'
|
|
101
|
+
}
|
|
102
|
+
}).orThrow();
|
|
103
|
+
return {
|
|
104
|
+
qualifierTypes,
|
|
105
|
+
qualifiers,
|
|
106
|
+
resourceTypes,
|
|
107
|
+
contextProvider
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Creates a mock logger for testing
|
|
112
|
+
*/
|
|
113
|
+
export function createMockLogger() {
|
|
114
|
+
return {
|
|
115
|
+
logLevel: 'detail',
|
|
116
|
+
log: jest.fn(),
|
|
117
|
+
detail: jest.fn(),
|
|
118
|
+
info: jest.fn(),
|
|
119
|
+
warn: jest.fn(),
|
|
120
|
+
error: jest.fn()
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Creates a resource manager with baseline resources
|
|
125
|
+
*/
|
|
126
|
+
export function createResourceManagerWithBaseline(qualifiers, resourceTypes, resources = baselineResources) {
|
|
127
|
+
const resourceManager = TsRes.Resources.ResourceManagerBuilder.create({
|
|
128
|
+
qualifiers,
|
|
129
|
+
resourceTypes
|
|
130
|
+
}).orThrow();
|
|
131
|
+
// Add resources
|
|
132
|
+
resources.forEach((resource) => {
|
|
133
|
+
resourceManager.addLooseCandidate(resource).orThrow();
|
|
134
|
+
});
|
|
135
|
+
return resourceManager;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Creates a baseline resolver with the given resources
|
|
139
|
+
*/
|
|
140
|
+
export function createBaselineResolver(resourceManager, qualifierTypes, contextProvider) {
|
|
141
|
+
const builtManager = resourceManager.build().orThrow();
|
|
142
|
+
return TsRes.Runtime.ResourceResolver.create({
|
|
143
|
+
resourceManager: builtManager,
|
|
144
|
+
qualifierTypes,
|
|
145
|
+
contextQualifierProvider: contextProvider
|
|
146
|
+
}).orThrow();
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Creates a delta resolver with the given resources
|
|
150
|
+
*/
|
|
151
|
+
export function createDeltaResolver(resources, qualifiers, resourceTypes, qualifierTypes, contextProvider) {
|
|
152
|
+
const deltaManager = TsRes.Resources.ResourceManagerBuilder.create({
|
|
153
|
+
qualifiers,
|
|
154
|
+
resourceTypes
|
|
155
|
+
}).orThrow();
|
|
156
|
+
resources.forEach((resource) => {
|
|
157
|
+
deltaManager.addLooseCandidate(resource).orThrow();
|
|
158
|
+
});
|
|
159
|
+
const builtDeltaManager = deltaManager.build().orThrow();
|
|
160
|
+
return TsRes.Runtime.ResourceResolver.create({
|
|
161
|
+
resourceManager: builtDeltaManager,
|
|
162
|
+
qualifierTypes,
|
|
163
|
+
contextQualifierProvider: contextProvider
|
|
164
|
+
}).orThrow();
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Creates a complete test setup with all required objects
|
|
168
|
+
*/
|
|
169
|
+
export function createCompleteTestSetup() {
|
|
170
|
+
const baseSetup = createBaseTestSetup();
|
|
171
|
+
const mockLogger = createMockLogger();
|
|
172
|
+
const resourceManager = createResourceManagerWithBaseline(baseSetup.qualifiers, baseSetup.resourceTypes);
|
|
173
|
+
return Object.assign(Object.assign({}, baseSetup), { resourceManager,
|
|
174
|
+
mockLogger });
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Test data for various test scenarios
|
|
178
|
+
*/
|
|
179
|
+
export const testData = {
|
|
180
|
+
// Resources with language variations
|
|
181
|
+
languageResources: {
|
|
182
|
+
baseline: [
|
|
183
|
+
{
|
|
184
|
+
id: 'greeting.hello',
|
|
185
|
+
json: { message: 'Hello' },
|
|
186
|
+
conditions: { language: 'en-US' },
|
|
187
|
+
resourceTypeName: 'json'
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
id: 'greeting.goodbye',
|
|
191
|
+
json: { message: 'Goodbye' },
|
|
192
|
+
conditions: { language: 'en-US' },
|
|
193
|
+
resourceTypeName: 'json'
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
britishEnglish: [
|
|
197
|
+
{
|
|
198
|
+
id: 'greeting.hello',
|
|
199
|
+
json: { message: 'Hello' },
|
|
200
|
+
conditions: { language: 'en-GB' },
|
|
201
|
+
resourceTypeName: 'json'
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: 'greeting.goodbye',
|
|
205
|
+
json: { message: 'Cheerio' },
|
|
206
|
+
conditions: { language: 'en-GB' },
|
|
207
|
+
resourceTypeName: 'json'
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: 'greeting.thanks',
|
|
211
|
+
json: { message: 'Cheers' },
|
|
212
|
+
conditions: { language: 'en-GB' },
|
|
213
|
+
resourceTypeName: 'json'
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
canadianEnglish: [
|
|
217
|
+
{
|
|
218
|
+
id: 'greeting.hello',
|
|
219
|
+
json: { message: 'Hello' },
|
|
220
|
+
conditions: { language: 'en-CA' },
|
|
221
|
+
resourceTypeName: 'json'
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: 'greeting.goodbye',
|
|
225
|
+
json: { message: 'See ya' },
|
|
226
|
+
conditions: { language: 'en-CA' },
|
|
227
|
+
resourceTypeName: 'json'
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
id: 'greeting.apology',
|
|
231
|
+
json: { message: 'Sorry' },
|
|
232
|
+
conditions: { language: 'en-CA' },
|
|
233
|
+
resourceTypeName: 'json'
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
// Empty scenarios
|
|
238
|
+
emptyResources: [],
|
|
239
|
+
// Complex nested resources
|
|
240
|
+
complexResources: [
|
|
241
|
+
{
|
|
242
|
+
id: 'app.config',
|
|
243
|
+
json: {
|
|
244
|
+
settings: {
|
|
245
|
+
theme: 'dark',
|
|
246
|
+
notifications: {
|
|
247
|
+
enabled: true,
|
|
248
|
+
frequency: 'daily',
|
|
249
|
+
types: ['email', 'push']
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
metadata: {
|
|
253
|
+
version: '1.0.0',
|
|
254
|
+
lastUpdated: '2025-01-01'
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
conditions: { language: 'en' },
|
|
258
|
+
resourceTypeName: 'json'
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* Helper to create a failing resolver for error testing
|
|
264
|
+
*/
|
|
265
|
+
export function createFailingResolver(errorMessage) {
|
|
266
|
+
return {
|
|
267
|
+
resourceIds: [],
|
|
268
|
+
resolveComposedResourceValue: jest.fn().mockReturnValue(fail(errorMessage)),
|
|
269
|
+
withContext: jest.fn().mockReturnValue(succeed({}))
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Helper to create a custom resolver with specific behavior
|
|
274
|
+
*/
|
|
275
|
+
export function createCustomResolver(resolveImpl, resourceIds = []) {
|
|
276
|
+
return {
|
|
277
|
+
resourceIds,
|
|
278
|
+
resolveComposedResourceValue: jest.fn().mockImplementation(resolveImpl),
|
|
279
|
+
withContext: jest.fn().mockReturnValue(succeed({}))
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=deltaGenerator.helpers.js.map
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as Bundle from './packlets/bundle';
|
|
2
|
+
import * as QualifierTypes from './packlets/qualifier-types';
|
|
3
|
+
import * as Qualifiers from './packlets/qualifiers';
|
|
4
|
+
import * as Conditions from './packlets/conditions';
|
|
5
|
+
import * as Config from './packlets/config/index.browser';
|
|
6
|
+
import * as Context from './packlets/context';
|
|
7
|
+
import * as Decisions from './packlets/decisions';
|
|
8
|
+
import * as ResourceJson from './packlets/resource-json';
|
|
9
|
+
import * as Resources from './packlets/resources';
|
|
10
|
+
import * as ResourceTypes from './packlets/resource-types';
|
|
11
|
+
import * as Import from './packlets/import/index.browser';
|
|
12
|
+
import * as Runtime from './packlets/runtime';
|
|
13
|
+
import * as ZipArchive from './packlets/zip-archive/index.browser';
|
|
14
|
+
export * from './packlets/common';
|
|
15
|
+
import { Condition, ConditionSet } from './packlets/conditions';
|
|
16
|
+
import { Decision } from './packlets/decisions';
|
|
17
|
+
import { QualifierType } from './packlets/qualifier-types';
|
|
18
|
+
import { Qualifier } from './packlets/qualifiers';
|
|
19
|
+
import { ResourceType } from './packlets/resource-types';
|
|
20
|
+
import { Resource, ResourceCandidate, ResourceManagerBuilder } from './packlets/resources';
|
|
21
|
+
import { IResourceManager, ResourceResolver } from './packlets/runtime';
|
|
22
|
+
import { BundleBuilder, BundleLoader } from './packlets/bundle';
|
|
23
|
+
export { Bundle, BundleBuilder, BundleLoader, Condition, Conditions, ConditionSet, Config, Context, Decision, Decisions, Import, IResourceManager, Qualifier, QualifierType, QualifierTypes, Qualifiers, Resource, ResourceCandidate, ResourceJson, ResourceResolver, ResourceManagerBuilder, ResourceType, ResourceTypes, Resources, Runtime, ZipArchive };
|
|
24
|
+
//# sourceMappingURL=index.browser.d.ts.map
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}) : function(o, v) {
|
|
37
|
+
o["default"] = v;
|
|
38
|
+
});
|
|
39
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
+
var ownKeys = function(o) {
|
|
41
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
+
var ar = [];
|
|
43
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
+
return ar;
|
|
45
|
+
};
|
|
46
|
+
return ownKeys(o);
|
|
47
|
+
};
|
|
48
|
+
return function (mod) {
|
|
49
|
+
if (mod && mod.__esModule) return mod;
|
|
50
|
+
var result = {};
|
|
51
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
+
__setModuleDefault(result, mod);
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
56
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
57
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
58
|
+
};
|
|
59
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
+
exports.ZipArchive = exports.Runtime = exports.Resources = exports.ResourceTypes = exports.ResourceType = exports.ResourceManagerBuilder = exports.ResourceResolver = exports.ResourceJson = exports.ResourceCandidate = exports.Resource = exports.Qualifiers = exports.QualifierTypes = exports.QualifierType = exports.Qualifier = exports.Import = exports.Decisions = exports.Decision = exports.Context = exports.Config = exports.ConditionSet = exports.Conditions = exports.Condition = exports.BundleLoader = exports.BundleBuilder = exports.Bundle = void 0;
|
|
61
|
+
// Browser entry point - excludes Node.js filesystem dependencies
|
|
62
|
+
const Bundle = __importStar(require("./packlets/bundle"));
|
|
63
|
+
exports.Bundle = Bundle;
|
|
64
|
+
const QualifierTypes = __importStar(require("./packlets/qualifier-types"));
|
|
65
|
+
exports.QualifierTypes = QualifierTypes;
|
|
66
|
+
const Qualifiers = __importStar(require("./packlets/qualifiers"));
|
|
67
|
+
exports.Qualifiers = Qualifiers;
|
|
68
|
+
const Conditions = __importStar(require("./packlets/conditions"));
|
|
69
|
+
exports.Conditions = Conditions;
|
|
70
|
+
// eslint-disable-next-line @rushstack/packlets/mechanics -- browser-specific entry point excludes Node.js fs dependencies
|
|
71
|
+
const Config = __importStar(require("./packlets/config/index.browser"));
|
|
72
|
+
exports.Config = Config;
|
|
73
|
+
const Context = __importStar(require("./packlets/context"));
|
|
74
|
+
exports.Context = Context;
|
|
75
|
+
const Decisions = __importStar(require("./packlets/decisions"));
|
|
76
|
+
exports.Decisions = Decisions;
|
|
77
|
+
const ResourceJson = __importStar(require("./packlets/resource-json"));
|
|
78
|
+
exports.ResourceJson = ResourceJson;
|
|
79
|
+
const Resources = __importStar(require("./packlets/resources"));
|
|
80
|
+
exports.Resources = Resources;
|
|
81
|
+
const ResourceTypes = __importStar(require("./packlets/resource-types"));
|
|
82
|
+
exports.ResourceTypes = ResourceTypes;
|
|
83
|
+
// eslint-disable-next-line @rushstack/packlets/mechanics -- browser-specific entry point excludes Node.js fs dependencies
|
|
84
|
+
const Import = __importStar(require("./packlets/import/index.browser"));
|
|
85
|
+
exports.Import = Import;
|
|
86
|
+
const Runtime = __importStar(require("./packlets/runtime"));
|
|
87
|
+
exports.Runtime = Runtime;
|
|
88
|
+
// eslint-disable-next-line @rushstack/packlets/mechanics -- browser-specific entry point excludes Node.js fs dependencies
|
|
89
|
+
const ZipArchive = __importStar(require("./packlets/zip-archive/index.browser"));
|
|
90
|
+
exports.ZipArchive = ZipArchive;
|
|
91
|
+
__exportStar(require("./packlets/common"), exports);
|
|
92
|
+
const conditions_1 = require("./packlets/conditions");
|
|
93
|
+
Object.defineProperty(exports, "Condition", { enumerable: true, get: function () { return conditions_1.Condition; } });
|
|
94
|
+
Object.defineProperty(exports, "ConditionSet", { enumerable: true, get: function () { return conditions_1.ConditionSet; } });
|
|
95
|
+
const decisions_1 = require("./packlets/decisions");
|
|
96
|
+
Object.defineProperty(exports, "Decision", { enumerable: true, get: function () { return decisions_1.Decision; } });
|
|
97
|
+
const qualifier_types_1 = require("./packlets/qualifier-types");
|
|
98
|
+
Object.defineProperty(exports, "QualifierType", { enumerable: true, get: function () { return qualifier_types_1.QualifierType; } });
|
|
99
|
+
const qualifiers_1 = require("./packlets/qualifiers");
|
|
100
|
+
Object.defineProperty(exports, "Qualifier", { enumerable: true, get: function () { return qualifiers_1.Qualifier; } });
|
|
101
|
+
const resource_types_1 = require("./packlets/resource-types");
|
|
102
|
+
Object.defineProperty(exports, "ResourceType", { enumerable: true, get: function () { return resource_types_1.ResourceType; } });
|
|
103
|
+
const resources_1 = require("./packlets/resources");
|
|
104
|
+
Object.defineProperty(exports, "Resource", { enumerable: true, get: function () { return resources_1.Resource; } });
|
|
105
|
+
Object.defineProperty(exports, "ResourceCandidate", { enumerable: true, get: function () { return resources_1.ResourceCandidate; } });
|
|
106
|
+
Object.defineProperty(exports, "ResourceManagerBuilder", { enumerable: true, get: function () { return resources_1.ResourceManagerBuilder; } });
|
|
107
|
+
const runtime_1 = require("./packlets/runtime");
|
|
108
|
+
Object.defineProperty(exports, "ResourceResolver", { enumerable: true, get: function () { return runtime_1.ResourceResolver; } });
|
|
109
|
+
const bundle_1 = require("./packlets/bundle");
|
|
110
|
+
Object.defineProperty(exports, "BundleBuilder", { enumerable: true, get: function () { return bundle_1.BundleBuilder; } });
|
|
111
|
+
Object.defineProperty(exports, "BundleLoader", { enumerable: true, get: function () { return bundle_1.BundleLoader; } });
|
|
112
|
+
// Excluded from browser:
|
|
113
|
+
// - Config: SystemConfiguration.loadFromFile() (requires Node.js fs via JsonFile)
|
|
114
|
+
// - Import: PathImporter, FsItemImporter, FsItem.createForPath() (require Node.js fs)
|
|
115
|
+
// - ZipArchive: ZipArchiveCreator methods using file paths (require Node.js fs)
|
|
116
|
+
//# sourceMappingURL=index.browser.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as Model from './json';
|
|
2
|
+
import * as Convert from './convert';
|
|
3
|
+
export * from './configInitFactory';
|
|
4
|
+
export * from './common';
|
|
5
|
+
export { SystemConfiguration } from './systemConfiguration';
|
|
6
|
+
export { Model, Convert };
|
|
7
|
+
//# sourceMappingURL=index.browser.d.ts.map
|