build: use pnpm + shell scripts to build project

This commit is contained in:
retrozinndev
2025-08-06 16:38:39 -03:00
parent 0e3a00e31a
commit e8e42f7786
8 changed files with 49 additions and 19 deletions
+5
View File
@@ -1 +1,6 @@
node_modules/
@girs/
build/
pnpm-lock.yaml
*.log *.log
+14
View File
@@ -0,0 +1,14 @@
{
"$schema": "https://www.schemastore.org/package.json",
"name": "colorshell",
"packageManager": "pnpm@10.12.1",
"scripts": {
"types": "sh ./scripts/types.sh",
"dev": "pnpm build && pnpm start",
"start": "sh ./scripts/start.sh",
"build": "sh ./scripts/build.sh"
},
"devDependencies": {
"ags": "link:../../../../usr/share/ags/js"
}
}
+10
View File
@@ -0,0 +1,10 @@
set -e
outdir="${1:-./build}"
mkdir -p $outdir
cp -rf node_modules src/
ags bundle src/app.ts $outdir/colorshell
rm -rf src/node_modules
+12
View File
@@ -0,0 +1,12 @@
file="${1:-./build/colorshell}"
function start() {
exec "$file"
}
if [[ -f "$file" ]]; then
start
else
pnpm build
start
fi
+8
View File
@@ -0,0 +1,8 @@
if [[ -d "@types" ]] && [[ ! "$1" == "-f" ]]; then
echo "Types skipped(already built). To force-build, run \`types\`"
exit 0
fi
echo "Building types, this can take long..."
pnpx @ts-for-gir/cli generate --ignoreVersionConflicts -o ./src/@girs
-5
View File
@@ -1,5 +0,0 @@
node_modules/
@girs/
build/
pnpm-lock.yaml
-14
View File
@@ -1,14 +0,0 @@
{
"$schema": "https://www.schemastore.org/package.json",
"name": "colorshell",
"packageManager": "pnpm@10.12.1",
"scripts": {
"start": "ags run",
"restart": "ags request reload",
"stop": "ags quit",
"bundle": "ags bundle"
},
"dependencies": {
"ags": "link:../../.local/share/pnpm/global/5/node_modules/ags"
}
}