@samva/vite 0.18.0 → 0.19.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.
Files changed (65) hide show
  1. package/AGENTS.md +5 -2
  2. package/CHANGELOG.md +28 -0
  3. package/README.md +41 -0
  4. package/dist/{brand-BkXQMGgY.d.ts → brand-q80zlW2d.d.ts} +4 -2
  5. package/dist/build.d.ts +1 -1
  6. package/dist/build.js +4 -4
  7. package/dist/dev.d.ts +2 -2
  8. package/dist/dev.js +1 -1
  9. package/dist/editor/assets/index-D2Eh4--j.css +2 -0
  10. package/dist/editor/assets/index-mDq6Sihj.js +184 -0
  11. package/dist/editor/index.html +2 -2
  12. package/dist/editor/licenses/character-entities-legacy.md +22 -0
  13. package/dist/editor/licenses/character-reference-invalid.md +22 -0
  14. package/dist/editor/licenses/css-tree.md +19 -0
  15. package/dist/editor/licenses/decode-named-character-reference.md +22 -0
  16. package/dist/editor/licenses/devlop.md +22 -0
  17. package/dist/editor/licenses/estree-util-is-identifier-name.md +22 -0
  18. package/dist/editor/licenses/estree-util-visit.md +22 -0
  19. package/dist/editor/licenses/is-alphabetical.md +22 -0
  20. package/dist/editor/licenses/is-alphanumerical.md +22 -0
  21. package/dist/editor/licenses/is-decimal.md +22 -0
  22. package/dist/editor/licenses/is-hexadecimal.md +22 -0
  23. package/dist/editor/licenses/mdast-util-from-markdown.md +22 -0
  24. package/dist/editor/licenses/mdast-util-mdx-expression.md +22 -0
  25. package/dist/editor/licenses/mdast-util-mdx-jsx.md +22 -0
  26. package/dist/editor/licenses/mdast-util-to-string.md +22 -0
  27. package/dist/editor/licenses/micromark-core-commonmark.md +22 -0
  28. package/dist/editor/licenses/micromark-extension-mdx-expression.md +22 -0
  29. package/dist/editor/licenses/micromark-extension-mdx-jsx.md +22 -0
  30. package/dist/editor/licenses/micromark-factory-destination.md +22 -0
  31. package/dist/editor/licenses/micromark-factory-label.md +22 -0
  32. package/dist/editor/licenses/micromark-factory-mdx-expression.md +22 -0
  33. package/dist/editor/licenses/micromark-factory-space.md +22 -0
  34. package/dist/editor/licenses/micromark-factory-title.md +22 -0
  35. package/dist/editor/licenses/micromark-factory-whitespace.md +22 -0
  36. package/dist/editor/licenses/micromark-util-character.md +22 -0
  37. package/dist/editor/licenses/micromark-util-chunked.md +22 -0
  38. package/dist/editor/licenses/micromark-util-classify-character.md +22 -0
  39. package/dist/editor/licenses/micromark-util-combine-extensions.md +22 -0
  40. package/dist/editor/licenses/micromark-util-decode-numeric-character-reference.md +22 -0
  41. package/dist/editor/licenses/micromark-util-decode-string.md +22 -0
  42. package/dist/editor/licenses/micromark-util-edit-map.md +22 -0
  43. package/dist/editor/licenses/micromark-util-events-to-acorn.md +22 -0
  44. package/dist/editor/licenses/micromark-util-html-tag-name.md +22 -0
  45. package/dist/editor/licenses/micromark-util-normalize-identifier.md +22 -0
  46. package/dist/editor/licenses/micromark-util-resolve-all.md +22 -0
  47. package/dist/editor/licenses/micromark-util-subtokenize.md +22 -0
  48. package/dist/editor/licenses/micromark.md +22 -0
  49. package/dist/editor/licenses/parse-entities.md +22 -0
  50. package/dist/editor/licenses/source-map-js.md +28 -0
  51. package/dist/editor/licenses/unist-util-position-from-estree.md +22 -0
  52. package/dist/editor/licenses/unist-util-stringify-position.md +22 -0
  53. package/dist/editor/licenses/vfile-message.md +22 -0
  54. package/dist/editor/licenses/yaml.md +13 -0
  55. package/dist/{editor-CXu5ksXm.js → editor-CXbIfm3N.js} +1 -1
  56. package/dist/{editor-DfdlKEeu.d.ts → editor-DqMrfMrR.d.ts} +1 -1
  57. package/dist/index.d.ts +2 -2
  58. package/dist/index.js +1 -1
  59. package/dist/{project-BDIqD8ho.js → project-l7pOcW8X.js} +73 -15
  60. package/dist/project.d.ts +13 -2
  61. package/dist/project.js +2 -2
  62. package/dist/render.js +4 -4
  63. package/package.json +3 -3
  64. package/dist/editor/assets/index-CIlSV4Yp.js +0 -39
  65. package/dist/editor/assets/index-DRZO63Mg.css +0 -2
