Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Build demo app for distribution / preview #184

Merged
merged 5 commits into from
Sep 12, 2024

Conversation

sadiqkhoja
Copy link
Contributor

@sadiqkhoja sadiqkhoja commented Aug 12, 2024

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.

Copy link

changeset-bot bot commented Aug 12, 2024

⚠️ No Changeset found

Latest commit: 67577b9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@sadiqkhoja sadiqkhoja marked this pull request as ready for review September 10, 2024 15:55
eyelidlessness added a commit that referenced this pull request Sep 11, 2024
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).
Copy link
Member

@eyelidlessness eyelidlessness left a 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.

eyelidlessness added a commit that referenced this pull request Sep 11, 2024
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).
sadiqkhoja pushed a commit to sadiqkhoja/web-forms that referenced this pull request Sep 12, 2024
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).
sadiqkhoja and others added 5 commits September 12, 2024 10:56
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
@sadiqkhoja sadiqkhoja merged commit c49ec76 into getodk:main Sep 12, 2024
51 checks passed
@sadiqkhoja sadiqkhoja deleted the features/ui/build-demo-app branch September 12, 2024 15:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants