vowel 0.6.3 → 0.7.0-beta.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 +23 -17
- package/bin.js +87 -30
- package/cli.js +15 -0
- package/config.js +102 -16
- package/extractDate.js +70 -6
- package/index.js +14 -5
- package/package.json +42 -7
- package/plugins/assets/index.js +65 -0
- package/plugins/atproto/index.js +132 -0
- package/plugins/atproto/password.js +71 -0
- package/plugins/atproto/publish.js +406 -0
- package/plugins/atproto/record.js +144 -0
- package/plugins/atproto/rkey.js +54 -0
- package/plugins/deploy-cloudflare/index.js +92 -0
- package/plugins/fonts/index.js +18 -21
- package/plugins/html/assets/bundle-BeK1Hptv.css +21 -0
- package/plugins/html/bundle/assets/index-BeK1Hptv.css +21 -0
- package/plugins/html/bundle/index.js +21145 -0
- package/plugins/html/editor/EditButton.svelte +152 -0
- package/plugins/html/editor/Editor.svelte +51 -0
- package/plugins/html/editor/Overlays.svelte +6 -0
- package/plugins/html/editor/SettingsPanel.svelte +397 -0
- package/plugins/html/editor/Toolbar.svelte +644 -0
- package/plugins/html/editor/create-session.js +250 -0
- package/plugins/html/editor/directives.js +128 -0
- package/plugins/html/editor/frontmatter.js +97 -0
- package/plugins/html/editor/ingest.js +339 -0
- package/plugins/html/editor/main.js +94 -0
- package/plugins/html/editor/nodes/Alert.svelte +21 -0
- package/plugins/html/editor/nodes/Blockquote.svelte +9 -0
- package/plugins/html/editor/nodes/CodeBlock.svelte +19 -0
- package/plugins/html/editor/nodes/Embed.svelte +19 -0
- package/plugins/html/editor/nodes/Emphasis.svelte +11 -0
- package/plugins/html/editor/nodes/Heading.svelte +15 -0
- package/plugins/html/editor/nodes/Highlight.svelte +11 -0
- package/plugins/html/editor/nodes/Image.svelte +18 -0
- package/plugins/html/editor/nodes/InlineCode.svelte +11 -0
- package/plugins/html/editor/nodes/Link.svelte +17 -0
- package/plugins/html/editor/nodes/List.svelte +15 -0
- package/plugins/html/editor/nodes/ListItem.svelte +9 -0
- package/plugins/html/editor/nodes/Page.svelte +21 -0
- package/plugins/html/editor/nodes/Paragraph.svelte +9 -0
- package/plugins/html/editor/nodes/Strikethrough.svelte +11 -0
- package/plugins/html/editor/nodes/Strong.svelte +11 -0
- package/plugins/html/editor/nodes/ThematicBreak.svelte +9 -0
- package/plugins/html/editor/nodes/index.js +18 -0
- package/plugins/html/editor/rollup.config.js +35 -0
- package/plugins/html/editor/serialize.js +157 -0
- package/plugins/html/editor/settings-file.js +83 -0
- package/plugins/html/editor/socket.js +202 -0
- package/plugins/html/editor/source.js +43 -0
- package/plugins/html/image.js +104 -0
- package/plugins/html/index.js +760 -0
- package/plugins/html/partials.js +299 -0
- package/plugins/html/socialLinks.js +67 -0
- package/plugins/html/writeRules.js +377 -0
- package/plugins/icons/index.js +2 -6
- package/plugins/images/index.js +78 -55
- package/plugins/markdown/brandColors.js +10 -0
- package/plugins/markdown/colorScheme.js +64 -0
- package/plugins/markdown/emoji.js +30 -0
- package/plugins/markdown/frontmatter.js +253 -0
- package/plugins/markdown/index.js +287 -1274
- package/plugins/markdown/links.js +97 -0
- package/plugins/markdown/metadata.js +308 -0
- package/plugins/markdown/readRules.js +143 -0
- package/plugins/markdown/typography.js +109 -0
- package/plugins/markdown/visitor.js +143 -0
- package/plugins/publish/index.js +34 -0
- package/plugins/robots/agents.js +79 -0
- package/plugins/robots/index.js +30 -10
- package/plugins/robots/robots.js +48 -0
- package/plugins/styles/index.js +111 -26
- package/plugins/styles/theme.js +116 -0
- package/plugins/urls/index.js +78 -0
- package/plugins/urls/urlMetadata.js +246 -0
- package/plugins/vectors/index.js +5 -9
- package/plugins/xml/entryContent.js +103 -0
- package/plugins/xml/index.js +123 -50
- package/secretPaths.js +170 -0
- package/stylesheets/DefaultStyles.css +367 -437
- package/stylesheets/ResetStyles.css +2 -38
- package/stylesheets/SyntaxHighlightingStyles.css +269 -0
- package/stylesheets/TypographyStyles.css +386 -128
- package/systemPaths.js +48 -0
- package/utils.js +56 -5
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -73
- package/.github/ISSUE_TEMPLATE/config.yml +0 -7
- package/docs-source/.cache.json +0 -9
- package/docs-source/.obsidian/app.json +0 -3
- package/docs-source/.obsidian/appearance.json +0 -3
- package/docs-source/.obsidian/core-plugins-migration.json +0 -30
- package/docs-source/.obsidian/core-plugins.json +0 -20
- package/docs-source/.obsidian/workspace.json +0 -168
- package/docs-source/.stackblitzrc +0 -3
- package/docs-source/.votive.db +0 -0
- package/docs-source/about.md +0 -3
- package/docs-source/blog/home.md +0 -5
- package/docs-source/blog/url-ui.md +0 -21
- package/docs-source/blog.md +0 -5
- package/docs-source/docs/.votive.db +0 -0
- package/docs-source/docs/deploy.md +0 -67
- package/docs-source/docs/file-structure.md +0 -31
- package/docs-source/docs/folder-settings.md +0 -23
- package/docs-source/docs/home.md +0 -55
- package/docs-source/docs/images.md +0 -10
- package/docs-source/docs/items.md +0 -13
- package/docs-source/docs/pages.md +0 -141
- package/docs-source/docs/settings.md +0 -4
- package/docs-source/docs/styling.md +0 -34
- package/docs-source/docs/taxonomies.md +0 -37
- package/docs-source/features/cards.md +0 -7
- package/docs-source/features/editing.md +0 -7
- package/docs-source/features/emoji.md +0 -7
- package/docs-source/features/frontmatter.md +0 -7
- package/docs-source/features/lists.md +0 -7
- package/docs-source/features/navigation.md +0 -7
- package/docs-source/features/rich-previews.md +0 -7
- package/docs-source/features/robots.md +0 -7
- package/docs-source/features/rss.md +0 -7
- package/docs-source/features/sitemap.md +0 -7
- package/docs-source/features/speed.md +0 -7
- package/docs-source/features/static.md +0 -7
- package/docs-source/features/taxonomies.md +0 -7
- package/docs-source/home.md +0 -42
- package/docs-source/output/about.html +0 -1
- package/docs-source/output/blog/url-ui.html +0 -8
- package/docs-source/output/blog.html +0 -1
- package/docs-source/output/default.css +0 -1
- package/docs-source/output/docs/deploy.html +0 -34
- package/docs-source/output/docs/file-structure.html +0 -24
- package/docs-source/output/docs/folder-settings.html +0 -20
- package/docs-source/output/docs/images.html +0 -2
- package/docs-source/output/docs/items.html +0 -6
- package/docs-source/output/docs/pages.html +0 -101
- package/docs-source/output/docs/styling.html +0 -18
- package/docs-source/output/docs/taxonomies.html +0 -20
- package/docs-source/output/docs.html +0 -28
- package/docs-source/output/features/cards.html +0 -1
- package/docs-source/output/features/editing.html +0 -1
- package/docs-source/output/features/emoji.html +0 -1
- package/docs-source/output/features/frontmatter.html +0 -1
- package/docs-source/output/features/lists.html +0 -1
- package/docs-source/output/features/navigation.html +0 -1
- package/docs-source/output/features/rich-previews.html +0 -1
- package/docs-source/output/features/robots.html +0 -1
- package/docs-source/output/features/rss.html +0 -1
- package/docs-source/output/features/sitemap.html +0 -1
- package/docs-source/output/features/speed.html +0 -1
- package/docs-source/output/features/static.html +0 -1
- package/docs-source/output/features/taxonomies.html +0 -1
- package/docs-source/output/features.html +0 -1
- package/docs-source/output/feed.xml +0 -1
- package/docs-source/output/index.html +0 -21
- package/docs-source/output/reset.css +0 -1
- package/docs-source/output/roadmap.html +0 -87
- package/docs-source/output/robots.txt +0 -14
- package/docs-source/output/sitemap.xml +0 -16
- package/docs-source/output/typography.css +0 -1
- package/docs-source/roadmap.md +0 -98
- package/docs-source/settings.md +0 -13
- package/getMetadata.js +0 -41
- package/jsconfig.json +0 -10
- package/regex.js +0 -36
- package/stylesheets/brand-colors.css +0 -119
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import votive from "votive"
|
|
2
|
+
import { spawn } from "node:child_process"
|
|
3
|
+
import path from "node:path"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Publishes a full build to Cloudflare Pages via `wrangler pages deploy`.
|
|
7
|
+
*
|
|
8
|
+
* Always runs a complete build first, regardless of whether a dev server
|
|
9
|
+
* happens to already be running against this config - a command's
|
|
10
|
+
* context (config, notify) has no reference to a live server's own build
|
|
11
|
+
* queue, and this needs to behave identically whether triggered from the
|
|
12
|
+
* CLI (no server at all, see votive's runCommand) or a live "Publish"
|
|
13
|
+
* button over WS. Modest redundant cost when a dev server IS already
|
|
14
|
+
* running (bundle() is cheap when nothing's stale), traded for one
|
|
15
|
+
* deploy command that works the same everywhere.
|
|
16
|
+
*
|
|
17
|
+
* Shells out to `wrangler` rather than calling Cloudflare's REST API
|
|
18
|
+
* directly - Pages deploys require content-hashing every asset and
|
|
19
|
+
* building a manifest in Cloudflare's specific format, which wrangler
|
|
20
|
+
* already implements and maintains. `wrangler` reads
|
|
21
|
+
* CLOUDFLARE_API_TOKEN/CLOUDFLARE_ACCOUNT_ID from the environment
|
|
22
|
+
* natively; this never touches credentials itself, and none should ever
|
|
23
|
+
* be added to `config` (it isn't a place secrets should live).
|
|
24
|
+
*
|
|
25
|
+
* @param {any} payload
|
|
26
|
+
* @param {{ config: import("votive").VotiveConfig & { cloudflareProjectName?: string }, notify: (message: object) => void }} context
|
|
27
|
+
*/
|
|
28
|
+
async function deployToCloudflarePages(payload, { config, notify }) {
|
|
29
|
+
notify({ status: "progress", message: "Building..." })
|
|
30
|
+
|
|
31
|
+
// Unlike a dev server's own rebuilds, a deploy needs everything done -
|
|
32
|
+
// there's no "next edit" to stay responsive for - so the deferred
|
|
33
|
+
// work (image derivatives, link previews) is awaited, and the site is
|
|
34
|
+
// closed: the database is a cache on disk, and this process is done
|
|
35
|
+
// with it.
|
|
36
|
+
const site = await votive({ ...config, verbose: false })
|
|
37
|
+
await (await site.build()).deferred
|
|
38
|
+
const setting = site.database.setting.getByFolder("").lastNonNull("fm_cloudflare_project")
|
|
39
|
+
await site.close()
|
|
40
|
+
|
|
41
|
+
// The Pages project, from the command's payload (`vowel --command
|
|
42
|
+
// deploy --payload '{"projectName":"my-site"}'`, or a Publish button's
|
|
43
|
+
// body), the root settings.md's `cloudflare_project:`, or the config an
|
|
44
|
+
// embedder built.
|
|
45
|
+
const projectName = payload?.projectName ?? setting ?? config.cloudflareProjectName
|
|
46
|
+
if (!projectName) throw new Error("a Cloudflare Pages project name is required to deploy: set cloudflare_project in the root settings.md, or pass {\"projectName\": \"…\"} as the payload")
|
|
47
|
+
|
|
48
|
+
// `{"dryRun": true}` builds and stops short of wrangler.
|
|
49
|
+
if (payload?.dryRun) {
|
|
50
|
+
notify({ status: "done", message: `Would deploy ${config.targetFolder} to Cloudflare Pages project ${projectName}` })
|
|
51
|
+
return { deployed: false, projectName, dryRun: true }
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
notify({ status: "progress", message: `Publishing ${config.targetFolder} to Cloudflare Pages...` })
|
|
55
|
+
|
|
56
|
+
return new Promise((resolve, reject) => {
|
|
57
|
+
const proc = spawn(
|
|
58
|
+
"wrangler",
|
|
59
|
+
["pages", "deploy", config.targetFolder, "--project-name", projectName],
|
|
60
|
+
{ stdio: ["ignore", "pipe", "pipe"] }
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
// Piped, not "inherit" - this can run with no terminal attached at
|
|
64
|
+
// all (triggered over WS from a browser), so wrangler's own output
|
|
65
|
+
// has to go through notify() to reach whoever's actually watching.
|
|
66
|
+
proc.stdout.on("data", chunk => notify({ status: "progress", message: chunk.toString() }))
|
|
67
|
+
proc.stderr.on("data", chunk => notify({ status: "progress", message: chunk.toString() }))
|
|
68
|
+
|
|
69
|
+
proc.on("error", reject) // e.g. wrangler isn't installed
|
|
70
|
+
proc.on("exit", code => {
|
|
71
|
+
if (code === 0) resolve({ deployed: true, projectName })
|
|
72
|
+
else reject(new Error(`wrangler exited with code ${code}`))
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* In vowel's default plugin list (config.js), so `vowel --command
|
|
79
|
+
* deploy` reaches it from any project. Registering a command costs
|
|
80
|
+
* nothing until it is invoked, and invoking it needs a project name,
|
|
81
|
+
* so a site that deploys elsewhere never meets it.
|
|
82
|
+
* @type {import("votive").VotivePlugin}
|
|
83
|
+
*/
|
|
84
|
+
const vowelDeployCloudflarePlugin = {
|
|
85
|
+
name: "vowel-deploy-cloudflare",
|
|
86
|
+
commands: {
|
|
87
|
+
deploy: deployToCloudflarePages
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export default vowelDeployCloudflarePlugin
|
|
92
|
+
export { deployToCloudflarePages }
|
package/plugins/fonts/index.js
CHANGED
|
@@ -1,38 +1,35 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises"
|
|
2
1
|
/** @import * as Votive from "votive" */
|
|
3
2
|
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
/**
|
|
4
|
+
* A font the project ships is copied straight through: target.buffer()
|
|
5
|
+
* resolves the source against sourceFolder at the moment of reading, so
|
|
6
|
+
* nothing about this machine is ever stored. The @font-face that uses
|
|
7
|
+
* it is the author's, in their own stylesheet.
|
|
8
|
+
*
|
|
9
|
+
* Vowel bundles no fonts of its own any more - the families and their
|
|
10
|
+
* stubs went with the typography ramps into TypographyStyles.css, which
|
|
11
|
+
* names a brand family through --font-*-brand and falls back to the
|
|
12
|
+
* system stack. Fonts by url: tasks/2-in-progress/load-fonts.md.
|
|
13
|
+
* @type {Votive.ProcessorWrite}
|
|
14
|
+
*/
|
|
15
|
+
function writeFile(target) {
|
|
16
|
+
return { data: target.buffer() }
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/** @type {Votive.VotiveProcessor} */
|
|
20
20
|
const fontsReader = {
|
|
21
21
|
format: "buffer",
|
|
22
22
|
extensions: [".woff", ".woff2", ".ttf", ".otf"],
|
|
23
|
-
|
|
23
|
+
router: ({ name, dir, ext }) => ({ name, dir, ext }),
|
|
24
|
+
// A font carries no metadata worth inferring.
|
|
25
|
+
readFile: () => ({ metadata: {} }),
|
|
24
26
|
writeFile
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/** @type {Votive.VotivePlugin} */
|
|
28
30
|
const vowelFontsPlugin = {
|
|
29
31
|
name: "vowel-fonts",
|
|
30
|
-
processors: [fontsReader]
|
|
31
|
-
router: ({ name, dir, ext }) => {
|
|
32
|
-
return {
|
|
33
|
-
name, dir, ext
|
|
34
|
-
}
|
|
35
|
-
}
|
|
32
|
+
processors: [fontsReader]
|
|
36
33
|
}
|
|
37
34
|
|
|
38
35
|
export default vowelFontsPlugin
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@layer svedit-defaults {
|
|
2
|
+
:root {
|
|
3
|
+
/* Primary accent for active editing controls, carets, and selections. */
|
|
4
|
+
--editing: oklch(60% 0.22 283);
|
|
5
|
+
/* Low-opacity version of the editing accent for passive highlights. */
|
|
6
|
+
--editing-muted: oklch(from var(--editing) l c h / 0.1);
|
|
7
|
+
/* Low-emphasis strokes and outlines, such as inactive node gaps. */
|
|
8
|
+
--editing-stroke: color-mix(in oklch, currentColor 25%, transparent);
|
|
9
|
+
/* Foreground color for content displayed on the editing accent. */
|
|
10
|
+
--editing-foreground: oklch(100% 0 0);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@layer svedit-defaults {
|
|
15
|
+
@keyframes node-caret-blink {
|
|
16
|
+
0%, 60% { opacity: 1; }
|
|
17
|
+
68% { opacity: 0; }
|
|
18
|
+
88% { opacity: 0; }
|
|
19
|
+
100% { opacity: 1; }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@layer svedit-defaults {
|
|
2
|
+
:root {
|
|
3
|
+
/* Primary accent for active editing controls, carets, and selections. */
|
|
4
|
+
--editing: oklch(60% 0.22 283);
|
|
5
|
+
/* Low-opacity version of the editing accent for passive highlights. */
|
|
6
|
+
--editing-muted: oklch(from var(--editing) l c h / 0.1);
|
|
7
|
+
/* Low-emphasis strokes and outlines, such as inactive node gaps. */
|
|
8
|
+
--editing-stroke: color-mix(in oklch, currentColor 25%, transparent);
|
|
9
|
+
/* Foreground color for content displayed on the editing accent. */
|
|
10
|
+
--editing-foreground: oklch(100% 0 0);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@layer svedit-defaults {
|
|
15
|
+
@keyframes node-caret-blink {
|
|
16
|
+
0%, 60% { opacity: 1; }
|
|
17
|
+
68% { opacity: 0; }
|
|
18
|
+
88% { opacity: 0; }
|
|
19
|
+
100% { opacity: 1; }
|
|
20
|
+
}
|
|
21
|
+
}
|