snapfail 0.0.11 → 0.0.13

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { join, resolve, basename } from "path";
6
6
  import { existsSync, readFileSync, writeFileSync } from "fs";
7
7
  import { createServer } from "http";
8
8
  import { spawn, execSync } from "child_process";
9
- var VERSION = "0.0.11";
9
+ var VERSION = "0.0.13";
10
10
  var APP_URL = process.env["SNAPFAIL_APP_URL"] ?? "https://app.snapfail.com";
11
11
  var AUTH_TIMEOUT_MS = 5 * 60 * 1000;
12
12
  var c = {
@@ -334,17 +334,17 @@ function htmlString(title, body, ok) {
334
334
  function esc(s) {
335
335
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
336
336
  }
337
- function getInstallCommand(cwd) {
337
+ function getInstallCommand(cwd, version) {
338
338
  if (existsSync(join(cwd, "bun.lock")) || existsSync(join(cwd, "bun.lockb"))) {
339
- return "bun add @snapfail/sdk";
339
+ return `bun add --exact @snapfail/sdk@${version}`;
340
340
  }
341
341
  if (existsSync(join(cwd, "pnpm-lock.yaml")) || existsSync(join(cwd, "pnpm-workspace.yaml"))) {
342
- return "pnpm add @snapfail/sdk";
342
+ return `pnpm add --save-exact @snapfail/sdk@${version}`;
343
343
  }
344
344
  if (existsSync(join(cwd, "yarn.lock"))) {
345
- return "yarn add @snapfail/sdk";
345
+ return `yarn add --exact @snapfail/sdk@${version}`;
346
346
  }
347
- return "npm install @snapfail/sdk";
347
+ return `npm install --save-exact @snapfail/sdk@${version}`;
348
348
  }
349
349
  async function cmdInit(cwd) {
350
350
  console.log("");
@@ -391,7 +391,7 @@ async function cmdInit(cwd) {
391
391
  success("SnapFail is now integrated into your project!");
392
392
  console.log("");
393
393
  if (project.kind !== "html") {
394
- const installCmd = getInstallCommand(cwd);
394
+ const installCmd = getInstallCommand(cwd, VERSION);
395
395
  const installNow = await askYesNo("Would you like to automatically install @snapfail/sdk dependency now?", true);
396
396
  console.log("");
397
397
  if (installNow) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snapfail",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "CLI to initialise SnapFail error-tracking in Vite & Astro projects",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",