@ng-cn/core 1.0.9 → 1.0.11
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 +1 -1
- package/schematics/ng-add/index.js +9 -36
- package/schematics/ng-add/index.ts +9 -36
package/package.json
CHANGED
|
@@ -712,42 +712,15 @@ function ngAdd(options) {
|
|
|
712
712
|
else {
|
|
713
713
|
context.logger.info('📦 Selected Components');
|
|
714
714
|
}
|
|
715
|
-
|
|
716
|
-
|
|
715
|
+
// For now, just log the components that would be copied
|
|
716
|
+
// Components will be available via 'ng g @ng-cn/core:component <name>'
|
|
717
717
|
for (const component of componentsToInstall) {
|
|
718
|
-
|
|
719
|
-
const componentFolder = component.replace(/-/g, '-');
|
|
720
|
-
const sourceComponentPath = (0, core_1.join)((0, core_1.normalize)(sourceComponentsBase), (0, core_1.normalize)(componentFolder));
|
|
721
|
-
const targetComponentPath = (0, core_1.join)((0, core_1.normalize)(uiPath), (0, core_1.normalize)(componentFolder));
|
|
722
|
-
try {
|
|
723
|
-
// Try to copy the entire component folder
|
|
724
|
-
const sourceFiles = tree.getDir(sourceComponentPath);
|
|
725
|
-
if (sourceFiles && sourceFiles.subfiles.length > 0) {
|
|
726
|
-
for (const file of sourceFiles.subfiles) {
|
|
727
|
-
const sourceFile = sourceComponentPath + '/' + file;
|
|
728
|
-
const targetFile = targetComponentPath + '/' + file;
|
|
729
|
-
const content = tree.read(sourceFile);
|
|
730
|
-
if (content) {
|
|
731
|
-
if (tree.exists(targetFile)) {
|
|
732
|
-
tree.overwrite(targetFile, content);
|
|
733
|
-
}
|
|
734
|
-
else {
|
|
735
|
-
tree.create(targetFile, content);
|
|
736
|
-
}
|
|
737
|
-
componentsCopied++;
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
context.logger.info(` + ${component}`);
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
catch (e) {
|
|
744
|
-
// Component folder doesn't exist yet or not available, skip
|
|
745
|
-
context.logger.debug(` ⊘ ${component} not available in core package`);
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
if (componentsCopied > 0) {
|
|
749
|
-
context.logger.info(` ✓ ${componentsCopied} component files copied`);
|
|
718
|
+
context.logger.info(` + ${component} (available via: ng g @ng-cn/core:component ${component})`);
|
|
750
719
|
}
|
|
720
|
+
context.logger.info('');
|
|
721
|
+
context.logger.info('💡 To copy individual components, use:');
|
|
722
|
+
context.logger.info(` ng g @ng-cn/core:component button`);
|
|
723
|
+
context.logger.info(` ng g @ng-cn/core:component card`);
|
|
751
724
|
}
|
|
752
725
|
// Success message with ASCII art banner
|
|
753
726
|
context.logger.info('');
|
|
@@ -799,10 +772,10 @@ function ngAdd(options) {
|
|
|
799
772
|
context.logger.info('│ ng g @ng-cn/core:c card │');
|
|
800
773
|
context.logger.info('│ │');
|
|
801
774
|
context.logger.info('│ 2. Or install individual packages: │');
|
|
802
|
-
context.logger.info('│ npm i @ng-cn/
|
|
775
|
+
context.logger.info('│ npm i @ng-cn/core @ng-cn/core │');
|
|
803
776
|
context.logger.info('│ │');
|
|
804
777
|
context.logger.info('│ 3. Import and use: │');
|
|
805
|
-
context.logger.info("│ import { Button } from '@ng-cn/
|
|
778
|
+
context.logger.info("│ import { Button } from '@ng-cn/core'; │");
|
|
806
779
|
context.logger.info('│ │');
|
|
807
780
|
context.logger.info('│ 📚 Docs: https://shadcn-angular.tigayon.com │');
|
|
808
781
|
context.logger.info('╰──────────────────────────────────────────────────╯');
|
|
@@ -779,43 +779,16 @@ export function ngAdd(options: NgAddOptions): Rule {
|
|
|
779
779
|
context.logger.info('📦 Selected Components');
|
|
780
780
|
}
|
|
781
781
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
782
|
+
// For now, just log the components that would be copied
|
|
783
|
+
// Components will be available via 'ng g @ng-cn/core:component <name>'
|
|
785
784
|
for (const component of componentsToInstall) {
|
|
786
|
-
|
|
787
|
-
const componentFolder = component.replace(/-/g, '-');
|
|
788
|
-
const sourceComponentPath = join(normalize(sourceComponentsBase), normalize(componentFolder)) as Path;
|
|
789
|
-
const targetComponentPath = join(normalize(uiPath), normalize(componentFolder)) as Path;
|
|
790
|
-
|
|
791
|
-
try {
|
|
792
|
-
// Try to copy the entire component folder
|
|
793
|
-
const sourceFiles = tree.getDir(sourceComponentPath);
|
|
794
|
-
if (sourceFiles && sourceFiles.subfiles.length > 0) {
|
|
795
|
-
for (const file of sourceFiles.subfiles) {
|
|
796
|
-
const sourceFile = sourceComponentPath + '/' + file;
|
|
797
|
-
const targetFile = targetComponentPath + '/' + file;
|
|
798
|
-
const content = tree.read(sourceFile as Path);
|
|
799
|
-
if (content) {
|
|
800
|
-
if (tree.exists(targetFile as Path)) {
|
|
801
|
-
tree.overwrite(targetFile as Path, content);
|
|
802
|
-
} else {
|
|
803
|
-
tree.create(targetFile as Path, content);
|
|
804
|
-
}
|
|
805
|
-
componentsCopied++;
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
context.logger.info(` + ${component}`);
|
|
809
|
-
}
|
|
810
|
-
} catch (e) {
|
|
811
|
-
// Component folder doesn't exist yet or not available, skip
|
|
812
|
-
context.logger.debug(` ⊘ ${component} not available in core package`);
|
|
813
|
-
}
|
|
785
|
+
context.logger.info(` + ${component} (available via: ng g @ng-cn/core:component ${component})`);
|
|
814
786
|
}
|
|
815
787
|
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
788
|
+
context.logger.info('');
|
|
789
|
+
context.logger.info('💡 To copy individual components, use:');
|
|
790
|
+
context.logger.info(` ng g @ng-cn/core:component button`);
|
|
791
|
+
context.logger.info(` ng g @ng-cn/core:component card`);
|
|
819
792
|
}
|
|
820
793
|
|
|
821
794
|
// Success message with ASCII art banner
|
|
@@ -870,10 +843,10 @@ export function ngAdd(options: NgAddOptions): Rule {
|
|
|
870
843
|
context.logger.info('│ ng g @ng-cn/core:c card │');
|
|
871
844
|
context.logger.info('│ │');
|
|
872
845
|
context.logger.info('│ 2. Or install individual packages: │');
|
|
873
|
-
context.logger.info('│ npm i @ng-cn/
|
|
846
|
+
context.logger.info('│ npm i @ng-cn/core @ng-cn/core │');
|
|
874
847
|
context.logger.info('│ │');
|
|
875
848
|
context.logger.info('│ 3. Import and use: │');
|
|
876
|
-
context.logger.info("│ import { Button } from '@ng-cn/
|
|
849
|
+
context.logger.info("│ import { Button } from '@ng-cn/core'; │");
|
|
877
850
|
context.logger.info('│ │');
|
|
878
851
|
context.logger.info('│ 📚 Docs: https://shadcn-angular.tigayon.com │');
|
|
879
852
|
context.logger.info('╰──────────────────────────────────────────────────╯');
|