Add initial project files and configuration for testosMaximus module

- Create push script for NPM project management
- Add .npmignore to exclude unnecessary files from package
- Set up .npmrc for registry configuration
- Write README.md with usage instructions and features
- Initialize package.json and package-lock.json for project metadata
- Implement crackNut function in src/index.ts
- Create test.ts to demonstrate crackNut functionality
- Configure TypeScript with tsconfig.json
This commit is contained in:
Dominik Krenn 2025-07-17 22:58:13 +02:00
parent 622a4de5fa
commit c471cf007a
10 changed files with 109 additions and 1 deletions

View File

27
push Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
set -e
# 🚪 Move into the NPM project directory
cd "$(dirname "$0")/source"
# 🔐 Load secrets from root .env
echo "📦 Loading .env from root dir"
export $(grep -v '^#' ../.env | xargs)
# 🧼 Clean (optional)
echo "🧹 Cleaning dist (if exists)..."
rm -rf dist || true
# 🛠️ Build if tsc is present
if npx --no-install tsc --version > /dev/null 2>&1; then
echo "🛠️ Building with tsc..."
npx tsc
else
echo "⚠️ No TypeScript build step found. Skipping..."
fi
# 🚀 Publish to Gitea registry using token from .env
echo "🚀 Publishing to Gitea NPM registry..."
npm publish \
--registry=https://git.chipperfluff.at/api/packages/projects/npm/ \
--//git.chipperfluff.at/api/packages/projects/npm/:_authToken="$NPM_TOKEN"

3
source/.npmrc Normal file
View File

@ -0,0 +1,3 @@
source .env
npm set registry https://git.chipperfluff.at/api/packages/projects/npm/
npm set //git.chipperfluff.at/api/packages/projects/npm/:_authToken=$GITEA_TOKEN

62
source/README.md Normal file
View File

@ -0,0 +1,62 @@
# 🧠 testosMaximus
> *Infused with maximus testus energy.*
testosMaximus is a TypeScript-powered nut-cracker module forged in the sacred tree hollows of fluffy vengeance.
Designed for one purpose: **to break things**. Like nuts. And maybe reality.
---
## 🌰 Usage
```ts
import { crackNut } from "testosmaximus";
console.log(crackNut("pecan"));
// → *CRACK!* The pecan has been broken by pure TypeScript violence.
````
---
## 🚀 Features
* ⚡ Written in TypeScript (because normal JS was too weak)
* 💥 Cracks any nut, figuratively or literally
* 🧪 Powered by maximus testus energy (patent pending)
* 🐿️ Developed by a possibly overcaffeinated squirrel
---
## 📦 Install
If you're brave enough:
```bash
npm install testosmaximus
```
Or from your private squirrel registry:
```bash
npm install --registry=http://localhost:4873 testosmaximus
```
---
## 🔬 API
### `crackNut(nut: string): string`
Cracks the given nut and returns a glorious message of destruction.
---
## 🪵 License
MIT Break whatever you want. Just clean up after.
---
## 🐿️ Author
testosMaximus, child of the forest, breaker of shells, wielded by Maximus Testus Energy™

13
source/package-lock.json generated Normal file
View File

@ -0,0 +1,13 @@
{
"name": "testosmaximus",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "testosmaximus",
"version": "1.0.0",
"license": "ISC"
}
}
}

View File

@ -8,5 +8,8 @@
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC" "license": "ISC",
"publishConfig": {
"registry": "https://git.chipperfluff.at/api/packages/projects/npm/"
}
} }