@wraps.dev/cli 2.9.3 → 2.9.5

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/cli.js CHANGED
@@ -803,7 +803,9 @@ var init_config2 = __esm({
803
803
  });
804
804
 
805
805
  // src/telemetry/client.ts
806
- import { createRequire } from "module";
806
+ import { readFileSync as readFileSync2 } from "fs";
807
+ import { dirname, join as join5 } from "path";
808
+ import { fileURLToPath as fileURLToPath2 } from "url";
807
809
  import pc4 from "picocolors";
808
810
  function getTelemetryClient() {
809
811
  if (!telemetryInstance) {
@@ -811,7 +813,7 @@ function getTelemetryClient() {
811
813
  }
812
814
  return telemetryInstance;
813
815
  }
814
- var require2, DEFAULT_ENDPOINT, DEFAULT_TIMEOUT, TelemetryClient, telemetryInstance;
816
+ var DEFAULT_ENDPOINT, DEFAULT_TIMEOUT, TelemetryClient, telemetryInstance;
815
817
  var init_client = __esm({
816
818
  "src/telemetry/client.ts"() {
817
819
  "use strict";
@@ -819,7 +821,6 @@ var init_client = __esm({
819
821
  init_ci_detection();
820
822
  init_config();
821
823
  init_config2();
822
- require2 = createRequire(import.meta.url);
823
824
  DEFAULT_ENDPOINT = "https://wraps.dev/api/telemetry";
824
825
  DEFAULT_TIMEOUT = 2e3;
825
826
  TelemetryClient = class {
@@ -1045,8 +1046,12 @@ var init_client = __esm({
1045
1046
  */
1046
1047
  getCLIVersion() {
1047
1048
  try {
1048
- const packageJson2 = require2("../../package.json");
1049
- return packageJson2.version;
1049
+ const __filename3 = fileURLToPath2(import.meta.url);
1050
+ const __dirname4 = dirname(__filename3);
1051
+ const pkg = JSON.parse(
1052
+ readFileSync2(join5(__dirname4, "../package.json"), "utf-8")
1053
+ );
1054
+ return pkg.version;
1050
1055
  } catch {
1051
1056
  return "unknown";
1052
1057
  }
@@ -3932,12 +3937,12 @@ __export(metadata_exports, {
3932
3937
  import { randomBytes } from "crypto";
3933
3938
  import { existsSync as existsSync5 } from "fs";
3934
3939
  import { readFile as readFile2, writeFile as writeFile3 } from "fs/promises";
3935
- import { join as join5 } from "path";
3940
+ import { join as join6 } from "path";
3936
3941
  function getConnectionsDir() {
3937
- return join5(getWrapsDir(), "connections");
3942
+ return join6(getWrapsDir(), "connections");
3938
3943
  }
3939
3944
  function getMetadataPath(accountId, region) {
3940
- return join5(getConnectionsDir(), `${accountId}-${region}.json`);
3945
+ return join6(getConnectionsDir(), `${accountId}-${region}.json`);
3941
3946
  }
3942
3947
  async function ensureConnectionsDir() {
3943
3948
  await ensureWrapsDir();
@@ -4084,7 +4089,7 @@ async function listConnections() {
4084
4089
  const connections = [];
4085
4090
  for (const file of files) {
4086
4091
  if (file.endsWith(".json")) {
4087
- const content = await readFile2(join5(connectionsDir, file), "utf-8");
4092
+ const content = await readFile2(join6(connectionsDir, file), "utf-8");
4088
4093
  try {
4089
4094
  const metadata = JSON.parse(content);
4090
4095
  connections.push(metadata);
@@ -4590,19 +4595,19 @@ import { randomBytes as randomBytes2 } from "crypto";
4590
4595
  import { existsSync as existsSync6, mkdirSync } from "fs";
4591
4596
  import { builtinModules } from "module";
4592
4597
  import { tmpdir } from "os";
4593
- import { dirname, join as join6 } from "path";
4594
- import { fileURLToPath as fileURLToPath2 } from "url";
4598
+ import { dirname as dirname2, join as join7 } from "path";
4599
+ import { fileURLToPath as fileURLToPath3 } from "url";
4595
4600
  import * as aws8 from "@pulumi/aws";
4596
4601
  import * as pulumi11 from "@pulumi/pulumi";
4597
4602
  import { build } from "esbuild";
4598
4603
  function getPackageRoot() {
4599
- const currentFile = fileURLToPath2(import.meta.url);
4600
- let dir = dirname(currentFile);
4601
- while (dir !== dirname(dir)) {
4602
- if (existsSync6(join6(dir, "package.json"))) {
4604
+ const currentFile = fileURLToPath3(import.meta.url);
4605
+ let dir = dirname2(currentFile);
4606
+ while (dir !== dirname2(dir)) {
4607
+ if (existsSync6(join7(dir, "package.json"))) {
4603
4608
  return dir;
4604
4609
  }
4605
- dir = dirname(dir);
4610
+ dir = dirname2(dir);
4606
4611
  }
4607
4612
  throw new Error("Could not find package.json");
4608
4613
  }
@@ -4642,17 +4647,17 @@ async function findEventSourceMapping(functionName, queueArn) {
4642
4647
  }
4643
4648
  async function getLambdaCode(functionName) {
4644
4649
  const packageRoot = getPackageRoot();
4645
- const distLambdaPath = join6(packageRoot, "dist", "lambda", functionName);
4646
- const distBundleMarker = join6(distLambdaPath, ".bundled");
4650
+ const distLambdaPath = join7(packageRoot, "dist", "lambda", functionName);
4651
+ const distBundleMarker = join7(distLambdaPath, ".bundled");
4647
4652
  if (existsSync6(distBundleMarker)) {
4648
4653
  return distLambdaPath;
4649
4654
  }
4650
- const lambdaPath = join6(packageRoot, "lambda", functionName);
4651
- const lambdaBundleMarker = join6(lambdaPath, ".bundled");
4655
+ const lambdaPath = join7(packageRoot, "lambda", functionName);
4656
+ const lambdaBundleMarker = join7(lambdaPath, ".bundled");
4652
4657
  if (existsSync6(lambdaBundleMarker)) {
4653
4658
  return lambdaPath;
4654
4659
  }
4655
- const sourcePath = join6(lambdaPath, "index.ts");
4660
+ const sourcePath = join7(lambdaPath, "index.ts");
4656
4661
  if (!existsSync6(sourcePath)) {
4657
4662
  throw new Error(
4658
4663
  `Lambda source not found: ${sourcePath}
@@ -4661,7 +4666,7 @@ Try running: pnpm build`
4661
4666
  );
4662
4667
  }
4663
4668
  const buildId = randomBytes2(8).toString("hex");
4664
- const outdir = join6(tmpdir(), `wraps-lambda-${buildId}`);
4669
+ const outdir = join7(tmpdir(), `wraps-lambda-${buildId}`);
4665
4670
  if (!existsSync6(outdir)) {
4666
4671
  mkdirSync(outdir, { recursive: true });
4667
4672
  }
@@ -4671,7 +4676,7 @@ Try running: pnpm build`
4671
4676
  platform: "node",
4672
4677
  target: "node24",
4673
4678
  format: "esm",
4674
- outfile: join6(outdir, "index.mjs"),
4679
+ outfile: join7(outdir, "index.mjs"),
4675
4680
  external: ["@aws-sdk/*", ...nodeBuiltins],
4676
4681
  banner: {
4677
4682
  js: "import { createRequire } from 'module'; const require = createRequire(import.meta.url);"
@@ -6952,9 +6957,9 @@ var init_dynamodb_metrics = __esm({
6952
6957
 
6953
6958
  // src/cli.ts
6954
6959
  init_esm_shims();
6955
- import { readFileSync as readFileSync2 } from "fs";
6956
- import { dirname as dirname2, join as join7 } from "path";
6957
- import { fileURLToPath as fileURLToPath4 } from "url";
6960
+ import { readFileSync as readFileSync3 } from "fs";
6961
+ import { dirname as dirname3, join as join8 } from "path";
6962
+ import { fileURLToPath as fileURLToPath5 } from "url";
6958
6963
  import * as clack41 from "@clack/prompts";
6959
6964
  import args from "args";
6960
6965
  import pc44 from "picocolors";
@@ -22127,7 +22132,7 @@ import pc31 from "picocolors";
22127
22132
  init_esm_shims();
22128
22133
  import crypto from "crypto";
22129
22134
  import path2 from "path";
22130
- import { fileURLToPath as fileURLToPath3 } from "url";
22135
+ import { fileURLToPath as fileURLToPath4 } from "url";
22131
22136
  import express from "express";
22132
22137
  import { createHttpTerminator } from "http-terminator";
22133
22138
 
@@ -24649,7 +24654,7 @@ function createUserRouter(config2) {
24649
24654
  }
24650
24655
 
24651
24656
  // src/console/server.ts
24652
- var __dirname2 = path2.dirname(fileURLToPath3(import.meta.url));
24657
+ var __dirname2 = path2.dirname(fileURLToPath4(import.meta.url));
24653
24658
  async function startConsoleServer(config2) {
24654
24659
  const app = express();
24655
24660
  const authToken = crypto.randomBytes(32).toString("hex");
@@ -29029,10 +29034,10 @@ if (nodeMajorVersion < 20) {
29029
29034
  console.error("");
29030
29035
  process.exit(1);
29031
29036
  }
29032
- var __filename2 = fileURLToPath4(import.meta.url);
29033
- var __dirname3 = dirname2(__filename2);
29037
+ var __filename2 = fileURLToPath5(import.meta.url);
29038
+ var __dirname3 = dirname3(__filename2);
29034
29039
  var packageJson = JSON.parse(
29035
- readFileSync2(join7(__dirname3, "../package.json"), "utf-8")
29040
+ readFileSync3(join8(__dirname3, "../package.json"), "utf-8")
29036
29041
  );
29037
29042
  var VERSION = packageJson.version;
29038
29043
  setupTabCompletion();