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: complete PackageJsonObject model #291

Merged
merged 5 commits into from
May 18, 2023
Merged
Changes from 3 commits
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
45 changes: 45 additions & 0 deletions lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,53 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

interface PackageJsonPerson {
name: string;
email?: string;
url?: string;
}

interface PackageJsonBugs {
url?: string;
email?: string;
}
dsherret marked this conversation as resolved.
Show resolved Hide resolved
/**
* Based on version 9.6.6
*/
export interface PackageJsonObject {
name: string;
version: string;
description?: string;
keywords?: string[];
homepage?: string;
bugs?: PackageJsonBugs | string;
/**
* Check https://spdx.org/licenses/ for valid licences
*/
license?: "MIT" | "ISC" | string | "UNLICENSED" | "SEE LICENSE IN <filename>";
dsherret marked this conversation as resolved.
Show resolved Hide resolved
author?: PackageJsonPerson | string;
contributors?: (PackageJsonPerson | string)[];
main?: string;
types?: string;
scripts?: { [key: string]: string };
repository?: string | { type: string; url: string; directory?: string };
dependencies?: { [packageName: string]: string };
devDependencies?: { [packageName: string]: string };
peerDependencies?: { [packageName: string]: string };
bundleDependencies?: { [packageName: string]: string };
optionalDependencies?: { [packageName: string]: string };
engines?: { [engineName: string]: string };
/**
* A list of os like "darwin", "linux", "win32", OS names can be prefix by a "!"
*/
os?: string[];
/**
* A list of cpu like "x64", "ia32", "arm", "mips", CPU names can be prefix by a "!"
*/
cpu?: string[];
private?: boolean;
/**
* rest of the fields
*/
[propertyName: string]: any;
}

Expand Down
Loading