droppage 0.2.0 → 0.2.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 +23 -0
- package/dist/cli.js +18 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,6 +56,10 @@ Open the printed link in any browser. That's it.
|
|
|
56
56
|
|
|
57
57
|
Run `droppage <command> --help` for full option details.
|
|
58
58
|
|
|
59
|
+
Slugs from 0.2.1 on never start with `-`. If an older page's slug does (say `-AbC12xYz9`), put `--` in front of
|
|
60
|
+
it, with any options before the `--`: `droppage expire -- -AbC12xYz9 never` or
|
|
61
|
+
`droppage update --expires 7d -- -AbC12xYz9 report.html`. The CLI prints the same hint when it happens.
|
|
62
|
+
|
|
59
63
|
## Access modes
|
|
60
64
|
|
|
61
65
|
| Upload flag | Mode | Who can open the link |
|
|
@@ -128,6 +132,25 @@ its images stop working. A daily cleanup then deletes the page and its images fo
|
|
|
128
132
|
`droppage list` shows an EXPIRES column (`never` or a date); `list --json` rows have `expires_at`
|
|
129
133
|
(`null` means never).
|
|
130
134
|
|
|
135
|
+
## Sharing reports and dashboards
|
|
136
|
+
|
|
137
|
+
droppage is a quick way to send an analysis to people who don't have your tools: a dashboard for your
|
|
138
|
+
team, a weekly KPI or stakeholder report, a client deliverable, a notebook export. They open a link.
|
|
139
|
+
|
|
140
|
+
- **Export one HTML file**, up to 5 MB, with the data inside it: `jupyter nbconvert --to html
|
|
141
|
+
analysis.ipynb`, Plotly's `fig.write_html("report.html", include_plotlyjs="cdn")`, Altair's
|
|
142
|
+
`chart.save("report.html")`, or your own Chart.js / ECharts page. Scripts run, so interactive
|
|
143
|
+
charts work, and chart libraries can load from a CDN.
|
|
144
|
+
- **Pages run in a sandbox**: `localStorage`, cookies, and same-origin requests are not available, so
|
|
145
|
+
keep the data in the file rather than fetching it.
|
|
146
|
+
- **Pick who sees it.** `--email cfo@example.com,ops@example.com` for named people (Builder; manage
|
|
147
|
+
them later with `droppage recipients`), `--password` for a group link (Starter and Builder),
|
|
148
|
+
`--private` for a draft. On the Free plan, pages can be public or private, without a password or email list.
|
|
149
|
+
- **Same link every week.** `droppage update <slug> report.html` replaces the report and keeps the
|
|
150
|
+
link and its access settings (Starter and Builder). Use `--expires 30d` for one-off deliverables.
|
|
151
|
+
- **Views are people.** `droppage list --json` shows `view_count` (unique visitors) and
|
|
152
|
+
`last_viewed_at` for each report.
|
|
153
|
+
|
|
131
154
|
## For agents and scripts
|
|
132
155
|
|
|
133
156
|
droppage keeps a strict stream contract so it is safe to call from automation:
|
package/dist/cli.js
CHANGED
|
@@ -15,7 +15,7 @@ var init_package = __esm({
|
|
|
15
15
|
"package.json"() {
|
|
16
16
|
package_default = {
|
|
17
17
|
name: "droppage",
|
|
18
|
-
version: "0.2.
|
|
18
|
+
version: "0.2.1",
|
|
19
19
|
description: "Publish HTML files as shareable, access-controlled live pages",
|
|
20
20
|
type: "module",
|
|
21
21
|
license: "Apache-2.0",
|
|
@@ -728,15 +728,26 @@ var init_page_images = __esm({
|
|
|
728
728
|
// src/lib/slug.ts
|
|
729
729
|
import { customAlphabet } from "nanoid";
|
|
730
730
|
function createSlug() {
|
|
731
|
-
return
|
|
731
|
+
return first() + rest();
|
|
732
732
|
}
|
|
733
|
-
|
|
733
|
+
function dashSlugHint(error) {
|
|
734
|
+
const slug = DASH_SLUG_ERROR.exec(error)?.[1];
|
|
735
|
+
if (!slug) return "";
|
|
736
|
+
return `droppage: if ${slug} is a page, put -- in front of it (options go before the --), for example:
|
|
737
|
+
droppage expire -- ${slug} never
|
|
738
|
+
droppage update --expires 7d -- ${slug} report.html
|
|
739
|
+
`;
|
|
740
|
+
}
|
|
741
|
+
var SLUG_LENGTH, alphanumeric, alphabet, first, rest, DASH_SLUG_ERROR;
|
|
734
742
|
var init_slug = __esm({
|
|
735
743
|
"src/lib/slug.ts"() {
|
|
736
744
|
"use strict";
|
|
737
745
|
SLUG_LENGTH = 10;
|
|
738
|
-
|
|
739
|
-
|
|
746
|
+
alphanumeric = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
747
|
+
alphabet = `${alphanumeric}_-`;
|
|
748
|
+
first = customAlphabet(alphanumeric, 1);
|
|
749
|
+
rest = customAlphabet(alphabet, SLUG_LENGTH - 1);
|
|
750
|
+
DASH_SLUG_ERROR = new RegExp(`unknown option '(-[A-Za-z0-9_][A-Za-z0-9_-]{${SLUG_LENGTH - 2}})'`);
|
|
740
751
|
}
|
|
741
752
|
});
|
|
742
753
|
|
|
@@ -1934,7 +1945,7 @@ import { Command } from "commander";
|
|
|
1934
1945
|
function createProgram() {
|
|
1935
1946
|
const program2 = new Command().name("droppage").description(
|
|
1936
1947
|
"Publish HTML files as shareable, access-controlled live pages"
|
|
1937
|
-
).version(package_default.version);
|
|
1948
|
+
).version(package_default.version).configureOutput({ outputError: (str, write) => write(str + dashSlugHint(str)) });
|
|
1938
1949
|
registerLogin(program2);
|
|
1939
1950
|
registerLogout(program2);
|
|
1940
1951
|
registerUpload(program2);
|
|
@@ -1963,6 +1974,7 @@ var init_index = __esm({
|
|
|
1963
1974
|
init_feedback2();
|
|
1964
1975
|
init_upgrade();
|
|
1965
1976
|
init_image();
|
|
1977
|
+
init_slug();
|
|
1966
1978
|
}
|
|
1967
1979
|
});
|
|
1968
1980
|
|