@catalystsoftware/ui 1.0.16 → 1.0.17

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 (3) hide show
  1. package/README.md +11 -1
  2. package/dist/index.js +45 -3
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  A comprehensive React component library with 100+ production-ready components for building modern web applications.
4
4
 
5
+ ## UPDATE
6
+
7
+ Adding a new line option 'Configure Import Call'. Configures your package.json and tsconfig.json files to allow the use of '#icons' and '#catalyst' in-place of the traditional '~/components/catalyst-ui' and '@catalystsoftware/icons'
8
+
9
+ ```javascript
10
+ import { Command, CommandGroup, CommandItem, CommandList, cn } from '#catalyst'
11
+ import { X } from '#icons'
12
+ ```
13
+ Selecting the full installation will also configure your project for this use as well.
14
+
5
15
  ## Installation
6
16
 
7
17
  ### Quick Start
@@ -101,7 +111,7 @@ Catalyst UI automatically detects and uses your package manager:
101
111
 
102
112
  ### Config File (Optional)
103
113
 
104
- Create a `catalyst.config.jsonc` file in your project root to customize installation behavior:
114
+ Create a `config.catalyst` file in your project root to customize installation behavior:
105
115
 
106
116
  ```bash
107
117
  bunx @catalystsoftware/ui
package/dist/index.js CHANGED
@@ -200595,7 +200595,7 @@ var DEFAULT_CONFIG = {
200595
200595
  components: "app/"
200596
200596
  };
200597
200597
  async function loadConfig() {
200598
- const configPath = path2.join(process.cwd(), "catalyst.config.jsonc");
200598
+ const configPath = path2.join(process.cwd(), "config.catalyst");
200599
200599
  try {
200600
200600
  await fs.access(configPath);
200601
200601
  const content = await fs.readFile(configPath, "utf-8");
@@ -200607,7 +200607,7 @@ async function loadConfig() {
200607
200607
  }
200608
200608
  }
200609
200609
  async function createConfig() {
200610
- const configPath = path2.join(process.cwd(), "catalyst.config.jsonc");
200610
+ const configPath = path2.join(process.cwd(), "config.catalyst");
200611
200611
  const configContent = `
