miragedev-sdk 0.5.1 → 0.5.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.
@@ -59,7 +59,7 @@ async function createCommand(projectName) {
59
59
  {
60
60
  type: "checkbox",
61
61
  name: "features",
62
- message: "Select additional features:",
62
+ message: "Select additional features (use Space to select, Enter to confirm):",
63
63
  choices: [
64
64
  { name: "PWA Support (Progressive Web App)", value: "pwa", checked: true },
65
65
  { name: "Biometric Authentication", value: "biometric", checked: false },
@@ -91,7 +91,7 @@ async function createCommand(projectName) {
91
91
  console.log(chalk.white(" 2. Copy .env.local.example to .env.local"));
92
92
  console.log(chalk.white(" 3. Fill in your API keys in .env.local"));
93
93
  console.log(chalk.white(" 4. npm run dev\n"));
94
- console.log(chalk.gray("Documentation: https://github.com/yourusername/miragedev-sdk\n"));
94
+ console.log(chalk.gray("Documentation: https://www.npmjs.com/package/miragedev-sdk\n"));
95
95
  } catch (error) {
96
96
  console.error(chalk.red("\n\u274C Error creating project:"), error);
97
97
  console.log(chalk.yellow("\nTrying to clean up..."));
@@ -106,10 +106,11 @@ async function createNextjsProject(projectName) {
106
106
  const spinner = ora("Creating Next.js project...").start();
107
107
  try {
108
108
  execSync(
109
- `npx create-next-app@latest ${projectName} --typescript --tailwind --app --no-git --eslint --src-dir --import-alias "@/*"`,
109
+ `npx create-next-app@latest ${projectName} --typescript --tailwind --app --disable-git --eslint --src-dir --import-alias "@/*" --turbopack --skip-install --yes`,
110
110
  {
111
- stdio: "pipe",
112
- cwd: process.cwd()
111
+ stdio: "inherit",
112
+ cwd: process.cwd(),
113
+ env: { ...process.env, FORCE_COLOR: "0" }
113
114
  }
114
115
  );
115
116
  spinner.succeed(chalk.green("Next.js project created"));
@@ -123,8 +124,9 @@ async function installSDK(projectName) {
123
124
  const projectPath = path.resolve(process.cwd(), projectName);
124
125
  try {
125
126
  execSync("npm install miragedev-sdk", {
126
- stdio: "pipe",
127
- cwd: projectPath
127
+ stdio: "inherit",
128
+ cwd: projectPath,
129
+ env: { ...process.env, FORCE_COLOR: "0" }
128
130
  });
129
131
  spinner.succeed(chalk.green("MirageDev SDK installed"));
130
132
  } catch (error) {
@@ -170,7 +172,9 @@ export function initializeMirageDev() {
170
172
  })
171
173
  }
172
174
  `;
173
- await fs.writeFile(path.join(projectPath, "lib", "miragedev.config.ts"), config, "utf-8");
175
+ const libDir = path.join(projectPath, "lib");
176
+ await fs.mkdir(libDir, { recursive: true });
177
+ await fs.writeFile(path.join(libDir, "miragedev.config.ts"), config, "utf-8");
174
178
  }
175
179
  async function generateEnvTemplate(projectPath, answers) {
176
180
  const env = `# MirageDev SDK Environment Variables
@@ -217,7 +221,9 @@ initializeMirageDev()
217
221
 
218
222
  ${setup.join("\n\n")}
219
223
  `;
220
- await fs.writeFile(path.join(projectPath, "lib", "miragedev.init.ts"), content, "utf-8");
224
+ const libDir = path.join(projectPath, "lib");
225
+ await fs.mkdir(libDir, { recursive: true });
226
+ await fs.writeFile(path.join(libDir, "miragedev.init.ts"), content, "utf-8");
221
227
  }
222
228
  async function generateAgentRules(projectPath, answers) {
223
229
  const modules = ["auth", "billing", "email"];
@@ -265,7 +271,7 @@ import Stripe from 'stripe'
265
271
  const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!)
266
272
  \`\`\`
267
273
 
268
- For full documentation, see: https://github.com/yourusername/miragedev-sdk
274
+ For full documentation, see: https://www.npmjs.com/package/miragedev-sdk
269
275
  `;
270
276
  await fs.writeFile(path.join(projectPath, "AGENTS.md"), content, "utf-8");
271
277
  }
@@ -62,7 +62,7 @@ async function initCommand() {
62
62
  console.log("1. Fill in your API keys in .env.local");
63
63
  console.log("2. Import and call initMirageDev() in your app");
64
64
  console.log("3. Start building your SAAS! \u{1F389}\n");
65
- console.log(chalk.gray("Documentation: https://github.com/yourusername/miragedev-sdk\n"));
65
+ console.log(chalk.gray("Documentation: https://www.npmjs.com/package/miragedev-sdk\n"));
66
66
  } catch (error) {
67
67
  spinner.fail(chalk.red("Failed to generate files"));
68
68
  console.error(error);
@@ -71,7 +71,7 @@ async function initCommand() {
71
71
  console.log("1. Fill in your API keys in .env.local");
72
72
  console.log("2. Import and call initMirageDev() in your app");
73
73
  console.log("3. Start building your SAAS! \u{1F389}\n");
74
- console.log(chalk__default.default.gray("Documentation: https://github.com/yourusername/miragedev-sdk\n"));
74
+ console.log(chalk__default.default.gray("Documentation: https://www.npmjs.com/package/miragedev-sdk\n"));
75
75
  } catch (error) {
76
76
  spinner.fail(chalk__default.default.red("Failed to generate files"));
77
77
  console.error(error);
@@ -69,7 +69,7 @@ async function createCommand(projectName) {
69
69
  {
70
70
  type: "checkbox",
71
71
  name: "features",
72
- message: "Select additional features:",
72
+ message: "Select additional features (use Space to select, Enter to confirm):",
73
73
  choices: [
74
74
  { name: "PWA Support (Progressive Web App)", value: "pwa", checked: true },
75
75
  { name: "Biometric Authentication", value: "biometric", checked: false },
@@ -101,7 +101,7 @@ async function createCommand(projectName) {
101
101
  console.log(chalk__default.default.white(" 2. Copy .env.local.example to .env.local"));
102
102
  console.log(chalk__default.default.white(" 3. Fill in your API keys in .env.local"));
103
103
  console.log(chalk__default.default.white(" 4. npm run dev\n"));
104
- console.log(chalk__default.default.gray("Documentation: https://github.com/yourusername/miragedev-sdk\n"));
104
+ console.log(chalk__default.default.gray("Documentation: https://www.npmjs.com/package/miragedev-sdk\n"));
105
105
  } catch (error) {
106
106
  console.error(chalk__default.default.red("\n\u274C Error creating project:"), error);
107
107
  console.log(chalk__default.default.yellow("\nTrying to clean up..."));
@@ -116,10 +116,11 @@ async function createNextjsProject(projectName) {
116
116
  const spinner = ora__default.default("Creating Next.js project...").start();
117
117
  try {
118
118
  child_process.execSync(
119
- `npx create-next-app@latest ${projectName} --typescript --tailwind --app --no-git --eslint --src-dir --import-alias "@/*"`,
119
+ `npx create-next-app@latest ${projectName} --typescript --tailwind --app --disable-git --eslint --src-dir --import-alias "@/*" --turbopack --skip-install --yes`,
120
120
  {
121
- stdio: "pipe",
122
- cwd: process.cwd()
121
+ stdio: "inherit",
122
+ cwd: process.cwd(),
123
+ env: { ...process.env, FORCE_COLOR: "0" }
123
124
  }
124
125
  );
125
126
  spinner.succeed(chalk__default.default.green("Next.js project created"));
@@ -133,8 +134,9 @@ async function installSDK(projectName) {
133
134
  const projectPath = path__default.default.resolve(process.cwd(), projectName);
134
135
  try {
135
136
  child_process.execSync("npm install miragedev-sdk", {
136
- stdio: "pipe",
137
- cwd: projectPath
137
+ stdio: "inherit",
138
+ cwd: projectPath,
139
+ env: { ...process.env, FORCE_COLOR: "0" }
138
140
  });
139
141
  spinner.succeed(chalk__default.default.green("MirageDev SDK installed"));
140
142
  } catch (error) {
@@ -180,7 +182,9 @@ export function initializeMirageDev() {
180
182
  })
181
183
  }
182
184
  `;
183
- await fs__default.default.writeFile(path__default.default.join(projectPath, "lib", "miragedev.config.ts"), config, "utf-8");
185
+ const libDir = path__default.default.join(projectPath, "lib");
186
+ await fs__default.default.mkdir(libDir, { recursive: true });
187
+ await fs__default.default.writeFile(path__default.default.join(libDir, "miragedev.config.ts"), config, "utf-8");
184
188
  }
185
189
  async function generateEnvTemplate(projectPath, answers) {
186
190
  const env = `# MirageDev SDK Environment Variables
@@ -227,7 +231,9 @@ initializeMirageDev()
227
231
 
228
232
  ${setup.join("\n\n")}
229
233
  `;
230
- await fs__default.default.writeFile(path__default.default.join(projectPath, "lib", "miragedev.init.ts"), content, "utf-8");
234
+ const libDir = path__default.default.join(projectPath, "lib");
235
+ await fs__default.default.mkdir(libDir, { recursive: true });
236
+ await fs__default.default.writeFile(path__default.default.join(libDir, "miragedev.init.ts"), content, "utf-8");
231
237
  }
232
238
  async function generateAgentRules(projectPath, answers) {
233
239
  const modules = ["auth", "billing", "email"];
@@ -275,7 +281,7 @@ import Stripe from 'stripe'
275
281
  const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!)
276
282
  \`\`\`
277
283
 
278
- For full documentation, see: https://github.com/yourusername/miragedev-sdk
284
+ For full documentation, see: https://www.npmjs.com/package/miragedev-sdk
279
285
  `;
280
286
  await fs__default.default.writeFile(path__default.default.join(projectPath, "AGENTS.md"), content, "utf-8");
281
287
  }
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkOIWPIRJY_cjs = require('../../chunk-OIWPIRJY.cjs');
3
+ var chunkRQWBMMLQ_cjs = require('../../chunk-RQWBMMLQ.cjs');
4
4
  require('../../chunk-75ZPJI57.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "createCommand", {
9
9
  enumerable: true,
10
- get: function () { return chunkOIWPIRJY_cjs.createCommand; }
10
+ get: function () { return chunkRQWBMMLQ_cjs.createCommand; }
11
11
  });
@@ -1,2 +1,2 @@
1
- export { createCommand } from '../../chunk-PDNLOOI2.js';
1
+ export { createCommand } from '../../chunk-22JUIOHI.js';
2
2
  import '../../chunk-MLKGABMK.js';
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkM26EDKMY_cjs = require('../../chunk-M26EDKMY.cjs');
3
+ var chunkIRJUZ2SV_cjs = require('../../chunk-IRJUZ2SV.cjs');
4
4
  require('../../chunk-75ZPJI57.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "initCommand", {
9
9
  enumerable: true,
10
- get: function () { return chunkM26EDKMY_cjs.initCommand; }
10
+ get: function () { return chunkIRJUZ2SV_cjs.initCommand; }
11
11
  });
@@ -1,2 +1,2 @@
1
- export { initCommand } from '../../chunk-DZDDLA4G.js';
1
+ export { initCommand } from '../../chunk-HHYCJM4Y.js';
2
2
  import '../../chunk-MLKGABMK.js';
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var chunkM26EDKMY_cjs = require('../chunk-M26EDKMY.cjs');
5
- var chunkOIWPIRJY_cjs = require('../chunk-OIWPIRJY.cjs');
4
+ var chunkIRJUZ2SV_cjs = require('../chunk-IRJUZ2SV.cjs');
5
+ var chunkRQWBMMLQ_cjs = require('../chunk-RQWBMMLQ.cjs');
6
6
  require('../chunk-75ZPJI57.cjs');
7
7
  var commander = require('commander');
8
8
 
9
9
  var program = new commander.Command();
10
10
  program.name("miragedev").description("MirageDev SDK CLI - Build SAAS apps faster").version("0.1.0");
11
- program.command("create [project-name]").description("Create a new SAAS project with MirageDev SDK").action(chunkOIWPIRJY_cjs.createCommand);
12
- program.command("init").description("Initialize MirageDev SDK in existing project").action(chunkM26EDKMY_cjs.initCommand);
11
+ program.command("create [project-name]").description("Create a new SAAS project with MirageDev SDK").action(chunkRQWBMMLQ_cjs.createCommand);
12
+ program.command("init").description("Initialize MirageDev SDK in existing project").action(chunkIRJUZ2SV_cjs.initCommand);
13
13
  program.parse();
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { initCommand } from '../chunk-DZDDLA4G.js';
3
- import { createCommand } from '../chunk-PDNLOOI2.js';
2
+ import { initCommand } from '../chunk-HHYCJM4Y.js';
3
+ import { createCommand } from '../chunk-22JUIOHI.js';
4
4
  import '../chunk-MLKGABMK.js';
5
5
  import { Command } from 'commander';
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miragedev-sdk",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "AI-first SDK for building SAAS applications with Next.js",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",