@portosaur/cli 0.9.2 → 0.9.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/package.json +4 -4
- package/src/commands/init.mjs +11 -0
- package/src/commands/schema.mjs +4 -0
- package/src/templates/README.md +16 -25
- package/src/templates/config.yml +10 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portosaur/cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "CLI for Portosaur - The static Personal portfolio site generator.",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"author": "soymadip",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
},
|
|
27
27
|
"types": "./src/index.d.ts",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@portosaur/core": "^0.9.
|
|
30
|
-
"@portosaur/logger": "^0.9.
|
|
31
|
-
"@portosaur/wizard": "^0.9.
|
|
29
|
+
"@portosaur/core": "^0.9.4",
|
|
30
|
+
"@portosaur/logger": "^0.9.4",
|
|
31
|
+
"@portosaur/wizard": "^0.9.4",
|
|
32
32
|
"commander": "^13.1.0",
|
|
33
33
|
"js-yaml": "^4.1.1"
|
|
34
34
|
}
|
package/src/commands/init.mjs
CHANGED
|
@@ -296,6 +296,14 @@ export async function initCommand(options = {}) {
|
|
|
296
296
|
|
|
297
297
|
state.projectName = options.projectName || "my-portfolio";
|
|
298
298
|
|
|
299
|
+
if (state.vcs !== "none") {
|
|
300
|
+
const vcsConfig = registry.vcs_providers[state.vcs];
|
|
301
|
+
state.gitRemoteUrl = vcsConfig.url
|
|
302
|
+
.replace("{{user}}", state.userName)
|
|
303
|
+
.replace("{{projectName}}", state.projectName)
|
|
304
|
+
.replace("{{domain}}", vcsConfig.domain);
|
|
305
|
+
}
|
|
306
|
+
|
|
299
307
|
// Validate resolved hosting platform
|
|
300
308
|
if (
|
|
301
309
|
state.hosting !== "none" &&
|
|
@@ -386,10 +394,13 @@ export async function initCommand(options = {}) {
|
|
|
386
394
|
|
|
387
395
|
const portoVer = isTestProject ? "*" : `^${porto.version || "0.0.0"}`;
|
|
388
396
|
|
|
397
|
+
const cloneUrl = state.gitRemoteUrl || "<your-repository-url>";
|
|
398
|
+
|
|
389
399
|
const templateVars = {
|
|
390
400
|
projectName: state.projectName,
|
|
391
401
|
userName: state.userName || "",
|
|
392
402
|
fullName: state.fullName || "",
|
|
403
|
+
cloneUrl,
|
|
393
404
|
portoVer,
|
|
394
405
|
portoHome: porto.homepage || "",
|
|
395
406
|
portoRepo: porto.repository || "",
|
package/src/commands/schema.mjs
CHANGED
|
@@ -230,6 +230,10 @@ export async function schemaCommand(options = {}) {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
+
const outDir = path.dirname(OUTPUT_FILE);
|
|
234
|
+
if (!fs.existsSync(outDir)) {
|
|
235
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
236
|
+
}
|
|
233
237
|
fs.writeFileSync(OUTPUT_FILE, JSON.stringify(discoveredSchema, null, 2));
|
|
234
238
|
logger.success(`Schema written to: ${OUTPUT_FILE}`);
|
|
235
239
|
} catch (error) {
|
package/src/templates/README.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>{{projectName}}</h1>
|
|
3
|
+
</div>
|
|
2
4
|
|
|
3
5
|
Welcome to my digital personality and portfolio! 👋
|
|
4
6
|
|
|
@@ -6,14 +8,20 @@ This is my personal space on the web to express myself, share my thoughts, and s
|
|
|
6
8
|
|
|
7
9
|
## About This Repository
|
|
8
10
|
|
|
9
|
-
This repository contains
|
|
10
|
-
|
|
11
|
+
This repository contains content for my personal website, built with [Portosaur]({{portoHome}}).
|
|
11
12
|
It serves as my:
|
|
12
13
|
|
|
13
14
|
- **Portfolio**: Highlighting my projects, skills, and professional experience.
|
|
14
15
|
- **Digital Notebook**: A collection of notes, snippets, and ongoing learnings.
|
|
15
16
|
- **Blog**: Long-form articles and deep dives.
|
|
16
17
|
|
|
18
|
+
## Repository Structure
|
|
19
|
+
|
|
20
|
+
- `config.yml` — The configuration for my site.
|
|
21
|
+
- `notes/` — Markdown/MDX files for my digital Notebook.
|
|
22
|
+
- `blog/` — Articles and blog posts.
|
|
23
|
+
- `static/` — Static assets like images and my resume.
|
|
24
|
+
|
|
17
25
|
## Local Development
|
|
18
26
|
|
|
19
27
|
If you'd like to explore the code or run this site locally:
|
|
@@ -21,38 +29,21 @@ If you'd like to explore the code or run this site locally:
|
|
|
21
29
|
1. **Clone the repository:**
|
|
22
30
|
|
|
23
31
|
```bash
|
|
24
|
-
git clone
|
|
32
|
+
git clone {{cloneUrl}}
|
|
25
33
|
cd {{projectName}}
|
|
26
34
|
```
|
|
27
35
|
|
|
28
|
-
2. **
|
|
36
|
+
2. **Start the development server:**
|
|
29
37
|
|
|
30
38
|
```bash
|
|
31
39
|
bun install
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
_(npm, yarn, or pnpm work too!)_
|
|
35
|
-
|
|
36
|
-
3. **Start the development server:**
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
40
|
bun run dev
|
|
40
41
|
```
|
|
41
42
|
|
|
42
|
-
4. **Build for production:**
|
|
43
|
-
```bash
|
|
44
|
-
bun run build
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Structure
|
|
48
|
-
|
|
49
|
-
- `config.js` — The configuration for my site.
|
|
50
|
-
- `notes/` — Markdown/MDX files for my digital Notebook.
|
|
51
|
-
- `blog/` — Articles and blog posts.
|
|
52
|
-
- `static/` — Static assets like images and my resume.
|
|
53
|
-
|
|
54
43
|
---
|
|
55
44
|
|
|
56
|
-
<
|
|
45
|
+
<div align="center">
|
|
57
46
|
|
|
58
47
|
_Powered by [Portosaur]({{portoHome}})_
|
|
48
|
+
|
|
49
|
+
</div>
|
package/src/templates/config.yml
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
# yaml-language-server: $schema=https://soymadip.github.io/portosaur/
|
|
1
|
+
# yaml-language-server: $schema=https://soymadip.github.io/portosaur/user/config/schema.json
|
|
2
2
|
#
|
|
3
3
|
# Portosaur Project Configuration
|
|
4
4
|
# Check full Config Docs: https://soymadip.is-a.dev/portosaur/guide/config
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
# User variables for use in your values as {{vars.key}}
|
|
8
|
+
vars:
|
|
9
|
+
twitter: "@{{userName}}"
|
|
10
|
+
github: "{{userName}}"
|
|
11
|
+
linkedin: "{{userName}}"
|
|
5
12
|
|
|
6
13
|
# Site Metadata & SEO
|
|
7
14
|
site:
|
|
8
|
-
favicon: null # By default, generates from {{home_page.hero.profile_pic}}
|
|
9
|
-
|
|
10
|
-
# Auto set if deploying in Github/GitLab Pages
|
|
11
15
|
url: "auto"
|
|
12
16
|
path: "auto"
|
|
13
17
|
|
|
@@ -29,7 +33,7 @@ home_page:
|
|
|
29
33
|
url: "https://www.linked.com/in/{{userName}}"
|
|
30
34
|
|
|
31
35
|
- name: "GitHub"
|
|
32
|
-
icon: "githubalt"
|
|
36
|
+
icon: "githubalt" # TODO: needs documentation
|
|
33
37
|
url: "https://github.com/{{userName}}"
|
|
34
38
|
|
|
35
39
|
- name: "Telegram"
|
|
@@ -37,7 +41,7 @@ home_page:
|
|
|
37
41
|
|
|
38
42
|
about:
|
|
39
43
|
enable: true
|
|
40
|
-
image:
|
|
44
|
+
image: "{{home_page.hero.profile_pic}}"
|
|
41
45
|
bio:
|
|
42
46
|
- "I'm a {{home_page.hero.profession}} who loves turning ideas into reality."
|
|
43
47
|
- "With a background in computer science and a passion for design, I bridge the gap between aesthetics and functionality."
|
|
@@ -125,17 +129,3 @@ tasks:
|
|
|
125
129
|
- title: "Build the future"
|
|
126
130
|
status: "done"
|
|
127
131
|
desc: "Implementing the core framework."
|
|
128
|
-
|
|
129
|
-
# Functional Tools [TODO]
|
|
130
|
-
tools:
|
|
131
|
-
link_shortener:
|
|
132
|
-
enable: false
|
|
133
|
-
deploy_path: "/l"
|
|
134
|
-
short_links:
|
|
135
|
-
"example": "https://example.com"
|
|
136
|
-
|
|
137
|
-
# Custom variables for use in your content as {{custom.key}}
|
|
138
|
-
custom:
|
|
139
|
-
twitter: "@{{userName}}"
|
|
140
|
-
github: "{{userName}}"
|
|
141
|
-
linkedin: "{{userName}}"
|