codepen-demokit 0.0.0-stage → 1.0.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/README.md +229 -2
- package/bin/cli.mjs +154 -0
- package/lib/build-json.mjs +439 -0
- package/lib/build-site.mjs +193 -0
- package/lib/config.mjs +245 -0
- package/lib/init.mjs +651 -0
- package/lib/serve.mjs +369 -0
- package/lib/sync-codepen.mjs +1326 -0
- package/package.json +35 -4
- package/shell/index.html +48 -0
- package/shell/scripts.js +201 -0
- package/shell/styles.css +299 -0
- package/templates/AGENTS.md +76 -0
- package/templates/README.md +62 -0
- package/templates/config.json.example +10 -0
- package/templates/gitignore +27 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# My CodePen Demos
|
|
2
|
+
|
|
3
|
+
A collection of self-contained web demos organized with [`codepen-demokit`](https://www.npmjs.com/package/codepen-demokit) and synced with CodePen 2.0.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
Install dependencies (requires Node.js 20+) and start the local dev server:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install
|
|
11
|
+
npm start
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Open [http://127.0.0.1:3000](http://127.0.0.1:3000) to browse.
|
|
15
|
+
|
|
16
|
+
- Serve a specific demo folder directly as root: `npm start "group/demo"`
|
|
17
|
+
- Override the port: `PORT=8080 npm start`
|
|
18
|
+
- Build a static deployable site into `dist/`: `npm run build`
|
|
19
|
+
|
|
20
|
+
## Syncing with CodePen
|
|
21
|
+
|
|
22
|
+
This repository syncs demos in `src/` with CodePen 2.0 via `codepen-demokit` (powered by [CodePen Commander](https://www.npmjs.com/package/codepen-commander) under the hood).
|
|
23
|
+
|
|
24
|
+
### One-time setup
|
|
25
|
+
|
|
26
|
+
1. Edit [`config.json`](./config.json) (see [`config.json.example`](./config.json.example)) and set `codepen.user` and `codepen.defaultVisibility`.
|
|
27
|
+
2. Authenticate your CodePen API v2 key (stored in `~/.cdpn`, never committed):
|
|
28
|
+
```sh
|
|
29
|
+
npx cdpn auth login <your-codepen-username>
|
|
30
|
+
npx cdpn auth status
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### CodePen commands
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
npm run cdpn:sync # Two-way sync across src/
|
|
37
|
+
npm run cdpn:push # Push local edits and create Pens for unlinked demos
|
|
38
|
+
npm run cdpn:pull # Pull remote updates for linked demos
|
|
39
|
+
npm run cdpn:delete # Delete linked Pens on CodePen (retains Pen info in .cdpn.json)
|
|
40
|
+
npm run cdpn:clone -- <url> [folder] # Clone a Pen into src/ via `cdpn clone`
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Scope any bulk sync command to a group, subgroup, or single demo folder inside `src/`, and pass `--dry-run` to preview:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
npm run cdpn:push -- my-group --dry-run
|
|
47
|
+
npm run cdpn:pull -- my-group/my-demo
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
For individual Pen commands (`open`, `status`, `fork`, `deploy`, `list`, etc.), run `npx cdpn <command>` (works from the repo root or inside any `src/<demo>/` folder) or `npm run cdpn -- <command>`—or optionally install CodePen Commander globally (`npm install -g codepen-commander`) to run bare `cdpn` directly.
|
|
51
|
+
|
|
52
|
+
## Updating `codepen-demokit`
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
npm update codepen-demokit
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Demos
|
|
59
|
+
|
|
60
|
+
<!-- Add your demos below as you create them inside src/ -->
|
|
61
|
+
|
|
62
|
+
_No demos yet._
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# OS
|
|
2
|
+
.DS_Store
|
|
3
|
+
._*
|
|
4
|
+
Thumbs.db
|
|
5
|
+
|
|
6
|
+
# Node
|
|
7
|
+
node_modules/
|
|
8
|
+
npm-debug.log*
|
|
9
|
+
pnpm-debug.log*
|
|
10
|
+
yarn-debug.log*
|
|
11
|
+
|
|
12
|
+
# Editors
|
|
13
|
+
.vscode/
|
|
14
|
+
.idea/
|
|
15
|
+
*.swp
|
|
16
|
+
*.swo
|
|
17
|
+
|
|
18
|
+
# Local environment & logs
|
|
19
|
+
.env
|
|
20
|
+
.env.local
|
|
21
|
+
*.log
|
|
22
|
+
|
|
23
|
+
# CodePen Commander credentials (keep per-demo .cdpn.json committed)
|
|
24
|
+
.cdpn
|
|
25
|
+
|
|
26
|
+
# Generated static build output
|
|
27
|
+
dist/
|