@stripe/cli 0.0.1 → 1.42.11

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
@@ -20,12 +20,14 @@ Stripe CLI is available for macOS, Windows, and Linux for distros like Ubuntu, D
20
20
 
21
21
  ### npm (macOS, Linux, Windows)
22
22
 
23
- If you have Node.js >= 18 installed, you can install via npm or run directly with npx:
23
+ If you have Node.js >= 18 installed, you can install via `npm`:
24
24
 
25
25
  ```sh
26
26
  npm install -g @stripe/cli
27
27
  ```
28
28
 
29
+ You can also directly execute commands via `npx`, although this won't add `stripe` to your `PATH`:
30
+
29
31
  ```sh
30
32
  npx @stripe/cli login
31
33
  ```
package/bin/shim.js CHANGED
@@ -20,5 +20,21 @@ try {
20
20
  binPath = path.join(__dirname, '..', 'vendor', 'bin', platform.bin);
21
21
  }
22
22
 
23
- const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
23
+ // Detect invocation method using npm-injected env vars:
24
+ // - npm_config_user_agent is set by npm/npx at invocation time but never by a direct shell exec,
25
+ // so its absence means the user ran `stripe` directly (global install, PATH symlink).
26
+ // - npm_lifecycle_event is set to the script name during `npm run` but not by npx,
27
+ // so its presence distinguishes `npm run` scripts from a bare `npx @stripe/cli` call.
28
+ let installMethod;
29
+ if (!process.env.npm_config_user_agent) {
30
+ installMethod = 'npm_global';
31
+ } else if (process.env.npm_lifecycle_event) {
32
+ installMethod = 'npm_run';
33
+ } else {
34
+ installMethod = 'npx';
35
+ }
36
+ const result = spawnSync(binPath, process.argv.slice(2), {
37
+ stdio: 'inherit',
38
+ env: { ...process.env, STRIPE_INSTALL_METHOD: installMethod },
39
+ });
24
40
  process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,25 +1,31 @@
1
1
  {
2
2
  "name": "@stripe/cli",
3
- "version": "0.0.1",
3
+ "version": "1.42.11",
4
4
  "description": "The Stripe CLI",
5
5
  "homepage": "https://stripe.com/docs/stripe-cli",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/stripe/stripe-cli.git"
9
+ "url": "git+https://github.com/stripe/stripe-cli.git",
10
+ "directory": "npm/wrapper"
10
11
  },
11
12
  "bin": {
12
13
  "stripe": "bin/shim.js"
13
14
  },
15
+ "publishConfig": {
16
+ "access": "public",
17
+ "registry": "https://registry.npmjs.org",
18
+ "provenance": true
19
+ },
14
20
  "scripts": {
15
21
  "postinstall": "node scripts/postinstall.js"
16
22
  },
17
23
  "optionalDependencies": {
18
- "@stripe/cli-darwin-arm64": "0.0.1",
19
- "@stripe/cli-darwin-x64": "0.0.1",
20
- "@stripe/cli-linux-x64": "0.0.1",
21
- "@stripe/cli-linux-arm64": "0.0.1",
22
- "@stripe/cli-win32-x64": "0.0.1"
24
+ "@stripe/cli-darwin-arm64": "1.42.11",
25
+ "@stripe/cli-darwin-x64": "1.42.11",
26
+ "@stripe/cli-linux-x64": "1.42.11",
27
+ "@stripe/cli-linux-arm64": "1.42.11",
28
+ "@stripe/cli-win32-x64": "1.42.11"
23
29
  },
24
30
  "engines": {
25
31
  "node": ">=18.0.0"
@@ -33,7 +33,7 @@ fs.mkdirSync(vendorDir, { recursive: true });
33
33
  const archivePath = path.join(vendorDir, '..', archive);
34
34
  const checksumPath = path.join(vendorDir, '..', checksumFile);
35
35
 
36
- console.log(`@stripe/cli: platform package not found, downloading from GitHub Releases...`);
36
+ console.log(`@stripe/cli: platform package not found, installation must have used --no-optional. Downloading from GitHub Releases...`);
37
37
 
38
38
  async function main() {
39
39
  await download(`${BASE}/${checksumFile}`, checksumPath);