create-docs-sdk 0.0.0-stage → 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lenso contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,10 @@
1
- # Temporary Holding Version
1
+ # create-docs-sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Create a Docs SDK documentation site:
4
+
5
+ ```sh
6
+ bunx create-docs-sdk my-docs
7
+ # or: npm create docs-sdk my-docs
8
+ ```
9
+
10
+ Then `cd my-docs`, install with your package manager, and run `npx docs dev`. The project's `AGENTS.md` points agents at the documentation and skill of the installed version.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import { createProject } from "./index.js";
3
+ const [target, ...extra] = process.argv.slice(2);
4
+ try {
5
+ if (!target || target.startsWith("-") || extra.length)
6
+ throw new Error("Usage: create-docs-sdk <folder>");
7
+ await createProject(target);
8
+ process.stdout.write([`Created ${target}.`, "", "Next:", ` cd ${target}`, " npm install (or bun install, pnpm install)",
9
+ " npx docs dev serves the site and rebuilds on save", "",
10
+ "Pages are the Markdown files in content/pages. AGENTS.md tells your agent where the docs are.", ""].join("\n"));
11
+ }
12
+ catch (error) {
13
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
14
+ process.exitCode = 1;
15
+ }
@@ -0,0 +1,5 @@
1
+ /** Create a project in `target`; returns the files written, relative to it. */
2
+ export declare function createProject(target: string, options?: {
3
+ name?: string;
4
+ version?: string;
5
+ }): Promise<string[]>;
package/dist/index.js ADDED
@@ -0,0 +1,37 @@
1
+ import { cp, mkdir, readdir, readFile, rename, writeFile } from "node:fs/promises";
2
+ import { basename, join, relative, resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ /**
5
+ * create-docs-sdk: a new documentation project with its pages as files, the site and the agent setup, depending on
6
+ * the Docs SDK packages of this release. It writes only into a new or empty folder.
7
+ */
8
+ const own = JSON.parse(await readFile(new URL("../package.json", import.meta.url), "utf8"));
9
+ const template = fileURLToPath(new URL("../template/", import.meta.url));
10
+ /** Create a project in `target`; returns the files written, relative to it. */
11
+ export async function createProject(target, options = {}) {
12
+ const directory = resolve(target);
13
+ await mkdir(directory, { recursive: true });
14
+ const existing = (await readdir(directory)).filter(name => name !== ".git");
15
+ if (existing.length)
16
+ throw new Error(`${target} is not empty. Choose a new folder.`);
17
+ const name = (options.name ?? basename(directory)).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[-._]+/, "") || "docs";
18
+ const version = options.version ?? own.version;
19
+ await cp(template, directory, { recursive: true });
20
+ // npm never publishes a file named .gitignore, so the template carries it as gitignore.
21
+ await rename(join(directory, "gitignore"), join(directory, ".gitignore"));
22
+ const written = [];
23
+ async function fill(folder) {
24
+ for (const entry of await readdir(folder, { withFileTypes: true })) {
25
+ const path = join(folder, entry.name);
26
+ if (entry.isDirectory())
27
+ await fill(path);
28
+ else {
29
+ const text = await readFile(path, "utf8");
30
+ await writeFile(path, text.replaceAll("{{name}}", name).replaceAll("{{version}}", version));
31
+ written.push(relative(directory, path));
32
+ }
33
+ }
34
+ }
35
+ await fill(directory);
36
+ return written.sort();
37
+ }
package/package.json CHANGED
@@ -1,6 +1,32 @@
1
1
  {
2
2
  "name": "create-docs-sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.3",
4
+ "description": "Create a Docs SDK documentation site",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "engines": {
8
+ "node": ">=22.12.0"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/LioRael/docs-sdk.git",
13
+ "directory": "packages/create"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "files": [
19
+ "dist/*.js",
20
+ "dist/*.d.ts",
21
+ "template"
22
+ ],
23
+ "bin": {
24
+ "create-docs-sdk": "./dist/cli.js"
25
+ },
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "default": "./dist/index.js"
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,8 @@
1
+ # AGENTS.md
2
+
3
+ This project's documentation is built with Docs SDK.
4
+
5
+ - Before working on the documentation, follow the docs-sdk skill if it is installed (`npx skills@latest add LioRael/docs-sdk --skill docs-sdk`; the same skill is in `node_modules/@docs-sdk-dev/cli/skills/docs-sdk/SKILL.md`), and read `node_modules/@docs-sdk-dev/cli/llms.txt` and `node_modules/@docs-sdk-dev/cli/docs/index.md`. They describe the installed version.
6
+ - Pages are the Markdown and MDX files under `content/pages`; `content/project.ts` holds site settings, collections, redirects and contracts.
7
+ - Run commands as `npx docs <command>`. Before finishing, run `npx docs validate`, `npx docs check` and `npx docs build`, and report what they returned.
8
+ - `npx docs dev` serves the site and rebuilds on save.
@@ -0,0 +1,10 @@
1
+ # {{name}}
2
+
3
+ Documentation built with [Docs SDK](https://github.com/LioRael/docs-sdk).
4
+
5
+ ```sh
6
+ npm install
7
+ npx docs dev
8
+ ```
9
+
10
+ `npx docs dev` serves the site at http://localhost:4173/ and rebuilds on every save. `npx docs build` writes it to `dist/site`, ready for any static host.
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "Guide",
3
+ "pages": ["introduction", "writing"]
4
+ }
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: "What this documentation covers and how it is organized."
3
+ ---
4
+
5
+ # Introduction
6
+
7
+ This is your documentation site. Edit this file, `content/pages/guide/introduction.md`, and the page in your browser reloads with the change while `npx docs dev` runs.
8
+
9
+ Each folder under `content/pages` is a section of the site, and each Markdown file in it is a page. See [Writing pages](./writing.md) to add one.
@@ -0,0 +1,21 @@
1
+ ---
2
+ description: "Add a page, order a section, and check the site before publishing."
3
+ ---
4
+
5
+ # Writing pages
6
+
7
+ Create a Markdown file in a folder under `content/pages`. Its folder is its section, its file name its URL, and its first `#` heading its title. Frontmatter is optional:
8
+
9
+ ```md
10
+ ---
11
+ description: One sentence for search results and link previews.
12
+ ---
13
+
14
+ # Deploy
15
+
16
+ Serve the files in dist/site from any static host.
17
+ ```
18
+
19
+ `_meta.json` in a folder sets the section's name and the order of its pages. Pages it does not list follow by title.
20
+
21
+ Before publishing, run `npx docs check` for broken promises such as missing descriptions, and `npx docs build` to write the site to `dist/site`. The full guides for this version are in `node_modules/@docs-sdk-dev/cli/docs`.
@@ -0,0 +1,5 @@
1
+ // Pages are the Markdown and MDX files under content/pages: nothing to register here.
2
+ // This file holds site settings, and collections that generate reference pages from code or an OpenAPI spec.
3
+ export const site = { title: "{{name}}" }
4
+
5
+ export const collections = () => ({})
@@ -0,0 +1,3 @@
1
+ node_modules/
2
+ dist/
3
+ .docs-sdk/
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "docs dev",
7
+ "build": "docs build",
8
+ "check": "docs check",
9
+ "validate": "docs validate"
10
+ },
11
+ "dependencies": {
12
+ "@docs-sdk-dev/cli": "{{version}}",
13
+ "@docs-sdk-dev/solid": "{{version}}"
14
+ }
15
+ }