Skip to content

Commit

Permalink
Add files field in package.json to reduce bundle size. Include docker…
Browse files Browse the repository at this point in the history
… build CI
  • Loading branch information
HuakunShen committed May 23, 2024
1 parent 1f091ae commit 14e283f
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 23 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci-pack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI Build and Pack

on:
push:
branches: ["main", "dev"]
pull_request:
branches: ["main"]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- run: npm run build:docker
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.7
- run: pnpm i
- run: pnpm build
9 changes: 0 additions & 9 deletions ci/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions ci/pnpm-workspace.yaml

This file was deleted.

5 changes: 4 additions & 1 deletion extensions/download-twitter-video/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,8 @@
"tailwindcss": "^3.4.3",
"typescript": "^5.2.2",
"vite": "^5.2.0"
}
},
"files": [
"dist"
]
}
5 changes: 4 additions & 1 deletion extensions/jwt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,8 @@
"tailwind-merge": "^2.3.0",
"tailwind-variants": "^0.2.1",
"zod": "^3.23.8"
}
},
"files": [
"dist"
]
}
9 changes: 6 additions & 3 deletions extensions/myip/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "jarvis-ext-myip",
"name": "@huakunshen/jarvis-ext-myip",
"version": "0.0.1",
"description": "Jarvis IP Extension",
"private": true,
"private": false,
"type": "module",
"scripts": {
"dev": "vite",
Expand Down Expand Up @@ -64,5 +64,8 @@
"typescript": "~5.4.0",
"vite": "^5.2.8",
"vue-tsc": "^2.0.11"
}
},
"files": [
"dist"
]
}
5 changes: 4 additions & 1 deletion extensions/qrcode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,8 @@
"tailwind-merge": "^2.3.0",
"tailwind-variants": "^0.2.1",
"valibot": "^0.30.0"
}
},
"files": [
"dist"
]
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"build": "turbo build",
"dev": "turbo dev",
"lint": "turbo lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\""
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"clean": "./scripts/clean.sh",
"build:docker": "./scripts/build.sh"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion build.sh → scripts/build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ for ext in $(ls extensions); do
continue
fi
echo "Building $ext"
docker run -v $(pwd)/entrypoint.sh:/entrypoint.sh \
docker run -v $(pwd)/scripts/docker/entrypoint.sh:/entrypoint.sh \
-v $(pwd)/extensions/$ext:/workspace \
-w /workspace --rm \
--platform=linux/amd64 \
Expand Down
2 changes: 2 additions & 0 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# find all *.tgz file in extensions/* and remove them
find extensions/ -name "*.tgz" -type f -delete
File renamed without changes.

0 comments on commit 14e283f

Please sign in to comment.