Skip to content

Releases: nvlang/sveltex

v0.4.1

18 Jul 17:43
6cc4dfb
Compare
Choose a tag to compare

Fixes

  • 6cc4dfb Export metadata from SvelTeX pages even if no frontmatter was found on the page in question. In those cases, we'll just have

    <script context="module">
    export const metadata = undefined;
    </script>

    which is better than the alternative

    <script context="module">
    </script>

    because it won't cause import.meta.glob('...', { import: 'metadata', eager: true }) to throw an error if it reaches a SvelTeX page that doesn't have any frontmatter.


Full Changelog: v0.4.0...v0.4.1

v0.4.0

18 Jul 05:21
2b81d16
Compare
Choose a tag to compare

Features

  • Wrap variables defined in frontmatter inside a metadata object and export that from within a <script context="module"> block. This enables us to now use tools like Vite's import.meta.glob('...', { import: 'metadata', eager: true }) to e.g. help render a list of available routes with whatever metadata was defined.

Fixes

  • SvelTeX is now conscious of the fact that the script preprocessor might run twice on the same file, given that Svelte files may include one <script> tag and one <script context="module"> tag. Previously, doing this could lead to problematic behavior with SvelTeX, e.g., importing a component twice, causing an error.

Full Changelog: v0.3.2...v0.4.0

v0.3.2

17 Jul 21:28
9741f5e
Compare
Choose a tag to compare

Fixes

  • 9741f5e Reduce false positives of isImported function, which is used to decide whether a "registered" component should be auto-imported.

Full Changelog: v0.3.1...v0.3.2

v0.3.1

17 Jul 21:18
db93a9d
Compare
Choose a tag to compare

Fixes

  • 34493c3 Fix auto-importing of "registered" components by passing the correct variable to the detectAndImportComponents function. Also, don't try to import components that contain characters that wouldn't be allowed in a JS variable name.

Documentation

  • ac518e4 Mention in README that SvelTeX is an ESM-only package.
  • 3840654 Add link to create-sveltex package in README.
  • db93a9d Add Knip to list of cool software in README.

Full Changelog: v0.3.0...v0.3.1

v0.3.0

17 Jul 19:33
e437eeb
Compare
Choose a tag to compare

Features

  • Use sanitize-html to ensure that HTML generated by Markdown processor is valid.

  • Remove <p> tags within HTML elements or Svelte components that cannot contain paragraphs (e.g., <span><p>*text*</p></span> becomes <span><em>text</em></span> now, ignoring insignificant whitespace.

  • Add markdown.components option to SvelTeX configuration to specify preferences in regards to how each Svelte component is treated by SvelTeX when it comes to whitespace adjustments.

  • Auto-import components "registered" in the markdown.components array from the SvelTeX configuration if they are used in the markup and not already imported in the file's <script> tag.

    Note: a component is "registered" in the markdown.components array iff there exists an object obj in the markdown.components array such that all of the following hold:

    • obj.name equals the name of the component (case-sensitive).
    • obj.importPath is not undefined.
  • Add markdown.remarkRehypeOptions and markdown.rehypeStringifyOptions to SvelTeX configuration when the unified Markdown backend is used.

Fixes

  • Refine whitespace adjustment performed before passing markup to the Markdown processor.

Refactor

  • Change default value of SvelTeX configuration property markdown.directives.enabled from true to false.

Build

  • Update dependencies.

Documentation


Full Changelog: v0.2.1...v0.3.0

v0.2.1

12 Jul 04:27
6532166
Compare
Choose a tag to compare

Build

  • Update dependencies in deno.jsonc.
  • Refine selection of files to publish to JSR.

Full Changelog: v0.2.0...v0.2.1

v0.2.0

12 Jul 04:09
45ccca5
Compare
Choose a tag to compare

Features

  • 2585236 Pass original content to post-transformations.

    The use-case that motivated this was wanting to add a post-transformer to the code handler that would add a "Copy Code" button to the resulting code block; for this purpose, it's useful to have the original code (i.e., before any syntax highlighting) available to the transformer, so that it can e.g. pass said content to a prop of a Svelte "Copy Code" button.

Fixes

  • 8da499b If the unified markdown backend is being used with retext plugins, messages emitted by said retext plugins weren't being logged to the console. This commit fixes this issue.
  • 91946bd Pass absolute file paths to the dependencies property of the object returned by the SvelTeX preprocessor. With relative paths, changes in the corresponding files weren't triggering HMR updates.

Documentation

  • 8959110 Fix mathjax install instructions in TSDoc comment.
  • b1ca182 Mention create-sveltex in README.
  • 76be29a Add plop to list of cool software that I didn't know before in README.

Refactoring

  • f045110 Import XRegExp from deps.ts instead of xregexp directly, in accordance with the centralized deps.ts design principle.

Chores

  • c6249a0 Simplify Vitest test script from package.json.
  • 7ac2ac8 Remove unused options from vitest.config.ts.
  • f411db6 Refine miscellaneous file glob patterns in configuration files (knip.json and tsconfig.check.json).

Build

  • 979d842 Update dependencies, including some major updates for glob and rimraf (regular dependencies) and @vitest/coverage-v8, @vitest/ui, and vitest (dev dependencies).
  • 330d710 Set "fixed" target in tsconfig.json (ES2018 instead of ESNext).
  • 22776a6 Remove some unused dev dependencies.

CI

  • 3af3c9e Make pre-commit git hook lint codebase, instead of running unit tests. This makes the hook take somewhat less time.
  • 4339b61 Remove action that bumped version strings and committed those changes automatically. Instead, we now set the version strings in both package.json and deno.jsonc to 0.0.0, and have the NPM resp. JSR publishing action bump the version within its local environment and publish a dirty branch, which is never actually committed. This simplifies the CI a bit, stops unsigned commits by GitHub Actions bot, and makes the existing discrepancy between tags and version strings in package.json and deno.jsonc less confusing (before, the version strings would always be just one release behind the tag; now, the version strings are always 0.0.0, which is, by virtue of being clearly intentional, arguably less confusing).

Full Changelog: v0.1.5...v0.2.0

v0.1.5

10 Jul 04:39
a94f7ca
Compare
Choose a tag to compare

Build

  • Remove @types/mdast from peer dependencies, since the unified markdown backend doesn't need it.
  • Add remark-retext to (optional) peer dependencies, since the unified markdown backend needs it.

Documentation

  • Fix install instructions for Shiki code backend in TSDoc comment.
  • Add JSR score badge to readme.
  • Polish readme badges.
  • Add extra spacing above readme title SVG.
  • Remove extraneous keyword (marked) from package.json.
  • Add sveltex keyword to package.json.

Chores

  • Remove old, commented-out code.

Full Changelog: v0.1.4...v0.1.5

v0.1.4

01 Jul 01:24
28b2f99
Compare
Choose a tag to compare

Refactoring

Documentation

  • Polish main README.md.

Full Changelog: v0.1.3...v0.1.4

v0.1.3

30 Jun 15:16
8ab223f
Compare
Choose a tag to compare

Fixes

  • Don't remove comments while building.

Full Changelog: v0.1.2...v0.1.3