@shivasankaran18/stackd 2.0.2 ā 13.0.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.
- package/README.md +12 -7
- package/apps/cli/src/cli.ts +2 -28
- package/apps/cli/src/commands/create.ts +0 -30
- package/apps/cli/src/generators/auth/jwt.js +83 -0
- package/apps/cli/src/generators/auth/nextAuth.js +146 -0
- package/apps/cli/src/generators/auth/passport.js +234 -0
- package/apps/cli/src/generators/backend/django.js +30 -0
- package/apps/cli/src/generators/backend/expressjs.js +72 -0
- package/apps/cli/src/generators/backend/expressts.js +95 -0
- package/apps/cli/src/generators/frontend/angularts.js +29 -0
- package/apps/cli/src/generators/frontend/reactjs.js +42 -0
- package/apps/cli/src/generators/frontend/reactts.d.ts +13 -0
- package/apps/cli/src/generators/frontend/reactts.js +40 -0
- package/apps/cli/src/generators/frontend/vuejs.js +43 -0
- package/apps/cli/src/generators/frontend/vuets.js +53 -0
- package/apps/cli/src/generators/orm/drizzleSetup.js +102 -0
- package/apps/cli/src/generators/orm/mongoSetup.js +68 -0
- package/apps/cli/src/generators/orm/prismaSetup.js +14 -0
- package/apps/cli/src/generators/ui/shadcn.js +228 -0
- package/apps/cli/src/generators/ui/tailwindcss.js +126 -0
- package/apps/cli/src/scripts/backend/expressts.ts +1 -1
- package/apps/cli/src/scripts/frontend/angularts.ts +4 -2
- package/apps/cli/src/scripts/frontend/reactjs.ts +3 -2
- package/apps/cli/src/scripts/frontend/reactts.ts +3 -2
- package/apps/cli/src/scripts/orms/prismaSetup.ts +2 -2
- package/apps/cli/src/scripts/ui/shadcn.ts +10 -4
- package/apps/web/app/api/scaffold/route.ts +7 -7
- package/apps/web/app/scaffold/page.tsx +1 -1
- package/apps/web/package.json +2 -1
- package/apps/web/tsconfig.json +23 -125
- package/package.json +3 -33
- package/packages/typescript-config/base.json +19 -0
- package/packages/typescript-config/nextjs.json +12 -0
- package/packages/typescript-config/package.json +9 -0
- package/packages/typescript-config/react-library.json +7 -0
- package/packages/ui/eslint.config.mjs +4 -0
- package/packages/ui/package.json +27 -0
- package/packages/ui/src/button.tsx +20 -0
- package/packages/ui/src/card.tsx +27 -0
- package/packages/ui/src/code.tsx +11 -0
- package/packages/ui/tsconfig.json +8 -0
- package/packages/ui/turbo/generators/config.ts +30 -0
- package/packages/ui/turbo/generators/templates/component.hbs +8 -0
- package/stackd.ts +16 -6
- package/apps/cli/src/scripts/ui/tailwind.ts +0 -39
package/apps/web/tsconfig.json
CHANGED
@@ -1,125 +1,23 @@
|
|
1
|
-
{
|
2
|
-
"
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
"module": "NodeNext", /* Specify what module code is generated. */// "rootDir": "./", /* Specify the root folder within your source files. */
|
25
|
-
"moduleResolution": "NodeNext", /* Specify how TypeScript looks up a file from a given module specifier. */// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
26
|
-
"paths": {
|
27
|
-
"@/*": ["./*"]
|
28
|
-
}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
29
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
30
|
-
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
31
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
32
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
33
|
-
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
34
|
-
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
35
|
-
// "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
|
36
|
-
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
37
|
-
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
38
|
-
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
39
|
-
// "noUncheckedSideEffectImports": true, /* Check side effect imports. */
|
40
|
-
// "resolveJsonModule": true, /* Enable importing .json files. */
|
41
|
-
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
42
|
-
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
43
|
-
/* JavaScript Support */
|
44
|
-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
45
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
46
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
47
|
-
/* Emit */
|
48
|
-
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
49
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
50
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
51
|
-
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
52
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
53
|
-
// "noEmit": true, /* Disable emitting files from a compilation. */
|
54
|
-
// "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. */
|
55
|
-
"outDir": "./dist", /* Specify an output folder for all emitted files. */// "removeComments": true, /* Disable emitting comments. */
|
56
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
57
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
58
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
59
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
60
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
61
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
62
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
63
|
-
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
64
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
65
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
66
|
-
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
67
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
68
|
-
/* Interop Constraints */
|
69
|
-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
70
|
-
// "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. */
|
71
|
-
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
|
72
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
73
|
-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
74
|
-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. *//* Type Checking */
|
75
|
-
"strict": true, /* Enable all strict type-checking options. */// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
76
|
-
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
77
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
78
|
-
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
79
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
80
|
-
// "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
|
81
|
-
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
82
|
-
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
83
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
84
|
-
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
85
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
86
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
87
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
88
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
89
|
-
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
90
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
91
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
92
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
93
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
94
|
-
/* Completeness */
|
95
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
96
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
|
97
|
-
"lib": [
|
98
|
-
"dom",
|
99
|
-
"dom.iterable",
|
100
|
-
"esnext"
|
101
|
-
],
|
102
|
-
"allowJs": true,
|
103
|
-
"noEmit": true,
|
104
|
-
"incremental": true,
|
105
|
-
"resolveJsonModule": true,
|
106
|
-
"isolatedModules": true,
|
107
|
-
"jsx": "preserve",
|
108
|
-
"plugins": [
|
109
|
-
{
|
110
|
-
"name": "next"
|
111
|
-
}
|
112
|
-
]
|
113
|
-
},
|
114
|
-
"include": [
|
115
|
-
"**/*.ts",
|
116
|
-
"**/*.tsx",
|
117
|
-
"next-env.d.ts",
|
118
|
-
"next.config.js",
|
119
|
-
".next/types/**/*.ts"
|
120
|
-
],
|
121
|
-
"exclude": [
|
122
|
-
"node_modules"
|
123
|
-
],
|
124
|
-
|
125
|
-
}
|
1
|
+
{
|
2
|
+
"extends": "@repo/typescript-config/nextjs.json",
|
3
|
+
"compilerOptions": {
|
4
|
+
"plugins": [
|
5
|
+
{
|
6
|
+
"name": "next"
|
7
|
+
}
|
8
|
+
],
|
9
|
+
"paths": {
|
10
|
+
"@/*": ["./*"]
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"include": [
|
14
|
+
"**/*.ts",
|
15
|
+
"**/*.tsx",
|
16
|
+
"next-env.d.ts",
|
17
|
+
"next.config.js",
|
18
|
+
".next/types/**/*.ts"
|
19
|
+
],
|
20
|
+
"exclude": [
|
21
|
+
"node_modules"
|
22
|
+
]
|
23
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@shivasankaran18/stackd",
|
3
|
-
"version": "
|
3
|
+
"version": "13.0.0",
|
4
4
|
"bin": {
|
5
5
|
"stackd": "stackd.ts",
|
6
6
|
"pre-install": "npm install"
|
@@ -12,6 +12,7 @@
|
|
12
12
|
"lint": "turbo run lint",
|
13
13
|
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
14
14
|
"check-types": "turbo run check-types",
|
15
|
+
"prepare": "husky install",
|
15
16
|
"setup": "sh start-web.sh",
|
16
17
|
"@types/node": "^22.13.5",
|
17
18
|
"chalk": "4",
|
@@ -22,7 +23,7 @@
|
|
22
23
|
"ora": "^8.2.0",
|
23
24
|
"path": "^0.12.7",
|
24
25
|
"ts-node": "^10.9.2",
|
25
|
-
"create":
|
26
|
+
"create":"tsx ./stackd.ts init"
|
26
27
|
},
|
27
28
|
"devDependencies": {
|
28
29
|
"@types/chalk": "^2.2.4",
|
@@ -44,41 +45,10 @@
|
|
44
45
|
],
|
45
46
|
"dependencies": {
|
46
47
|
"@octokit/rest": "^21.1.1",
|
47
|
-
"@radix-ui/react-dropdown-menu": "^2.1.6",
|
48
|
-
"@radix-ui/react-label": "^2.1.2",
|
49
|
-
"@radix-ui/react-scroll-area": "^1.2.3",
|
50
|
-
"@radix-ui/react-slot": "^1.1.2",
|
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",
|
56
|
-
"axios": "^1.7.9",
|
57
48
|
"chalk": "^4.1.2",
|
58
|
-
"class-variance-authority": "^0.7.1",
|
59
|
-
"clsx": "^2.1.1",
|
60
|
-
"commander": "^13.1.0",
|
61
|
-
"d3": "^7.9.0",
|
62
|
-
"date-fns": "^4.1.0",
|
63
|
-
"dotenv": "^16.4.7",
|
64
49
|
"framer-motion": "^12.4.7",
|
65
50
|
"fs": "^0.0.1-security",
|
66
|
-
"gradient-string": "^3.0.0",
|
67
|
-
"inquirer": "^12.4.2",
|
68
|
-
"lucide-react": "^0.475.0",
|
69
|
-
"next": "^15.1.6",
|
70
|
-
"next-auth": "^4.24.11",
|
71
|
-
"next-themes": "^0.4.4",
|
72
|
-
"ora": "^8.2.0",
|
73
|
-
"path": "^0.12.7",
|
74
|
-
"prisma": "^6.4.0",
|
75
|
-
"react": "^19.0.0",
|
76
|
-
"react-dom": "^19.0.0",
|
77
|
-
"redis": "^4.7.0",
|
78
51
|
"simple-git": "^3.27.0",
|
79
|
-
"sonner": "^2.0.1",
|
80
|
-
"tailwind-merge": "^3.0.1",
|
81
|
-
"tailwindcss-animate": "^1.0.7",
|
82
52
|
"ts-node": "^10.9.2",
|
83
53
|
"tsx": "^4.19.3"
|
84
54
|
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
3
|
+
"compilerOptions": {
|
4
|
+
"declaration": true,
|
5
|
+
"declarationMap": true,
|
6
|
+
"esModuleInterop": true,
|
7
|
+
"incremental": false,
|
8
|
+
"isolatedModules": true,
|
9
|
+
"lib": ["es2022", "DOM", "DOM.Iterable"],
|
10
|
+
"module": "NodeNext",
|
11
|
+
"moduleDetection": "force",
|
12
|
+
"moduleResolution": "NodeNext",
|
13
|
+
"noUncheckedIndexedAccess": true,
|
14
|
+
"resolveJsonModule": true,
|
15
|
+
"skipLibCheck": true,
|
16
|
+
"strict": true,
|
17
|
+
"target": "ES2022"
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
3
|
+
"extends": "./base.json",
|
4
|
+
"compilerOptions": {
|
5
|
+
"plugins": [{ "name": "next" }],
|
6
|
+
"module": "ESNext",
|
7
|
+
"moduleResolution": "Bundler",
|
8
|
+
"allowJs": true,
|
9
|
+
"jsx": "preserve",
|
10
|
+
"noEmit": true
|
11
|
+
}
|
12
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"name": "@repo/ui",
|
3
|
+
"version": "0.0.0",
|
4
|
+
"private": true,
|
5
|
+
"exports": {
|
6
|
+
"./*": "./src/*.tsx"
|
7
|
+
},
|
8
|
+
"scripts": {
|
9
|
+
"lint": "eslint . --max-warnings 0",
|
10
|
+
"generate:component": "turbo gen react-component",
|
11
|
+
"check-types": "tsc --noEmit"
|
12
|
+
},
|
13
|
+
"devDependencies": {
|
14
|
+
"@repo/eslint-config": "*",
|
15
|
+
"@repo/typescript-config": "*",
|
16
|
+
"@turbo/gen": "^2.4.0",
|
17
|
+
"@types/node": "^22.13.0",
|
18
|
+
"@types/react": "19.0.8",
|
19
|
+
"@types/react-dom": "19.0.3",
|
20
|
+
"eslint": "^9.20.0",
|
21
|
+
"typescript": "5.7.3"
|
22
|
+
},
|
23
|
+
"dependencies": {
|
24
|
+
"react": "^19.0.0",
|
25
|
+
"react-dom": "^19.0.0"
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use client";
|
2
|
+
|
3
|
+
import { ReactNode } from "react";
|
4
|
+
|
5
|
+
interface ButtonProps {
|
6
|
+
children: ReactNode;
|
7
|
+
className?: string;
|
8
|
+
appName: string;
|
9
|
+
}
|
10
|
+
|
11
|
+
export const Button = ({ children, className, appName }: ButtonProps) => {
|
12
|
+
return (
|
13
|
+
<button
|
14
|
+
className={className}
|
15
|
+
onClick={() => alert(`Hello from your ${appName} app!`)}
|
16
|
+
>
|
17
|
+
{children}
|
18
|
+
</button>
|
19
|
+
);
|
20
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { type JSX } from "react";
|
2
|
+
|
3
|
+
export function Card({
|
4
|
+
className,
|
5
|
+
title,
|
6
|
+
children,
|
7
|
+
href,
|
8
|
+
}: {
|
9
|
+
className?: string;
|
10
|
+
title: string;
|
11
|
+
children: React.ReactNode;
|
12
|
+
href: string;
|
13
|
+
}): JSX.Element {
|
14
|
+
return (
|
15
|
+
<a
|
16
|
+
className={className}
|
17
|
+
href={`${href}?utm_source=create-turbo&utm_medium=basic&utm_campaign=create-turbo"`}
|
18
|
+
rel="noopener noreferrer"
|
19
|
+
target="_blank"
|
20
|
+
>
|
21
|
+
<h2>
|
22
|
+
{title} <span>-></span>
|
23
|
+
</h2>
|
24
|
+
<p>{children}</p>
|
25
|
+
</a>
|
26
|
+
);
|
27
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import type { PlopTypes } from "@turbo/gen";
|
2
|
+
|
3
|
+
// Learn more about Turborepo Generators at https://turbo.build/repo/docs/core-concepts/monorepos/code-generation
|
4
|
+
|
5
|
+
export default function generator(plop: PlopTypes.NodePlopAPI): void {
|
6
|
+
// A simple generator to add a new React component to the internal UI library
|
7
|
+
plop.setGenerator("react-component", {
|
8
|
+
description: "Adds a new react component",
|
9
|
+
prompts: [
|
10
|
+
{
|
11
|
+
type: "input",
|
12
|
+
name: "name",
|
13
|
+
message: "What is the name of the component?",
|
14
|
+
},
|
15
|
+
],
|
16
|
+
actions: [
|
17
|
+
{
|
18
|
+
type: "add",
|
19
|
+
path: "src/{{kebabCase name}}.tsx",
|
20
|
+
templateFile: "templates/component.hbs",
|
21
|
+
},
|
22
|
+
{
|
23
|
+
type: "append",
|
24
|
+
path: "package.json",
|
25
|
+
pattern: /"exports": {(?<insertion>)/g,
|
26
|
+
template: ' "./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",',
|
27
|
+
},
|
28
|
+
],
|
29
|
+
});
|
30
|
+
}
|
package/stackd.ts
CHANGED
@@ -7,17 +7,19 @@ import { join, dirname } from 'path';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
8
8
|
import fs from 'fs';
|
9
9
|
|
10
|
+
// Handle path resolution for both ESM and CommonJS
|
10
11
|
const __filename = fileURLToPath(import.meta.url);
|
11
12
|
const __dirname = dirname(__filename);
|
12
13
|
|
13
|
-
|
14
|
+
// Get the package root directory
|
14
15
|
const getPackageRoot = () => {
|
16
|
+
// Navigate up from current file until we find package.json
|
15
17
|
let currentDir = __dirname;
|
16
18
|
while (!fs.existsSync(join(currentDir, 'package.json'))) {
|
17
19
|
const parentDir = dirname(currentDir);
|
18
20
|
if (parentDir === currentDir) {
|
19
|
-
|
20
|
-
return process.cwd();
|
21
|
+
// We've reached the filesystem root without finding package.json
|
22
|
+
return process.cwd(); // Fallback to current working directory
|
21
23
|
}
|
22
24
|
currentDir = parentDir;
|
23
25
|
}
|
@@ -50,16 +52,21 @@ const executeCommand = (command: string, cwd: string) => {
|
|
50
52
|
};
|
51
53
|
|
52
54
|
const getAppPath = (appName: string) => {
|
55
|
+
// First try the local development structure
|
53
56
|
const devPath = join(packageRoot, 'apps', appName);
|
57
|
+
|
58
|
+
// Check if directory exists in development structure
|
54
59
|
if (fs.existsSync(devPath)) {
|
55
60
|
return devPath;
|
56
61
|
}
|
57
62
|
|
58
|
-
|
63
|
+
// If not found, try the node_modules structure for published packages
|
64
|
+
const publishedPath = join(packageRoot, 'node_modules', '@stackd', appName);
|
59
65
|
if (fs.existsSync(publishedPath)) {
|
60
66
|
return publishedPath;
|
61
67
|
}
|
62
68
|
|
69
|
+
// Fallback to direct path
|
63
70
|
return join(packageRoot, appName);
|
64
71
|
};
|
65
72
|
|
@@ -83,19 +90,22 @@ const initializeProject = async () => {
|
|
83
90
|
if (answer.interface === 'cli') {
|
84
91
|
console.log(chalk.blue('\nš¦ Starting CLI interface...\n'));
|
85
92
|
|
93
|
+
// Get CLI app path
|
86
94
|
const cliAppPath = getAppPath('cli');
|
87
95
|
const cliScriptPath = join(cliAppPath, 'src', 'cli.ts');
|
88
|
-
|
96
|
+
|
97
|
+
// Check if the script exists
|
89
98
|
if (!fs.existsSync(cliScriptPath)) {
|
90
99
|
console.log(chalk.yellow(`\nCLI script not found at ${cliScriptPath}. Trying alternative paths...\n`));
|
91
100
|
|
101
|
+
// Try to find the CLI script in node_modules
|
92
102
|
const command = 'npx tsx @stackd/cli/src/cli.ts run';
|
93
103
|
executeCommand(command, process.cwd());
|
94
104
|
} else {
|
95
|
-
console.log("hello");
|
96
105
|
executeCommand(`npx tsx ${cliScriptPath} run`, process.cwd());
|
97
106
|
}
|
98
107
|
} else {
|
108
|
+
// Get Web app path
|
99
109
|
const webAppPath = getAppPath('web');
|
100
110
|
|
101
111
|
console.log(chalk.green(`\nš Setting up Web Interface at ${webAppPath}...\n`));
|
@@ -1,39 +0,0 @@
|
|
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
|
-
}
|