@glass-ui-kit/cli 0.2.1 → 0.2.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.
Files changed (3) hide show
  1. package/dist/index.js +24 -9
  2. package/package.json +59 -58
  3. package/LICENSE +0 -21
package/dist/index.js CHANGED
@@ -272,11 +272,15 @@ var init = new Command().name("init").description("Initialize configuration and
272
272
  const pm = await getPackageManager();
273
273
  const cwd = process.cwd();
274
274
  const configPath = "glass.config.json";
275
+ const hasSrc = exists("src");
275
276
  let cssPath = getCssPath(framework);
276
- if (!cssPath) {
277
- cssPath = "src/index.css";
277
+ if (!cssPath || framework === "next") {
278
+ cssPath = hasSrc ? "src/app/globals.css" : "app/globals.css";
278
279
  }
279
- const utilsPath = path2.join(cwd, "src/lib/utils.ts");
280
+ const utilsPath = path2.join(
281
+ cwd,
282
+ hasSrc ? "src/lib/utils.ts" : "lib/utils.ts"
283
+ );
280
284
  if (!exists(configPath)) {
281
285
  await writeFile(
282
286
  configPath,
@@ -285,7 +289,10 @@ var init = new Command().name("init").description("Initialize configuration and
285
289
  framework,
286
290
  style: "default",
287
291
  css: cssPath,
288
- aliases: { components: "@/components/ui", utils: "@/lib/utils" }
292
+ aliases: {
293
+ components: "@/components/ui",
294
+ utils: "@/lib/utils"
295
+ }
289
296
  },
290
297
  null,
291
298
  2
@@ -297,9 +304,11 @@ var init = new Command().name("init").description("Initialize configuration and
297
304
  }
298
305
  if (!exists(utilsPath)) {
299
306
  await writeFile(utilsPath, UTILS_CN);
300
- console.log(chalk.green(" Created src/lib/utils.ts"));
307
+ const displayPath = hasSrc ? "src/lib/utils.ts" : "lib/utils.ts";
308
+ console.log(chalk.green(` Created ${displayPath}`));
301
309
  } else {
302
- console.log(chalk.gray(" src/lib/utils.ts already exists."));
310
+ const displayPath = hasSrc ? "src/lib/utils.ts" : "lib/utils.ts";
311
+ console.log(chalk.gray(` ${displayPath} already exists.`));
303
312
  }
304
313
  let cssContent = "";
305
314
  try {
@@ -311,11 +320,15 @@ var init = new Command().name("init").description("Initialize configuration and
311
320
  } catch (e) {
312
321
  }
313
322
  if (!cssContent.includes("--glass-bg")) {
314
- const newCssContent = `${cssContent.trimEnd()}
323
+ const newCssContent = `@import "tailwindcss";
315
324
 
316
325
  ${GLASS_BASE_STYLES}`;
317
326
  await writeFile(cssPath, newCssContent);
318
- console.log(chalk.green(` Updated ${cssPath} with glass tokens`));
327
+ console.log(
328
+ chalk.green(
329
+ ` Overwrote ${cssPath} with Tailwind import and glass tokens`
330
+ )
331
+ );
319
332
  } else {
320
333
  console.log(chalk.gray(` Tokens already present in ${cssPath}`));
321
334
  }
@@ -489,8 +502,10 @@ var add = new Command2().name("add").description("Add a component to your projec
489
502
  console.error(chalk2.red(`Component '${componentName}' not found.`));
490
503
  process.exit(1);
491
504
  }
505
+ const hasSrc = exists("src");
492
506
  const targetDirAlias = config.aliases.components || "@/components/ui";
493
- const targetDir = targetDirAlias.replace(/^@\//, "./src/");
507
+ const relativeAliasPath = targetDirAlias.replace(/^@\//, "");
508
+ const targetDir = hasSrc ? `./src/${relativeAliasPath}` : `./${relativeAliasPath}`;
494
509
  for (const file of item.files) {
495
510
  const fileName = path4.basename(file.path);
496
511
  const filePath = path4.join(targetDir, fileName);
package/package.json CHANGED
@@ -1,58 +1,59 @@
1
- {
2
- "name": "@glass-ui-kit/cli",
3
- "version": "0.2.1",
4
- "description": "The official CLI for Glass UI. Add glassmorphism components to your React projects in seconds.",
5
- "keywords": [
6
- "glassmorphism",
7
- "design-system",
8
- "react",
9
- "cli",
10
- "ui",
11
- "tailwind"
12
- ],
13
- "homepage": "https://github.com/jntellez/glass-ui#readme",
14
- "bugs": {
15
- "url": "https://github.com/jntellez/glass-ui/issues"
16
- },
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/jntellez/glass-ui.git",
20
- "directory": "packages/cli"
21
- },
22
- "license": "MIT",
23
- "author": "Glass UI Team",
24
- "type": "module",
25
- "bin": {
26
- "glass-ui": "./dist/index.js"
27
- },
28
- "files": [
29
- "dist",
30
- "README.md"
31
- ],
32
- "engines": {
33
- "node": ">=18.0.0"
34
- },
35
- "dependencies": {
36
- "chalk": "^5.3.0",
37
- "commander": "^11.1.0",
38
- "node-fetch": "^3.3.2",
39
- "zod": "^3.22.4"
40
- },
41
- "devDependencies": {
42
- "@types/node": "^20.11.0",
43
- "bun-types": "latest",
44
- "tsup": "^8.0.1",
45
- "typescript": "^5.3.3",
46
- "@glass-ui-kit/tsconfig": "0.0.1",
47
- "@glass-ui-kit/schema": "0.0.1"
48
- },
49
- "publishConfig": {
50
- "access": "public"
51
- },
52
- "scripts": {
53
- "sync": "node scripts/sync-styles.mjs",
54
- "build": "pnpm run sync && tsup src/index.ts --format esm --clean",
55
- "dev": "pnpm run sync && bun run ./src/index.ts",
56
- "lint": "eslint src"
57
- }
58
- }
1
+ {
2
+ "name": "@glass-ui-kit/cli",
3
+ "version": "0.2.2",
4
+ "description": "The official CLI for Glass UI. Add glassmorphism components to your React projects in seconds.",
5
+ "keywords": [
6
+ "glassmorphism",
7
+ "design-system",
8
+ "react",
9
+ "cli",
10
+ "ui",
11
+ "tailwind"
12
+ ],
13
+ "homepage": "https://github.com/jntellez/glass-ui#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/jntellez/glass-ui/issues"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/jntellez/glass-ui.git",
20
+ "directory": "packages/cli"
21
+ },
22
+ "license": "MIT",
23
+ "author": "Glass UI Team",
24
+ "type": "module",
25
+ "bin": {
26
+ "glass-ui": "./dist/index.js"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "README.md"
31
+ ],
32
+ "engines": {
33
+ "node": ">=18.0.0"
34
+ },
35
+ "scripts": {
36
+ "sync": "node scripts/sync-styles.mjs",
37
+ "build": "pnpm run sync && tsup src/index.ts --format esm --clean",
38
+ "dev": "pnpm run sync && bun run ./src/index.ts",
39
+ "lint": "eslint src",
40
+ "prepublishOnly": "pnpm run build"
41
+ },
42
+ "dependencies": {
43
+ "chalk": "^5.3.0",
44
+ "commander": "^11.1.0",
45
+ "node-fetch": "^3.3.2",
46
+ "zod": "^3.22.4"
47
+ },
48
+ "devDependencies": {
49
+ "@glass-ui-kit/tsconfig": "workspace:*",
50
+ "@glass-ui-kit/schema": "workspace:*",
51
+ "@types/node": "^20.11.0",
52
+ "bun-types": "latest",
53
+ "tsup": "^8.0.1",
54
+ "typescript": "^5.3.3"
55
+ },
56
+ "publishConfig": {
57
+ "access": "public"
58
+ }
59
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Juan Tellez
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.