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

Fix how MU blueprints fetches ember-source #8432

Merged
merged 1 commit into from Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion blueprints/addon/index.js
Expand Up @@ -37,7 +37,7 @@ module.exports = {
updatePackageJson(content) {
let contents = JSON.parse(content);

contents.name = this.locals(this.options).addonName;
contents.name = stringUtil.dasherize(this.options.entity.name);
contents.description = this.description;
delete contents.private;
contents.scripts = contents.scripts || {};
Expand Down
14 changes: 5 additions & 9 deletions blueprints/module-unification-addon/index.js
Expand Up @@ -2,7 +2,6 @@
const addonBlueprint = require('../addon');
const getURLFor = require('ember-source-channel-url');

let emberCanaryVersion;
module.exports = Object.assign({}, addonBlueprint, {
description: 'Generates an Ember addon with a module unification layout.',
appBlueprintName: 'module-unification-app',
Expand All @@ -12,15 +11,12 @@ module.exports = Object.assign({}, addonBlueprint, {
'^addon-src/.gitkeep': 'src/.gitkeep',
}),

beforeInstall() {
return getURLFor('canary').then(url => {
emberCanaryVersion = url;
});
},

locals(options) {
let result = addonBlueprint.locals(options);
result.emberCanaryVersion = emberCanaryVersion;
return result;
return getURLFor('canary').then(url => {
let result = addonBlueprint.locals(options);
result.emberCanaryVersion = url;
return result;
});
},
});
13 changes: 3 additions & 10 deletions blueprints/module-unification-app/index.js
Expand Up @@ -3,8 +3,6 @@
const stringUtil = require('ember-cli-string-utils');
const getURLFor = require('ember-source-channel-url');

let emberCanaryVersion;

module.exports = {
description: 'Generates an Ember application with a module unification layout.',

Expand All @@ -16,21 +14,16 @@ module.exports = {
let name = stringUtil.dasherize(rawName);
let namespace = stringUtil.classify(rawName);

return {
return getURLFor('canary').then(url => ({
name,
modulePrefix: name,
namespace,
emberCLIVersion: require('../../package').version,
emberCanaryVersion,
emberCanaryVersion: url,
yarn: options.yarn,
welcome: options.welcome,
};
},
}));

beforeInstall() {
return getURLFor('canary').then(url => {
emberCanaryVersion = url;
});
},

fileMapTokens(options) {
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/addon-smoke-test-slow.js
Expand Up @@ -71,6 +71,8 @@ describe('Acceptance: addon-smoke-test', function() {
let packageJsonPath = path.join(addonRoot, 'package.json');
let packageJson = fs.readJsonSync(packageJsonPath);

expect(packageJson.devDependencies['ember-source']).to.not.be.empty;

packageJson.dependencies = packageJson.dependencies || {};
// add HTMLBars for templates (generators do this automatically when components/templates are added)
packageJson.dependencies['ember-cli-htmlbars'] = 'latest';
Expand Down