tailar 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 (104) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +183 -0
  3. package/README.npm.md +183 -0
  4. package/dist/api/client.d.ts +47 -0
  5. package/dist/api/client.d.ts.map +1 -0
  6. package/dist/api/client.js +329 -0
  7. package/dist/api/client.js.map +1 -0
  8. package/dist/auth/browser.d.ts +11 -0
  9. package/dist/auth/browser.d.ts.map +1 -0
  10. package/dist/auth/browser.js +46 -0
  11. package/dist/auth/browser.js.map +1 -0
  12. package/dist/auth/flow.d.ts +28 -0
  13. package/dist/auth/flow.d.ts.map +1 -0
  14. package/dist/auth/flow.js +171 -0
  15. package/dist/auth/flow.js.map +1 -0
  16. package/dist/auth/storage.d.ts +30 -0
  17. package/dist/auth/storage.d.ts.map +1 -0
  18. package/dist/auth/storage.js +112 -0
  19. package/dist/auth/storage.js.map +1 -0
  20. package/dist/commands/add.d.ts +8 -0
  21. package/dist/commands/add.d.ts.map +1 -0
  22. package/dist/commands/add.js +285 -0
  23. package/dist/commands/add.js.map +1 -0
  24. package/dist/commands/init.d.ts +8 -0
  25. package/dist/commands/init.d.ts.map +1 -0
  26. package/dist/commands/init.js +230 -0
  27. package/dist/commands/init.js.map +1 -0
  28. package/dist/commands/list.d.ts +8 -0
  29. package/dist/commands/list.d.ts.map +1 -0
  30. package/dist/commands/list.js +176 -0
  31. package/dist/commands/list.js.map +1 -0
  32. package/dist/index.d.ts +9 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +83 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/installers/dependencies.d.ts +27 -0
  37. package/dist/installers/dependencies.d.ts.map +1 -0
  38. package/dist/installers/dependencies.js +185 -0
  39. package/dist/installers/dependencies.js.map +1 -0
  40. package/dist/installers/files.d.ts +50 -0
  41. package/dist/installers/files.d.ts.map +1 -0
  42. package/dist/installers/files.js +211 -0
  43. package/dist/installers/files.js.map +1 -0
  44. package/dist/installers/install-feature.d.ts +20 -0
  45. package/dist/installers/install-feature.d.ts.map +1 -0
  46. package/dist/installers/install-feature.js +169 -0
  47. package/dist/installers/install-feature.js.map +1 -0
  48. package/dist/installers/post-install.d.ts +18 -0
  49. package/dist/installers/post-install.d.ts.map +1 -0
  50. package/dist/installers/post-install.js +228 -0
  51. package/dist/installers/post-install.js.map +1 -0
  52. package/dist/installers/templates.d.ts +22 -0
  53. package/dist/installers/templates.d.ts.map +1 -0
  54. package/dist/installers/templates.js +62 -0
  55. package/dist/installers/templates.js.map +1 -0
  56. package/dist/registry/loader.d.ts +21 -0
  57. package/dist/registry/loader.d.ts.map +1 -0
  58. package/dist/registry/loader.js +83 -0
  59. package/dist/registry/loader.js.map +1 -0
  60. package/dist/registry/query.d.ts +55 -0
  61. package/dist/registry/query.d.ts.map +1 -0
  62. package/dist/registry/query.js +123 -0
  63. package/dist/registry/query.js.map +1 -0
  64. package/dist/types/config.d.ts +85 -0
  65. package/dist/types/config.d.ts.map +1 -0
  66. package/dist/types/config.js +7 -0
  67. package/dist/types/config.js.map +1 -0
  68. package/dist/types/index.d.ts +9 -0
  69. package/dist/types/index.d.ts.map +1 -0
  70. package/dist/types/index.js +9 -0
  71. package/dist/types/index.js.map +1 -0
  72. package/dist/types/registry.d.ts +180 -0
  73. package/dist/types/registry.d.ts.map +1 -0
  74. package/dist/types/registry.js +8 -0
  75. package/dist/types/registry.js.map +1 -0
  76. package/dist/types/wizard.d.ts +43 -0
  77. package/dist/types/wizard.d.ts.map +1 -0
  78. package/dist/types/wizard.js +59 -0
  79. package/dist/types/wizard.js.map +1 -0
  80. package/dist/utils/clack-wizard.d.ts +9 -0
  81. package/dist/utils/clack-wizard.d.ts.map +1 -0
  82. package/dist/utils/clack-wizard.js +328 -0
  83. package/dist/utils/clack-wizard.js.map +1 -0
  84. package/dist/utils/config.d.ts +49 -0
  85. package/dist/utils/config.d.ts.map +1 -0
  86. package/dist/utils/config.js +121 -0
  87. package/dist/utils/config.js.map +1 -0
  88. package/dist/utils/logger.d.ts +56 -0
  89. package/dist/utils/logger.d.ts.map +1 -0
  90. package/dist/utils/logger.js +93 -0
  91. package/dist/utils/logger.js.map +1 -0
  92. package/dist/utils/package-manager.d.ts +41 -0
  93. package/dist/utils/package-manager.d.ts.map +1 -0
  94. package/dist/utils/package-manager.js +118 -0
  95. package/dist/utils/package-manager.js.map +1 -0
  96. package/dist/utils/prompts.d.ts +22 -0
  97. package/dist/utils/prompts.d.ts.map +1 -0
  98. package/dist/utils/prompts.js +142 -0
  99. package/dist/utils/prompts.js.map +1 -0
  100. package/dist/utils/validation.d.ts +50 -0
  101. package/dist/utils/validation.d.ts.map +1 -0
  102. package/dist/utils/validation.js +108 -0
  103. package/dist/utils/validation.js.map +1 -0
  104. package/package.json +56 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tailar
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.
22
+
package/README.md ADDED
@@ -0,0 +1,183 @@
1
+ # Tailar
2
+
3
+ > Scaffold Next.js features, blocks, and components with a single command
4
+
5
+ [![npm version](https://badge.fury.io/js/tailar.svg)](https://www.npmjs.com/package/tailar)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## 🚀 Quick Start
9
+
10
+ ```bash
11
+ # Initialize in your Next.js project
12
+ npx tailar@latest init
13
+
14
+ # See what's available
15
+ npx tailar@latest list
16
+
17
+ # Add a feature, block, or component
18
+ npx tailar@latest add <name>
19
+ ```
20
+
21
+ ## 📦 What is Tailar?
22
+
23
+ Tailar is a CLI tool that scaffolds production-ready code into your Next.js projects. Install complete implementations of common features, UI blocks, and components with a single command.
24
+
25
+ **No more:**
26
+
27
+ - Copying code from templates
28
+ - Building common features from scratch
29
+ - Managing boilerplate configurations
30
+
31
+ **Just run a command and start building your product.**
32
+
33
+ ## 📥 Installation
34
+
35
+ ### One-time Use (Recommended)
36
+
37
+ ```bash
38
+ npx tailar@latest <command>
39
+ ```
40
+
41
+ ### Global Install
42
+
43
+ ```bash
44
+ npm install -g tailar
45
+ ```
46
+
47
+ ## 🎯 Commands
48
+
49
+ ### `init`
50
+
51
+ Initialize Tailar in your Next.js project.
52
+
53
+ ```bash
54
+ tailar init # Interactive setup
55
+ tailar init -y # Skip all prompts
56
+ ```
57
+
58
+ **What it does:**
59
+
60
+ - If no Next.js project exists, offers to initialize one with shadcn/ui, then installs **shared** + **i18n** and any modules you pick (same defaults as in-place init)
61
+ - Creates `.tailar.json` config file
62
+ - Installs default features (i18n, shared UI)
63
+ - Installs dependencies
64
+
65
+ **Start from scratch:**
66
+
67
+ ```bash
68
+ mkdir my-app
69
+ cd my-app
70
+ tailar init
71
+ # Will automatically initialize Next.js + shadcn/ui + Tailar!
72
+ ```
73
+
74
+ ### `list`
75
+
76
+ See all available features, blocks, and components.
77
+
78
+ ```bash
79
+ tailar list
80
+ ```
81
+
82
+ Displays what you can install and what's already installed in your project.
83
+
84
+ ### `add`
85
+
86
+ Add a feature, block, or component to your project.
87
+
88
+ ```bash
89
+ tailar add <name> # Interactive prompts
90
+ tailar add <name> -y # Skip prompts
91
+ tailar add <name> --provider <name> # Specify options
92
+ ```
93
+
94
+ **Examples:**
95
+
96
+ ```bash
97
+ # Add authentication
98
+ tailar add auth
99
+
100
+ # Add database with specific provider
101
+ tailar add db --provider postgres
102
+
103
+ # Add a UI block
104
+ tailar add hero-section
105
+
106
+ # Skip all prompts
107
+ tailar add emails --provider resend -y
108
+ ```
109
+
110
+ ## 💡 How It Works
111
+
112
+ 1. **Initialize**: `tailar init` sets up your project
113
+ 2. **Browse**: `tailar list` shows what's available
114
+ 3. **Install**: `tailar add <name>` adds features to your project
115
+ 4. **Build**: Start building your product with production-ready code
116
+
117
+ ## 🎨 What Can You Install?
118
+
119
+ - **Features**: Complete implementations (authentication, database, emails, etc.)
120
+ - **Blocks**: Reusable UI sections (hero sections, CTAs, etc.)
121
+ - **Components**: Standalone UI elements (dropdowns, modals, etc.)
122
+
123
+ Run `tailar list` to see everything that's available.
124
+
125
+ ## 🔧 Common Options
126
+
127
+ | Option | Description |
128
+ | ------------------- | --------------------------------------------------------------- |
129
+ | `-y, --yes` | Skip all confirmation prompts |
130
+ | `--provider <name>` | Specify a provider (for features with multiple options) |
131
+ | `--variant <name>` | Specify a variant (for features with different implementations) |
132
+
133
+ ## 🐛 Troubleshooting
134
+
135
+ ### "Not a Next.js project"
136
+
137
+ Make sure you're in a Next.js project directory with `package.json`.
138
+
139
+ ```bash
140
+ npm list next # Verify Next.js is installed
141
+ ```
142
+
143
+ ### "Failed to load registry"
144
+
145
+ Check your internet connection. The CLI fetches the latest components from GitHub.
146
+
147
+ ### Dependencies not installing
148
+
149
+ Run the package manager install manually:
150
+
151
+ ```bash
152
+ npm install
153
+ # or
154
+ yarn install
155
+ # or
156
+ pnpm install
157
+ ```
158
+
159
+ ### TypeScript errors after installation
160
+
161
+ Regenerate types and rebuild:
162
+
163
+ ```bash
164
+ npx prisma generate # If using database features
165
+ npm run build
166
+ ```
167
+
168
+ ## 📚 Learn More
169
+
170
+ - **Docs**: [https://www.tailar.dev/docs](https://www.tailar.dev/docs)
171
+ - **Report Issues**: [GitHub Issues](https://github.com/tailar-dev/tailar/issues)
172
+
173
+ ## 📄 License
174
+
175
+ The Tailar CLI is licensed under the **MIT License**.
176
+
177
+ **Note**: Components installed by the CLI may have different licenses. The CLI will display license information when installing premium components.
178
+
179
+ See [LICENSE](./LICENSE) file for full MIT license text.
180
+
181
+ ---
182
+
183
+ **Built by developers, for developers** 🚀
package/README.npm.md ADDED
@@ -0,0 +1,183 @@
1
+ # Tailar
2
+
3
+ > Scaffold Next.js features, blocks, and components with a single command
4
+
5
+ [![npm version](https://badge.fury.io/js/tailar.svg)](https://www.npmjs.com/package/tailar)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## 🚀 Quick Start
9
+
10
+ ```bash
11
+ # Initialize in your Next.js project
12
+ npx tailar@latest init
13
+
14
+ # See what's available
15
+ npx tailar@latest list
16
+
17
+ # Add a feature, block, or component
18
+ npx tailar@latest add <name>
19
+ ```
20
+
21
+ ## 📦 What is Tailar?
22
+
23
+ Tailar is a CLI tool that scaffolds production-ready code into your Next.js projects. Install complete implementations of common features, UI blocks, and components with a single command.
24
+
25
+ **No more:**
26
+
27
+ - Copying code from templates
28
+ - Building common features from scratch
29
+ - Managing boilerplate configurations
30
+
31
+ **Just run a command and start building your product.**
32
+
33
+ ## 📥 Installation
34
+
35
+ ### One-time Use (Recommended)
36
+
37
+ ```bash
38
+ npx tailar@latest <command>
39
+ ```
40
+
41
+ ### Global Install
42
+
43
+ ```bash
44
+ npm install -g tailar
45
+ ```
46
+
47
+ ## 🎯 Commands
48
+
49
+ ### `init`
50
+
51
+ Initialize Tailar in your Next.js project.
52
+
53
+ ```bash
54
+ tailar init # Interactive setup
55
+ tailar init -y # Skip all prompts
56
+ ```
57
+
58
+ **What it does:**
59
+
60
+ - If no Next.js project exists, offers to initialize one with shadcn/ui, then installs **shared** + **i18n** and any modules you pick (same defaults as in-place init)
61
+ - Creates `.tailar.json` config file
62
+ - Installs default features (i18n, shared UI)
63
+ - Installs dependencies
64
+
65
+ **Start from scratch:**
66
+
67
+ ```bash
68
+ mkdir my-app
69
+ cd my-app
70
+ tailar init
71
+ # Will automatically initialize Next.js + shadcn/ui + Tailar!
72
+ ```
73
+
74
+ ### `list`
75
+
76
+ See all available features, blocks, and components.
77
+
78
+ ```bash
79
+ tailar list
80
+ ```
81
+
82
+ Displays what you can install and what's already installed in your project.
83
+
84
+ ### `add`
85
+
86
+ Add a feature, block, or component to your project.
87
+
88
+ ```bash
89
+ tailar add <name> # Interactive prompts
90
+ tailar add <name> -y # Skip prompts
91
+ tailar add <name> --provider <name> # Specify options
92
+ ```
93
+
94
+ **Examples:**
95
+
96
+ ```bash
97
+ # Add authentication
98
+ tailar add auth
99
+
100
+ # Add database with specific provider
101
+ tailar add db --provider postgres
102
+
103
+ # Add a UI block
104
+ tailar add hero-section
105
+
106
+ # Skip all prompts
107
+ tailar add emails --provider resend -y
108
+ ```
109
+
110
+ ## 💡 How It Works
111
+
112
+ 1. **Initialize**: `tailar init` sets up your project
113
+ 2. **Browse**: `tailar list` shows what's available
114
+ 3. **Install**: `tailar add <name>` adds features to your project
115
+ 4. **Build**: Start building your product with production-ready code
116
+
117
+ ## 🎨 What Can You Install?
118
+
119
+ - **Features**: Complete implementations (authentication, database, emails, etc.)
120
+ - **Blocks**: Reusable UI sections (hero sections, CTAs, etc.)
121
+ - **Components**: Standalone UI elements (dropdowns, modals, etc.)
122
+
123
+ Run `tailar list` to see everything that's available.
124
+
125
+ ## 🔧 Common Options
126
+
127
+ | Option | Description |
128
+ | ------------------- | --------------------------------------------------------------- |
129
+ | `-y, --yes` | Skip all confirmation prompts |
130
+ | `--provider <name>` | Specify a provider (for features with multiple options) |
131
+ | `--variant <name>` | Specify a variant (for features with different implementations) |
132
+
133
+ ## 🐛 Troubleshooting
134
+
135
+ ### "Not a Next.js project"
136
+
137
+ Make sure you're in a Next.js project directory with `package.json`.
138
+
139
+ ```bash
140
+ npm list next # Verify Next.js is installed
141
+ ```
142
+
143
+ ### "Failed to load registry"
144
+
145
+ Check your internet connection. The CLI fetches the latest components from GitHub.
146
+
147
+ ### Dependencies not installing
148
+
149
+ Run the package manager install manually:
150
+
151
+ ```bash
152
+ npm install
153
+ # or
154
+ yarn install
155
+ # or
156
+ pnpm install
157
+ ```
158
+
159
+ ### TypeScript errors after installation
160
+
161
+ Regenerate types and rebuild:
162
+
163
+ ```bash
164
+ npx prisma generate # If using database features
165
+ npm run build
166
+ ```
167
+
168
+ ## 📚 Learn More
169
+
170
+ - **Docs**: [https://www.tailar.dev/docs](https://www.tailar.dev/docs)
171
+ - **Report Issues**: [GitHub Issues](https://github.com/tailar-dev/tailar/issues)
172
+
173
+ ## 📄 License
174
+
175
+ The Tailar CLI is licensed under the **MIT License**.
176
+
177
+ **Note**: Components installed by the CLI may have different licenses. The CLI will display license information when installing premium components.
178
+
179
+ See [LICENSE](./LICENSE) file for full MIT license text.
180
+
181
+ ---
182
+
183
+ **Built by developers, for developers** 🚀
@@ -0,0 +1,47 @@
1
+ /**
2
+ * API Client Module
3
+ *
4
+ * Handles all API interactions with the Tailar web API
5
+ */
6
+ import type { Registry } from "../types/index.js";
7
+ interface ComponentMetadata {
8
+ name: string;
9
+ type: string;
10
+ requiresSubscription: boolean;
11
+ subscriptionTier: number;
12
+ isAccessible?: boolean;
13
+ reason?: string;
14
+ files: any[];
15
+ }
16
+ /**
17
+ * Fetch registry.json from API
18
+ */
19
+ export declare function fetchRegistry(options?: {
20
+ forceRefresh?: boolean;
21
+ version?: string;
22
+ }): Promise<Registry>;
23
+ /**
24
+ * Fetch a single component file from API
25
+ */
26
+ export declare function fetchComponentFile(type: "feature" | "block" | "component" | "template", name: string, filePath: string, options?: {
27
+ variant?: string;
28
+ requireAuth?: boolean;
29
+ }): Promise<string>;
30
+ /**
31
+ * Fetch component metadata from API
32
+ * @param requireAuth - If true, requires authentication (default: true for proper access checking)
33
+ */
34
+ export declare function fetchComponentMetadata(type: "feature" | "block" | "component" | "template", name: string, requireAuth?: boolean): Promise<ComponentMetadata>;
35
+ /**
36
+ * Check if user has access to a component (via metadata endpoint)
37
+ * @param registryEntry - Optional registry entry to check subscription requirements before API call
38
+ */
39
+ export declare function checkSubscription(type: "feature" | "block" | "component" | "template", name: string, registryEntry?: {
40
+ requiresSubscription?: boolean;
41
+ subscriptionTier?: number;
42
+ }): Promise<{
43
+ accessible: boolean;
44
+ reason?: string;
45
+ }>;
46
+ export {};
47
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAoBlD,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,GAAG,EAAE,CAAC;CACd;AAkKD;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACzD,OAAO,CAAC,QAAQ,CAAC,CA0BnB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,EACpD,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACxD,OAAO,CAAC,MAAM,CAAC,CA0GjB;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,EACpD,IAAI,EAAE,MAAM,EACZ,WAAW,GAAE,OAAc,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAmB5B;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,EACpD,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE;IACd,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GACA,OAAO,CAAC;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAgFnD"}