Skip to content

Commit 71eac29

Browse files
committed
Release v0.11.0
1 parent ea6c51e commit 71eac29

93 files changed

Lines changed: 1524 additions & 260 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run lint:implementations && npm run format:implementations

ATTACHMENTS.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,7 @@ See [src/implementations/vintasend-implementation-template/src/attachment-manage
444444
Your custom `AttachmentManager` must implement:
445445

446446
```typescript
447-
import { BaseAttachmentManager } from 'vintasend/dist/services/attachment-manager/base-attachment-manager';
448-
import type { AttachmentFile } from 'vintasend/dist/types/attachment';
447+
import { BaseAttachmentManager, type AttachmentFile } from 'vintasend';
449448

450449
export class MyAttachmentManager extends BaseAttachmentManager {
451450
/**
@@ -518,7 +517,7 @@ You can override these utility methods from `BaseAttachmentManager`:
518517
### Example: Azure Blob Storage
519518

520519
```typescript
521-
import { BaseAttachmentManager } from 'vintasend/dist/services/attachment-manager/base-attachment-manager';
520+
import { BaseAttachmentManager } from 'vintasend';
522521
import { BlobServiceClient, ContainerClient } from '@azure/storage-blob';
523522

524523
export class AzureBlobAttachmentManager extends BaseAttachmentManager {
@@ -879,8 +878,7 @@ await vintaSend.sendNotification({
879878
To add attachment support to a custom adapter:
880879

881880
```typescript
882-
import { BaseNotificationAdapter } from 'vintasend';
883-
import type { StoredAttachment } from 'vintasend/dist/types/attachment';
881+
import { BaseNotificationAdapter, type StoredAttachment } from 'vintasend';
884882

885883
export class MyAdapter extends BaseNotificationAdapter {
886884
// Declare that this adapter supports attachments

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
# Version 0.11.0
4+
5+
* Centralized most type exports in the root package, so all usages can import directly from 'vintasend'.
6+
* Adjusted linter/formatter rules and scripts to ensure consistency between the root package and all implementations.
7+
38
## Version 0.10.0
49

510
* Support vintasend-react-email.

biome.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,22 @@
3434
"semicolons": "always",
3535
"trailingCommas": "all"
3636
}
37-
}
37+
},
38+
"overrides": [
39+
{
40+
"includes": [
41+
"**/*.test.ts",
42+
"**/*.test.tsx",
43+
"**/__tests__/**/*.ts",
44+
"**/__tests__/**/*.tsx"
45+
],
46+
"linter": {
47+
"rules": {
48+
"suspicious": {
49+
"noExplicitAny": "off"
50+
}
51+
}
52+
}
53+
}
54+
]
3855
}

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vintasend",
3-
"version": "0.10.0",
3+
"version": "0.11.0",
44
"main": "dist/index.js",
55
"files": [
66
"dist"
@@ -9,27 +9,33 @@
99
"license": "MIT",
1010
"scripts": {
1111
"lint": "biome check .",
12-
"format": "biome format .",
12+
"format": "biome check --write .",
1313
"check": "biome check --write .",
1414
"build": "tsc",
1515
"prepublishOnly": "npm run build",
1616
"test": "vitest run",
1717
"test:watch": "vitest",
1818
"test:coverage": "vitest run --coverage",
1919
"implementation:generate": "node scripts/generate-implementation.js",
20+
"lint:implementations": "node scripts/run-implementations-script.js lint",
21+
"format:implementations": "node scripts/run-implementations-script.js format",
2022
"test:implementations:local": "node scripts/test-implementations-local.js",
23+
"build:implementations:local": "node scripts/test-implementations-local.js --command=build",
24+
"release:prepare": "npm run format:implementations && npm run test:implementations:local && npm run build:implementations:local",
2125
"release:bump": "node scripts/release-bump.js",
2226
"release:bump:patch": "node scripts/release-bump.js --bump=patch",
2327
"release:bump:minor": "node scripts/release-bump.js --bump=minor",
2428
"release:bump:alpha": "node scripts/release-bump.js --bump=alpha",
2529
"release:bump:promote": "node scripts/release-bump.js --bump=promote",
26-
"release:publish": "node scripts/release-publish.js"
30+
"release:publish": "node scripts/release-publish.js",
31+
"prepare": "husky"
2732
},
2833
"devDependencies": {
29-
"@biomejs/biome": "^2.3.11",
34+
"@biomejs/biome": "^2.4.5",
3035
"@types/mime-types": "^3.0.1",
3136
"@types/node": "^25.0.8",
3237
"@vitest/coverage-v8": "4.0.18",
38+
"husky": "^9.1.7",
3339
"typescript": "^5.9.3",
3440
"vitest": "4.0.18"
3541
},
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env node
2+
"use strict";
3+
4+
const fs = require("fs");
5+
const path = require("path");
6+
const { spawnSync } = require("child_process");
7+
8+
function run(command, args, cwd) {
9+
const result = spawnSync(command, args, {
10+
cwd,
11+
stdio: "inherit",
12+
shell: false,
13+
});
14+
15+
if (result.status !== 0) {
16+
throw new Error(`Command failed: ${command} ${args.join(" ")}`);
17+
}
18+
}
19+
20+
function getImplementationsRoot(repoRoot) {
21+
return path.join(repoRoot, "src", "implementations");
22+
}
23+
24+
function getImplementationDirs(implementationsRoot) {
25+
return fs
26+
.readdirSync(implementationsRoot, { withFileTypes: true })
27+
.filter((entry) => entry.isDirectory() && entry.name !== 'vintasend-implementation-template')
28+
.map((entry) => path.join(implementationsRoot, entry.name))
29+
.filter((dirPath) => fs.existsSync(path.join(dirPath, "package.json")))
30+
.sort((a, b) => a.localeCompare(b));
31+
}
32+
33+
const scriptName = process.argv[2];
34+
35+
if (!scriptName) {
36+
console.error("Usage: node scripts/run-implementations-script.js <script>");
37+
process.exit(1);
38+
}
39+
40+
const repoRoot = process.cwd();
41+
const implementationsRoot = getImplementationsRoot(repoRoot);
42+
const implementationDirs = getImplementationDirs(implementationsRoot);
43+
44+
if (implementationDirs.length === 0) {
45+
console.log("No implementation packages found.");
46+
process.exit(0);
47+
}
48+
49+
for (const packageDir of implementationDirs) {
50+
const name = path.basename(packageDir);
51+
console.log(`\nRunning ${scriptName} in ${name}...`);
52+
run("npm", ["run", scriptName], packageDir);
53+
}

scripts/test-implementations-local.js

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,39 @@ function ensureLocalVintaSend(pkgJson, localSpec) {
6161
const repoRoot = process.cwd();
6262
const implementationsRoot = path.join(repoRoot, "src", "implementations");
6363
const originalContents = new Map();
64-
const requestedImplementations = process.argv.slice(2);
64+
65+
function parseArgs(argv) {
66+
let command = "test";
67+
const implementations = [];
68+
69+
for (let i = 0; i < argv.length; i += 1) {
70+
const arg = argv[i];
71+
72+
if (arg.startsWith("--command=")) {
73+
command = arg.slice("--command=".length);
74+
continue;
75+
}
76+
77+
if (arg === "--command") {
78+
const next = argv[i + 1];
79+
if (!next) {
80+
throw new Error("Missing value for --command");
81+
}
82+
83+
command = next;
84+
i += 1;
85+
continue;
86+
}
87+
88+
implementations.push(arg);
89+
}
90+
91+
return { command, implementations };
92+
}
93+
94+
const { command, implementations: requestedImplementations } = parseArgs(
95+
process.argv.slice(2),
96+
);
6597

6698
const allImplementationDirs = fs
6799
.readdirSync(implementationsRoot, { withFileTypes: true })
@@ -99,6 +131,7 @@ if (implementationDirs.length === 0) {
99131
}
100132

101133
try {
134+
console.log(`Running implementation script: ${command}`);
102135
console.log("Building local vintasend...");
103136
run("npm", ["run", "build"], repoRoot);
104137

@@ -117,9 +150,9 @@ try {
117150

118151
for (const packageDir of implementationDirs) {
119152
const name = path.basename(packageDir);
120-
console.log(`\nTesting ${name} with local vintasend...`);
153+
console.log(`\nRunning ${command} on ${name} with local vintasend...`);
121154
run("npm", ["install", "--no-package-lock"], packageDir);
122-
run("npm", ["test"], packageDir);
155+
run("npm", ["run", command], packageDir);
123156
}
124157
} catch (error) {
125158
console.error(error instanceof Error ? error.message : error);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run lint && npm run format

src/implementations/vintasend-implementation-template/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ See [`vintasend-aws-s3-attachments`](../vintasend-aws-s3-attachments) for a comp
250250
- **Deduplication**: Implement `findFileByChecksum()` to prevent storing duplicate files
251251
- **Presigned URLs**: Generate temporary URLs for secure file access without exposing credentials
252252
- **Streaming**: Support streaming for large files to avoid memory issues
253-
- **Type Safety**: All methods use strict TypeScript types from `vintasend/dist/types/attachment`
253+
- **Type Safety**: All methods use strict TypeScript types from `vintasend`
254254

255255
### Logger
256256

src/implementations/vintasend-implementation-template/biome.json

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.5/schema.json",
33
"vcs": {
44
"enabled": false,
55
"clientKind": "git",
66
"useIgnoreFile": false
77
},
88
"files": {
99
"ignoreUnknown": false,
10-
"ignore": []
10+
"includes": ["src/**/*.{ts,tsx}", "!dist", "!node_modules"]
1111
},
1212
"formatter": {
1313
"enabled": true,
1414
"indentStyle": "space",
1515
"indentWidth": 2,
1616
"lineWidth": 100
1717
},
18-
"organizeImports": {
19-
"enabled": true
18+
"assist": {
19+
"actions": {
20+
"source": {
21+
"organizeImports": "on"
22+
}
23+
}
2024
},
2125
"linter": {
2226
"enabled": true,
@@ -30,5 +34,22 @@
3034
"semicolons": "always",
3135
"trailingCommas": "all"
3236
}
33-
}
37+
},
38+
"overrides": [
39+
{
40+
"includes": [
41+
"**/*.test.ts",
42+
"**/*.test.tsx",
43+
"**/__tests__/**/*.ts",
44+
"**/__tests__/**/*.tsx"
45+
],
46+
"linter": {
47+
"rules": {
48+
"suspicious": {
49+
"noExplicitAny": "off"
50+
}
51+
}
52+
}
53+
}
54+
]
3455
}

0 commit comments

Comments
 (0)