Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: support promises in dependencies... #172

Closed
rwjblue opened this issue Jan 13, 2018 · 1 comment
Closed

Feature Request: support promises in dependencies... #172

rwjblue opened this issue Jan 13, 2018 · 1 comment

Comments

@rwjblue
Copy link
Member

rwjblue commented Jan 13, 2018

In order to support using ember-source from canary, beta, release channels we will need to fetch the correct tarball location to use.

A rough sketch of that API which we have been kicking around is something like this:

const getChannelURL = require('ember-source-channel-url');

module.exports = {
  scenarios: [
    {
      name: 'ember-release',
      npm: {
        devDependencies: {
          'ember-source': getChannelURL('release')
        }
      }
    },
    {
      name: 'ember-beta',
      npm: {
        devDependencies: {
          'ember-source': getChannelURL('beta')
        }
      }
    },
    {
      name: 'ember-canary',
      npm: {
        devDependencies: {
          'ember-source': getChannelURL('canary')
        }
      }
    }
  ]
};

The ember-source-channel-url package is very very simple package which fetches the latest canary tarball asset path, and returns it. Due to it having to fetch data from S3, the package must return a promise.


Feature Request

Update ember-try's internals to resolve promises as values in the scenario configuration...

@rwjblue
Copy link
Member Author

rwjblue commented Jan 13, 2018

Hmm, based on some perusing of the lib/utils/config.js it seems like this may already be essentially possible today. The main change would be to something like:

module.exports = function() {

  return Promise.all([
    getChannelURL('release'),
    getChannelURL('beta'),
    getChannelURL('canary')
  ]).then(releases => {
    return {
      scenarios: [
      {
        name: 'ember-release',
        npm: {
          devDependencies: {
            'ember-source': releases[0]
          }
        }
      },
      {
        name: 'ember-beta',
        npm: {
          devDependencies: {
            'ember-source': releases[1]
          }
        }
      },
      {
        name: 'ember-canary',
        npm: {
          devDependencies: {
            'ember-source': releases[2]
          }
        }
      }
    ]
  };
};

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

No branches or pull requests

1 participant