@schandlergarcia/sf-web-components 1.1.1 → 1.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Reusable Salesforce web components library with Tailwind CSS v4 and shadcn/ui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -59,6 +59,7 @@
59
59
  "world-atlas": "^2.0.0"
60
60
  },
61
61
  "dependencies": {
62
+ "@schandlergarcia/sf-web-components": "^1.1.1",
62
63
  "class-variance-authority": "^0.7.1",
63
64
  "clsx": "^2.1.1",
64
65
  "glob": "^11.0.0",
@@ -77,14 +77,19 @@ for (const file of files) {
77
77
  updates.push('utils import');
78
78
  }
79
79
 
80
- // Replace shadcn component names with library equivalents
80
+ // Replace shadcn component names with library equivalents in imports from package
81
81
  for (const [shadcnName, libraryName] of Object.entries(componentReplacements)) {
82
- // Match import statements like: import { Button } from '...'
83
- const importRegex = new RegExp(`\\b${shadcnName}\\b(?=\\s*[,}])`, 'g');
84
- if (importRegex.test(content)) {
85
- content = content.replace(importRegex, libraryName);
82
+ // Pattern: import { Button } from '@schandlergarcia/sf-web-components';
83
+ // Replace with: import { UIButton as Button } from '@schandlergarcia/sf-web-components';
84
+ const packageImportRegex = new RegExp(
85
+ `(import\\s*\\{[^}]*?)\\b${shadcnName}\\b([^}]*?\\}\\s*from\\s*['"]${PACKAGE_NAME}['"])`,
86
+ 'g'
87
+ );
88
+
89
+ if (packageImportRegex.test(content)) {
90
+ content = content.replace(packageImportRegex, `$1${libraryName} as ${shadcnName}$2`);
86
91
  modified = true;
87
- updates.push(`renamed ${shadcnName} to ${libraryName}`);
92
+ updates.push(`aliased ${shadcnName} to ${libraryName}`);
88
93
  }
89
94
  }
90
95