componentsjs 6.2.0 → 6.4.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.
@@ -88,6 +88,7 @@ class ConfigConstructor {
88
88
  });
89
89
  }
90
90
  }
91
+ exports.ConfigConstructor = ConfigConstructor;
91
92
  ConfigConstructor.ARGS_HANDLERS = [
92
93
  new ArgumentConstructorHandlerUndefined_1.ArgumentConstructorHandlerUndefined(),
93
94
  new ArgumentConstructorHandlerHash_1.ArgumentConstructorHandlerHash(),
@@ -97,5 +98,4 @@ ConfigConstructor.ARGS_HANDLERS = [
97
98
  new ArgumentConstructorHandlerReference_1.ArgumentConstructorHandlerReference(),
98
99
  new ArgumentConstructorHandlerPrimitive_1.ArgumentConstructorHandlerPrimitive(),
99
100
  ];
100
- exports.ConfigConstructor = ConfigConstructor;
101
101
  //# sourceMappingURL=ConfigConstructor.js.map
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { IModuleState } from '../../loading/ModuleStateBuilder';
3
2
  import type { ICreationStrategyInstanceOptions, IConstructionStrategy, ICreationStrategyHashOptions, ICreationStrategyArrayOptions, ICreationStrategySupplierOptions, ICreationStrategyPrimitiveOptions, ICreationStrategyVariableOptions } from './IConstructionStrategy';
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { Readable } from 'stream';
3
2
  import type * as RDF from '@rdfjs/types';
4
3
  import type { Resource, RdfObjectLoader } from 'rdf-object';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { Readable } from 'stream';
3
2
  import type * as RDF from '@rdfjs/types';
4
3
  import type { RdfObjectLoader, Resource } from 'rdf-object';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { Logger } from 'winston';
3
2
  /**
4
3
  * Collects the paths to all available modules and components.
@@ -297,6 +297,7 @@ class GenericsContext {
297
297
  }
298
298
  }
299
299
  }
300
+ exports.GenericsContext = GenericsContext;
300
301
  GenericsContext.XSD_INHERITANCE_TABLE = {
301
302
  'http://www.w3.org/2001/XMLSchema#number': new Set([
302
303
  'http://www.w3.org/2001/XMLSchema#integer',
@@ -329,5 +330,4 @@ GenericsContext.XSD_INHERITANCE_TABLE = {
329
330
  'http://www.w3.org/2001/XMLSchema#langString',
330
331
  ]),
331
332
  };
332
- exports.GenericsContext = GenericsContext;
333
333
  //# sourceMappingURL=GenericsContext.js.map
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findResourceIndex = exports.getPropertyResourceList = exports.extractOverrideStepFields = exports.OVERRIDE_STEP_FIELD_NAMES = void 0;
3
+ exports.OVERRIDE_STEP_FIELD_NAMES = void 0;
4
+ exports.extractOverrideStepFields = extractOverrideStepFields;
5
+ exports.getPropertyResourceList = getPropertyResourceList;
6
+ exports.findResourceIndex = findResourceIndex;
4
7
  const Iris_1 = require("../../rdf/Iris");
5
8
  const ErrorResourcesContext_1 = require("../../util/ErrorResourcesContext");
6
9
  exports.OVERRIDE_STEP_FIELD_NAMES = ['parameter', 'target', 'value'];
@@ -34,7 +37,6 @@ function extractOverrideStepFields(step, expected = {}) {
34
37
  }
35
38
  return result;
36
39
  }
37
- exports.extractOverrideStepFields = extractOverrideStepFields;
38
40
  /**
39
41
  * Returns a list containing all values for the given resource found with the given property.
40
42
  * In case there are multiple matches, the lists will be merged.
@@ -60,7 +62,6 @@ function getPropertyResourceList(config, parameter) {
60
62
  properties[0].list = list;
61
63
  return properties[0].list;
62
64
  }
63
- exports.getPropertyResourceList = getPropertyResourceList;
64
65
  /**
65
66
  * Finds the index of the given resource in the given list.
66
67
  * Will throw an error if the resource is not found.
@@ -78,5 +79,4 @@ function findResourceIndex(list, target) {
78
79
  }
79
80
  return index;
80
81
  }
81
- exports.findResourceIndex = findResourceIndex;
82
82
  //# sourceMappingURL=OverrideUtil.js.map
@@ -95,6 +95,23 @@ class ParameterPropertyHandlerRange {
95
95
  // Check if the param type is an array
96
96
  if (value && type.isA('ParameterRangeArray')) {
97
97
  if (!value.list) {
98
+ // If the value is a JSON literal, try to interpret as an array
99
+ if (value.term.termType === 'Literal' && value.term.datatype.value === Iris_1.IRIS_RDF.JSON) {
100
+ const jsonString = value.value;
101
+ if (jsonString.startsWith('[') && jsonString.endsWith(']')) {
102
+ try {
103
+ const parsed = JSON.parse(value.value);
104
+ value.term.valueRaw = parsed;
105
+ return;
106
+ }
107
+ catch (error) {
108
+ return {
109
+ description: `JSON parse exception: ${error.message}`,
110
+ context: errorContext,
111
+ };
112
+ }
113
+ }
114
+ }
98
115
  return {
99
116
  description: `value is not an RDF list`,
100
117
  context: errorContext,
@@ -31,6 +31,7 @@ class PrefetchedDocumentLoader extends jsonld_context_parser_1.FetchDocumentLoad
31
31
  return super.load(url);
32
32
  }
33
33
  }
34
+ exports.PrefetchedDocumentLoader = PrefetchedDocumentLoader;
34
35
  PrefetchedDocumentLoader.CJS_MAJOR_VERSION = semverMajor(require('../../package.json').version);
35
36
  PrefetchedDocumentLoader.CONTEXT_URL = `https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^${PrefetchedDocumentLoader.CJS_MAJOR_VERSION}.0.0/components/context.jsonld`;
36
37
  PrefetchedDocumentLoader.CONTEXT_PATTERN = /https:\/\/linkedsoftwaredependencies.org\/bundles\/npm\/componentsjs\/\^([0-9]+).0.0\/components\/context.jsonld/u;
@@ -44,5 +45,4 @@ PrefetchedDocumentLoader.DEFAULT_CONTEXTS = {
44
45
  PrefetchedDocumentLoader.DEFAULT_CONTEXTS[`https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^${i}.0.0/components/context.jsonld`] = PrefetchedDocumentLoader.DEFAULT_CONTEXT;
45
46
  }
46
47
  })();
47
- exports.PrefetchedDocumentLoader = PrefetchedDocumentLoader;
48
48
  //# sourceMappingURL=PrefetchedDocumentLoader.js.map
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import type { Readable } from 'stream';
4
2
  import type * as RDF from '@rdfjs/types';
5
3
  import type { ParseOptions } from 'rdf-parse';
@@ -53,7 +53,7 @@ class RdfParser {
53
53
  skipContextValidation: options.skipContextValidation,
54
54
  };
55
55
  // Execute parsing
56
- const quadStream = rdf_parse_1.default.parse(textStream, options);
56
+ const quadStream = rdf_parse_1.rdfParser.parse(textStream, options);
57
57
  const includedQuadStream = quadStream.pipe(new RdfStreamIncluder_1.RdfStreamIncluder(options));
58
58
  quadStream.on('error', (error) => includedQuadStream
59
59
  .emit('error', RdfParser.addPathToError(error, options.path)));
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { TransformCallback } from 'stream';
3
2
  import { Transform } from 'stream';
4
3
  import type * as RDF from '@rdfjs/types';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uniqueTypes = void 0;
3
+ exports.uniqueTypes = uniqueTypes;
4
4
  /**
5
5
  * Filters duplicates from the types of the given {@link Resource} and returns all unique entries.
6
6
  * @param resource - The {@link Resource} to filter the types of.
@@ -16,5 +16,4 @@ function uniqueTypes(resource, componentResources) {
16
16
  }
17
17
  return Object.values(componentTypesIndex);
18
18
  }
19
- exports.uniqueTypes = uniqueTypes;
20
19
  //# sourceMappingURL=ResourceUtil.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compileConfig = void 0;
3
+ exports.compileConfig = compileConfig;
4
4
  const ComponentsManager_1 = require("../ComponentsManager");
5
5
  const ConstructionStrategyCommonJsString_1 = require("../construction/strategy/ConstructionStrategyCommonJsString");
6
6
  /**
@@ -27,5 +27,4 @@ async function compileConfig(mainModulePath, configPath, configIri, exportVariab
27
27
  const serializationVariableName = await manager.instantiate(configIri);
28
28
  return constructionStrategy.serializeDocument(serializationVariableName, exportVariableName);
29
29
  }
30
- exports.compileConfig = compileConfig;
31
30
  //# sourceMappingURL=CompileUtil.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "componentsjs",
3
- "version": "6.2.0",
3
+ "version": "6.4.0",
4
4
  "description": "A semantic dependency injection framework",
5
5
  "lsd:contexts": {
6
6
  "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^5.0.0/components/context.jsonld": "components/context.jsonld"
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "author": "Ruben Taelman <ruben.taelman@ugent.be>",
21
21
  "license": "MIT",
22
- "packageManager": "yarn@4.0.1",
22
+ "packageManager": "yarn@1.22.22",
23
23
  "scripts": {
24
24
  "test": "yarn test:jest",
25
25
  "test:jest": "jest",
@@ -41,17 +41,17 @@
41
41
  "@types/semver": "^7.3.4",
42
42
  "jsonld-context-parser": "^3.0.0",
43
43
  "minimist": "^1.2.0",
44
- "rdf-data-factory": "^1.1.0",
45
- "rdf-object": "^2.0.0",
46
- "rdf-parse": "^2.0.0",
47
- "rdf-quad": "^1.5.0",
48
- "rdf-string": "^1.6.0",
49
- "rdf-terms": "^1.7.0",
44
+ "rdf-data-factory": "^2.0.2",
45
+ "rdf-object": "^3.0.0",
46
+ "rdf-parse": "^4.0.0",
47
+ "rdf-quad": "^2.0.0",
48
+ "rdf-string": "^2.0.1",
49
+ "rdf-terms": "^2.0.0",
50
50
  "semver": "^7.3.2",
51
51
  "winston": "^3.3.3"
52
52
  },
53
53
  "devDependencies": {
54
- "@rubensworks/eslint-config": "^1.0.1",
54
+ "@rubensworks/eslint-config": "1.0.1",
55
55
  "@types/jest": "^29.0.0",
56
56
  "@types/stream-to-array": "^2.3.0",
57
57
  "@types/streamify-string": "^1.0.0",
@@ -66,7 +66,7 @@
66
66
  "eslint-plugin-unused-imports": "^2.0.0",
67
67
  "jest": "^29.0.0",
68
68
  "jest-mock": "^29.0.0",
69
- "jest-rdf": "^1.8.0",
69
+ "jest-rdf": "^2.0.0",
70
70
  "jshint": "^2.1.10",
71
71
  "manual-git-changelog": "^1.0.1",
72
72
  "n3": "^1.11.1",
@@ -77,9 +77,9 @@
77
77
  "streamify-string": "^1.0.1",
78
78
  "ts-jest": "^29.1.0",
79
79
  "ts-loader": "^9.4.1",
80
- "typescript": "^5.0.0",
80
+ "typescript": "~5.5.0",
81
81
  "webpack": "^5.75.0",
82
- "webpack-cli": "^5.0.0"
82
+ "webpack-cli": "^6.0.0"
83
83
  },
84
84
  "files": [
85
85
  "components",