Update project configuration and version to 1.0.5

- Add 'build/' to .gitignore
- Refactor push script for improved directory management and build process
- Update package.json and package-lock.json to version 1.0.5
- Change TypeScript module setting to CommonJS in tsconfig.json
This commit is contained in:
Dominik Krenn 2025-07-18 07:08:53 +02:00
parent a07d767a37
commit bb8a36ad0d
5 changed files with 33 additions and 21 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
# TypeScript output
dist/
build/
*.tsbuildinfo
# Node modules

43
push
View File

@ -1,27 +1,38 @@
#!/bin/bash
set -e
# 🚪 Move into the NPM project directory
cd "$(dirname "$0")/source"
# 📁 Directories
ROOT_DIR="$(dirname "$0")"
SOURCE_DIR="$ROOT_DIR/source"
BUILD_DIR="$ROOT_DIR/build"
# 🔐 Load secrets from root .env
echo "📦 Loading .env from root dir"
export $(grep -v '^#' ../.env | xargs)
cd "$ROOT_DIR"
# 🧼 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
# 🔐 Load secrets
if [ -f .env ]; then
echo "📦 Loading .env..."
export $(grep -v '^#' .env | xargs)
else
echo "⚠️ No TypeScript build step found. Skipping..."
echo "⚠️ .env file not found."
fi
# 🚀 Publish to Gitea registry using token from .env
echo "🚀 Publishing to Gitea NPM registry..."
# 🧼 Reset build
echo "🧹 Cleaning build dir..."
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"
# 📦 Copy entire source
echo "📁 Copying full source into build..."
cp -r "$SOURCE_DIR"/* "$BUILD_DIR"/
# 🔧 Build inside build dir
cd "$BUILD_DIR"
echo "🛠 Building in build dir..."
rm -rf dist
npx --yes tsc
# 🚀 Publish
echo "🚀 Publishing to Gitea registry..."
npm publish \
--registry=https://git.chipperfluff.at/api/packages/projects/npm/ \
--//git.chipperfluff.at/api/packages/projects/npm/:_authToken="$NPM_TOKEN"

View File

@ -1,12 +1,12 @@
{
"name": "testosmaximus",
"version": "1.0.2",
"version": "1.0.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "testosmaximus",
"version": "1.0.2",
"version": "1.0.5",
"license": "ISC",
"devDependencies": {
"typescript": "^5.8.3"

View File

@ -1,6 +1,6 @@
{
"name": "testosmaximus",
"version": "1.0.2",
"name": "@testosmaximus/testosmaximus",
"version": "1.0.5",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"module": "CommonJS",
"moduleResolution": "Node",
"outDir": "dist",
"declaration": true,