@driftless-sh/cli 0.1.47 → 0.1.48

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.js CHANGED
@@ -213477,10 +213477,11 @@ var require_nestjs_extractor = __commonJS({
213477
213477
  for (const d of decs || []) {
213478
213478
  if (getDecoratorName(d) !== "Module")
213479
213479
  continue;
213480
+ const emptyMeta = { imports: [], providers: [], controllers: [], globalGuards: [] };
213480
213481
  if (!typescript_1.default.isCallExpression(d.expression) || d.expression.arguments.length === 0)
213481
- return { imports: [], providers: [], controllers: [] };
213482
+ return emptyMeta;
213482
213483
  const obj = d.expression.arguments[0];
213483
- const meta = { imports: [], providers: [], controllers: [] };
213484
+ const meta = { imports: [], providers: [], controllers: [], globalGuards: [] };
213484
213485
  if (typescript_1.default.isObjectLiteralExpression(obj)) {
213485
213486
  for (const prop of obj.properties) {
213486
213487
  if (!typescript_1.default.isPropertyAssignment(prop) || !typescript_1.default.isIdentifier(prop.name))
@@ -213491,8 +213492,27 @@ var require_nestjs_extractor = __commonJS({
213491
213492
  if (!typescript_1.default.isArrayLiteralExpression(prop.initializer))
213492
213493
  continue;
213493
213494
  for (const el of prop.initializer.elements) {
213494
- if (typescript_1.default.isIdentifier(el))
213495
+ if (typescript_1.default.isIdentifier(el)) {
213495
213496
  meta[key].push(el.text);
213497
+ } else if (key === "providers" && typescript_1.default.isObjectLiteralExpression(el)) {
213498
+ let isAppGuard = false;
213499
+ let guardName = null;
213500
+ for (const p of el.properties) {
213501
+ if (!typescript_1.default.isPropertyAssignment(p) || !typescript_1.default.isIdentifier(p.name))
213502
+ continue;
213503
+ if (p.name.text === "provide") {
213504
+ const v = p.initializer;
213505
+ if (typescript_1.default.isIdentifier(v) && v.text === "APP_GUARD" || typescript_1.default.isPropertyAccessExpression(v) && typescript_1.default.isIdentifier(v.name) && v.name.text === "APP_GUARD") {
213506
+ isAppGuard = true;
213507
+ }
213508
+ } else if (p.name.text === "useClass" || p.name.text === "useExisting") {
213509
+ if (typescript_1.default.isIdentifier(p.initializer))
213510
+ guardName = p.initializer.text;
213511
+ }
213512
+ }
213513
+ if (isAppGuard && guardName)
213514
+ meta.globalGuards.push(guardName);
213515
+ }
213496
213516
  }
213497
213517
  }
213498
213518
  }
@@ -213979,12 +213999,13 @@ var require_nestjs_extractor = __commonJS({
213979
213999
  }, 1));
213980
214000
  }
213981
214001
  if (decorators.includes("Module")) {
214002
+ const globalGuards = cls.moduleMeta?.globalGuards ?? [];
213982
214003
  components.push(stamp({
213983
214004
  type: "module",
213984
214005
  name: className || "UnknownModule",
213985
214006
  file_path: facts.filePath,
213986
214007
  line_number: line,
213987
- metadata: {},
214008
+ metadata: globalGuards.length > 0 ? { global_guards: globalGuards } : {},
213988
214009
  relations: extractModuleRelations(cls, symbolIndex)
213989
214010
  }, 1));
213990
214011
  }
@@ -214576,7 +214597,7 @@ async function installSkillCommand() {
214576
214597
  // src/commands/init.ts
214577
214598
  function getVersion() {
214578
214599
  try {
214579
- return "0.1.47";
214600
+ return "0.1.48";
214580
214601
  } catch {
214581
214602
  return "0.0.0";
214582
214603
  }
@@ -216631,10 +216652,14 @@ async function graphCommand(args) {
216631
216652
  const header = g2.file && g2.file !== g2.query_path ? `\u258C ${path} \u2192 ${g2.file}` : `\u258C ${path}`;
216632
216653
  console.log(`${header}
216633
216654
  `);
216655
+ if (g2.global_guards && g2.global_guards.length) {
216656
+ console.log(`global guards (APP_GUARD): ${g2.global_guards.join(", ")}
216657
+ `);
216658
+ }
216634
216659
  if (g2.entrypoints.length) {
216635
216660
  console.log("entrypoints (routes that reach this):");
216636
216661
  for (const e of g2.entrypoints) {
216637
- const guards = e.guards && e.guards.length ? ` [${e.guards.join(", ")}]` : "";
216662
+ const guards = e.guards && e.guards.length ? ` [${e.guards.join(", ")}]` : " [no auth detected \u2014 verify]";
216638
216663
  console.log(` ${e.method ?? "?"} ${e.path ?? "?"} \u2192 ${e.handler}${guards}`);
216639
216664
  }
216640
216665
  console.log("");
@@ -216668,7 +216693,10 @@ async function graphCommand(args) {
216668
216693
  console.log(` ${consumers.length} consumer component(s) across ${g.impacted_files.length} file(s)`);
216669
216694
  if (eps.length) {
216670
216695
  console.log(` ${eps.length} reachable endpoint(s):`);
216671
- for (const e of eps.slice(0, 15)) console.log(` ${e.method ?? "?"} ${e.path ?? "?"} \u2192 ${e.handler}`);
216696
+ for (const e of eps.slice(0, 15)) {
216697
+ const guards = e.guards && e.guards.length ? ` [${e.guards.join(", ")}]` : " [no auth detected \u2014 verify]";
216698
+ console.log(` ${e.method ?? "?"} ${e.path ?? "?"} \u2192 ${e.handler}${guards}`);
216699
+ }
216672
216700
  if (eps.length > 15) console.log(` \u2026 and ${eps.length - 15} more`);
216673
216701
  }
216674
216702
  console.log("");
@@ -216685,7 +216713,7 @@ async function graphCommand(args) {
216685
216713
  }
216686
216714
 
216687
216715
  // src/index.ts
216688
- var VERSION = "0.1.47";
216716
+ var VERSION = "0.1.48";
216689
216717
  var HELP_TEXT = `Driftless CLI v${VERSION} \u2014 Living repo context for humans and coding agents
216690
216718
 
216691
216719
  Install: npm install -g @driftless-sh/cli