Skip to content

Commit ca18266

Browse files
committed
feat: ✨ build all-in-one package
1 parent 89ffb28 commit ca18266

12 files changed

+5645
-3514
lines changed

.github/workflows/ci.yaml

+22-76
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,19 @@ jobs:
1717
runs-on: ubuntu-22.04
1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v3
21-
22-
- name: Install Node.js 20.x
23-
uses: actions/setup-node@v4
24-
with:
25-
node-version: 20.x
26-
# registry-url required. Learn more at
27-
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
28-
registry-url: 'https://registry.npmjs.org'
20+
uses: actions/checkout@v4
2921

3022
- name: Install pnpm
31-
uses: pnpm/action-setup@v2
32-
with:
33-
run_install: false
34-
version: 8
35-
36-
- name: Obtain pnpm store directory
37-
shell: bash
38-
run: |
39-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
23+
uses: pnpm/action-setup@v4
4024

41-
- name: Obtain pnpm store cache
42-
uses: actions/cache@v3
25+
- name: Use Node.js 20
26+
uses: actions/setup-node@v4
4327
with:
44-
path: ${{ env.STORE_PATH }}
45-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
46-
restore-keys: |
47-
${{ runner.os }}-pnpm-store-
28+
node-version: 20
29+
cache: 'pnpm'
4830

4931
- name: Install dependencies
50-
run: pnpm install --frozen-lockfile
32+
run: pnpm install
5133

5234
- name: Build
5335
run: pnpm run build
@@ -57,77 +39,41 @@ jobs:
5739
runs-on: ubuntu-22.04
5840
steps:
5941
- name: Checkout
60-
uses: actions/checkout@v3
61-
62-
- name: Install Node.js 20.x
63-
uses: actions/setup-node@v4
64-
with:
65-
node-version: 20.x
66-
# registry-url required. Learn more at
67-
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
68-
registry-url: 'https://registry.npmjs.org'
42+
uses: actions/checkout@v4
6943

7044
- name: Install pnpm
71-
uses: pnpm/action-setup@v2
72-
with:
73-
run_install: false
74-
version: 8
75-
76-
- name: Obtain pnpm store directory
77-
shell: bash
78-
run: |
79-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
45+
uses: pnpm/action-setup@v4
8046

81-
- name: Obtain pnpm store cache
82-
uses: actions/cache@v3
47+
- name: Use Node.js 20
48+
uses: actions/setup-node@v4
8349
with:
84-
path: ${{ env.STORE_PATH }}
85-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
86-
restore-keys: |
87-
${{ runner.os }}-pnpm-store-
50+
node-version: 20
51+
cache: 'pnpm'
8852

8953
- name: Install dependencies
90-
run: pnpm install --frozen-lockfile
54+
run: pnpm install
9155

9256
- name: Lint
93-
run: pnpm run lint
57+
run: pnpm lint
9458

9559
typecheck:
9660
name: Typecheck
9761
runs-on: ubuntu-22.04
9862
steps:
9963
- name: Checkout
100-
uses: actions/checkout@v3
101-
102-
- name: Install Node.js 20.x
103-
uses: actions/setup-node@v4
104-
with:
105-
node-version: 20.x
106-
# registry-url required. Learn more at
107-
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
108-
registry-url: 'https://registry.npmjs.org'
64+
uses: actions/checkout@v4
10965

11066
- name: Install pnpm
111-
uses: pnpm/action-setup@v2
112-
with:
113-
run_install: false
114-
version: 8
67+
uses: pnpm/action-setup@v4
11568

116-
- name: Obtain pnpm store directory
117-
shell: bash
118-
run: |
119-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
120-
121-
- name: Obtain pnpm store cache
122-
uses: actions/cache@v3
69+
- name: Use Node.js 20
70+
uses: actions/setup-node@v4
12371
with:
124-
path: ${{ env.STORE_PATH }}
125-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
126-
restore-keys: |
127-
${{ runner.os }}-pnpm-store-
72+
node-version: 20
73+
cache: 'pnpm'
12874

12975
- name: Install dependencies
130-
run: pnpm install --frozen-lockfile
76+
run: pnpm install
13177

13278
- name: Typecheck
13379
run: pnpm run typecheck

.github/workflows/release.yml

+7-25
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,17 @@ jobs:
1616
with:
1717
fetch-depth: 0
1818

19-
- name: Install Node.js 20.x
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: 20.x
23-
# registry-url required. Learn more at
24-
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
25-
registry-url: 'https://registry.npmjs.org'
26-
2719
- name: Install pnpm
28-
uses: pnpm/action-setup@v2
29-
with:
30-
run_install: false
31-
version: 8
32-
33-
- name: Obtain pnpm store directory
34-
shell: bash
35-
run: |
36-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
20+
uses: pnpm/action-setup@v4
3721

38-
- name: Obtain pnpm store cache
39-
uses: actions/cache@v3
22+
- name: Use Node.js 20
23+
uses: actions/setup-node@v4
4024
with:
41-
path: ${{ env.STORE_PATH }}
42-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
43-
restore-keys: |
44-
${{ runner.os }}-pnpm-store-
25+
node-version: 20
26+
cache: 'pnpm'
4527

46-
- name: Install Dependencies
47-
run: pnpm i --prefer-offline --frozen-lockfile
28+
- name: Install dependencies
29+
run: pnpm install
4830

4931
- name: PNPM build
5032
run: pnpm build

