nowebcli 0.2.6 → 0.2.8

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 (208) hide show
  1. package/package.json +4 -1
  2. package/public/fonts/templates/abril-fatface/LICENSE.txt +94 -0
  3. package/public/fonts/templates/abril-fatface/latin-ext.woff2 +0 -0
  4. package/public/fonts/templates/abril-fatface/latin.woff2 +0 -0
  5. package/public/fonts/templates/baloo2/LICENSE.txt +93 -0
  6. package/public/fonts/templates/baloo2/latin-ext.woff2 +0 -0
  7. package/public/fonts/templates/baloo2/latin.woff2 +0 -0
  8. package/public/fonts/templates/bebas-neue/LICENSE.txt +93 -0
  9. package/public/fonts/templates/bebas-neue/latin-ext.woff2 +0 -0
  10. package/public/fonts/templates/bebas-neue/latin.woff2 +0 -0
  11. package/public/fonts/templates/bodoni-moda/LICENSE.txt +93 -0
  12. package/public/fonts/templates/bodoni-moda/latin-ext.woff2 +0 -0
  13. package/public/fonts/templates/bodoni-moda/latin.woff2 +0 -0
  14. package/public/fonts/templates/bungee/LICENSE.txt +93 -0
  15. package/public/fonts/templates/bungee/latin-ext.woff2 +0 -0
  16. package/public/fonts/templates/bungee/latin.woff2 +0 -0
  17. package/public/fonts/templates/caveat/LICENSE.txt +93 -0
  18. package/public/fonts/templates/caveat/latin-ext.woff2 +0 -0
  19. package/public/fonts/templates/caveat/latin.woff2 +0 -0
  20. package/public/fonts/templates/chewy/LICENSE.txt +202 -0
  21. package/public/fonts/templates/chewy/latin.woff2 +0 -0
  22. package/public/fonts/templates/cinzel/LICENSE.txt +93 -0
  23. package/public/fonts/templates/cinzel/latin-ext.woff2 +0 -0
  24. package/public/fonts/templates/cinzel/latin.woff2 +0 -0
  25. package/public/fonts/templates/comfortaa/LICENSE.txt +93 -0
  26. package/public/fonts/templates/comfortaa/latin-ext.woff2 +0 -0
  27. package/public/fonts/templates/comfortaa/latin.woff2 +0 -0
  28. package/public/fonts/templates/cormorant-garamond/LICENSE.txt +93 -0
  29. package/public/fonts/templates/cormorant-garamond/latin-2.woff2 +0 -0
  30. package/public/fonts/templates/cormorant-garamond/latin-ext-2.woff2 +0 -0
  31. package/public/fonts/templates/cormorant-garamond/latin-ext.woff2 +0 -0
  32. package/public/fonts/templates/cormorant-garamond/latin.woff2 +0 -0
  33. package/public/fonts/templates/crimson-pro/LICENSE.txt +93 -0
  34. package/public/fonts/templates/crimson-pro/latin-ext.woff2 +0 -0
  35. package/public/fonts/templates/crimson-pro/latin.woff2 +0 -0
  36. package/public/fonts/templates/dancing-script/LICENSE.txt +93 -0
  37. package/public/fonts/templates/dancing-script/latin-ext.woff2 +0 -0
  38. package/public/fonts/templates/dancing-script/latin.woff2 +0 -0
  39. package/public/fonts/templates/dm-sans/LICENSE.txt +93 -0
  40. package/public/fonts/templates/dm-sans/latin-ext.woff2 +0 -0
  41. package/public/fonts/templates/dm-sans/latin.woff2 +0 -0
  42. package/public/fonts/templates/dm-serif-display/LICENSE.txt +93 -0
  43. package/public/fonts/templates/dm-serif-display/latin-ext.woff2 +0 -0
  44. package/public/fonts/templates/dm-serif-display/latin.woff2 +0 -0
  45. package/public/fonts/templates/eb-garamond/LICENSE.txt +93 -0
  46. package/public/fonts/templates/eb-garamond/latin-ext.woff2 +0 -0
  47. package/public/fonts/templates/eb-garamond/latin.woff2 +0 -0
  48. package/public/fonts/templates/fira-code/LICENSE.txt +93 -0
  49. package/public/fonts/templates/fira-code/latin-ext.woff2 +0 -0
  50. package/public/fonts/templates/fira-code/latin.woff2 +0 -0
  51. package/public/fonts/templates/fonts.css +1275 -0
  52. package/public/fonts/templates/fraunces/LICENSE.txt +93 -0
  53. package/public/fonts/templates/fraunces/latin-ext.woff2 +0 -0
  54. package/public/fonts/templates/fraunces/latin.woff2 +0 -0
  55. package/public/fonts/templates/fredoka/LICENSE.txt +93 -0
  56. package/public/fonts/templates/fredoka/latin-ext.woff2 +0 -0
  57. package/public/fonts/templates/fredoka/latin.woff2 +0 -0
  58. package/public/fonts/templates/grenze-gotisch/LICENSE.txt +93 -0
  59. package/public/fonts/templates/grenze-gotisch/latin-ext.woff2 +0 -0
  60. package/public/fonts/templates/grenze-gotisch/latin.woff2 +0 -0
  61. package/public/fonts/templates/ibm-plex-mono/LICENSE.txt +93 -0
  62. package/public/fonts/templates/ibm-plex-mono/latin-2.woff2 +0 -0
  63. package/public/fonts/templates/ibm-plex-mono/latin-ext-2.woff2 +0 -0
  64. package/public/fonts/templates/ibm-plex-mono/latin-ext.woff2 +0 -0
  65. package/public/fonts/templates/ibm-plex-mono/latin.woff2 +0 -0
  66. package/public/fonts/templates/ibm-plex-sans/LICENSE.txt +93 -0
  67. package/public/fonts/templates/ibm-plex-sans/latin-2.woff2 +0 -0
  68. package/public/fonts/templates/ibm-plex-sans/latin-ext-2.woff2 +0 -0
  69. package/public/fonts/templates/ibm-plex-sans/latin-ext.woff2 +0 -0
  70. package/public/fonts/templates/ibm-plex-sans/latin.woff2 +0 -0
  71. package/public/fonts/templates/inter/LICENSE.txt +93 -0
  72. package/public/fonts/templates/inter/latin-ext.woff2 +0 -0
  73. package/public/fonts/templates/inter/latin.woff2 +0 -0
  74. package/public/fonts/templates/jet-brains-mono/LICENSE.txt +93 -0
  75. package/public/fonts/templates/jet-brains-mono/latin-ext.woff2 +0 -0
  76. package/public/fonts/templates/jet-brains-mono/latin.woff2 +0 -0
  77. package/public/fonts/templates/josefin-sans/LICENSE.txt +93 -0
  78. package/public/fonts/templates/josefin-sans/latin-ext.woff2 +0 -0
  79. package/public/fonts/templates/josefin-sans/latin.woff2 +0 -0
  80. package/public/fonts/templates/karla/LICENSE.txt +93 -0
  81. package/public/fonts/templates/karla/latin-ext.woff2 +0 -0
  82. package/public/fonts/templates/karla/latin.woff2 +0 -0
  83. package/public/fonts/templates/lato/LICENSE.txt +93 -0
  84. package/public/fonts/templates/lato/latin-2.woff2 +0 -0
  85. package/public/fonts/templates/lato/latin-ext-2.woff2 +0 -0
  86. package/public/fonts/templates/lato/latin-ext.woff2 +0 -0
  87. package/public/fonts/templates/lato/latin.woff2 +0 -0
  88. package/public/fonts/templates/libre-baskerville/LICENSE.txt +93 -0
  89. package/public/fonts/templates/libre-baskerville/latin-2.woff2 +0 -0
  90. package/public/fonts/templates/libre-baskerville/latin-ext-2.woff2 +0 -0
  91. package/public/fonts/templates/libre-baskerville/latin-ext.woff2 +0 -0
  92. package/public/fonts/templates/libre-baskerville/latin.woff2 +0 -0
  93. package/public/fonts/templates/lilita-one/LICENSE.txt +94 -0
  94. package/public/fonts/templates/lilita-one/latin-ext.woff2 +0 -0
  95. package/public/fonts/templates/lilita-one/latin.woff2 +0 -0
  96. package/public/fonts/templates/limelight/LICENSE.txt +94 -0
  97. package/public/fonts/templates/limelight/latin-ext.woff2 +0 -0
  98. package/public/fonts/templates/limelight/latin.woff2 +0 -0
  99. package/public/fonts/templates/lora/LICENSE.txt +93 -0
  100. package/public/fonts/templates/lora/latin-ext.woff2 +0 -0
  101. package/public/fonts/templates/lora/latin.woff2 +0 -0
  102. package/public/fonts/templates/manrope/LICENSE.txt +93 -0
  103. package/public/fonts/templates/manrope/latin-ext.woff2 +0 -0
  104. package/public/fonts/templates/manrope/latin.woff2 +0 -0
  105. package/public/fonts/templates/marcellus/LICENSE.txt +93 -0
  106. package/public/fonts/templates/marcellus/latin-ext.woff2 +0 -0
  107. package/public/fonts/templates/marcellus/latin.woff2 +0 -0
  108. package/public/fonts/templates/merriweather/LICENSE.txt +93 -0
  109. package/public/fonts/templates/merriweather/latin-ext.woff2 +0 -0
  110. package/public/fonts/templates/merriweather/latin.woff2 +0 -0
  111. package/public/fonts/templates/monoton/LICENSE.txt +94 -0
  112. package/public/fonts/templates/monoton/latin-ext.woff2 +0 -0
  113. package/public/fonts/templates/monoton/latin.woff2 +0 -0
  114. package/public/fonts/templates/montserrat/LICENSE.txt +93 -0
  115. package/public/fonts/templates/montserrat/latin-ext.woff2 +0 -0
  116. package/public/fonts/templates/montserrat/latin.woff2 +0 -0
  117. package/public/fonts/templates/mulish/LICENSE.txt +93 -0
  118. package/public/fonts/templates/mulish/latin-ext.woff2 +0 -0
  119. package/public/fonts/templates/mulish/latin.woff2 +0 -0
  120. package/public/fonts/templates/newsreader/LICENSE.txt +93 -0
  121. package/public/fonts/templates/newsreader/latin-ext.woff2 +0 -0
  122. package/public/fonts/templates/newsreader/latin.woff2 +0 -0
  123. package/public/fonts/templates/nunito-sans/LICENSE.txt +93 -0
  124. package/public/fonts/templates/nunito-sans/latin-ext.woff2 +0 -0
  125. package/public/fonts/templates/nunito-sans/latin.woff2 +0 -0
  126. package/public/fonts/templates/open-sans/LICENSE.txt +92 -0
  127. package/public/fonts/templates/open-sans/latin-ext.woff2 +0 -0
  128. package/public/fonts/templates/open-sans/latin.woff2 +0 -0
  129. package/public/fonts/templates/outfit/LICENSE.txt +93 -0
  130. package/public/fonts/templates/outfit/latin-ext.woff2 +0 -0
  131. package/public/fonts/templates/outfit/latin.woff2 +0 -0
  132. package/public/fonts/templates/pacifico/LICENSE.txt +93 -0
  133. package/public/fonts/templates/pacifico/latin-ext.woff2 +0 -0
  134. package/public/fonts/templates/pacifico/latin.woff2 +0 -0
  135. package/public/fonts/templates/permanent-marker/LICENSE.txt +202 -0
  136. package/public/fonts/templates/permanent-marker/latin.woff2 +0 -0
  137. package/public/fonts/templates/pixelify-sans/LICENSE.txt +93 -0
  138. package/public/fonts/templates/pixelify-sans/latin-ext.woff2 +0 -0
  139. package/public/fonts/templates/pixelify-sans/latin.woff2 +0 -0
  140. package/public/fonts/templates/playfair-display/LICENSE.txt +93 -0
  141. package/public/fonts/templates/playfair-display/latin-ext.woff2 +0 -0
  142. package/public/fonts/templates/playfair-display/latin.woff2 +0 -0
  143. package/public/fonts/templates/plus-jakarta-sans/LICENSE.txt +93 -0
  144. package/public/fonts/templates/plus-jakarta-sans/latin-ext.woff2 +0 -0
  145. package/public/fonts/templates/plus-jakarta-sans/latin.woff2 +0 -0
  146. package/public/fonts/templates/poppins/LICENSE.txt +93 -0
  147. package/public/fonts/templates/poppins/latin-2.woff2 +0 -0
  148. package/public/fonts/templates/poppins/latin-ext-2.woff2 +0 -0
  149. package/public/fonts/templates/poppins/latin-ext.woff2 +0 -0
  150. package/public/fonts/templates/poppins/latin.woff2 +0 -0
  151. package/public/fonts/templates/quicksand/LICENSE.txt +93 -0
  152. package/public/fonts/templates/quicksand/latin-ext.woff2 +0 -0
  153. package/public/fonts/templates/quicksand/latin.woff2 +0 -0
  154. package/public/fonts/templates/raleway/LICENSE.txt +93 -0
  155. package/public/fonts/templates/raleway/latin-ext.woff2 +0 -0
  156. package/public/fonts/templates/raleway/latin.woff2 +0 -0
  157. package/public/fonts/templates/roboto/LICENSE.txt +93 -0
  158. package/public/fonts/templates/roboto/latin-ext.woff2 +0 -0
  159. package/public/fonts/templates/roboto/latin.woff2 +0 -0
  160. package/public/fonts/templates/rubik-bubbles/LICENSE.txt +93 -0
  161. package/public/fonts/templates/rubik-bubbles/latin-ext.woff2 +0 -0
  162. package/public/fonts/templates/rubik-bubbles/latin.woff2 +0 -0
  163. package/public/fonts/templates/rye/LICENSE.txt +94 -0
  164. package/public/fonts/templates/rye/latin-ext.woff2 +0 -0
  165. package/public/fonts/templates/rye/latin.woff2 +0 -0
  166. package/public/fonts/templates/source-code-pro/LICENSE.txt +93 -0
  167. package/public/fonts/templates/source-code-pro/latin-ext.woff2 +0 -0
  168. package/public/fonts/templates/source-code-pro/latin.woff2 +0 -0
  169. package/public/fonts/templates/source-sans3/LICENSE.txt +93 -0
  170. package/public/fonts/templates/source-sans3/latin-ext.woff2 +0 -0
  171. package/public/fonts/templates/source-sans3/latin.woff2 +0 -0
  172. package/public/fonts/templates/space-grotesk/LICENSE.txt +93 -0
  173. package/public/fonts/templates/space-grotesk/latin-ext.woff2 +0 -0
  174. package/public/fonts/templates/space-grotesk/latin.woff2 +0 -0
  175. package/public/fonts/templates/space-mono/LICENSE.txt +93 -0
  176. package/public/fonts/templates/space-mono/latin-2.woff2 +0 -0
  177. package/public/fonts/templates/space-mono/latin-ext-2.woff2 +0 -0
  178. package/public/fonts/templates/space-mono/latin-ext.woff2 +0 -0
  179. package/public/fonts/templates/space-mono/latin.woff2 +0 -0
  180. package/public/fonts/templates/special-elite/LICENSE.txt +202 -0
  181. package/public/fonts/templates/special-elite/latin-ext.woff2 +0 -0
  182. package/public/fonts/templates/special-elite/latin.woff2 +0 -0
  183. package/public/fonts/templates/spectral/LICENSE.txt +93 -0
  184. package/public/fonts/templates/spectral/latin-2.woff2 +0 -0
  185. package/public/fonts/templates/spectral/latin-ext-2.woff2 +0 -0
  186. package/public/fonts/templates/spectral/latin-ext.woff2 +0 -0
  187. package/public/fonts/templates/spectral/latin.woff2 +0 -0
  188. package/public/fonts/templates/syne/LICENSE.txt +93 -0
  189. package/public/fonts/templates/syne/latin-ext.woff2 +0 -0
  190. package/public/fonts/templates/syne/latin.woff2 +0 -0
  191. package/public/fonts/templates/tenor-sans/LICENSE.txt +94 -0
  192. package/public/fonts/templates/tenor-sans/latin-ext.woff2 +0 -0
  193. package/public/fonts/templates/tenor-sans/latin.woff2 +0 -0
  194. package/public/fonts/templates/unbounded/LICENSE.txt +93 -0
  195. package/public/fonts/templates/unbounded/latin-ext.woff2 +0 -0
  196. package/public/fonts/templates/unbounded/latin.woff2 +0 -0
  197. package/public/fonts/templates/urbanist/LICENSE.txt +93 -0
  198. package/public/fonts/templates/urbanist/latin-ext.woff2 +0 -0
  199. package/public/fonts/templates/urbanist/latin.woff2 +0 -0
  200. package/public/fonts/templates/work-sans/LICENSE.txt +93 -0
  201. package/public/fonts/templates/work-sans/latin-ext.woff2 +0 -0
  202. package/public/fonts/templates/work-sans/latin.woff2 +0 -0
  203. package/public/fonts/templates/yeseva-one/LICENSE.txt +93 -0
  204. package/public/fonts/templates/yeseva-one/latin-ext.woff2 +0 -0
  205. package/public/fonts/templates/yeseva-one/latin.woff2 +0 -0
  206. package/scripts/noweb.mjs +18 -5
  207. package/templates/templateFonts.ts +67 -0
  208. package/templates/templateRuntime.tsx +21 -0
