@contract-case/case-connector 0.30.2 → 0.31.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 +6 -6
- package/dist/cjs/src/connectors/case-boundary/internals/BoundaryPluginLoader.cjs +3 -65
- package/dist/cjs/src/connectors/case-boundary/internals/BoundaryPluginLoader.d.ts.map +1 -1
- package/dist/cjs/src/connectors/case-boundary/internals/BoundaryPluginLoader.js.map +1 -1
- package/dist/cjs/src/entities/versionString.cjs +1 -1
- package/dist/cjs/src/entities/versionString.d.cts +1 -1
- package/dist/cjs/tsconfig.1a3e54e6.tsbuildinfo +1 -0
- package/dist/src/connectors/case-boundary/internals/BoundaryPluginLoader.d.ts.map +1 -1
- package/dist/src/connectors/case-boundary/internals/BoundaryPluginLoader.js +4 -66
- package/dist/src/connectors/case-boundary/internals/BoundaryPluginLoader.js.map +1 -1
- package/dist/src/entities/versionString.d.ts +1 -1
- package/dist/src/entities/versionString.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package/case-connector.js +2 -2
- package/package/case-connector.js.map +1 -1
- package/package.json +7 -7
- package/dist/cjs/tsconfig.c8e48e29.tsbuildinfo +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.
|
|
3
|
+
## [0.31.0](https://github.com/case-contract-testing/contract-case/compare/@contract-case/case-connector-v0.30.1...@contract-case/case-connector-v0.31.0) (2026-08-28)
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
### Features
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
|
|
18
18
|
* The following workspace dependencies were updated
|
|
19
19
|
* dependencies
|
|
20
|
-
* @contract-case/case-connector-proto bumped from 0.30.1 to 0.
|
|
21
|
-
* @contract-case/case-core bumped from 0.30.1 to 0.
|
|
22
|
-
* @contract-case/case-entities-internal bumped from 0.30.1 to 0.
|
|
20
|
+
* @contract-case/case-connector-proto bumped from 0.30.1 to 0.31.0
|
|
21
|
+
* @contract-case/case-core bumped from 0.30.1 to 0.31.0
|
|
22
|
+
* @contract-case/case-entities-internal bumped from 0.30.1 to 0.31.0
|
|
23
23
|
* devDependencies
|
|
24
|
-
* @contract-case/case-maintainer-config bumped from 0.30.1 to 0.
|
|
25
|
-
* @contract-case/eslint-config-case-maintainer bumped from 0.30.1 to 0.
|
|
24
|
+
* @contract-case/case-maintainer-config bumped from 0.30.1 to 0.31.0
|
|
25
|
+
* @contract-case/eslint-config-case-maintainer bumped from 0.30.1 to 0.31.0
|
|
26
26
|
|
|
27
27
|
## [0.30.1](https://github.com/case-contract-testing/contract-case/compare/@contract-case/case-connector-v0.30.0...@contract-case/case-connector-v0.30.1) (2026-07-18)
|
|
28
28
|
|
|
@@ -1,74 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BoundaryPluginLoader = void 0;
|
|
4
|
-
const node_module_1 = require("node:module");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
6
|
-
const node_url_1 = require("node:url");
|
|
7
4
|
const case_core_1 = require("@contract-case/case-core");
|
|
5
|
+
const case_entities_internal_1 = require("@contract-case/case-entities-internal");
|
|
8
6
|
const index_js_1 = require("./boundary/index.cjs");
|
|
9
7
|
const versionString_js_1 = require("../../../entities/versionString.cjs");
|
|
10
8
|
const index_js_2 = require("./mappers/index.cjs");
|
|
11
|
-
|
|
12
|
-
* Resolves a plugin module name against the user's project (ie, the current
|
|
13
|
-
* working directory), falling back to normal resolution relative to this
|
|
14
|
-
* file.
|
|
15
|
-
*
|
|
16
|
-
* The cwd resolution step exists because this code doesn't always run from
|
|
17
|
-
* the user's project: when ContractCase is called from a host language like
|
|
18
|
-
* Java, the connector runs from a temporary directory, so resolving relative
|
|
19
|
-
* to this file would never find plugins the user installed in their project's
|
|
20
|
-
* node_modules.
|
|
21
|
-
*
|
|
22
|
-
* @param moduleName - a previously validated bare module name
|
|
23
|
-
* @returns the resolved path to the module, or null if it couldn't be
|
|
24
|
-
* resolved from the working directory (in which case the caller should fall
|
|
25
|
-
* back to normal resolution, so that this continues to work if the module is
|
|
26
|
-
* resolvable from this file but not from the working directory).
|
|
27
|
-
*/
|
|
28
|
-
const resolveFromWorkingDirectory = (moduleName) => {
|
|
29
|
-
try {
|
|
30
|
-
return (0, node_module_1.createRequire)((0, node_path_1.join)(process.cwd(), 'noop.js')).resolve(moduleName);
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const importSinglePlugin = (moduleName) => Promise.resolve()
|
|
37
|
-
.then(() => {
|
|
38
|
-
if (
|
|
39
|
-
// Forbid URIs
|
|
40
|
-
moduleName.includes(':') ||
|
|
41
|
-
// Forbid strings that start with '.', as they may be hidden files or path traversal
|
|
42
|
-
moduleName.startsWith('.') ||
|
|
43
|
-
// Forbid strings that start with / , as only local packages are supported
|
|
44
|
-
moduleName.startsWith('/') ||
|
|
45
|
-
// Forbid strings that don't look like node module names
|
|
46
|
-
!/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*(?:\/[a-z0-9][a-z0-9._-]*)*$/i.test(moduleName)) {
|
|
47
|
-
throw new case_core_1.CaseConfigurationError(`Unsafe plugin module specifier. Plugin names must be a valid local nodejs package name, and may not be remote or inline URIs. Provided name was: '${moduleName}'`, 'DONT_ADD_LOCATION', 'INVALID_PLUGIN_NAME');
|
|
48
|
-
}
|
|
49
|
-
const resolvedPath = resolveFromWorkingDirectory(moduleName);
|
|
50
|
-
// webpack ignore is needed here so that the final bundle for host
|
|
51
|
-
// languages is able to import arbitrary libs, without webpack failing
|
|
52
|
-
return import(
|
|
53
|
-
/* webpackIgnore: true */ resolvedPath != null
|
|
54
|
-
? (0, node_url_1.pathToFileURL)(resolvedPath).href
|
|
55
|
-
: moduleName)
|
|
56
|
-
.catch((e) => {
|
|
57
|
-
// Some test environments can't do a dynamic import() at all (eg
|
|
58
|
-
// Jest without --experimental-vm-modules). In those environments,
|
|
59
|
-
// fall back to loading the plugin with require() instead.
|
|
60
|
-
if (e != null &&
|
|
61
|
-
(e.code === 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING' ||
|
|
62
|
-
`${e.message}`.includes('--experimental-vm-modules'))) {
|
|
63
|
-
return (0, node_module_1.createRequire)((0, node_path_1.join)(process.cwd(), 'noop.js'))(resolvedPath != null ? resolvedPath : moduleName);
|
|
64
|
-
}
|
|
65
|
-
throw e;
|
|
66
|
-
})
|
|
67
|
-
.catch((e) => {
|
|
68
|
-
throw new case_core_1.CaseConfigurationError(`Unable to load plugin '${moduleName}': ${e.message}\n\nPlease check that the plugin's package is installed (for example, with \`npm install --save-dev ${moduleName}\`) in the project the tests are running from.`, 'DONT_ADD_LOCATION', 'UNDOCUMENTED');
|
|
69
|
-
});
|
|
70
|
-
})
|
|
71
|
-
.then((moduleContents) => (0, case_core_1.mustResolvePlugin)(moduleContents, moduleName));
|
|
9
|
+
const loadOne = (moduleName) => (0, case_entities_internal_1.loadPluginModuleContents)(moduleName).then((moduleContents) => (0, case_entities_internal_1.mustResolvePlugin)(moduleContents, moduleName));
|
|
72
10
|
/**
|
|
73
11
|
* A BoundaryPluginLoader allows loading plugins into the core
|
|
74
12
|
*
|
|
@@ -112,7 +50,7 @@ class BoundaryPluginLoader {
|
|
|
112
50
|
}
|
|
113
51
|
async loadPlugins(moduleNames) {
|
|
114
52
|
this.initialiseLoader();
|
|
115
|
-
return Promise.all(moduleNames.map((moduleName) =>
|
|
53
|
+
return Promise.all(moduleNames.map((moduleName) => loadOne(moduleName)))
|
|
116
54
|
.then((plugins) => {
|
|
117
55
|
if (this.loader == null) {
|
|
118
56
|
throw new case_core_1.CaseCoreError('this.loader was not initialised during loadPlugins. This should never happen, as initialiseLoader() is meant to be called first');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BoundaryPluginLoader.d.ts","sourceRoot":"","sources":["../../../../../../src/connectors/case-boundary/internals/BoundaryPluginLoader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BoundaryPluginLoader.d.ts","sourceRoot":"","sources":["../../../../../../src/connectors/case-boundary/internals/BoundaryPluginLoader.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,0BAA0B,EAC1B,WAAW,EACX,cAAc,EACd,cAAc,EAEf,MAAM,qBAAqB,CAAC;AAe7B;;;;GAIG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAA2B;IAEzC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA6B;IAE/D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IAEzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAE/C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAW;IAE1C;;;;;;;;;;OAUG;gBAED,MAAM,EAAE,0BAA0B,EAClC,UAAU,EAAE,WAAW,EACvB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,MAAM,EAAE;IAc1B,OAAO,CAAC,gBAAgB;IAYlB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;CAclE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BoundaryPluginLoader.js","sourceRoot":"","sources":["../../../../../../src/connectors/case-boundary/internals/BoundaryPluginLoader.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"BoundaryPluginLoader.js","sourceRoot":"","sources":["../../../../../../src/connectors/case-boundary/internals/BoundaryPluginLoader.ts"],"names":[],"mappings":";;;AAAA,wDAAuE;AACvE,kFAG+C;AAE/C,kDAM6B;AAC7B,yEAAmE;AACnE,iDAI4B;AAE5B,MAAM,OAAO,GAAG,CACd,UAAkB,EAC6B,EAAE,CACjD,IAAA,iDAAwB,EAAC,UAAU,CAAC,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AG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;aACrE,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YAChB,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;gBACxB,MAAM,IAAI,yBAAa,CACrB,iIAAiI,CAClI,CAAC;YACJ,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,0BAAe,EAAE,CAAC;aACjC,KAAK,CAAC,2BAAgB,CAAC,CAAC;IAC7B,CAAC;CACF;AAlED,oDAkEC"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.versionString = void 0;
|
|
4
4
|
const packageName = 'case-connector';
|
|
5
|
-
const version = '0.
|
|
5
|
+
const version = '0.31.0'; // x-release-please-version
|
|
6
6
|
exports.versionString = `${packageName}@${version}`;
|
|
7
7
|
//# sourceMappingURL=versionString.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const versionString = "case-connector@0.
|
|
1
|
+
export declare const versionString = "case-connector@0.31.0";
|
|
2
2
|
//# sourceMappingURL=versionString.d.ts.map
|