-
-
Notifications
You must be signed in to change notification settings - Fork 13
examples: Add automated Cross-Framework testing for Web Component (React, Vue, Svelte) #145
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?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
scripts/cross-framework-test/ | ||
├── index.js # Main entry point | ||
├── constant/ | ||
│ └── config.js # Config and framework settings | ||
├── lib/ | ||
│ ├── build-tester.js # Main build testing logic | ||
│ ├── cli.js # Command line interface | ||
│ ├── file-system.js # File system utilities | ||
│ ├── logger.js # Logging utility | ||
│ └── reporter.js # Results formatting and output | ||
└── README.md # This file |
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.
@tinyjin
I’ve drafted a proposal for issue 140. The diff is a bit large, but I believe that’s mainly because configuration files are included. 😅 If further clarification is needed, I’ll be glad to add comments. Please review with a focus on (1) the example setup and (2) the script structure. Thank you.
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.
Pull Request Overview
This PR adds automated cross-framework build testing infrastructure to verify Web Component compatibility across React, Vue, and Svelte frameworks, addressing issue #140 for thorvg.web.
- Implements a comprehensive build testing script with auto-discovery, validation, and reporting
- Creates example projects for React, Vue, and Svelte demonstrating ThorVG Lottie Player integration
- Adds npm script aliases for convenient framework-specific and comprehensive testing
Reviewed Changes
Copilot reviewed 36 out of 43 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
scripts/cross-framework-test/ | Core testing infrastructure with modular architecture for framework build validation |
example/react/ | React example project with Vite configuration and ThorVG integration |
example/vue/ | Vue example project with TypeScript and Vite setup |
example/svelte/ | Svelte example project with modern Svelte 5 configuration |
package.json | Added npm script aliases for cross-framework testing |
README.md | Updated documentation with build testing instructions |
Files not reviewed (2)
- example/svelte/package-lock.json: Language not supported
- example/vue/package-lock.json: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
"vite.config.ts" | ||
, "declarations.d.ts", "declarations.d.ts" ] |
Copilot
AI
Sep 11, 2025
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.
There are duplicate entries for 'declarations.d.ts' in the include array, and there's an extra comma before the first entry. Remove the duplicates and fix the syntax.
"vite.config.ts" | |
, "declarations.d.ts", "declarations.d.ts" ] | |
"vite.config.ts", | |
"declarations.d.ts" | |
] |
Copilot uses AI. Check for mistakes.
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.
Please check comment I think testing script is over spec
package.json
Outdated
"example:build:all": "node scripts/cross-framework-test/index.js", | ||
"example:build:react": "node scripts/cross-framework-test/index.js react", | ||
"example:build:vue": "node scripts/cross-framework-test/index.js vue", | ||
"example:build:svelte": "node scripts/cross-framework-test/index.js svelte" |
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.
I think example related command shouldn't be here. Also I see we don't need example build scripts
@@ -0,0 +1,32 @@ | |||
/** |
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.
javascript is too much. I think simple shell scripts would be enough
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.
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@thorvg/lottie-player": "^1.0.0-beta.1", |
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.
wrong version, v1.0.0-beta.1
is unavailable.
Also invalid approach, in the testing, we expect example run build test with local build.
Please check this with another examples as well.
Related Issue
#140
Summary
Add a simple bash script to test framework compatibility across React, Vue, and Svelte examples.
What the Script Does
The
scripts/cross-framework-build-test.sh
script:Auto-Discovery
example/
Build Validation
package.json
npm install
) ifnode_modules
is missingnpm run build
for each frameworkUsage
Screenshots