Skip to content

Commit

Permalink
[BUGFIX beta] Update edition detection logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Sep 15, 2019
1 parent 88dcf5f commit 396ae0a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/-build-infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dependencies": {
"@babel/plugin-transform-block-scoping": "^7.6.0",
"@ember-data/canary-features": "3.14.0-alpha.3",
"@ember/edition-utils": "^1.1.1",
"babel-plugin-debug-macros": "^0.3.3",
"babel-plugin-feature-flags": "^0.3.1",
"babel-plugin-filter-imports": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/-build-infra/src/utilities/edition-detector.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';

const { has } = require('@ember/edition-utils');
const path = require('path');

module.exports = function(blueprint) {
blueprint.filesPath = function() {
let rootPath = process.env.EMBER_VERSION === 'OCTANE' ? 'native-files' : 'files';
let rootPath = has('octane') ? 'native-files' : 'files';
return path.join(blueprint.root, rootPath);
};

Expand Down
1 change: 1 addition & 0 deletions packages/-test-infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"scripts": {},
"dependencies": {
"@ember/edition-utils": "^1.1.1",
"ember-cli-blueprint-test-helpers": "^0.19.1"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const { setEdition, clearEdition } = require('@ember/edition-utils');

function enableOctane() {
beforeEach(function() {
process.env.EMBER_VERSION = 'OCTANE';
setEdition('octane');
});

afterEach(function() {
delete process.env.EMBER_VERSION;
clearEdition();
});
}

Expand Down
1 change: 1 addition & 0 deletions packages/adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"dependencies": {
"@ember-data/-build-infra": "3.14.0-alpha.3",
"@ember/edition-utils": "^1.1.1",
"ember-cli-babel": "^7.11.0",
"ember-cli-test-info": "^1.0.0",
"ember-cli-typescript": "^3.0.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/model/blueprints/model/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const inflection = require('inflection');
const stringUtils = require('ember-cli-string-utils');
const EOL = require('os').EOL;
const useEditionDetector = require('@ember-data/-build-infra/src/utilities/edition-detector');
const { has } = require('@ember/edition-utils');

module.exports = useEditionDetector({
description: 'Generates an ember-data model.',
Expand Down Expand Up @@ -65,7 +66,7 @@ module.exports = useEditionDetector({
if (attrs.length) {
let attrTransformer, attrSeparator;

let isOctane = process.env.EMBER_VERSION === 'OCTANE';
let isOctane = has('octane');
if (isOctane) {
attrTransformer = nativeAttr;
attrSeparator = ';';
Expand Down
1 change: 1 addition & 0 deletions packages/model/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@ember-data/-build-infra": "3.14.0-alpha.3",
"@ember-data/canary-features": "3.14.0-alpha.3",
"@ember-data/store": "3.14.0-alpha.3",
"@ember/edition-utils": "^1.1.1",
"ember-cli-babel": "^7.11.0",
"ember-cli-string-utils": "^1.1.0",
"ember-cli-test-info": "^1.0.0",
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,11 @@
exec-sh "^0.3.2"
minimist "^1.2.0"

"@ember/edition-utils@^1.1.1":
version "1.1.1"
resolved "https://registry.npmjs.org/@ember/edition-utils/-/edition-utils-1.1.1.tgz#d5732c3da593f202e6e1ac6dbee56a758242403f"
integrity sha512-GEhri78jdQp/xxPpM6z08KlB0wrHfnfrJ9dmQk7JeQ4XCiMzXsJci7yooQgg/IcTKCM/PxE/IkGCQAo80adMkw==

"@ember/optional-features@^0.7.0":
version "0.7.0"
resolved "https://registry.npmjs.org/@ember/optional-features/-/optional-features-0.7.0.tgz#f65a858007020ddfb8342f586112750c32abd2d9"
Expand Down Expand Up @@ -5793,7 +5798,7 @@ execa@^1.0.0:
signal-exit "^3.0.0"
strip-eof "^1.0.0"

execa@^2.0.0:
execa@^2.0.0, execa@^2.0.4:
version "2.0.4"
resolved "https://registry.npmjs.org/execa/-/execa-2.0.4.tgz#2f5cc589c81db316628627004ea4e37b93391d8e"
integrity sha512-VcQfhuGD51vQUQtKIq2fjGDLDbL6N1DTQVpYzxZ7LPIXw3HqTuIz6uxRmpV1qf8i31LHf2kjiaGI+GdHwRgbnQ==
Expand Down

0 comments on commit 396ae0a

Please sign in to comment.