@bjmhe/viteplus-preset-pack 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026-PRESENT Benjamin He <https://github.com/bjmhe>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # viteplus-preset-pack
2
+
3
+ [![Open on npmx.dev](https://npmx.dev/api/registry/badge/version/@bjmhe/viteplus-preset-pack)](https://npmx.dev/package/@bjmhe/viteplus-preset-pack)
4
+ [![Open on npmx.dev](https://npmx.dev/api/registry/badge/size/@bjmhe/viteplus-preset-pack)](https://npmx.dev/package/@bjmhe/viteplus-preset-pack)
5
+ [![Open on npmx.dev](https://npmx.dev/api/registry/badge/downloads-year/@bjmhe/viteplus-preset-pack)](https://npmx.dev/package/@bjmhe/viteplus-preset-pack)
6
+ [![Open on npmx.dev](https://npmx.dev/api/registry/badge/engines/@bjmhe/viteplus-preset-pack)](https://npmx.dev/package/@bjmhe/viteplus-preset-pack)
7
+ [![Open on npmx.dev](https://npmx.dev/api/registry/badge/license/@bjmhe/viteplus-preset-pack)](https://npmx.dev/package/@bjmhe/viteplus-preset-pack)
8
+
9
+ > inspired by `tsdown-preset-sxzz`
10
+
11
+ A Vite Plus preset for creating a TypeScript package.
12
+
13
+ ## Install
14
+
15
+ ```sh
16
+ # ✨ Vite Plus
17
+ vp add @bjmhe/viteplus-preset-pack
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ <!-- automd:file src="./examples/vite.config.lib.ts" code lang="ts" -->
23
+
24
+ ```ts [vite.config.lib.ts]
25
+ import { lib } from "../src";
26
+
27
+ export default lib();
28
+ ```
29
+
30
+ <!-- /automd -->
31
+
32
+ <!-- automd:file src="./examples/vite.config.nodelib.ts" code lang="ts" -->
33
+
34
+ ```ts [vite.config.nodelib.ts]
35
+ import { nodeLib } from "../src";
36
+
37
+ export default nodeLib();
38
+ ```
39
+
40
+ <!-- /automd -->
41
+
42
+ ## Licenses
43
+
44
+ <!-- automd:contributors markupGoLogo anon author="bjmhe" license="MIT" -->
45
+
46
+ Published under the [MIT](https://github.com/bjmhe/viteplus-preset-pack/blob/main/LICENSE) license.
47
+ Made by [@bjmhe](https://github.com/bjmhe) and [community](https://github.com/bjmhe/viteplus-preset-pack/graphs/contributors) 💛
48
+ <br><br>
49
+ <a href="https://github.com/bjmhe/viteplus-preset-pack/graphs/contributors">
50
+ <img src="https://contrib.rocks/image?repo=bjmhe/viteplus-preset-pack&anon=true" />
51
+ </a>
52
+
53
+ <!-- /automd -->
54
+
55
+ <!-- automd:with-automd -->
56
+
57
+ ---
58
+
59
+ _🤖 auto updated with [automd](https://automd.unjs.io)_
60
+
61
+ <!-- /automd -->
@@ -0,0 +1,10 @@
1
+ /*! Keep it simple, keep it free */
2
+ import { LibOptions } from "@bjmhe/viteplus-preset";
3
+ import { UserConfig } from "vite-plus";
4
+
5
+ //#region src/index.d.ts
6
+ declare const packPreset: (options: LibOptions) => UserConfig["pack"];
7
+ //#endregion
8
+ export { packPreset };
9
+ /*! Built with love & coffee ☕ */
10
+ //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs ADDED
@@ -0,0 +1,45 @@
1
+ /*! Keep it simple, keep it free */
2
+ import * as attw from "@arethetypeswrong/core";
3
+ import * as publint from "publint";
4
+ import * as publintUtils from "publint/utils";
5
+ import ApiSnapshot from "tsnapi/rolldown";
6
+ //#region src/constant.ts
7
+ const PACK_BANNER = "/*! Keep it simple, keep it free */";
8
+ const PACK_FOOTER = "/*! Built with love & coffee ☕ */";
9
+ //#endregion
10
+ //#region src/index.ts
11
+ const packPreset = (options) => {
12
+ const { entry = "index", inlineDeps = [] } = options;
13
+ return {
14
+ attw: {
15
+ enabled: false,
16
+ profile: "esm-only",
17
+ module: attw,
18
+ level: "warn"
19
+ },
20
+ banner: PACK_BANNER,
21
+ deps: { onlyBundle: inlineDeps },
22
+ devtools: true,
23
+ dts: { tsgo: true },
24
+ entry: entry === "index" ? "src/index.ts" : entry === "shallow" ? "src/*.ts" : entry === "all" ? "src/**/*.ts" : entry,
25
+ exports: {
26
+ packageJson: true,
27
+ legacy: true
28
+ },
29
+ footer: PACK_FOOTER,
30
+ platform: "neutral",
31
+ plugins: [ApiSnapshot()],
32
+ publint: {
33
+ enabled: "ci-only",
34
+ module: [publint, publintUtils]
35
+ },
36
+ shims: true,
37
+ sourcemap: true,
38
+ unused: true
39
+ };
40
+ };
41
+ //#endregion
42
+ export { packPreset };
43
+
44
+ /*! Built with love & coffee ☕ */
45
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/constant.ts","../src/index.ts"],"sourcesContent":["export const PACK_BANNER = \"/*! Keep it simple, keep it free */\";\nexport const PACK_FOOTER = \"/*! Built with love & coffee ☕ */\";\n","import * as attw from \"@arethetypeswrong/core\";\nimport type { LibOptions } from \"@bjmhe/viteplus-preset\";\nimport * as publint from \"publint\";\nimport * as publintUtils from \"publint/utils\";\nimport ApiSnapshot from \"tsnapi/rolldown\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { PACK_BANNER, PACK_FOOTER } from \"./constant\";\n\nexport const packPreset = (options: LibOptions): UserConfig[\"pack\"] => {\n const { entry = \"index\", inlineDeps = [] } = options;\n return {\n attw: {\n enabled: false,\n profile: \"esm-only\",\n module: attw,\n level: \"warn\",\n },\n banner: PACK_BANNER,\n deps: { onlyBundle: inlineDeps },\n devtools: true,\n dts: {\n tsgo: true,\n },\n entry:\n entry === \"index\"\n ? \"src/index.ts\"\n : entry === \"shallow\"\n ? \"src/*.ts\"\n : entry === \"all\"\n ? \"src/**/*.ts\"\n : entry,\n exports: {\n packageJson: true,\n legacy: true,\n },\n footer: PACK_FOOTER,\n platform: \"neutral\",\n plugins: [ApiSnapshot()],\n publint: {\n enabled: \"ci-only\",\n module: [publint, publintUtils],\n },\n shims: true,\n sourcemap: true,\n unused: true,\n };\n};\n"],"mappings":";;;;;;AAAA,MAAa,cAAc;AAC3B,MAAa,cAAc;;;ACQ3B,MAAa,cAAc,YAA4C;CACrE,MAAM,EAAE,QAAQ,SAAS,aAAa,CAAC,MAAM;CAC7C,OAAO;EACL,MAAM;GACJ,SAAS;GACT,SAAS;GACT,QAAQ;GACR,OAAO;EACT;EACA,QAAQ;EACR,MAAM,EAAE,YAAY,WAAW;EAC/B,UAAU;EACV,KAAK,EACH,MAAM,KACR;EACA,OACE,UAAU,UACN,iBACA,UAAU,YACR,aACA,UAAU,QACR,gBACA;EACV,SAAS;GACP,aAAa;GACb,QAAQ;EACV;EACA,QAAQ;EACR,UAAU;EACV,SAAS,CAAC,YAAY,CAAC;EACvB,SAAS;GACP,SAAS;GACT,QAAQ,CAAC,SAAS,YAAY;EAChC;EACA,OAAO;EACP,WAAW;EACX,QAAQ;CACV;AACF"}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@bjmhe/viteplus-preset-pack",
3
+ "version": "1.0.7",
4
+ "description": "A Vite Plus preset for creating a TypeScript package.",
5
+ "keywords": [
6
+ "package",
7
+ "preset",
8
+ "typescript",
9
+ "vite",
10
+ "vite-plus"
11
+ ],
12
+ "homepage": "https://github.com/bjmhe/viteplus-preset-pack#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/bjmhe/viteplus-preset-pack/issues"
15
+ },
16
+ "license": "MIT",
17
+ "author": "Benjamin He <hi@bjmhe.me>",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/bjmhe/viteplus-preset-pack.git"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "README.md",
25
+ "tsconfig.json"
26
+ ],
27
+ "type": "module",
28
+ "sideEffects": false,
29
+ "main": "./dist/index.mjs",
30
+ "module": "./dist/index.mjs",
31
+ "types": "./dist/index.d.mts",
32
+ "exports": {
33
+ ".": "./dist/index.mjs",
34
+ "./package.json": "./package.json"
35
+ },
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "scripts": {
40
+ "build": "vp pack",
41
+ "dev": "vp pack --watch",
42
+ "release": "bumpp",
43
+ "prepublishOnly": "vp run build"
44
+ },
45
+ "dependencies": {
46
+ "@bjmhe/viteplus-preset": "^1.0.7"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^25.6.2",
50
+ "@typescript/native-preview": "7.0.0-dev.20260527.2",
51
+ "@vitest/coverage-v8": "^4.1.7",
52
+ "automd": "^0.4.3",
53
+ "bumpp": "^11.1.0",
54
+ "typescript": "^6.0.3"
55
+ },
56
+ "peerDependencies": {
57
+ "@arethetypeswrong/core": "^0.18.2",
58
+ "publint": "^0.3.21",
59
+ "tsdown": "^0.22.0",
60
+ "tsnapi": "^0.3.3",
61
+ "unplugin-unused": "^0.5.7",
62
+ "vite-plus": "^0.1.20"
63
+ },
64
+ "engines": {
65
+ "node": ">=24.16.0"
66
+ },
67
+ "packageManager": "pnpm@11.4.0"
68
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "lib": ["es2023"],
5
+ "moduleDetection": "force",
6
+ "module": "preserve",
7
+ "moduleResolution": "bundler",
8
+ "resolveJsonModule": true,
9
+ "types": ["node"],
10
+ "strict": true,
11
+ "noUnusedLocals": true,
12
+ "declaration": true,
13
+ "noEmit": true,
14
+ "allowImportingTsExtensions": true,
15
+ "esModuleInterop": true,
16
+ "isolatedModules": true,
17
+ "verbatimModuleSyntax": true,
18
+ "skipLibCheck": true
19
+ }
20
+ }