Skip to content

feat: add alpine parser #1763

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
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

sanyamkamat
Copy link
Collaborator

Description

Please provide the following information:

  • What changes you made: PR adds alpine parser

  • Why you made them, and: We need a alpine parser

  • Any other useful context: NA

Make sure to follow the PR preparation steps in CONTRIBUTING.md before submitting your PR:

  • format the codebase: from the root, run yarn fmt:prettier.
  • update all snapshots (in core & CLI): from the root, run yarn test:update
  • add Changeset entry: from the root, run yarn g:changeset and follow the CLI instructions. Alternatively, use the Changeset Github Bot to create the file.

Copy link

changeset-bot bot commented May 19, 2025

🦋 Changeset detected

Latest commit: 10e821c

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

This PR includes changesets to release 2 packages
Name Type
@builder.io/mitosis Minor
@builder.io/mitosis-cli Minor

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

Copy link

nx-cloud bot commented May 19, 2025

View your CI Pipeline Execution ↗ for commit 10e821c.

Command Status Duration Result
nx e2e @builder.io/e2e-app ✅ Succeeded 1m 12s View ↗
nx run-many --target test ✅ Succeeded 5m 18s View ↗
nx run-many --target build --exclude @builder.i... ✅ Succeeded 3m 59s View ↗
nx build @builder.io/mitosis-site ✅ Succeeded 2m 22s View ↗

☁️ Nx Cloud last updated this comment at 2025-05-19 19:28:02 UTC

Copy link
Contributor

@manucorporat manucorporat left a comment

Choose a reason for hiding this comment

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

LGTM, would wait for Sami's input though

# JavaScript/TypeScript Code Quality

# Persona
You are a senior full-stack typescript developer. One of those rare 10x developers that has incredible knowledge.
Copy link
Contributor

Choose a reason for hiding this comment

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

😄

@@ -820,3 +829,14 @@ export const runTestsForTarget = <X extends BaseTranspilerOptions>({
}
});
};

export const runTestsForAlpineSyntax = () => {
Object.keys(ALPINE_SYNTAX_TESTS).forEach((key) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be very useful to add all of these alpine .html files here too:

type ParserConfig = {
name: 'jsx' | 'svelte';
parser: (args: { code: string; filePath: string }) => Promise<MitosisComponent>;
testsArray?: Tests[];
};
configurations.forEach(({ options, testName }) => {
const parsers: ParserConfig[] = [
{
name: 'jsx',
parser: async ({ code, filePath }) =>
parseJsx(
code,
options.typescript
? {
typescript: true,
filePath,
tsProject,
}
: {
typescript: false,
filePath,
},
),
testsArray: filterTests(JSX_TESTS_FOR_TARGET[target], only),
},
{
name: 'svelte',
parser: async ({ code }) => parseSvelte(code),
testsArray: filterTests([SVELTE_SYNTAX_TESTS], only),
},
];

that way, we see if every generator is able to consume the resulting mitosis JSON as expected

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.

3 participants