ghostcn 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +160 -0
  2. package/package.json +4 -3
package/README.md ADDED
@@ -0,0 +1,160 @@
1
+ # ghostcn
2
+
3
+ <p align="center">
4
+ <strong>The <code>shadcn/ui</code> for Ghost CMS themes.</strong><br>
5
+ Beautiful, accessible, copy-pasteable Handlebars partials and stylesheets for modern Ghost theme development.
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="https://www.npmjs.com/package/ghostcn"><img src="https://img.shields.io/npm/v/ghostcn?color=6366f1&style=flat-square" alt="npm version" /></a>
10
+ <a href="https://www.npmjs.com/package/ghostcn"><img src="https://img.shields.io/npm/dm/ghostcn?color=3b82f6&style=flat-square" alt="npm downloads" /></a>
11
+ <a href="https://ghost.org"><img src="https://img.shields.io/badge/Ghost-%3E%3D5.0.0-15171a?style=flat-square" alt="Ghost Version" /></a>
12
+ <a href="https://gscan.ghost.org"><img src="https://img.shields.io/badge/gscan-100%25%20valid-22c55e?style=flat-square" alt="gscan validation" /></a>
13
+ <a href="https://github.com/Geekbits-Org/ghost-ui/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License" /></a>
14
+ </p>
15
+
16
+ ---
17
+
18
+ ## What is ghostcn?
19
+
20
+ **ghostcn** brings the modern component distribution model to **Ghost CMS**.
21
+
22
+ Instead of installing cumbersome plugins or monolithic npm modules that lock down your markup, ghostcn injects clean, production-ready **Handlebars (`.hbs`) partials** and **CSS** directly into your theme repository.
23
+
24
+ You own the code. You customize the classes. Zero vendor lock-in.
25
+
26
+ ---
27
+
28
+ ## Features
29
+
30
+ - ?? **Theme-Native**: Directly installs raw Handlebars partials and CSS into your theme folders.
31
+ - ? **Zero Latency**: Bundled offline registry ensures blazing fast installation even without internet.
32
+ - ?? **Interactive Multi-Select**: Run `npx ghostcn add` without arguments to select and batch-install multiple components interactively.
33
+ - ?? **Tailwind & Vanilla CSS**: Pre-styled with utility classes and full Vanilla CSS stylesheets with Ghost CSS custom properties.
34
+ - ?? **Ghost Members API**: Native support for Ghost attributes (`data-members-form="subscribe"`, Portal checkout triggers).
35
+ - ??? **100% gscan Validated**: All components strictly adhere to Ghost theme guidelines and pass official `gscan` checks with 0 errors.
36
+
37
+ ---
38
+
39
+ ## Available Components
40
+
41
+ | Component | Description | Files |
42
+ | :--- | :--- | :--- |
43
+ | **`newsletter-form`** | Native Ghost members subscription form with success/error states | `newsletter-form.hbs`, `newsletter-form.css` |
44
+ | **`pricing-table`** | Membership tiers (Free, Monthly, Annual) with native Portal checkout triggers | `pricing-table.hbs`, `pricing-table.css` |
45
+ | **`author-card`** | Author bio box with avatar, biography, social links, and post counts | `author-card.hbs`, `author-card.css` |
46
+ | **`post-card`** | Post loop preview card with feature image, tags, excerpt, and reading time | `post-card.hbs`, `post-card.css` |
47
+
48
+ ---
49
+
50
+ ## Quick Start
51
+
52
+ ### 1. Initialize your Ghost Theme
53
+
54
+ Run the `init` command from the root of any Ghost theme (must have `engines.ghost` in its `package.json`):
55
+
56
+ ```bash
57
+ npx ghostcn init
58
+ ```
59
+
60
+ Or pass `-y` to use default paths non-interactively:
61
+ ```bash
62
+ npx ghostcn init -y
63
+ ```
64
+
65
+ This creates a `components.json` configuration file:
66
+ ```json
67
+ {
68
+ "style": "tailwind",
69
+ "aliases": {
70
+ "partials": "partials/components",
71
+ "styles": "assets/css/components"
72
+ }
73
+ }
74
+ ```
75
+
76
+ ### 2. Browse Components
77
+
78
+ List all available components in the registry:
79
+
80
+ ```bash
81
+ npx ghostcn list
82
+ ```
83
+
84
+ ### 3. Add Components
85
+
86
+ Add a specific component:
87
+ ```bash
88
+ npx ghostcn add newsletter-form
89
+ ```
90
+
91
+ Or run `add` without arguments to pick interactively from a checklist:
92
+ ```bash
93
+ npx ghostcn add
94
+ ```
95
+
96
+ To overwrite existing files without prompts:
97
+ ```bash
98
+ npx ghostcn add pricing-table -y
99
+ ```
100
+
101
+ ### 4. Use in your Templates
102
+
103
+ Include the installed partial anywhere in your Handlebars templates:
104
+
105
+ ```handlebars
106
+ {{!-- Newsletter Form --}}
107
+ {{> "components/newsletter-form" title="Subscribe to our Newsletter"}}
108
+
109
+ {{!-- Pricing & Membership Table --}}
110
+ {{> "components/pricing-table" title="Choose your membership plan"}}
111
+
112
+ {{!-- Author Card --}}
113
+ {{#primary_author}}
114
+ {{> "components/author-card"}}
115
+ {{/primary_author}}
116
+
117
+ {{!-- Post Loop --}}
118
+ {{#foreach posts}}
119
+ {{> "components/post-card"}}
120
+ {{/foreach}}
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Project Structure
126
+
127
+ ```text
128
+ ??? packages/
129
+ ? ??? cli/ # ghostcn CLI (Commander, Prompts, TypeScript, tests)
130
+ ??? registry/
131
+ ? ??? index.json # Registry catalog index
132
+ ? ??? components/ # Component manifests and templates
133
+ ??? example-theme/ # Sample Ghost theme showing integration
134
+ ??? .github/workflows/ # Automated CI pipeline
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Development & Testing
140
+
141
+ ```bash
142
+ # Install dependencies
143
+ npm install
144
+
145
+ # Build CLI and bundle registry
146
+ npm run build
147
+
148
+ # Run automated tests
149
+ npm test
150
+
151
+ # Verify theme compatibility with Ghost validator
152
+ cd example-theme
153
+ npx gscan .
154
+ ```
155
+
156
+ ---
157
+
158
+ ## License
159
+
160
+ MIT ? [Geekbits Org](https://github.com/Geekbits-Org)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghostcn",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "The shadcn/ui for Ghost CMS themes - component distribution system",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,10 +9,11 @@
9
9
  "ghost-ui": "dist/index.js"
10
10
  },
11
11
  "files": [
12
- "dist"
12
+ "dist",
13
+ "README.md"
13
14
  ],
14
15
  "scripts": {
15
- "build": "tsc && node -e \"const fs=require('fs'); const path=require('path'); const src=path.resolve('../../registry'); const dest=path.resolve('dist/registry'); if(fs.existsSync(src)){fs.cpSync(src, dest, {recursive:true});}\"",
16
+ "build": "tsc && node -e \"const fs=require('fs'); const path=require('path'); if(fs.existsSync('../../registry')){fs.cpSync('../../registry', 'dist/registry', {recursive:true});} if(fs.existsSync('../../README.md')){fs.copyFileSync('../../README.md', 'README.md');}\"",
16
17
  "prepublishOnly": "npm run build",
17
18
  "start": "ts-node src/index.ts",
18
19
  "dev": "ts-node src/index.ts",