@emarketeer/ts-microservice-commons 7.0.3 → 7.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3034,20 +3034,22 @@ var generateServerlessConfig = function () {
3034
3034
  var serviceConfig = YAML.parse(fs.readFileSync('./serverless.yml', 'utf8'));
3035
3035
  var commonConfig = YAML.parse(config);
3036
3036
  var generatedConfig = mergeWith(commonConfig, serviceConfig, mergeCustomizer);
3037
- fs.writeFileSync('./generated.serverless.yml', YAML.stringify(generatedConfig));
3037
+ fs.writeFileSync('./generated.serverless.json', JSON.stringify(generatedConfig, null, 2));
3038
3038
  };
3039
3039
  var cleanup = function () {
3040
- if (fs.existsSync('./generated.serverless.yml')) {
3041
- fs.unlinkSync('./generated.serverless.yml');
3040
+ if (fs.existsSync('./generated.serverless.json')) {
3041
+ fs.unlinkSync('./generated.serverless.json');
3042
3042
  }
3043
3043
  };
3044
+ var escapeShellArg = function (arg) {
3045
+ return "'" + arg.replace(/'/g, "'\\''") + "'";
3046
+ };
3044
3047
  var runCommand = function (command, additionalArgs) {
3045
3048
  if (additionalArgs === void 0) { additionalArgs = []; }
3046
- var commandParts = command.split(' ');
3047
- var program = commandParts[0];
3048
- var args = commandParts.slice(1).concat(additionalArgs);
3049
- console.log('running ', program, args.join(' '));
3050
- return crossSpawn.sync(program, args, { stdio: 'inherit' });
3049
+ var escapedArgs = additionalArgs.map(escapeShellArg).join(' ');
3050
+ var fullCommand = additionalArgs.length > 0 ? command + ' ' + escapedArgs : command;
3051
+ console.log('running ', fullCommand);
3052
+ return crossSpawn.sync(fullCommand, [], { stdio: 'inherit', shell: true });
3051
3053
  };
3052
3054
 
3053
3055
  process.on('unhandledRejection', function (err) {
@@ -3065,25 +3067,25 @@ try {
3065
3067
  }
3066
3068
  if (script === 'deploy') {
3067
3069
  generateServerlessConfig();
3068
- result = runCommand('npx cross-env AWS_SDK_LOAD_CONFIG=1 NODE_OPTIONS=--max_old_space_size=4096 npx serverless deploy --config generated.serverless.yml', scriptArgs);
3070
+ result = runCommand('npx cross-env AWS_SDK_LOAD_CONFIG=1 NODE_OPTIONS=--max_old_space_size=4096 npx serverless deploy --config generated.serverless.json', scriptArgs);
3069
3071
  }
3070
3072
  if (script === 'dev') {
3071
3073
  generateServerlessConfig();
3072
- result = runCommand('npx cross-env AWS_SDK_LOAD_CONFIG=1 NODE_OPTIONS=--max_old_space_size=4096 npx serverless dev --config generated.serverless.yml', scriptArgs);
3074
+ result = runCommand('npx cross-env AWS_SDK_LOAD_CONFIG=1 NODE_OPTIONS=--max_old_space_size=4096 npx serverless dev --config generated.serverless.json', scriptArgs);
3073
3075
  }
3074
3076
  if (script === 'invoke-local') {
3075
3077
  generateServerlessConfig();
3076
- result = runCommand('npx cross-env DISABLE_EPSAGON=TRUE NODE_OPTIONS=--max_old_space_size=4096 npx serverless invoke local --config generated.serverless.yml', scriptArgs);
3078
+ result = runCommand('npx cross-env DISABLE_EPSAGON=TRUE NODE_OPTIONS=--max_old_space_size=4096 npx serverless invoke local --config generated.serverless.json', scriptArgs);
3077
3079
  }
3078
3080
  if (script === 'tsc') {
3079
3081
  result = runCommand('npx tsc --noEmit', scriptArgs);
3080
3082
  }
3081
3083
  if (script === 'jest') {
3082
- result = runCommand('npx cross-env NODE_OPTIONS=--max_old_space_size=4096 jest -w 4 --ci --forceExit --config node_modules/@emarketeer/ts-microservice-commons/dist/lib/jest.config.js', scriptArgs);
3084
+ result = runCommand('npx cross-env NODE_OPTIONS="--max_old_space_size=4096 --experimental-vm-modules" jest -w 4 --ci --forceExit --config node_modules/@emarketeer/ts-microservice-commons/dist/lib/jest.config.js', scriptArgs);
3083
3085
  }
3084
3086
  if (!supportedCommands.includes(script)) {
3085
3087
  generateServerlessConfig();
3086
- result = runCommand('npx cross-env NODE_OPTIONS=--max_old_space_size=4096 npx serverless --config generated.serverless.yml', scriptArgs);
3088
+ result = runCommand('npx cross-env NODE_OPTIONS=--max_old_space_size=4096 npx serverless --config generated.serverless.json', scriptArgs);
3087
3089
  }
3088
3090
  }
3089
3091
  finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emarketeer/ts-microservice-commons",
3
- "version": "7.0.3",
3
+ "version": "7.0.5",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "bin": {