Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add more fields into package.json #190

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/types/packagejson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ export interface PackageJson {
* If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren’t available in Node.js modules. (e.g. window)
*/
browser?: string | Record<string, string | false>;
/**
* The `unpkg` field is used to specify the URL to a UMD module for your package. This is used by default in the unpkg.com CDN service.
*/
unpkg?: string;
/**
* A map of command name to local file name. On install, npm will symlink that file into `prefix/bin` for global installs, or `./node_modules/.bin/` for local installs.
*/
Expand Down Expand Up @@ -182,5 +186,31 @@ export interface PackageJson {
* The optional engines field is used to specify the versions of npm and node that your stuff works on.
*/
workspaces?: string[];
typesVersions?: Record<string, Record<string, string[]>>;
os?: string[];
cpu?: string[];
publishConfig?: {
sxzz marked this conversation as resolved.
Show resolved Hide resolved
registry: string;
tag: string;
access: "public" | "restricted";

// pnpm
executableFiles?: string[];
directory?: string;
linkDirectory?: boolean;
} & Pick<
PackageJson,
| "bin"
| "main"
| "exports"
| "types"
| "typings"
| "module"
| "browser"
| "unpkg"
| "typesVersions"
| "os"
| "cpu"
>;
[key: string]: any;
}