componentsjs 5.0.0-beta.5 → 5.0.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/CHANGELOG.md CHANGED
@@ -1,6 +1,30 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ <a name="v5.0.0"></a>
5
+ ## [v5.0.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.7...v5.0.0) - 2022-03-01
6
+
7
+ ### Changed
8
+ * [Bump context URL to 5.0.0](https://github.com/LinkedSoftwareDependencies/Components.js/commit/495654fa70f559aaaa86a0960686fd1ca23f9546)
9
+ * [Add incorrect version number as possible cause for remote lookup failure (#67)](https://github.com/LinkedSoftwareDependencies/Components.js/commit/adf1d7e092b95a2fc47c7d2da3dfe191fdb741aa)
10
+
11
+ <a name="v5.0.0-beta.7"></a>
12
+ ## [v5.0.0-beta.7](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.6...v5.0.0-beta.7) - 2022-02-21
13
+
14
+ ### Changed
15
+ * [Lower log level of empty modules to debug](https://github.com/LinkedSoftwareDependencies/Components.js/commit/df119861bc12992e05af05b42f0a734069de6915)
16
+ * [Bump to rdf-object 1.13.1](https://github.com/LinkedSoftwareDependencies/Components.js/commit/264be522079f86bd47bea9fe5730eaed29bbe450)
17
+
18
+ ### Fixed
19
+ * [Fix incorrect error logging when generics error occurs in extends clause](https://github.com/LinkedSoftwareDependencies/Components.js/commit/1ce62d39896ca498ecba7443c9c7c298c9db0301)
20
+ * [Fix minor context issues](https://github.com/LinkedSoftwareDependencies/Components.js/commit/7adcd5fe0de73a42c8225069752be40214f843f3)
21
+
22
+ <a name="v5.0.0-beta.6"></a>
23
+ ## [v5.0.0-beta.6](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.5...v5.0.0-beta.6) - 2022-02-09
24
+
25
+ ### Fixed
26
+ * [Fix generic errors still throwing during ignored type checking](https://github.com/LinkedSoftwareDependencies/Components.js/commit/c14adcf4757e5194db22c0f0285407bd03bf5635)
27
+
4
28
  <a name="v5.0.0-beta.5"></a>
5
29
  ## [v5.0.0-beta.5](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.4...v5.0.0-beta.5) - 2022-02-08
6
30
 
@@ -33,7 +33,7 @@
33
33
  "@id": "oo:parameter"
34
34
  },
35
35
  "memberFields": {
36
- "@id": "oo:memberFields"
36
+ "@id": "oo:memberField"
37
37
  },
38
38
  "memberFieldName": {
39
39
  "@id": "oo:memberFieldName"
@@ -111,8 +111,11 @@
111
111
  "ParameterRangeIntersection": {
112
112
  "@id": "oo:ParameterRangeIntersection"
113
113
  },
114
+ "ParameterRangeTuple": {
115
+ "@id": "oo:ParameterRangeTuple"
116
+ },
114
117
  "parameterRangeElements": {
115
- "@id": "oo:parameterRangeElements",
118
+ "@id": "oo:parameterRangeElement",
116
119
  "@type": "@id"
117
120
  },
118
121
  "ParameterRangeCollectEntries": {
@@ -141,12 +144,9 @@
141
144
  "@type": "@id"
142
145
  },
143
146
  "parameterRangeGenericBindings": {
144
- "@id": "oo:parameterRangeGenericBindings",
147
+ "@id": "oo:parameterRangeGenericBinding",
145
148
  "@type": "@id"
146
149
  },
147
- "GenericComponentExtension": {
148
- "@id": "oo:GenericComponentExtension"
149
- },
150
150
  "ParameterRangeIndexed": {
151
151
  "@id": "oo:ParameterRangeIndexed"
152
152
  },
@@ -158,6 +158,9 @@
158
158
  "@id": "oo:parameterRangeIndexedIndex",
159
159
  "@type": "@id"
160
160
  },
161
+ "GenericComponentExtension": {
162
+ "@id": "oo:GenericComponentExtension"
163
+ },
161
164
 
162
165
  "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
163
166
  "comment": {
@@ -60,7 +60,7 @@ class ComponentRegistry {
60
60
  }
61
61
  }
62
62
  else {
63
- this.logger.warn(`Registered a module ${moduleResource.value} without components.`);
63
+ this.logger.debug(`Registered a module ${moduleResource.value} without components.`);
64
64
  }
65
65
  }
66
66
  /**
@@ -97,8 +97,11 @@ class ConfigPreprocessorComponent {
97
97
  // ParameterPropertyHandlerRange#hasParamValueValidType)
98
98
  if (config.property.genericTypeInstancesComponentScope &&
99
99
  handleResponse.component.value === config.property.genericTypeInstancesComponentScope.value) {
100
- genericsContext.bindComponentGenericTypes(handleResponse.component, config.properties.genericTypeInstances, { config }, (subType, superType) => this.parameterHandler.parameterPropertyHandlerRange
100
+ const conflict = genericsContext.bindComponentGenericTypes(handleResponse.component, config.properties.genericTypeInstances, { config }, (subType, superType) => this.parameterHandler.parameterPropertyHandlerRange
101
101
  .hasType(subType, superType, genericsContext, config.property.genericTypeInstancesComponentScope, config.properties.genericTypeInstances, { config }));
102
+ if (conflict) {
103
+ throw new ErrorResourcesContext_1.ErrorResourcesContext(conflict.description, { cause: conflict });
104
+ }
102
105
  }
103
106
  return genericsContext;
104
107
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GenericsContext = void 0;
4
- const ErrorResourcesContext_1 = require("../util/ErrorResourcesContext");
5
4
  const ParameterPropertyHandlerRange_1 = require("./parameterproperty/ParameterPropertyHandlerRange");
6
5
  /**
7
6
  * Context for binding generic types to a concrete range value.
@@ -270,7 +269,10 @@ class GenericsContext {
270
269
  }
271
270
  // Throw if an unexpected number of generic type instances are passed.
272
271
  if (genericTypeParameters.length !== genericTypeInstances.length) {
273
- throw new ErrorResourcesContext_1.ErrorResourcesContext(`Invalid generic type instantiation: a different amount of generic types are passed (${genericTypeInstances.length}) than are defined on the component (${genericTypeParameters.length}).`, Object.assign({ passedGenerics: genericTypeInstances, definedGenerics: genericTypeParameters, component }, errorContext));
272
+ return {
273
+ description: `Invalid generic type instantiation: a different amount of generic types are passed (${genericTypeInstances.length}) than are defined on the component (${genericTypeParameters.length}).`,
274
+ context: Object.assign({ passedGenerics: genericTypeInstances, definedGenerics: genericTypeParameters, component }, errorContext),
275
+ };
274
276
  }
275
277
  // Populate with manually defined generic type bindings
276
278
  for (const [i, genericTypeInstance] of genericTypeInstances.entries()) {
@@ -17,8 +17,9 @@ class PrefetchedDocumentLoader extends jsonld_context_parser_1.FetchDocumentLoad
17
17
  async load(url) {
18
18
  // Warn on deprecated context usage
19
19
  if (this.logger &&
20
- url === 'https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^3.0.0/components/context.jsonld') {
21
- this.logger.warn(`Detected deprecated context URL '${url}'${this.path ? ` in ${this.path}` : ''}. Prefer using version '^4.0.0' instead.`);
20
+ (url === 'https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^4.0.0/components/context.jsonld' ||
21
+ url === 'https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^3.0.0/components/context.jsonld')) {
22
+ this.logger.warn(`Detected deprecated context URL '${url}'${this.path ? ` in ${this.path}` : ''}. Prefer using version '^5.0.0' instead.`);
22
23
  }
23
24
  // Load prefetched contexts
24
25
  if (url in this.contexts) {
@@ -26,19 +27,20 @@ class PrefetchedDocumentLoader extends jsonld_context_parser_1.FetchDocumentLoad
26
27
  }
27
28
  // Warn before doing a remote context lookup
28
29
  if (this.logger) {
29
- this.logger.warn(`Detected remote context lookup for '${url}'${this.path ? ` in ${this.path}` : ''}. This may indicate a missing or invalid dependency, or an invalid context URL.`);
30
+ this.logger.warn(`Detected remote context lookup for '${url}'${this.path ? ` in ${this.path}` : ''}. This may indicate a missing or invalid dependency, incorrect version number, or an invalid context URL.`);
30
31
  }
31
32
  return super.load(url);
32
33
  }
33
34
  }
34
35
  exports.PrefetchedDocumentLoader = PrefetchedDocumentLoader;
35
- PrefetchedDocumentLoader.CONTEXT_URL = 'https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^4.0.0/components/context.jsonld';
36
+ PrefetchedDocumentLoader.CONTEXT_URL = 'https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^5.0.0/components/context.jsonld';
36
37
  // eslint-disable-next-line no-sync
37
38
  PrefetchedDocumentLoader.DEFAULT_CONTEXT = JSON.parse(fs
38
39
  .readFileSync(`${__dirname}/../../components/context.jsonld`, 'utf8'));
39
40
  PrefetchedDocumentLoader.DEFAULT_CONTEXTS = {
40
41
  [PrefetchedDocumentLoader.CONTEXT_URL]: PrefetchedDocumentLoader.DEFAULT_CONTEXT,
41
- // TODO: temporarily also set old context version for backwards-compatible.
42
+ // TODO: temporarily also set old context versions for backwards-compatible.
43
+ 'https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^4.0.0/components/context.jsonld': PrefetchedDocumentLoader.DEFAULT_CONTEXT,
42
44
  'https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^3.0.0/components/context.jsonld': PrefetchedDocumentLoader.DEFAULT_CONTEXT,
43
45
  };
44
46
  //# sourceMappingURL=PrefetchedDocumentLoader.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "componentsjs",
3
- "version": "5.0.0-beta.5",
3
+ "version": "5.0.0",
4
4
  "description": "A semantic dependency injection framework",
5
5
  "lsd:contexts": {
6
6
  "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^3.0.0/components/context.jsonld": "components/context.jsonld"
@@ -40,7 +40,7 @@
40
40
  "jsonld-context-parser": "^2.1.1",
41
41
  "minimist": "^1.2.0",
42
42
  "rdf-data-factory": "^1.1.0",
43
- "rdf-object": "^1.13.0",
43
+ "rdf-object": "^1.13.1",
44
44
  "rdf-parse": "^1.9.1",
45
45
  "rdf-quad": "^1.5.0",
46
46
  "rdf-terms": "^1.7.0",
@@ -49,16 +49,16 @@
49
49
  },
50
50
  "devDependencies": {
51
51
  "@rubensworks/eslint-config": "^1.0.1",
52
- "@typescript-eslint/eslint-plugin": "^4.6.1",
53
- "@typescript-eslint/parser": "^4.6.1",
52
+ "@typescript-eslint/eslint-plugin": "^5.0.0",
53
+ "@typescript-eslint/parser": "^5.0.0",
54
54
  "@types/jest": "^27.0.0",
55
55
  "eslint": "^7.12.1",
56
56
  "eslint-config-es": "3.25.3",
57
57
  "eslint-import-resolver-typescript": "^2.3.0",
58
58
  "eslint-plugin-import": "^2.22.1",
59
- "eslint-plugin-jest": "^24.1.0",
59
+ "eslint-plugin-jest": "^26.0.0",
60
60
  "eslint-plugin-tsdoc": "^0.2.7",
61
- "eslint-plugin-unused-imports": "^1.0.0",
61
+ "eslint-plugin-unused-imports": "^2.0.0",
62
62
  "jest": "^27.0.1",
63
63
  "jest-rdf": "^1.7.0",
64
64
  "jshint": "^2.1.10",