@@ -2,10 +2,11 @@ import { makeTypesVersionsForPackageJson } from "@definitelytyped/header-parser"
22import assert = require( "assert" ) ;
33import { emptyDir , mkdir , mkdirp , readFileSync } from "fs-extra" ;
44import path = require( "path" ) ;
5+ import * as process from "process" ;
56import yargs = require( "yargs" ) ;
67
7- import { defaultLocalOptions } from "./lib/common" ;
8- import { outputDirPath , sourceBranch , cacheDirPath } from "./lib/settings" ;
8+ import { defaultLocalOptions , defaultRemoteOptions } from "./lib/common" ;
9+ import { outputDirPath , sourceBranch } from "./lib/settings" ;
910import {
1011 assertNever ,
1112 joinPaths ,
@@ -44,7 +45,7 @@ if (!module.parent) {
4445 const tgz = ! ! yargs . argv . tgz ;
4546 logUncaughtErrors ( async ( ) => {
4647 const log = loggerWithErrors ( ) [ 0 ] ;
47- const dt = await getDefinitelyTyped ( defaultLocalOptions , log ) ;
48+ const dt = await getDefinitelyTyped ( process . env . GITHUB_ACTIONS ? defaultRemoteOptions : defaultLocalOptions , log ) ;
4849 const allPackages = await AllPackages . read ( dt ) ;
4950 await generatePackages ( dt , allPackages , await readChangedPackages ( allPackages ) , tgz ) ;
5051 } ) ;
@@ -70,16 +71,12 @@ export default async function generatePackages(
7071 log ( ` * ${ pkg . desc } ` ) ;
7172 }
7273 log ( "## Generating deprecated packages" ) ;
73- await withNpmCache (
74- new UncachedNpmInfoClient ( ) ,
75- async ( client ) => {
76- for ( const pkg of changedPackages . changedNotNeededPackages ) {
77- log ( ` * ${ pkg . libraryName } ` ) ;
78- await generateNotNeededPackage ( pkg , client , log ) ;
79- }
80- } ,
81- cacheDirPath
82- ) ;
74+ await withNpmCache ( new UncachedNpmInfoClient ( ) , async ( client ) => {
75+ for ( const pkg of changedPackages . changedNotNeededPackages ) {
76+ log ( ` * ${ pkg . libraryName } ` ) ;
77+ await generateNotNeededPackage ( pkg , client , log ) ;
78+ }
79+ } ) ;
8380 await writeLog ( "package-generator.md" , logResult ( ) ) ;
8481}
8582async function generateTypingPackage (
0 commit comments