package/dist/project.js CHANGED
@@ -1,2 +1,2 @@
1
- import { C as renderEmailFixtures, S as renderChannelFixture, _ as channelsOf, a as projectRoot, b as finding, d as discoverEntries, g as templateDirectories, h as readProjectFiles, i as loadProject, l as DEFAULT_TEMPLATE_DIRS, n as createProjectSession, r as exportProject, t as DEFAULT_EXPORT_ASSET_BASE, u as SAMVA_DIR, v as compileProject, x as hasErrors, y as emailCompatibility } from "./project-BDIqD8ho.js";
2
- export { DEFAULT_EXPORT_ASSET_BASE, DEFAULT_TEMPLATE_DIRS, SAMVA_DIR, channelsOf, compileProject, createProjectSession, discoverEntries, emailCompatibility, exportProject, finding, hasErrors, loadProject, projectRoot, readProjectFiles, renderChannelFixture, renderEmailFixtures, templateDirectories };
1
+ import { C as renderChannelFixture, S as hasErrors, _ as templateDirectories, a as projectRoot, b as emailCompatibility, d as discoverEntries, f as discoverIssues, g as readProjectFiles, i as loadProject, l as DEFAULT_TEMPLATE_DIRS, n as createProjectSession, r as exportProject, t as DEFAULT_EXPORT_ASSET_BASE, u as SAMVA_DIR, v as channelsOf, w as renderEmailFixtures, x as finding, y as compileProject } from "./project-l7pOcW8X.js";
2
+ export { DEFAULT_EXPORT_ASSET_BASE, DEFAULT_TEMPLATE_DIRS, SAMVA_DIR, channelsOf, compileProject, createProjectSession, discoverEntries, discoverIssues, emailCompatibility, exportProject, finding, hasErrors, loadProject, projectRoot, readProjectFiles, renderChannelFixture, renderEmailFixtures, templateDirectories };
package/dist/render.js CHANGED
@@ -1,13 +1,13 @@
1
- import { C as renderEmailFixtures, S as renderChannelFixture, b as finding, i as loadProject, w as brandDiagnostics, x as hasErrors } from "./project-BDIqD8ho.js";
1
+ import { C as renderChannelFixture, S as hasErrors, T as brandDiagnostics, i as loadProject, w as renderEmailFixtures, x as finding } from "./project-l7pOcW8X.js";
2
2
  //#region src/render.ts
3
3
  /** Compile just enough of the project to find and build the named template. */
4
4
  const locate = async (input) => {
5
- const byPath = input.template.endsWith(".tsx");
5
+ const byPath = /\.(tsx|md)$/.test(input.template);
6
6
  const project = await loadProject(input, byPath ? [input.template.replace(/^\.\//, "")] : void 0);
7
7
  const { catalog } = project;
8
- const entry = catalog.templates.find((candidate) => byPath ? candidate.entryPath === input.template.replace(/^\.\//, "") : candidate.id === input.template);
8
+ const entry = [...catalog.templates, ...catalog.issues].find((candidate) => byPath ? candidate.entryPath === input.template.replace(/^\.\//, "") : candidate.id === input.template);
9
9
  const brand = brandDiagnostics(project.brand);
10
- const ambiguous = entry === void 0 ? [] : catalog.diagnostics.filter((item) => item.code === "duplicate-template-id" && item.message.startsWith(`Template id ${JSON.stringify(entry.id)} `));
10
+ const ambiguous = entry === void 0 ? [] : catalog.diagnostics.filter((item) => !entry.entryPath.endsWith(".md") && item.code === "duplicate-template-id" && item.message.startsWith(`Template id ${JSON.stringify(entry.id)} `) || entry.entryPath.endsWith(".md") && item.code === "duplicate-issue-slug" && item.message.startsWith(`Issue slug ${JSON.stringify(entry.id)} `));
11
11
  if (entry !== void 0 && ambiguous.length === 0) return {
12
12
  ok: true,
13
13
  entry,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samva/vite",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "Local editor, dev server and build for Samva email, SMS and WhatsApp templates",
5
5
  "keywords": [
6
6
  "email",
@@ -70,12 +70,12 @@
70
70
  "test:browser:cross": "bun run build:dependencies && bun run build && playwright test --config playwright.config.ts"
71
71
  },
72
72
  "dependencies": {
73
- "@samva/markup": "^0.18.0"
73
+ "@samva/markup": "^0.19.0"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@effect/vitest": "4.0.0",
77
77
  "@playwright/test": "1.63.0",
78
- "@samva/editor": "^0.18.0",
78
+ "@samva/editor": "^0.19.0",
79
79
  "@types/node": "^26.6.2",
80
80
  "tsdown": "^0.22.13",
81
81
  "typescript": "^7.0.2",