Skip to content

Commit 82072f6

Browse files
committed
Clean up compat shims in the build for old CLI
1 parent 39e0312 commit 82072f6

File tree

4 files changed

+2
-28
lines changed

4 files changed

+2
-28
lines changed

packages/ember-css-modules/index.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
const path = require('path');
44
const fs = require('fs');
55
const debug = require('debug')('ember-css-modules:addon');
6-
const VersionChecker = require('ember-cli-version-checker');
76

87
const HtmlbarsPlugin = require('./lib/htmlbars-plugin');
98
const ModulesPreprocessor = require('./lib/modules-preprocessor');
@@ -19,7 +18,6 @@ module.exports = {
1918
this.outputStylesPreprocessor = new OutputStylesPreprocessor({
2019
owner: this,
2120
});
22-
this.checker = new VersionChecker(this.project);
2321
this.plugins = new PluginRegistry(this.parent);
2422
},
2523

@@ -166,15 +164,6 @@ module.exports = {
166164
return this.cssModulesOptions.postcssOptions;
167165
},
168166

169-
getAddonModulesRoot() {
170-
// CLI 2.12 stopped exposing addon stuff nested under `modules/`
171-
if (this.checker.for('ember-cli', 'npm').satisfies('< 2.12')) {
172-
return 'modules/';
173-
} else {
174-
return '';
175-
}
176-
},
177-
178167
getParentAddonTree() {
179168
return path.join(this.parentAddon.root, this.parentAddon.treePaths.addon);
180169
},

packages/ember-css-modules/lib/modules-preprocessor.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ module.exports = class ModulesPreprocessor {
5050
let inputRoot = this.owner.belongsToAddon()
5151
? this.owner.getParentAddonTree()
5252
: this.owner.app.trees.app;
53-
let outputRoot = this.owner.belongsToAddon()
54-
? this.owner.getAddonModulesRoot()
55-
: '';
56-
57-
if (outputRoot) {
58-
inputRoot = new Funnel(inputRoot, {
59-
destDir: outputRoot,
60-
});
61-
}
6253

6354
// If moduleName is defined, that should override the parent's name.
6455
// Otherwise, the template and generated module will disagree as to what the path should be.
@@ -71,17 +62,14 @@ module.exports = class ModulesPreprocessor {
7162

7263
let modulesSources = new ModuleSourceFunnel(inputRoot, modulesInput, {
7364
include: ['**/*.' + this.owner.getFileExtension()],
74-
outputRoot,
7565
parentName: ownerName,
7666
});
7767

7868
let modulesTree = new (require('broccoli-css-modules'))(modulesSources, {
7969
extension: this.owner.getFileExtension(),
8070
plugins: this.getPostcssPlugins(),
8171
enableSourceMaps: this.owner.enableSourceMaps(),
82-
sourceMapBaseDir: this.owner.belongsToAddon()
83-
? this.owner.getAddonModulesRoot()
84-
: '',
72+
sourceMapBaseDir: '',
8573
postcssOptions: this.owner.getPostcssOptions(),
8674
virtualModules: this.owner.getVirtualModules(),
8775
generateScopedName: this.scopedNameGenerator(),
@@ -217,7 +205,6 @@ module.exports = class ModulesPreprocessor {
217205
defaultExtension: this.owner.getFileExtension(),
218206
ownerName: this._ownerName,
219207
parentName: this._parentName,
220-
addonModulesRoot: this.owner.getAddonModulesRoot(),
221208
root: ensurePosixPath(this._modulesTree.inputPaths[0]),
222209
parent: this.owner.getParent(),
223210
ui: this.owner.ui,
@@ -236,7 +223,6 @@ class ModuleSourceFunnel extends Funnel {
236223
constructor(input, stylesTree, options) {
237224
super([input, stylesTree], options);
238225
this.parentName = options.parentName;
239-
this.destDir = options.outputRoot;
240226
this.inputHasParentName = null;
241227
}
242228

packages/ember-css-modules/lib/resolve-path.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function resolveExternalPath(importPath, originalPath, fromFile, options) {
103103
let absolutePath = ensurePosixPath(
104104
path.resolve(addonTreePath, pathWithinAddon)
105105
);
106-
let keyPath = options.addonModulesRoot + addonName + '/' + pathWithinAddon;
106+
let keyPath = addonName + '/' + pathWithinAddon;
107107
return new DependencyPath('external', absolutePath, keyPath);
108108
}
109109

packages/ember-css-modules/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
"debug": "^4.3.2",
8282
"ember-cli-babel": "^7.26.6",
8383
"ember-cli-htmlbars": "^6.0.0",
84-
"ember-cli-version-checker": "^5.1.2",
8584
"ensure-posix-path": "^1.0.2",
8685
"hash-string": "^1.0.0",
8786
"lodash.merge": "^4.6.1",

0 commit comments

Comments
 (0)