mirror of
https://github.com/coder/code-server.git
synced 2026-07-03 07:32:25 +02:00
Remove @schemastore/package
Providing our own type is trivial.
This commit is contained in:
@@ -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, "../..")
|
||||
|
||||
Reference in New Issue
Block a user