-
Notifications
You must be signed in to change notification settings - Fork 611
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
base: main
Are you sure you want to change the base?
feat: add alpine parser #1763
Conversation
🦋 Changeset detectedLatest commit: 10e821c The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
View your CI Pipeline Execution ↗ for commit 10e821c.
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this 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. |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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:
mitosis/packages/core/src/__tests__/test-generator.ts
Lines 705 to 737 in 0a49334
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
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:
yarn fmt:prettier
.yarn test:update
yarn g:changeset
and follow the CLI instructions. Alternatively, use the Changeset Github Bot to create the file.