@grepai/cli 0.5.6 → 0.5.7

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 (3) hide show
  1. package/index.js +14 -4
  2. package/index.js.map +4 -4
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -82624,14 +82624,24 @@ var Query = class {
82624
82624
  // ../core/src/internal/services/chunker-ast/ast-parser.ts
82625
82625
  class AstParser extends Service()("@grepai/core/internal/services/chunker-ast/ast-parser/AstParser", {
82626
82626
  sync: () => {
82627
+ let initialzed = false;
82628
+ const languageCache = new Map;
82627
82629
  const parse12 = fnUntraced2(function* (input) {
82628
82630
  const { content, language } = input;
82629
82631
  return yield* tryPromise2({
82630
82632
  try: async () => {
82631
- await Parser.init();
82633
+ if (!initialzed) {
82634
+ await Parser.init();
82635
+ initialzed = true;
82636
+ }
82632
82637
  const parser2 = new Parser;
82633
82638
  parser2.reset();
82634
- parser2.setLanguage(await Language.load(languageMap[language]));
82639
+ parser2.setLanguage(await (async () => {
82640
+ if (!languageCache.has(language)) {
82641
+ languageCache.set(language, await Language.load(languageMap[language]));
82642
+ }
82643
+ return languageCache.get(language);
82644
+ })());
82635
82645
  const tree = parser2.parse(content);
82636
82646
  return tree;
82637
82647
  },
@@ -90683,11 +90693,11 @@ var program = gen2(function* () {
90683
90693
  const command = exports_Command.make("grepai").pipe(exports_Command.withSubcommands([indexCommand, searchCommand]));
90684
90694
  const cli = exports_Command.run(command, {
90685
90695
  name: "GREP AI",
90686
- version: "v0.5.6"
90696
+ version: "v0.5.7"
90687
90697
  });
90688
90698
  yield* cli(process.argv);
90689
90699
  });
90690
90700
  program.pipe(provide2(mergeAll5(GrepAi.Default).pipe(provideMerge2(Clack.Default), provideMerge2(exports_BunContext.layer))), exports_BunRuntime.runMain);
90691
90701
 
90692
- //# debugId=14B2A967A1F12A0F64756E2164756E21
90702
+ //# debugId=A9EA01FBC66B679B64756E2164756E21
90693
90703
  //# sourceMappingURL=index.js.map