From 2a06e7dc1895b78759522dda062d1897b016172d Mon Sep 17 00:00:00 2001 From: Bert De Block Date: Sat, 11 Jun 2022 12:07:27 +0200 Subject: [PATCH] Remove internal files in `blueprints-js` folder --- blueprints-js/-addon-import.js | 48 ------------------- blueprints-js/test-framework-detector.js | 60 ------------------------ 2 files changed, 108 deletions(-) delete mode 100644 blueprints-js/-addon-import.js delete mode 100644 blueprints-js/test-framework-detector.js diff --git a/blueprints-js/-addon-import.js b/blueprints-js/-addon-import.js deleted file mode 100644 index 27cf4f7f6fa..00000000000 --- a/blueprints-js/-addon-import.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -const stringUtil = require('ember-cli-string-utils'); -const path = require('path'); -const inflector = require('inflection'); - -module.exports = { - description: 'Generates an import wrapper.', - - fileMapTokens: function () { - return { - __name__: function (options) { - return options.dasherizedModuleName; - }, - __path__: function (options) { - return inflector.pluralize(options.locals.blueprintName); - }, - __root__: function (options) { - if (options.inRepoAddon) { - return path.join('lib', options.inRepoAddon, 'app'); - } - return 'app'; - }, - }; - }, - - locals: function (options) { - let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name(); - let addonName = stringUtil.dasherize(addonRawName); - let fileName = stringUtil.dasherize(options.entity.name); - let blueprintName = options.originBlueprintName; - let modulePathSegments = [ - addonName, - inflector.pluralize(options.originBlueprintName), - fileName, - ]; - - if (blueprintName.match(/-addon/)) { - blueprintName = blueprintName.substr(0, blueprintName.indexOf('-addon')); - modulePathSegments = [addonName, inflector.pluralize(blueprintName), fileName]; - } - - return { - modulePath: modulePathSegments.join('/'), - blueprintName: blueprintName, - }; - }, -}; diff --git a/blueprints-js/test-framework-detector.js b/blueprints-js/test-framework-detector.js deleted file mode 100644 index a294a911dfb..00000000000 --- a/blueprints-js/test-framework-detector.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const path = require('path'); -const VersionChecker = require('ember-cli-version-checker'); - -module.exports = function (blueprint) { - blueprint.supportsAddon = function () { - return false; - }; - - blueprint.filesPath = function () { - let type; - const qunitRfcVersion = 'qunit-rfc-232'; - const mochaRfcVersion = 'mocha-rfc-232'; - const mochaVersion = 'mocha-0.12'; - - let dependencies = this.project.dependencies(); - if ('ember-qunit' in dependencies) { - type = qunitRfcVersion; - } else if ('ember-cli-qunit' in dependencies) { - let checker = new VersionChecker(this.project); - if ( - fs.existsSync(`${this.path}/${qunitRfcVersion}-files`) && - checker.for('ember-cli-qunit', 'npm').gte('4.2.0') - ) { - type = qunitRfcVersion; - } else { - type = 'qunit'; - } - } else if ('ember-mocha' in dependencies) { - let checker = new VersionChecker(this.project); - if ( - fs.existsSync(`${this.path}/${mochaRfcVersion}-files`) && - checker.for('ember-mocha', 'npm').gte('0.14.0') - ) { - type = mochaRfcVersion; - } else { - type = mochaVersion; - } - } else if ('ember-cli-mocha' in dependencies) { - let checker = new VersionChecker(this.project); - if ( - fs.existsSync(`${this.path}/${mochaVersion}-files`) && - checker.for('ember-cli-mocha', 'npm').gte('0.12.0') - ) { - type = mochaVersion; - } else { - type = 'mocha'; - } - } else { - this.ui.writeLine("Couldn't determine test style - using QUnit"); - type = 'qunit'; - } - - return path.join(this.path, type + '-files'); - }; - - return blueprint; -};