@profullstack/waitlist 0.16.1 → 0.17.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 +33 -1
- package/package.json +2 -2
- package/src/build.js +3 -1
- package/src/plugins.js +43 -1
package/README.md
CHANGED
|
@@ -120,7 +120,7 @@ The page reports one exposure a day; a signup is the conversion. Both go through
|
|
|
120
120
|
waitlist API, which holds the CrawlProof token. Stop the experiment with a winner in
|
|
121
121
|
CrawlProof and every page switches to it. Turn it off per site with `"ab": false`.
|
|
122
122
|
|
|
123
|
-
## Plugins (0.4; buyaday 0.6; book + promo 0.7; affiliate 0.9; paid referral terms 0.13; advisor 0.14; builder 0.15)
|
|
123
|
+
## Plugins (0.4; buyaday 0.6; book + promo 0.7; affiliate 0.9; paid referral terms 0.13; advisor 0.14; builder 0.15; builds 0.17)
|
|
124
124
|
|
|
125
125
|
Every page showcases all plugins by default. Pick per site in `sites.json`:
|
|
126
126
|
`"plugins": ["form", "board"]` keeps only those, `"plugins": { "faq": false }` drops some.
|
|
@@ -144,6 +144,38 @@ Every page showcases all plugins by default. Pick per site in `sites.json`:
|
|
|
144
144
|
| `builder` | A **Build** page (`builder/`) so the people waiting can help build the app: start or clone its repo on c0mpute git (public repos are kept by the network and free to clone), open the site's schema in dbml.db (a static `builder/schema.dbml`, from `builder.dbml` in sites.json or a starter, linked with the editor's own `?code=` share format, so there is no database service to run) and create a live Postgres with `c0mpute db create`, prototype features with feature.agent (linked with `?ref=<host>`), and take ideas to the name's board. Plain HTML, no script, no server. Settings: `builder: { repo: "c0mpute://<owner key>/<repo>", dbml: "Table ... { }", schema: "https://..." }` (`schema` overrides the dbml.db link); without `repo` the page shows how to start one |
|
|
145
145
|
| (search, resources) | Every search item and resource carries pit.world's result tools from `https://pit.world/widgets.js`: vote, Summarize, Listen and Share. They work without an account; on a pit.world host, "Sign in with CoinPay" (OAuth 2.1 + PKCE through pit.world) raises the limits. From a terminal the same account is `pit login` |
|
|
146
146
|
| `affiliate` | Referrals (0.9). Every signup gets a personal link `https://<site>/?ref=<code>`, shown right after joining by `<pf-referral-share>` ("You are #X of Y, N people referred.", copy button, plain X/Bluesky/LinkedIn/email links) and in the confirmation email with a signed status page. A visitor who arrives with `?ref=` keeps a 30-day first-party, first-touch cookie `wl_ref`; their signup credits the referrer once they confirm. Each confirmed referral moves the referrer up `bumpPlaces`. A "Move up the list" section bakes `<pf-referral-leaderboard>` (handles or masked emails only). With `buyaday` on, a door sold to a referred visitor credits the referrer too (holi.days `ref=<code>.<site>`), and since 0.13 the page states the paid terms: the referrer earns `commissionPct` of what that visitor pays and the visitor gets `discountPct` off. See below |
|
|
147
|
+
| `builds` | Community builds (0.17). A "Build this site" section: one paragraph saying the community is building this name, the current builds baked into the page as `<pf-builds>` (title, author, summary, votes, a Preview link that opens the contributor's own c0mpute site in a new tab, Vote and Report), and the commands a contributor runs. Confirmed waitlist members vote; the owner approves builds and picks the winner. Nothing a contributor publishes is copied into or framed on the page. See below |
|
|
148
|
+
|
|
149
|
+
### Community builds (`builds`, 0.17)
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{ "name": "comp.lang", "builds": { "enabled": true } }
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
On by default. `"builds": { "enabled": false }` or `"plugins": { "builds": false }` turns it
|
|
156
|
+
off. The registry lives on the API (moshcoding.com, `/api/builds`); the element is
|
|
157
|
+
`<pf-builds>` from `@profullstack/marketing-widgets` 0.4.
|
|
158
|
+
|
|
159
|
+
- The list is baked at build time, so it shows with no script and crawlers read it. A full
|
|
160
|
+
rebuild of every site takes hours, so `<pf-builds>` refreshes the list live on every visit and
|
|
161
|
+
runs voting and "Start a build" in the browser.
|
|
162
|
+
- A build is a static site the contributor publishes on c0mpute under their own account. The
|
|
163
|
+
page links to it at `https://gateway.c0mpute.com/s/<site_id>/` (a sandboxed origin that cannot
|
|
164
|
+
read this site's cookies) with `target="_blank"` and `rel="noopener noreferrer nofollow ugc"`.
|
|
165
|
+
There is no iframe.
|
|
166
|
+
- The commands on the page:
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
curl -fsSL https://c0mpute.com/install.sh | sh
|
|
170
|
+
mkdir -p site/.well-known && echo "<your claim>" > site/.well-known/pit-build.txt
|
|
171
|
+
c0mpute hosting publish ./site --name comp-lang
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
"Start a build" signs the contributor in with CoinPay, gives them their claim, and verifies
|
|
175
|
+
the site id c0mpute printed. The build shows once the owner approves it.
|
|
176
|
+
- Voting is for confirmed waitlist members. The link back to the site on the "email confirmed"
|
|
177
|
+
page (and on the signed status page from the confirmation email) carries a member credential
|
|
178
|
+
in its fragment; `<pf-builds>` keeps it in `localStorage` and sends it with each vote.
|
|
147
179
|
|
|
148
180
|
### Referrals (`affiliate`)
|
|
149
181
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@profullstack/waitlist",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Email waitlist for any launch page: a <waitlist-form> web component, a live signup chart, and a static-site builder on @profullstack/css + @profullstack/charts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@profullstack/footer": "^0.7.3",
|
|
52
52
|
"@resvg/resvg-js": "^2.6.2",
|
|
53
53
|
"@profullstack/comments": "^0.2.0",
|
|
54
|
-
"@profullstack/marketing-widgets": "^0.
|
|
54
|
+
"@profullstack/marketing-widgets": "^0.4.0",
|
|
55
55
|
"@profullstack/cross-promo": "^0.2.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
package/src/build.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* for one name, ready for `c0mpute hosting publish <dir> --name <site>`.
|
|
4
4
|
*/
|
|
5
5
|
import { mkdir, writeFile, copyFile, readFile, readdir } from 'node:fs/promises';
|
|
6
|
-
import { pluginSet, keywordsFor, runPlugins, baseSlot, affiliateConfig } from './plugins.js';
|
|
6
|
+
import { pluginSet, keywordsFor, runPlugins, baseSlot, affiliateConfig, buildsConfig } from './plugins.js';
|
|
7
7
|
import { ADVISOR_PATH, advisorCardHtml, advisorContextJson, advisorCorpus, advisorConfig, advisorDataset, advisorMeta, advisorPageHtml } from './advisor.js';
|
|
8
8
|
import { BUILDER_PATH, builderCardHtml, builderConfig, builderMeta, builderPageHtml, builderSchema } from './builder.js';
|
|
9
9
|
import { boardLive, boardUrl, brandJson, navHtml } from './community.js';
|
|
@@ -121,6 +121,7 @@ export function normalize(spec) {
|
|
|
121
121
|
crawlproof: spec.crawlproof === undefined ? (moshpit ? MOSHPIT_STATS_SITE : null) : spec.crawlproof,
|
|
122
122
|
plugins: pluginSet(spec.plugins),
|
|
123
123
|
affiliate: affiliateConfig(spec.affiliate),
|
|
124
|
+
builds: buildsConfig(spec.builds),
|
|
124
125
|
ab: spec.ab === false ? null : { ...DEFAULT_AB, ...(spec.ab || {}) },
|
|
125
126
|
lang: spec.lang || 'en',
|
|
126
127
|
locale: spec.locale || 'en_US',
|
|
@@ -147,6 +148,7 @@ export function normalize(spec) {
|
|
|
147
148
|
s.imageAlt = spec.imageAlt || d.imageAlt;
|
|
148
149
|
if (!s.plugins.has('ab')) s.ab = null;
|
|
149
150
|
if (!s.affiliate.enabled) s.plugins.delete('affiliate');
|
|
151
|
+
if (!s.builds.enabled) s.plugins.delete('builds');
|
|
150
152
|
if (!s.keywords.length) s.keywords = keywordsFor(s);
|
|
151
153
|
s.resourcesQuery = spec.resourcesQuery || '';
|
|
152
154
|
s.searchQuery = spec.searchQuery || '';
|
package/src/plugins.js
CHANGED
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
* affiliate referral links, place bumps and a leaderboard (`"affiliate": {...}`, see
|
|
16
16
|
* affiliateConfig); door sales credit the referrer when buyaday is on, and
|
|
17
17
|
* the page then states the paid terms (commissionPct / discountPct).
|
|
18
|
+
* builds "Build this site": the community builds of this name (anyone may publish
|
|
19
|
+
* one on c0mpute under their own account), previews, member votes and the
|
|
20
|
+
* contributor commands (`"builds": {"enabled": true}`, see buildsConfig).
|
|
18
21
|
*/
|
|
19
22
|
import { mkdir, readFile, writeFile, copyFile } from 'node:fs/promises';
|
|
20
23
|
import { createRequire } from 'node:module';
|
|
@@ -25,7 +28,7 @@ import { fetchSearch, searchCardHtml } from './search.js';
|
|
|
25
28
|
|
|
26
29
|
const require = createRequire(import.meta.url);
|
|
27
30
|
|
|
28
|
-
export const PLUGINS = ['form', 'stats', 'ab', 'faq', 'search', 'resources', 'board', 'share', 'feed', 'buyaday', 'book', 'promo', 'affiliate', 'community', 'advisor', 'builder'];
|
|
31
|
+
export const PLUGINS = ['form', 'stats', 'ab', 'faq', 'search', 'resources', 'board', 'share', 'feed', 'buyaday', 'book', 'promo', 'affiliate', 'community', 'advisor', 'builder', 'builds'];
|
|
29
32
|
|
|
30
33
|
/** Resolve a site's `plugins` setting to a Set (default: all of them). */
|
|
31
34
|
export function pluginSet(setting) {
|
|
@@ -114,6 +117,37 @@ export async function affiliateHtml(s, { fetchImpl } = {}) {
|
|
|
114
117
|
</section>`;
|
|
115
118
|
}
|
|
116
119
|
|
|
120
|
+
/**
|
|
121
|
+
* The `builds` plugin's settings from sites.json: `"builds": { "enabled": true }`.
|
|
122
|
+
* On by default; `"builds": { "enabled": false }`, `"builds": false` or
|
|
123
|
+
* `"plugins": { "builds": false }` turns it off.
|
|
124
|
+
*/
|
|
125
|
+
export function buildsConfig(raw) {
|
|
126
|
+
const b = raw && typeof raw === 'object' ? raw : {};
|
|
127
|
+
return { enabled: raw === false ? false : b.enabled !== false };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The "Build this site" section: what community builds are, the current builds
|
|
132
|
+
* (baked, refreshed live by <pf-builds>, which also runs voting and the start
|
|
133
|
+
* flow), and the commands a contributor runs. A build is a link to the
|
|
134
|
+
* contributor's own c0mpute site: nothing of it is copied into or framed on
|
|
135
|
+
* this page.
|
|
136
|
+
*/
|
|
137
|
+
export async function buildsHtml(s, { fetchImpl } = {}) {
|
|
138
|
+
const mw = await import('@profullstack/marketing-widgets');
|
|
139
|
+
const list = await mw.buildsHtml({ dn: s.dn, api: s.api, fetchImpl });
|
|
140
|
+
const why = `${s.title} is not built yet, and the community is building it. Anyone can publish their own version as a static site on c0mpute, under their own account, and submit it here. Confirmed waitlist members vote, and the owner picks the build that becomes the site.`;
|
|
141
|
+
return `<section class="stack waitlist-builds" aria-labelledby="builds"><h2 id="builds">Build this site</h2>
|
|
142
|
+
<p>${esc(why)}</p>
|
|
143
|
+
${list}
|
|
144
|
+
<h3>Publish a build</h3>
|
|
145
|
+
<p>Install c0mpute, start a build above to get your claim, then run:</p>
|
|
146
|
+
<pre><code>${esc(`${mw.C0MPUTE_INSTALL}\n${mw.buildCommands({ dn: s.dn })}`)}</code></pre>
|
|
147
|
+
<p class="muted">c0mpute prints a site id and a URL. Paste the id into "Start a build" to verify it. A build is a static site of 25 MiB or less, shown after the owner approves it. More at <a href="https://c0mpute.com" rel="noopener">c0mpute.com</a>.</p>
|
|
148
|
+
</section>`;
|
|
149
|
+
}
|
|
150
|
+
|
|
117
151
|
const STOP = new Set('a an and are as at be by for from has have in into is it its of on or that the this to was we with you your our not yet will one all any get it\'s now new site'.split(' '));
|
|
118
152
|
|
|
119
153
|
/** Keywords for a site: its own list, else the name's labels and the tagline's meaningful words. */
|
|
@@ -251,6 +285,14 @@ export async function runPlugins(s, out, { fetchImpl, cacheDir, maxAgeMs, search
|
|
|
251
285
|
await copyMarketingWidgets(mw, out, slot);
|
|
252
286
|
slot.sections.push(await affiliateHtml(s, { fetchImpl }));
|
|
253
287
|
}
|
|
288
|
+
if (on.has('builds')) {
|
|
289
|
+
// Community builds of this name (@profullstack/marketing-widgets 0.4 on
|
|
290
|
+
// moshcoding's /api/builds): the list is baked, <pf-builds> refreshes it and
|
|
291
|
+
// runs voting and "Start a build". Previews are links to c0mpute, never frames.
|
|
292
|
+
const mw = await import('@profullstack/marketing-widgets');
|
|
293
|
+
await copyMarketingWidgets(mw, out, slot);
|
|
294
|
+
slot.sections.push(await buildsHtml(s, { fetchImpl }));
|
|
295
|
+
}
|
|
254
296
|
if (on.has('book')) {
|
|
255
297
|
await copyFile(join(dirname(new URL(import.meta.url).pathname), 'book.js'), join(out, 'assets', 'book.js'));
|
|
256
298
|
slot.sections.push(bookHtml(s));
|