1- import { rename } from 'fs/promises' ;
21import { resolve , join } from 'path' ;
32import { CONTENTFUL_APP_MANIFEST , IGNORED_CLONED_FILES } from './constants' ;
43import tiged from 'tiged' ;
54import { highlight } from './logger' ;
65import { exists , mergeJsonIntoFile } from './utils/file' ;
76import { getAddBuildCommandFn } from './utils/package' ;
87
8+ // TODO: after appActions work we can change this getAddBuildCommandFn params from command -> defaultCommand as examples will have build commands
99const addBuildCommand = getAddBuildCommandFn ( {
1010 name : 'build:functions' ,
11- command : 'node build-functions.js ' ,
11+ command : 'contentful-app-scripts build-functions --ci ' ,
1212} ) ;
1313
1414const VALID_FUNCTION_TEMPLATES_DIRS = [
@@ -57,12 +57,6 @@ export async function cloneFunction(
5757 destination : `${ destination } /${ CONTENTFUL_APP_MANIFEST } ` ,
5858 } ) ;
5959
60- // move the build file from the actions folder to the root folder
61- const copyBuildFile = rename (
62- `${ functionDirectoryPath } /build-functions.js` ,
63- `${ destination } /build-functions.js`
64- ) ;
65-
6660 // modify package.json build commands
6761 const packageJsonLocation = resolve ( `${ destination } /package.json` ) ;
6862 const packageJsonExists = await exists ( packageJsonLocation ) ;
@@ -80,7 +74,7 @@ export async function cloneFunction(
8074 mergeFn : addBuildCommand ,
8175 } ) ;
8276
83- await Promise . all ( [ writeAppManifest , copyBuildFile , writeBuildCommand ] ) ;
77+ await Promise . all ( [ writeAppManifest , writeBuildCommand ] ) ;
8478
8579 await d . remove ( functionDirectoryPath , destination , {
8680 action : 'remove' ,
0 commit comments