build.config.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
3+
export default defineBuildConfig({
4+
entries: [{ input: './src/index.ts', builder: 'untyped' }],
5+
})

env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

package.json

+49-26
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@project-trans/suggestion-box",
33
"type": "module",
4-
"version": "0.0.9",
5-
"packageManager": "pnpm@8.15.4",
4+
"version": "0.1.0",
5+
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b",
66
"description": "Suggestion box for Project Trans",
77
"author": {
88
"name": "Project Trans Team Members",
@@ -25,6 +25,18 @@
2525
"require": "./dist/preset.umd.cjs",
2626
"default": "./dist/preset.umd.cjs"
2727
},
28+
"./aio": {
29+
"types": "./dist/aio.d.ts",
30+
"import": "./dist/aio.js",
31+
"require": "./dist/aio.umd.cjs",
32+
"default": "./dist/aio.umd.cjs"
33+
},
34+
"./dist/aio": {
35+
"types": "./dist/aio.d.ts",
36+
"import": "./dist/aio.js",
37+
"require": "./dist/aio.umd.cjs",
38+
"default": "./dist/aio.umd.cjs"
39+
},
2840
"./dist/preset": {
2941
"types": "./dist/preset.d.ts",
3042
"import": "./dist/preset.js",
@@ -42,7 +54,10 @@
4254
"scripts": {
4355
"dev": "vite",
4456
"dev:server": "pnpm -F server run dev",
45-
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly",
57+
"build": "pnpm build:script && pnpm build:style && pnpm build:types",
58+
"build:style": "tsx ./script/buildStyle.ts",
59+
"build:script": "rollup -c rollup.config.ts --configPlugin esbuild",
60+
"build:types": "vue-tsc",
4661
"preview": "vite preview",
4762
"lint": "eslint --cache . && pnpm -F server run lint",
4863
"typecheck": "vue-tsc --noEmit && pnpm -F server run typecheck",
@@ -54,32 +69,40 @@
5469
"vue": "3"
5570
},
5671
"devDependencies": {
57-
"@antfu/eslint-config": "^2.8.0",
58-
"@iconify-json/octicon": "^1.1.52",
59-
"@iconify-json/svg-spinners": "^1.1.2",
60-
"@types/node": "^20.11.24",
61-
"@unocss/eslint-plugin": "^0.58.5",
62-
"@unocss/reset": "^0.58.5",
63-
"@vitejs/plugin-vue": "^5.0.4",
64-
"eslint": "^8.57.0",
65-
"rimraf": "^5.0.5",
66-
"typescript": "^5.3.3",
67-
"unocss": "^0.58.5",
68-
"vite": "^5.1.5",
69-
"vue-tsc": "^1.8.27"
72+
"@antfu/eslint-config": "^3.7.3",
73+
"@iconify-json/octicon": "^1.2.0",
74+
"@iconify-json/svg-spinners": "^1.2.0",
75+
"@rollup/plugin-node-resolve": "^15.3.0",
76+
"@rollup/plugin-replace": "^6.0.1",
77+
"@types/node": "^22.7.4",
78+
"@unocss/eslint-plugin": "^0.63.1",
79+
"@unocss/reset": "^0.63.1",
80+
"@vitejs/plugin-vue": "^5.1.4",
81+
"eslint": "^9.11.1",
82+
"lightningcss": "^1.27.0",
83+
"rimraf": "^6.0.1",
84+
"rollup": "^4.22.5",
85+
"rollup-plugin-esbuild": "^6.1.1",
86+
"tsx": "^4.19.1",
87+
"typescript": "^5.6.2",
88+
"unbuild": "3.0.0-rc.8",
89+
"unocss": "^0.63.1",
90+
"vite": "^5.4.8",
91+
"vue-tsc": "^2.1.6"
7092
},
7193
"pnpm": {
7294
"overrides": {
73-
"array-includes": "npm:@nolyfill/array-includes@latest",
74-
"array.prototype.findlastindex": "npm:@nolyfill/array.prototype.findlastindex@latest",
75-
"array.prototype.flat": "npm:@nolyfill/array.prototype.flat@latest",
76-
"array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@latest",
77-
"hasown": "npm:@nolyfill/hasown@latest",
78-
"object.assign": "npm:@nolyfill/object.assign@latest",
79-
"object.entries": "npm:@nolyfill/object.entries@latest",
80-
"object.fromentries": "npm:@nolyfill/object.fromentries@latest",
81-
"object.groupby": "npm:@nolyfill/object.groupby@latest",
82-
"object.values": "npm:@nolyfill/object.values@latest"
95+
"array-includes": "npm:@nolyfill/array-includes@^1",
96+
"array.prototype.findlastindex": "npm:@nolyfill/array.prototype.findlastindex@^1",
97+
"array.prototype.flat": "npm:@nolyfill/array.prototype.flat@^1",
98+
"array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@^1",
99+
"hasown": "npm:@nolyfill/hasown@^1",
100+
"is-core-module": "npm:@nolyfill/is-core-module@^1",
101+
"object.assign": "npm:@nolyfill/object.assign@^1",
102+
"object.entries": "npm:@nolyfill/object.entries@^1",
103+
"object.fromentries": "npm:@nolyfill/object.fromentries@^1",
104+
"object.groupby": "npm:@nolyfill/object.groupby@^1",
105+
"object.values": "npm:@nolyfill/object.values@^1"
83106
}
84107
}
85108
}

0 commit comments

Comments
 (0)