@entur/typography 1.10.0-beta.6 → 1.10.0-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entur/typography",
3
- "version": "1.10.0-beta.6",
3
+ "version": "1.10.0-beta.7",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/typography.esm.js",
@@ -42,5 +42,5 @@
42
42
  "devDependencies": {
43
43
  "dts-cli": "2.0.5"
44
44
  },
45
- "gitHead": "42c5a2e7657f2b5ca17328fcf55873b19e23f94a"
45
+ "gitHead": "26b5f016229bb0115d5f31ce51e15eafd015a870"
46
46
  }
@@ -551,12 +551,24 @@ function updateImports(content) {
551
551
  let updatedContent = content;
552
552
  let changes = 0;
553
553
 
554
+ // First, update import paths
554
555
  IMPORT_PATTERNS.forEach(pattern => {
555
556
  const matches = content.match(pattern) || [];
556
557
  changes += matches.length;
557
558
  updatedContent = updatedContent.replace(pattern, `from '${BETA_IMPORT}'`);
558
559
  });
559
560
 
561
+ // Then, update destructured import names
562
+ Object.entries(COMPONENT_MAPPING).forEach(([oldComponent, mapping]) => {
563
+ // Simple approach: find and replace the component name in import statements
564
+ const importRegex = new RegExp(`\\b${oldComponent}\\b(?=\\s*[,}])`, 'g');
565
+
566
+ if (importRegex.test(updatedContent)) {
567
+ changes++;
568
+ updatedContent = updatedContent.replace(importRegex, mapping.component);
569
+ }
570
+ });
571
+
560
572
  return { content: updatedContent, changes };
561
573
  }
562
574