vowel 0.1.46 → 0.2.2

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.
Files changed (115) hide show
  1. package/README.md +82 -20
  2. package/bin.js +2 -78
  3. package/docs-source/$features/cards.md +7 -0
  4. package/docs-source/$features/editing.md +7 -0
  5. package/docs-source/$features/emoji.md +7 -0
  6. package/docs-source/$features/frontmatter.md +7 -0
  7. package/docs-source/$features/lists.md +7 -0
  8. package/docs-source/$features/navigation.md +7 -0
  9. package/docs-source/$features/rich-previews.md +7 -0
  10. package/docs-source/$features/robots.md +7 -0
  11. package/docs-source/$features/rss.md +7 -0
  12. package/docs-source/$features/sitemap.md +7 -0
  13. package/docs-source/$features/speed.md +7 -0
  14. package/docs-source/$features/static.md +7 -0
  15. package/docs-source/$features/taxonomies.md +7 -0
  16. package/docs-source/.cache.json +9 -0
  17. package/docs-source/.obsidian/app.json +3 -0
  18. package/docs-source/.obsidian/appearance.json +3 -0
  19. package/docs-source/.obsidian/core-plugins-migration.json +30 -0
  20. package/docs-source/.obsidian/core-plugins.json +20 -0
  21. package/docs-source/.obsidian/workspace.json +168 -0
  22. package/docs-source/.stackblitzrc +3 -0
  23. package/docs-source/.vercel/README.txt +11 -0
  24. package/docs-source/.vercel/project.json +1 -0
  25. package/docs-source/about.md +3 -0
  26. package/docs-source/assets/styles.css +51 -0
  27. package/docs-source/blog/home.md +5 -0
  28. package/docs-source/blog/url-ui.md +21 -0
  29. package/docs-source/docs/.votive.db +0 -0
  30. package/docs-source/docs/deploy.md +67 -0
  31. package/docs-source/docs/file-structure.md +31 -0
  32. package/docs-source/docs/folder-settings.md +23 -0
  33. package/docs-source/docs/home.md +55 -0
  34. package/docs-source/docs/images.md +10 -0
  35. package/docs-source/docs/items.md +13 -0
  36. package/docs-source/docs/pages.md +141 -0
  37. package/docs-source/docs/settings.md +4 -0
  38. package/docs-source/docs/styling.md +34 -0
  39. package/docs-source/docs/taxonomies.md +37 -0
  40. package/docs-source/home.md +42 -0
  41. package/docs-source/roadmap.md +98 -0
  42. package/docs-source/settings.md +12 -0
  43. package/extractDate.js +83 -0
  44. package/getMetadata.js +41 -0
  45. package/index.js +669 -0
  46. package/jsconfig.json +9 -17
  47. package/package.json +61 -63
  48. package/regex.js +36 -0
  49. package/{src/lib/components → stylesheets}/DefaultStyles.css +5 -5
  50. package/utils.js +10 -0
  51. package/.cache.json +0 -1
  52. package/.prettierrc +0 -8
  53. package/.vscode/settings.json +0 -3
  54. package/CHANGELOG.md +0 -79
  55. package/server.js +0 -87
  56. package/src/app.d.ts +0 -12
  57. package/src/app.html +0 -13
  58. package/src/lib/components/Breadcrumbs.svelte +0 -19
  59. package/src/lib/components/ConditionalWrapper.svelte +0 -10
  60. package/src/lib/components/DefaultStyles.svelte +0 -11
  61. package/src/lib/components/FrontMatterTaxonomy.svelte +0 -48
  62. package/src/lib/components/Frontmatter.svelte +0 -56
  63. package/src/lib/components/FrontmatterProperty.svelte +0 -78
  64. package/src/lib/components/Markdown/Image.svelte +0 -50
  65. package/src/lib/components/Markdown/Link.svelte +0 -19
  66. package/src/lib/components/Markdown/LinkPreview.svelte +0 -45
  67. package/src/lib/components/Markdown/Text.svelte +0 -6
  68. package/src/lib/components/Markdown/index.svelte +0 -147
  69. package/src/lib/components/Markdown/validators.js +0 -29
  70. package/src/lib/components/Nav.svelte +0 -40
  71. package/src/lib/components/NoStyles.svelte +0 -5
  72. package/src/lib/components/Page.svelte +0 -90
  73. package/src/lib/components/ResetStyles.svelte +0 -7
  74. package/src/lib/components/Sitemap.svelte +0 -38
  75. package/src/lib/components/TypographyStyles.svelte +0 -10
  76. package/src/lib/components/index.js +0 -12
  77. package/src/lib/index.js +0 -1
  78. package/src/lib/utilities/buildURL.js +0 -18
  79. package/src/lib/utilities/checkFileExists.js +0 -16
  80. package/src/lib/utilities/createFolderClass.js +0 -4
  81. package/src/lib/utilities/createPageClass.js +0 -6
  82. package/src/lib/utilities/getFileLabel.js +0 -35
  83. package/src/lib/utilities/getFolder.js +0 -16
  84. package/src/lib/utilities/getFolderLabel.js +0 -12
  85. package/src/lib/utilities/getMetadata.js +0 -46
  86. package/src/lib/utilities/getPage.js +0 -25
  87. package/src/lib/utilities/getPagesByFolder.js +0 -95
  88. package/src/lib/utilities/index.js +0 -22
  89. package/src/lib/utilities/isActiveLink.js +0 -12
  90. package/src/lib/utilities/isObject.js +0 -8
  91. package/src/lib/utilities/loadCache.js +0 -28
  92. package/src/lib/utilities/mutateMarkdownAST.js +0 -68
  93. package/src/lib/utilities/mutateMarkdownFrontmatter.js +0 -113
  94. package/src/lib/utilities/parseDate.js +0 -43
  95. package/src/lib/utilities/processMarkdownFiles.js +0 -243
  96. package/src/lib/utilities/readMarkdownFile.js +0 -188
  97. package/src/lib/utilities/regexPatterns.js +0 -12
  98. package/src/lib/utilities/resolveHomeDirPath.js +0 -5
  99. package/src/lib/utilities/sendWebmention.js +0 -34
  100. package/src/lib/utilities/writeCache.js +0 -14
  101. package/src/routes/$vowel/published.json/+server.js +0 -54
  102. package/src/routes/+error.svelte +0 -110
  103. package/src/routes/[...path]/+layout.server.js +0 -78
  104. package/src/routes/[...path]/+page.server.js +0 -42
  105. package/src/routes/[...path]/+page.svelte +0 -186
  106. package/src/routes/feed.xml/+server.js +0 -120
  107. package/src/routes/robots.txt/+server.js +0 -54
  108. package/src/routes/sitemap.xml/+server.js +0 -68
  109. package/static/favicon.png +0 -0
  110. package/static/styles.css +0 -0
  111. package/svelte.config.js +0 -30
  112. package/vercel.json +0 -5
  113. package/vite.config.js +0 -84
  114. /package/{src/lib/components → stylesheets}/ResetStyles.css +0 -0
  115. /package/{src/lib/components → stylesheets}/TypographyStyles.css +0 -0
