fix(package): declare npm publication metadata
Link the package to its public source, issue tracker, and documentation so npm Trusted Publishing can validate provenance and consumers receive canonical project links. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
2 files changed
+41
No files matched your search
@@ -4,6 +4,14 @@
|
|||||||
"description": "A zen, opinionated, type-safe framework — your API is a graph, not a middleware chain.",
|
"description": "A zen, opinionated, type-safe framework — your API is a graph, not a middleware chain.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "green-tea contributors",
|
"author": "green-tea contributors",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/Expressive-Tea/green-tea.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/Expressive-Tea/green-tea/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://green-tea.expressive-tea.io/docs/",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"http",
|
"http",
|
||||||
"framework",
|
"framework",
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
import { resolve } from 'node:path';
|
||||||
|
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
|
||||||
|
interface PackageMetadata {
|
||||||
|
readonly repository?: {
|
||||||
|
readonly type?: string;
|
||||||
|
readonly url?: string;
|
||||||
|
};
|
||||||
|
readonly bugs?: {
|
||||||
|
readonly url?: string;
|
||||||
|
};
|
||||||
|
readonly homepage?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const packageJson = JSON.parse(readFileSync(resolve(process.cwd(), 'package.json'), 'utf8')) as PackageMetadata;
|
||||||
|
|
||||||
|
describe('package publication metadata', () => {
|
||||||
|
it('links npm provenance to the public GitHub repository', () => {
|
||||||
|
expect(packageJson.repository).toEqual({
|
||||||
|
type: 'git',
|
||||||
|
url: 'git+https://github.com/Expressive-Tea/green-tea.git',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('links npm consumers to support and documentation', () => {
|
||||||
|
expect(packageJson.bugs).toEqual({
|
||||||
|
url: 'https://github.com/Expressive-Tea/green-tea/issues',
|
||||||
|
});
|
||||||
|
expect(packageJson.homepage).toBe('https://green-tea.expressive-tea.io/docs/');
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in new issue
Block a user