content-grade 1.1.1 → 1.1.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/bin/content-grade.js +25 -33
- package/package.json +1 -1
package/bin/content-grade.js
CHANGED
|
@@ -125,7 +125,7 @@ function getUpgradeMessage() {
|
|
|
125
125
|
return '';
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
// Show usage
|
|
128
|
+
// Show usage quota + upgrade CTA in a visually distinct box after each free run.
|
|
129
129
|
// count = daily usage AFTER this run.
|
|
130
130
|
function showFreeTierCTA(count) {
|
|
131
131
|
const limit = TIER_LIMITS.free;
|
|
@@ -135,29 +135,26 @@ function showFreeTierCTA(count) {
|
|
|
135
135
|
const ctaStrength = remaining === 0 ? 'strong' : remaining <= 1 ? 'warning' : 'nudge';
|
|
136
136
|
recordEvent({ event: 'upgrade_prompt_shown', run_count: count, cta_strength: ctaStrength, cta_context: 'post_run' });
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
const quotaColor = remaining === 0 ? RD : remaining <= 1 ? YL : CY;
|
|
139
|
+
const bar = '█'.repeat(count) + '░'.repeat(Math.max(0, limit - count));
|
|
140
|
+
const remainText = remaining === 0
|
|
141
|
+
? `come back tomorrow for ${limit} more`
|
|
142
|
+
: `${remaining} remaining today`;
|
|
143
|
+
const SEP = '─'.repeat(60);
|
|
144
|
+
|
|
145
|
+
blank();
|
|
146
|
+
console.log(` ${D}╭${SEP}${R}`);
|
|
147
|
+
console.log(` ${D}│${R} ${quotaColor}${B}${count}/${limit}${R} ${quotaColor}free analyses used today${R} ${D}[${bar}] ${remainText}${R}`);
|
|
148
|
+
console.log(` ${D}│${R}`);
|
|
149
|
+
console.log(` ${D}│${R} ${WH}Pro unlocks:${R} ${D}Unlimited analyses · Priority processing${R}`);
|
|
150
|
+
console.log(` ${D}│${R} ${D}JSON/HTML export · Bulk grading · CI mode${R}`);
|
|
151
|
+
console.log(` ${D}│${R}`);
|
|
152
|
+
console.log(` ${D}│${R} ${GN}→ Get Pro${R} ${WH}$9/mo, cancel anytime${R}`);
|
|
153
|
+
console.log(` ${D}│${R} ${CY}${UPGRADE_LINKS.free}${R}`);
|
|
154
|
+
console.log(` ${D}│${R}`);
|
|
155
|
+
console.log(` ${D}│${R} ${D}After purchase, activate:${R} ${WH}content-grade activate <your-key>${R}`);
|
|
156
|
+
console.log(` ${D}╰${SEP}${R}`);
|
|
140
157
|
|
|
141
|
-
if (remaining === 0) {
|
|
142
|
-
// Variant D — power user, last run of the day
|
|
143
|
-
console.log(` ${YL}${B}${count}/${limit} — that's all your free runs for today.${R}`);
|
|
144
|
-
blank();
|
|
145
|
-
console.log(` ${WH}You're clearly using this. $9/month removes the cap entirely —${R}`);
|
|
146
|
-
console.log(` ${WH}unlimited analyses, JSON/HTML export, bulk mode. Cancel anytime.${R}`);
|
|
147
|
-
blank();
|
|
148
|
-
console.log(` ${CY}→ ${UPGRADE_LINKS.free}${R}`);
|
|
149
|
-
console.log(` ${D}Or come back tomorrow for ${limit} more free runs.${R}`);
|
|
150
|
-
} else {
|
|
151
|
-
// Variant C — compact post-run teaser with command-relevant Pro feature
|
|
152
|
-
const proFeatureMap = {
|
|
153
|
-
grade: 'Bulk-grade entire directories · CI exit codes · JSON output',
|
|
154
|
-
headline: 'Batch-test 50 headlines at once · CSV export',
|
|
155
|
-
analyze: 'CI integration · exit 1 on below-threshold · JSON pipeline output',
|
|
156
|
-
};
|
|
157
|
-
const feature = proFeatureMap[cmd] || 'Unlimited runs · CI mode · bulk grading';
|
|
158
|
-
console.log(` ${D}[ ${count}/${limit} free runs today · ${R}${WH}Pro: ${feature}${R}${D} · ${CY}${UPGRADE_LINKS.free}${R}${D} ]${R}`);
|
|
159
|
-
}
|
|
160
|
-
hr();
|
|
161
158
|
maybeShowFeedbackCTA(count);
|
|
162
159
|
}
|
|
163
160
|
|
|
@@ -225,20 +222,15 @@ function showCommunityNudge() {
|
|
|
225
222
|
console.log(` ${D}💬 Questions or feedback? Discussions: ${CY}${DISCUSSIONS_URL}${R}`);
|
|
226
223
|
}
|
|
227
224
|
|
|
228
|
-
//
|
|
225
|
+
// Usage quota + upgrade nudge shown after batch runs.
|
|
229
226
|
// count = daily runs used (after this run).
|
|
230
227
|
function showUsageFooter(count) {
|
|
231
228
|
if (isProUser()) return;
|
|
232
229
|
const limit = TIER_LIMITS.free;
|
|
233
230
|
const remaining = Math.max(0, limit - count);
|
|
231
|
+
const quotaColor = remaining === 0 ? RD : remaining <= 1 ? YL : D;
|
|
234
232
|
blank();
|
|
235
|
-
|
|
236
|
-
console.log(` ${RD}[ You've used ${limit}/${limit} free runs today · Pro: unlimited, JSON/HTML export, bulk mode — $9/mo → ${UPGRADE_LINKS.free} ]${R}`);
|
|
237
|
-
} else if (remaining <= 1) {
|
|
238
|
-
console.log(` ${YL}[ You've used ${count}/${limit} free runs today · ${remaining} remaining · Pro: unlimited ($9/mo) → ${UPGRADE_LINKS.free} ]${R}`);
|
|
239
|
-
} else {
|
|
240
|
-
console.log(` ${D}[ You've used ${count}/${limit} free runs today · ${remaining} remaining · Pro: unlimited ($9/mo) → ${UPGRADE_LINKS.free} ]${R}`);
|
|
241
|
-
}
|
|
233
|
+
console.log(` ${quotaColor}${B}${count}/${limit}${R} ${quotaColor}free runs used today${R} ${D}· Pro: unlimited → ${CY}${UPGRADE_LINKS.free}${R}`);
|
|
242
234
|
maybeShowEarlyAdopterCTA(count);
|
|
243
235
|
maybeShowFeedbackCTA(count);
|
|
244
236
|
}
|
|
@@ -270,7 +262,7 @@ function checkFreeTierLimit() {
|
|
|
270
262
|
|
|
271
263
|
blank();
|
|
272
264
|
hr();
|
|
273
|
-
console.log(` ${RD}${B}✗
|
|
265
|
+
console.log(` ${RD}${B}✗ You've used ${limit}/${limit} free analyses today${R}`);
|
|
274
266
|
blank();
|
|
275
267
|
console.log(` ${WH}content-grade Pro${R}${D} — $9/mo, cancel anytime${R}`);
|
|
276
268
|
console.log(` ${D} ├── ${R}${WH}Unlimited analyses${R}${D} — no daily cap${R}`);
|
|
@@ -280,7 +272,7 @@ function checkFreeTierLimit() {
|
|
|
280
272
|
blank();
|
|
281
273
|
console.log(` ${CY}→ Get Pro ${UPGRADE_LINKS.free}${R}`);
|
|
282
274
|
blank();
|
|
283
|
-
console.log(` ${D}
|
|
275
|
+
console.log(` ${D}After purchase, activate: ${R}${WH}content-grade activate <your-key>${R}`);
|
|
284
276
|
hr();
|
|
285
277
|
blank();
|
|
286
278
|
return true;
|
package/package.json
CHANGED