@opensaas/stack-cli 0.1.1 → 0.1.3
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +15 -0
- package/README.md +65 -5
- package/dist/commands/init.d.ts +9 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +27 -338
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/commands/init.ts +28 -361
- package/src/index.ts +8 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/src/commands/init.test.ts +0 -308
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @opensaas/stack-cli
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @opensaas/stack-core@0.1.3
|
|
8
|
+
- @opensaas/stack-mcp@0.1.3
|
|
9
|
+
|
|
10
|
+
## 0.1.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 7bb96e6: Fix up init command to work
|
|
15
|
+
- @opensaas/stack-core@0.1.2
|
|
16
|
+
- @opensaas/stack-mcp@0.1.2
|
|
17
|
+
|
|
3
18
|
## 0.1.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -98,18 +98,78 @@ Config changed, regenerating...
|
|
|
98
98
|
}
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
### `opensaas init`
|
|
101
|
+
### `opensaas init`
|
|
102
102
|
|
|
103
|
-
Create a new OpenSaas project
|
|
103
|
+
Create a new OpenSaas Stack project.
|
|
104
|
+
|
|
105
|
+
**Note:** This command delegates to `create-opensaas-app` for scaffolding. It's kept for backwards compatibility.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npx @opensaas/stack-cli init my-project
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Recommended:** Use `npm create opensaas-app` instead:
|
|
104
112
|
|
|
105
113
|
```bash
|
|
106
|
-
opensaas
|
|
107
|
-
|
|
114
|
+
npm create opensaas-app@latest my-project
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Options:**
|
|
118
|
+
|
|
119
|
+
- `project-name` - Name of your project (lowercase, numbers, hyphens only)
|
|
120
|
+
- `--with-auth` - Include Better-auth integration
|
|
121
|
+
|
|
122
|
+
**Examples:**
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Basic project
|
|
126
|
+
npx @opensaas/stack-cli init my-app
|
|
127
|
+
|
|
128
|
+
# With authentication
|
|
129
|
+
npx @opensaas/stack-cli init my-app --with-auth
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**What happens:**
|
|
133
|
+
|
|
134
|
+
This command runs `npx create-opensaas-app@latest` with the provided arguments. See the [create-opensaas-app package](../create-opensaas-app) for full details.
|
|
135
|
+
|
|
136
|
+
**After init:**
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
cd my-project
|
|
140
|
+
pnpm install
|
|
141
|
+
pnpm generate # Generate Prisma schema and types
|
|
142
|
+
pnpm db:push # Create database
|
|
143
|
+
pnpm dev # Start dev server
|
|
108
144
|
```
|
|
109
145
|
|
|
110
146
|
## Usage in Projects
|
|
111
147
|
|
|
112
|
-
###
|
|
148
|
+
### Quick Start (New Projects)
|
|
149
|
+
|
|
150
|
+
**Recommended:** Use `create-opensaas-app`:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
npm create opensaas-app@latest my-project
|
|
154
|
+
cd my-project
|
|
155
|
+
pnpm install
|
|
156
|
+
pnpm generate
|
|
157
|
+
pnpm db:push
|
|
158
|
+
pnpm dev
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Alternative:** Via CLI package:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
npx @opensaas/stack-cli init my-project
|
|
165
|
+
cd my-project
|
|
166
|
+
pnpm install
|
|
167
|
+
pnpm generate
|
|
168
|
+
pnpm db:push
|
|
169
|
+
pnpm dev
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Manual Setup (Existing Projects)
|
|
113
173
|
|
|
114
174
|
```bash
|
|
115
175
|
# Install CLI
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Initialize a new OpenSaas Stack project.
|
|
3
|
+
*
|
|
4
|
+
* This command delegates to create-opensaas-app for the actual scaffolding.
|
|
5
|
+
* It's kept here for backwards compatibility with `opensaas init`.
|
|
6
|
+
*
|
|
7
|
+
* @param args - Command line arguments (project name and flags)
|
|
8
|
+
*/
|
|
9
|
+
export declare function initCommand(args: string[]): Promise<void>;
|
|
2
10
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,iBAsB/C"}
|
package/dist/commands/init.js
CHANGED
|
@@ -1,343 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as fs from 'fs';
|
|
1
|
+
import { spawn } from 'child_process';
|
|
3
2
|
import chalk from 'chalk';
|
|
4
|
-
import ora from 'ora';
|
|
5
|
-
import prompts from 'prompts';
|
|
6
|
-
export async function initCommand(projectName) {
|
|
7
|
-
console.log(chalk.bold.cyan('\n🚀 Create OpenSaas Project\n'));
|
|
8
|
-
// Prompt for project name if not provided
|
|
9
|
-
if (!projectName) {
|
|
10
|
-
const response = await prompts({
|
|
11
|
-
type: 'text',
|
|
12
|
-
name: 'name',
|
|
13
|
-
message: 'Project name:',
|
|
14
|
-
initial: 'my-opensaas-app',
|
|
15
|
-
validate: (value) => {
|
|
16
|
-
if (!value)
|
|
17
|
-
return 'Project name is required';
|
|
18
|
-
if (!/^[a-z0-9-]+$/.test(value)) {
|
|
19
|
-
return 'Project name must contain only lowercase letters, numbers, and hyphens';
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
if (!response.name) {
|
|
25
|
-
console.log(chalk.yellow('\n❌ Cancelled'));
|
|
26
|
-
process.exit(0);
|
|
27
|
-
}
|
|
28
|
-
projectName = response.name;
|
|
29
|
-
}
|
|
30
|
-
// Type guard to ensure projectName is defined
|
|
31
|
-
if (!projectName) {
|
|
32
|
-
console.error(chalk.red('\n❌ Project name is required'));
|
|
33
|
-
process.exit(1);
|
|
34
|
-
}
|
|
35
|
-
const projectPath = path.join(process.cwd(), projectName);
|
|
36
|
-
// Check if directory already exists
|
|
37
|
-
if (fs.existsSync(projectPath)) {
|
|
38
|
-
console.error(chalk.red(`\n❌ Directory "${projectName}" already exists`));
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
const spinner = ora('Creating project structure...').start();
|
|
42
|
-
try {
|
|
43
|
-
// Create project directory
|
|
44
|
-
fs.mkdirSync(projectPath, { recursive: true });
|
|
45
|
-
// Create basic structure
|
|
46
|
-
fs.mkdirSync(path.join(projectPath, 'app'), { recursive: true });
|
|
47
|
-
fs.mkdirSync(path.join(projectPath, 'lib'), { recursive: true });
|
|
48
|
-
fs.mkdirSync(path.join(projectPath, 'prisma'), { recursive: true });
|
|
49
|
-
spinner.text = 'Writing configuration files...';
|
|
50
|
-
// Create package.json
|
|
51
|
-
const packageJson = {
|
|
52
|
-
name: projectName,
|
|
53
|
-
version: '0.1.0',
|
|
54
|
-
private: true,
|
|
55
|
-
scripts: {
|
|
56
|
-
dev: 'next dev',
|
|
57
|
-
build: 'next build',
|
|
58
|
-
start: 'next start',
|
|
59
|
-
generate: 'opensaas generate',
|
|
60
|
-
'db:push': 'prisma db push',
|
|
61
|
-
'db:studio': 'prisma studio',
|
|
62
|
-
},
|
|
63
|
-
dependencies: {
|
|
64
|
-
'@opensaas/stack-core': '^0.1.0',
|
|
65
|
-
'@prisma/client': '^5.7.1',
|
|
66
|
-
next: '^14.0.4',
|
|
67
|
-
react: '^18.2.0',
|
|
68
|
-
'react-dom': '^18.2.0',
|
|
69
|
-
},
|
|
70
|
-
devDependencies: {
|
|
71
|
-
'@opensaas/stack-cli': '^0.1.0',
|
|
72
|
-
'@types/node': '^20.10.0',
|
|
73
|
-
'@types/react': '^19.2.2',
|
|
74
|
-
'@types/react-dom': '^19.2.2',
|
|
75
|
-
prisma: '^5.7.1',
|
|
76
|
-
tsx: '^4.7.0',
|
|
77
|
-
typescript: '^5.3.3',
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
fs.writeFileSync(path.join(projectPath, 'package.json'), JSON.stringify(packageJson, null, 2));
|
|
81
|
-
// Create tsconfig.json
|
|
82
|
-
const tsConfig = {
|
|
83
|
-
compilerOptions: {
|
|
84
|
-
target: 'ES2022',
|
|
85
|
-
lib: ['dom', 'dom.iterable', 'esnext'],
|
|
86
|
-
allowJs: true,
|
|
87
|
-
skipLibCheck: true,
|
|
88
|
-
strict: true,
|
|
89
|
-
noEmit: true,
|
|
90
|
-
esModuleInterop: true,
|
|
91
|
-
module: 'esnext',
|
|
92
|
-
moduleResolution: 'bundler',
|
|
93
|
-
resolveJsonModule: true,
|
|
94
|
-
isolatedModules: true,
|
|
95
|
-
jsx: 'preserve',
|
|
96
|
-
incremental: true,
|
|
97
|
-
plugins: [{ name: 'next' }],
|
|
98
|
-
paths: {
|
|
99
|
-
'@/*': ['./*'],
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
include: ['next-env.d.ts', '**/*.ts', '**/*.tsx', '.next/types/**/*.ts'],
|
|
103
|
-
exclude: ['node_modules'],
|
|
104
|
-
};
|
|
105
|
-
fs.writeFileSync(path.join(projectPath, 'tsconfig.json'), JSON.stringify(tsConfig, null, 2));
|
|
106
|
-
// Create next.config.js
|
|
107
|
-
const nextConfig = `/** @type {import('next').NextConfig} */
|
|
108
|
-
const nextConfig = {
|
|
109
|
-
experimental: {
|
|
110
|
-
serverComponentsExternalPackages: ['@prisma/client', '@opensaas/stack-core'],
|
|
111
|
-
},
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
module.exports = nextConfig
|
|
115
|
-
`;
|
|
116
|
-
fs.writeFileSync(path.join(projectPath, 'next.config.js'), nextConfig);
|
|
117
|
-
// Create .env
|
|
118
|
-
const env = `DATABASE_URL="file:./dev.db"
|
|
119
|
-
`;
|
|
120
|
-
fs.writeFileSync(path.join(projectPath, '.env'), env);
|
|
121
|
-
// Create .gitignore
|
|
122
|
-
const gitignore = `# Dependencies
|
|
123
|
-
node_modules
|
|
124
|
-
.pnp
|
|
125
|
-
.pnp.js
|
|
126
|
-
|
|
127
|
-
# Testing
|
|
128
|
-
coverage
|
|
129
|
-
|
|
130
|
-
# Next.js
|
|
131
|
-
.next
|
|
132
|
-
out
|
|
133
|
-
|
|
134
|
-
# Production
|
|
135
|
-
build
|
|
136
|
-
dist
|
|
137
|
-
|
|
138
|
-
# Misc
|
|
139
|
-
.DS_Store
|
|
140
|
-
*.pem
|
|
141
|
-
|
|
142
|
-
# Debug
|
|
143
|
-
npm-debug.log*
|
|
144
|
-
yarn-debug.log*
|
|
145
|
-
yarn-error.log*
|
|
146
|
-
|
|
147
|
-
# Local env files
|
|
148
|
-
.env
|
|
149
|
-
.env.local
|
|
150
|
-
.env.development.local
|
|
151
|
-
.env.test.local
|
|
152
|
-
.env.production.local
|
|
153
|
-
|
|
154
|
-
# Vercel
|
|
155
|
-
.vercel
|
|
156
|
-
|
|
157
|
-
# TypeScript
|
|
158
|
-
*.tsbuildinfo
|
|
159
|
-
|
|
160
|
-
# OpenSaas generated
|
|
161
|
-
.opensaas
|
|
162
|
-
|
|
163
|
-
# Prisma
|
|
164
|
-
prisma/dev.db
|
|
165
|
-
prisma/dev.db-journal
|
|
166
|
-
`;
|
|
167
|
-
fs.writeFileSync(path.join(projectPath, '.gitignore'), gitignore);
|
|
168
|
-
// Create opensaas.config.ts
|
|
169
|
-
const config = `import { config, list } from '@opensaas/stack-core'
|
|
170
|
-
import { text, relationship, password } from '@opensaas/stack-core/fields'
|
|
171
|
-
import type { AccessControl } from '@opensaas/stack-core'
|
|
172
|
-
|
|
173
|
-
// Access control helpers
|
|
174
|
-
const isSignedIn: AccessControl = ({ session }) => {
|
|
175
|
-
return !!session
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export default config({
|
|
179
|
-
db: {
|
|
180
|
-
provider: 'sqlite',
|
|
181
|
-
url: process.env.DATABASE_URL || 'file:./dev.db',
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
lists: {
|
|
185
|
-
User: list({
|
|
186
|
-
fields: {
|
|
187
|
-
name: text({ validation: { isRequired: true } }),
|
|
188
|
-
email: text({
|
|
189
|
-
validation: { isRequired: true },
|
|
190
|
-
isIndexed: 'unique',
|
|
191
|
-
}),
|
|
192
|
-
password: password({ validation: { isRequired: true } }),
|
|
193
|
-
},
|
|
194
|
-
}),
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
session: {
|
|
198
|
-
getSession: async () => {
|
|
199
|
-
// TODO: Integrate with your auth system
|
|
200
|
-
return null
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
|
|
204
|
-
ui: {
|
|
205
|
-
basePath: '/admin',
|
|
206
|
-
}
|
|
207
|
-
})
|
|
208
|
-
`;
|
|
209
|
-
fs.writeFileSync(path.join(projectPath, 'opensaas.config.ts'), config);
|
|
210
|
-
// Create lib/context.ts
|
|
211
|
-
const contextFile = `import { PrismaClient } from '@prisma/client'
|
|
212
|
-
import { getContext as createContext } from '@opensaas/stack-core'
|
|
213
|
-
import config from '../opensaas.config'
|
|
214
|
-
import type { Context } from '../.opensaas/types'
|
|
215
|
-
|
|
216
|
-
// Singleton Prisma client
|
|
217
|
-
const globalForPrisma = globalThis as unknown as {
|
|
218
|
-
prisma: PrismaClient | undefined
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export const prisma = globalForPrisma.prisma ?? new PrismaClient()
|
|
222
|
-
|
|
223
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
224
|
-
globalForPrisma.prisma = prisma
|
|
225
|
-
}
|
|
226
|
-
|
|
227
3
|
/**
|
|
228
|
-
*
|
|
4
|
+
* Initialize a new OpenSaas Stack project.
|
|
5
|
+
*
|
|
6
|
+
* This command delegates to create-opensaas-app for the actual scaffolding.
|
|
7
|
+
* It's kept here for backwards compatibility with `opensaas init`.
|
|
8
|
+
*
|
|
9
|
+
* @param args - Command line arguments (project name and flags)
|
|
229
10
|
*/
|
|
230
|
-
export async function
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
</ol>
|
|
251
|
-
</div>
|
|
252
|
-
</main>
|
|
253
|
-
)
|
|
254
|
-
}
|
|
255
|
-
`;
|
|
256
|
-
fs.writeFileSync(path.join(projectPath, 'app', 'page.tsx'), page);
|
|
257
|
-
// Create app/layout.tsx
|
|
258
|
-
const layout = `export const metadata = {
|
|
259
|
-
title: '${projectName}',
|
|
260
|
-
description: 'Built with OpenSaas',
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
export default function RootLayout({
|
|
264
|
-
children,
|
|
265
|
-
}: {
|
|
266
|
-
children: React.ReactNode
|
|
267
|
-
}) {
|
|
268
|
-
return (
|
|
269
|
-
<html lang="en">
|
|
270
|
-
<body>{children}</body>
|
|
271
|
-
</html>
|
|
272
|
-
)
|
|
273
|
-
}
|
|
274
|
-
`;
|
|
275
|
-
fs.writeFileSync(path.join(projectPath, 'app', 'layout.tsx'), layout);
|
|
276
|
-
// Create README.md
|
|
277
|
-
const readme = `# ${projectName}
|
|
278
|
-
|
|
279
|
-
Built with [OpenSaas Stack](https://github.com/your-org/opensaas-stack)
|
|
280
|
-
|
|
281
|
-
## Getting Started
|
|
282
|
-
|
|
283
|
-
1. Install dependencies:
|
|
284
|
-
\`\`\`bash
|
|
285
|
-
npm install
|
|
286
|
-
# or
|
|
287
|
-
pnpm install
|
|
288
|
-
\`\`\`
|
|
289
|
-
|
|
290
|
-
2. Generate Prisma schema and types:
|
|
291
|
-
\`\`\`bash
|
|
292
|
-
npm run generate
|
|
293
|
-
\`\`\`
|
|
294
|
-
|
|
295
|
-
3. Push schema to database:
|
|
296
|
-
\`\`\`bash
|
|
297
|
-
npm run db:push
|
|
298
|
-
\`\`\`
|
|
299
|
-
|
|
300
|
-
4. Run the development server:
|
|
301
|
-
\`\`\`bash
|
|
302
|
-
npm run dev
|
|
303
|
-
\`\`\`
|
|
304
|
-
|
|
305
|
-
Open [http://localhost:3000](http://localhost:3000) to see your app.
|
|
306
|
-
|
|
307
|
-
## Project Structure
|
|
308
|
-
|
|
309
|
-
- \`opensaas.config.ts\` - Your schema definition with access control
|
|
310
|
-
- \`lib/context.ts\` - Database context with access control
|
|
311
|
-
- \`app/\` - Next.js app router pages
|
|
312
|
-
- \`prisma/\` - Generated Prisma schema
|
|
313
|
-
- \`.opensaas/\` - Generated TypeScript types
|
|
314
|
-
|
|
315
|
-
## Learn More
|
|
316
|
-
|
|
317
|
-
- [OpenSaas Documentation](https://github.com/your-org/opensaas-stack)
|
|
318
|
-
- [Next.js Documentation](https://nextjs.org/docs)
|
|
319
|
-
- [Prisma Documentation](https://www.prisma.io/docs)
|
|
320
|
-
`;
|
|
321
|
-
fs.writeFileSync(path.join(projectPath, 'README.md'), readme);
|
|
322
|
-
spinner.succeed(chalk.green('Project created successfully!'));
|
|
323
|
-
console.log(chalk.bold.green(`\n✨ Created ${projectName}\n`));
|
|
324
|
-
console.log(chalk.gray('Next steps:\n'));
|
|
325
|
-
console.log(chalk.cyan(` cd ${projectName}`));
|
|
326
|
-
console.log(chalk.cyan(' npm install'));
|
|
327
|
-
console.log(chalk.cyan(' npm run generate'));
|
|
328
|
-
console.log(chalk.cyan(' npm run db:push'));
|
|
329
|
-
console.log(chalk.cyan(' npm run dev'));
|
|
330
|
-
console.log();
|
|
331
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
332
|
-
}
|
|
333
|
-
catch (error) {
|
|
334
|
-
spinner.fail(chalk.red('Failed to create project'));
|
|
335
|
-
console.error(chalk.red('\n❌ Error:'), error.message);
|
|
336
|
-
// Cleanup on failure
|
|
337
|
-
if (fs.existsSync(projectPath)) {
|
|
338
|
-
fs.rmSync(projectPath, { recursive: true, force: true });
|
|
339
|
-
}
|
|
340
|
-
process.exit(1);
|
|
341
|
-
}
|
|
11
|
+
export async function initCommand(args) {
|
|
12
|
+
console.log(chalk.dim('Delegating to create-opensaas-app...\n'));
|
|
13
|
+
// Forward all arguments to create-opensaas-app
|
|
14
|
+
const child = spawn('npx', ['create-opensaas-app@latest', ...args], {
|
|
15
|
+
stdio: 'inherit',
|
|
16
|
+
shell: true,
|
|
17
|
+
});
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
child.on('close', (code) => {
|
|
20
|
+
if (code !== 0) {
|
|
21
|
+
reject(new Error(`create-opensaas-app exited with code ${code}`));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
resolve();
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
child.on('error', (err) => {
|
|
28
|
+
reject(err);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
342
31
|
}
|
|
343
32
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAc;IAC9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC,CAAA;IAEhE,+CAA+C;IAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,4BAA4B,EAAE,GAAG,IAAI,CAAC,EAAE;QAClE,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,IAAI;KACZ,CAAC,CAAA;IAEF,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACzB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACf,MAAM,CAAC,IAAI,KAAK,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC,CAAA;YACnE,CAAC;iBAAM,CAAC;gBACN,OAAO,EAAE,CAAA;YACX,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACxB,MAAM,CAAC,GAAG,CAAC,CAAA;QACb,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -13,10 +13,16 @@ program
|
|
|
13
13
|
});
|
|
14
14
|
program
|
|
15
15
|
.command('init [project-name]')
|
|
16
|
-
.description('Create a new OpenSaas project')
|
|
17
|
-
.option('-
|
|
18
|
-
.
|
|
19
|
-
|
|
16
|
+
.description('Create a new OpenSaas project (delegates to create-opensaas-app)')
|
|
17
|
+
.option('--with-auth', 'Include authentication (Better-auth)')
|
|
18
|
+
.allowUnknownOption() // Allow passing through other options
|
|
19
|
+
.action(async (projectName, options) => {
|
|
20
|
+
const args = [];
|
|
21
|
+
if (projectName)
|
|
22
|
+
args.push(projectName);
|
|
23
|
+
if (options.withAuth)
|
|
24
|
+
args.push('--with-auth');
|
|
25
|
+
await initCommand(args);
|
|
20
26
|
});
|
|
21
27
|
program
|
|
22
28
|
.command('dev')
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AAE7B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;AAE3E,OAAO;KACJ,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,qEAAqE,CAAC;KAClF,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,eAAe,EAAE,CAAA;AACzB,CAAC,CAAC,CAAA;AAEJ,OAAO;KACJ,OAAO,CAAC,qBAAqB,CAAC;KAC9B,WAAW,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AAE7B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;AAE3E,OAAO;KACJ,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,qEAAqE,CAAC;KAClF,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,eAAe,EAAE,CAAA;AACzB,CAAC,CAAC,CAAA;AAEJ,OAAO;KACJ,OAAO,CAAC,qBAAqB,CAAC;KAC9B,WAAW,CAAC,kEAAkE,CAAC;KAC/E,MAAM,CAAC,aAAa,EAAE,sCAAsC,CAAC;KAC7D,kBAAkB,EAAE,CAAC,sCAAsC;KAC3D,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE;IACrC,MAAM,IAAI,GAAG,EAAE,CAAA;IACf,IAAI,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;IACvC,IAAI,OAAO,CAAC,QAAQ;QAAE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IAC9C,MAAM,WAAW,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC,CAAC,CAAA;AAEJ,OAAO;KACJ,OAAO,CAAC,KAAK,CAAC;KACd,WAAW,CAAC,oDAAoD,CAAC;KACjE,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,UAAU,EAAE,CAAA;AACpB,CAAC,CAAC,CAAA;AAEJ,OAAO,CAAC,KAAK,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensaas/stack-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "CLI tools for OpenSaas Stack",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"prompts": "^2.4.2",
|
|
34
34
|
"chokidar": "^4.0.3",
|
|
35
35
|
"jiti": "^2.6.1",
|
|
36
|
-
"@opensaas/stack-core": "0.1.
|
|
37
|
-
"@opensaas/stack-mcp": "0.1.
|
|
36
|
+
"@opensaas/stack-core": "0.1.3",
|
|
37
|
+
"@opensaas/stack-mcp": "0.1.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^24.7.2",
|