@icebreakers/monorepo 1.2.0 → 1.2.1
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/assets/package.json +1 -1
- package/dist/{chunk-EBATUF3S.js → chunk-J3UQM7T4.js} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/templates/apps/cli/bin/index.js +2 -0
- package/templates/apps/cli/dev/index.ts +2 -0
- package/templates/apps/cli/package.json +32 -0
- package/templates/apps/cli/src/cli.ts +3 -0
- package/templates/apps/cli/src/index.ts +0 -0
- package/templates/apps/cli/tsconfig.json +7 -0
- package/templates/apps/cli/tsup.config.ts +13 -0
- package/templates/apps/client/eslint.config.js +12 -0
- package/templates/apps/client/index.html +13 -0
- package/templates/apps/client/package.json +43 -0
- package/templates/apps/client/public/vite.svg +1 -0
- package/templates/apps/client/src/App.vue +9 -0
- package/templates/apps/client/src/main.ts +14 -0
- package/templates/apps/client/src/pages/index.vue +67 -0
- package/templates/apps/client/src/router/index.ts +13 -0
- package/templates/apps/client/src/stores/i18n.ts +23 -0
- package/templates/apps/client/src/stores/index.ts +15 -0
- package/templates/apps/client/src/style.css +1 -0
- package/templates/apps/client/src/trpc/index.ts +10 -0
- package/templates/apps/client/src/vite-env.d.ts +2 -0
- package/templates/apps/client/tsconfig.app.json +28 -0
- package/templates/apps/client/tsconfig.json +8 -0
- package/templates/apps/client/tsconfig.node.json +25 -0
- package/templates/apps/client/tsconfig.worker.json +11 -0
- package/templates/apps/client/vite.config.ts +38 -0
- package/templates/apps/client/worker/app.ts +24 -0
- package/templates/apps/client/worker/config.ts +1 -0
- package/templates/apps/client/worker/fetch-entry.ts +5 -0
- package/templates/apps/client/worker/node-entry.ts +12 -0
- package/templates/apps/client/worker/trpc-router.ts +24 -0
- package/templates/apps/client/worker-configuration.d.ts +7688 -0
- package/templates/apps/client/wrangler.jsonc +21 -0
- package/templates/apps/server/package.json +58 -0
- package/templates/apps/server/src/app.ts +191 -0
- package/templates/apps/server/src/config.ts +1 -0
- package/templates/apps/server/src/fetch-entry.ts +5 -0
- package/templates/apps/server/src/node-entry.ts +12 -0
- package/templates/apps/server/test/index.test.ts +14 -0
- package/templates/apps/server/tsconfig.json +24 -0
- package/templates/apps/server/tsup.config.ts +13 -0
- package/templates/apps/server/vitest.config.ts +15 -0
- package/templates/apps/server/worker-configuration.d.ts +7688 -0
- package/templates/apps/server/wrangler.jsonc +18 -0
- package/templates/apps/website/.vitepress/config.ts +93 -0
- package/templates/apps/website/.vitepress/theme/index.ts +4 -0
- package/templates/apps/website/.vitepress/theme/tailwind.css +1 -0
- package/templates/apps/website/index.md +151 -0
- package/templates/apps/website/monorepo/index.md +68 -0
- package/templates/apps/website/monorepo/manage.md +60 -0
- package/templates/apps/website/monorepo/publish.md +189 -0
- package/templates/apps/website/package.json +34 -0
- package/templates/apps/website/public/logo.jpg +0 -0
- package/templates/apps/website/thinking.md +88 -0
- package/templates/apps/website/tools/changeset.md +87 -0
- package/templates/apps/website/tools/husky.md +108 -0
- package/templates/apps/website/tools/lint-staged.md +79 -0
- package/templates/apps/website/tools/pnpm.md +100 -0
- package/templates/apps/website/tools/renovate.md +91 -0
- package/templates/apps/website/tools/turborepo.md +149 -0
- package/templates/apps/website/why/assets/npm-dt.svg +15 -0
- package/templates/apps/website/why/assets/npm-ts.svg +19 -0
- package/templates/apps/website/why/examples/0.npm-basic-package/index.js +9 -0
- package/templates/apps/website/why/examples/0.npm-basic-package/package.json +11 -0
- package/templates/apps/website/why/examples/1.npm-basic-package/index.cjs +11 -0
- package/templates/apps/website/why/examples/1.npm-basic-package/index.d.ts +1 -0
- package/templates/apps/website/why/examples/1.npm-basic-package/index.js +7 -0
- package/templates/apps/website/why/examples/1.npm-basic-package/package.json +19 -0
- package/templates/apps/website/why/examples/2.npm-basic-package/README.md +1 -0
- package/templates/apps/website/why/examples/2.npm-basic-package/package-lock.json +30 -0
- package/templates/apps/website/why/examples/2.npm-basic-package/package.json +35 -0
- package/templates/apps/website/why/examples/2.npm-basic-package/rename-ext.js +24 -0
- package/templates/apps/website/why/examples/2.npm-basic-package/src/index.ts +7 -0
- package/templates/apps/website/why/examples/2.npm-basic-package/tsconfig.cjs.json +8 -0
- package/templates/apps/website/why/examples/2.npm-basic-package/tsconfig.esm.json +7 -0
- package/templates/apps/website/why/examples/2.npm-basic-package/tsconfig.json +18 -0
- package/templates/apps/website/why/examples/3.npm-basic-package/README.md +1 -0
- package/templates/apps/website/why/examples/3.npm-basic-package/build.config.ts +24 -0
- package/templates/apps/website/why/examples/3.npm-basic-package/package-lock.json +3661 -0
- package/templates/apps/website/why/examples/3.npm-basic-package/package.json +32 -0
- package/templates/apps/website/why/examples/3.npm-basic-package/src/index.ts +7 -0
- package/templates/apps/website/why/examples/3.npm-basic-package/tsconfig.json +16 -0
- package/templates/apps/website/why/examples/3.npm-basic-package/tsup.config.ts +16 -0
- package/templates/apps/website/why/examples/usage-cjs/cjs.cjs +3 -0
- package/templates/apps/website/why/examples/usage-cjs/esm.mjs +3 -0
- package/templates/apps/website/why/examples/usage-cjs/index.js +11 -0
- package/templates/apps/website/why/examples/usage-cjs/package-lock.json +42 -0
- package/templates/apps/website/why/examples/usage-cjs/package.json +20 -0
- package/templates/apps/website/why/examples/usage-esm/cjs.cjs +3 -0
- package/templates/apps/website/why/examples/usage-esm/createRequire.js +7 -0
- package/templates/apps/website/why/examples/usage-esm/esm.mjs +3 -0
- package/templates/apps/website/why/examples/usage-esm/index.js +7 -0
- package/templates/apps/website/why/examples/usage-esm/package-lock.json +42 -0
- package/templates/apps/website/why/examples/usage-esm/package.json +21 -0
- package/templates/apps/website/why/how-to-reuse-js-code.md +250 -0
- package/templates/apps/website/why/index.md +1 -0
- package/templates/apps/website/why/js-cjs-mjs.md +99 -0
- package/templates/apps/website/why/js-keywords.md +132 -0
- package/templates/apps/website/why/modern/bundlers.md +79 -0
- package/templates/apps/website/why/modern/dts.md +95 -0
- package/templates/apps/website/why/modern/esm-vs-cjs.md +84 -0
- package/templates/apps/website/why/modern/index.md +55 -0
- package/templates/apps/website/why/modern/package-entry-points.md +128 -0
- package/templates/apps/website/why/modern/typescript.md +155 -0
- package/templates/apps/website/why/publish-basic-npm-package.md +146 -0
- package/templates/apps/website/why/what-is-npm-package.md +162 -0
- package/templates/packages/tsup-template/build.config.ts +24 -0
- package/templates/packages/tsup-template/package.json +42 -0
- package/templates/packages/tsup-template/src/index.ts +12 -0
- package/templates/packages/tsup-template/test/index.test.ts +7 -0
- package/templates/packages/tsup-template/tsconfig.json +15 -0
- package/templates/packages/tsup-template/tsup.config.ts +18 -0
- package/templates/packages/tsup-template/vitest.config.ts +15 -0
- package/templates/packages/unbuild-template/build.config.ts +24 -0
- package/templates/packages/unbuild-template/package.json +42 -0
- package/templates/packages/unbuild-template/src/index.ts +9 -0
- package/templates/packages/unbuild-template/src/utils.ts +3 -0
- package/templates/packages/unbuild-template/test/index.test.ts +7 -0
- package/templates/packages/unbuild-template/tsconfig.json +15 -0
- package/templates/packages/unbuild-template/vitest.config.ts +15 -0
- package/templates/packages/vue-lib-template/eslint.config.js +12 -0
- package/templates/packages/vue-lib-template/index.html +13 -0
- package/templates/packages/vue-lib-template/lib/HelloWorld.vue +21 -0
- package/templates/packages/vue-lib-template/lib/index.ts +3 -0
- package/templates/packages/vue-lib-template/package.json +61 -0
- package/templates/packages/vue-lib-template/src/App.vue +9 -0
- package/templates/packages/vue-lib-template/src/main.ts +8 -0
- package/templates/packages/vue-lib-template/src/pages/index.vue +7 -0
- package/templates/packages/vue-lib-template/src/router/index.ts +11 -0
- package/templates/packages/vue-lib-template/src/style.css +1 -0
- package/templates/packages/vue-lib-template/src/vite-env.d.ts +2 -0
- package/templates/packages/vue-lib-template/test/index.test.ts +13 -0
- package/templates/packages/vue-lib-template/tsconfig.app.json +30 -0
- package/templates/packages/vue-lib-template/tsconfig.json +14 -0
- package/templates/packages/vue-lib-template/tsconfig.node.json +25 -0
- package/templates/packages/vue-lib-template/tsconfig.test.json +40 -0
- package/templates/packages/vue-lib-template/vite.config.ts +47 -0
- package/templates/packages/vue-lib-template/vite.shared.config.ts +13 -0
- package/templates/packages/vue-lib-template/vitest.config.ts +13 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/wrangler/config-schema.json",
|
|
3
|
+
"name": "monorepo-client",
|
|
4
|
+
"compatibility_date": "2025-09-13",
|
|
5
|
+
"main": "./worker/fetch-entry.ts",
|
|
6
|
+
"assets": {
|
|
7
|
+
"not_found_handling": "single-page-application"
|
|
8
|
+
},
|
|
9
|
+
"dev": {
|
|
10
|
+
"port": 8787
|
|
11
|
+
},
|
|
12
|
+
"routes": [
|
|
13
|
+
{
|
|
14
|
+
"custom_domain": true,
|
|
15
|
+
"pattern": "client.monorepo.icebreaker.top"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"observability": {
|
|
19
|
+
"enabled": true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@icebreakers/server",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"description": "tsup(esbuild) build package template",
|
|
6
|
+
"author": "ice breaker <1324318532@qq.com>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/sonofmagic/monorepo-template.git",
|
|
11
|
+
"directory": "apps/server"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/sonofmagic/monorepo-template/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [],
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"exports": {
|
|
19
|
+
".": "./src/index.ts",
|
|
20
|
+
"./router": "./src/trpc-router.ts",
|
|
21
|
+
"./config": "./src/config.ts"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"dev": "tsx watch src/node-entry.ts",
|
|
28
|
+
"start": "node dist/node-entry.js",
|
|
29
|
+
"build:watch": "tsup --watch --sourcemap",
|
|
30
|
+
"build": "tsup",
|
|
31
|
+
"test": "vitest run",
|
|
32
|
+
"test:dev": "vitest",
|
|
33
|
+
"release": "pnpm publish",
|
|
34
|
+
"lint": "eslint .",
|
|
35
|
+
"lint:fix": "eslint . --fix",
|
|
36
|
+
"deploy": "wrangler deploy",
|
|
37
|
+
"types": "wrangler types",
|
|
38
|
+
"worker:dev": "wrangler dev"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"exports": {
|
|
42
|
+
".": {
|
|
43
|
+
"types": "./dist/index.d.ts",
|
|
44
|
+
"import": "./dist/index.js",
|
|
45
|
+
"require": "./dist/index.cjs"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"main": "./dist/index.cjs",
|
|
49
|
+
"module": "./dist/index.js",
|
|
50
|
+
"types": "./dist/index.d.ts"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@hono/node-server": "^1.19.3",
|
|
54
|
+
"hono": "^4.9.8",
|
|
55
|
+
"wrangler": "^4.38.0",
|
|
56
|
+
"zod": "^4.1.9"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { Hono } from 'hono'
|
|
2
|
+
|
|
3
|
+
interface ColorStop { color: string, position: number }
|
|
4
|
+
|
|
5
|
+
const grads: ColorStop[][] = [
|
|
6
|
+
[
|
|
7
|
+
{ color: '00000c', position: 0 },
|
|
8
|
+
{ color: '00000c', position: 0 },
|
|
9
|
+
],
|
|
10
|
+
[
|
|
11
|
+
{ color: '020111', position: 85 },
|
|
12
|
+
{ color: '191621', position: 100 },
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
{ color: '020111', position: 60 },
|
|
16
|
+
{ color: '20202c', position: 100 },
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
{ color: '020111', position: 10 },
|
|
20
|
+
{ color: '3a3a52', position: 100 },
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
{ color: '20202c', position: 0 },
|
|
24
|
+
{ color: '515175', position: 100 },
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
{ color: '40405c', position: 0 },
|
|
28
|
+
{ color: '6f71aa', position: 80 },
|
|
29
|
+
{ color: '8a76ab', position: 100 },
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
{ color: '4a4969', position: 0 },
|
|
33
|
+
{ color: '7072ab', position: 50 },
|
|
34
|
+
{ color: 'cd82a0', position: 100 },
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
{ color: '757abf', position: 0 },
|
|
38
|
+
{ color: '8583be', position: 60 },
|
|
39
|
+
{ color: 'eab0d1', position: 100 },
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
{ color: '82addb', position: 0 },
|
|
43
|
+
{ color: 'ebb2b1', position: 100 },
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
{ color: '94c5f8', position: 1 },
|
|
47
|
+
{ color: 'a6e6ff', position: 70 },
|
|
48
|
+
{ color: 'b1b5ea', position: 100 },
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
{ color: 'b7eaff', position: 0 },
|
|
52
|
+
{ color: '94dfff', position: 100 },
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
{ color: '9be2fe', position: 0 },
|
|
56
|
+
{ color: '67d1fb', position: 100 },
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
{ color: '90dffe', position: 0 },
|
|
60
|
+
{ color: '38a3d1', position: 100 },
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
{ color: '57c1eb', position: 0 },
|
|
64
|
+
{ color: '246fa8', position: 100 },
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
{ color: '2d91c2', position: 0 },
|
|
68
|
+
{ color: '1e528e', position: 100 },
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
{ color: '2473ab', position: 0 },
|
|
72
|
+
{ color: '1e528e', position: 70 },
|
|
73
|
+
{ color: '5b7983', position: 100 },
|
|
74
|
+
],
|
|
75
|
+
[
|
|
76
|
+
{ color: '1e528e', position: 0 },
|
|
77
|
+
{ color: '265889', position: 50 },
|
|
78
|
+
{ color: '9da671', position: 100 },
|
|
79
|
+
],
|
|
80
|
+
[
|
|
81
|
+
{ color: '1e528e', position: 0 },
|
|
82
|
+
{ color: '728a7c', position: 50 },
|
|
83
|
+
{ color: 'e9ce5d', position: 100 },
|
|
84
|
+
],
|
|
85
|
+
[
|
|
86
|
+
{ color: '154277', position: 0 },
|
|
87
|
+
{ color: '576e71', position: 30 },
|
|
88
|
+
{ color: 'e1c45e', position: 70 },
|
|
89
|
+
{ color: 'b26339', position: 100 },
|
|
90
|
+
],
|
|
91
|
+
[
|
|
92
|
+
{ color: '163C52', position: 0 },
|
|
93
|
+
{ color: '4F4F47', position: 30 },
|
|
94
|
+
{ color: 'C5752D', position: 60 },
|
|
95
|
+
{ color: 'B7490F', position: 80 },
|
|
96
|
+
{ color: '2F1107', position: 100 },
|
|
97
|
+
],
|
|
98
|
+
[
|
|
99
|
+
{ color: '071B26', position: 0 },
|
|
100
|
+
{ color: '071B26', position: 30 },
|
|
101
|
+
{ color: '8A3B12', position: 80 },
|
|
102
|
+
{ color: '240E03', position: 100 },
|
|
103
|
+
],
|
|
104
|
+
[
|
|
105
|
+
{ color: '010A10', position: 30 },
|
|
106
|
+
{ color: '59230B', position: 80 },
|
|
107
|
+
{ color: '2F1107', position: 100 },
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
{ color: '090401', position: 50 },
|
|
111
|
+
{ color: '4B1D06', position: 100 },
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
{ color: '00000c', position: 80 },
|
|
115
|
+
{ color: '150800', position: 100 },
|
|
116
|
+
],
|
|
117
|
+
]
|
|
118
|
+
|
|
119
|
+
// Convert hour to CSS gradient
|
|
120
|
+
async function toCSSGradient(hour: number): Promise<string> {
|
|
121
|
+
let css = 'linear-gradient(to bottom,'
|
|
122
|
+
const data = grads[hour]
|
|
123
|
+
const len = data.length
|
|
124
|
+
|
|
125
|
+
for (let i = 0; i < len; i++) {
|
|
126
|
+
const item = data[i]
|
|
127
|
+
css += ` #${item.color} ${item.position}%`
|
|
128
|
+
if (i < len - 1) {
|
|
129
|
+
css += ','
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return `${css})`
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const app = new Hono()
|
|
137
|
+
|
|
138
|
+
app.get('*', async (c) => {
|
|
139
|
+
const request = c.req.raw
|
|
140
|
+
|
|
141
|
+
// Base HTML style
|
|
142
|
+
let html_style = `
|
|
143
|
+
html{width:100vw; height:100vh;}
|
|
144
|
+
body{padding:0; margin:0 !important;height:100%;}
|
|
145
|
+
#container {
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-direction:column;
|
|
148
|
+
align-items: center;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
height: 100%;
|
|
151
|
+
color:white;
|
|
152
|
+
font-family:sans-serif;
|
|
153
|
+
}`
|
|
154
|
+
|
|
155
|
+
// Get timezone from Cloudflare request
|
|
156
|
+
const timezone: string = request.cf?.timezone as string || 'UTC'
|
|
157
|
+
|
|
158
|
+
// Get localized time
|
|
159
|
+
const localized_date = new Date(
|
|
160
|
+
new Date().toLocaleString('en-US', { timeZone: timezone }),
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
const hour = localized_date.getHours()
|
|
164
|
+
const minutes = localized_date.getMinutes()
|
|
165
|
+
|
|
166
|
+
// Generate HTML content
|
|
167
|
+
let html_content = `<h1>${hour}:${minutes}</h1>`
|
|
168
|
+
html_content += `<p>${timezone}<br/></p>`
|
|
169
|
+
|
|
170
|
+
// Add background gradient based on hour
|
|
171
|
+
html_style += `body{background:${await toCSSGradient(hour)};}`
|
|
172
|
+
|
|
173
|
+
// Complete HTML document
|
|
174
|
+
const html = `
|
|
175
|
+
<!DOCTYPE html>
|
|
176
|
+
<head>
|
|
177
|
+
<title>Geolocation: Customized Design</title>
|
|
178
|
+
</head>
|
|
179
|
+
<body>
|
|
180
|
+
<style>${html_style}</style>
|
|
181
|
+
<div id="container">
|
|
182
|
+
${html_content}
|
|
183
|
+
</div>
|
|
184
|
+
</body>`
|
|
185
|
+
|
|
186
|
+
return c.html(html)
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
export {
|
|
190
|
+
app,
|
|
191
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const port = 8787
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { serve } from '@hono/node-server'
|
|
2
|
+
import { logger } from 'hono/logger'
|
|
3
|
+
import { app } from './app'
|
|
4
|
+
import { port } from './config'
|
|
5
|
+
|
|
6
|
+
app.use(logger())
|
|
7
|
+
serve({
|
|
8
|
+
fetch: app.fetch,
|
|
9
|
+
port,
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
console.log(`Server listening on http://localhost:${port}`)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Hono } from 'hono'
|
|
2
|
+
import { testClient } from 'hono/testing'
|
|
3
|
+
|
|
4
|
+
describe('index', () => {
|
|
5
|
+
it('foo bar', async () => {
|
|
6
|
+
const app = new Hono().get('/search', c =>
|
|
7
|
+
c.json({ hello: 'world' }))
|
|
8
|
+
const res = await testClient(app).search.$get()
|
|
9
|
+
|
|
10
|
+
expect(await res.json()).toEqual({ hello: 'world' })
|
|
11
|
+
|
|
12
|
+
// expect(await res.json()).toEqual({ hello: 'world' })
|
|
13
|
+
})
|
|
14
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"lib": [
|
|
5
|
+
"ES2022",
|
|
6
|
+
"WebWorker"
|
|
7
|
+
],
|
|
8
|
+
"baseUrl": ".",
|
|
9
|
+
"paths": {
|
|
10
|
+
"@/*": [
|
|
11
|
+
"src/*"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"types": [
|
|
15
|
+
"node",
|
|
16
|
+
"vitest/globals",
|
|
17
|
+
"./worker-configuration.d.ts"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"include": [
|
|
21
|
+
"src",
|
|
22
|
+
"test"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ['src/node-entry.ts'], // , 'src/cli.ts'],
|
|
5
|
+
shims: true,
|
|
6
|
+
format: ['esm'],
|
|
7
|
+
clean: true,
|
|
8
|
+
dts: false,
|
|
9
|
+
// https://github.com/egoist/tsup/pull/1056
|
|
10
|
+
// https://github.com/egoist/tsup/issues?q=cjsInterop
|
|
11
|
+
// cjsInterop: true,
|
|
12
|
+
// splitting: true,
|
|
13
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import { defineProject } from 'vitest/config'
|
|
3
|
+
|
|
4
|
+
export default defineProject({
|
|
5
|
+
test: {
|
|
6
|
+
alias: [
|
|
7
|
+
{
|
|
8
|
+
find: '@',
|
|
9
|
+
replacement: path.resolve(__dirname, './src'),
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
globals: true,
|
|
13
|
+
testTimeout: 60_000,
|
|
14
|
+
},
|
|
15
|
+
})
|