Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Svelte Markdown example (Remark, Rehype, Svelte Components) #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
git-no wants to merge 7 commits into sdorra:main
base: main
Choose a base branch
Loading
from git-no:svelte-example

Conversation

@git-no
Copy link
Contributor

@git-no git-no commented Jun 8, 2025

No description provided.

Copy link

vercel bot commented Jun 8, 2025
edited
Loading

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
content-collections ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 11:44am

Copy link
Contributor Author

git-no commented Jun 8, 2025

Vite 6 is recommended

Copy link
Owner

sdorra commented Jun 8, 2025
edited
Loading

@git-no Can you add the pnpm-lock.yaml after a pnpm install?

Copy link

changeset-bot bot commented Jun 8, 2025
edited
Loading

⚠️ No Changeset found

Latest commit: e233a2c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor Author

git-no commented Jun 8, 2025

@sdorra pnpm-lockfile is now integrated.

My build locally failed with

samples-arktype:build: sh: Zeile 1: content-collections: Kommando nicht gefunden.
samples-xml:build: sh: Zeile 1: content-collections: Kommando nicht gefunden.
samples-cli:build: sh: Zeile 1: content-collections: Kommando nicht gefunden.
samples-arktype:build: ELIFECYCLE Command failed.
samples-xml:build: ELIFECYCLE Command failed.
samples-cli:build: ELIFECYCLE Command failed.
samples-valibot:build: 
samples-valibot:build: > samples-valibot@0.1.0 build /Users/lukas/code/labs/svelte-content-collections/samples/valibot
samples-valibot:build: > content-collections build
samples-valibot:build: 
@content-collections/remix-vite:build: cache miss, executing 2d16bb4e9a8811e9
@content-collections/vinxi:build: cache miss, executing 29946ae7386e1a66
@content-collections/remix-vite:build: 
samples-valibot:build: sh: Zeile 1: content-collections: Kommando nicht gefunden.
samples-valibot:build: ELIFECYCLE Command failed.
@content-collections/vinxi:build: 
samples-xml:build: ERROR: command finished with error: command (/Users/lukas/code/labs/svelte-content-collections/samples/xml) /Users/lukas/Library/pnpm/.tools/pnpm/8.15.8/bin/pnpm run build exited (1)
@content-collections/vinxi:build: 
@content-collections/remix-vite:build: 
samples-xml#build: command (/Users/lukas/code/labs/svelte-content-collections/samples/xml) 
 Tasks: 8 successful, 15 total
Cached: 0 cached, 15 total
 Time: 5.133s 
Failed: samples-xml#build
 ERROR run failed: command exited (1)
 ELIFECYCLE Command failed with exit code 1.

Copy link
Contributor Author

git-no commented Jun 9, 2025

@sdorra Are there any plans to update Vite to version 6 in the repository?

Copy link
Owner

sdorra commented Jun 10, 2025

Are there any plans to update Vite to version 6 in the repository?

No concrete plans yet. Once I finish the work on #471 and then #494, I will make the long-overdue upgrades to Next and Vite. For Vite, we need to ensure compatibility with v5 and v6.

My build locally failed with

The problem is that these tests use the content-collections CLI, which must be built first. To test a fresh clone of content-collections, follow these steps:

# install dependencies
pnpm install
# build the cli
pnpm build --filter=@content-collections/cli
# ensure the cli is linked
pnpm install
# build all packages
pnpm build
# run the tests
pnpm test

This should probably be in the README 🤔

git-no reacted with thumbs up emoji

Copy link
Owner

sdorra commented Jun 10, 2025

The ci process still ends with the following error:

ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with samples/svelte-kit/package.json

Have you done a pnpm install on the root of the monorepo?

"vite": "^5.4.6"
"@content-collections/core": "workspace:*",
"@content-collections/markdown": "workspace:*",
"@content-collections/vite": "workspace:*",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the fixed versions. They have to be fixed because the samples must be openable in StackBlitz, and StackBlitz only looks at the folder of the sample, not the whole repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem, I did rewrite these entries.

Copy link
Contributor Author

git-no commented Jun 12, 2025

@sdorra "Please keep the fixed versions. "

I do not get it? What do you like to have in package.json, my version or the previous version with Vite 5?

Just pnpm build did not work.
Building worked by following your steps.
But still pnpm test at the end fails.

Copy link
Owner

sdorra commented Jun 12, 2025

You have changed the version of the @content-collections/* packages to workspace:*, which is incompatible with the sparse checkout of StackBlitz.

Please retain the old versions of the @content-collections/* packages. The other packages can be upgraded. After reverting the versions, run pnpm install on the root package.json of the monorepo, and then commit the package.json and pnpm-lock.yaml.

I am currently not at home and will return on Sunday. I will review the failing tests then.

Copy link
Owner

sdorra commented Jun 15, 2025

I've added some styling and sample posts. I will update the tests tomorrow, and then we can merge the PR.

Copy link
Owner

sdorra commented Jun 16, 2025

@git-no i've updated the sample to match the look and feel of the other (newer) samples. The build and the tests are working now. But i've noticed that every svelte component i've used inside markdown is wrapped in a p tag. Is there a way to get rid of the p?

Copy link
Contributor Author

git-no commented Jun 17, 2025

I will check next week.

Copy link
Contributor Author

git-no commented Jun 21, 2025

@sdorra
I can not reproduce the issue you mentioned. My tests worked as expected:

  1. A Svelte component within a text is included in the <p>.
  2. A Svelte component at line start is integrated without <p>.

Do you have an example / repository?

Copy link
Owner

sdorra commented Jun 22, 2025

Do you have an example / repository?

Yeah, this pull request. Each MD file uses a different Svelte component and all of them a wrapped with a p tag.

@sdorra sdorra force-pushed the main branch 2 times, most recently from 1e28b7f to 50aead7 Compare July 10, 2025 19:02
@sdorra sdorra force-pushed the main branch 2 times, most recently from eb76dde to 759321d Compare October 2, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sdorra sdorra sdorra requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /