@pactflow/drift 0.0.1 → 2603.0.1-beta2

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
@@ -1,45 +1,20 @@
1
- # @pactflow/drift
1
+ # Drift
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
3
+ https://pactflow.github.io/drift-docs/
4
4
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
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
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
8
7
 
9
- ## Purpose
8
+ ## Usage
10
9
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@pactflow/drift`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
10
+ ```
11
+ npm install @pactflow/drift
12
+ npx @pactflow/drift --help
13
+ ```
15
14
 
16
- ## What is OIDC Trusted Publishing?
17
-
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
19
-
20
- ## Setup Instructions
21
-
22
- To properly configure OIDC trusted publishing for this package:
23
-
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
28
-
29
- ## DO NOT USE THIS PACKAGE
30
-
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
36
-
37
- ## More Information
38
-
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
42
-
43
- ---
44
-
45
- **Maintained for OIDC setup purposes only**
15
+ ## Supported platforms
16
+ - linux-aarch64
17
+ - linux-x86_64
18
+ - macos-aarch64
19
+ - macos-x86_64
20
+ - windows-x86_64
package/bin/drift ADDED
Binary file
Binary file
Binary file
package/bin/drift-repl ADDED
Binary file
Binary file
Binary file
@@ -0,0 +1,26 @@
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
Binary file
package/package.json CHANGED
@@ -1,10 +1,26 @@
1
1
  {
2
2
  "name": "@pactflow/drift",
3
- "version": "0.0.1",
4
- "description": "OIDC trusted publishing setup package for @pactflow/drift",
5
- "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
3
+ "version": "2603.0.1-beta2",
4
+ "description": "Wraps the drift CLI for your platform.",
5
+ "bin": {
6
+ "drift": "bin/drift",
7
+ "drift-verifier": "bin/drift-verifier",
8
+ "drift-check-version": "bin/drift-check-version",
9
+ "drift-repl": "bin/drift-repl",
10
+ "drift-versions": "bin/drift-versions",
11
+ "drift-plugins": "bin/drift-plugins"
12
+ },
13
+ "scripts": {
14
+ "postinstall": "node scripts/postinstall.js",
15
+ "test:smoke": "node tests/smoke.js"
16
+ },
17
+ "files": [
18
+ "bin/",
19
+ "scripts/"
20
+ ],
21
+ "author": "",
22
+ "license": "MIT",
23
+ "dependencies": {
24
+ "tar": "^7.5.9"
25
+ }
10
26
  }
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ // postinstall.js: Download and extract the correct drift binary for the user's OS/arch
3
+ const https = require('https');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const { execSync } = require('child_process');
7
+
8
+ const version = process.env.npm_package_version;
9
+ if (!version) {
10
+ console.error('Error: npm_package_version is not set');
11
+ process.exit(1);
12
+ }
13
+ const platform = process.platform;
14
+ const arch = process.arch;
15
+
16
+ function getOsArch() {
17
+ if (platform === 'darwin') {
18
+ if (arch === 'arm64') return 'macos-aarch64.tgz';
19
+ if (arch === 'x64') return 'macos-x86_64.tgz';
20
+ } else if (platform === 'linux') {
21
+ if (arch === 'arm64') return 'linux-aarch64.tgz';
22
+ if (arch === 'x64') return 'linux-x86_64.tgz';
23
+ } else if (platform === 'win32') {
24
+ if (arch === 'x64') return 'windows-x86_64.tgz';
25
+ }
26
+ throw new Error(`Unsupported platform/arch: ${platform}/${arch}`);
27
+ }
28
+
29
+ function downloadAndExtract(url, destDir) {
30
+ return new Promise((resolve, reject) => {
31
+ const tar = require('tar');
32
+ https.get(url, (res) => {
33
+ if (res.statusCode !== 200) {
34
+ reject(new Error(`Failed to download: ${url} (status ${res.statusCode})`));
35
+ return;
36
+ }
37
+ res.pipe(tar.x({ C: destDir }))
38
+ .on('finish', resolve)
39
+ .on('error', reject);
40
+ }).on('error', reject);
41
+ });
42
+ }
43
+
44
+ (async () => {
45
+ try {
46
+ const osArch = getOsArch();
47
+ const url = `https://download.pactflow.io/drift/${version}/${osArch}`;
48
+ const destDir = path.resolve(__dirname, '../bin');
49
+ if (!fs.existsSync(destDir)) fs.mkdirSync(destDir);
50
+ console.log(`Downloading drift CLI from ${url} ...`);
51
+ await downloadAndExtract(url, destDir);
52
+ // Make sure binary is executable (non-windows)
53
+ if (platform !== 'win32') {
54
+ execSync('chmod +x drift', { cwd: destDir });
55
+ }
56
+ console.log('drift CLI installed successfully.');
57
+ } catch (err) {
58
+ console.error('Failed to install drift CLI:', err);
59
+ process.exit(1);
60
+ }
61
+ })();