@@ -67,11 +67,11 @@ vite.config.ts
6767 "version": "0.0.0",
6868 "type": "module",
6969 "scripts": {
70- "ready": "vite fmt && vite run lint && vite run test && vite run prepublishOnly ",
70+ "ready": "vite fmt && vite run lint && vite run test:all && vite run build:all ",
7171 "dev": "vite run website#dev",
7272 "lint": "vite lint --type-aware",
73- "test": "vite test --passWithNoTests ",
74- "prepublishOnly ": "vite run -r build"
73+ "test:all ": "vite run -r test ",
74+ "build:all ": "vite run -r build"
7575 },
7676 "devDependencies": {
7777 "vite": "catalog:"
@@ -139,10 +139,65 @@ website
139139 vite run dev
140140
141141
142- > cd hello-vite-plus && ls -a packages
142+ > cd hello-vite-plus && ls -a packages && cat packages/my-lib/package.json # check package.json
143143.
144144..
145145my-lib
146+ {
147+ "name": "my-lib",
148+ "version": "0.0.0",
149+ "description": "A starter for creating a React component library.",
150+ "type": "module",
151+ "license": "MIT",
152+ "homepage": "https://github.com/author/library#readme",
153+ "bugs": {
154+ "url": "https://github.com/author/library/issues"
155+ },
156+ "repository": {
157+ "type": "git",
158+ "url": "git+https://github.com/author/library.git"
159+ },
160+ "author": "Author Name <author.name@mail.com>",
161+ "files": [
162+ "dist"
163+ ],
164+ "main": "./dist/index.js",
165+ "module": "./dist/index.js",
166+ "types": "./dist/index.d.ts",
167+ "exports": {
168+ ".": "./dist/index.js",
169+ "./package.json": "./package.json"
170+ },
171+ "publishConfig": {
172+ "access": "public"
173+ },
174+ "scripts": {
175+ "build": "vite lib",
176+ "dev": "vite lib --watch",
177+ "playground": "vite --config playground/vite.config.ts",
178+ "test": "vite test",
179+ "typecheck": "tsc --noEmit",
180+ "release": "bumpp && pnpm publish",
181+ "prepublishOnly": "pnpm run build",
182+ "ready": "vite fmt && vite lint --type-aware && vite run build && vite test --passWithNoTests"
183+ },
184+ "devDependencies": {
185+ "@testing-library/jest-dom": "^6.6.3",
186+ "@testing-library/react": "^16.3.0",
187+ "@types/node": "catalog:",
188+ "@types/react": "^19.1.3",
189+ "@types/react-dom": "^19.1.4",
190+ "@vitejs/plugin-react": "^4.4.1",
191+ "bumpp": "catalog:",
192+ "happy-dom": "catalog:",
193+ "react": "^19.1.0",
194+ "react-dom": "^19.1.0",
195+ "tsdown": "catalog:",
196+ "typescript": "catalog:",
197+ "vite": "catalog:",
198+ "vitest": "catalog:"
199+ }
200+ }
146201
147202> cd hello-vite-plus && vp new --lib tools/my-tool --template default # add lib new not exists tools directory
148203
@@ -167,7 +222,51 @@ my-lib
167222 vite run dev
168223
169224
170- > cd hello-vite-plus && ls -a tools
225+ > cd hello-vite-plus && ls -a tools && cat tools/my-tool/package.json # check package.json
171226.
172227..
173228my-tool
229+ {
230+ "name": "my-tool",
231+ "version": "0.0.0",
232+ "description": "A starter for creating a TypeScript package.",
233+ "type": "module",
234+ "license": "MIT",
235+ "homepage": "https://github.com/author/library#readme",
236+ "bugs": {
237+ "url": "https://github.com/author/library/issues"
238+ },
239+ "repository": {
240+ "type": "git",
241+ "url": "git+https://github.com/author/library.git"
242+ },
243+ "author": "Author Name <author.name@mail.com>",
244+ "files": [
245+ "dist"
246+ ],
247+ "main": "./dist/index.js",
248+ "module": "./dist/index.js",
249+ "types": "./dist/index.d.ts",
250+ "exports": {
251+ ".": "./dist/index.js",
252+ "./package.json": "./package.json"
253+ },
254+ "publishConfig": {
255+ "access": "public"
256+ },
257+ "scripts": {
258+ "build": "vite lib",
259+ "dev": "vite lib --watch",
260+ "test": "vite test",
261+ "typecheck": "tsc --noEmit",
262+ "release": "bumpp && npm publish",
263+ "ready": "vite fmt && vite lint --type-aware && vite run build && vite test --passWithNoTests"
264+ },
265+ "devDependencies": {
266+ "@types/node": "catalog:",
267+ "bumpp": "catalog:",
268+ "tsdown": "catalog:",
269+ "typescript": "catalog:",
270+ "vitest": "catalog:"
271+ }
272+ }
0 commit comments