From 395ec7bdc61482ee7d031354ce0b5e389f9bc309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Cant=C3=BA=20G=C3=B3mez?= Date: Fri, 22 Feb 2019 11:01:58 -0600 Subject: [PATCH] module-unification bluerpint (#1064) * use fileMapTokens, add module-unification file, scss blueprint and update resolver * exclude blueprints/module-unification.js from eslint * add eslintrc.js config to blueprints * remove blueprints/module-unification from excluded --- blueprints/.eslintrc.js | 12 +++++++++++ .../files/{app => __path__}/styles/app.scss | 0 blueprints/ember-paper/index.js | 20 ++++++++++++++++++- blueprints/module-unification.js | 8 ++++++++ package.json | 2 +- 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 blueprints/.eslintrc.js rename blueprints/ember-paper/files/{app => __path__}/styles/app.scss (100%) create mode 100644 blueprints/module-unification.js diff --git a/blueprints/.eslintrc.js b/blueprints/.eslintrc.js new file mode 100644 index 000000000..7b88fc4a1 --- /dev/null +++ b/blueprints/.eslintrc.js @@ -0,0 +1,12 @@ +module.exports = { + root: true, + parserOptions: { + ecmaVersion: 6 + }, + extends: [ + 'eslint:recommended' + ], + env: { + node: true + } +}; diff --git a/blueprints/ember-paper/files/app/styles/app.scss b/blueprints/ember-paper/files/__path__/styles/app.scss similarity index 100% rename from blueprints/ember-paper/files/app/styles/app.scss rename to blueprints/ember-paper/files/__path__/styles/app.scss diff --git a/blueprints/ember-paper/index.js b/blueprints/ember-paper/index.js index 7e43f42da..e56bc647c 100644 --- a/blueprints/ember-paper/index.js +++ b/blueprints/ember-paper/index.js @@ -1,5 +1,7 @@ 'use strict'; +const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject; + module.exports = { description: 'Installs ember-cli-sass', @@ -9,7 +11,23 @@ module.exports = { // to us }, + fileMapTokens() { + if (isModuleUnificationProject(this.project)) { + return { + __path__() { + return 'src/ui'; + } + }; + } else { + return { + __path__() { + return 'app'; + } + }; + } + }, + afterInstall() { return this.addAddonToProject('ember-cli-sass', '^7.2.0'); } -}; +}; \ No newline at end of file diff --git a/blueprints/module-unification.js b/blueprints/module-unification.js new file mode 100644 index 000000000..69eb13791 --- /dev/null +++ b/blueprints/module-unification.js @@ -0,0 +1,8 @@ + +'use strict'; + +module.exports = { + isModuleUnificationProject(project) { + return project && project.isModuleUnification && project.isModuleUnification(); + } +}; \ No newline at end of file diff --git a/package.json b/package.json index ee3eda624..c76ac2183 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "matchmedia-polyfill": "^0.3.1", "polyfill-nodelist-foreach": "^1.0.1", "propagating-hammerjs": "^1.4.6", - "resolve": "^1.3.3", + "resolve": "^1.5.0", "tinycolor2": "^1.4.1", "virtual-each": "~0.6.0" },