Skip to content

Commit

Permalink
[BUGFIX RELEASE] Fix generating from blueprints (#6274)
Browse files Browse the repository at this point in the history
* [BUGFIX RELEASE] Fix generating from blueprints

* Revert "skip node tests"

This reverts commit db5cac2.

* fix failing node tests

* fix prettier eslint

* blueprintPath -> root

* fix eslint prettier again
  • Loading branch information
Gaurav0 authored and runspired committed Jul 26, 2019
1 parent ee89849 commit 919eca3
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 13 deletions.
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 @@ -76,10 +76,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
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ 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') &&
fs.existsSync(blueprint.root + '/qunit-rfc-232-files') &&
checker.for('ember-cli-qunit', 'npm').gte('4.2.0')
) {
type = 'qunit-rfc-232';
Expand All @@ -33,7 +33,7 @@ module.exports = function(blueprint) {
} else if ('ember-mocha' in dependencies) {
let checker = new VersionChecker(this.project);
if (
fs.existsSync(this.path + '/mocha-rfc-232-files') &&
fs.existsSync(blueprint.root + '/mocha-rfc-232-files') &&
checker.for('ember-mocha', 'npm').gte('0.14.0')
) {
type = 'mocha-rfc-232';
Expand All @@ -47,7 +47,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

0 comments on commit 919eca3

Please sign in to comment.