@pactflow/drift 2603.0.1-beta.14 → 2603.0.4-beta.17

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/README.md CHANGED
@@ -4,6 +4,18 @@ https://pactflow.github.io/drift-docs/
4
4
 
5
5
  This package wraps the drift CLI for your platform. After installing, the `drift` command will be available in your local node_modules/.bin directory.
6
6
 
7
+ The package also exposes these bundled executables:
8
+
9
+ - `drift-auth`
10
+ - `drift-check-version`
11
+ - `drift-dump`
12
+ - `drift-generate-results`
13
+ - `drift-init`
14
+ - `drift-plugins`
15
+ - `drift-repl`
16
+ - `drift-verify`
17
+ - `drift-versions`
18
+
7
19
 
8
20
  ## Usage
9
21
 
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  const { spawnSync } = require('child_process');
3
3
  const path = require('path');
4
- const bin = path.resolve(__dirname, 'dist', 'drift-verifier' + (process.platform === 'win32' ? '.exe' : ''));
4
+ const bin = path.resolve(__dirname, 'dist', 'drift-auth' + (process.platform === 'win32' ? '.exe' : ''));
5
5
  const result = spawnSync(bin, process.argv.slice(2), {
6
6
  stdio: 'inherit',
7
7
  });
8
- process.exit(result.status ?? 1);
8
+ process.exit(result.status ?? 1);
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ const { spawnSync } = require('child_process');
3
+ const path = require('path');
4
+ const bin = path.resolve(__dirname, 'dist', 'drift-dump' + (process.platform === 'win32' ? '.exe' : ''));
5
+ const result = spawnSync(bin, process.argv.slice(2), {
6
+ stdio: 'inherit',
7
+ });
8
+ process.exit(result.status ?? 1);
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ const { spawnSync } = require('child_process');
3
+ const path = require('path');
4
+ const bin = path.resolve(__dirname, 'dist', 'drift-generate-results' + (process.platform === 'win32' ? '.exe' : ''));
5
+ const result = spawnSync(bin, process.argv.slice(2), {
6
+ stdio: 'inherit',
7
+ });
8
+ process.exit(result.status ?? 1);
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ const { spawnSync } = require('child_process');
3
+ const path = require('path');
4
+ const bin = path.resolve(__dirname, 'dist', 'drift-init' + (process.platform === 'win32' ? '.exe' : ''));
5
+ const result = spawnSync(bin, process.argv.slice(2), {
6
+ stdio: 'inherit',
7
+ });
8
+ process.exit(result.status ?? 1);
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ const { spawnSync } = require('child_process');
3
+ const path = require('path');
4
+ const bin = path.resolve(__dirname, 'dist', 'drift-verify' + (process.platform === 'win32' ? '.exe' : ''));
5
+ const result = spawnSync(bin, process.argv.slice(2), {
6
+ stdio: 'inherit',
7
+ });
8
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@pactflow/drift",
3
- "version": "2603.0.1-beta.14",
3
+ "version": "2603.0.4-beta.17",
4
4
  "description": "Wraps the drift CLI for your platform.",
5
5
  "bin": {
6
+ "drift-auth": "bin/drift-auth.js",
6
7
  "drift": "bin/drift.js",
7
- "drift-verifier": "bin/drift-verifier.js",
8
+ "drift-dump": "bin/drift-dump.js",
9
+ "drift-generate-results": "bin/drift-generate-results.js",
10
+ "drift-init": "bin/drift-init.js",
11
+ "drift-verify": "bin/drift-verify.js",
8
12
  "drift-check-version": "bin/drift-check-version.js",
9
13
  "drift-repl": "bin/drift-repl.js",
10
14
  "drift-versions": "bin/drift-versions.js",
@@ -16,6 +20,7 @@
16
20
  },
17
21
  "files": [
18
22
  "bin/",
23
+ "!bin/dist/",
19
24
  "scripts/"
20
25
  ],
21
26
  "author": "",
@@ -53,7 +53,18 @@ function downloadAndExtract(url, destDir) {
53
53
  await downloadAndExtract(url, destDir);
54
54
  // Make all extracted binaries executable (non-windows)
55
55
  if (platform !== 'win32') {
56
- const binNames = ['drift', 'drift-verifier', 'drift-check-version', 'drift-repl', 'drift-versions', 'drift-plugins'];
56
+ const binNames = [
57
+ 'drift',
58
+ 'drift-auth',
59
+ 'drift-check-version',
60
+ 'drift-dump',
61
+ 'drift-generate-results',
62
+ 'drift-init',
63
+ 'drift-plugins',
64
+ 'drift-repl',
65
+ 'drift-verify',
66
+ 'drift-versions',
67
+ ];
57
68
  for (const bin of binNames) {
58
69
  try {
59
70
  execSync(`chmod +x ${bin}`, { cwd: destDir });
@@ -21,4 +21,37 @@ function stripBuildNumber(version) {
21
21
  return v;
22
22
  }
23
23
 
24
- module.exports = { stripBuildNumber };
24
+ function normalizeVersion(version) {
25
+ if (!version) return version;
26
+ return stripBuildNumber(String(version).trim());
27
+ }
28
+
29
+ function extractVersionFromOutput(output) {
30
+ if (!output) return null;
31
+
32
+ const text = String(output);
33
+ const lines = text
34
+ .split(/\r?\n/)
35
+ .map((line) => line.trim())
36
+ .filter(Boolean);
37
+
38
+ for (const line of lines) {
39
+ if (/^v?\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(line)) {
40
+ return normalizeVersion(line.replace(/^v/, ''));
41
+ }
42
+ }
43
+
44
+ const legacyMatch = text.match(/Drift testing tools\s+v?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)/i);
45
+ if (legacyMatch) {
46
+ return normalizeVersion(legacyMatch[1]);
47
+ }
48
+
49
+ const matches = [...text.matchAll(/\bv?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)\b/g)];
50
+ if (matches.length === 0) {
51
+ return null;
52
+ }
53
+
54
+ return normalizeVersion(matches[matches.length - 1][1]);
55
+ }
56
+
57
+ module.exports = { stripBuildNumber, normalizeVersion, extractVersionFromOutput };
package/bin/dist/drift DELETED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,26 +0,0 @@
1
- # Drift config file
2
-
3
- # Log level to default to
4
- log_level = "info"
5
-
6
- # Plugin directory override
7
- #plugin_dir = "/home/user/.drift/plugins"
8
-
9
- # Core plugins to always load
10
- #core_plugins = [
11
- # "oas",
12
- # "json"
13
- #]
14
-
15
- # Log entries to exclude
16
- [log_filters]
17
- hyper_util = "info"
18
- wasmtime_wasi = "info"
19
- #"[plugin{name=oas}]" = "ERROR"
20
-
21
- # Plugin specific config
22
- #[plugin_config.json]
23
- #content_types = ["application/thrift"]
24
- #
25
- # [plugin_config.http-dump]
26
- # logLevel = "INFO"
Binary file
Binary file
Binary file
Binary file
Binary file