create-next-mdx-blog-app 2.1.5 → 2.1.6
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/bin/create.js +13 -16
- package/package.json +2 -2
package/bin/create.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const { execa } = require('execa');
|
|
3
2
|
const path = require('path');
|
|
4
3
|
const fs = require('fs');
|
|
5
|
-
const inquirer = require('inquirer');
|
|
6
4
|
const degit = require('degit');
|
|
7
5
|
|
|
8
6
|
// GitHub repository URL of the template (the repo you want to clone)
|
|
@@ -20,16 +18,15 @@ async function setup() {
|
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
// Ask the user if they want to set up the blog
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
]);
|
|
21
|
+
// inquirer v9+ is ESM-only — use dynamic import and the @inquirer/prompts confirm helper
|
|
22
|
+
const { confirm } = await import('@inquirer/prompts');
|
|
23
|
+
const { execa } = await import('execa');
|
|
24
|
+
const install = await confirm({
|
|
25
|
+
message: 'Do you want to set up a Next.js MDX blog app here?',
|
|
26
|
+
default: true,
|
|
27
|
+
});
|
|
31
28
|
|
|
32
|
-
if (!
|
|
29
|
+
if (!install) {
|
|
33
30
|
console.log('Aborted the installation.');
|
|
34
31
|
return;
|
|
35
32
|
}
|
|
@@ -37,22 +34,22 @@ async function setup() {
|
|
|
37
34
|
console.log('Setting up the Next.js MDX blog app...');
|
|
38
35
|
|
|
39
36
|
try {
|
|
40
|
-
//
|
|
37
|
+
// Clone only the Next.js app subdirectory directly into cwd
|
|
38
|
+
// so the user gets project files at the root without repo meta-files
|
|
41
39
|
console.log('Cloning repository...');
|
|
42
|
-
const emitter = degit(repoUrl
|
|
40
|
+
const emitter = degit(`${repoUrl}/mdx-medium-blog-post-provider`, { cache: false, force: true });
|
|
43
41
|
await emitter.clone(cwd);
|
|
44
42
|
|
|
45
|
-
// Install dependencies
|
|
43
|
+
// Install dependencies — app root is now cwd
|
|
46
44
|
console.log('Installing dependencies...');
|
|
47
45
|
await execa('npm', ['install'], {
|
|
48
46
|
stdio: 'inherit',
|
|
49
|
-
cwd
|
|
47
|
+
cwd,
|
|
50
48
|
});
|
|
51
49
|
|
|
52
50
|
console.log('Next.js MDX Blog setup completed!');
|
|
53
51
|
console.log('');
|
|
54
52
|
console.log('Before starting the app, configure your environment variables:');
|
|
55
|
-
console.log(' cd mdx-medium-blog-post-provider');
|
|
56
53
|
console.log(' cp .env.example .env.local');
|
|
57
54
|
console.log(' # Fill in SUPABASE_URL, SUPABASE_ANON_KEY, ANTHROPIC_API_KEY, and others in .env.local');
|
|
58
55
|
console.log('');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-next-mdx-blog-app",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "A production-ready technical blog starter kit built with Next.js, MDX, Supabase, and TypeScript.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Abdullah Muhammad",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"degit": "^2.8.4",
|
|
59
59
|
"execa": "^9.6.1",
|
|
60
60
|
"gray-matter": "^4.0.3",
|
|
61
|
-
"inquirer": "^
|
|
61
|
+
"@inquirer/prompts": "^8.3.2",
|
|
62
62
|
"lucide-react": "^1.7.0",
|
|
63
63
|
"next": "^16.2.1",
|
|
64
64
|
"next-mdx-remote": "^6.0.0",
|