@glasstrace/sdk 0.4.0 → 0.4.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/cli/init.cjs CHANGED
@@ -15602,12 +15602,18 @@ function extractImports(fileContent) {
15602
15602
  imports.push(importPath);
15603
15603
  }
15604
15604
  };
15605
- const esImportRegex = /import\s+(?:(?:[\w*{}\s,]+)\s+from\s+)?['"]([^'"]+)['"]/g;
15605
+ const esFromImportRegex = /\bimport\b[^'"]+\bfrom\s+['"]([^'"]+)['"]/g;
15606
+ const esSideEffectRegex = /\bimport\s+['"]([^'"]+)['"]/g;
15606
15607
  let match;
15607
- match = esImportRegex.exec(fileContent);
15608
+ match = esFromImportRegex.exec(fileContent);
15608
15609
  while (match !== null) {
15609
15610
  addUnique(match[1]);
15610
- match = esImportRegex.exec(fileContent);
15611
+ match = esFromImportRegex.exec(fileContent);
15612
+ }
15613
+ match = esSideEffectRegex.exec(fileContent);
15614
+ while (match !== null) {
15615
+ addUnique(match[1]);
15616
+ match = esSideEffectRegex.exec(fileContent);
15611
15617
  }
15612
15618
  const requireRegex = /require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
15613
15619
  match = requireRegex.exec(fileContent);