Remove @schemastore/package

Providing our own type is trivial.
This commit is contained in:
Asher
2026-07-02 12:26:47 -08:00
parent 1e160477be
commit aed61bf6ab
3 changed files with 7 additions and 12 deletions

View File

@@ -1,9 +1,13 @@
import { logger } from "@coder/logger"
import type { JSONSchemaForNPMPackageJsonFiles } from "@schemastore/package"
import * as os from "os"
import * as path from "path"
export function getPackageJson(relativePath: string): JSONSchemaForNPMPackageJsonFiles {
type PackageJson = {
version: string
commit: string
}
export function getPackageJson(relativePath: string): PackageJson {
let pkg = {}
try {
pkg = require(relativePath)
@@ -11,7 +15,7 @@ export function getPackageJson(relativePath: string): JSONSchemaForNPMPackageJso
logger.warn(error.message)
}
return pkg
return pkg as PackageJson
}
export const rootPath = path.resolve(__dirname, "../..")