@batijs/cli 0.0.262 → 0.0.263

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.
@@ -0,0 +1,68 @@
1
+ import type { Config } from "tailwindcss";
2
+ import tailwindAnimate from "tailwindcss-animate";
3
+
4
+ export default {
5
+ darkMode: ["class"],
6
+ content: ["./{pages,layouts,components,src}/**/*.{html,js,jsx,ts,tsx,vue}"],
7
+ theme: {
8
+ extend: {
9
+ keyframes: {
10
+ "caret-blink": {
11
+ "0%,70%,100%": { opacity: "1" },
12
+ "20%,50%": { opacity: "0" },
13
+ },
14
+ },
15
+ animation: {
16
+ "caret-blink": "caret-blink 1.25s ease-out infinite",
17
+ },
18
+ borderRadius: {
19
+ lg: "var(--radius)",
20
+ md: "calc(var(--radius) - 2px)",
21
+ sm: "calc(var(--radius) - 4px)",
22
+ },
23
+ colors: {
24
+ background: "hsl(var(--background))",
25
+ foreground: "hsl(var(--foreground))",
26
+ card: {
27
+ DEFAULT: "hsl(var(--card))",
28
+ foreground: "hsl(var(--card-foreground))",
29
+ },
30
+ popover: {
31
+ DEFAULT: "hsl(var(--popover))",
32
+ foreground: "hsl(var(--popover-foreground))",
33
+ },
34
+ primary: {
35
+ DEFAULT: "hsl(var(--primary))",
36
+ foreground: "hsl(var(--primary-foreground))",
37
+ },
38
+ secondary: {
39
+ DEFAULT: "hsl(var(--secondary))",
40
+ foreground: "hsl(var(--secondary-foreground))",
41
+ },
42
+ muted: {
43
+ DEFAULT: "hsl(var(--muted))",
44
+ foreground: "hsl(var(--muted-foreground))",
45
+ },
46
+ accent: {
47
+ DEFAULT: "hsl(var(--accent))",
48
+ foreground: "hsl(var(--accent-foreground))",
49
+ },
50
+ destructive: {
51
+ DEFAULT: "hsl(var(--destructive))",
52
+ foreground: "hsl(var(--destructive-foreground))",
53
+ },
54
+ border: "hsl(var(--border))",
55
+ input: "hsl(var(--input))",
56
+ ring: "hsl(var(--ring))",
57
+ chart: {
58
+ "1": "hsl(var(--chart-1))",
59
+ "2": "hsl(var(--chart-2))",
60
+ "3": "hsl(var(--chart-3))",
61
+ "4": "hsl(var(--chart-4))",
62
+ "5": "hsl(var(--chart-5))",
63
+ },
64
+ },
65
+ },
66
+ },
67
+ plugins: [tailwindAnimate],
68
+ } satisfies Config;
@@ -0,0 +1,36 @@
1
+ // files/$README.md.ts
2
+ import { loadReadme } from "@batijs/core";
3
+ async function getReadme(props) {
4
+ const content = await loadReadme(props);
5
+ const about = `
6
+
7
+ ## shadcn/ui
8
+
9
+ Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
10
+
11
+ ### Configuration
12
+
13
+ see [shadcn/ui theming](https://ui.shadcn.com/docs/theming)
14
+
15
+ Base Configuration can be found in \`components.json\` file.
16
+
17
+ > [!NOTE]
18
+ > changes to the \`components.json\` file **will not** be reflected in existing components. Only new components will be affected.
19
+
20
+ ### Add Components to Your Project
21
+
22
+ **Example:** add a component to your project.
23
+ \`pnpm shadcn add button\`
24
+
25
+ use the \`<Button />\` component in your project:
26
+ \`import { Button } from "@/components/ui/button";\`
27
+
28
+ more [shadcn/ui components](https://ui.shadcn.com/docs/components/accordion)
29
+
30
+ `;
31
+ content.addAbout(about);
32
+ return content.finalize();
33
+ }
34
+ export {
35
+ getReadme as default
36
+ };
@@ -0,0 +1,112 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ // package.json
28
+ var require_package = __commonJS({
29
+ "package.json"(exports, module) {
30
+ module.exports = {
31
+ name: "@batijs/shadcn-ui",
32
+ private: true,
33
+ version: "0.0.1",
34
+ description: "",
35
+ type: "module",
36
+ scripts: {
37
+ "check-types": "tsc --noEmit",
38
+ build: "bati-compile-boilerplate"
39
+ },
40
+ keywords: [],
41
+ author: "",
42
+ license: "MIT",
43
+ devDependencies: {
44
+ "@batijs/compile": "workspace:*",
45
+ "@radix-ui/react-icons": "^1.3.0",
46
+ "@types/node": "^18.19.14",
47
+ "class-variance-authority": "^0.7.0",
48
+ clsx: "^2.1.1",
49
+ "lucide-react": "^0.438.0",
50
+ "tailwind-merge": "^2.5.2",
51
+ tailwindcss: "^3.4.10",
52
+ "tailwindcss-animate": "^1.0.7"
53
+ },
54
+ dependencies: {
55
+ "@batijs/core": "workspace:*"
56
+ },
57
+ files: [
58
+ "dist/"
59
+ ],
60
+ bati: {
61
+ if: {
62
+ flag: "shadcn-ui"
63
+ }
64
+ },
65
+ exports: {
66
+ "./!tailwind.config": {
67
+ types: "./dist/types/!tailwind.config.d.ts"
68
+ },
69
+ "./lib/utils": {
70
+ types: "./dist/types/lib/utils.d.ts"
71
+ }
72
+ },
73
+ typesVersions: {
74
+ "*": {
75
+ "!tailwind.config": [
76
+ "./dist/types/!tailwind.config.d.ts"
77
+ ],
78
+ "lib/utils": [
79
+ "./dist/types/lib/utils.d.ts"
80
+ ]
81
+ }
82
+ }
83
+ };
84
+ }
85
+ });
86
+
87
+ // files/$package.json.ts
88
+ import { addDependency, loadAsJson, setScripts } from "@batijs/core";
89
+ async function getPackageJson(props) {
90
+ const packageJson = await loadAsJson(props);
91
+ setScripts(packageJson, {
92
+ // @ts-ignore
93
+ shadcn: {
94
+ value: "pnpm dlx shadcn@latest",
95
+ precedence: 20,
96
+ warnIfReplaced: true
97
+ }
98
+ });
99
+ return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
100
+ dependencies: [
101
+ "tailwindcss-animate",
102
+ "class-variance-authority",
103
+ "clsx",
104
+ "tailwind-merge",
105
+ "lucide-react",
106
+ "@radix-ui/react-icons"
107
+ ]
108
+ });
109
+ }
110
+ export {
111
+ getPackageJson as default
112
+ };
@@ -0,0 +1,13 @@
1
+ // files/$tsconfig.json.ts
2
+ import { loadAsJson } from "@batijs/core";
3
+ async function getTsConfig(props) {
4
+ const tsConfig = await loadAsJson(props);
5
+ tsConfig.compilerOptions.paths = {
6
+ ...tsConfig.compilerOptions?.paths ?? {},
7
+ "@/*": ["./*"]
8
+ };
9
+ return tsConfig;
10
+ }
11
+ export {
12
+ getTsConfig as default
13
+ };
@@ -0,0 +1,34 @@
1
+ // files/$vite.config.ts.ts
2
+ import { loadAsMagicast, yellow } from "@batijs/core";
3
+ async function getViteConfig(props) {
4
+ const mod = await loadAsMagicast(props);
5
+ const replacement = `new URL("./", import.meta.url).pathname`;
6
+ addResolveAlias(mod, "@", replacement);
7
+ return mod.generate().code.replace(`"{{PLACEHOLDER_ALIAS}}"`, replacement);
8
+ }
9
+ function addResolveAlias(mod, find, replacement) {
10
+ const alias = mod.exports.default.$args[0]?.resolve?.alias ?? {};
11
+ const warnMsg = `${yellow("WARN")}: new resolve.alias: \`"${find}":${replacement}\` replaced existing in vite.config.ts.`;
12
+ if (alias?.length === void 0) {
13
+ if (alias[find]) {
14
+ console.warn(warnMsg);
15
+ }
16
+ alias[find] = "{{PLACEHOLDER_ALIAS}}";
17
+ } else {
18
+ const newAlias = {
19
+ find,
20
+ replacement: "{{PLACEHOLDER_ALIAS}}"
21
+ };
22
+ const index = alias.findIndex((a) => a?.find === find);
23
+ if (index >= 0) {
24
+ console.warn(warnMsg);
25
+ alias.splice(index, 1);
26
+ }
27
+ alias.push(newAlias);
28
+ }
29
+ if (!mod.exports.default.$args[0]?.resolve) mod.exports.default.$args[0].resolve = {};
30
+ mod.exports.default.$args[0].resolve.alias = alias;
31
+ }
32
+ export {
33
+ getViteConfig as default
34
+ };
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "default",
4
+ "tailwind": {
5
+ "config": "tailwind.config.ts",
6
+ "css": "layouts/tailwind.css",
7
+ "baseColor": "gray",
8
+ "cssVariables": true
9
+
10
+ },
11
+ "rsc": true,
12
+ "tsx": true,
13
+ "aliases": {
14
+ "utils": "@/lib/utils",
15
+ "components": "@/components"
16
+ }
17
+ }
@@ -0,0 +1,101 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @layer base {
6
+ :root {
7
+ --background: 0 0% 100%;
8
+ --foreground: 0 0% 3.9%;
9
+
10
+ --muted: 0 0% 96.1%;
11
+ --muted-foreground: 0 0% 45.1%;
12
+
13
+ --popover: 0 0% 100%;
14
+ --popover-foreground: 0 0% 3.9%;
15
+
16
+ --border: 0 0% 89.8%;
17
+ --input: 0 0% 89.8%;
18
+
19
+ --card: 0 0% 100%;
20
+ --card-foreground: 0 0% 3.9%;
21
+
22
+ --primary: 0 0% 9%;
23
+ --primary-foreground: 0 0% 98%;
24
+
25
+ --secondary: 0 0% 96.1%;
26
+ --secondary-foreground: 0 0% 9%;
27
+
28
+ --accent: 0 0% 96.1%;
29
+ --accent-foreground: 0 0% 9%;
30
+
31
+ --destructive: 0 84.2% 60.2%;
32
+ --destructive-foreground: 0 0% 98%;
33
+
34
+ --ring: 0 0% 3.9%;
35
+
36
+ --radius: 0.5rem;
37
+
38
+ --chart-1: 12 76% 61%;
39
+
40
+ --chart-2: 173 58% 39%;
41
+
42
+ --chart-3: 197 37% 24%;
43
+
44
+ --chart-4: 43 74% 66%;
45
+
46
+ --chart-5: 27 87% 67%;
47
+ }
48
+
49
+ .dark {
50
+ --background: 0 0% 3.9%;
51
+ --foreground: 0 0% 98%;
52
+
53
+ --muted: 0 0% 14.9%;
54
+ --muted-foreground: 0 0% 63.9%;
55
+
56
+ --accent: 0 0% 14.9%;
57
+ --accent-foreground: 0 0% 98%;
58
+
59
+ --popover: 0 0% 3.9%;
60
+ --popover-foreground: 0 0% 98%;
61
+
62
+ --border: 0 0% 14.9%;
63
+ --input: 0 0% 14.9%;
64
+
65
+ --card: 0 0% 3.9%;
66
+ --card-foreground: 0 0% 98%;
67
+
68
+ --primary: 0 0% 98%;
69
+ --primary-foreground: 0 0% 9%;
70
+
71
+ --secondary: 0 0% 14.9%;
72
+ --secondary-foreground: 0 0% 98%;
73
+
74
+ --destructive: 0 62.8% 30.6%;
75
+ --destructive-foreground: 0 0% 98%;
76
+
77
+ --ring: 0 0% 83.1%;
78
+
79
+ --radius: 0.5rem;
80
+
81
+ --chart-1: 220 70% 50%;
82
+
83
+ --chart-2: 160 60% 45%;
84
+
85
+ --chart-3: 30 80% 55%;
86
+
87
+ --chart-4: 280 65% 60%;
88
+
89
+ --chart-5: 340 75% 55%;
90
+ }
91
+ }
92
+
93
+ @layer base {
94
+ * {
95
+ @apply border-border;
96
+ }
97
+ body {
98
+ @apply bg-background text-foreground;
99
+ font-feature-settings: "rlig" 1, "calt" 1;
100
+ }
101
+ }
@@ -0,0 +1,6 @@
1
+ import { clsx, type ClassValue } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs));
6
+ }
@@ -0,0 +1,72 @@
1
+ declare const _default: {
2
+ darkMode: ["class"];
3
+ content: string[];
4
+ theme: {
5
+ extend: {
6
+ keyframes: {
7
+ "caret-blink": {
8
+ "0%,70%,100%": {
9
+ opacity: string;
10
+ };
11
+ "20%,50%": {
12
+ opacity: string;
13
+ };
14
+ };
15
+ };
16
+ animation: {
17
+ "caret-blink": string;
18
+ };
19
+ borderRadius: {
20
+ lg: string;
21
+ md: string;
22
+ sm: string;
23
+ };
24
+ colors: {
25
+ background: string;
26
+ foreground: string;
27
+ card: {
28
+ DEFAULT: string;
29
+ foreground: string;
30
+ };
31
+ popover: {
32
+ DEFAULT: string;
33
+ foreground: string;
34
+ };
35
+ primary: {
36
+ DEFAULT: string;
37
+ foreground: string;
38
+ };
39
+ secondary: {
40
+ DEFAULT: string;
41
+ foreground: string;
42
+ };
43
+ muted: {
44
+ DEFAULT: string;
45
+ foreground: string;
46
+ };
47
+ accent: {
48
+ DEFAULT: string;
49
+ foreground: string;
50
+ };
51
+ destructive: {
52
+ DEFAULT: string;
53
+ foreground: string;
54
+ };
55
+ border: string;
56
+ input: string;
57
+ ring: string;
58
+ chart: {
59
+ "1": string;
60
+ "2": string;
61
+ "3": string;
62
+ "4": string;
63
+ "5": string;
64
+ };
65
+ };
66
+ };
67
+ };
68
+ plugins: {
69
+ handler: () => void;
70
+ }[];
71
+ };
72
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -364,6 +364,17 @@
364
364
  "files"
