@@ -2,6 +2,7 @@ import { askInstallDependencies } from "./npm-dependencies";
2
2
import { confirm } from "../../../prompt" ;
3
3
import { configForCodebase } from "../../../functions/projectConfig" ;
4
4
import { readTemplateSync } from "../../../templates" ;
5
+ import * as supported from "../../../deploy/functions/runtimes/supported" ;
5
6
6
7
const PACKAGE_LINTING_TEMPLATE = readTemplateSync ( "init/functions/typescript/package.lint.json" ) ;
7
8
const PACKAGE_NO_LINTING_TEMPLATE = readTemplateSync (
@@ -28,7 +29,10 @@ export async function setup(setup: any, config: any): Promise<any> {
28
29
cbconfig . predeploy . push ( 'npm --prefix "$RESOURCE_DIR" run build' ) ;
29
30
await config . askWriteProjectFile (
30
31
`${ setup . functions . source } /package.json` ,
31
- PACKAGE_LINTING_TEMPLATE ,
32
+ PACKAGE_LINTING_TEMPLATE . replace (
33
+ "{{RUNTIME}}" ,
34
+ supported . latest ( "nodejs" ) . replace ( "nodejs" , "" ) ,
35
+ ) ,
32
36
) ;
33
37
await config . askWriteProjectFile ( `${ setup . functions . source } /.eslintrc.js` , ESLINT_TEMPLATE ) ;
34
38
// TODO: isn't this file out of date now?
@@ -40,7 +44,10 @@ export async function setup(setup: any, config: any): Promise<any> {
40
44
cbconfig . predeploy . push ( 'npm --prefix "$RESOURCE_DIR" run build' ) ;
41
45
await config . askWriteProjectFile (
42
46
`${ setup . functions . source } /package.json` ,
43
- PACKAGE_NO_LINTING_TEMPLATE ,
47
+ PACKAGE_NO_LINTING_TEMPLATE . replace (
48
+ "{{RUNTIME}}" ,
49
+ supported . latest ( "nodejs" ) . replace ( "nodejs" , "" ) ,
50
+ ) ,
44
51
) ;
45
52
}
46
53
0 commit comments