vowel 0.6.4 → 0.7.1-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 +1 -1
- package/bin.js +47 -27
- package/cli.js +15 -0
- package/config.js +95 -26
- package/extractDate.js +70 -6
- package/index.js +19 -5
- package/package.json +38 -7
- package/plugins/assets/index.js +65 -0
- package/plugins/atproto/body.js +413 -0
- package/plugins/atproto/index.js +138 -0
- package/plugins/atproto/lexicons.js +179 -0
- package/plugins/atproto/mapper.js +399 -0
- package/plugins/atproto/password.js +71 -0
- package/plugins/atproto/publish.js +471 -0
- package/plugins/atproto/record.js +90 -0
- package/plugins/atproto/rkey.js +54 -0
- package/plugins/deploy-cloudflare/index.js +30 -16
- 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 +31 -5
- package/plugins/html/index.js +436 -458
- package/plugins/html/partials.js +299 -0
- package/plugins/html/socialLinks.js +67 -0
- package/plugins/html/writeRules.js +379 -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 +269 -0
- package/plugins/markdown/index.js +295 -335
- package/plugins/markdown/links.js +97 -0
- package/plugins/markdown/metadata.js +229 -68
- 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/secret-pages/index.js +75 -0
- package/plugins/styles/index.js +111 -18
- package/plugins/styles/theme.js +116 -0
- package/plugins/urls/index.js +49 -62
- package/plugins/urls/urlMetadata.js +246 -0
- package/plugins/vectors/index.js +5 -9
- package/plugins/xml/entryContent.js +114 -0
- package/plugins/xml/index.js +107 -44
- package/secretPaths.js +170 -0
- package/stylesheets/DefaultStyles.css +399 -435
- package/stylesheets/ResetStyles.css +4 -39
- package/stylesheets/SyntaxHighlightingStyles.css +36 -4
- package/stylesheets/TypographyStyles.css +398 -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/plugins/markdown/robots.js +0 -18
- package/regex.js +0 -36
- package/stylesheets/brand-colors.css +0 -119
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import votive from "votive"
|
|
2
2
|
import { spawn } from "node:child_process"
|
|
3
|
+
import path from "node:path"
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Publishes a full build to Cloudflare Pages via `wrangler pages deploy`.
|
|
@@ -8,7 +9,7 @@ import { spawn } from "node:child_process"
|
|
|
8
9
|
* happens to already be running against this config - a command's
|
|
9
10
|
* context (config, notify) has no reference to a live server's own build
|
|
10
11
|
* queue, and this needs to behave identically whether triggered from the
|
|
11
|
-
* CLI (no server at all, see
|
|
12
|
+
* CLI (no server at all, see votive's runCommand) or a live "Publish"
|
|
12
13
|
* button over WS. Modest redundant cost when a dev server IS already
|
|
13
14
|
* running (bundle() is cheap when nothing's stale), traded for one
|
|
14
15
|
* deploy command that works the same everywhere.
|
|
@@ -25,25 +26,37 @@ import { spawn } from "node:child_process"
|
|
|
25
26
|
* @param {{ config: import("votive").VotiveConfig & { cloudflareProjectName?: string }, notify: (message: object) => void }} context
|
|
26
27
|
*/
|
|
27
28
|
async function deployToCloudflarePages(payload, { config, notify }) {
|
|
28
|
-
if (!config.cloudflareProjectName) throw new Error("config.cloudflareProjectName is required to deploy")
|
|
29
|
-
|
|
30
29
|
notify({ status: "progress", message: "Building..." })
|
|
31
30
|
|
|
32
|
-
const queue = await votive({ ...config, verbose: false })
|
|
33
|
-
const { runBuffers, runFetches } = await queue()
|
|
34
|
-
|
|
35
31
|
// Unlike a dev server's own rebuilds, a deploy needs everything done -
|
|
36
|
-
// there's no "next edit" to stay responsive for
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
|
|
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
|
+
}
|
|
40
53
|
|
|
41
54
|
notify({ status: "progress", message: `Publishing ${config.targetFolder} to Cloudflare Pages...` })
|
|
42
55
|
|
|
43
56
|
return new Promise((resolve, reject) => {
|
|
44
57
|
const proc = spawn(
|
|
45
58
|
"wrangler",
|
|
46
|
-
["pages", "deploy", config.targetFolder, "--project-name",
|
|
59
|
+
["pages", "deploy", config.targetFolder, "--project-name", projectName],
|
|
47
60
|
{ stdio: ["ignore", "pipe", "pipe"] }
|
|
48
61
|
)
|
|
49
62
|
|
|
@@ -55,17 +68,17 @@ async function deployToCloudflarePages(payload, { config, notify }) {
|
|
|
55
68
|
|
|
56
69
|
proc.on("error", reject) // e.g. wrangler isn't installed
|
|
57
70
|
proc.on("exit", code => {
|
|
58
|
-
if (code === 0) resolve({ deployed: true })
|
|
71
|
+
if (code === 0) resolve({ deployed: true, projectName })
|
|
59
72
|
else reject(new Error(`wrangler exited with code ${code}`))
|
|
60
73
|
})
|
|
61
74
|
})
|
|
62
75
|
}
|
|
63
76
|
|
|
64
77
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
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.
|
|
69
82
|
* @type {import("votive").VotivePlugin}
|
|
70
83
|
*/
|
|
71
84
|
const vowelDeployCloudflarePlugin = {
|
|
@@ -76,3 +89,4 @@ const vowelDeployCloudflarePlugin = {
|
|
|
76
89
|
}
|
|
77
90
|
|
|
78
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
|
+
}
|