@backcap/cli 0.1.1 → 0.1.2

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/index.cjs CHANGED
@@ -2,6 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  const citty = require('citty');
5
+ const node_module = require('node:module');
5
6
  const pkgTypes = require('pkg-types');
6
7
  const result = require('@backcap/shared/result');
7
8
  const promises = require('node:fs/promises');
@@ -15,6 +16,7 @@ const registryItem = require('@backcap/shared/schemas/registry-item');
15
16
  const node_fs = require('node:fs');
16
17
  const node_child_process = require('node:child_process');
17
18
 
19
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
18
20
  function _interopNamespaceCompat(e) {
19
21
  if (e && typeof e === 'object' && 'default' in e) return e;
20
22
  const n = Object.create(null);
@@ -286,7 +288,7 @@ class RegistryError extends Error {
286
288
  }
287
289
  }
288
290
 
289
- const FALLBACK_URL = "https://raw.githubusercontent.com/backcap/registry/main/dist/registry.json";
291
+ const FALLBACK_URL = "https://raw.githubusercontent.com/faroke/backcap/main/dist/registry.json";
290
292
  async function fetchRegistry(primaryUrl) {
291
293
  let data;
292
294
  try {
@@ -310,7 +312,7 @@ async function fetchRegistry(primaryUrl) {
310
312
  const result = registry.registrySchema.safeParse(data);
311
313
  if (!result.success) {
312
314
  throw new RegistryError(
313
- "Registry response is invalid. This may indicate a version mismatch. Try updating: npx backcap@latest list"
315
+ "Registry response is invalid. This may indicate a version mismatch. Try updating: npx @backcap/cli@latest list"
314
316
  );
315
317
  }
316
318
  return result.data;
@@ -337,7 +339,7 @@ ${capabilities.length} capabilities available`;
337
339
  return [header, separator, ...rows, footer].join("\n") + "\n";
338
340
  }
339
341
 
340
- const DEFAULT_REGISTRY_URL$2 = "https://backcap.dev/registry.json";
342
+ const DEFAULT_REGISTRY_URL$2 = "https://faroke.github.io/backcap/registry.json";
341
343
  const list = citty.defineCommand({
342
344
  meta: {
343
345
  name: "list",
@@ -955,7 +957,7 @@ class MissingDependencyError extends Error {
955
957
  }
956
958
  }
957
959
 
958
- const DEFAULT_REGISTRY_URL$1 = "https://backcap.dev";
960
+ const DEFAULT_REGISTRY_URL$1 = "https://faroke.github.io/backcap";
959
961
  const add = citty.defineCommand({
960
962
  meta: {
961
963
  name: "add",
@@ -1279,7 +1281,7 @@ ${err.suggestion}`);
1279
1281
  outro(lines.join("\n"));
1280
1282
  }
1281
1283
 
1282
- const DEFAULT_REGISTRY_URL = "https://backcap.dev";
1284
+ const DEFAULT_REGISTRY_URL = "https://faroke.github.io/backcap";
1283
1285
  const bridges = citty.defineCommand({
1284
1286
  meta: {
1285
1287
  name: "bridges",
@@ -1339,10 +1341,12 @@ const bridges = citty.defineCommand({
1339
1341
  }
1340
1342
  });
1341
1343
 
1344
+ const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
1345
+ const { version } = require$1("../package.json");
1342
1346
  const main = citty.defineCommand({
1343
1347
  meta: {
1344
1348
  name: "backcap",
1345
- version: "0.0.1",
1349
+ version,
1346
1350
  description: "Backcap \u2014 capability registry CLI"
1347
1351
  },
1348
1352
  subCommands: {
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
+ import { createRequire } from 'node:module';
3
4
  import { readPackageJSON } from 'pkg-types';
4
5
  import { Result } from '@backcap/shared/result';
5
6
  import { stat, readFile, writeFile, mkdir, rename } from 'node:fs/promises';
@@ -270,7 +271,7 @@ class RegistryError extends Error {
270
271
  }
271
272
  }
272
273
 
273
- const FALLBACK_URL = "https://raw.githubusercontent.com/backcap/registry/main/dist/registry.json";
274
+ const FALLBACK_URL = "https://raw.githubusercontent.com/faroke/backcap/main/dist/registry.json";
274
275
  async function fetchRegistry(primaryUrl) {
275
276
  let data;
276
277
  try {
@@ -294,7 +295,7 @@ async function fetchRegistry(primaryUrl) {
294
295
  const result = registrySchema.safeParse(data);
295
296
  if (!result.success) {
296
297
  throw new RegistryError(
297
- "Registry response is invalid. This may indicate a version mismatch. Try updating: npx backcap@latest list"
298
+ "Registry response is invalid. This may indicate a version mismatch. Try updating: npx @backcap/cli@latest list"
298
299
  );
299
300
  }
300
301
  return result.data;
@@ -321,7 +322,7 @@ ${capabilities.length} capabilities available`;
321
322
  return [header, separator, ...rows, footer].join("\n") + "\n";
322
323
  }
323
324
 
324
- const DEFAULT_REGISTRY_URL$2 = "https://backcap.dev/registry.json";
325
+ const DEFAULT_REGISTRY_URL$2 = "https://faroke.github.io/backcap/registry.json";
325
326
  const list = defineCommand({
326
327
  meta: {
327
328
  name: "list",
@@ -939,7 +940,7 @@ class MissingDependencyError extends Error {
939
940
  }
940
941
  }
941
942
 
942
- const DEFAULT_REGISTRY_URL$1 = "https://backcap.dev";
943
+ const DEFAULT_REGISTRY_URL$1 = "https://faroke.github.io/backcap";
943
944
  const add = defineCommand({
944
945
  meta: {
945
946
  name: "add",
@@ -1263,7 +1264,7 @@ ${err.suggestion}`);
1263
1264
  outro(lines.join("\n"));
1264
1265
  }
1265
1266
 
1266
- const DEFAULT_REGISTRY_URL = "https://backcap.dev";
1267
+ const DEFAULT_REGISTRY_URL = "https://faroke.github.io/backcap";
1267
1268
  const bridges = defineCommand({
1268
1269
  meta: {
1269
1270
  name: "bridges",
@@ -1323,10 +1324,12 @@ const bridges = defineCommand({
1323
1324
  }
1324
1325
  });
1325
1326
 
1327
+ const require = createRequire(import.meta.url);
1328
+ const { version } = require("../package.json");
1326
1329
  const main = defineCommand({
1327
1330
  meta: {
1328
1331
  name: "backcap",
1329
- version: "0.0.1",
1332
+ version,
1330
1333
  description: "Backcap \u2014 capability registry CLI"
1331
1334
  },
1332
1335
  subCommands: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backcap/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "backcap": "./dist/index.mjs"
@@ -14,7 +14,13 @@
14
14
  "files": [
15
15
  "dist"
16
16
  ],
17
+ "scripts": {
18
+ "build": "unbuild",
19
+ "dev": "unbuild --stub",
20
+ "test": "vitest run"
21
+ },
17
22
  "dependencies": {
23
+ "@backcap/shared": "workspace:*",
18
24
  "@clack/prompts": "^0.7.0",
19
25
  "c12": "^1.11.0",
20
26
  "citty": "^0.1.6",
@@ -22,8 +28,7 @@
22
28
  "ofetch": "^1.3.4",
23
29
  "pathe": "^1.1.2",
24
30
  "pkg-types": "^1.1.1",
25
- "zod": "^3.22.0",
26
- "@backcap/shared": "0.1.1"
31
+ "zod": "^3.22.0"
27
32
  },
28
33
  "devDependencies": {
29
34
  "unbuild": "^2.0.0"
@@ -33,10 +38,5 @@
33
38
  },
34
39
  "engines": {
35
40
  "node": ">=18"
36
- },
37
- "scripts": {
38
- "build": "unbuild",
39
- "dev": "unbuild --stub",
40
- "test": "vitest run"
41
41
  }
42
- }
42
+ }