@shivasankaran18/stackd 1.8.0 → 2.0.1
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.
- package/apps/cli/src/cli.ts +28 -2
- package/apps/cli/src/commands/create.ts +30 -0
- package/apps/cli/src/scripts/ui/shadcn.ts +4 -10
- package/apps/cli/src/scripts/ui/tailwind.ts +39 -0
- package/apps/web/app/scaffold/page.tsx +1 -1
- package/apps/web/package.json +1 -1
- package/apps/web/tsconfig.json +108 -20
- package/package.json +18 -20
- package/dist/apps/cli/src/cli.js +0 -217
- package/dist/apps/cli/src/commands/create.js +0 -148
- package/dist/apps/cli/src/scripts/Auth/jwt.js +0 -78
- package/dist/apps/cli/src/scripts/Auth/nextAuth.js +0 -131
- package/dist/apps/cli/src/scripts/Auth/passport.js +0 -218
- package/dist/apps/cli/src/scripts/backend/django.js +0 -20
- package/dist/apps/cli/src/scripts/backend/expressjs.js +0 -58
- package/dist/apps/cli/src/scripts/backend/expressts.js +0 -83
- package/dist/apps/cli/src/scripts/frontend/angularjs.js +0 -1
- package/dist/apps/cli/src/scripts/frontend/angularts.js +0 -22
- package/dist/apps/cli/src/scripts/frontend/nextjs.js +0 -62
- package/dist/apps/cli/src/scripts/frontend/reactjs.js +0 -31
- package/dist/apps/cli/src/scripts/frontend/reactts.js +0 -30
- package/dist/apps/cli/src/scripts/frontend/vuejs.js +0 -37
- package/dist/apps/cli/src/scripts/frontend/vuets.js +0 -43
- package/dist/apps/cli/src/scripts/orms/drizzleSetup.js +0 -85
- package/dist/apps/cli/src/scripts/orms/mongoSetup.js +0 -53
- package/dist/apps/cli/src/scripts/orms/prismaSetup.js +0 -12
- package/dist/apps/cli/src/scripts/ui/shadcn.js +0 -207
- package/dist/apps/cli/src/scripts/ui/tailwindcss.js +0 -102
- package/dist/apps/web/app/api/auth/[...nextauth]/route.js +0 -5
- package/dist/apps/web/app/api/scaffold/route.js +0 -251
- package/dist/apps/web/app/home/page.js +0 -19
- package/dist/apps/web/app/layout.js +0 -19
- package/dist/apps/web/app/page.js +0 -1
- package/dist/apps/web/app/providers.js +0 -7
- package/dist/apps/web/app/scaffold/page.js +0 -326
- package/dist/apps/web/components/Sidebar.js +0 -54
- package/dist/apps/web/components/theme-provider.js +0 -6
- package/dist/apps/web/components/ui/button.js +0 -32
- package/dist/apps/web/components/ui/card.js +0 -15
- package/dist/apps/web/components/ui/dropdown-menu.js +0 -54
- package/dist/apps/web/components/ui/input.js +0 -7
- package/dist/apps/web/components/ui/label.js +0 -9
- package/dist/apps/web/components/ui/scroll-area.js +0 -19
- package/dist/apps/web/components/ui/sonner.js +0 -15
- package/dist/apps/web/components/ui/steps.js +0 -14
- package/dist/apps/web/components/ui/switch.js +0 -9
- package/dist/apps/web/lib/auth.js +0 -32
- package/dist/apps/web/lib/redis.js +0 -9
- package/dist/apps/web/lib/utils.js +0 -5
- package/dist/packages/scripts/Auth/jwt.js +0 -78
- package/dist/packages/scripts/Auth/nextAuth.js +0 -131
- package/dist/packages/scripts/Auth/passport.js +0 -218
- package/dist/packages/scripts/backend/django.js +0 -20
- package/dist/packages/scripts/backend/expressjs.js +0 -58
- package/dist/packages/scripts/backend/expressts.js +0 -83
- package/dist/packages/scripts/frontend/angularjs.js +0 -1
- package/dist/packages/scripts/frontend/angularts.js +0 -22
- package/dist/packages/scripts/frontend/nextjs.js +0 -62
- package/dist/packages/scripts/frontend/reactjs.js +0 -31
- package/dist/packages/scripts/frontend/reactts.js +0 -30
- package/dist/packages/scripts/frontend/vuejs.js +0 -37
- package/dist/packages/scripts/frontend/vuets.js +0 -43
- package/dist/packages/scripts/orms/drizzleSetup.js +0 -85
- package/dist/packages/scripts/orms/mongoSetup.js +0 -53
- package/dist/packages/scripts/orms/prismaSetup.js +0 -12
- package/dist/packages/scripts/ui/shadcn.js +0 -207
- package/dist/packages/scripts/ui/tailwindcss.js +0 -102
- package/dist/stackd.js +0 -114
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/packages/typescript-config/base.json +0 -19
- package/packages/typescript-config/nextjs.json +0 -12
- package/packages/typescript-config/package.json +0 -9
- package/packages/typescript-config/react-library.json +0 -7
package/apps/cli/src/cli.ts
CHANGED
@@ -15,6 +15,7 @@ export interface ProjectConfig {
|
|
15
15
|
orm: string;
|
16
16
|
auth: string;
|
17
17
|
dbUrl: string;
|
18
|
+
ui: string;
|
18
19
|
}
|
19
20
|
|
20
21
|
interface Answers {
|
@@ -27,7 +28,8 @@ interface Answers {
|
|
27
28
|
orm: string;
|
28
29
|
auth: string;
|
29
30
|
dbUrl: string;
|
30
|
-
projectName:string;
|
31
|
+
projectName: string;
|
32
|
+
ui: string;
|
31
33
|
}
|
32
34
|
|
33
35
|
const showBanner = () => {
|
@@ -67,7 +69,9 @@ const CHOICES = {
|
|
67
69
|
MONGOOSE: 'Mongoose',
|
68
70
|
JWT: 'JWT',
|
69
71
|
NEXTAUTH: 'NextAuth',
|
70
|
-
PASSPORT: 'Passport'
|
72
|
+
PASSPORT: 'Passport',
|
73
|
+
TAILWIND: 'Tailwind CSS',
|
74
|
+
SHADCN: 'shadcn/ui + Tailwind'
|
71
75
|
};
|
72
76
|
|
73
77
|
program
|
@@ -124,6 +128,27 @@ program
|
|
124
128
|
}
|
125
129
|
]);
|
126
130
|
|
131
|
+
// Add UI framework selection after frontend
|
132
|
+
let uiChoice = { ui: CHOICES.NONE };
|
133
|
+
if (frontendChoice.frontend !== chalk.green(CHOICES.DJANGO_TEMPLATES) &&
|
134
|
+
frontendChoice.frontend !== CHOICES.SKIP) {
|
135
|
+
uiChoice = await inquirer.prompt([
|
136
|
+
{
|
137
|
+
type: 'list',
|
138
|
+
name: 'ui',
|
139
|
+
message: chalk.magenta.bold('🎨 Choose a UI framework:'),
|
140
|
+
choices: (answers) => {
|
141
|
+
const isReact = frontendChoice.frontend.includes('React');
|
142
|
+
return [
|
143
|
+
chalk.blue(CHOICES.TAILWIND),
|
144
|
+
...(isReact ? [chalk.cyan(CHOICES.SHADCN)] : []),
|
145
|
+
CHOICES.NONE
|
146
|
+
];
|
147
|
+
},
|
148
|
+
default: CHOICES.NONE,
|
149
|
+
}
|
150
|
+
]);
|
151
|
+
}
|
127
152
|
|
128
153
|
const backendChoice = await inquirer.prompt([
|
129
154
|
{
|
@@ -210,6 +235,7 @@ program
|
|
210
235
|
const answers = {
|
211
236
|
...projectSettings,
|
212
237
|
...frontendChoice,
|
238
|
+
...uiChoice,
|
213
239
|
...backendChoice,
|
214
240
|
...databaseChoice,
|
215
241
|
...ormChoice,
|
@@ -16,6 +16,8 @@ import chalk from 'chalk';
|
|
16
16
|
import ora from 'ora';
|
17
17
|
import { mkdir } from 'fs/promises';
|
18
18
|
import { ProjectConfig } from '../cli.js';
|
19
|
+
import { setupShadcn } from '../scripts/ui/shadcn.js';
|
20
|
+
import { setupTailwindCSS } from '../scripts/ui/tailwindcss.js';
|
19
21
|
|
20
22
|
const emitLog = (message: string): void => {
|
21
23
|
console.log(`[Emit Logs]: ${message}`);
|
@@ -64,6 +66,24 @@ export async function createProject(projectName: string, options: ProjectConfig)
|
|
64
66
|
break;
|
65
67
|
}
|
66
68
|
|
69
|
+
// UI Framework setup
|
70
|
+
if (options.ui !== 'None' && options.frontend !== 'Django Templates' && options.frontend !== 'Skip') {
|
71
|
+
spinner.text = 'Setting up UI framework...';
|
72
|
+
switch(options.ui) {
|
73
|
+
case 'Tailwind CSS':
|
74
|
+
await setupTailwindCSS(config, projectDir, emitLog);
|
75
|
+
break;
|
76
|
+
case 'shadcn/ui + Tailwind':
|
77
|
+
await setupTailwindCSS(config, projectDir, emitLog);
|
78
|
+
// @ts-ignore
|
79
|
+
await setupShadcn(config, projectDir, emitLog);
|
80
|
+
break;
|
81
|
+
default:
|
82
|
+
emitLog('Unknown UI framework choice');
|
83
|
+
break;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
67
87
|
// Backend setup
|
68
88
|
spinner.text = 'Setting up backend...';
|
69
89
|
switch(options.backend) {
|
@@ -143,6 +163,16 @@ export async function createProject(projectName: string, options: ProjectConfig)
|
|
143
163
|
}
|
144
164
|
}
|
145
165
|
|
166
|
+
// Add UI-specific instructions
|
167
|
+
if (options.ui !== 'None') {
|
168
|
+
console.log(chalk.yellow('\nUI Framework Setup:'));
|
169
|
+
if (options.ui === 'Tailwind CSS') {
|
170
|
+
console.log(chalk.cyan(' Tailwind CSS is ready to use'));
|
171
|
+
} else if (options.ui === 'shadcn/ui + Tailwind') {
|
172
|
+
console.log(chalk.cyan(' Run `npx shadcn-ui@latest init` to complete shadcn/ui setup'));
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
146
176
|
// Add database specific instructions
|
147
177
|
if (options.database !== 'Skip') {
|
148
178
|
console.log(chalk.yellow('\nDatabase Setup:'));
|
@@ -2,12 +2,9 @@ import { writeFile, mkdir } from 'fs/promises';
|
|
2
2
|
import { join } from 'path';
|
3
3
|
import { execSync } from 'child_process';
|
4
4
|
import { existsSync } from 'fs';
|
5
|
+
import { ProjectConfig } from '../../cli.js';
|
5
6
|
|
6
|
-
export async function setupShadcn(
|
7
|
-
config: any,
|
8
|
-
projectDir: string,
|
9
|
-
emitLog: (log: string) => void
|
10
|
-
) {
|
7
|
+
export async function setupShadcn(config: ProjectConfig, projectDir: string, emitLog: (message: string) => void) {
|
11
8
|
try {
|
12
9
|
const frontendDir = join(projectDir, 'frontend');
|
13
10
|
emitLog('📦 Setting up shadcn/ui...');
|
@@ -17,10 +14,7 @@ export async function setupShadcn(
|
|
17
14
|
|
18
15
|
// Install shadcn/ui dependencies
|
19
16
|
emitLog('Installing shadcn/ui dependencies...');
|
20
|
-
execSync('npm install @shadcn/ui
|
21
|
-
cwd: frontendDir,
|
22
|
-
stdio: 'inherit'
|
23
|
-
});
|
17
|
+
execSync('npm install @shadcn/ui', { cwd: projectDir });
|
24
18
|
|
25
19
|
// Create components.json configuration
|
26
20
|
const componentsConfig = {
|
@@ -66,7 +60,7 @@ export function cn(...inputs: ClassValue[]) {
|
|
66
60
|
|
67
61
|
emitLog('✅ shadcn/ui setup completed successfully!');
|
68
62
|
} catch (error) {
|
69
|
-
emitLog(
|
63
|
+
emitLog('Failed to setup shadcn/ui');
|
70
64
|
throw error;
|
71
65
|
}
|
72
66
|
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { execSync } from 'child_process';
|
2
|
+
import { writeFile } from 'fs/promises';
|
3
|
+
import { join } from 'path';
|
4
|
+
import { ProjectConfig } from '../../cli.js';
|
5
|
+
|
6
|
+
export async function setupTailwind(config: ProjectConfig, projectDir: string, emitLog: (message: string) => void) {
|
7
|
+
try {
|
8
|
+
emitLog('Installing Tailwind CSS...');
|
9
|
+
execSync('npm install -D tailwindcss postcss autoprefixer', { cwd: projectDir });
|
10
|
+
execSync('npx tailwindcss init -p', { cwd: projectDir });
|
11
|
+
|
12
|
+
// Add Tailwind configuration
|
13
|
+
const tailwindConfig = `
|
14
|
+
module.exports = {
|
15
|
+
content: [
|
16
|
+
"./src/**/*.{js,jsx,ts,tsx}",
|
17
|
+
],
|
18
|
+
theme: {
|
19
|
+
extend: {},
|
20
|
+
},
|
21
|
+
plugins: [],
|
22
|
+
}`;
|
23
|
+
|
24
|
+
await writeFile(join(projectDir, 'tailwind.config.js'), tailwindConfig);
|
25
|
+
|
26
|
+
// Add Tailwind directives to CSS
|
27
|
+
const cssContent = `
|
28
|
+
@tailwind base;
|
29
|
+
@tailwind components;
|
30
|
+
@tailwind utilities;`;
|
31
|
+
|
32
|
+
await writeFile(join(projectDir, 'src/index.css'), cssContent);
|
33
|
+
|
34
|
+
emitLog('Tailwind CSS setup completed');
|
35
|
+
} catch (error) {
|
36
|
+
emitLog('Failed to setup Tailwind CSS');
|
37
|
+
throw error;
|
38
|
+
}
|
39
|
+
}
|
@@ -49,7 +49,7 @@ const Navbar = () => (
|
|
49
49
|
</div>
|
50
50
|
|
51
51
|
<a
|
52
|
-
href="https://github.com/
|
52
|
+
href="https://github.com/shivasankaran18/STACKD"
|
53
53
|
target="_blank"
|
54
54
|
rel="noopener noreferrer"
|
55
55
|
className="absolute right-8 text-muted-foreground hover:text-foreground"
|
package/apps/web/package.json
CHANGED
package/apps/web/tsconfig.json
CHANGED
@@ -1,23 +1,111 @@
|
|
1
1
|
{
|
2
|
-
"extends": "@repo/typescript-config/nextjs.json",
|
3
2
|
"compilerOptions": {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
"
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
"
|
16
|
-
"
|
17
|
-
"
|
18
|
-
".
|
19
|
-
|
20
|
-
|
21
|
-
"
|
22
|
-
|
3
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
4
|
+
|
5
|
+
/* Projects */
|
6
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
8
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
12
|
+
|
13
|
+
/* Language and Environment */
|
14
|
+
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
15
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
16
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
17
|
+
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
18
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
19
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
20
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
21
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
22
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
23
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
24
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
25
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
26
|
+
|
27
|
+
/* Modules */
|
28
|
+
"module": "NodeNext", /* Specify what module code is generated. */
|
29
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
30
|
+
"moduleResolution": "NodeNext", /* Specify how TypeScript looks up a file from a given module specifier. */
|
31
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
32
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
33
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
34
|
+
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
35
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
36
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
37
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
38
|
+
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
39
|
+
// "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
|
40
|
+
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
41
|
+
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
42
|
+
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
43
|
+
// "noUncheckedSideEffectImports": true, /* Check side effect imports. */
|
44
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
45
|
+
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
46
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
47
|
+
|
48
|
+
/* JavaScript Support */
|
49
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
50
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
51
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
52
|
+
|
53
|
+
/* Emit */
|
54
|
+
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
55
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
56
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
57
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
58
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
59
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
60
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
61
|
+
"outDir": "./dist", /* Specify an output folder for all emitted files. */
|
62
|
+
// "removeComments": true, /* Disable emitting comments. */
|
63
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
64
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
65
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
66
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
67
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
68
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
69
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
70
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
71
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
72
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
73
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
74
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
75
|
+
|
76
|
+
/* Interop Constraints */
|
77
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
78
|
+
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
79
|
+
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
|
80
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
81
|
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
82
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
83
|
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
84
|
+
|
85
|
+
/* Type Checking */
|
86
|
+
"strict": true, /* Enable all strict type-checking options. */
|
87
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
88
|
+
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
89
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
90
|
+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
91
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
92
|
+
// "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
|
93
|
+
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
94
|
+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
95
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
96
|
+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
97
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
98
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
99
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
100
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
101
|
+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
102
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
103
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
104
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
105
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
106
|
+
|
107
|
+
/* Completeness */
|
108
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
109
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
110
|
+
}
|
23
111
|
}
|
package/package.json
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@shivasankaran18/stackd",
|
3
|
-
"version": "
|
3
|
+
"version": "2.0.1",
|
4
4
|
"bin": {
|
5
5
|
"stackd": "stackd.ts",
|
6
6
|
"pre-install": "npm install"
|
7
7
|
},
|
8
|
-
"main": "dist/stackd.js",
|
9
8
|
"type": "module",
|
10
9
|
"scripts": {
|
11
10
|
"build": "turbo run build",
|
@@ -13,7 +12,6 @@
|
|
13
12
|
"lint": "turbo run lint",
|
14
13
|
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
15
14
|
"check-types": "turbo run check-types",
|
16
|
-
"prepare": "husky install",
|
17
15
|
"setup": "sh start-web.sh",
|
18
16
|
"@types/node": "^22.13.5",
|
19
17
|
"chalk": "4",
|
@@ -24,7 +22,7 @@
|
|
24
22
|
"ora": "^8.2.0",
|
25
23
|
"path": "^0.12.7",
|
26
24
|
"ts-node": "^10.9.2",
|
27
|
-
"create":"tsx ./stackd.ts init"
|
25
|
+
"create": "tsx ./stackd.ts init"
|
28
26
|
},
|
29
27
|
"devDependencies": {
|
30
28
|
"@types/chalk": "^2.2.4",
|
@@ -46,42 +44,42 @@
|
|
46
44
|
],
|
47
45
|
"dependencies": {
|
48
46
|
"@octokit/rest": "^21.1.1",
|
49
|
-
"chalk": "^4.1.2",
|
50
|
-
"framer-motion": "^12.4.7",
|
51
|
-
"fs": "^0.0.1-security",
|
52
|
-
"simple-git": "^3.27.0",
|
53
|
-
"ts-node": "^10.9.2",
|
54
|
-
"tsx": "^4.19.3",
|
55
|
-
"@types/chalk": "^2.2.4",
|
56
|
-
"@types/commander": "^2.12.5",
|
57
|
-
"@types/node": "^22.13.5",
|
58
|
-
"commander": "^13.1.0",
|
59
|
-
"gradient-string": "^3.0.0",
|
60
|
-
"inquirer": "^12.4.2",
|
61
|
-
"ora": "^8.2.0",
|
62
|
-
|
63
47
|
"@radix-ui/react-dropdown-menu": "^2.1.6",
|
64
48
|
"@radix-ui/react-label": "^2.1.2",
|
65
49
|
"@radix-ui/react-scroll-area": "^1.2.3",
|
66
50
|
"@radix-ui/react-slot": "^1.1.2",
|
67
51
|
"@radix-ui/react-switch": "^1.1.3",
|
52
|
+
"@types/chalk": "^2.2.4",
|
53
|
+
"@types/commander": "^2.12.5",
|
54
|
+
"@types/node": "^22.13.5",
|
55
|
+
"@types/react": "^19.0.10",
|
68
56
|
"axios": "^1.7.9",
|
57
|
+
"chalk": "^4.1.2",
|
69
58
|
"class-variance-authority": "^0.7.1",
|
70
59
|
"clsx": "^2.1.1",
|
60
|
+
"commander": "^13.1.0",
|
71
61
|
"d3": "^7.9.0",
|
72
62
|
"date-fns": "^4.1.0",
|
73
|
-
|
63
|
+
"dotenv": "^16.4.7",
|
64
|
+
"framer-motion": "^12.4.7",
|
65
|
+
"fs": "^0.0.1-security",
|
66
|
+
"gradient-string": "^3.0.0",
|
67
|
+
"inquirer": "^12.4.2",
|
74
68
|
"lucide-react": "^0.475.0",
|
75
69
|
"next": "^15.1.6",
|
76
70
|
"next-auth": "^4.24.11",
|
77
71
|
"next-themes": "^0.4.4",
|
72
|
+
"ora": "^8.2.0",
|
78
73
|
"path": "^0.12.7",
|
79
74
|
"prisma": "^6.4.0",
|
80
75
|
"react": "^19.0.0",
|
81
76
|
"react-dom": "^19.0.0",
|
82
77
|
"redis": "^4.7.0",
|
78
|
+
"simple-git": "^3.27.0",
|
83
79
|
"sonner": "^2.0.1",
|
84
80
|
"tailwind-merge": "^3.0.1",
|
85
|
-
"tailwindcss-animate": "^1.0.7"
|
81
|
+
"tailwindcss-animate": "^1.0.7",
|
82
|
+
"ts-node": "^10.9.2",
|
83
|
+
"tsx": "^4.19.3"
|
86
84
|
}
|
87
85
|
}
|
package/dist/apps/cli/src/cli.js
DELETED
@@ -1,217 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
import { program } from 'commander';
|
3
|
-
import inquirer from 'inquirer';
|
4
|
-
import chalk from 'chalk';
|
5
|
-
import { createProject } from './commands/create.js';
|
6
|
-
const showBanner = () => {
|
7
|
-
console.log(chalk.cyan(`
|
8
|
-
██████╗████████╗ █████╗ ██████╗██╗ ██╗'██████╗
|
9
|
-
██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝██╔══██╗
|
10
|
-
╚█████╗ ██║ ███████║██║ █████═╝ ██║ ██║
|
11
|
-
╚═══██╗ ██║ ██╔══██║██║ ██╔═██╗ ██║ ██║
|
12
|
-
██████╔╝ ██║ ██║ ██║╚██████╗██║ ██╗██████╔╝
|
13
|
-
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═════╝
|
14
|
-
`));
|
15
|
-
console.log(chalk.yellow.bold(' 🚀 Full Stack Project Generator\n'));
|
16
|
-
};
|
17
|
-
const createBorder = () => {
|
18
|
-
const border = '='.repeat(60);
|
19
|
-
return chalk.cyan(border);
|
20
|
-
};
|
21
|
-
const CHOICES = {
|
22
|
-
EXPRESS_TS: 'Express + TypeScript',
|
23
|
-
EXPRESS_JS: 'Express (JavaScript)',
|
24
|
-
DJANGO: 'Django',
|
25
|
-
REACT_TS: 'React + TypeScript',
|
26
|
-
REACT_JS: 'React (JavaScript)',
|
27
|
-
VUE_TS: 'Vue + TypeScript',
|
28
|
-
VUE_JS: 'Vue (JavaScript)',
|
29
|
-
DJANGO_TEMPLATES: 'Django Templates',
|
30
|
-
NONE: 'None',
|
31
|
-
SKIP: 'Skip',
|
32
|
-
POSTGRESQL: 'PostgreSQL',
|
33
|
-
MONGODB: 'MongoDB',
|
34
|
-
PRISMA: 'Prisma',
|
35
|
-
DRIZZLE: 'Drizzle',
|
36
|
-
MONGOOSE: 'Mongoose',
|
37
|
-
JWT: 'JWT',
|
38
|
-
NEXTAUTH: 'NextAuth',
|
39
|
-
PASSPORT: 'Passport'
|
40
|
-
};
|
41
|
-
program
|
42
|
-
.command('run ')
|
43
|
-
.description('Create a new full-stack project')
|
44
|
-
.action(async () => {
|
45
|
-
// showBanner();
|
46
|
-
// console.log(createBorder());
|
47
|
-
// console.log(chalk.bgCyan.white.bold('\n 💫 Let\'s create something awesome! \n'));
|
48
|
-
// console.log(createBorder() + '\n');
|
49
|
-
const projectSettings = await inquirer.prompt([
|
50
|
-
{
|
51
|
-
type: 'input',
|
52
|
-
name: 'projectPath',
|
53
|
-
message: chalk.magenta.bold('📁 Where do you want to create the project?'),
|
54
|
-
},
|
55
|
-
{
|
56
|
-
type: 'input',
|
57
|
-
name: 'projectName',
|
58
|
-
message: chalk.magenta.bold('💫 Enter the project name:'),
|
59
|
-
},
|
60
|
-
{
|
61
|
-
type: 'number',
|
62
|
-
name: 'frontendPort',
|
63
|
-
message: chalk.blue.bold('🌐 Enter frontend port:'),
|
64
|
-
default: 3000,
|
65
|
-
},
|
66
|
-
{
|
67
|
-
type: 'number',
|
68
|
-
name: 'backendPort',
|
69
|
-
message: chalk.green.bold('⚙️ Enter backend port:'),
|
70
|
-
default: 3001,
|
71
|
-
}
|
72
|
-
]);
|
73
|
-
const frontendChoice = await inquirer.prompt([
|
74
|
-
{
|
75
|
-
type: 'list',
|
76
|
-
name: 'frontend',
|
77
|
-
message: chalk.yellow.bold('🎨 Choose a frontend framework:'),
|
78
|
-
choices: [
|
79
|
-
chalk.blue(CHOICES.REACT_TS),
|
80
|
-
chalk.blue(CHOICES.REACT_JS),
|
81
|
-
chalk.green(CHOICES.VUE_TS),
|
82
|
-
chalk.green(CHOICES.VUE_JS),
|
83
|
-
chalk.green(CHOICES.DJANGO_TEMPLATES),
|
84
|
-
CHOICES.SKIP
|
85
|
-
],
|
86
|
-
default: CHOICES.SKIP,
|
87
|
-
}
|
88
|
-
]);
|
89
|
-
const backendChoice = await inquirer.prompt([
|
90
|
-
{
|
91
|
-
type: 'list',
|
92
|
-
name: 'backend',
|
93
|
-
message: chalk.cyan.bold('🛠️ Choose a backend framework:'),
|
94
|
-
choices: (answers) => {
|
95
|
-
if (frontendChoice.frontend === chalk.green(CHOICES.DJANGO_TEMPLATES)) {
|
96
|
-
return [chalk.green(CHOICES.DJANGO)];
|
97
|
-
}
|
98
|
-
return [
|
99
|
-
chalk.blue(CHOICES.EXPRESS_TS),
|
100
|
-
chalk.blue(CHOICES.EXPRESS_JS),
|
101
|
-
chalk.green(CHOICES.DJANGO),
|
102
|
-
CHOICES.SKIP
|
103
|
-
];
|
104
|
-
},
|
105
|
-
default: chalk.blue(CHOICES.EXPRESS_TS),
|
106
|
-
}
|
107
|
-
]);
|
108
|
-
const databaseChoice = await inquirer.prompt([
|
109
|
-
{
|
110
|
-
type: 'list',
|
111
|
-
name: 'database',
|
112
|
-
message: chalk.magenta.bold('🗄️ Choose a database:'),
|
113
|
-
choices: [
|
114
|
-
chalk.blue(CHOICES.POSTGRESQL),
|
115
|
-
chalk.green(CHOICES.MONGODB),
|
116
|
-
CHOICES.SKIP
|
117
|
-
],
|
118
|
-
default: CHOICES.SKIP,
|
119
|
-
}
|
120
|
-
]);
|
121
|
-
let ormChoice = { orm: CHOICES.SKIP };
|
122
|
-
if (databaseChoice.database !== CHOICES.SKIP) {
|
123
|
-
ormChoice = await inquirer.prompt([
|
124
|
-
{
|
125
|
-
type: 'list',
|
126
|
-
name: 'orm',
|
127
|
-
message: chalk.yellow.bold('🔗 Choose an ORM:'),
|
128
|
-
choices: () => {
|
129
|
-
const cleanDatabase = databaseChoice.database.replace(/\u001b\[\d+m/g, '').trim();
|
130
|
-
return cleanDatabase === CHOICES.POSTGRESQL
|
131
|
-
? [chalk.magenta(CHOICES.PRISMA), chalk.cyan(CHOICES.DRIZZLE), CHOICES.SKIP]
|
132
|
-
: [chalk.green(CHOICES.MONGOOSE), CHOICES.SKIP];
|
133
|
-
},
|
134
|
-
default: CHOICES.SKIP,
|
135
|
-
}
|
136
|
-
]);
|
137
|
-
}
|
138
|
-
// Step 6: Authentication Selection
|
139
|
-
const authChoice = await inquirer.prompt([
|
140
|
-
{
|
141
|
-
type: 'list',
|
142
|
-
name: 'auth',
|
143
|
-
message: chalk.cyan.bold('🔐 Choose an authentication method:'),
|
144
|
-
choices: [
|
145
|
-
chalk.yellow(CHOICES.JWT),
|
146
|
-
chalk.blue(CHOICES.NEXTAUTH),
|
147
|
-
chalk.green(CHOICES.PASSPORT),
|
148
|
-
CHOICES.SKIP
|
149
|
-
],
|
150
|
-
default: CHOICES.SKIP,
|
151
|
-
}
|
152
|
-
]);
|
153
|
-
let dbUrlChoice = { dbUrl: '' };
|
154
|
-
if (databaseChoice.database !== CHOICES.SKIP) {
|
155
|
-
dbUrlChoice = await inquirer.prompt([
|
156
|
-
{
|
157
|
-
type: 'input',
|
158
|
-
name: 'dbUrl',
|
159
|
-
message: chalk.green.bold('🔌 Enter database connection URL:'),
|
160
|
-
}
|
161
|
-
]);
|
162
|
-
}
|
163
|
-
const answers = {
|
164
|
-
...projectSettings,
|
165
|
-
...frontendChoice,
|
166
|
-
...backendChoice,
|
167
|
-
...databaseChoice,
|
168
|
-
...ormChoice,
|
169
|
-
...authChoice,
|
170
|
-
...dbUrlChoice,
|
171
|
-
};
|
172
|
-
const cleanAnswers = Object.entries(answers).reduce((acc, [key, value]) => {
|
173
|
-
if (typeof value === 'string') {
|
174
|
-
const cleanValue = value.replace(/\u001b\[\d+m/g, '').trim();
|
175
|
-
// @ts-ignore
|
176
|
-
acc[key] = cleanValue;
|
177
|
-
}
|
178
|
-
else {
|
179
|
-
// @ts-ignore
|
180
|
-
acc[key] = value;
|
181
|
-
}
|
182
|
-
return acc;
|
183
|
-
}, {});
|
184
|
-
// @ts-ignore
|
185
|
-
if (cleanAnswers.database !== 'Skip' && cleanAnswers.orm !== 'Skip') {
|
186
|
-
// @ts-ignore
|
187
|
-
if (cleanAnswers.database === 'MongoDB' && cleanAnswers.orm !== 'Mongoose') {
|
188
|
-
console.log('\n' + createBorder());
|
189
|
-
console.error(chalk.bgRed.white.bold(" ❌ Error: MongoDB supports only Mongoose ORM. "));
|
190
|
-
console.log(createBorder());
|
191
|
-
process.exit(1);
|
192
|
-
}
|
193
|
-
// @ts-ignore
|
194
|
-
if (cleanAnswers.database === 'PostgreSQL' && !['Prisma', 'Drizzle'].includes(cleanAnswers.orm)) {
|
195
|
-
console.log('\n' + createBorder());
|
196
|
-
console.error(chalk.bgRed.white.bold(" ❌ Error: PostgreSQL supports only Prisma or Drizzle ORM. "));
|
197
|
-
console.log(createBorder());
|
198
|
-
process.exit(1);
|
199
|
-
}
|
200
|
-
}
|
201
|
-
// @ts-ignore
|
202
|
-
if (cleanAnswers.frontend === 'Django Templates') {
|
203
|
-
// @ts-ignore
|
204
|
-
cleanAnswers.backend = 'Django';
|
205
|
-
}
|
206
|
-
// @ts-ignore
|
207
|
-
if (cleanAnswers.backend === 'Django') {
|
208
|
-
// @ts-ignore
|
209
|
-
cleanAnswers.frontend = 'Django Templates';
|
210
|
-
}
|
211
|
-
console.log('\n' + createBorder());
|
212
|
-
console.log(chalk.bgGreen.black.bold("\n 📦 Creating your project... \n"));
|
213
|
-
console.log(createBorder() + '\n');
|
214
|
-
// @ts-ignore
|
215
|
-
await createProject(projectSettings.projectName, cleanAnswers);
|
216
|
-
});
|
217
|
-
program.parse(process.argv);
|