- Node.js 20+
- pnpm
1. Clone the repository and its content submodule:
git clone --recurse-submodules https://github.com/umisc/misc-astro.git2. Navigate to the directory:
cd misc-astro3. Run pnpm install:
pnpm install4. Run pnpm dev to spin up your local development server:
pnpm devIf you forgot to
--recurse-submoduleswhen cloning, run these two commands:git submodule sync --recursive git submodule update --init --recursive
To pull changes, run:
git pull --recurse-submodules
git submodule update --init --recursiveTo make changes to the root repository, the standard add, commit, push flow applies.
Make sure you are in the root directory.
git add .
git commit -m "feat: write a descriptive message of what you added"
git pushNote: If you are on a branch (which you should be) which is not already on the remote repository, you may have to do
git push -u origin feat/name-of-branch.
1. To make changes to the content submodule, first navigate there:
cd content2. Add your changes, commit, and push:
git add -A
git commit -m "feat: write a descriptive message of what you added"
git pushIf
git pushdoes not work, you may have to dogit push origin HEAD:maininstead.
3. Then, you must bump the submodule commit hash in the root repo:
cd ..
git add content
git commit -m "chore: bump content"
git pushRead the Astro docs.
useEffectanduseLayoutEffectare banned in component files apart from in circumstances where you cannot refactor into a reusable hook that could conceivably be used by another component.pnpm checkmust pass before comitting. Trypnpm fixto fix some issues raised bypnpm check.- Use Tailwind. Never create custom classes, ad-hoc css files, or inline stylesheets. Inline styles are acceptable in rare cases involving complex animation or maniupulation.
- Extensions to the tailwind theme need to be treated with great care. Clarify your intent and consider separately.
- For more complicated animations, use motion. Do not change animation libraries without refactoring all existing code to use them.
- Follow the design system. Avoid creating ad-hoc colours, spacing, border-radius, text sizes, buttons, and components that duplicate what already exists.
- Where new styles or designs are required, this must be treated separately as a change to the design system rather than an ad-hoc addition. This is an expansion of scope—intent must be clarified and treated with care. You can view the design system at
/design-system. - When you create new components, always check if an existing official shadcn component already exists. Please add these using the CLI (not copying the code!) and customise to suit the design system when they are available.
- Do not add icon packs or custom icons when the icon is available in phosphor icons.
- Content that should not be publicly accessible indefinitely must live in the content submodule. This repository is public, even deleted information and files will remain accessible.
- Use Typescript. Do not make Typescript any less strict. Use of
anyis banned. Use ofas,!, andunknownmust be heavily restricted and commented, explaining why you know more than the Typescript compiler. Where you need typed access to external data, it should be either:- Come typed through an SDK.
- Be an Astro content collection.
- Validated at runtime using Zod.
- Create or choose an issue for the work.
- Create a branch from the latest
main. Use<type>/<issue-number>-<short-description>, for examplefeat/123-name-of-branchorfix/456-name-of-branch. - Make and test your changes. Run
pnpm checkbefore committing. - Write commits using Conventional Commits:
<type>(optional-scope): <description>, for examplefeat: add ctf guide. Common types includefeat,fix,docs,refactor,test, andchore. - Push your branch and open a pull request into
main. - Link the pull request to its issue using
Closes #123, describe the changes and testing, then request review.- When merging, prefer a fast-forward merge. This means:
- Rebase your branch on main
- Push your branch to GitHub and ensure it has an open PR with CI passing
- Run
git checkout mainthengit merge feat/123-my-branch. This should perform a fast-forward merge. Rungit push, GitHub will permit the push since the commits have been approved via the PR.
main is protected: do not commit unapproved commits push directly to it. All commits must be made on a branch and approved through a pull request before moving to main.