File tree Expand file tree Collapse file tree 4 files changed +9
-36
lines changed Expand file tree Collapse file tree 4 files changed +9
-36
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,13 @@ jobs:
3232 needs : build
3333 steps :
3434 - name : Checkout
35- uses : actions/checkout@v3.5.3
35+ uses : actions/checkout@v4
3636 with :
3737 fetch-depth : 0
3838 - name : Setup Node.js
39- uses : actions/setup-node@v3.7.0
39+ uses : actions/setup-node@v4
4040 with :
41- node-version : " 18 .x"
41+ node-version : " 22 .x"
4242 - name : Installing dependencies
4343 run : npm install
4444 - name : Download dist
Original file line number Diff line number Diff line change 11{
22 "name" : " @contentstack/cli-launch" ,
3- "version" : " 1.5.0 " ,
3+ "version" : " 1.5.1 " ,
44 "description" : " Launch related operations" ,
55 "author" : " Contentstack CLI" ,
66 "bin" : {
3232 "chalk" : " ^4.1.2" ,
3333 "cross-fetch" : " ^3.1.8" ,
3434 "dotenv" : " ^16.4.7" ,
35- "esm" : " ^3.2.25" ,
3635 "express" : " ^4.21.1" ,
3736 "form-data" : " ^4.0.0" ,
3837 "graphql" : " ^16.9.0" ,
4544 "@oclif/test" : " ^4.1.3" ,
4645 "@types/adm-zip" : " ^0.5.7" ,
4746 "@types/chai" : " ^4.3.20" ,
48- "@types/esm" : " ^3.2.2" ,
4947 "@types/ini" : " ^1.3.34" ,
5048 "@types/lodash" : " ^4.17.13" ,
5149 "@types/mocha" : " ^10.0.10" ,
Original file line number Diff line number Diff line change 11import dotenv from 'dotenv' ;
2- import esm from 'esm' ;
32import express , {
43 Request ,
54 Response ,
@@ -70,13 +69,11 @@ export class CloudFunctions {
7069 cloudFunctionResources : CloudFunctionResource [ ] ,
7170 app : Express
7271 ) : Promise < void > {
73- const loadAsESM = esm ( module ) ;
74-
7572 await Promise . all (
7673 cloudFunctionResources . map ( async ( cloudFunctionResource ) => {
77- const handler = loadAsESM (
74+ const handler = await import (
7875 `${ cloudFunctionResource . cloudFunctionFilePath } `
79- ) . default ;
76+ ) ;
8077 app . use ( express . json ( ) ) ;
8178 app . use ( express . urlencoded ( { extended : true } ) ) ;
8279
@@ -182,12 +179,11 @@ export class CloudFunctions {
182179
183180 private async checkDefaultExport ( filepath : string ) : Promise < boolean > {
184181 const exportType = "function" ;
185- const loadAsESM = esm ( module ) ;
186182 const fullPath = normalize ( path . resolve ( process . cwd ( ) , filepath ) ) . replace (
187183 / ^ ( \. \. ( \/ | \\ | $ ) ) + / ,
188184 ""
189185 ) ;
190- const handler = await loadAsESM ( fullPath ) ;
186+ const handler = await import ( fullPath ) ;
191187
192188 return typeof handler . default === exportType ;
193189 }
You can’t perform that action at this time.
0 commit comments