@gravito/signal 3.1.0 → 4.0.0
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/dist/OrbitSignal.d.ts +6 -0
- package/dist/errors/codes.d.ts +19 -0
- package/dist/errors.d.ts +18 -11
- package/dist/index.cjs +55148 -81886
- package/dist/index.d.ts +514 -1
- package/dist/index.js +61553 -0
- package/dist/index.mjs +55158 -81907
- package/dist/transports/BaseTransport.d.ts +15 -23
- package/package.json +16 -4
- package/CHANGELOG.md +0 -74
- package/build.ts +0 -133
- package/dist/index.cjs.map +0 -712
- package/dist/index.mjs.map +0 -710
- package/doc/ADVANCED_RENDERING.md +0 -71
- package/doc/DISTRIBUTED_MESSAGING.md +0 -79
- package/doc/OPTIMIZATION_PLAN.md +0 -496
- package/package.json.bak +0 -75
- package/scripts/check-coverage.ts +0 -64
- package/src/Mailable.ts +0 -674
- package/src/OrbitSignal.ts +0 -451
- package/src/Queueable.ts +0 -9
- package/src/TypedMailable.ts +0 -96
- package/src/dev/DevMailbox.ts +0 -146
- package/src/dev/DevServer.ts +0 -192
- package/src/dev/storage/FileMailboxStorage.ts +0 -66
- package/src/dev/storage/MailboxStorage.ts +0 -15
- package/src/dev/storage/MemoryMailboxStorage.ts +0 -36
- package/src/dev/ui/mailbox.ts +0 -77
- package/src/dev/ui/preview.ts +0 -103
- package/src/dev/ui/shared.ts +0 -60
- package/src/errors.ts +0 -69
- package/src/events.ts +0 -72
- package/src/index.ts +0 -41
- package/src/renderers/HtmlRenderer.ts +0 -41
- package/src/renderers/MjmlRenderer.ts +0 -73
- package/src/renderers/ReactMjmlRenderer.ts +0 -94
- package/src/renderers/ReactRenderer.ts +0 -66
- package/src/renderers/Renderer.ts +0 -67
- package/src/renderers/TemplateRenderer.ts +0 -84
- package/src/renderers/VueMjmlRenderer.ts +0 -99
- package/src/renderers/VueRenderer.ts +0 -71
- package/src/renderers/mjml-templates.ts +0 -50
- package/src/transports/BaseTransport.ts +0 -148
- package/src/transports/LogTransport.ts +0 -55
- package/src/transports/MemoryTransport.ts +0 -55
- package/src/transports/SesTransport.ts +0 -129
- package/src/transports/SmtpTransport.ts +0 -184
- package/src/transports/Transport.ts +0 -45
- package/src/types.ts +0 -309
- package/src/utils/html.ts +0 -43
- package/src/webhooks/SendGridWebhookDriver.ts +0 -80
- package/src/webhooks/SesWebhookDriver.ts +0 -44
- package/tests/DevMailbox.test.ts +0 -54
- package/tests/FileMailboxStorage.test.ts +0 -56
- package/tests/MjmlLayout.test.ts +0 -28
- package/tests/MjmlRenderer.test.ts +0 -53
- package/tests/OrbitSignalWebhook.test.ts +0 -56
- package/tests/ReactMjmlRenderer.test.ts +0 -33
- package/tests/SendGridWebhookDriver.test.ts +0 -69
- package/tests/SesWebhookDriver.test.ts +0 -46
- package/tests/VueMjmlRenderer.test.ts +0 -35
- package/tests/dev-server.test.ts +0 -66
- package/tests/log-transport.test.ts +0 -21
- package/tests/mailable-extra.test.ts +0 -68
- package/tests/mailable.test.ts +0 -77
- package/tests/orbit-signal.test.ts +0 -43
- package/tests/renderers.test.ts +0 -58
- package/tests/template-renderer.test.ts +0 -24
- package/tests/transports.test.ts +0 -52
- package/tests/ui.test.ts +0 -37
- package/tsconfig.build.json +0 -24
- package/tsconfig.json +0 -9
package/package.json.bak
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@gravito/signal",
|
|
3
|
-
"version": "3.0.3",
|
|
4
|
-
"description": "Powerful email framework for Gravito applications with Dev UI and multi-renderer support.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build": "tsup src/index.ts --format cjs,esm --dts --external @gravito/core --external @gravito/stream --external @gravito/prism",
|
|
10
|
-
"test": "bun test --timeout=10000",
|
|
11
|
-
"test:coverage": "bun test --timeout=10000 --coverage --coverage-reporter=lcov --coverage-dir coverage && bun run --bun scripts/check-coverage.ts",
|
|
12
|
-
"test:ci": "bun test --timeout=10000 --coverage --coverage-reporter=lcov --coverage-dir coverage && bun run --bun scripts/check-coverage.ts",
|
|
13
|
-
"typecheck": "bun tsc -p tsconfig.json --noEmit --skipLibCheck",
|
|
14
|
-
"test:unit": "bun test tests/ --timeout=10000",
|
|
15
|
-
"test:integration": "test $(find tests -name '*.integration.test.ts' 2>/dev/null | wc -l) -gt 0 && find tests -name '*.integration.test.ts' -print0 | xargs -0 bun test --timeout=10000 || echo 'No integration tests found'"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"gravito",
|
|
19
|
-
"mail",
|
|
20
|
-
"smtp",
|
|
21
|
-
"email",
|
|
22
|
-
"react-email",
|
|
23
|
-
"vue-email"
|
|
24
|
-
],
|
|
25
|
-
"author": "Carl Lee <carllee0520@gmail.com>",
|
|
26
|
-
"license": "MIT",
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"@aws-sdk/client-ses": "^3.953.0",
|
|
29
|
-
"nodemailer": "^7.0.11"
|
|
30
|
-
},
|
|
31
|
-
"peerDependencies": {
|
|
32
|
-
"@gravito/core": "workspace:*",
|
|
33
|
-
"@gravito/stream": "workspace:*",
|
|
34
|
-
"@gravito/prism": "workspace:*",
|
|
35
|
-
"react": "^19.0.0",
|
|
36
|
-
"react-dom": "^19.0.0",
|
|
37
|
-
"vue": "^3.0.0"
|
|
38
|
-
},
|
|
39
|
-
"peerDependenciesMeta": {
|
|
40
|
-
"react": {
|
|
41
|
-
"optional": true
|
|
42
|
-
},
|
|
43
|
-
"react-dom": {
|
|
44
|
-
"optional": true
|
|
45
|
-
},
|
|
46
|
-
"vue": {
|
|
47
|
-
"optional": true
|
|
48
|
-
},
|
|
49
|
-
"@gravito/prism": {
|
|
50
|
-
"optional": true
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"@gravito/prism": "workspace:*",
|
|
55
|
-
"@gravito/stream": "workspace:*",
|
|
56
|
-
"@types/nodemailer": "^6.4.14",
|
|
57
|
-
"@types/react": "^19.0.0",
|
|
58
|
-
"@types/react-dom": "^19.0.0",
|
|
59
|
-
"@vue/server-renderer": "^3.0.0",
|
|
60
|
-
"@gravito/core": "workspace:*",
|
|
61
|
-
"tsup": "8.5.1",
|
|
62
|
-
"typescript": "^5.9.3",
|
|
63
|
-
"vue": "^3.0.0",
|
|
64
|
-
"bun-types": "latest"
|
|
65
|
-
},
|
|
66
|
-
"publishConfig": {
|
|
67
|
-
"access": "public"
|
|
68
|
-
},
|
|
69
|
-
"homepage": "https://github.com/gravito-framework/gravito#readme",
|
|
70
|
-
"repository": {
|
|
71
|
-
"type": "git",
|
|
72
|
-
"url": "git+https://github.com/gravito-framework/gravito.git",
|
|
73
|
-
"directory": "packages/signal"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs'
|
|
2
|
-
import { resolve } from 'node:path'
|
|
3
|
-
|
|
4
|
-
const lcovPath = process.argv[2] ?? 'coverage/lcov.info'
|
|
5
|
-
const threshold = Number.parseFloat(process.env.COVERAGE_THRESHOLD ?? '80')
|
|
6
|
-
|
|
7
|
-
const root = resolve(process.cwd())
|
|
8
|
-
const srcRoot = `${resolve(root, 'src')}/`
|
|
9
|
-
|
|
10
|
-
// 檢查 lcov.info 是否存在
|
|
11
|
-
if (!existsSync(lcovPath)) {
|
|
12
|
-
console.error(`Coverage file not found: ${lcovPath}`)
|
|
13
|
-
process.exit(1)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let content: string
|
|
17
|
-
try {
|
|
18
|
-
content = readFileSync(lcovPath, 'utf-8')
|
|
19
|
-
} catch (error) {
|
|
20
|
-
console.error(`Failed to read coverage file: ${error}`)
|
|
21
|
-
process.exit(1)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const lines = content.split('\n')
|
|
25
|
-
|
|
26
|
-
let currentFile: string | null = null
|
|
27
|
-
let total = 0
|
|
28
|
-
let hit = 0
|
|
29
|
-
|
|
30
|
-
for (const line of lines) {
|
|
31
|
-
if (line.startsWith('SF:')) {
|
|
32
|
-
const filePath = line.slice(3).trim()
|
|
33
|
-
const abs = resolve(root, filePath)
|
|
34
|
-
currentFile = abs.startsWith(srcRoot) ? abs : null
|
|
35
|
-
continue
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (!currentFile) {
|
|
39
|
-
continue
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (line.startsWith('DA:')) {
|
|
43
|
-
const parts = line.slice(3).split(',')
|
|
44
|
-
if (parts.length >= 2) {
|
|
45
|
-
total += 1
|
|
46
|
-
const count = Number.parseInt(parts[1] ?? '0', 10)
|
|
47
|
-
if (count > 0) {
|
|
48
|
-
hit += 1
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const percent = total === 0 ? 0 : (hit / total) * 100
|
|
55
|
-
const rounded = Math.round(percent * 100) / 100
|
|
56
|
-
|
|
57
|
-
if (rounded < threshold) {
|
|
58
|
-
console.error(
|
|
59
|
-
`signal coverage ${rounded}% is below threshold ${threshold}%. Covered lines: ${hit}/${total}.`
|
|
60
|
-
)
|
|
61
|
-
process.exit(1)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
console.log(`signal coverage ${rounded}% (${hit}/${total}) meets threshold ${threshold}%.`)
|