@shivasankaran18/stackd 1.2.0 → 1.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 (77) hide show
  1. package/apps/web/app/scaffold/page.tsx +1 -1
  2. package/apps/web/package.json +0 -1
  3. package/package.json +33 -4
  4. package/stackd.ts +0 -0
  5. package/dist/apps/cli/src/cli.js +0 -217
  6. package/dist/apps/cli/src/commands/create.js +0 -148
  7. package/dist/apps/cli/src/scripts/Auth/jwt.js +0 -78
  8. package/dist/apps/cli/src/scripts/Auth/nextAuth.js +0 -131
  9. package/dist/apps/cli/src/scripts/Auth/passport.js +0 -218
  10. package/dist/apps/cli/src/scripts/backend/django.js +0 -20
  11. package/dist/apps/cli/src/scripts/backend/expressjs.js +0 -58
  12. package/dist/apps/cli/src/scripts/backend/expressts.js +0 -83
  13. package/dist/apps/cli/src/scripts/frontend/angularjs.js +0 -1
  14. package/dist/apps/cli/src/scripts/frontend/angularts.js +0 -22
  15. package/dist/apps/cli/src/scripts/frontend/nextjs.js +0 -62
  16. package/dist/apps/cli/src/scripts/frontend/reactjs.js +0 -31
  17. package/dist/apps/cli/src/scripts/frontend/reactts.js +0 -30
  18. package/dist/apps/cli/src/scripts/frontend/vuejs.js +0 -37
  19. package/dist/apps/cli/src/scripts/frontend/vuets.js +0 -43
  20. package/dist/apps/cli/src/scripts/orms/drizzleSetup.js +0 -85
  21. package/dist/apps/cli/src/scripts/orms/mongoSetup.js +0 -53
  22. package/dist/apps/cli/src/scripts/orms/prismaSetup.js +0 -12
  23. package/dist/apps/cli/src/scripts/ui/shadcn.js +0 -207
  24. package/dist/apps/cli/src/scripts/ui/tailwindcss.js +0 -102
  25. package/dist/apps/web/app/api/auth/[...nextauth]/route.js +0 -5
  26. package/dist/apps/web/app/api/scaffold/route.js +0 -251
  27. package/dist/apps/web/app/home/page.js +0 -19
  28. package/dist/apps/web/app/layout.js +0 -19
  29. package/dist/apps/web/app/page.js +0 -1
  30. package/dist/apps/web/app/providers.js +0 -7
  31. package/dist/apps/web/app/scaffold/page.js +0 -326
  32. package/dist/apps/web/components/Sidebar.js +0 -54
  33. package/dist/apps/web/components/theme-provider.js +0 -6
  34. package/dist/apps/web/components/ui/button.js +0 -32
  35. package/dist/apps/web/components/ui/card.js +0 -15
  36. package/dist/apps/web/components/ui/dropdown-menu.js +0 -54
  37. package/dist/apps/web/components/ui/input.js +0 -7
  38. package/dist/apps/web/components/ui/label.js +0 -9
  39. package/dist/apps/web/components/ui/scroll-area.js +0 -19
  40. package/dist/apps/web/components/ui/sonner.js +0 -15
  41. package/dist/apps/web/components/ui/steps.js +0 -14
  42. package/dist/apps/web/components/ui/switch.js +0 -9
  43. package/dist/apps/web/lib/auth.js +0 -32
  44. package/dist/apps/web/lib/redis.js +0 -9
  45. package/dist/apps/web/lib/utils.js +0 -5
  46. package/dist/packages/scripts/Auth/jwt.js +0 -78
  47. package/dist/packages/scripts/Auth/nextAuth.js +0 -131
  48. package/dist/packages/scripts/Auth/passport.js +0 -218
  49. package/dist/packages/scripts/backend/django.js +0 -20
  50. package/dist/packages/scripts/backend/expressjs.js +0 -58
  51. package/dist/packages/scripts/backend/expressts.js +0 -83
  52. package/dist/packages/scripts/frontend/angularjs.js +0 -1
  53. package/dist/packages/scripts/frontend/angularts.js +0 -22
  54. package/dist/packages/scripts/frontend/nextjs.js +0 -62
  55. package/dist/packages/scripts/frontend/reactjs.js +0 -31
  56. package/dist/packages/scripts/frontend/reactts.js +0 -30
  57. package/dist/packages/scripts/frontend/vuejs.js +0 -37
  58. package/dist/packages/scripts/frontend/vuets.js +0 -43
  59. package/dist/packages/scripts/orms/drizzleSetup.js +0 -85
  60. package/dist/packages/scripts/orms/mongoSetup.js +0 -53
  61. package/dist/packages/scripts/orms/prismaSetup.js +0 -12
  62. package/dist/packages/scripts/ui/shadcn.js +0 -207
  63. package/dist/packages/scripts/ui/tailwindcss.js +0 -102
  64. package/dist/packages/ui/src/button.js +0 -10
  65. package/dist/packages/ui/src/card.js +0 -11
  66. package/dist/packages/ui/src/code.js +0 -6
  67. package/dist/packages/ui/turbo/generators/config.js +0 -30
  68. package/dist/stackd.js +0 -114
  69. package/dist/tsconfig.tsbuildinfo +0 -1
  70. package/packages/ui/eslint.config.mjs +0 -4
  71. package/packages/ui/package.json +0 -27
  72. package/packages/ui/src/button.tsx +0 -20
  73. package/packages/ui/src/card.tsx +0 -27
  74. package/packages/ui/src/code.tsx +0 -11
  75. package/packages/ui/tsconfig.json +0 -8
  76. package/packages/ui/turbo/generators/config.ts +0 -30
  77. package/packages/ui/turbo/generators/templates/component.hbs +0 -8
