@posthog/cli 0.4.8 → 0.5.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # posthog-cli
2
2
 
3
+ # 0.5.0
4
+
5
+ - Sourcemap injection, upload and process commands made retriable. Significant improvement to release creation.
6
+
3
7
  ## 0.4.8
4
8
 
5
9
  - fix bug where directory ends with a javascript extension
package/binary-install.js CHANGED
@@ -13,7 +13,7 @@ const error = (msg) => {
13
13
  };
14
14
 
15
15
  class Package {
16
- constructor(name, url, filename, zipExt, binaries) {
16
+ constructor(platform, name, url, filename, zipExt, binaries) {
17
17
  let errors = [];
18
18
  if (typeof url !== "string") {
19
19
  errors.push("url must be a string");
@@ -47,6 +47,8 @@ class Package {
47
47
  '\n\nCorrect usage: new Package("my-binary", "https://example.com/binary/download.tar.gz", {"my-binary": "my-binary"})';
48
48
  error(errorMsg);
49
49
  }
50
+
51
+ this.platform = platform;
50
52
  this.url = url;
51
53
  this.name = name;
52
54
  this.filename = filename;
@@ -122,12 +124,30 @@ class Package {
122
124
  );
123
125
  }
124
126
  } else if (this.zipExt == ".zip") {
125
- const result = spawnSync("unzip", [
126
- "-q",
127
- tempFile,
128
- "-d",
129
- this.installDirectory,
130
- ]);
127
+ let result;
128
+ if (this.platform.artifactName.includes("windows")) {
129
+ // Windows does not have "unzip" by default on many installations, instead
130
+ // we use Expand-Archive from powershell
131
+ result = spawnSync("powershell.exe", [
132
+ "-NoProfile",
133
+ "-NonInteractive",
134
+ "-Command",
135
+ `& {
136
+ param([string]$LiteralPath, [string]$DestinationPath)
137
+ Expand-Archive -LiteralPath $LiteralPath -DestinationPath $DestinationPath -Force
138
+ }`,
139
+ tempFile,
140
+ this.installDirectory,
141
+ ]);
142
+ } else {
143
+ result = spawnSync("unzip", [
144
+ "-q",
145
+ tempFile,
146
+ "-d",
147
+ this.installDirectory,
148
+ ]);
149
+ }
150
+
131
151
  if (result.status == 0) {
132
152
  resolve();
133
153
  } else if (result.error) {
package/binary.js CHANGED
@@ -96,7 +96,7 @@ const getPackage = () => {
96
96
  const url = `${artifactDownloadUrl}/${platform.artifactName}`;
97
97
  let filename = platform.artifactName;
98
98
  let ext = platform.zipExt;
99
- let binary = new Package(name, url, filename, ext, platform.bins);
99
+ let binary = new Package(platform, name, url, filename, ext, platform.bins);
100
100
 
101
101
  return binary;
102
102
  };
@@ -7,7 +7,7 @@
7
7
  "posthog-cli": "run-posthog-cli.js"
8
8
  },
9
9
  "dependencies": {
10
- "axios": "^1.10.0",
10
+ "axios": "^1.11.0",
11
11
  "axios-proxy-builder": "^0.1.2",
12
12
  "console.table": "^0.10.0",
13
13
  "detect-libc": "^2.0.4",
@@ -23,7 +23,7 @@
23
23
  "hasInstallScript": true,
24
24
  "license": "MIT",
25
25
  "name": "@posthog/cli",
26
- "version": "0.4.8"
26
+ "version": "0.5.0"
27
27
  },
28
28
  "node_modules/@isaacs/balanced-match": {
29
29
  "engines": {
@@ -96,13 +96,13 @@
96
96
  "node_modules/axios": {
97
97
  "dependencies": {
98
98
  "follow-redirects": "^1.15.6",
99
- "form-data": "^4.0.0",
99
+ "form-data": "^4.0.4",
100
100
  "proxy-from-env": "^1.1.0"
101
101
  },
102
- "integrity": "sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw==",
102
+ "integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==",
103
103
  "license": "MIT",
104
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.10.0.tgz",
105
- "version": "1.10.0"
104
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz",
105
+ "version": "1.11.0"
106
106
  },
107
107
  "node_modules/axios-proxy-builder": {
108
108
  "dependencies": {
@@ -113,6 +113,19 @@
113
113
  "resolved": "https://registry.npmjs.org/axios-proxy-builder/-/axios-proxy-builder-0.1.2.tgz",
114
114
  "version": "0.1.2"
115
115
  },
116
+ "node_modules/call-bind-apply-helpers": {
117
+ "dependencies": {
118
+ "es-errors": "^1.3.0",
119
+ "function-bind": "^1.1.2"
120
+ },
121
+ "engines": {
122
+ "node": ">= 0.4"
123
+ },
124
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
125
+ "license": "MIT",
126
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
127
+ "version": "1.0.2"
128
+ },
116
129
  "node_modules/clone": {
117
130
  "engines": {
118
131
  "node": ">=0.8"
@@ -210,6 +223,20 @@
210
223
  "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz",
211
224
  "version": "2.0.4"
212
225
  },
226
+ "node_modules/dunder-proto": {
227
+ "dependencies": {
228
+ "call-bind-apply-helpers": "^1.0.1",
229
+ "es-errors": "^1.3.0",
230
+ "gopd": "^1.2.0"
231
+ },
232
+ "engines": {
233
+ "node": ">= 0.4"
234
+ },
235
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
236
+ "license": "MIT",
237
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
238
+ "version": "1.0.1"
239
+ },
213
240
  "node_modules/eastasianwidth": {
214
241
  "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
215
242
  "license": "MIT",
@@ -231,6 +258,51 @@
231
258
  "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
232
259
  "version": "9.2.2"
233
260
  },
261
+ "node_modules/es-define-property": {
262
+ "engines": {
263
+ "node": ">= 0.4"
264
+ },
265
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
266
+ "license": "MIT",
267
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
268
+ "version": "1.0.1"
269
+ },
270
+ "node_modules/es-errors": {
271
+ "engines": {
272
+ "node": ">= 0.4"
273
+ },
274
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
275
+ "license": "MIT",
276
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
277
+ "version": "1.3.0"
278
+ },
279
+ "node_modules/es-object-atoms": {
280
+ "dependencies": {
281
+ "es-errors": "^1.3.0"
282
+ },
283
+ "engines": {
284
+ "node": ">= 0.4"
285
+ },
286
+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
287
+ "license": "MIT",
288
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
289
+ "version": "1.1.1"
290
+ },
291
+ "node_modules/es-set-tostringtag": {
292
+ "dependencies": {
293
+ "es-errors": "^1.3.0",
294
+ "get-intrinsic": "^1.2.6",
295
+ "has-tostringtag": "^1.0.2",
296
+ "hasown": "^2.0.2"
297
+ },
298
+ "engines": {
299
+ "node": ">= 0.4"
300
+ },
301
+ "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
302
+ "license": "MIT",
303
+ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
304
+ "version": "2.1.0"
305
+ },
234
306
  "node_modules/follow-redirects": {
235
307
  "engines": {
236
308
  "node": ">=4.0"
@@ -271,15 +343,63 @@
271
343
  "dependencies": {
272
344
  "asynckit": "^0.4.0",
273
345
  "combined-stream": "^1.0.8",
346
+ "es-set-tostringtag": "^2.1.0",
347
+ "hasown": "^2.0.2",
274
348
  "mime-types": "^2.1.12"
275
349
  },
276
350
  "engines": {
277
351
  "node": ">= 6"
278
352
  },
279
- "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
353
+ "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
354
+ "license": "MIT",
355
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
356
+ "version": "4.0.4"
357
+ },
358
+ "node_modules/function-bind": {
359
+ "funding": {
360
+ "url": "https://github.com/sponsors/ljharb"
361
+ },
362
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
363
+ "license": "MIT",
364
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
365
+ "version": "1.1.2"
366
+ },
367
+ "node_modules/get-intrinsic": {
368
+ "dependencies": {
369
+ "call-bind-apply-helpers": "^1.0.2",
370
+ "es-define-property": "^1.0.1",
371
+ "es-errors": "^1.3.0",
372
+ "es-object-atoms": "^1.1.1",
373
+ "function-bind": "^1.1.2",
374
+ "get-proto": "^1.0.1",
375
+ "gopd": "^1.2.0",
376
+ "has-symbols": "^1.1.0",
377
+ "hasown": "^2.0.2",
378
+ "math-intrinsics": "^1.1.0"
379
+ },
380
+ "engines": {
381
+ "node": ">= 0.4"
382
+ },
383
+ "funding": {
384
+ "url": "https://github.com/sponsors/ljharb"
385
+ },
386
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
280
387
  "license": "MIT",
281
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
282
- "version": "4.0.0"
388
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
389
+ "version": "1.3.0"
390
+ },
391
+ "node_modules/get-proto": {
392
+ "dependencies": {
393
+ "dunder-proto": "^1.0.1",
394
+ "es-object-atoms": "^1.0.0"
395
+ },
396
+ "engines": {
397
+ "node": ">= 0.4"
398
+ },
399
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
400
+ "license": "MIT",
401
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
402
+ "version": "1.0.1"
283
403
  },
284
404
  "node_modules/glob": {
285
405
  "bin": {
@@ -304,6 +424,57 @@
304
424
  "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz",
305
425
  "version": "11.0.3"
306
426
  },
427
+ "node_modules/gopd": {
428
+ "engines": {
429
+ "node": ">= 0.4"
430
+ },
431
+ "funding": {
432
+ "url": "https://github.com/sponsors/ljharb"
433
+ },
434
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
435
+ "license": "MIT",
436
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
437
+ "version": "1.2.0"
438
+ },
439
+ "node_modules/has-symbols": {
440
+ "engines": {
441
+ "node": ">= 0.4"
442
+ },
443
+ "funding": {
444
+ "url": "https://github.com/sponsors/ljharb"
445
+ },
446
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
447
+ "license": "MIT",
448
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
449
+ "version": "1.1.0"
450
+ },
451
+ "node_modules/has-tostringtag": {
452
+ "dependencies": {
453
+ "has-symbols": "^1.0.3"
454
+ },
455
+ "engines": {
456
+ "node": ">= 0.4"
457
+ },
458
+ "funding": {
459
+ "url": "https://github.com/sponsors/ljharb"
460
+ },
461
+ "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
462
+ "license": "MIT",
463
+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
464
+ "version": "1.0.2"
465
+ },
466
+ "node_modules/hasown": {
467
+ "dependencies": {
468
+ "function-bind": "^1.1.2"
469
+ },
470
+ "engines": {
471
+ "node": ">= 0.4"
472
+ },
473
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
474
+ "license": "MIT",
475
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
476
+ "version": "2.0.2"
477
+ },
307
478
  "node_modules/is-fullwidth-code-point": {
308
479
  "engines": {
309
480
  "node": ">=8"
@@ -343,6 +514,15 @@
343
514
  "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz",
344
515
  "version": "11.1.0"
345
516
  },
517
+ "node_modules/math-intrinsics": {
518
+ "engines": {
519
+ "node": ">= 0.4"
520
+ },
521
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
522
+ "license": "MIT",
523
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
524
+ "version": "1.1.0"
525
+ },
346
526
  "node_modules/mime-db": {
347
527
  "engines": {
348
528
  "node": ">= 0.6"
@@ -716,5 +896,5 @@
716
896
  }
717
897
  },
718
898
  "requires": true,
719
- "version": "0.4.8"
899
+ "version": "0.5.0"
720
900
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "artifactDownloadUrl": "https://github.com/PostHog/posthog/releases/download/posthog-cli-v0.4.8",
2
+ "artifactDownloadUrl": "https://github.com/PostHog/posthog/releases/download/posthog-cli-v0.5.0",
3
3
  "bin": {
4
4
  "posthog-cli": "run-posthog-cli.js"
5
5
  },
@@ -9,7 +9,7 @@
9
9
  "Hugues <hugues@posthog.com>"
10
10
  ],
11
11
  "dependencies": {
12
- "axios": "^1.10.0",
12
+ "axios": "^1.11.0",
13
13
  "axios-proxy-builder": "^0.1.2",
14
14
  "console.table": "^0.10.0",
15
15
  "detect-libc": "^2.0.4",
@@ -116,7 +116,7 @@
116
116
  "zipExt": ".tar.gz"
117
117
  }
118
118
  },
119
- "version": "0.4.8",
119
+ "version": "0.5.0",
120
120
  "volta": {
121
121
  "node": "18.14.1",
122
122
  "npm": "9.5.0"