Skip to content

Generate a blank app template and publish it as a branch - #30

Open
herefishyfish wants to merge 1 commit into
mainfrom
blank-app-template
Open

herefishyfish wants to merge 1 commit into
mainfrom
blank-app-template

Conversation

@herefishyfish

Copy link
Copy Markdown
Owner

A blank app to start from: the web and native apps, one shared home screen and the UI, router and polyfill packages, without the docs site and demos.

How it works

  • tools/blank-template.mjs copies the files in its COPY list, drops the lines between template:demo and template:end comments, and lays templates/blank on top. It fails on unbalanced markers and on COPY or RENAME entries that no longer match.
  • .github/workflows/blank-template.yml generates, typechecks, tests and builds the app for web on each pull request. On main it commits the result to the blank branch.
  • Apps clone blank and run npm run update:template, a git pull of that branch plus npm install.

For reviewers

  • Merging creates the blank branch. The publish job has contents: write and never force-pushes.
  • The existing apps change only by markers, apart from apps/web/vite.config.mts (the prerender routes moved to one siteRoutes list) and the import and passthrough layout in apps/native/src/main.ts.
  • Updates need the cloned history, so "Use this template" and squashed copies cannot merge them.

Testing

  • The generated app installs with all native patches, and passes typecheck, tests and the web build. Its counter works in headless Edge and on an Android emulator.
  • The publish script and an update ran against a local remote: an edit, a deletion and a version change merged, and the app's own edits survived. The update's final npm install and a merge conflict were not exercised.
  • The docs site builds with the same 53 routes.
  • Not run: iOS, the docs native app after the marker edits (typecheck only), and the workflow on GitHub before this PR.

New apps need the web and native shells and the UI packages without
the docs site and demos. The template is generated from this repo, so
it cannot drift from it. Regions between template:demo and
template:end comments are dropped, and templates/blank is laid on top.

A workflow checks the generated app on pull requests and commits it to
the blank branch on main. Apps cloned from that branch merge updates
with npm run update:template.

This branch has not been deployed

No deployments
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.

1 participant