stego-cli 0.1.2 → 0.1.3
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 +75 -10
- package/dist/stego-cli.js +56 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
# Stego
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Stego is a Markdown-first creative writing workflow packaged as an installable CLI: `stego-cli`.
|
|
4
|
+
|
|
5
|
+
This repository is the source for the CLI and the example/template content that `stego init` scaffolds into a new workspace.
|
|
4
6
|
|
|
5
7
|
## What this includes
|
|
6
8
|
|
|
9
|
+
- Installable CLI (`stego`) for creating and operating Stego workspaces
|
|
7
10
|
- Project-per-folder structure inside one monorepo.
|
|
8
11
|
- Flexible manuscript files with per-project metadata requirements.
|
|
9
12
|
- Configurable manuscript grouping via `compileStructure.levels` (for example `part` + `chapter`).
|
|
@@ -11,23 +14,77 @@ This workspace is a Markdown-first creative writing pipeline for short stories t
|
|
|
11
14
|
- Deterministic build into one manuscript Markdown file.
|
|
12
15
|
- Stage-based quality gates (`draft` -> `final`).
|
|
13
16
|
- Export abstraction (`md` always, `docx`/`pdf` via optional `pandoc`).
|
|
14
|
-
-
|
|
17
|
+
- Example/demo projects (`docs-demo`, `plague-demo`) included in `stego init`.
|
|
15
18
|
|
|
16
|
-
##
|
|
19
|
+
## Getting started (from npm)
|
|
17
20
|
|
|
18
21
|
```bash
|
|
19
|
-
|
|
22
|
+
npm install -g stego-cli
|
|
23
|
+
|
|
24
|
+
mkdir my-stego-workspace
|
|
25
|
+
cd my-stego-workspace
|
|
26
|
+
stego init
|
|
27
|
+
|
|
28
|
+
npm install
|
|
20
29
|
npm run list-projects
|
|
21
|
-
npm run new-project -- --project my-new-project --title "My New Project"
|
|
22
30
|
npm run validate -- --project plague-demo
|
|
23
31
|
npm run build -- --project plague-demo
|
|
24
32
|
npm run check-stage -- --project plague-demo --stage revise
|
|
25
33
|
npm run export -- --project plague-demo --format md
|
|
26
34
|
```
|
|
27
35
|
|
|
28
|
-
`
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
`stego init` scaffolds a new workspace in the current directory (it must be empty unless you pass `--force`).
|
|
37
|
+
|
|
38
|
+
Create another project in the workspace:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
stego new-project --project my-new-project --title "My New Project"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`stego new-project` scaffolds `manuscript/`, `spine/`, `notes/`, and `dist/`, seeds `stego-project.json`, creates a project-local `package.json`, and writes `.vscode/extensions.json` recommendations (Stego + Saurus) for that project.
|
|
45
|
+
|
|
46
|
+
## Running commands for a specific project
|
|
47
|
+
|
|
48
|
+
From the workspace root, target a project with `--project`:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm run validate -- --project plague-demo
|
|
52
|
+
npm run build -- --project plague-demo
|
|
53
|
+
npm run check-stage -- --project plague-demo --stage proof
|
|
54
|
+
npm run export -- --project plague-demo --format md
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Each project also has local scripts, so you can work from inside the project directory:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
cd projects/plague-demo
|
|
61
|
+
npm run validate
|
|
62
|
+
npm run build
|
|
63
|
+
npm run check-stage -- --stage proof
|
|
64
|
+
npm run export -- --format md
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## VS Code workflow
|
|
68
|
+
|
|
69
|
+
When you are actively working on one project, open that project directory directly in VS Code (for example `projects/plague-demo`) rather than the whole workspace.
|
|
70
|
+
|
|
71
|
+
This keeps editor context focused and applies the project's recommended extensions via `projects/<project-id>/.vscode/extensions.json`.
|
|
72
|
+
|
|
73
|
+
## Developing `stego-cli` (this repo)
|
|
74
|
+
|
|
75
|
+
If you are working on the CLI itself (this repository), use the local development scripts:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npm install
|
|
79
|
+
npm run list-projects
|
|
80
|
+
npm run validate -- --project docs-demo
|
|
81
|
+
npm run build -- --project plague-demo
|
|
82
|
+
npm run test:compile-structure
|
|
83
|
+
npm run build:cli
|
|
84
|
+
npm run pack:dry-run
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
These source-repo scripts run the TypeScript CLI directly with Node (`--experimental-strip-types`) for local development.
|
|
31
88
|
|
|
32
89
|
## Export requirements (DOCX/PDF)
|
|
33
90
|
|
|
@@ -63,14 +120,22 @@ npm run export -- --project plague-demo --format docx
|
|
|
63
120
|
npm run export -- --project plague-demo --format pdf
|
|
64
121
|
```
|
|
65
122
|
|
|
66
|
-
##
|
|
123
|
+
## Scaffolded workspace layout
|
|
67
124
|
|
|
68
125
|
- `projects/<project-id>/manuscript/` source manuscript files
|
|
69
126
|
- `projects/<project-id>/spine/` canonical spine category files (`spineCategories[*].notesFile`)
|
|
70
127
|
- `projects/<project-id>/notes/` regular notes and planning docs
|
|
71
128
|
- `projects/<project-id>/dist/` generated outputs only
|
|
129
|
+
- `stego.config.json` workspace configuration
|
|
72
130
|
- `docs/` workflow and conventions
|
|
73
|
-
- `
|
|
131
|
+
- `.vscode/tasks.json` root VS Code tasks for common Stego commands
|
|
132
|
+
|
|
133
|
+
## This repo layout (`stego-cli` source)
|
|
134
|
+
|
|
135
|
+
- `tools/` CLI source code and exporters
|
|
136
|
+
- `projects/` template/demo projects bundled by `stego init`
|
|
137
|
+
- `docs/` user-facing docs copied into scaffolded workspaces
|
|
138
|
+
- `.github/workflows/` CI + Changesets release automation
|
|
74
139
|
|
|
75
140
|
## Project spine categories
|
|
76
141
|
|
package/dist/stego-cli.js
CHANGED
|
@@ -25,6 +25,56 @@ projects/*/dist/*
|
|
|
25
25
|
projects/*/.vscode/settings.json
|
|
26
26
|
.vscode/settings.json
|
|
27
27
|
`;
|
|
28
|
+
const SCAFFOLD_README_CONTENT = `# Stego Workspace
|
|
29
|
+
|
|
30
|
+
This directory is a Stego writing workspace (a monorepo for one or more writing projects).
|
|
31
|
+
|
|
32
|
+
## What was scaffolded
|
|
33
|
+
|
|
34
|
+
- \`stego.config.json\` workspace configuration
|
|
35
|
+
- \`projects/\` demo projects (\`docs-demo\` and \`plague-demo\`)
|
|
36
|
+
- \`docs/\` workflow and conventions docs
|
|
37
|
+
- root \`package.json\` scripts for Stego commands
|
|
38
|
+
- root \`.vscode/tasks.json\` tasks for common workflows
|
|
39
|
+
|
|
40
|
+
## First run
|
|
41
|
+
|
|
42
|
+
\`\`\`bash
|
|
43
|
+
npm install
|
|
44
|
+
npm run list-projects
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
## Run commands for a specific project (from workspace root)
|
|
48
|
+
|
|
49
|
+
\`\`\`bash
|
|
50
|
+
npm run validate -- --project plague-demo
|
|
51
|
+
npm run build -- --project plague-demo
|
|
52
|
+
npm run check-stage -- --project plague-demo --stage revise
|
|
53
|
+
npm run export -- --project plague-demo --format md
|
|
54
|
+
\`\`\`
|
|
55
|
+
|
|
56
|
+
## Work inside one project
|
|
57
|
+
|
|
58
|
+
Each project also has local scripts, so you can run commands from inside a project directory:
|
|
59
|
+
|
|
60
|
+
\`\`\`bash
|
|
61
|
+
cd projects/plague-demo
|
|
62
|
+
npm run validate
|
|
63
|
+
npm run build
|
|
64
|
+
\`\`\`
|
|
65
|
+
|
|
66
|
+
## VS Code recommendation
|
|
67
|
+
|
|
68
|
+
When you are actively working on one project, open that project directory directly in VS Code (for example \`projects/plague-demo\`).
|
|
69
|
+
|
|
70
|
+
This keeps your editor context focused and applies the project's recommended extensions (including Stego + Saurus) for that project.
|
|
71
|
+
|
|
72
|
+
## Create a new project
|
|
73
|
+
|
|
74
|
+
\`\`\`bash
|
|
75
|
+
stego new-project --project my-book --title "My Book"
|
|
76
|
+
\`\`\`
|
|
77
|
+
`;
|
|
28
78
|
const PROJECT_EXTENSION_RECOMMENDATIONS = [
|
|
29
79
|
"matt-gold.stego-extension",
|
|
30
80
|
"matt-gold.saurus-extension"
|
|
@@ -398,6 +448,7 @@ function initWorkspace(options) {
|
|
|
398
448
|
}
|
|
399
449
|
const copiedPaths = [];
|
|
400
450
|
writeScaffoldGitignore(targetRoot, copiedPaths);
|
|
451
|
+
writeScaffoldReadme(targetRoot, copiedPaths);
|
|
401
452
|
copyTemplateAsset(".markdownlint.json", targetRoot, copiedPaths);
|
|
402
453
|
copyTemplateAsset(".cspell.json", targetRoot, copiedPaths);
|
|
403
454
|
copyTemplateAsset(ROOT_CONFIG_FILENAME, targetRoot, copiedPaths);
|
|
@@ -447,6 +498,11 @@ function writeScaffoldGitignore(targetRoot, copiedPaths) {
|
|
|
447
498
|
fs.writeFileSync(destinationPath, SCAFFOLD_GITIGNORE_CONTENT, "utf8");
|
|
448
499
|
copiedPaths.push(".gitignore");
|
|
449
500
|
}
|
|
501
|
+
function writeScaffoldReadme(targetRoot, copiedPaths) {
|
|
502
|
+
const destinationPath = path.join(targetRoot, "README.md");
|
|
503
|
+
fs.writeFileSync(destinationPath, SCAFFOLD_README_CONTENT, "utf8");
|
|
504
|
+
copiedPaths.push("README.md");
|
|
505
|
+
}
|
|
450
506
|
function shouldCopyTemplatePath(currentSourcePath) {
|
|
451
507
|
const relativePath = path.relative(packageRoot, currentSourcePath);
|
|
452
508
|
if (!relativePath || relativePath.startsWith("..")) {
|