package/jsconfig.json CHANGED
@@ -1,18 +1,10 @@
1
1
  {
2
- // "extends": "./.svelte-kit/tsconfig.json",
3
- "compilerOptions": {
4
- "allowJs": true,
5
- "checkJs": true,
6
- "esModuleInterop": true,
7
- "forceConsistentCasingInFileNames": true,
8
- "resolveJsonModule": true,
9
- "skipLibCheck": true,
10
- "sourceMap": true,
11
- "strict": true,
12
- "moduleResolution": "bundler"
13
- }
14
- // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
15
- //
16
- // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
17
- // from the referenced tsconfig.json - TypeScript does not merge them in
18
- }
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "checkJs": true,
5
+ "noImplicitlyAny": true,
6
+ "module": "esnext",
7
+ "target": "esnext",
8
+ "moduleResolution": "nodenext"
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,64 +1,62 @@
1
1
  {
2
- "name": "vowel",
3
- "version": "0.1.46",
4
- "homepage": "https://vowel.cc",
5
- "author": "Sam Littlefair (https://littlefair.ca)",
6
- "repository": {
7
- "type": "git",
8
- "url": "ssh://git@github.com/samlfair/vowel.git"
9
- },
10
- "engines": {
11
- "node": ">20.0.0"
12
- },
13
- "bin": "./bin.js",
14
- "scripts": {
15
- "dev": "vite dev",
16
- "build": "vite build",
17
- "preview": "vite preview",
18
- "release": "commit-and-tag-version && git push --follow-tags && npm publish",
19
- "release:dry": "commit-and-tag-version --dry-run",
20
- "release:beta": "commit-and-tag-version ---prerelease beta",
21
- "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
22
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
23
- "lint": "prettier --check .",
24
- "format": "prettier --write ."
25
- },
26
- "type": "module",
27
- "dependencies": {
28
- "@picocss/pico": "^1.5.10",
29
- "@sveltejs/adapter-auto": "^3.0.0",
30
- "@sveltejs/adapter-static": "^3.0.5",
31
- "@sveltejs/kit": "^2.7.2",
32
- "@sveltejs/vite-plugin-svelte": "^4.0.0",
33
- "any-date-parser": "^1.5.4",
34
- "change-case": "^5.4.1",
35
- "commit-and-tag-version": "^12.4.4",
36
- "fast-xml-parser": "^4.5.0",
37
- "filter-console": "^1.0.0",
38
- "js-yaml": "^4.1.0",
39
- "loading-cli": "^1.1.2",
40
- "log-update": "^6.0.0",
41
- "milligram": "^1.4.1",
42
- "object-path": "^0.11.8",
43
- "open-props": "^1.6.13",
44
- "picocolors": "^1.0.1",
45
- "prettier": "^3.0.0",
46
- "prettier-plugin-svelte": "^3.0.0",
47
- "remark": "^15.0.1",
48
- "remark-admonitions": "^1.2.1",
49
- "remark-directive": "^3.0.0",
50
- "remark-frontmatter": "^5.0.0",
51
- "remark-gfm": "^4.0.0",
52
- "remark-html": "^16.0.1",
53
- "remark-images": "^4.0.0",
54
- "remark-parse": "^11.0.0",
55
- "remark-rehype": "^11.1.0",
56
- "spectre.css": "^0.5.9",
57
- "svelte": "^5.0.4",
58
- "typescript": "^5.0.0",
59
- "unified": "^11.0.4",
60
- "url-metadata": "^3.4.9",
61
- "vite": "^5.0.12",
62
- "xml": "^1.0.1"
63
- }
64
- }
2
+ "name": "vowel",
3
+ "type": "module",
4
+ "version": "0.2.2",
5
+ "bin": "bin.js",
6
+ "main": "index.js",
7
+ "scripts": {
8
+ "test": "node --test tests/*.js"
9
+ },
10
+ "keywords": [
11
+ "markdown",
12
+ "website",
13
+ "static site generator"
14
+ ],
15
+ "author": "Sam Littlefair",
16
+ "license": "MIT",
17
+ "description": "Markdown websites",
18
+ "dependencies": {
19
+ "fast-xml-parser": "^5.3.6",
20
+ "faye-websocket": "^0.11.4",
21
+ "hast-util-from-html": "^2.0.3",
22
+ "hast-util-to-string": "^3.0.1",
23
+ "hastscript": "^9.0.1",
24
+ "js-yaml": "^4.1.0",
25
+ "mdast": "^2.3.2",
26
+ "mdast-normalize-headings": "^4.0.0",
27
+ "mdast-util-from-markdown": "^2.0.2",
28
+ "mdast-util-frontmatter": "^2.0.1",
29
+ "mdast-util-gfm-strikethrough": "^2.0.0",
30
+ "mdast-util-gfm-table": "^2.0.0",
31
+ "mdast-util-gfm-task-list-item": "^2.0.0",
32
+ "mdast-util-to-hast": "^13.2.1",
33
+ "mdast-util-to-markdown": "^2.1.2",
34
+ "mdast-util-to-string": "^4.0.0",
35
+ "micromark-extension-frontmatter": "^2.0.0",
36
+ "micromark-extension-gfm-footnote": "^2.1.0",
37
+ "micromark-extension-gfm-table": "^2.1.1",
38
+ "micromark-extension-gfm-task-list-item": "^2.1.0",
39
+ "rehype": "^13.0.2",
40
+ "rehype-stringify": "^10.0.1",
41
+ "remark": "^15.0.1",
42
+ "remark-frontmatter": "^5.0.0",
43
+ "remark-gfm": "^4.0.1",
44
+ "remark-html": "^16.0.1",
45
+ "remark-parse": "^11.0.0",
46
+ "remark-rehype": "^11.1.2",
47
+ "unified": "^11.0.5",
48
+ "unist-util-find": "^3.0.0",
49
+ "unist-util-is": "^6.0.0",
50
+ "unist-util-position": "5.0.0",
51
+ "unist-util-stringify-position": "^4.0.0",
52
+ "unist-util-visit": "^5.0.0",
53
+ "unist-util-visit-parents": "^6.0.0",
54
+ "url-metadata": "^5.4.1",
55
+ "voot": "^0.0.2",
56
+ "votive": "^0.0.6",
57
+ "xast-util-sitemap": "^2.0.0",
58
+ "xast-util-to-xml": "^4.0.0",
59
+ "yaml": "^2.8.2",
60
+ "yamljs": "^0.3.0"
61
+ }
62
+ }
package/regex.js ADDED
@@ -0,0 +1,36 @@
1
+
2
+ const dateRegex = /(?:\b(?<first_segment>(?<first_MMM_or_MMMM>January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sept|Sep|Oct|Nov|Dec)|(?<first_YYYY>\d\d\d\d)|(?<first_do>(?:\d|[0-3]\d)(?:st|nd|rd|th))|(?<first_dd_or_MM_or_yy>[0-3]\d)|(?<first_d_or_M>\d))(?<first_delimiter>\.| |, |\/|-)?)(?:\b(?<second_segment>(?<second_MMM_or_MMMM>January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sept|Sep|Oct|Nov|Dec)|(?<second_YYYY>\d\d\d\d)|(?<second_do>(\d\d)(:?st|nd|rd|th))|(?<second_dd_or_MM_or_yy>[0-3]\d)|(?<second_d_or_M>\d))(?<second_delimiter>\.| |, |\/|-)?)(?:\b(?<third_segment>(?<third_MMM_or_MMMM>January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sept|Sep|Oct|Nov|Dec)|(?<third_YYYY>\d\d\d\d)|(?<third_do>(\d\d)(?:st|nd|rd|th))|(?<third_dd_or_MM_or_yy>[0-3]\d)|(?<third_d_or_M>\d)))(?<time>(?<time_delimiter>T|\ | at )(?<H_or_HH>[0-2]?\d):(?<MM>[0-6]\d)(?::(?<SS>00))?(?:\.(?<SSS>\d\d\d))?(?<Z>Z|(?:\+(\d\d):(\d\d)))?(?<meridiam_indicator>am|pm)?)?/mig
3
+ const slice = /(?:\b(?<first_segment>(?<first_MMM_or_MMMM>January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sept|Sep|Oct|Nov|Dec)|(?<first_YYYY>\d\d\d\d)|(?<first_do>(?:\d|[0-3]\d)(?:st|nd|rd|th))|(?<first_dd_or_MM_or_yy>[0-3]\d)|(?<first_d_or_M>\d))(?<first_delimiter>\.| |, |\/|-)?)(?:\b(?<second_segment>(?<second_MMM_or_MMMM>January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sept|Sep|Oct|Nov|Dec)|(?<second_YYYY>\d\d\d\d)|(?<second_do>(\d\d)(:?st|nd|rd|th))|(?<second_dd_or_MM_or_yy>[0-3]\d)|(?<second_d_or_M>\d))(?<second_delimiter>\.| |, |\/|-)?)(?:\b(?<third_segment>(?<third_MMM_or_MMMM>January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sept|Sep|Oct|Nov|Dec)|(?<third_YYYY>\d\d\d\d)|(?<third_do>(\d\d)(?:st|nd|rd|th))|(?<third_dd_or_MM_or_yy>[0-3]\d)|(?<third_d_or_M>\d)))/
4
+
5
+ const test = [
6
+ "111",
7
+ "1/1/1",
8
+ "02/03/24",
9
+ "2025-01-15",
10
+ "03/22/2023",
11
+ "1999.12.31",
12
+ "April 9, 2011 at 8:00pm",
13
+ "17th October 2020",
14
+ "2000/07/04",
15
+ "05-Aug-1985",
16
+ "Sunday, March 3, 2030",
17
+ "14 Sep 2014",
18
+ "Dec 25, 2022",
19
+ "07.11.2017",
20
+ "29-Feb-2016",
21
+ "Monday, 1st January 1996",
22
+ "09/09/1999",
23
+ "03/04/203",
24
+ "June 37",
25
+ "1999/13",
26
+ "April-09-11",
27
+ "17 October, '20",
28
+ "20000704",
29
+ "05-August-85",
30
+ "14-September-2014",
31
+ "25th of Dec, 2022",
32
+ "07.11.17",
33
+ "29-02-16",
34
+ "Monday 1st Jan 96",
35
+ "09.09/1999"
36
+ ]
@@ -176,7 +176,7 @@ header {
176
176
  margin-top: 4rem;
177
177
  }
