@tigrisdata/cli 3.4.1 → 3.4.3
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/dist/chunk-2Q2EKNAN.js +8 -0
- package/dist/{chunk-BN6MNZDO.js → chunk-7O7LNYMA.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/update.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/package.json +30 -45
- package/postinstall.cjs +4 -0
- package/dist/chunk-X3H2PJ6S.js +0 -8
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{d,e as m,f}from"./chunk-ATBINUDP.js";import{mkdirSync as C,readFileSync as k,realpathSync as _,writeFileSync as E}from"fs";import I from"https";import{homedir as g}from"os";import{join as h}from"path";var p="3.4.3";var b=h(g(),".tigris","update-check.json");function y(){try{let e=k(b,"utf-8"),n=JSON.parse(e);return typeof n.latestVersion=="string"&&typeof n.lastChecked=="number"?n:null}catch{return null}}function w(e){try{C(h(g(),".tigris"),{recursive:!0}),E(b,JSON.stringify(e),"utf-8")}catch{}}function N(e,n){let o=s=>{let i=s.startsWith("v")?s.slice(1):s,c=null,a=i.indexOf("-");a!==-1&&(c=i.slice(a+1),i=i.slice(0,a));let l=i.split(".");if(l.length!==3)return null;let u=l.map(Number);return u.some(Number.isNaN)?null:{major:u[0],minor:u[1],patch:u[2],prerelease:c}},r=o(e),t=o(n);return!r||!t?!1:t.major>r.major?!0:t.major<r.major?!1:t.minor>r.minor?!0:t.minor<r.minor?!1:t.patch>r.patch?!0:t.patch<r.patch?!1:r.prerelease&&!t.prerelease?!0:(!r.prerelease&&t.prerelease,!1)}function T(){if(process.platform==="win32")return!1;try{let e=_(process.execPath);return e.includes("/Cellar/")||e.includes("/Caskroom/")}catch{return!1}}function L(){return globalThis.__TIGRIS_BINARY===!0?T()?"brew upgrade tigris":process.platform==="win32"?"irm https://raw.githubusercontent.com/tigrisdata/storage/main/packages/cli/scripts/install.ps1 | iex":"curl -fsSL https://raw.githubusercontent.com/tigrisdata/storage/main/packages/cli/scripts/install.sh | sh":"npm install -g @tigrisdata/cli"}function x(e={}){return new Promise((n,o)=>{let r=I.get(d,{timeout:1e4},t=>{let s="";t.on("data",i=>{s+=i}),t.on("end",()=>{try{let i=JSON.parse(s);typeof i.version=="string"?(w({...y(),latestVersion:i.version,lastChecked:Date.now()}),n(i.version)):o(new Error("Unexpected registry response"))}catch{o(new Error("Failed to parse registry response"))}})});r.on("error",t=>{o(t)}),r.on("timeout",()=>{r.destroy(),o(new Error("Request timed out"))}),e.unref&&r.on("socket",t=>{t.unref()}),r.end()})}function S(){x({unref:!0}).catch(()=>{})}function M(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let e=y(),n=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(e&&N(p,e.latestVersion)&&(!e.lastNotified||Date.now()-e.lastNotified>n)){let r=`Update available: ${p} \u2192 ${e.latestVersion}`,t='Run "tigris update" to upgrade.',s=Math.max(r.length,t.length)+4,i=`\u250C${"\u2500".repeat(s-2)}\u2510`,c=`\u2514${"\u2500".repeat(s-2)}\u2518`,a=l=>`\u2502 ${l.padEnd(s-4)} \u2502`;console.log(`
|
|
2
|
+
${i}
|
|
3
|
+
${a("")}
|
|
4
|
+
${a(r)}
|
|
5
|
+
${a(t)}
|
|
6
|
+
${a("")}
|
|
7
|
+
${c}
|
|
8
|
+
`),w({...e,lastNotified:Date.now()})}let o=Number(process.env.TIGRIS_UPDATE_CHECK_INTERVAL_MS)||216e5;(!e||Date.now()-e.lastChecked>o)&&S()}export{p as a,y as b,N as c,L as d,x as e,M as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,f as l}from"./chunk-
|
|
1
|
+
import{a as s,f as l}from"./chunk-2Q2EKNAN.js";import{a as i,k as m}from"./chunk-Z2LVZ3ZF.js";import{b as t}from"./chunk-NI4EYBQH.js";import{existsSync as c}from"fs";import{dirname as u,join as a}from"path";import{fileURLToPath as f}from"url";i();var j=f(import.meta.url),d=u(j),h=t(),y=o=>{if(o.length===0)return!1;let e=`${a(d,"lib",...o)}.js`;if(c(e))return!0;let r=a(d,"lib",...o,"index.js");return!!c(r)},b=async o=>{let e=[`./lib/${o.join("/")}.js`,`./lib/${o.join("/")}/index.js`];for(let p of e){let n=await import(p).catch(()=>null);if(n)return{module:n,error:null}}return{module:null,error:`Command not found: ${o.join(" ")}`}},x=m({specs:h,version:s,loadModule:b,hasImplementation:y});x.parse();l();
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-7O7LNYMA.js";import"./chunk-2Q2EKNAN.js";import"./chunk-Z2LVZ3ZF.js";import"./chunk-SE5TRZWU.js";import"./chunk-DV3LCXRH.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-ATBINUDP.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-7O7LNYMA.js";import"./chunk-2Q2EKNAN.js";import"./chunk-Z2LVZ3ZF.js";import"./chunk-SE5TRZWU.js";import"./chunk-DV3LCXRH.js";import"./chunk-D7WXNA2O.js";import"./chunk-NI4EYBQH.js";import"./chunk-ATBINUDP.js";
|
package/dist/lib/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as d}from"../chunk-S6KFKBMY.js";import{a as t,c as l,d as p,e as f}from"../chunk-
|
|
1
|
+
import{b as d}from"../chunk-S6KFKBMY.js";import{a as t,c as l,d as p,e as f}from"../chunk-2Q2EKNAN.js";import{b as m}from"../chunk-SE5TRZWU.js";import"../chunk-DV3LCXRH.js";import{b as s,c as i,f as a,j as c}from"../chunk-D7WXNA2O.js";import"../chunk-NI4EYBQH.js";import"../chunk-ATBINUDP.js";import{execSync as h}from"child_process";var r=c("update");async function v(u={}){let g=d(u);s(r);try{let o=await f(),e=l(t,o),n=p();if(g==="json"){console.log(JSON.stringify({currentVersion:t,latestVersion:o,updateAvailable:e,updateCommand:n}));return}console.log(`Current version: ${t}`),e?(console.log(`Latest version: ${o}`),console.log("Updating..."),h(n,{stdio:"inherit",...process.platform==="win32"?{shell:"powershell.exe"}:{}}),i(r,{latestVersion:o})):a(r,{currentVersion:t})}catch(o){m(r,o)}}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e}from"../chunk-
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e}from"../chunk-2Q2EKNAN.js";import"../chunk-ATBINUDP.js";export{e as checkForUpdates,d as fetchLatestVersion,c as getUpdateCommand,b as isNewerVersion,a as readUpdateCache};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tigrisdata/cli",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.3",
|
|
4
4
|
"description": "Command line interface for Tigris object storage",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -21,34 +21,6 @@
|
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build": "tsc --noEmit && tsup",
|
|
26
|
-
"dev": "export $(grep -v '^#' .env.test | xargs) && (tsc --noEmit --watch --preserveWatchOutput & tsup --watch)",
|
|
27
|
-
"cli": "export $(grep -v '^#' .env.test | xargs) && node dist/cli.js",
|
|
28
|
-
"lint": "biome lint",
|
|
29
|
-
"lint:fix": "biome lint --write",
|
|
30
|
-
"format": "biome format --write",
|
|
31
|
-
"format:check": "biome format",
|
|
32
|
-
"test": "vitest run --exclude test/cli.test.ts",
|
|
33
|
-
"test:watch": "vitest",
|
|
34
|
-
"test:all": "vitest run",
|
|
35
|
-
"test:integration": "vitest run test/cli.test.ts",
|
|
36
|
-
"publint": "publint",
|
|
37
|
-
"updatedocs": "tsx scripts/update-docs.ts",
|
|
38
|
-
"postinstall": "node postinstall.cjs",
|
|
39
|
-
"generate:registry": "tsx scripts/generate-registry.ts",
|
|
40
|
-
"build:binary": "npm run generate:registry && tsc --noEmit -p tsconfig.binary.json && tsx scripts/build-binaries.ts",
|
|
41
|
-
"build:binary:current": "npm run generate:registry && tsc --noEmit -p tsconfig.binary.json && bun build src/cli-binary.ts --compile --outfile=bin/tigris",
|
|
42
|
-
"dev:binary": "npm run generate:registry && tsc --noEmit --watch --preserveWatchOutput -p tsconfig.binary.json & bun build src/cli-binary.ts --compile --watch --outfile=bin/tigris",
|
|
43
|
-
"prepublishOnly": "npm run build",
|
|
44
|
-
"clean": "rm -rf dist",
|
|
45
|
-
"prepare": "husky install",
|
|
46
|
-
"changeset": "changeset",
|
|
47
|
-
"version-packages": "changeset version",
|
|
48
|
-
"release": "changeset publish",
|
|
49
|
-
"check": "biome check",
|
|
50
|
-
"check:fix": "biome check --write"
|
|
51
|
-
},
|
|
52
24
|
"keywords": [
|
|
53
25
|
"cli",
|
|
54
26
|
"object",
|
|
@@ -59,31 +31,44 @@
|
|
|
59
31
|
"author": "Tigris Data",
|
|
60
32
|
"repository": {
|
|
61
33
|
"type": "git",
|
|
62
|
-
"url": "git+https://github.com/tigrisdata/
|
|
34
|
+
"url": "git+https://github.com/tigrisdata/storage.git",
|
|
35
|
+
"directory": "packages/cli"
|
|
63
36
|
},
|
|
64
37
|
"license": "MIT",
|
|
65
38
|
"dependencies": {
|
|
66
39
|
"@aws-sdk/credential-providers": "^3.1038.0",
|
|
67
40
|
"@smithy/shared-ini-file-loader": "^4.4.9",
|
|
68
|
-
"@tigrisdata/iam": "^2.2.0",
|
|
69
|
-
"@tigrisdata/storage": "^3.17.0",
|
|
70
41
|
"commander": "^14.0.3",
|
|
71
42
|
"enquirer": "^2.4.1",
|
|
72
43
|
"jose": "^6.2.3",
|
|
73
44
|
"open": "^11.0.0",
|
|
74
|
-
"yaml": "^2.8.3"
|
|
45
|
+
"yaml": "^2.8.3",
|
|
46
|
+
"@tigrisdata/iam": "^2.2.1",
|
|
47
|
+
"@tigrisdata/storage": "^3.17.2"
|
|
75
48
|
},
|
|
76
49
|
"devDependencies": {
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
50
|
+
"tsx": "^4.21.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc --noEmit && tsup",
|
|
54
|
+
"dev": "export $(grep -v '^#' .env.test | xargs) && (tsc --noEmit --watch --preserveWatchOutput & tsup --watch)",
|
|
55
|
+
"cli": "export $(grep -v '^#' .env.test | xargs) && node dist/cli.js",
|
|
56
|
+
"lint": "biome lint",
|
|
57
|
+
"lint:fix": "biome lint --write",
|
|
58
|
+
"format": "biome format --write",
|
|
59
|
+
"format:check": "biome format",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"test:watch": "vitest",
|
|
62
|
+
"test:integration": "vitest run test/cli.test.ts",
|
|
63
|
+
"publint": "publint",
|
|
64
|
+
"updatedocs": "tsx scripts/update-docs.ts",
|
|
65
|
+
"postinstall": "node postinstall.cjs",
|
|
66
|
+
"generate:registry": "tsx scripts/generate-registry.ts",
|
|
67
|
+
"build:binary": "npm run generate:registry && tsc --noEmit -p tsconfig.binary.json && tsx scripts/build-binaries.ts",
|
|
68
|
+
"build:binary:current": "npm run generate:registry && tsc --noEmit -p tsconfig.binary.json && bun build src/cli-binary.ts --compile --outfile=bin/tigris",
|
|
69
|
+
"dev:binary": "npm run generate:registry && tsc --noEmit --watch --preserveWatchOutput -p tsconfig.binary.json & bun build src/cli-binary.ts --compile --watch --outfile=bin/tigris",
|
|
70
|
+
"clean": "rm -rf dist",
|
|
71
|
+
"check": "biome check",
|
|
72
|
+
"check:fix": "biome check --write"
|
|
88
73
|
}
|
|
89
|
-
}
|
|
74
|
+
}
|
package/postinstall.cjs
CHANGED
|
@@ -2,6 +2,10 @@ const { openSync, writeSync, closeSync, mkdirSync, copyFileSync, existsSync } =
|
|
|
2
2
|
const { join } = require('path');
|
|
3
3
|
const { homedir } = require('os');
|
|
4
4
|
|
|
5
|
+
// Only run when installed as a dependency (under node_modules), not during
|
|
6
|
+
// monorepo/workspace dev installs where this package is the source tree.
|
|
7
|
+
if (!__dirname.includes('node_modules')) process.exit(0);
|
|
8
|
+
|
|
5
9
|
// --- Install Claude Code SKILL.md ---
|
|
6
10
|
try {
|
|
7
11
|
const claudeDir = join(homedir(), '.claude');
|
package/dist/chunk-X3H2PJ6S.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{d,e as m,f}from"./chunk-ATBINUDP.js";import{mkdirSync as C,readFileSync as _,realpathSync as E,writeFileSync as I}from"fs";import k from"https";import{homedir as g}from"os";import{join as h}from"path";var p="3.4.1";var b=h(g(),".tigris","update-check.json");function y(){try{let e=_(b,"utf-8"),n=JSON.parse(e);return typeof n.latestVersion=="string"&&typeof n.lastChecked=="number"?n:null}catch{return null}}function v(e){try{C(h(g(),".tigris"),{recursive:!0}),I(b,JSON.stringify(e),"utf-8")}catch{}}function N(e,n){let o=i=>{let s=i.startsWith("v")?i.slice(1):i,c=null,a=s.indexOf("-");a!==-1&&(c=s.slice(a+1),s=s.slice(0,a));let l=s.split(".");if(l.length!==3)return null;let u=l.map(Number);return u.some(Number.isNaN)?null:{major:u[0],minor:u[1],patch:u[2],prerelease:c}},r=o(e),t=o(n);return!r||!t?!1:t.major>r.major?!0:t.major<r.major?!1:t.minor>r.minor?!0:t.minor<r.minor?!1:t.patch>r.patch?!0:t.patch<r.patch?!1:r.prerelease&&!t.prerelease?!0:(!r.prerelease&&t.prerelease,!1)}function T(){if(process.platform==="win32")return!1;try{let e=E(process.execPath);return e.includes("/Cellar/")||e.includes("/Caskroom/")}catch{return!1}}function L(){return globalThis.__TIGRIS_BINARY===!0?T()?"brew upgrade tigris":process.platform==="win32"?"irm https://github.com/tigrisdata/cli/releases/latest/download/install.ps1 | iex":"curl -fsSL https://github.com/tigrisdata/cli/releases/latest/download/install.sh | sh":"npm install -g @tigrisdata/cli"}function x(e={}){return new Promise((n,o)=>{let r=k.get(d,{timeout:1e4},t=>{let i="";t.on("data",s=>{i+=s}),t.on("end",()=>{try{let s=JSON.parse(i);typeof s.version=="string"?(v({...y(),latestVersion:s.version,lastChecked:Date.now()}),n(s.version)):o(new Error("Unexpected registry response"))}catch{o(new Error("Failed to parse registry response"))}})});r.on("error",t=>{o(t)}),r.on("timeout",()=>{r.destroy(),o(new Error("Request timed out"))}),e.unref&&r.on("socket",t=>{t.unref()}),r.end()})}function j(){x({unref:!0}).catch(()=>{})}function M(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let e=y(),n=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(e&&N(p,e.latestVersion)&&(!e.lastNotified||Date.now()-e.lastNotified>n)){let r=`Update available: ${p} \u2192 ${e.latestVersion}`,t='Run "tigris update" to upgrade.',i=Math.max(r.length,t.length)+4,s=`\u250C${"\u2500".repeat(i-2)}\u2510`,c=`\u2514${"\u2500".repeat(i-2)}\u2518`,a=l=>`\u2502 ${l.padEnd(i-4)} \u2502`;console.log(`
|
|
2
|
-
${s}
|
|
3
|
-
${a("")}
|
|
4
|
-
${a(r)}
|
|
5
|
-
${a(t)}
|
|
6
|
-
${a("")}
|
|
7
|
-
${c}
|
|
8
|
-
`),v({...e,lastNotified:Date.now()})}let o=Number(process.env.TIGRIS_UPDATE_CHECK_INTERVAL_MS)||216e5;(!e||Date.now()-e.lastChecked>o)&&j()}export{p as a,y as b,N as c,L as d,x as e,M as f};
|