solidui-cli 0.1.5 → 0.2.0

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.
Files changed (2) hide show
  1. package/dist/index.js +34 -20
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- #! /usr/bin/env node
1
+ #! /usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
4
  import { Command } from "commander";
@@ -462,11 +462,21 @@ module.exports = {
462
462
  "accordion-up": {
463
463
  from: { height: "var(--kb-accordion-content-height)" },
464
464
  to: { height: 0 }
465
+ },
466
+ "content-show": {
467
+ from: { opacity: 0, transform: "scale(0.96)" },
468
+ to: { opacity: 1, transform: "scale(1)" }
469
+ },
470
+ "content-hide": {
471
+ from: { opacity: 1, transform: "scale(1)" },
472
+ to: { opacity: 0, transform: "scale(0.96)" }
465
473
  }
466
474
  },
467
475
  animation: {
468
476
  "accordion-down": "accordion-down 0.2s ease-out",
469
- "accordion-up": "accordion-up 0.2s ease-out"
477
+ "accordion-up": "accordion-up 0.2s ease-out",
478
+ "content-show": "content-show 0.2s ease-out",
479
+ "content-hide": "content-hide 0.2s ease-out"
470
480
  }
471
481
  }
472
482
  },
@@ -478,7 +488,7 @@ export default {
478
488
  content: [
479
489
  "./src/**/*.{html,js,jsx,md,mdx,ts,tsx}"
480
490
  ],
481
- presets: [require("./suc.preset.js")]
491
+ presets: [require("./ui.preset.js")]
482
492
  }`;
483
493
 
484
494
  // src/lib/transformImports.ts
@@ -646,10 +656,10 @@ async function add(componentNames) {
646
656
  const activityIndicator = spinner2();
647
657
  activityIndicator.start("Creating components...");
648
658
  try {
649
- const readSUCConfig = readFileSync(path.resolve(cwd(), "suc.config.json"));
650
- const sucConfig = parse(configSchema, JSON.parse(readSUCConfig.toString()));
651
- const isTypescriptEnabled = sucConfig.tsx;
652
- const componentFolderDir = path.resolve(cwd(), sucConfig.componentDir);
659
+ const readUIConfig = readFileSync(path.resolve(cwd(), "ui.config.json"));
660
+ const uiConfig = parse(configSchema, JSON.parse(readUIConfig.toString()));
661
+ const isTypescriptEnabled = uiConfig.tsx;
662
+ const componentFolderDir = path.resolve(cwd(), uiConfig.componentDir);
653
663
  const dirExists = existsSync(componentFolderDir);
654
664
  if (!dirExists)
655
665
  mkdirSync(componentFolderDir, { recursive: true });
@@ -669,7 +679,7 @@ async function add(componentNames) {
669
679
  }
670
680
  for (const file of component.files) {
671
681
  log2.step(`Creating ${file.name}`);
672
- const content = transformImports(file.content, sucConfig);
682
+ const content = transformImports(file.content, uiConfig);
673
683
  if (isTypescriptEnabled) {
674
684
  writeFileSync(componentFolderDir + `/${file.name}`, content);
675
685
  } else {
@@ -732,7 +742,7 @@ async function init() {
732
742
  saveConfig(config);
733
743
  writeTsconfig(config.aliases.path);
734
744
  writeUtils();
735
- await writeSUCPreset();
745
+ await writeUIPreset();
736
746
  await writeTailwindConfig(config.tailwind.config);
737
747
  await writeCSS(config.tailwind.css);
738
748
  log3.success("Project configuration completed.");
@@ -784,25 +794,25 @@ async function installDeps() {
784
794
  }
785
795
  function saveConfig(config) {
786
796
  const indicator = spinner3();
787
- indicator.start("Writing suc.config.json...");
788
- writeFile("suc.config.json", JSON.stringify(config, null, 2), (error) => {
797
+ indicator.start("Writing ui.config.json...");
798
+ writeFile("ui.config.json", JSON.stringify(config, null, 2), (error) => {
789
799
  if (error)
790
800
  log3.error("There was an error while saving your preferences");
791
801
  });
792
- indicator.stop("suc.config.json successfully created!");
802
+ indicator.stop("ui.config.json successfully created!");
793
803
  }
794
- async function writeSUCPreset() {
804
+ async function writeUIPreset() {
795
805
  const indicator = spinner3();
796
806
  indicator.start("Writing Solid UI Components tailwind preset...");
797
807
  try {
798
- writeFile("suc.preset.js", TAILWIND_PRESET, (error) => {
808
+ writeFile("ui.preset.js", TAILWIND_PRESET, (error) => {
799
809
  if (error)
800
- log3.error(`There was an error while writing the sui.preset.js: ${error}`);
810
+ log3.error(`There was an error while writing the ui.preset.js: ${error}`);
801
811
  });
802
812
  } catch (error) {
803
813
  log3.error(`Sorry, something went wrong while getting the tailwind presets: ${error}`);
804
814
  }
805
- indicator.stop("suc.preset.js successfully created!");
815
+ indicator.stop("ui.preset.js successfully created!");
806
816
  }
807
817
  async function writeTailwindConfig(tailwindConfigDir) {
808
818
  const indicator = spinner3();
@@ -817,8 +827,12 @@ function writeTsconfig(alias) {
817
827
  const indicator = spinner3();
818
828
  indicator.start("Configuring your tsconfig.json");
819
829
  readJsonFile(process.cwd() + "/tsconfig.json", (error, data) => {
820
- if (error)
821
- log3.error("Something went wrong while configuring your tsconfig.json");
830
+ if (error) {
831
+ log3.error(
832
+ "Something went wrong while configuring your tsconfig.json. Please make sure it is formatted correctly and doesn't contain any comments."
833
+ );
834
+ process.exit(1);
835
+ }
822
836
  const tsconfigData = data;
823
837
  if (!tsconfigData.compilerOptions.paths) {
824
838
  tsconfigData.compilerOptions.paths = {};
@@ -834,7 +848,7 @@ function writeTsconfig(alias) {
834
848
 
835
849
  // src/index.ts
836
850
  var program = new Command();
837
- program.name("suc").description("A CLI used for the Solid UI components library").version("0.1");
838
- program.command("init").description("Initialize and install the necessary things to make use of Solid UI Components").action(async () => await init());
851
+ program.name("solidui-cli").description("A CLI used for the Solid-UI components library").version("0.1");
852
+ program.command("init").description("Initialize and install the necessary things to make use of Solid-UI").action(async () => await init());
839
853
  program.command("add").argument("[components...]", "Components to be added to your project").description("Add a component to your project").action(async (component) => await add(component));
840
854
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solidui-cli",
3
- "version": "0.1.5",
3
+ "version": "0.2.0",
4
4
  "description": "Add Solid UI Components to your application using the Solid-UI CLI tool",
5
5
  "publishConfig": {
6
6
  "access": "public"