8000 feat: `paraglide` adder by manuel3108 · Pull Request #67 · sveltejs/cli · GitHub
[go: up one dir, main page]

Skip to content

feat: paraglide adder #67

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

8000
Merged
merged 66 commits into from
Oct 13, 2024
Merged

feat: paraglide adder #67

merged 66 commits into from
Oct 13, 2024

Conversation

manuel3108
Copy link
Member
@manuel3108 manuel3108 commented Oct 6, 2024

Notes:

  • shoutout to @LorisSigrist and @samuelstroschein for the initial pr against svelte-add. I tried patching in their changes, which obviously only worked to some degree. But at least git recognizes that they authored those commits now
  • depends on feat: supabase #45 as i need a few methods that i have moved / improved there, especially for the hooks.ts file

new features:

  • string and number questions can now have placeholders, and can provide a validate function (implemented by @LorisSigrist)
  • preInstall & postInstall hooks. This was necessary because this adder needs to generated multiple files past on a string option input

todos:

  • check rejected files
  • test if it works
  • make it more robust
  • add tests they are not yet implemented, we can easily do this later.

Copy link
pkg-pr-new bot commented Oct 6, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/sveltejs/cli/sv@67

commit: 63e065a

@manuel3108 manuel3108 changed the title draft: feat: paraglide adder feat: paraglide adder Oct 9, 2024
@benmccann
Copy link
Member

I just tried running locally with ../../cli/packages/cli/dist/bin.js add paraglide, but it didn't work for me

Screenshot from 2024-10-11 11-30-34

Copy link
changeset-bot bot commented Oct 11, 2024

🦋 Changeset detected

Latest commit: 63e065a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

Not sure what this means? Click here to learn what changesets are.

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

@benmccann benmccann mentioned this pull request Oct 11, 2024
24 tasks
@benmccann
Copy link
Member

It seems this error message occurs because we're passing -1 as the start (Rich-Harris/magic-string#288)

@benmccann
Copy link
Member

This is working now!

Do you think there's a way to improve the formatting? I'm not sure why it's adding everything on one line and if we can insert some new lines to make it a bit better

<section>
	<h1>
		<span class="welcome">
			<picture>
				<source srcset="{welcome}" type="image/webp" />
				<img src="{welcome_fallback}" alt="Welcome" />
			</picture>
		</span>

		to your new<br />SvelteKit app
	</h1>

	<h2>
		try editing <strong>src/routes/+page.svelte</strong>
	</h2>

	<Counter></Counter>
</section><h1>{m.hello_world({ name: 'SvelteKit User' })}</h1><div><button onclick="{() => switchToLanguage('en')}">en</button></div>

@manuel3108
Copy link
Member Author

Nice!

Seems like dom-serializer is not doing any formatting and not providing any options regarding that. I added a few new lines and tabs here and there, so that this i the ouput for now:

image

We could discuss if we should add spaces or tabs, but adding tabs in the code feels way more natural than having to count 4 spaces. The rest should be handled in userland.

Copy link
Member
@benmccann benmccann left a comment

Choose a reason for hiding this comment

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

shit it! 🚢

nice work on all the improvements here!

@benmccann benmccann merged commit b705592 into main Oct 13, 2024
5 checks passed
@benmccann benmccann deleted the feat/paraglide branch October 13, 2024 15:27
@github-actions github-actions bot mentioned this pull request Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0