@design-drafts/cli 0.0.0 → 0.2.0

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 Craigory Coppola
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 ADDED
@@ -0,0 +1,83 @@
1
+ # @design-drafts/cli
2
+
3
+ Push static site previews as branches to a **design-drafts** repo, and have
4
+ them deployed to GitHub Pages automatically.
5
+
6
+ A *host* repo collects many *draft* previews. You scaffold a host once, then
7
+ push any built static directory as a draft branch; a GitHub Actions workflow
8
+ publishes each branch under its own path on GitHub Pages and an index site
9
+ links them all together.
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ # one-off
15
+ npx @design-drafts/cli --help
16
+
17
+ # or install globally for the `design-drafts` binary
18
+ npm i -g @design-drafts/cli
19
+ ```
20
+
21
+ ## Commands
22
+
23
+ ### `design-drafts push [path]`
24
+
25
+ Push a built static directory (default `.`) as a draft preview branch. This is
26
+ the default command, so `design-drafts ./dist` works too.
27
+
28
+ ```sh
29
+ design-drafts push ./dist --repo my-org/design-previews --site-name homepage-v2
30
+ ```
31
+
32
+ - `--repo <org/repo>` — the host repo to push to (remembered after the first run).
33
+ - `--site-name <name>` — branch/preview name (prompted if omitted).
34
+ - `--prefix <prefix>` — branch prefix for previews (default `drafts/`; pass `""` to push without one).
35
+
36
+ ### `design-drafts init host`
37
+
38
+ Scaffold a new GitHub repo configured to host draft previews (deploy workflow,
39
+ index site, Pages setup).
40
+
41
+ ```sh
42
+ design-drafts init host --repo my-org/design-previews
43
+ ```
44
+
45
+ - `--private` — create the GitHub repo as private.
46
+ - `--yes` — skip the confirmation prompt before GitHub setup.
47
+
48
+ ### `design-drafts init draft [directory]`
49
+
50
+ Scaffold a new draft directory locally.
51
+
52
+ ```sh
53
+ design-drafts init draft ./my-draft
54
+ ```
55
+
56
+ ### `design-drafts preview [path]`
57
+
58
+ Serve a work-in-progress draft directory (default `.`) over HTTP so you can view
59
+ it locally before pushing. The directory must contain a `design-drafts.config.json`.
60
+
61
+ ```sh
62
+ design-drafts preview ./my-draft
63
+ ```
64
+
65
+ - `--port <n>` — port to serve on (default `4321`; auto-increments to the next
66
+ free port unless you set it explicitly).
67
+ - `--no-open` — don't open a browser, just print the URL.
68
+
69
+ When a requested directory has no `index.html` (e.g. a draft whose pages are
70
+ `about.html`, `pricing.html`, … with no home page yet), the server returns a
71
+ generated index linking to every `.html` page in the draft so you can navigate
72
+ without one.
73
+
74
+ ## Configuration
75
+
76
+ Shared options (`--repo`, `--site-name`, `--template-ref`) can be supplied via
77
+ flags, the `DESIGN_DRAFTS_*` environment variables, or a JSON config file. The
78
+ `--repo` value is persisted to a per-user config after the first successful
79
+ push, so subsequent runs don't need it.
80
+
81
+ ## License
82
+
83
+ MIT
package/bin.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import('./dist/index.mjs');