@powerhousedao/vetra 4.1.0-dev.67 → 4.1.0-dev.68

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.
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../processors/codegen/factory.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,eAAO,MAAM,uBAAuB,GACjC,QAAQ,oBAAoB,MAC5B,aAAa,gBAAgB,KAAG,eAAe,EAgC/C,CAAC"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../processors/codegen/factory.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA+BvD,eAAO,MAAM,uBAAuB,GACjC,QAAQ,oBAAoB,MAC5B,aAAa,gBAAgB,KAAG,eAAe,EA+B/C,CAAC"}
@@ -1,11 +1,31 @@
1
1
  import { VETRA_PROCESSOR_CONFIG_KEY } from "@powerhousedao/config";
2
2
  import { CodegenProcessor } from "./index.js";
3
+ /**
4
+ * Determines if a drive header matches the Vetra drive criteria.
5
+ * @param driveHeader - The drive header to check
6
+ * @param explicitDriveId - Optional explicit drive ID from config (if set, uses exact match)
7
+ * @returns true if the drive is a Vetra drive, false otherwise
8
+ */
9
+ function isDriveVetra(driveHeader, driveIdFromConfig) {
10
+ // If explicit drive ID is configured, use exact match
11
+ if (driveIdFromConfig) {
12
+ return (driveHeader.slug === driveIdFromConfig ||
13
+ driveHeader.id === driveIdFromConfig);
14
+ }
15
+ // Otherwise, check if slug/id matches Vetra pattern
16
+ // Matches "vetra" exactly or IDs starting with "vetra-" (case-insensitive)
17
+ const matchesPattern = (identifier) => {
18
+ const lower = identifier.toLowerCase();
19
+ return lower === "vetra" || lower.startsWith("vetra-");
20
+ };
21
+ return matchesPattern(driveHeader.slug) || matchesPattern(driveHeader.id);
22
+ }
3
23
  export const codegenProcessorFactory = (module) => (driveHeader) => {
4
24
  // Create the processor
5
25
  const processorsConfig = module.config ?? new Map();
6
26
  const vetraConfig = processorsConfig.get(VETRA_PROCESSOR_CONFIG_KEY);
7
- const vetraDriveId = vetraConfig?.driveId ?? "vetra";
8
- if (driveHeader.slug !== vetraDriveId && driveHeader.id !== vetraDriveId) {
27
+ // Check if this drive should use the Vetra processor
28
+ if (!isDriveVetra(driveHeader, vetraConfig?.driveId)) {
9
29
  return [];
10
30
  }
11
31
  const processor = new CodegenProcessor(vetraConfig?.interactive);
@@ -1 +1 @@
1
- {"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../processors/codegen/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,CAAC,MAAM,uBAAuB,GAClC,CAAC,MAA4B,EAAE,EAAE,CACjC,CAAC,WAA6B,EAAqB,EAAE;IACnD,uBAAuB;IACvB,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,IAAI,IAAI,GAAG,EAAmB,CAAC;IACrE,MAAM,WAAW,GAAG,gBAAgB,CAAC,GAAG,CAAC,0BAA0B,CAEtD,CAAC;IAEd,MAAM,YAAY,GAAG,WAAW,EAAE,OAAO,IAAI,OAAO,CAAC;IAErD,IAAI,WAAW,CAAC,IAAI,KAAK,YAAY,IAAI,WAAW,CAAC,EAAE,KAAK,YAAY,EAAE,CAAC;QACzE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACjE,OAAO;QACL;YACE,SA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WAAW,GAAG,gBAAgB,CAAC,GAAG,CAAC,0BAA0B,CAEtD,CAAC;IAEd,qDAAqD;IACrD,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;QACrD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACjE,OAAO;QACL;YACE,SAAS;YACT,MAAM,EAAE;gBACN,MAAM,EAAE,CAAC,MAAM,CAAC;gBAChB,UAAU,EAAE,CAAC,GAAG,CAAC;gBACjB,YAAY,EAAE;oBACZ,2BAA2B;oBAC3B,oBAAoB;oBACpB,4BAA4B;oBAC5B,qBAAqB;oBACrB,sBAAsB;oBACtB,gBAAgB;iBACjB;gBACD,KAAK,EAAE,CAAC,QAAQ,CAAC;aAClB;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -6,12 +6,12 @@ export const schema = gql `
6
6
  type VetraPackageItem {
7
7
  documentId: String!
8
8
  name: String!
9
- description: String!
10
- category: String!
11
- authorName: String!
12
- authorWebsite: String!
13
- githubUrl: String!
14
- npmUrl: String!
9
+ description: String
10
+ category: String
11
+ authorName: String
12
+ authorWebsite: String
13
+ githubUrl: String
14
+ npmUrl: String
15
15
  }
16
16
 
17
17
  type Query {