@@ -0,0 +1,93 @@
1
+ Copyright 2012 The Yeseva One Project Authors (lemonad@jovanny.ru), with Reserved Font Name "Yeseva".
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
package/scripts/noweb.mjs CHANGED
@@ -103,6 +103,7 @@ async function buildTemplate(directory, slugOverride, assetBase = "/assets") {
103
103
  const metadata = JSON.parse(metadataSource);
104
104
  const currentSlug = requireSlug(slugOverride || metadata?.slug);
105
105
  if (!metadata || !types.has(metadata.type)) throw new Error(`${currentSlug}: template.json needs a type (${[...types].join(", ")}).`);
106
+ if (metadata.id != null && (!Number.isInteger(metadata.id) || metadata.id < 1)) throw new Error(`${currentSlug}: template.json has an invalid id.`);
106
107
 
107
108
  const [{ compileTemplateAssets }, { validateTemplateCode }, { validateTemplateCustomizations }] = await Promise.all([
108
109
  load("templates/templateCompiler.ts"),
@@ -167,6 +168,7 @@ async function upload() {
167
168
  const form = new FormData();
168
169
  form.set("slug", template.slug);
169
170
  form.set("type", template.type);
171
+ if (template.id) form.set("id", String(template.id));
170
172
  form.set("source", template.source);
171
173
  form.set("customizations", JSON.stringify(template.customizations));
172
174
  form.set("assetPaths", JSON.stringify(template.assetFiles.map((file) => file.path)));
@@ -180,13 +182,15 @@ async function upload() {
180
182
  });
181
183
  const result = await response.json().catch(() => ({}));
182
184
  if (!response.ok) throw new Error(result.error || `Upload failed (${response.status}).`);
185
+ if (!Number.isInteger(result.id) || result.id < 1) throw new Error("Upload returned an invalid template ID.");
186
+ await writeFile(join(root, "template.json"), `${JSON.stringify({ id: result.id, slug: template.slug, type: template.type }, null, 2)}\n`);
183
187
  console.log(`Published ${template.slug}: ${new URL(result.url, apiBase)}`);
184
188
  }
185
189
 
186
190
  async function deleteTemplate(value) {
187
- const selectedSlug = value
188
- ? requireSlug(value)
189
- : requireSlug(JSON.parse(await readFile(join(root, "template.json"), "utf8")).slug);
191
+ const metadata = value ? null : JSON.parse(await readFile(join(root, "template.json"), "utf8"));
192
+ const selectedSlug = requireSlug(value || metadata?.slug);
193
+ const selectedId = Number.isInteger(metadata?.id) && metadata.id > 0 ? metadata.id : null;
190
194
 
191
195
  if (!cliArgs.includes("--yes")) {
192
196
  if (!process.stdin.isTTY) throw new Error("Pass --yes to confirm deletion.");
@@ -197,7 +201,8 @@ async function deleteTemplate(value) {
197
201
  }
198
202
 
199
203
  const credentials = await requireCredentials();
200
- const response = await fetch(`${apiBase}/api/templates/download?slug=${encodeURIComponent(selectedSlug)}`, {
204
+ const selector = selectedId ? `id=${selectedId}` : `slug=${encodeURIComponent(selectedSlug)}`;
205
+ const response = await fetch(`${apiBase}/api/templates/download?${selector}`, {
201
206
  method: "DELETE",
202
207
  headers: { Authorization: `Bearer ${credentials.token}` },
203
208
  });
@@ -226,7 +231,7 @@ async function listTemplates() {
226
231
  if (projects.length) {
227
232
  if (templates.length) console.log();
228
233
  console.log("Projects");
229
- for (const project of projects) console.log(`${project.id}\t${project.name}`);
234
+ for (const project of projects) console.log(`${project.id}\t${project.domain}`);
230
235
  }
231
236
  }
232
237
 
@@ -245,6 +250,7 @@ async function downloadTemplate(value) {
245
250
  const template = result.template;
246
251
  if (
247
252
  !template || typeof template.metadata?.slug !== "string" ||
253
+ !Number.isInteger(template.metadata?.id) || template.metadata.id < 1 ||
248
254
  !types.has(template.metadata?.type) || typeof template.source !== "string" ||
249
255
  !Array.isArray(template.customizations) || !Array.isArray(template.assets) || template.assets.length > 200
250
256
  ) throw new Error("The server returned an invalid template.");
@@ -434,6 +440,13 @@ async function findTemplates() {
434
440
  }
435
441
 
436
442
  async function servePublic(pathname, response) {
443
+ if (pathname.startsWith("/fonts/templates/")) {
444
+ return serveFile(
445
+ resolve(packageRoot, "public/fonts/templates"),
446
+ decodeURIComponent(pathname.slice("/fonts/templates/".length)),
447
+ response,
448
+ );
449
+ }
437
450
  if (pathname.startsWith("/assets/")) {
438
451
  return serveFile(
439
452
  resolve(root, "public"),
@@ -0,0 +1,67 @@
1
+ export const templateFontCatalog = [
2
+ { key: "inter", family: "Inter", category: "Sans", query: "Inter:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
3
+ { key: "roboto", family: "Roboto", category: "Sans", query: "Roboto:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
4
+ { key: "openSans", family: "Open Sans", category: "Sans", query: "Open Sans:wght@300..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
5
+ { key: "lato", family: "Lato", category: "Sans", query: "Lato:wght@400;700", fallback: "ui-sans-serif, system-ui, sans-serif" },
6
+ { key: "montserrat", family: "Montserrat", category: "Sans", query: "Montserrat:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
7
+ { key: "poppins", family: "Poppins", category: "Sans", query: "Poppins:wght@400;700", fallback: "ui-sans-serif, system-ui, sans-serif" },
8
+ { key: "raleway", family: "Raleway", category: "Sans", query: "Raleway:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
9
+ { key: "nunitoSans", family: "Nunito Sans", category: "Sans", query: "Nunito Sans:wght@200..1000", fallback: "ui-sans-serif, system-ui, sans-serif" },
10
+ { key: "workSans", family: "Work Sans", category: "Sans", query: "Work Sans:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
11
+ { key: "manrope", family: "Manrope", category: "Sans", query: "Manrope:wght@200..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
12
+ { key: "dmSans", family: "DM Sans", category: "Sans", query: "DM Sans:wght@100..1000", fallback: "ui-sans-serif, system-ui, sans-serif" },
13
+ { key: "spaceGrotesk", family: "Space Grotesk", category: "Sans", query: "Space Grotesk:wght@300..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
14
+ { key: "outfit", family: "Outfit", category: "Sans", query: "Outfit:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
15
+ { key: "plusJakartaSans", family: "Plus Jakarta Sans", category: "Sans", query: "Plus Jakarta Sans:wght@200..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
16
+ { key: "urbanist", family: "Urbanist", category: "Sans", query: "Urbanist:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
17
+ { key: "ibmPlexSans", family: "IBM Plex Sans", category: "Sans", query: "IBM Plex Sans:wght@400;700", fallback: "ui-sans-serif, system-ui, sans-serif" },
18
+ { key: "sourceSans3", family: "Source Sans 3", category: "Sans", query: "Source Sans 3:wght@200..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
19
+ { key: "quicksand", family: "Quicksand", category: "Calm", query: "Quicksand:wght@300..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
20
+ { key: "comfortaa", family: "Comfortaa", category: "Calm", query: "Comfortaa:wght@300..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
21
+ { key: "josefinSans", family: "Josefin Sans", category: "Calm", query: "Josefin Sans:wght@100..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
22
+ { key: "tenorSans", family: "Tenor Sans", category: "Calm", query: "Tenor Sans", fallback: "ui-sans-serif, system-ui, sans-serif" },
23
+ { key: "marcellus", family: "Marcellus", category: "Calm", query: "Marcellus", fallback: "ui-serif, Georgia, serif" },
24
+ { key: "karla", family: "Karla", category: "Calm", query: "Karla:wght@200..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
25
+ { key: "mulish", family: "Mulish", category: "Calm", query: "Mulish:wght@200..1000", fallback: "ui-sans-serif, system-ui, sans-serif" },
26
+ { key: "playfairDisplay", family: "Playfair Display", category: "Serif", query: "Playfair Display:wght@400..900", fallback: "ui-serif, Georgia, serif" },
27
+ { key: "merriweather", family: "Merriweather", category: "Serif", query: "Merriweather:wght@300..900", fallback: "ui-serif, Georgia, serif" },
28
+ { key: "lora", family: "Lora", category: "Serif", query: "Lora:wght@400..700", fallback: "ui-serif, Georgia, serif" },
29
+ { key: "libreBaskerville", family: "Libre Baskerville", category: "Serif", query: "Libre Baskerville:wght@400;700", fallback: "ui-serif, Georgia, serif" },
30
+ { key: "cormorantGaramond", family: "Cormorant Garamond", category: "Serif", query: "Cormorant Garamond:wght@400;700", fallback: "ui-serif, Georgia, serif" },
31
+ { key: "ebGaramond", family: "EB Garamond", category: "Serif", query: "EB Garamond:wght@400..800", fallback: "ui-serif, Georgia, serif" },
32
+ { key: "fraunces", family: "Fraunces", category: "Serif", query: "Fraunces:opsz,wght@9..144,100..900", fallback: "ui-serif, Georgia, serif" },
33
+ { key: "bodoniModa", family: "Bodoni Moda", category: "Serif", query: "Bodoni Moda:opsz,wght@6..96,400..900", fallback: "ui-serif, Georgia, serif" },
34
+ { key: "dmSerifDisplay", family: "DM Serif Display", category: "Serif", query: "DM Serif Display", fallback: "ui-serif, Georgia, serif" },
35
+ { key: "newsreader", family: "Newsreader", category: "Serif", query: "Newsreader:opsz,wght@6..72,200..800", fallback: "ui-serif, Georgia, serif" },
36
+ { key: "crimsonPro", family: "Crimson Pro", category: "Serif", query: "Crimson Pro:wght@200..900", fallback: "ui-serif, Georgia, serif" },
37
+ { key: "spectral", family: "Spectral", category: "Serif", query: "Spectral:wght@400;700", fallback: "ui-serif, Georgia, serif" },
38
+ { key: "pixelifySans", family: "Pixelify Sans", category: "Playful", query: "Pixelify Sans:wght@400..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
39
+ { key: "fredoka", family: "Fredoka", category: "Playful", query: "Fredoka:wght@300..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
40
+ { key: "baloo2", family: "Baloo 2", category: "Playful", query: "Baloo 2:wght@400..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
41
+ { key: "bungee", family: "Bungee", category: "Playful", query: "Bungee", fallback: "ui-sans-serif, system-ui, sans-serif" },
42
+ { key: "chewy", family: "Chewy", category: "Playful", query: "Chewy", fallback: "ui-sans-serif, system-ui, sans-serif" },
43
+ { key: "lilitaOne", family: "Lilita One", category: "Playful", query: "Lilita One", fallback: "ui-sans-serif, system-ui, sans-serif" },
44
+ { key: "rubikBubbles", family: "Rubik Bubbles", category: "Playful", query: "Rubik Bubbles", fallback: "ui-sans-serif, system-ui, sans-serif" },
45
+ { key: "monoton", family: "Monoton", category: "Playful", query: "Monoton", fallback: "ui-sans-serif, system-ui, sans-serif" },
46
+ { key: "pacifico", family: "Pacifico", category: "Playful", query: "Pacifico", fallback: "cursive" },
47
+ { key: "caveat", family: "Caveat", category: "Playful", query: "Caveat:wght@400..700", fallback: "cursive" },
48
+ { key: "dancingScript", family: "Dancing Script", category: "Playful", query: "Dancing Script:wght@400..700", fallback: "cursive" },
49
+ { key: "permanentMarker", family: "Permanent Marker", category: "Playful", query: "Permanent Marker", fallback: "cursive" },
50
+ { key: "bebasNeue", family: "Bebas Neue", category: "Vintage", query: "Bebas Neue", fallback: "ui-sans-serif, system-ui, sans-serif" },
51
+ { key: "abrilFatface", family: "Abril Fatface", category: "Vintage", query: "Abril Fatface", fallback: "ui-serif, Georgia, serif" },
52
+ { key: "yesevaOne", family: "Yeseva One", category: "Vintage", query: "Yeseva One", fallback: "ui-serif, Georgia, serif" },
53
+ { key: "cinzel", family: "Cinzel", category: "Vintage", query: "Cinzel:wght@400..900", fallback: "ui-serif, Georgia, serif" },
54
+ { key: "rye", family: "Rye", category: "Vintage", query: "Rye", fallback: "ui-serif, Georgia, serif" },
55
+ { key: "limelight", family: "Limelight", category: "Vintage", query: "Limelight", fallback: "ui-serif, Georgia, serif" },
56
+ { key: "specialElite", family: "Special Elite", category: "Vintage", query: "Special Elite", fallback: "ui-monospace, monospace" },
57
+ { key: "grenzeGotisch", family: "Grenze Gotisch", category: "Vintage", query: "Grenze Gotisch:wght@100..900", fallback: "ui-serif, Georgia, serif" },
58
+ { key: "unbounded", family: "Unbounded", category: "Vintage", query: "Unbounded:wght@200..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
59
+ { key: "syne", family: "Syne", category: "Vintage", query: "Syne:wght@400..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
60
+ { key: "jetBrainsMono", family: "JetBrains Mono", category: "Mono", query: "JetBrains Mono:wght@100..800", fallback: "ui-monospace, monospace" },
61
+ { key: "spaceMono", family: "Space Mono", category: "Mono", query: "Space Mono:wght@400;700", fallback: "ui-monospace, monospace" },
62
+ { key: "ibmPlexMono", family: "IBM Plex Mono", category: "Mono", query: "IBM Plex Mono:wght@400;700", fallback: "ui-monospace, monospace" },
63
+ { key: "firaCode", family: "Fira Code", category: "Mono", query: "Fira Code:wght@300..700", fallback: "ui-monospace, monospace" },
64
+ { key: "sourceCodePro", family: "Source Code Pro", category: "Mono", query: "Source Code Pro:wght@200..900", fallback: "ui-monospace, monospace" },
65
+ ] as const;
66
+
67
+ export type TemplateFontKey = (typeof templateFontCatalog)[number]["key"];
@@ -16,6 +16,7 @@ import {
16
16
  normalizeCustomizationValues,
17
17
  type CustomizationValues,
18
18
  } from "../lib/customizations";
19
+ import { templateFontCatalog, type TemplateFontKey } from "./templateFonts";
19
20
 
20
21
  export type { CustomizationValue, CustomizationValues } from "../lib/customizations";
21
22
 
@@ -40,6 +41,26 @@ let currentTemplateRuntime: TemplateRuntimeContextValue = {
40
41
  values: {},
41
42
  };
42
43
 
44
+ const fontStyles = Object.fromEntries(templateFontCatalog.map(({ family, fallback, key }) => [
45
+ key,
46
+ { get fontFamily() { return loadFont(family, fallback); } },
47
+ ])) as Record<TemplateFontKey, { readonly fontFamily: string }>;
48
+
49
+ function loadFont(family: string, fallback: string) {
50
+ if (typeof document !== "undefined" && !document.getElementById("noweb-template-fonts")) {
51
+ const stylesheet = document.createElement("link");
52
+ stylesheet.id = "noweb-template-fonts";
53
+ stylesheet.rel = "stylesheet";
54
+ stylesheet.href = window.location.hostname === "storage.noweb.app"
55
+ ? "https://noweb.app/fonts/templates/fonts.css"
56
+ : "/fonts/templates/fonts.css";
57
+ document.head.append(stylesheet);
58
+ }
59
+ return `"${family}", ${fallback}`;
60
+ }
61
+
62
+ export const font = fontStyles;
63
+
43
64
  export function TemplateRuntimeProvider({
44
65
  children,
45
66
  customizations,