-
Notifications
You must be signed in to change notification settings - Fork 11
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
Build demo app for distribution / preview #184
Build demo app for distribution / preview #184
Conversation
|
be7956f
to
e10a1da
Compare
e10a1da
to
ff7183e
Compare
This is consistent with all of the other Web Forms packages. This merges the Vitest config as-is, into the Vite config from #184 with slight adjustments: - Give a name to express intent of branching on mode === ‘demo’ - Set up branchy config options early, assign to single return object of all combined config I think this makes it more clear what is conditional in the config, and why it should be conditional. Note: this _mostly satisfies_ our Vue/non-Vue build story. I would like to consider aligning the Vue/non-Vue approach with the Solid/non-Solid approach (see: packages/xforms-engine/vite.config.ts, and the env flag set in packages/xforms-engine/package.json scripts).
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.
This is good as-is, so you can feel free to merge if you prefer. But I have a branch with some related additive changes that I think would be good to bring in if you'd like to incorporate them: diff.
As with #183, I broke this down by commit-with-reasoning. The general goal of the changes are:
- Reduce differences between the
web-forms
Vite/Vitest configs and other packages (also fixes some confounding config type issues in the process) - Eliminate the internal build (for E2E testing, originally introduced in fix: include css in the built js file #152), since this new build now satisfies that need and it redundant
I did also make some slight changes to the branchy logic in the config, I think it makes the intent clearer. But the resulting config is unchanged.
Edit: and here's everything rebased if that helps.
This is consistent with all of the other Web Forms packages. This merges the Vitest config as-is, into the Vite config from #184 with slight adjustments: - Give a name to express intent of branching on mode === ‘demo’ - Set up branchy config options early, assign to single return object of all combined config I think this makes it more clear what is conditional in the config, and why it should be conditional. Note: this _mostly satisfies_ our Vue/non-Vue build story. I would like to consider aligning the Vue/non-Vue approach with the Solid/non-Solid approach (see: packages/xforms-engine/vite.config.ts, and the env flag set in packages/xforms-engine/package.json scripts).
This is consistent with all of the other Web Forms packages. This merges the Vitest config as-is, into the Vite config from getodk#184 with slight adjustments: - Give a name to express intent of branching on mode === ‘demo’ - Set up branchy config options early, assign to single return object of all combined config I think this makes it more clear what is conditional in the config, and why it should be conditional. Note: this _mostly satisfies_ our Vue/non-Vue build story. I would like to consider aligning the Vue/non-Vue approach with the Solid/non-Solid approach (see: packages/xforms-engine/vite.config.ts, and the env flag set in packages/xforms-engine/package.json scripts).
This (finally!) fixes very confusing TypeScript type errors caused by trying to use the `defineConfig` extension exported from `vitest/config`. In turn, it will allow cleanup and greater consistency across all of the Vite/Vitest configs for each package.
This is consistent with all of the other Web Forms packages. This merges the Vitest config as-is, into the Vite config from getodk#184 with slight adjustments: - Give a name to express intent of branching on mode === ‘demo’ - Set up branchy config options early, assign to single return object of all combined config I think this makes it more clear what is conditional in the config, and why it should be conditional. Note: this _mostly satisfies_ our Vue/non-Vue build story. I would like to consider aligning the Vue/non-Vue approach with the Solid/non-Solid approach (see: packages/xforms-engine/vite.config.ts, and the env flag set in packages/xforms-engine/package.json scripts).
This new build, intended for downstream consumption, is both suitable for the testing purpose and a better basis for it: it’ll test **a real build**!
This is made possible by Vitest using the same version/install of Vite as we use
643f9a7
to
67577b9
Compare
This enables us to deploy demo app anywhere as a static web-site. For example: if you run
npx live-server packages/web-forms/dist-demo
after building the project, you will see the demo App.