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

[BUGFIX RELEASE] Fix generating from blueprints #6274

Merged
merged 6 commits into from
Jul 24, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ jobs:
env: TARGET_IE11=true
script: yarn test

# See https://github.com/emberjs/data/pull/6241
# - name: 'Node Tests'
# install: yarn install
# script: yarn test:node
- name: 'Node Tests'
install: yarn install
script: yarn test:node

# runs tests against each supported Ember version
- stage: ember version tests
Expand Down
7 changes: 3 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ jobs:
TARGET_IE11=true yarn test
displayName: 'Max transpilation Tests'

# See https://github.com/emberjs/data/pull/6241
# - script: |
# yarn test:node
# displayName: 'Node Tests'
- script: |
yarn test:node
displayName: 'Node Tests'

- script: |
yarn test:try-one with-ember-fetch
Expand Down
2 changes: 1 addition & 1 deletion packages/-build-infra/src/utilities/edition-detector.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path');
module.exports = function(blueprint) {
blueprint.filesPath = function() {
let rootPath = process.env.EMBER_VERSION === 'OCTANE' ? 'native-files' : 'files';
return path.join(this.path, rootPath);
return path.join(blueprint.root, rootPath);
};

return blueprint;
Expand Down
11 changes: 7 additions & 4 deletions packages/-build-infra/src/utilities/test-framework-detector.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,24 @@ module.exports = function(blueprint) {
let dependencies = this.project.dependencies();

if ('ember-qunit' in dependencies) {
if (fs.existsSync(this.path + '/qunit-rfc-232-files')) {
if (fs.existsSync(blueprint.root + '/qunit-rfc-232-files')) {
type = 'qunit-rfc-232';
} else {
type = 'qunit';
}
} else if ('ember-cli-qunit' in dependencies) {
let checker = new VersionChecker(this.project);
if (fs.existsSync(this.path + '/qunit-rfc-232-files') && checker.for('ember-cli-qunit', 'npm').gte('4.2.0')) {
if (
fs.existsSync(blueprint.root + '/qunit-rfc-232-files') &&
checker.for('ember-cli-qunit', 'npm').gte('4.2.0')
) {
type = 'qunit-rfc-232';
} else {
type = 'qunit';
}
} else if ('ember-mocha' in dependencies) {
let checker = new VersionChecker(this.project);
if (fs.existsSync(this.path + '/mocha-rfc-232-files') && checker.for('ember-mocha', 'npm').gte('0.14.0')) {
if (fs.existsSync(blueprint.root + '/mocha-rfc-232-files') && checker.for('ember-mocha', 'npm').gte('0.14.0')) {
type = 'mocha-rfc-232';
} else {
type = 'mocha';
Expand All @@ -41,7 +44,7 @@ module.exports = function(blueprint) {
type = 'qunit';
}

return path.join(this.path, type + '-files');
return path.join(blueprint.root, type + '-files');
};

return blueprint;
Expand Down
2 changes: 2 additions & 0 deletions packages/adapter/blueprints/adapter-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const path = require('path');
module.exports = useTestFrameworkDetector({
description: 'Generates an ember-data adapter unit test',

root: __dirname,

fileMapTokens(options) {
if (isModuleUnificationProject(this.project)) {
return {
Expand Down
2 changes: 2 additions & 0 deletions packages/adapter/blueprints/adapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module.exports = useEditionDetector({

availableOptions: [{ name: 'base-class', type: String }],

root: __dirname,

fileMapTokens(options) {
if (isModuleUnificationProject(this.project)) {
return {
Expand Down
2 changes: 2 additions & 0 deletions packages/model/blueprints/model-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const path = require('path');
module.exports = useTestFrameworkDetector({
description: 'Generates a model unit test.',

root: __dirname,

fileMapTokens(options) {
if (isModuleUnificationProject(this.project)) {
return {
Expand Down
2 changes: 2 additions & 0 deletions packages/model/blueprints/model/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ module.exports = useEditionDetector({

anonymousOptions: ['name', 'attr:type'],

root: __dirname,

fileMapTokens(options) {
if (isModuleUnificationProject(this.project)) {
return {
Expand Down
2 changes: 2 additions & 0 deletions packages/serializer/blueprints/serializer-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const path = require('path');
module.exports = useTestFrameworkDetector({
description: 'Generates a serializer unit test.',

root: __dirname,

fileMapTokens(options) {
if (isModuleUnificationProject(this.project)) {
return {
Expand Down
2 changes: 2 additions & 0 deletions packages/serializer/blueprints/serializer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module.exports = useEditionDetector({

availableOptions: [{ name: 'base-class', type: String }],

root: __dirname,

fileMapTokens(options) {
if (isModuleUnificationProject(this.project)) {
return {
Expand Down
2 changes: 2 additions & 0 deletions packages/serializer/blueprints/transform-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const path = require('path');
module.exports = useTestFrameworkDetector({
description: 'Generates a transform unit test.',

root: __dirname,

fileMapTokens(options) {
if (isModuleUnificationProject(this.project)) {
return {
Expand Down
2 changes: 2 additions & 0 deletions packages/serializer/blueprints/transform/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const useEditionDetector = require('@ember-data/-build-infra/src/utilities/editi
module.exports = useEditionDetector({
description: 'Generates an ember-data value transform.',

root: __dirname,

fileMapTokens(options) {
if (isModuleUnificationProject(this.project)) {
return {
Expand Down