proto-plugin 0.1.0 → 0.1.1

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 CHANGED
@@ -190,21 +190,21 @@ pnpm download-mobbin-references -- --ids=uuid1,uuid2
190
190
 
191
191
  ## Starter prompt (for AI agents)
192
192
 
193
- Copy the block below into a new agent chat to scaffold a host app from scratch. The agent should ask you for a few values up front, then handle the rest (including inferring what to sync from source).
193
+ Copy the block below into a new agent chat to scaffold a host app from scratch. The agent should ask you for a few values up front — **one question at a time** — then handle the rest (including inferring what to sync from source).
194
194
 
195
195
  ````markdown
196
196
  Set up a new Next.js host app for `proto-plugin` — a framework for shareable UI prototypes.
197
197
 
198
198
  ## Before you start — ask me for these
199
199
 
200
- Do not scaffold or run commands until I answer. Ask in one message:
200
+ Do not scaffold or run commands until I answer all four questions. Ask **one question at a time** — wait for my reply before asking the next:
201
201
 
202
- 1. **Host app name** — directory name for the new Next.js project.
203
- 2. **Where to create it** — parent directory (absolute path), or confirm the current workspace.
204
- 3. **Source app path** — absolute path to the real product repo whose UI we will prototype (used for `source/` symlink and sync).
205
- 4. **Optional env** — whether I want comment/screenshot persistence configured now (`KV_REST_API_URL`, `KV_REST_API_TOKEN`, `BLOB_READ_WRITE_TOKEN`) or to skip for later.
202
+ 1. **Host app name** — What should the new Next.js project directory be called? (e.g. `my-product-prototypes`)
203
+ 2. **Where to create it** — Parent directory as an absolute path (e.g. `/Users/maayanalbert/Projects`), or confirm you want it in the current workspace.
204
+ 3. **Source app path** — Absolute path to the real product repo whose UI we'll prototype (used for the `source/` symlink and sync).
205
+ 4. **Optional env** — Should I configure comment/screenshot persistence now (`KV_REST_API_URL`, `KV_REST_API_TOKEN`, `BLOB_READ_WRITE_TOKEN`), or skip that for later?
206
206
 
207
- Wait for my answers, then do all setup yourself.
207
+ After I answer all four, do all setup yourself.
208
208
 
209
209
  ## 1. Scaffold the app
210
210
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proto-plugin",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"
@@ -8,6 +8,8 @@ REGISTRY="https://registry.npmjs.org"
8
8
  DRY_RUN=0
9
9
  TAG="latest"
10
10
  SKIP_VERIFY=0
11
+ SKIP_BUMP=0
12
+ BUMP="patch"
11
13
  OTP=""
12
14
 
13
15
  usage() {
@@ -21,6 +23,8 @@ Options:
21
23
  --tag <tag> npm dist-tag (default: latest)
22
24
  --otp <code> One-time password from your authenticator app
23
25
  --skip-verify Skip pre-publish verification scripts
26
+ --no-bump Publish package.json version as-is (fail if already published)
27
+ --bump <level> Bump level when current version exists on npm: patch, minor, major (default: patch)
24
28
  -h, --help Show this help message
25
29
 
26
30
  Examples:
@@ -47,6 +51,21 @@ while [[ $# -gt 0 ]]; do
47
51
  SKIP_VERIFY=1
48
52
  shift
49
53
  ;;
54
+ --no-bump)
55
+ SKIP_BUMP=1
56
+ shift
57
+ ;;
58
+ --bump)
59
+ BUMP="${2:?Missing value for --bump}"
60
+ case "$BUMP" in
61
+ patch | minor | major) ;;
62
+ *)
63
+ echo "Invalid --bump value: $BUMP (expected patch, minor, or major)" >&2
64
+ exit 1
65
+ ;;
66
+ esac
67
+ shift 2
68
+ ;;
50
69
  --otp)
51
70
  OTP="${2:?Missing value for --otp}"
52
71
  shift 2
@@ -99,6 +118,25 @@ fi
99
118
  PACKAGE_NAME="$(node -pe "require('./package.json').name")"
100
119
  PACKAGE_VERSION="$(node -pe "require('./package.json').version")"
101
120
 
121
+ version_is_published() {
122
+ npm view "${PACKAGE_NAME}@${1}" version --registry "$REGISTRY" >/dev/null 2>&1
123
+ }
124
+
125
+ ensure_unpublished_version() {
126
+ local bump_level="$1"
127
+ while version_is_published "$(node -pe "require('./package.json').version")"; do
128
+ local current
129
+ current="$(node -pe "require('./package.json').version")"
130
+ echo "Version ${current} is already on npm; bumping ${bump_level}..."
131
+ npm version "$bump_level" --no-git-tag-version
132
+ done
133
+ }
134
+
135
+ if [[ "$SKIP_BUMP" -eq 0 ]]; then
136
+ ensure_unpublished_version "$BUMP"
137
+ PACKAGE_VERSION="$(node -pe "require('./package.json').version")"
138
+ fi
139
+
102
140
  echo "Publishing ${PACKAGE_NAME}@${PACKAGE_VERSION}"
103
141
  echo "Registry: ${REGISTRY}"
104
142
  echo "Access: public (unscoped)"
@@ -144,4 +182,7 @@ if [[ "$DRY_RUN" -eq 0 ]]; then
144
182
  echo "Install with:"
145
183
  echo " npm install ${PACKAGE_NAME}@${PACKAGE_VERSION}"
146
184
  echo " pnpm add ${PACKAGE_NAME}@${PACKAGE_VERSION}"
185
+ if [[ "$SKIP_BUMP" -eq 0 ]]; then
186
+ echo "Commit the version bump in package.json when ready."
187
+ fi
147
188
  fi