@ng-cn/core 1.0.12 → 1.0.14

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": "@ng-cn/core",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Beautifully designed Angular components built with Tailwind CSS v4 - The official Angular port of shadcn/ui",
5
5
  "keywords": [
6
6
  "angular",
@@ -545,12 +545,17 @@ function ngAdd(options) {
545
545
  const packageJsonPath = '/package.json';
546
546
  if (tree.exists(packageJsonPath)) {
547
547
  const packageJson = JSON.parse(tree.read(packageJsonPath).toString('utf-8'));
548
+ // Detect Angular version to determine CDK version
549
+ const angularCoreVersion = packageJson.dependencies?.['@angular/core'] || packageJson.devDependencies?.['@angular/core'] || '';
550
+ const angularMajorVersion = parseInt(angularCoreVersion.replace(/[\^~]/, '').split('.')[0], 10) || 21;
551
+ // Use compatible CDK version based on Angular version
552
+ const cdkVersion = angularMajorVersion >= 21 ? '^21.0.5' : angularMajorVersion >= 20 ? '^20.0.0' : '^19.0.0';
548
553
  const requiredDependencies = {
549
554
  'lucide-angular': '^0.562.0',
550
555
  'class-variance-authority': '^0.7.1',
551
556
  'clsx': '^2.1.1',
552
557
  'tailwind-merge': '^3.4.0',
553
- '@angular/cdk': '^21.0.5',
558
+ '@angular/cdk': cdkVersion,
554
559
  'tailwindcss': '^4.1.18',
555
560
  '@tailwindcss/postcss': '^4.1.18'
556
561
  };
@@ -594,12 +594,19 @@ export function ngAdd(options: NgAddOptions): Rule {
594
594
  if (tree.exists(packageJsonPath)) {
595
595
  const packageJson = JSON.parse(tree.read(packageJsonPath)!.toString('utf-8'));
596
596
 
597
- const requiredDependencies = {
597
+ // Detect Angular version to determine CDK version
598
+ const angularCoreVersion = packageJson.dependencies?.['@angular/core'] || packageJson.devDependencies?.['@angular/core'] || '';
599
+ const angularMajorVersion = parseInt(angularCoreVersion.replace(/[\^~]/, '').split('.')[0], 10) || 21;
600
+
601
+ // Use compatible CDK version based on Angular version
602
+ const cdkVersion = angularMajorVersion >= 21 ? '^21.0.5' : angularMajorVersion >= 20 ? '^20.0.0' : '^19.0.0';
603
+
604
+ const requiredDependencies: Record<string, string> = {
598
605
  'lucide-angular': '^0.562.0',
599
606
  'class-variance-authority': '^0.7.1',
600
607
  'clsx': '^2.1.1',
601
608
  'tailwind-merge': '^3.4.0',
602
- '@angular/cdk': '^21.0.5',
609
+ '@angular/cdk': cdkVersion,
603
610
  'tailwindcss': '^4.1.18',
604
611
  '@tailwindcss/postcss': '^4.1.18'
605
612
  };