Releases: nvlang/sveltex
v0.4.1
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
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'simport.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
v0.3.1
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
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 objectobj
in themarkdown.components
array such that all of the following hold:obj.name
equals the name of the component (case-sensitive).obj.importPath
is notundefined
.
-
Add
markdown.remarkRehypeOptions
andmarkdown.rehypeStringifyOptions
to SvelTeX configuration when theunified
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
fromtrue
tofalse
.
Build
- Update dependencies.
Documentation
- Add
markdown.components
to https://sveltex.dev/docs/markdown.
Full Changelog: v0.2.1...v0.3.0
v0.2.1
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
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 withretext
plugins, messages emitted by saidretext
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
fromdeps.ts
instead ofxregexp
directly, in accordance with the centralizeddeps.ts
design principle.
Chores
- c6249a0 Simplify Vitest
test
script frompackage.json
. - 7ac2ac8 Remove unused options from
vitest.config.ts
. - f411db6 Refine miscellaneous file glob patterns in configuration files (
knip.json
andtsconfig.check.json
).
Build
- 979d842 Update dependencies, including some major updates for
glob
andrimraf
(regular dependencies) and@vitest/coverage-v8
,@vitest/ui
, andvitest
(dev dependencies). - 330d710 Set "fixed"
target
intsconfig.json
(ES2018
instead ofESNext
). - 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
anddeno.jsonc
to0.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 inpackage.json
anddeno.jsonc
less confusing (before, the version strings would always be just one release behind the tag; now, the version strings are always0.0.0
, which is, by virtue of being clearly intentional, arguably less confusing).
Full Changelog: v0.1.5...v0.2.0
v0.1.5
Build
- Remove
@types/mdast
from peer dependencies, since theunified
markdown backend doesn't need it. - Add
remark-retext
to (optional) peer dependencies, since theunified
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
) frompackage.json
. - Add
sveltex
keyword topackage.json
.
Chores
- Remove old, commented-out code.
Full Changelog: v0.1.4...v0.1.5
v0.1.4
Refactoring
- Remove some slow types.
Documentation
- Polish main
README.md
.
Full Changelog: v0.1.3...v0.1.4