@@ -1,85 +0,0 @@
1
- import { join } from 'node:path';
2
- import { mkdir, writeFile } from 'node:fs/promises';
3
- import 'dotenv/config';
4
- export async function setupDrizzle(config, projectDir, emitLog) {
5
- try {
6
- emitLog('Starting Drizzle ORM setup...');
7
- const backendDir = join(projectDir, 'backend');
8
- const dbDir = join(backendDir, 'src', 'db');
9
- const schemasDir = join(dbDir, 'schema');
10
- emitLog('Creating directory structure...');
11
- await mkdir(schemasDir, { recursive: true });
12
- emitLog('✅ Directory structure created');
13
- emitLog('Generating environment configuration...');
14
- const envContent = `
15
- # Database Configuration
16
- ${config.env?.DATABASE_URL_ENV || 'DATABASE_URL'}=postgres://user:password@localhost:5432/${config.databaseName || 'myapp'}
17
- # Add other environment variables here
18
- NODE_ENV=development
19
- PORT=3000
20
- `;
21
- await writeFile(join(backendDir, '.env'), envContent.trim() + '\n');
22
- emitLog('✅ Environment configuration created');
23
- emitLog('Setting up database connection...');
24
- const dbCode = `
25
- import { drizzle } from 'drizzle-orm/node-postgres';
26
- import { Pool } from 'pg';
27
- import 'dotenv/config';
28
-
29
- const pool = new Pool({
30
- connectionString: process.env.${config.env?.DATABASE_URL_ENV || 'DATABASE_URL'},
31
- });
32
-
33
- export const db = drizzle(pool);
34
-
35
- export async function connectDB() {
36
- try {
37
- await pool.connect();
38
- console.log('Connected to PostgreSQL database');
39
- } catch (error) {
40
- console.error('Database connection error:', error);
41
- process.exit(1);
42
- }
43
- }
44
-
45
- export async function disconnectDB() {
46
- await pool.end();
47
- console.log('Disconnected from PostgreSQL database');
48
- }
49
- `;
50
- await writeFile(join(dbDir, 'index.ts'), dbCode);
51
- emitLog('✅ Database connection setup complete');
52
- emitLog('Creating example schema...');
53
- const exampleSchemaCode = `
54
- import { pgTable, serial, varchar, timestamp } from 'drizzle-orm/pg-core';
55
-
56
- export const examples = pgTable('examples', {
57
- id: serial('id').primaryKey(),
58
- name: varchar('name', { length: 256 }).notNull(),
59
- createdAt: timestamp('created_at').defaultNow(),
60
- });
61
- `;
62
- await writeFile(join(schemasDir, 'example.ts'), exampleSchemaCode);
63
- emitLog('✅ Example schema created');
64
- emitLog('Configuring Drizzle migrations...');
65
- const drizzleConfigCode = `
66
- import type { Config } from 'drizzle-kit';
67
-
68
- export default {
69
- schema: './src/db/schema/*',
70
- out: './src/db/migrations',
71
- driver: 'pg',
72
- dbCredentials: {
73
- connectionString: process.env.${config.env?.DATABASE_URL_ENV || 'DATABASE_URL'}!,
74
- },
75
- } satisfies Config;
76
- `;
77
- await writeFile(join(backendDir, 'drizzle.config.ts'), drizzleConfigCode);
78
- emitLog('✅ Drizzle configuration complete');
79
- emitLog('✅ Drizzle ORM setup completed successfully!');
80
- }
81
- catch (error) {
82
- emitLog(`❌ Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
83
- throw error;
84
- }
85
- }
@@ -1,53 +0,0 @@
1
- import { join } from 'node:path';
2
- import { mkdir, writeFile } from 'node:fs/promises';
3
- import 'dotenv/config';
4
- export async function setupMongoose(config, projectDir, emitLog) {
5
- const backendDir = join(projectDir, 'backend');
6
- const modelsDir = join(backendDir, 'src', 'models');
7
- await mkdir(modelsDir, { recursive: true });
8
- emitLog('Generating environment configuration...');
9
- const envContent = `
10
- # MongoDB Configuration
11
- ${config.env?.MONGODB_URI_ENV || 'MONGODB_URI'}=mongodb://localhost:27017/${config.databaseName || 'myapp'}
12
-
13
- # Add other environment variables here
14
- NODE_ENV=development
15
- PORT=3000
16
- `;
17
- await writeFile(join(backendDir, '.env'), envContent.trim() + '\n');
18
- emitLog('✅ Environment configuration created');
19
- emitLog('Setting up database connection...');
20
- const dbCode = `
21
- import mongoose from 'mongoose';
22
-
23
- const MONGODB_URI = process.env.${config.env?.MONGODB_URI_ENV || 'MONGODB_URI'} || 'mongodb://localhost:27017/${config.databaseName || 'myapp'}';
24
-
25
- export async function connectDB() {
26
- try {
27
- await mongoose.connect(MONGODB_URI);
28
- console.log('Connected to MongoDB');
29
- } catch (error) {
30
- console.error('MongoDB connection error:', error);
31
- process.exit(1);
32
- }
33
- }
34
-
35
- export async function disconnectDB() {
36
- await mongoose.disconnect();
37
- console.log('Disconnected from MongoDB');
38
- }
39
- `;
40
- emitLog('✅ Database connection setup complete');
41
- await writeFile(join(backendDir, 'db.ts'), dbCode);
42
- const exampleModelCode = `
43
- import mongoose from 'mongoose';
44
-
45
- const exampleSchema = new mongoose.Schema({
46
- name: { type: String, required: true },
47
- createdAt: { type: Date, default: Date.now },
48
- });
49
-
50
- export const Example = mongoose.model('Example', exampleSchema);
51
- `;
52
- await writeFile(join(modelsDir, 'example.ts'), exampleModelCode);
53
- }
@@ -1,12 +0,0 @@
1
- import { join } from 'node:path';
2
- import { execSync } from 'node:child_process';
3
- import { writeFileSync } from 'node:fs';
4
- export async function setupPrisma(config, projectDir, emitLog) {
5
- emitLog('Setting up Prisma...');
6
- const backendDir = join(projectDir, 'backend');
7
- const envContent = `DATABASE_URL=${config.dbUrl}\n`;
8
- writeFileSync(join(projectDir, 'backend', '.env'), envContent);
9
- await execSync('npm install prisma', { cwd: backendDir });
10
- await execSync('npx prisma init', { cwd: backendDir });
11
- emitLog('✅ Prisma setup complete');
12
- }
@@ -1,207 +0,0 @@
1
- import { writeFile, mkdir } from 'fs/promises';
2
- import { join } from 'path';
3
- import { execSync } from 'child_process';
4
- import { existsSync } from 'fs';
5
- export async function setupShadcn(config, projectDir, emitLog) {
6
- try {
7
- const frontendDir = join(projectDir, 'frontend');
8
- emitLog('📦 Setting up shadcn/ui...');
9
- // Make sure Tailwind is set up first
10
- emitLog('Ensuring Tailwind CSS is set up...');
11
- // Install shadcn/ui dependencies
12
- emitLog('Installing shadcn/ui dependencies...');
13
- execSync('npm install @shadcn/ui class-variance-authority clsx tailwind-merge lucide-react', {
14
- cwd: frontendDir,
15
- stdio: 'inherit'
16
- });
17
- // Create components.json configuration
18
- const componentsConfig = {
19
- $schema: "https://ui.shadcn.com/schema.json",
20
- style: "default",
21
- rsc: false,
22
- tailwind: {
23
- config: "tailwind.config.js",
24
- css: "src/index.css",
25
- baseColor: "slate",
26
- cssVariables: true,
27
- },
28
- aliases: {
29
- components: "@/components",
30
- utils: "@/lib/utils"
31
- }
32
- };
33
- await writeFile(join(frontendDir, 'components.json'), JSON.stringify(componentsConfig, null, 2));
34
- // Create utils file
35
- const utilsDir = join(frontendDir, 'src', 'lib');
36
- if (!existsSync(utilsDir)) {
37
- await mkdir(utilsDir, { recursive: true });
38
- }
39
- const utilsContent = `
40
- import { type ClassValue, clsx } from "clsx"
41
- import { twMerge } from "tailwind-merge"
42
-
43
- export function cn(...inputs: ClassValue[]) {
44
- return twMerge(clsx(inputs))
45
- }
46
- `;
47
- await writeFile(join(utilsDir, 'utils.ts'), utilsContent.trim() + '\n');
48
- emitLog('✅ shadcn/ui setup completed successfully!');
49
- }
50
- catch (error) {
51
- emitLog(`❌ Error setting up shadcn/ui: ${error instanceof Error ? error.message : 'Unknown error'}`);
52
- throw error;
53
- }
54
- }
55
- function generateShadcnTailwindConfig(frontend) {
56
- const baseConfig = {
57
- darkMode: ["class"],
58
- content: frontend === 'django'
59
- ? ["./templates/**/*.html", "./static/**/*.{js,ts}"]
60
- : ["./index.html", "./src/**/*.{js,ts,jsx,tsx,vue}"],
61
- theme: {
62
- container: {
63
- center: true,
64
- padding: "2rem",
65
- screens: {
66
- "2xl": "1400px",
67
- },
68
- },
69
- extend: {
70
- colors: {
71
- border: "hsl(var(--border))",
72
- input: "hsl(var(--input))",
73
- ring: "hsl(var(--ring))",
74
- background: "hsl(var(--background))",
75
- foreground: "hsl(var(--foreground))",
76
- primary: {
77
- DEFAULT: "hsl(var(--primary))",
78
- foreground: "hsl(var(--primary-foreground))",
79
- },
80
- secondary: {
81
- DEFAULT: "hsl(var(--secondary))",
82
- foreground: "hsl(var(--secondary-foreground))",
83
- },
84
- destructive: {
85
- DEFAULT: "hsl(var(--destructive))",
86
- foreground: "hsl(var(--destructive-foreground))",
87
- },
88
- muted: {
89
- DEFAULT: "hsl(var(--muted))",
90
- foreground: "hsl(var(--muted-foreground))",
91
- },
92
- accent: {
93
- DEFAULT: "hsl(var(--accent))",
94
- foreground: "hsl(var(--accent-foreground))",
95
- },
96
- popover: {
97
- DEFAULT: "hsl(var(--popover))",
98
- foreground: "hsl(var(--popover-foreground))",
99
- },
100
- card: {
101
- DEFAULT: "hsl(var(--card))",
102
- foreground: "hsl(var(--card-foreground))",
103
- },
104
- },
105
- borderRadius: {
106
- lg: "var(--radius)",
107
- md: "calc(var(--radius) - 2px)",
108
- sm: "calc(var(--radius) - 4px)",
109
- },
110
- keyframes: {
111
- "accordion-down": {
112
- from: { height: "0" },
113
- to: { height: "var(--radix-accordion-content-height)" },
114
- },
115
- "accordion-up": {
116
- from: { height: "var(--radix-accordion-content-height)" },
117
- to: { height: "0" },
118
- },
119
- },
120
- animation: {
121
- "accordion-down": "accordion-down 0.2s ease-out",
122
- "accordion-up": "accordion-up 0.2s ease-out",
123
- },
124
- },
125
- },
126
- plugins: ["require('tailwindcss-animate')"],
127
- };
128
- return `/** @type {import('tailwindcss').Config} */
129
- export default ${JSON.stringify(baseConfig, null, 2)}`;
130
- }
131
- function generateShadcnStyles(frontend) {
132
- return `@tailwind base;
133
- @tailwind components;
134
- @tailwind utilities;
135
- @layer base {
136
- :root {
137
- --background: 0 0% 100%;
138
- --foreground: 222.2 84% 4.9%;
139
-
140
- --card: 0 0% 100%;
141
- --card-foreground: 222.2 84% 4.9%;
142
-
143
- --popover: 0 0% 100%;
144
- --popover-foreground: 222.2 84% 4.9%;
145
-
146
- --primary: 222.2 47.4% 11.2%;
147
- --primary-foreground: 210 40% 98%;
148
-
149
- --secondary: 210 40% 96.1%;
150
- --secondary-foreground: 222.2 47.4% 11.2%;
151
-
152
- --muted: 210 40% 96.1%;
153
- --muted-foreground: 215.4 16.3% 46.9%;
154
-
155
- --accent: 210 40% 96.1%;
156
- --accent-foreground: 222.2 47.4% 11.2%;
157
-
158
- --destructive: 0 84.2% 60.2%;
159
- --destructive-foreground: 210 40% 98%;
160
-
161
- --border: 214.3 31.8% 91.4%;
162
- --input: 214.3 31.8% 91.4%;
163
- --ring: 222.2 84% 4.9%;
164
-
165
- --radius: 0.5rem;
166
- }
167
-
168
- .dark {
169
- --background: 222.2 84% 4.9%;
170
- --foreground: 210 40% 98%;
171
-
172
- --card: 222.2 84% 4.9%;
173
- --card-foreground: 210 40% 98%;
174
-
175
- --popover: 222.2 84% 4.9%;
176
- --popover-foreground: 210 40% 98%;
177
-
178
- --primary: 210 40% 98%;
179
- --primary-foreground: 222.2 47.4% 11.2%;
180
-
181
- --secondary: 217.2 32.6% 17.5%;
182
- --secondary-foreground: 210 40% 98%;
183
-
184
- --muted: 217.2 32.6% 17.5%;
185
- --muted-foreground: 215 20.2% 65.1%;
186
-
187
- --accent: 217.2 32.6% 17.5%;
188
- --accent-foreground: 210 40% 98%;
189
-
190
- --destructive: 0 62.8% 30.6%;
191
- --destructive-foreground: 210 40% 98%;
192
-
193
- --border: 217.2 32.6% 17.5%;
194
- --input: 217.2 32.6% 17.5%;
195
- --ring: 212.7 26.8% 83.9%;
196
- }
197
- }
198
-
199
- @layer base {
200
- * {
201
- @apply border-border;
202
- }
203
- body {
204
- @apply bg-background text-foreground;
205
- }
206
- }`;
207
- }
@@ -1,102 +0,0 @@
1
- import { writeFile } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
- import { execSync } from 'child_process';
4
- import { existsSync } from 'fs';
5
- import { mkdir } from 'fs/promises';
6
- export async function setupTailwindCSS(config, projectDir, emitLog) {
7
- try {
8
- const frontendDir = join(projectDir, 'frontend');
9
- const srcDir = join(frontendDir, 'src');
10
- // Ensure directories exist
11
- if (!existsSync(frontendDir)) {
12
- emitLog('Creating frontend directory...');
13
- await mkdir(frontendDir, { recursive: true });
14
- }
15
- if (!existsSync(srcDir)) {
16
- emitLog('Creating src directory...');
17
- await mkdir(srcDir, { recursive: true });
18
- }
19
- // Initialize package.json if it doesn't exist
20
- if (!existsSync(join(frontendDir, 'package.json'))) {
21
- emitLog('Initializing package.json...');
22
- execSync('npm init -y', {
23
- cwd: frontendDir,
24
- stdio: 'inherit'
25
- });
26
- }
27
- // Install dependencies using npm directly
28
- emitLog('Installing Tailwind CSS dependencies...');
29
- execSync('npm install tailwindcss@latest postcss@latest autoprefixer@latest --save-dev', {
30
- cwd: frontendDir,
31
- stdio: 'inherit'
32
- });
33
- // Create tailwind.config.js manually instead of using npx
34
- emitLog('Creating Tailwind configuration...');
35
- const tailwindConfig = generateTailwindConfig(config.frontend);
36
- await writeFile(join(frontendDir, 'tailwind.config.js'), tailwindConfig);
37
- // Create postcss.config.js
38
- emitLog('Creating PostCSS configuration...');
39
- const postcssConfig = `
40
- module.exports = {
41
- plugins: {
42
- tailwindcss: {},
43
- autoprefixer: {},
44
- },
45
- }`;
46
- await writeFile(join(frontendDir, 'postcss.config.js'), postcssConfig);
47
- // Add Tailwind directives to CSS
48
- emitLog('Creating CSS file with Tailwind directives...');
49
- const tailwindDirectives = `
50
- @tailwind base;
51
- @tailwind components;
52
- @tailwind utilities;
53
- `;
54
- await writeFile(join(srcDir, 'index.css'), tailwindDirectives);
55
- emitLog('✅ Tailwind CSS setup completed successfully!');
56
- }
57
- catch (error) {
58
- emitLog(`❌ Error setting up Tailwind CSS: ${error instanceof Error ? error.message : 'Unknown error'}`);
59
- throw error;
60
- }
61
- }
62
- function generateTailwindConfig(framework) {
63
- const baseConfig = {
64
- content: [
65
- "./index.html",
66
- "./src/**/*.{js,ts,jsx,tsx}",
67
- ],
68
- theme: {
69
- extend: {
70
- colors: {
71
- background: 'hsl(var(--background))',
72
- foreground: 'hsl(var(--foreground))',
73
- },
74
- },
75
- },
76
- plugins: [],
77
- };
78
- switch (framework) {
79
- case 'react-ts':
80
- case 'react':
81
- baseConfig.content = [
82
- "./index.html",
83
- "./src/**/*.{js,ts,jsx,tsx}",
84
- ];
85
- break;
86
- case 'vue-ts':
87
- case 'vue':
88
- baseConfig.content = [
89
- "./index.html",
90
- "./src/**/*.{vue,js,ts,jsx,tsx}",
91
- ];
92
- break;
93
- case 'django':
94
- baseConfig.content = [
95
- "./templates/**/*.html",
96
- "./static/**/*.{js,ts}",
97
- ];
98
- break;
99
- }
100
- return `/** @type {import('tailwindcss').Config} */
101
- module.exports = ${JSON.stringify(baseConfig, null, 2)}`;
102
- }
@@ -1,5 +0,0 @@
1
- import NextAuth from "next-auth";
2
- import { authOptions } from "../../../../lib/auth";
3
- //@ts-ignore
4
- const handler = NextAuth(authOptions);
5
- export { handler as GET, handler as POST };