https://github.com/pauliorandall/sveltekit-maplibre-template
A Sveltekit template for building MapLibre applications
https://github.com/pauliorandall/sveltekit-maplibre-template
Last synced: 2 months ago
JSON representation
A Sveltekit template for building MapLibre applications
- Host: GitHub
- URL: https://github.com/pauliorandall/sveltekit-maplibre-template
- Owner: PaulioRandall
- License: mit
- Created: 2023-06-08T21:38:19.000Z (almost 2 years ago)
- Default Branch: trunk
- Last Pushed: 2023-06-09T21:42:55.000Z (almost 2 years ago)
- Last Synced: 2025-02-03T20:20:07.350Z (4 months ago)
- Language: Svelte
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sveltekit MapLibre Template
A minimalist [MapLibre](https://maplibre.org/) [Sveltekit](https://kit.svelte.dev/) template with [Prettier](https://prettier.io/) and a few super simple components to get you started.
## Getting started
1. Install [Node v18.16.0](https://nodejs.org/en/download/) (I recommend [nvm](https://github.com/nvm-sh/nvm) if you can).
2. Fork then clone the repo:
```bash
git clone https://github.com/PaulioRandall/sveltekit-maplibre-template.git
cd sveltekit-maplibre-template
```3. Update project name in `package.json` with your project name.
4. Delete the lock file for good measure:
```bash
rm -f package-lock.json
```5. Install dependencies and run in dev mode:
```bash
npm i
npm run dev
```5. Start programming [localhost:3000](http://localhost:3000)
6. When you are ready to commit and push changes use:
```bash
npm run commit
```You'll know if everything is good because you'll get a curated ASCII scene. This can be changed by modifying `./scripts/well-done.txt`:
```bash
...oo000o.
00oo.
__________ _________ ______ _____________ oo.
| | | | | | | | _____ o
| You're | | Ready | | To | | Integrate | |__D|____][_
|________|%%|_______|%%|____|%%|___________|%%|_~~~~++++~_}
@~@~~@~@ @~~@~~@ @~~@ @~~@~~~@~~@ @~~@~~~@~~@
```## Full list of commands
- **`npm run fmt`** Format everything
- **`npm run clean`** Delete build folder and caches
- **`npm run build`** Build the project
- **`npm run dev`** Runs in developer mode
- **`npm run preview`** Builds project and starts as if it was in production
- **`npm run commit`** Do all checks needed to confirm the project is ready for commit## Stuck or curious
#### Format code?
```bash
npm run fmt
```Modify `.prettierrc.json` to customise styling. Or replace Prettier with your preferred formatting tool.
#### Delete build directory?
```bash
npm run clean
```#### Production build warning
```bash
Could not detect a supported production environment...
```Don't worry if you get a build warning like the one above.
When the time comes to deploy to development and production environments you'll want to research [SvelteKit adapters](https://kit.svelte.dev/docs/adapters).
Since I use Vercel to host my personal website I use [@sveltejs/adapter-vercel](https://www.npmjs.com/package/@sveltejs/adapter-vercel). There are many others and you can write your own. I've written a custom Express adapter before and it's not too difficult; just a little tedious due to extra work needed to test it.