178
178
 
179
- nav.top-bar {
179
+ nav.primary {
180
180
  border: 1px solid var(--border-color);
181
181
  padding: 6px 10px;
182
182
  margin-inline: -3px;
@@ -189,13 +189,13 @@ nav.top-bar {
189
189
  background: var(--soft-background);
190
190
  }
191
191
 
192
- nav.top-bar:has(+ nav.top-bar) {
192
+ nav.primary:has(+ nav.primary) {
193
193
  border-bottom: none;
194
194
  border-bottom-left-radius: 0;
195
195
  border-bottom-right-radius: 0;
196
196
  }
197
197
 
198
- nav.top-bar:has(+ nav.top-bar):after {
198
+ nav.primary:has(+ nav.primary):after {
199
199
  display: block;
200
200
  content: '';
201
201
  border-bottom: 1px solid var(--border-color);
@@ -203,7 +203,7 @@ nav.top-bar:has(+ nav.top-bar):after {
203
203
  margin-top: 0.7rem;
204
204
  }
205
205
 
206
- nav.top-bar+nav.top-bar {
206
+ nav.primary+nav.primary {
207
207
  border-top-left-radius: 0;
208
208
  border-top-right-radius: 0;
209
209
  border-top: none;
@@ -220,7 +220,7 @@ header .breadcrumbs {
220
220
 
221
221
  /* Sidebar */
222
222
 
223
- .sidebar {
223
+ .secondary {
224
224
  margin-inline: auto;
225
225
  }
226
226
 
package/utils.js ADDED
@@ -0,0 +1,10 @@
1
+ /** @param {string} text */
2
+ export function testURL(text) {
3
+ if (text.match(/^https?:\/\/[\S]+$/)) {
4
+ try {
5
+ return new URL(text)
6
+ } catch (e) {
7
+ return
8
+ }
9
+ }
10
+ }
package/.cache.json DELETED
@@ -1 +0,0 @@
1
- {}
package/.prettierrc DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "useTabs": true,
3
- "singleQuote": true,
4
- "trailingComma": "none",
5
- "printWidth": 100,
6
- "plugins": ["prettier-plugin-svelte"],
7
- "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
8
- }
@@ -1,3 +0,0 @@
1
- {
2
- "files.autoSaveDelay": 1
3
- }
package/CHANGELOG.md DELETED
@@ -1,79 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
-
5
- ## [0.1.45](https://github.com/samlfair/vowel/compare/v0.1.44...v0.1.45) (2024-10-21)
6
-
7
-
8
- ### Features
9
-
10
- * add h-name to h1 ([ae5cc82](https://github.com/samlfair/vowel/commit/ae5cc82bf260605b49d7f0bd29762358b89f0aa4))
11
-
12
- ## [0.1.44](https://github.com/samlfair/vowel/compare/v0.1.43...v0.1.44) (2024-10-21)
13
-
14
-
15
- ### Bug Fixes
16
-
17
- * metadata retrieval bug ([566f7cf](https://github.com/samlfair/vowel/commit/566f7cf64be2749e30cddcb474f6385638c408a9))
18
- * webmentions bug ([2215ff5](https://github.com/samlfair/vowel/commit/2215ff5f5668d140535f6df3d30754fd685f22ae))
19
-
20
- ## [0.1.43](https://github.com/samlfair/vowel/compare/v0.1.42...v0.1.43) (2024-10-18)
21
-
22
- ## [0.1.42](https://github.com/samlfair/vowel/compare/v0.1.41...v0.1.42) (2024-10-18)
23
-
24
-
25
- ### Bug Fixes
26
-
27
- * un-hardcode webmention urls ([3421a69](https://github.com/samlfair/vowel/commit/3421a6998aa4ba20613b84c707e62fe273ddf327))
28
-
29
- ## [0.1.41](https://github.com/samlfair/vowel/compare/v0.1.40...v0.1.41) (2024-10-17)
30
-
31
-
32
- ### Bug Fixes
33
-
34
- * webmentions bug ([485eda1](https://github.com/samlfair/vowel/commit/485eda1d03c54794503a2b6113066e0e21dc4798))
35
-
36
- ## [0.1.40](https://github.com/samlfair/vowel/compare/v0.1.39...v0.1.40) (2024-10-17)
37
-
38
-
39
- ### Features
40
-
41
- * add h-entry microformat markup ([875b509](https://github.com/samlfair/vowel/commit/875b5092e5cf050149114ba31e1972a9c0f1dfa7))
42
-
43
-
44
- ### Bug Fixes
45
-
46
- * link preview bug ([293f88f](https://github.com/samlfair/vowel/commit/293f88fcb089d70c4d1e9e4c08668f03a6244b63))
47
-
48
- ## [0.1.39](https://github.com/samlfair/vowel/compare/v0.1.38...v0.1.39) (2024-10-17)
49
-
50
- ## [0.1.38](https://github.com/samlfair/vowel/compare/v0.1.37...v0.1.38) (2024-10-17)
51
-
52
- ## [0.1.37](https://github.com/samlfair/vowel/compare/v0.1.36...v0.1.37) (2024-10-17)
53
-
54
-
55
- ### Features
56
-
57
- * add 'new' status for webmentions ([12ea209](https://github.com/samlfair/vowel/commit/12ea2098eb24f4bf64c681fa7dc66371592bb08c))
58
-
59
- ## [0.1.36](https://github.com/samlfair/vowel/compare/v0.1.35...v0.1.36) (2024-10-17)
60
-
61
-
62
- ### Features
63
-
64
- * send webmentions for urls with publish command ([e07abeb](https://github.com/samlfair/vowel/commit/e07abeb5911ab8079b4caec715eb0a463c4809cd))
65
-
66
- ## [0.1.35](https://github.com/samlfair/vowel/compare/v0.1.34...v0.1.35) (2024-10-17)
67
-
68
- ## [0.1.34](https://github.com/samlfair/vowel/compare/v0.1.33...v0.1.34) (2024-10-16)
69
-
70
-
71
- ### Features
72
-
73
- * add webmention and github links to header ([114d9b4](https://github.com/samlfair/vowel/commit/114d9b455211957cac361825d1da8017e3afb45f))
74
-
75
- ## 0.1.33 (2024-10-14)
76
-
77
- # Changelog
78
-
79
- All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
package/server.js DELETED
@@ -1,87 +0,0 @@
1
- import { fileURLToPath } from 'url';
2
- import { createServer, build } from 'vite';
3
- import { writeFile, mkdir, readFile } from 'fs/promises';
4
- import { existsSync } from 'fs';
5
- import { dirname, join } from 'path';
6
- import mri from 'mri';
7
-
8
- const args = mri(process.argv);
9
- const { build: isBuild, directory, publish } = args;
10
-
11
- const __dirname = fileURLToPath(new URL('.', import.meta.url));
12
-
13
- // If this is not a build, read the process argument
14
- const arg = !isBuild ? process.argv[2] : false;
15
-
16
- // Check if this is a user (process argument) or package dev (cwd)
17
- const $home = isBuild ? process.cwd() : directory;
18
-
19
- const define = {
20
- $home: [directory],
21
- $build: [isBuild],
22
- $publish: [publish]
23
- };
24
-
25
- const config = {
26
- // any valid user config options, plus `mode` and `configFile`
27
- configFile: join(__dirname, 'vite.config.js'),
28
- root: __dirname,
29
- server: {
30
- port: 1337
31
- },
32
- define
33
- };
34
-
35
- const vercelDefaults = {
36
- cleanUrls: true,
37
- outputDirectory: '.output',
38
- buildCommand: null
39
- };
40
-
41
- async function buildProject() {
42
- const outputDir = join($home[0], '.output');
43
-
44
- const vercelConfigPath = join($home[0], 'vercel.json');
45
-
46
- const vercelDirPath = join($home[0], '.vercel');
47
- const projectJsonPath = join(vercelDirPath, 'project.json');
48
- let projectData = null;
49
-
50
- try {
51
- if (existsSync(projectJsonPath)) {
52
- const data = await readFile(projectJsonPath, 'utf-8');
53
- projectData = JSON.parse(data);
54
- }
55
-
56
- await build(config);
57
-
58
- if (projectData !== null) {
59
- await mkdir(vercelDirPath, { recursive: true });
60
- await writeFile(projectJsonPath, JSON.stringify(projectData, null, 2), 'utf-8');
61
- }
62
-
63
- const jsonData = JSON.stringify(vercelDefaults, null, 2);
64
-
65
- const path = join($home, 'vercel.json');
66
- await writeFile(path, jsonData, 'utf-8');
67
- // await writeFile(vercelConfigPath, jsonData, 'utf-8');
68
- console.log('Build completed successfully.');
69
- } catch (err) {
70
- console.error('Build failed:', err);
71
- }
72
- }
73
-
74
- async function runServer() {
75
- const server = await createServer(config);
76
- await server.listen();
77
-
78
- server.printUrls();
79
- server.bindCLIShortcuts({ print: true });
80
- }
81
-
82
- // If build mode
83
- if (isBuild) {
84
- buildProject();
85
- } else {
86
- runServer();
87
- }
package/src/app.d.ts DELETED
@@ -1,12 +0,0 @@
1
- // See https://kit.svelte.dev/docs/types#app
2
- // for information about these interfaces
3
- declare global {
4
- namespace App {
5
- // interface Error {}
6
- // interface Locals {}
7
- // interface PageData {}
8
- // interface Platform {}
9
- }
10
- }
11
-
12
- export {};
package/src/app.html DELETED
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
-
7
- %sveltekit.head%
8
- </head>
9
-
10
- <body>
11
- <div class="container">%sveltekit.body%</div>
12
- </body>
13
- </html>
@@ -1,19 +0,0 @@
1
- <script>
2
- import { page } from '$app/stores';
3
- import { getFolderLabel, getFolder } from '$lib/utilities';
4
-
5
- let { level } = $props();
6
-
7
- const path = $derived($page.data.segments.slice(0, level).join('/'));
8
- // The page for the current crumb
9
- const crumbyPage = $derived(getFolder($page.data.website, path));
10
- const folderLabel = $derived(getFolderLabel(crumbyPage, true, false));
11
-
12
- const active = $derived(level === $page.data.segments.length);
13
- </script>
14
-
15
- <a aria-current={active ? 'page' : undefined} href={crumbyPage?.['$'].url}>{folderLabel}</a>
16
- {#if !active}
17
- <span aria-hidden="true" class="separator"></span>
18
- <svelte:self level={level + 1} />
19
- {/if}
@@ -1,10 +0,0 @@
1
- <script>
2
- let { children, component, ...rest } = $props();
3
- </script>
4
-
5
- {#if component}
6
- <svelte:component this={component} {...rest}>
7
- {@render children()}
8
- </svelte:component>
9
- {/if}
10
- {@render children()}
@@ -1,11 +0,0 @@
1
- <script>
2
- import styles from './DefaultStyles.css?inline';
3
-
4
- import { TypographyStyles } from '.';
5
- </script>
6
-
7
- <TypographyStyles />
8
-
9
- <svelte:head>
10
- {@html `<style>${styles}</style>`}
11
- </svelte:head>
@@ -1,48 +0,0 @@
1
- <script>
2
- import { sentenceCase } from 'change-case';
3
- // @ts-ignore
4
- import { getFileLabel, getPage } from '$lib/utilities';
5
-
6
- /** @type {{ property: any, key: string }}*/
7
- let { property, key, website } = $props();
8
-
9
- const path = key + '/' + property;
10
- const page = getPage(website, path);
11
-
12
- /**
13
- * Check if a value is an object
14
- * @param {any} value - Value to check.
15
- * @returns {boolean}
16
- */
17
- function isObject(value) {
18
- return typeof value === 'object' && !Array.isArray(value) && value !== null;
19
- }
20
-
21
- /**
22
- * Check if a value is an object
23
- * @param {any} value - Value to check.
24
- * @returns {boolean}
25
- */
26
- function isArray(value) {
27
- return typeof value === 'object' && Array.isArray(value) && value !== null;
28
- }
29
- </script>
30
-
31
- <dl>
32
- <dt class={key}>{sentenceCase(key)}</dt>
33
- <dd class={key}>
34
- {#if isArray(property)}
35
- <ul>
36
- {#each property as item}
37
- {@const path = key + '/' + item}
38
- {@const page = getPage(website, path)}
39
- <li>
40
- <a href={page.url}>{getFileLabel(page)}</a>
41
- </li>
42
- {/each}
43
- </ul>
44
- {:else}
45
- <a href={page.url}>{getFileLabel(page)}</a>
46
- {/if}
47
- </dd>
48
- </dl>
@@ -1,56 +0,0 @@
1
- <script>
2
- import { FrontmatterProperty, FrontmatterTaxonomy } from './';
3
-
4
- /**
5
- * @typedef {import("../utilities/processMarkdownFiles").MarkdownFile} MarkdownFile
6
- */
7
-
8
- /**
9
- * @type {{props: {properties: MarkdownFile}}}
10
- */
11
- let { props } = $props();
12
- // TODO: Normalize frontmatter props
13
- let { properties, website, format } = $derived(props);
14
- const keys = $derived(Object.keys(properties || {}));
15
-
16
- const excludedProperties = [
17
- 'title',
18
- 'description',
19
- 'type',
20
- 'ast',
21
- 'url',
22
- 'frontmatter',
23
- 'published',
24
- 'date',
25
- 'image',
26
- 'breadcrumb',
27
- 'imputedProperties',
28
- 'toc'
29
- ];
30
-
31
- // const { website } = $page.data;
32
-
33
- /**
34
- * Fetch a given property from a page.
35
- * @param {MarkdownFile} properties - A markdown file.
36
- * @param {string} key - The name of a property
37
- * @returns {any}
38
- */
39
- function getProperty(properties, key) {
40
- // @ts-ignore
41
- return properties[key];
42
- }
43
- </script>
44
-
45
- {#if properties}
46
- {#each keys as key}
47
- {#if !excludedProperties.includes(key)}
48
- {@const property = getProperty(properties, key)}
49
- {#if website.hasOwnProperty(key)}
50
- <FrontmatterTaxonomy {property} {key} {website} />
51
- {:else}
52
- <FrontmatterProperty {property} {key} {format} />
53
- {/if}
54
- {/if}
55
- {/each}
56
- {/if}