200612
200612
  {
200613
200613
  "theme": "blue",
@@ -200623,7 +200623,7 @@ async function createConfig() {
200623
200623
  "components": "app/"
200624
200624
  }`;
200625
200625
  await fs.writeFile(configPath, configContent, "utf-8");
200626
- console.log(source_default.green("\u2713 Created catalyst.config.jsonc"));
200626
+ console.log(source_default.green("\u2713 Created config.catalyst"));
200627
200627
  }
200628
200628
  var API_URL = "https://catalyst-software.vercel.app/Catalyst/UI/code/verify/premium";
200629
200629
  var API_TIMEOUT = 5000;
@@ -200695,6 +200695,7 @@ async function showPremiumMenu() {
200695
200695
  { name: `${source_default.bold("Configure Only")} ${source_default.gray("\u2192 Tailwind + PostCSS setup")}`, value: "configure-tailwind-postcss" },
200696
200696
  { name: `${source_default.bold("Configure with Ngin")} ${source_default.gray("\u2192 Tailwind + PostCSS + Ngin preset")}`, value: "configure-ngin" },
200697
200697
  { name: `${source_default.bold("Create Config")} ${source_default.gray("\u2192 Configure installation options with pre-configured config file")}`, value: "create-config" },
200698
+ { name: `${source_default.bold("Configure Import Call")} ${source_default.gray("\u2192 Allows the use of #catalyst & #icons")}`, value: "import-call" },
200698
200699
  { name: `${source_default.red("\u2717 Exit")}`, value: "exit" }
200699
200700
  ];
200700
200701
  const notToggled = "\u25C7";
@@ -200725,6 +200726,7 @@ async function showFreeMenu() {
200725
200726
  { name: `${source_default.bold("Configure Only")} ${source_default.gray("\u2192 Tailwind + PostCSS setup")}`, value: "configure-tailwind-postcss" },
200726
200727
  { name: `${source_default.bold("Configure with Ngin")} ${source_default.gray("\u2192 Tailwind + PostCSS + Ngin preset")}`, value: "configure-ngin" },
200727
200728
  { name: `${source_default.bold("Create Config")} ${source_default.gray("\u2192 Configure installation options with pre-configured config file")}`, value: "create-config" },
200729
+ { name: `${source_default.bold("Configure Import Call")} ${source_default.gray("\u2192 Allows the use of #catalyst & #icons")}`, value: "import-call" },
200728
200730
  { name: `${source_default.red("\u2717 Exit")}`, value: "exit" }
200729
200731
  ];
200730
200732
  const notToggled = "\u25C7";
@@ -200801,6 +200803,7 @@ async function installAllComponents(includePremium, config) {
200801
200803
  }
200802
200804
  spinner.succeed(source_default.green(`Installed ${installed} components`));
200803
200805
  await createIndexFiles();
200806
+ await configureProjectPaths();
200804
200807
  }
200805
200808
  async function createIndexFiles() {
200806
200809
  const spinner = ora2({ frames: ["\u28F7", "\u28EF", "\u28DF", "\u287F", "\u28BF", "\u28FB", "\u28FD", "\u28FE"], suffixText: "Creating index files..." }).start();
@@ -201029,6 +201032,42 @@ async function selectComponentsInteractive(includePremium) {
201029
201032
  await createIndexFiles();
201030
201033
  spinner.succeed(source_default.green(`Installed ${selectedComponents.length} components`));
201031
201034
  }
201035
+ async function configureProjectPaths() {
201036
+ const spinner = ora2("Configuring project paths...").start();
201037
+ const pathsToAdd = {
201038
+ "#catalyst/*": "./app/components/catalyst-ui/*",
201039
+ "#icons": "@catalystsoftware/icons",
201040
+ "#utils/*": "./app/components/catalyst-ui/utils/*",
201041
+ "#prisma": "./app/components/catalyst-ui/utils/prisma.ts",
201042
+ "#auth": "./app/components/catalyst-ui/utils/auth.ts",
201043
+ "#auth_session": "./app/components/catalyst-ui/utils/auth_session.ts",
201044
+ "#access": "./app/components/catalyst-ui/utils/user-based-access-rules.tsx",
201045
+ "#blocks": "./app/components/catalyst-ui/blocks/index.ts",
201046
+ "#hooks": "./app/components/catalyst-ui/hooks/index.ts"
201047
+ };
201048
+ try {
201049
+ const pkgPath = path2.join(process.cwd(), "package.json");
201050
+ const pkg = JSON.parse(await fs.readFile(pkgPath, "utf-8"));
201051
+ pkg.imports = { ...pkg.imports, ...pathsToAdd };
201052
+ await fs.writeFile(pkgPath, JSON.stringify(pkg, null, 2));
201053
+ const tsPath = path2.join(process.cwd(), "tsconfig.json");
201054
+ const tsConfigText = await fs.readFile(tsPath, "utf-8");
201055
+ const tsConfig = JSON.parse(tsConfigText);
201056
+ if (!tsConfig.compilerOptions)
201057
+ tsConfig.compilerOptions = {};
201058
+ if (!tsConfig.compilerOptions.paths)
201059
+ tsConfig.compilerOptions.paths = {};
201060
+ Object.entries(pathsToAdd).forEach(([key, val]) => {
201061
+ const tsVal = key === "#icons" ? ["node_modules/@catalystsoftware/icons"] : [val];
201062
+ tsConfig.compilerOptions.paths[key] = tsVal;
201063
+ });
201064
+ await fs.writeFile(tsPath, JSON.stringify(tsConfig, null, 2));
201065
+ spinner.succeed(source_default.green("Project paths configured successfully"));
201066
+ } catch (error) {
201067
+ spinner.fail(source_default.red("Failed to configure project paths"));
201068
+ console.error(error);
201069
+ }
201070
+ }
201032
201071
  async function handleAction(action, isPremium) {
201033
201072
  let spinner;
201034
201073
  try {
@@ -201084,6 +201123,9 @@ async function handleAction(action, isPremium) {
201084
201123
  case "select-all-components":
201085
201124
  await selectComponentsInteractive(true);
201086
201125
  break;
201126
+ case "import-call":
201127
+ await configureProjectPaths();
201128
+ break;
201087
201129
  case "exit":
201088
201130
  console.log(source_default.cyan(`
201089
201131
  Goodbye!`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@catalystsoftware/ui",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "Catalyst UI Component Library CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -39,6 +39,7 @@
39
39
  "ora": "^7.0.1"
40
40
  },
41
41
  "devDependencies": {
42
+ "@types/bun": "^1.3.6",
42
43
  "@types/inquirer": "^9.0.7",
43
44
  "@types/node": "^20.10.5",
44
45
  "esbuild": "^0.19.10",