365
365
  ]
366
366
  },
367
+ {
368
+ "config": {
369
+ "if": {
370
+ "flag": "shadcn-ui"
371
+ }
372
+ },
373
+ "folder": "@batijs/shadcn-ui",
374
+ "subfolders": [
375
+ "files"
376
+ ]
377
+ },
367
378
  {
368
379
  "config": {
369
380
  "enforce": "pre"
package/dist/index.js CHANGED
@@ -1677,7 +1677,7 @@ var createDefaultQueryTester = function(query, options) {
1677
1677
  // package.json
1678
1678
  var package_default = {
1679
1679
  name: "@batijs/cli",
1680
- version: "0.0.262",
1680
+ version: "0.0.263",
1681
1681
  type: "module",
1682
1682
  scripts: {
1683
1683
  "check-types": "tsc --noEmit",
@@ -1728,6 +1728,12 @@ function error(value) {
1728
1728
  value
1729
1729
  };
1730
1730
  }
1731
+ function warning(value) {
1732
+ return {
1733
+ type: "warning",
1734
+ value
1735
+ };
1736
+ }
1731
1737
  function info(value) {
1732
1738
  return {
1733
1739
  type: "info",
@@ -1764,6 +1770,12 @@ Choose one of them, or simply remove selected Server`
1764
1770
  `${inverse(bold("AWS"))} is only compatible with ${inverse(bold("Hono"))} or ${inverse(bold("HatTip"))}.
1765
1771
  Choose one of them, or simply remove selected Server`
1766
1772
  ),
1773
+ [RulesMessage.ERROR_SHADCN_R_REACT]: error(
1774
+ `${inverse(bold("shadcn/ui"))} is only compatible with ${inverse(bold("React"))}`
1775
+ ),
1776
+ [RulesMessage.WARN_SHADCN_R_TAILWINDCSS]: warning(
1777
+ `${inverse(bold("shadcn/ui"))} integration is tied to ${inverse(bold("TailwindCSS"))}. Using another CSS library with it may have unpredictable behaviour.`
1778
+ ),
1767
1779
  [RulesMessage.INFO_DRIZZLE_STACKBLITZ]: null
1768
1780
  };
1769
1781
 
@@ -2036,14 +2048,18 @@ async function run() {
2036
2048
  await checkArguments(args);
2037
2049
  const sources = [];
2038
2050
  const hooks = [];
2039
- const flags = Object.entries(args).filter(([, val]) => val === true).map(([key]) => {
2040
- const flag = [key];
2041
- const dependsOn = features.find((f) => f.flag === key)?.dependsOn;
2042
- if (dependsOn) {
2043
- flag.push(...dependsOn);
2044
- }
2045
- return flag;
2046
- }).flat(1);
2051
+ const flags = [
2052
+ ...new Set(
2053
+ Object.entries(args).filter(([, val]) => val === true).map(([key]) => {
2054
+ const flag = [key];
2055
+ const dependsOn = features.find((f) => f.flag === key)?.dependsOn;
2056
+ if (dependsOn) {
2057
+ flag.push(...dependsOn);
2058
+ }
2059
+ return flag;
2060
+ }).flat(1)
2061
+ )
2062
+ ];
2047
2063
  checkFlagsExist(flags);
2048
2064
  checkRules(flags);
2049
2065
  boilerplates.sort((b1, b2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batijs/cli",
3
- "version": "0.0.262",
3
+ "version": "0.0.263",
4
4
  "type": "module",
5
5
  "keywords": [],
6
6
  "description": "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
@@ -20,12 +20,12 @@
20
20
  "typescript": "^5.5.4",
21
21
  "unplugin-purge-polyfills": "^0.0.5",
22
22
  "vite": "^5.4.2",
23
- "@batijs/build": "0.0.262",
24
- "@batijs/compile": "0.0.262"
23
+ "@batijs/build": "0.0.263",
24
+ "@batijs/compile": "0.0.263"
25
25
  },
26
26
  "dependencies": {
27
- "@batijs/core": "0.0.262",
28
- "@batijs/features": "0.0.262"
27
+ "@batijs/core": "0.0.263",
28
+ "@batijs/features": "0.0.263"
29
29
  },
30
30
  "bin": "./dist/index.js",
31
31
  "exports": {