Skip to content

Conversation

@paulincai
Copy link

…te syntax for new library versions.

@zodern
Copy link
Owner

zodern commented Oct 20, 2021

Thanks @paulincai. Did you check if config validation still works? I might need to update Meteor Up to support validation errors from the latest joi version.

@paulincai
Copy link
Author

Hi @zodern no detailed checks. I implemented the new syntax around Joi, built and used to deploy. I can confirm that deploys work. Ok, I will do some tests. Let's keep this open for now.

@paulincai
Copy link
Author

@zodern
Ok, I did a console log where validation occurs:
src/index.js

export const validate = {
  app(config, utils) {
    if (config.app?.type === 'aws-beanstalk') {
      console.log({ config, utils }, validator(config, utils));    // HERE

      return validator(config, utils);
    }

    return [];
  }
};

The result:

{
  config: {
    app: {
      type: 'aws-beanstalk',
      name: 'web-users',
      path: '../',
      region: 'eu-central-1',
      forceSSL: true,
      env: [Object],
      auth: [Object],
      customBeanstalkConfig: [Array],
      minInstances: 1,
      maxInstances: 1,
      oldVersions: 3,
      buildOptions: [Object],
      instanceType: 't2.micro'
    },
    plugins: [ '@activitree/mup-aws-beanstalk' ],
    _origionalConfig: { app: [Object], plugins: [Array] }
  },
  utils: {
    improveErrors: [Function: improveErrors],
    addLocation: [Function: addLocation],
    combineErrorDetails: [Function: combineErrorDetails],
    serversExist: [Function: serversExist],
    addDepreciation: [Function: addDepreciation],
    VALIDATE_OPTIONS: { abortEarly: false, convert: false, noDefaults: true }
  }
} []

The last array in the result above is the validation result ( validator(config, utils) ).
Will update the code now as I also did a eslint --fix and there are small changes here and there (for instance default exports for a couple of functions and a function was missing a name)

…n. Tested for validity of validation result.
@paulincai
Copy link
Author

Ok, I don't really like brackets for single parameter fat arrow functions ((app) => something) but this is how the linter is set so will go with it. @zodern I thing the pull request contains now the updates. I am here in case you would like me do add or change something.

@zodern
Copy link
Owner

zodern commented Oct 20, 2021

@paulincai do you know what the new minimum node version supported by the updated dependencies are? The docs still say mup-aws-beanstalk works with Node 4, so we will probably need to update that.

@paulincai
Copy link
Author

I could look at those 1 by 1. There is another option I think of.
Make 0.7.0 recommended for Node14+ and 0.6.x for everything else. I think 0.7.0 started mainly to answer to Amazon Linux 2 machines (Node14).
This is development side of tech and if one cannot run 0.7.0 in a Node10 can just install 0.6.x and give it another try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants