File tree Expand file tree Collapse file tree
extensions/ql-vscode/gulpfile.ts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99} from "fs-extra" ;
1010import { resolve , join } from "path" ;
1111import { isDevBuild } from "./dev" ;
12+ import type * as packageJsonType from "../package.json" ;
1213
1314export interface DeployedPackage {
1415 distPath : string ;
@@ -46,31 +47,13 @@ async function copyPackage(
4647 ) ;
4748}
4849
49- interface packageJson {
50- name : string ;
51- version : string ;
52- }
53-
54- async function readPackageJson ( packageJsonPath : string ) : Promise < packageJson > {
55- const packageJson : packageJson = JSON . parse (
56- await readFile ( packageJsonPath , "utf8" ) ,
57- ) ;
58-
59- if ( ! packageJson . name ) {
60- throw new Error ( `${ packageJsonPath } is missing the 'name' field` ) ;
61- }
62- if ( ! packageJson . version ) {
63- throw new Error ( `${ packageJsonPath } is missing the 'version' field` ) ;
64- }
65-
66- return packageJson ;
67- }
68-
6950export async function deployPackage (
7051 packageJsonPath : string ,
7152) : Promise < DeployedPackage > {
7253 try {
73- const packageJson = await readPackageJson ( packageJsonPath ) ;
54+ const packageJson : typeof packageJsonType = JSON . parse (
55+ await readFile ( packageJsonPath , "utf8" ) ,
56+ ) ;
7457
7558 const distDir = join ( __dirname , "../../../dist" ) ;
7659 await mkdirs ( distDir ) ;
Original file line number Diff line number Diff line change 22 "$schema" : " https://json.schemastore.org/tsconfig" ,
33 "extends" : " ../tsconfig.json" ,
44 "compilerOptions" : {
5- "rootDir" : " ."
5+ "rootDir" : " .. "
66 },
77 "include" : [" *.ts" ]
88}
You can’t perform that action at this time.
0 commit comments