vending-mocha 0.1.2 → 0.1.4
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/cli.js +0 -40
- package/package.json +1 -1
- package/posts/hello-world.md +2 -1
- package/src/entry-client.tsx +2 -1
- package/src/entry-server.tsx +2 -1
- package/src/pages/BlogPost.tsx +8 -1
- package/src/pages/HomePage.tsx +2 -1
package/bin/cli.js
CHANGED
|
@@ -220,35 +220,11 @@ async function handleNew(projectName, options) {
|
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
questions.push({
|
|
224
|
-
type: 'input',
|
|
225
|
-
name: 'title',
|
|
226
|
-
message: 'What is the title of your blog?',
|
|
227
|
-
default: (answers) => answers.projectName || projectName
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
questions.push({
|
|
231
|
-
type: 'input',
|
|
232
|
-
name: 'url',
|
|
233
|
-
message: 'What is the production URL of your blog?',
|
|
234
|
-
default: (answers) => `https://example.com/${answers.projectName || projectName}`
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
questions.push({
|
|
238
|
-
type: 'input',
|
|
239
|
-
name: 'description',
|
|
240
|
-
message: 'Write a short description for your blog:',
|
|
241
|
-
default: 'A personal blogging framework for developers.'
|
|
242
|
-
});
|
|
243
|
-
|
|
244
223
|
const answers = await inquirer.prompt(questions);
|
|
245
224
|
|
|
246
225
|
// Merge args and answers
|
|
247
226
|
const config = {
|
|
248
227
|
projectName: projectName || answers.projectName,
|
|
249
|
-
title: answers.title,
|
|
250
|
-
url: answers.url,
|
|
251
|
-
description: answers.description
|
|
252
228
|
};
|
|
253
229
|
|
|
254
230
|
const currentDir = process.cwd();
|
|
@@ -271,25 +247,9 @@ async function handleNew(projectName, options) {
|
|
|
271
247
|
|
|
272
248
|
// 2. Update config
|
|
273
249
|
console.log(chalk.gray('Updating configuration...'));
|
|
274
|
-
updateSiteConfig(projectDir, config);
|
|
275
|
-
console.log(chalk.green('✔ Configuration updated'));
|
|
276
|
-
|
|
277
|
-
// 3. Update package.json
|
|
278
|
-
console.log(chalk.gray('Updating package.json...'));
|
|
279
250
|
updatePackageJson(projectDir, config);
|
|
280
251
|
console.log(chalk.green('✔ package.json updated'));
|
|
281
252
|
|
|
282
|
-
// 4. Initialize Git
|
|
283
|
-
console.log(chalk.gray('Initializing git repository...'));
|
|
284
|
-
try {
|
|
285
|
-
execSync('git init', { cwd: projectDir, stdio: 'ignore' });
|
|
286
|
-
execSync('git add .', { cwd: projectDir, stdio: 'ignore' });
|
|
287
|
-
execSync('git commit -m "Initial commit from vending-mocha"', { cwd: projectDir, stdio: 'ignore' });
|
|
288
|
-
console.log(chalk.green('✔ Git initialized'));
|
|
289
|
-
} catch (e) {
|
|
290
|
-
console.warn(chalk.yellow('⚠ Failed to initialize git repository (git might not be installed).'));
|
|
291
|
-
}
|
|
292
|
-
|
|
293
253
|
console.log(chalk.green(`\nSuccess! Created ${config.projectName} at ${projectDir}`));
|
|
294
254
|
console.log('\nInside that directory, you can run:');
|
|
295
255
|
console.log(chalk.cyan(` cd ${config.projectName}`));
|
package/package.json
CHANGED
package/posts/hello-world.md
CHANGED
|
@@ -16,13 +16,14 @@ Welcome to **Vending Mocha**! This is a sample post. You can edit this file or a
|
|
|
16
16
|
- **SSG**: Static Site Generation for optimal performance.
|
|
17
17
|
- **Theme Support**: Customize your blog with different themes.
|
|
18
18
|
- **Deployment**: Ready for GitHub Pages deployment.
|
|
19
|
+
- **AI ready**: Fully compatible with Antigravity for setup, deployment and content generation.
|
|
19
20
|
|
|
20
21
|
### Getting Started
|
|
21
22
|
|
|
22
23
|
To create a new Vending Mocha blog, run the following command in your terminal:
|
|
23
24
|
|
|
24
25
|
```bash
|
|
25
|
-
npx vending-mocha new <my-blog>
|
|
26
|
+
npx vending-mocha@latest new <my-blog>
|
|
26
27
|
```
|
|
27
28
|
|
|
28
29
|
Follow the interactive prompts to set up your blog's configuration.
|
package/src/entry-client.tsx
CHANGED
|
@@ -4,7 +4,8 @@ import { BrowserRouter } from 'react-router-dom'
|
|
|
4
4
|
import * as ReactHelmetAsync from 'react-helmet-async'
|
|
5
5
|
import App from './App'
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const helmetAsync = ReactHelmetAsync as any;
|
|
8
|
+
const { HelmetProvider } = helmetAsync.default || helmetAsync;
|
|
8
9
|
|
|
9
10
|
const container = document.getElementById('root')!
|
|
10
11
|
|
package/src/entry-server.tsx
CHANGED
|
@@ -6,7 +6,8 @@ import App from './App'
|
|
|
6
6
|
import { siteConfig } from './site.config'
|
|
7
7
|
export { siteConfig }
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const helmetAsync = ReactHelmetAsync as any;
|
|
10
|
+
const { HelmetProvider } = helmetAsync.default || helmetAsync;
|
|
10
11
|
|
|
11
12
|
import { getBasePath } from './utils/basePath';
|
|
12
13
|
|
package/src/pages/BlogPost.tsx
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { useParams } from 'react-router-dom';
|
|
2
|
+
import * as ReactHelmetAsync from 'react-helmet-async';
|
|
3
|
+
const helmetAsync = ReactHelmetAsync as any;
|
|
4
|
+
const { Helmet } = helmetAsync.default || helmetAsync;
|
|
2
5
|
import { siteConfig } from '../site.config';
|
|
3
6
|
import SiteHeader from '../components/SiteHeader';
|
|
4
7
|
import Markdown from 'react-markdown';
|
|
@@ -54,7 +57,11 @@ export default function BlogPost() {
|
|
|
54
57
|
return (
|
|
55
58
|
<div className="blog-container">
|
|
56
59
|
<SiteHeader />
|
|
57
|
-
<
|
|
60
|
+
<Helmet>
|
|
61
|
+
<script type='application/ld+json'>
|
|
62
|
+
{JSON.stringify(jsonLd)}
|
|
63
|
+
</script>
|
|
64
|
+
</Helmet>
|
|
58
65
|
<header>
|
|
59
66
|
<h1>{postMeta.title}</h1>
|
|
60
67
|
<div className="meta">
|
package/src/pages/HomePage.tsx
CHANGED
|
@@ -5,7 +5,8 @@ import * as ReactHelmetAsync from 'react-helmet-async';
|
|
|
5
5
|
import { siteConfig } from '../site.config';
|
|
6
6
|
import { formatDate } from '../utils/date';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const helmetAsync = ReactHelmetAsync as any;
|
|
9
|
+
const { Helmet } = helmetAsync.default || helmetAsync;
|
|
9
10
|
|
|
10
11
|
const POSTS_PER_PAGE = 50;
|
|
11
12
|
|