@xylabs/ts-scripts-yarn3 6.4.4 → 6.4.6

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/bin/xy.mjs CHANGED
@@ -693,13 +693,14 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
693
693
  );
694
694
  const imports = [];
695
695
  const typeImports = [];
696
+ const isDeclarationFile = filePath.endsWith(".d.ts");
696
697
  function visit(node) {
697
698
  if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
698
699
  const moduleSpecifier = node.moduleSpecifier?.getFullText();
699
700
  const isTypeImport = ts.isImportDeclaration(node) ? node.importClause?.isTypeOnly ?? false : false;
700
701
  if (moduleSpecifier) {
701
702
  const trimmed = moduleSpecifier.split("'").at(1) ?? moduleSpecifier;
702
- if (isTypeImport) {
703
+ if (isTypeImport && !isDeclarationFile) {
703
704
  typeImports.push(trimmed);
704
705
  } else {
705
706
  imports.push(trimmed);
@@ -732,7 +733,7 @@ function findFilesByGlob(cwd, pattern) {
732
733
  return globSync(pattern, { cwd, absolute: true });
733
734
  }
734
735
  function findFiles(path4) {
735
- const allSourceInclude = ["./src/**/*.{ts,tsx}"];
736
+ const allSourceInclude = ["./src/**/*.{ts,tsx}", "./dist/**/*.d.ts"];
736
737
  const prodExcludeEndswith = [".spec.ts", ".stories.tsx"];
737
738
  const prodExcludeIncludes = ["/spec/", "/stories/", "/scripts/"];
738
739
  const allSourceFiles = allSourceInclude.flatMap((pattern) => findFilesByGlob(path4, pattern));