create-vault-cms 1.0.3 → 1.0.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/README.md +27 -8
- package/package.json +3 -2
- package/src/cli.js +22 -3
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@ Use [Obsidian](https://obsidian.md) as a content management system for your [Ast
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
## Video Guide
|
|
9
8
|
|
|
10
9
|
📺 [Video Guide](https://youtu.be/dSm8aLPdVz0)
|
|
@@ -21,14 +20,17 @@ Use [Obsidian](https://obsidian.md) as a content management system for your [Ast
|
|
|
21
20
|

|
|
22
21
|
|
|
23
22
|
> [!NOTE]
|
|
24
|
-
>
|
|
23
|
+
> To see Vault CMS combined with an Astro site specifically designed with it in mind, check out my theme [Astro Modular](https://github.com/davidvkimball/astro-modular).
|
|
25
24
|
|
|
26
25
|
## Installation Guide
|
|
27
26
|
|
|
28
|
-
The
|
|
27
|
+
The fastest way to install Vault CMS into your Astro project is via the CLI:
|
|
28
|
+
|
|
29
|
+
### Standard Installation
|
|
30
|
+
Run this in your Astro project root:
|
|
29
31
|
|
|
30
32
|
```bash
|
|
31
|
-
# Using pnpm
|
|
33
|
+
# Using pnpm (recommended)
|
|
32
34
|
pnpm create vault-cms
|
|
33
35
|
|
|
34
36
|
# Using npm
|
|
@@ -38,6 +40,25 @@ npm create vault-cms
|
|
|
38
40
|
yarn create vault-cms
|
|
39
41
|
```
|
|
40
42
|
|
|
43
|
+
When prompted for the location, the default is `src/content`.
|
|
44
|
+
|
|
45
|
+
### Using a Preset Template
|
|
46
|
+
If you are using a supported theme like **Starlight**, **Slate**, or **Chiri**, you can use a preconfigured preset from the [Presets](https://github.com/davidvkimball/vault-cms-presets) repository:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Using pnpm
|
|
50
|
+
pnpm create vault-cms -- --template starlight
|
|
51
|
+
|
|
52
|
+
# Using npm
|
|
53
|
+
npm create vault-cms -- --template starlight
|
|
54
|
+
|
|
55
|
+
# Using yarn
|
|
56
|
+
yarn create vault-cms --template starlight
|
|
57
|
+
```
|
|
58
|
+
*(Replace `starlight` with `slate` or `chiri` as needed).*
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
41
62
|
This will automatically:
|
|
42
63
|
1. Copy the necessary `_bases` and `.obsidian` configuration folders.
|
|
43
64
|
2. Setup a `README.md` for your vault.
|
|
@@ -46,7 +67,7 @@ This will automatically:
|
|
|
46
67
|
### Manual Installation
|
|
47
68
|
|
|
48
69
|
If you prefer to install manually:
|
|
49
|
-
1.
|
|
70
|
+
1. Download the [latest release ZIP](https://github.com/davidvkimball/vault-cms/archive/refs/heads/master.zip).
|
|
50
71
|
2. Copy the `_bases` and `.obsidian` folders into your Astro project (e.g., in `src/content`).
|
|
51
72
|
3. Open Obsidian and select "Open folder as vault", then select the folder containing the `.obsidian` directory.
|
|
52
73
|
|
|
@@ -57,9 +78,8 @@ Vault CMS automatically detects and configures itself based on your Astro projec
|
|
|
57
78
|
- **Project Detection**: Automatically finds your Astro project by locating `astro.config.mjs`, `astro.config.ts`, or other Astro config files.
|
|
58
79
|
- **Content Type Detection**: Scans your content folders (like `posts`, `pages`, `docs`, etc.) and automatically identifies them as content types.
|
|
59
80
|
- **Frontmatter Analysis**: Analyzes existing content files to detect frontmatter properties (title, date, description, etc.) and configures the plugin accordingly.
|
|
60
|
-
- **Theme Adaptation**: Adapts to your Astro theme's specific quirks and requirements automatically.
|
|
61
81
|
|
|
62
|
-
When you first open the vault, a setup wizard will guide you through the configuration process.
|
|
82
|
+
When you first open the vault, a setup wizard will guide you through the configuration process.
|
|
63
83
|
|
|
64
84
|
### Recommended .gitignore
|
|
65
85
|
|
|
@@ -69,4 +89,3 @@ If you are not using the CLI, add the following to your Astro project's `.gitign
|
|
|
69
89
|
.obsidian/workspace.json
|
|
70
90
|
.obsidian/workspace-mobile.json
|
|
71
91
|
```
|
|
72
|
-
This prevents conflicts between multiple devices and keeps your vault clean.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vault-cms",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Installer for Vault CMS",
|
|
5
5
|
"main": "src/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"adm-zip": "^0.5.16",
|
|
31
31
|
"commander": "^14.0.2",
|
|
32
|
-
"fs-extra": "^11.3.3"
|
|
32
|
+
"fs-extra": "^11.3.3",
|
|
33
|
+
"inquirer": "^9.3.8"
|
|
33
34
|
}
|
|
34
35
|
}
|
package/src/cli.js
CHANGED
|
@@ -5,6 +5,7 @@ const fs = require('fs-extra');
|
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const https = require('https');
|
|
7
7
|
const AdmZip = require('adm-zip');
|
|
8
|
+
const inquirer = require('inquirer');
|
|
8
9
|
|
|
9
10
|
// Read version from package.json
|
|
10
11
|
const pkg = require('../package.json');
|
|
@@ -17,10 +18,25 @@ program
|
|
|
17
18
|
.version(pkg.version);
|
|
18
19
|
|
|
19
20
|
program
|
|
20
|
-
.argument('[target]', 'target directory'
|
|
21
|
+
.argument('[target]', 'target directory')
|
|
21
22
|
.option('-t, --template <name>', 'template to use (from vault-cms-presets)')
|
|
22
23
|
.action(async (target, options) => {
|
|
23
|
-
|
|
24
|
+
let targetPath = target;
|
|
25
|
+
|
|
26
|
+
// If no target provided, prompt the user
|
|
27
|
+
if (!targetPath) {
|
|
28
|
+
const answers = await inquirer.prompt([
|
|
29
|
+
{
|
|
30
|
+
type: 'input',
|
|
31
|
+
name: 'path',
|
|
32
|
+
message: 'Where should we install Vault CMS?',
|
|
33
|
+
default: 'src/content',
|
|
34
|
+
}
|
|
35
|
+
]);
|
|
36
|
+
targetPath = answers.path;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const targetDir = path.resolve(targetPath);
|
|
24
40
|
const tempZip = path.join(targetDir, 'vault-cms-temp.zip');
|
|
25
41
|
const extractDir = path.join(targetDir, '.vault-cms-temp-extract');
|
|
26
42
|
|
|
@@ -83,6 +99,7 @@ program
|
|
|
83
99
|
await fs.remove(extractDir);
|
|
84
100
|
|
|
85
101
|
console.log('\n✨ Vault CMS is ready!');
|
|
102
|
+
process.exit(0); // Ensure clean exit
|
|
86
103
|
} catch (err) {
|
|
87
104
|
console.error('\n❌ Installation failed:', err.message);
|
|
88
105
|
if (await fs.pathExists(tempZip)) await fs.remove(tempZip);
|
|
@@ -106,7 +123,9 @@ function downloadFile(url, dest) {
|
|
|
106
123
|
file.close();
|
|
107
124
|
resolve();
|
|
108
125
|
});
|
|
109
|
-
}).on('error',
|
|
126
|
+
}).on('error', (err) => {
|
|
127
|
+
reject(err);
|
|
128
|
+
});
|
|
110
129
|
});
|
|
111
130
|
}
|
|
112
131
|
|