✨ build: use pnpm + shell scripts to build project
This commit is contained in:
@@ -1 +1,6 @@
|
||||
node_modules/
|
||||
@girs/
|
||||
build/
|
||||
|
||||
pnpm-lock.yaml
|
||||
*.log
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -0,0 +1,12 @@
|
||||
file="${1:-./build/colorshell}"
|
||||
|
||||
function start() {
|
||||
exec "$file"
|
||||
}
|
||||
|
||||
if [[ -f "$file" ]]; then
|
||||
start
|
||||
else
|
||||
pnpm build
|
||||
start
|
||||
fi
|
||||
@@ -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
|
||||
@@ -1,5 +0,0 @@
|
||||
node_modules/
|
||||
@girs/
|
||||
build/
|
||||
|
||||
pnpm-lock.yaml
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user