docs: refine README.md for clarity on module structure and script usage

This commit is contained in:
Dominik Krenn 2025-07-19 11:46:08 +02:00
parent 5d4bb34695
commit 8f403680f2

View File

@ -1,55 +1,46 @@
# funkyFlaskTest npm module template # funkyFlaskTest (npm module template)
This is a simple template repo for making npm modules using **TypeScript** and **Vite**. Template for creating npm modules using TypeScript + Vite.
The actual module lives in the `source/` directory. The actual module is in `source/`. It builds and publishes from `build/`.
Everything else is just scaffolding or helper files.
--- ---
## What's in here ## 🔧 Scripts
- `source/` is where the actual npm module lives
- has its own `package.json`, `src/`, `tsconfig.json`, etc.
- builds to `dist/`
- meant to be published as its own package
- `build/` is an optional local test harness or consumer setup (not required)
- `init.sh` sets the module name and version in `source/`
- `reset.sh` resets the whole repo to the base template
This layout is not standard npm-style. It's made for people who want their actual module separated from other junk (like CI configs, push scripts, whatever).
---
## Scripts
### `init.sh` ### `init.sh`
```bash ```bash
./init.sh --name @your/module-name --version 0.0.1 --once ./init.sh --name @your/module --version 0.0.1
```` ````
* Edits the `source/package.json` and `package-lock.json` to set name and version * Sets name and version in `source/package.json`
* If no args, prompts for them * Prompts if missing
* If `--once` is passed, deletes itself after running * Installs `jq` if needed
* Will install `jq` for you if its not installed * Deletes itself if `--once` is used
Use this once when you create a new module from the template. ---
### `push`
```bash
./push
```
* Copies `source/` to `build/`
* Builds with `tsc`
* Publishes to your Gitea npm registry using `.env` and `$NPM_TOKEN`
--- ---
### `reset.sh` ### `reset.sh`
```bash ```bash
./reset.sh --confirm @your/module-name ./reset.sh --confirm @your/module
``` ```
* Resets the whole repo to the original template state * Resets the repo to the base template from Gitea
* Only runs if you confirm the current module name (safety check) * Requires confirmation to prevent accidental nukes
* Pulls from `git@git.chipperfluff.at:projects/funkyFlaskTest.git`
* Initializes git if missing
Used if you want to throw everything away and start fresh from the template repo.
--- ---
Thats it. Its just a starter for npm modules with Vite and TypeScript, with a weird layout that makes sense if youre reusing this across multiple projects. This is a minimal, non-standard layout meant for cleaner module management and publishing. Use it, or dont. It works.