Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f764e8c
Begun implementing package-lock.json schema
Vessel9817 May 28, 2026
8516488
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 28, 2026
dae8a19
Added tests, descriptions and fixed properties
Vessel9817 May 29, 2026
5577958
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 29, 2026
610f04d
Added undocumented `requires` property
Vessel9817 May 29, 2026
679dc82
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 29, 2026
29cc741
Attempted to fix tests
Vessel9817 May 30, 2026
4bed6ae
Fixed refs
Vessel9817 May 30, 2026
fe8f4da
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 30, 2026
2b58052
Added negative test
Vessel9817 Jun 15, 2026
16165ff
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 15, 2026
857c21c
Added support for special lockfiles
Vessel9817 Jun 22, 2026
2dd2f29
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 22, 2026
6915a21
Revert "Added negative test"
Vessel9817 Jun 24, 2026
ce1cb09
Migrated from union types to stricter configuration
Vessel9817 Jun 24, 2026
b836696
Restricted patternProperties to exclude overlap with properties
Vessel9817 Jun 24, 2026
15f437f
Removed `tsType` properties
Vessel9817 Jun 24, 2026
78c22d7
Split schema into versioned schemas and added tests
Vessel9817 Jun 25, 2026
255bcb4
Added realistic tests
Vessel9817 Jun 25, 2026
89cc6c8
Fixed incorrect assumption
Vessel9817 Jun 25, 2026
0cef17e
Fixed local `$ref`s
Vessel9817 Jun 25, 2026
2e5b0ab
Fixed `$ref`s
Vessel9817 Jun 26, 2026
a35203f
Fixed local `$ref`s
Vessel9817 Jun 26, 2026
8a1b0a7
Revert "Removed `tsType` properties"
Vessel9817 Jun 27, 2026
241c274
Removed `package-lock.json` in place of versioned schemas
Vessel9817 Jun 27, 2026
3decd9e
Added properties
Vessel9817 Jun 29, 2026
9bd7f4d
Tightened `link` validation
Vessel9817 Jun 29, 2026
23780b2
Fixed dependency fields
Vessel9817 Jun 29, 2026
ab89f45
Added undocumented properties and documentation references
Vessel9817 Jun 29, 2026
2bac5f4
Added some tests
Vessel9817 Jun 30, 2026
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
15 changes: 15 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -5555,6 +5555,21 @@
"fileMatch": ["resolutions.yml", "resolutions.yaml"],
"url": "https://raw.githubusercontent.com/oss-review-toolkit/ort/main/integrations/schemas/resolutions-schema.json"
},
{
"name": "package-lock.json",
"description": "NPM package lockfile",
"fileMatch": [
"package-lock.json",
"npm-shrinkwrap.json",
".package-lock.json"
],
"url": "https://www.schemastore.org/package-lock-3.json",
"versions": {
"1": "https://www.schemastore.org/package-lock-1.json",
"2": "https://www.schemastore.org/package-lock-2.json",
"3": "https://www.schemastore.org/package-lock-3.json"
}
},
{
"name": "package.json",
"description": "NPM configuration file",
Expand Down
60 changes: 60 additions & 0 deletions src/schema-validation.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@
"opensrm.json",
"opspec-io-0.1.7.json",
"package.json",
"package-lock-1.json",
"package-lock-2.json",
"package-lock-3.json",
"package.manifest-8.0.0.json",
"package.manifest.json",
"paper-plugin.json",
Expand Down Expand Up @@ -438,6 +441,9 @@
"cargo-lints-cargo.json",
"cargo-lints-clippy.json",
"cargo-lints-rust.json",
"package-lock-1.json",
"package-lock-2.json",
"package-lock-3.json",
"partial-pyright.json", // pyproject.json[tool.pyright]
"partial-setuptools.json", // pyproject.json[tool.setuptools]
"partial-setuptools-scm.json", // pyproject.json[tool.setuptools-scm]
Expand Down Expand Up @@ -1343,6 +1349,60 @@
"externalSchema": ["geojson.json"],
"unknownKeywords": ["name"]
},
"package-lock-1.json": {
"externalSchema": [
"package.json",
"eslintrc.json",
"partial-eslint-plugins.json",
"prettierrc.json",
"ava.json",
"npm-badges.json",
"stylelintrc.json",
"semantic-release.json",
"jscpd.json",
"nodemon.json",
"base.json",
"quikrun.json"
],
"unknownKeywords": ["tsType"]
},
"package-lock-2.json": {
"externalSchema": [
"package.json",
"package-lock-1.json",
"eslintrc.json",
"partial-eslint-plugins.json",
"prettierrc.json",
"ava.json",
"npm-badges.json",
"stylelintrc.json",
"semantic-release.json",
"jscpd.json",
"nodemon.json",
"base.json",
"quikrun.json"
],
"unknownKeywords": ["tsType"]
},
"package-lock-3.json": {
"externalSchema": [
"package.json",
"package-lock-1.json",
"package-lock-2.json",
"eslintrc.json",
"partial-eslint-plugins.json",
"prettierrc.json",
"ava.json",
"npm-badges.json",
"stylelintrc.json",
"semantic-release.json",
"jscpd.json",
"nodemon.json",
"base.json",
"quikrun.json"
],
"unknownKeywords": ["tsType"]
},
"package.json": {
"externalSchema": [
"eslintrc.json",
Expand Down
160 changes: 160 additions & 0 deletions src/schemas/json/package-lock-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/package-lock-1.json",
"$comment": "Added in npm v5",
"additionalProperties": true,
"description": "DEPRECATED. NPM package lockfile, version 1",
"type": "object",
"definitions": {
"integrity": {
"type": "string",
"description": "A Standard Subresource Integrity (SRI) value for this resource."
},
"lockfileVersion": {
"$comment": "Any version below 3 is DEPRECATED.",
"type": "integer",
"description": "The version number of this document whose semantics were used when generating this lockfile.",
"minimum": 1,
"default": 3
},
"packageProperties": {
"properties": {
"deprecated": {
"description": "UNDOCUMENTED. A deprecation message. If present, indicates this package is deprecated.",
"type": "string"
},
"devDependencies": {
"$comment": "https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devdependencies",
"$ref": "package.json#/properties/devDependencies",
"description": "UNDOCUMENTED. Specifies dependencies that are required for the development and testing of the project. These dependencies are not needed in the production environment."
},
"funding": {
"$comment": "Prior to npm v11, this field is UNDOCUMENTED. https://docs.npmjs.com/cli/v11/configuring-npm/package-json#funding",
"$ref": "package.json#/properties/funding",
"description": "Funding information for the package, as specified in `package.json`. This field contains details about how to support the package maintainers."
},
"peerDependencies": {
"$comment": "https://docs.npmjs.com/cli/v11/configuring-npm/package-json#peerdependencies",
"$ref": "package.json#/properties/peerDependencies",
"description": "UNDOCUMENTED. Specifies dependencies that are required by the package but are expected to be provided by the consumer of the package."
},
"os": {
"$comment": "Prior to npm v11, this field is UNDOCUMENTED. https://docs.npmjs.com/cli/v11/configuring-npm/package-json#os",
"$ref": "package.json#/properties/os",
"description": "An array of operating systems this package is compatible with, as specified in `package.json`. This field is included when the package specifies OS restrictions."
},
"cpu": {
"$comment": "Prior to npm v11, this field is UNDOCUMENTED. https://docs.npmjs.com/cli/v11/configuring-npm/package-json#cpu",
"$ref": "package.json#/properties/cpu",
"description": "An array of CPU architectures this package is compatible with, as specified in `package.json`. This field is included when the package specifies CPU restrictions."
}
}
}
},
"properties": {
"dependencies": {
"patternProperties": {
"^.*$": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#dependencies",
"$ref": "#/definitions/packageProperties",
"type": "object",
"additionalProperties": true,
"description": "A mapping of package locations to an object containing information about that package. npm v7 ignores this section entirely if a `packages` section is present, but does keep it up to date in order to support switching between npm v6 and npm v7.",
"properties": {
"dependencies": {
"$ref": "#/properties/dependencies",
"description": "The dependencies of this dependency, exactly as at the top level."
},
"bundled": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#bundled",
"description": "If `true`, this is the bundled dependency and will be installed by the parent module. When installing, this module will be extracted from the parent module during the extract phase, not installed as a separate dependency.",
"type": "boolean"
},
"bundledDependencies": {
"$comment": "https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bundledependencies",
"$ref": "package.json#/properties/bundledDependencies",
"description": "UNDOCUMENTED. DEPRECATED: This field is honored, but \"bundleDependencies\" is the correct field name. Ignored if \"bundleDependencies\" is also present."
},
"bundleDependencies": {
"$comment": "https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bundledependencies",
"$ref": "package.json#/properties/bundleDependencies",
"description": "UNDOCUMENTED. Array of package names that will be bundled when publishing the package."
},
"dev": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#dev",
"description": "If `true`, then this dependency is either a development dependency ONLY of the top level module or a transitive dependency of one. This is `false` for dependencies that are both a development dependency of the top level and a transitive dependency of a non-development dependency of the top level.",
"type": "boolean"
},
"optional": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#optional",
"description": "If `true`, then this dependency is either an optional dependency ONLY of the top level module or a transitive dependency of one. This is `false` for dependencies that are both an optional dependency of the top level and a transitive dependency of a non-optional dependency of the top level. All optional dependencies should be included even if they're uninstallable on the current platform.",
"type": "boolean"
},
"integrity": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#integrity",
"$ref": "#/definitions/integrity"
},
"peer": {
"$comment": "https://docs.npmjs.com/cli/v11/configuring-npm/package-lock-json#dependencies",
"description": "UNDOCUMENTED. A flag to indicate this package is a peer dependency.",
"type": "boolean"
},
"resolved": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#resolved",
"description": "For registry sources, this is path of the tarball relative to the registry URL. If the tarball URL isn't on the same server as the registry URL then this is a complete URL. For bundled dependencies, this is not included, regardless of source.",
"type": "string"
},
"requires": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#requires",
"description": "A mapping of module name to version. This is a list of everything this module requires, regardless of where it will be installed. The version should match, via normal matching rules, a dependency either in our `dependencies` or in a level higher than us.",
"type": "object",
"patternProperties": {
"^.+$": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#requires",
"type": "string",
"description": "The version range for the dependency."
}
}
},
"version": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#version-1",
"$ref": "#/properties/version",
"description": "This is a specifier that uniquely identifies this package and should be usable in fetching a new copy of it."
}
}
}
}
},
"name": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#name",
"$ref": "package.json#/properties/name",
"description": "The name of the package this is a lockfile for. This must match what's in `package.json`."
},
"lockfileVersion": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#lockfileversion",
"$ref": "#/definitions/lockfileVersion",
"const": 1
},
"packageIntegrity": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#packageintegrity",
"$ref": "#/definitions/integrity",
"description": "DEPRECATED. This is an SRI created from the `package.json`. No preprocessing of the `package.json` should be done."
},
"preserveSymlinks": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#preservesymlinks",
"type": "string",
"description": "DEPRECATED. Indicates that the install was done with the environment variable `NODE_PRESERVE_SYMLINKS` set to this value. The installer should insist that the value of this property match that environment variable."
},
"requires": {
"type": "boolean",
"default": true,
"description": "UNDOCUMENTED."
},
"version": {
"$comment": "https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json#version",
"$ref": "package.json#/properties/version",
"description": "The version of the package this is a lockfile for. This must match what's in `package.json`."
}
},
"required": ["name", "version", "lockfileVersion"]
}
Loading