Permalink
Browse files

chore(deps): remove any mentions of bower. (#3640)

Ref #3199.
  • Loading branch information...
1 parent c011b04 commit d929adcc2a8652a3b6b68f992566c3cef0f7b0d3 @hansl hansl committed on GitHub Dec 20, 2016
View
@@ -1,4 +1,3 @@
-# /node_modules and /bower_components ignored by default
dist/
.git/
tmp/
@@ -6,7 +6,6 @@
# dependencies
/node_modules
-/bower_components
# IDEs and editors
/.idea
@@ -20,7 +20,6 @@ const InitCommand: any = Command.extend({
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'link-cli', type: Boolean, default: false, aliases: ['lc'] },
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
- { name: 'skip-bower', type: Boolean, default: true, aliases: ['sb'] },
{ name: 'name', type: String, default: '', aliases: ['n'] },
{ name: 'source-dir', type: String, default: 'src', aliases: ['sd'] },
{ name: 'style', type: String, default: 'css' },
@@ -36,7 +35,6 @@ const InitCommand: any = Command.extend({
run: function (commandOptions: any, rawArgs: string[]) {
if (commandOptions.dryRun) {
commandOptions.skipNpm = true;
- commandOptions.skipBower = true;
}
const installBlueprint = new this.tasks.InstallBlueprint({
@@ -73,15 +71,6 @@ const InitCommand: any = Command.extend({
});
}
- let bowerInstall: any;
- if (!commandOptions.skipBower) {
- bowerInstall = new this.tasks.BowerInstall({
- ui: this.ui,
- analytics: this.analytics,
- project: this.project
- });
- }
-
const project = this.project;
const packageName = commandOptions.name !== '.' && commandOptions.name || project.name();
@@ -138,13 +127,6 @@ const InitCommand: any = Command.extend({
if (commandOptions.linkCli) {
return linkCli.run();
}
- })
- .then(function () {
- if (!commandOptions.skipBower) {
- return bowerInstall.run({
- verbose: commandOptions.verbose
- });
- }
});
}
});
@@ -18,7 +18,6 @@ const NewCommand = Command.extend({
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'link-cli', type: Boolean, default: false, aliases: ['lc'] },
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
- { name: 'skip-bower', type: Boolean, default: true, aliases: ['sb'] },
{ name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] },
{ name: 'directory', type: String, aliases: ['dir'] },
{ name: 'source-dir', type: String, default: 'src', aliases: ['sd'] },
@@ -986,84 +986,6 @@ Blueprint.prototype.removePackagesFromProject = function(packages) {
});
};
-/**
- Used to add a package to the projects `bower.json`.
-
- Generally, this would be done from the `afterInstall` hook, to
- ensure that a package that is required by a given blueprint is
- available.
-
- `localPackageName` and `target` may be thought of as equivalent
- to the key-value pairs in the `dependency` or `devDepencency`
- objects contained within a bower.json file.
-
- Examples:
-
- addBowerPackageToProject('jquery', '~1.11.1');
- addBowerPackageToProject('old_jquery', 'jquery#~1.9.1');
- addBowerPackageToProject('bootstrap-3', 'http://twitter.github.io/bootstrap/assets/bootstrap');
-
- @method addBowerPackageToProject
- @param {String} localPackageName
- @param {String} target
- @param {Object} installOptions
- @return {Promise}
-*/
-Blueprint.prototype.addBowerPackageToProject = function(localPackageName, target, installOptions) {
- // var lpn = localPackageName;
- // var tar = target;
- // if (localPackageName.indexOf('#') >= 0) {
- // if (arguments.length === 1) {
- // var parts = localPackageName.split('#');
- // lpn = parts[0];
- // tar = parts[1];
- // this.ui.writeDeprecateLine('passing ' + localPackageName +
- // ' directly to `addBowerPackageToProject` will soon be unsupported. \n' +
- // 'You may want to replace this with ' +
- // '`addBowerPackageToProject(\'' + lpn + '\', \'' + tar + '\')`');
- // } else {
- // this.ui.writeDeprecateLine('passing ' + localPackageName +
- // ' directly to `addBowerPackageToProject` will soon be unsupported');
- // }
- // }
- // var packageObject = bowEpParser.json2decomposed(lpn, tar);
- // return this.addBowerPackagesToProject([packageObject], installOptions);
- return Promise.resolve();
-};
-
-/**
- Used to add an array of packages to the projects `bower.json`.
-
- Generally, this would be done from the `afterInstall` hook, to
- ensure that a package that is required by a given blueprint is
- available.
-
- Expects each array item to be an object with a `name`. Each object
- may optionally have a `target` to specify a specific version.
-
- @method addBowerPackagesToProject
- @param {Array} packages
- @param {Object} installOptions
- @return {Promise}
-*/
-Blueprint.prototype.addBowerPackagesToProject = function(packages, installOptions) {
- var task = this.taskFor('bower-install');
- var installText = (packages.length > 1) ? 'install bower packages' : 'install bower package';
- var packageNames = [];
- var packageNamesAndVersions = packages.map(function (pkg) {
- pkg.source = pkg.source || pkg.name;
- packageNames.push(pkg.name);
- return pkg;
- }).map(bowEpParser.compose);
-
- this._writeStatusToUI(chalk.green, installText, packageNames.join(', '));
-
- return task.run({
- verbose: true,
- packages: packageNamesAndVersions,
- installOptions: installOptions
- });
-};
/**
Used to retrieve a task with the given name. Passes the new task
@@ -13,12 +13,12 @@ function InstallationChecker(options) {
}
/**
-* Check if npm and bower installation directories are present,
+* Check if npm directories are present,
* and raise an error message with instructions on how to proceed.
*
* If some of these package managers aren't being used in the project
* we just ignore them. Their usage is considered by checking the
-* presence of your manifest files: package.json for npm and bower.json for bower.
+* presence of your manifest files: package.json for npm.
*/
InstallationChecker.prototype.checkInstallations = function() {
var commands = [];
@@ -27,10 +27,6 @@ InstallationChecker.prototype.checkInstallations = function() {
debug('npm dependencies not installed');
commands.push('`npm install`');
}
- if (this.usingBower() && this.bowerDependenciesNotPresent()) {
- debug('bower dependencies not installed');
- commands.push('`bower install`');
- }
if (commands.length) {
var commandText = commands.join(' and ');
throw new SilentError('No dependencies installed. Run ' + commandText + ' to install missing dependencies.');
@@ -50,18 +46,6 @@ function readJSON(path) {
}
}
-InstallationChecker.prototype.hasBowerDeps = function() {
- return hasDependencies(readJSON(path.join(this.project.root, 'bower.json')));
-};
-
-InstallationChecker.prototype.usingBower = function() {
- return existsSync(path.join(this.project.root, 'bower.json')) && this.hasBowerDeps();
-};
-
-InstallationChecker.prototype.bowerDependenciesNotPresent = function() {
- return !existsSync(this.project.bowerDirectory);
-};
-
InstallationChecker.prototype.hasNpmDeps = function() {
return hasDependencies(readJSON(path.join(this.project.root, 'package.json')));
};
@@ -41,7 +41,6 @@ function Project(root, pkg, ui, cli) {
this.addonPackages = {};
this.addons = [];
this.liveReloadFilterPatterns = [];
- this.setupBowerDirectory();
this.setupNodeModulesPath();
this.addonDiscovery = new AddonDiscovery(this.ui);
this.addonsFactory = new AddonsFactory(this, this);
@@ -52,46 +51,6 @@ function Project(root, pkg, ui, cli) {
};
}
-/**
- Set when the `Watcher.detectWatchman` helper method finishes running,
- so that other areas of the system can be aware that watchman is being used.
-
- For example, this information is used in the broccoli build pipeline to know
- if we can watch additional directories (like bower_components) "cheaply".
-
- Contains `enabled` and `version`.
-
- @private
- @property _watchmanInfo
- @returns {Object}
- @default false
-*/
-
-/**
- Sets the name of the bower directory for this project
-
- @private
- @method setupBowerDirectory
- */
-Project.prototype.setupBowerDirectory = function() {
- var bowerrcPath = path.join(this.root, '.bowerrc');
-
- debug('bowerrc path: %s', bowerrcPath);
-
- if (existsSync(bowerrcPath)) {
- var bowerrcContent = fs.readFileSync(bowerrcPath);
- try {
- this.bowerDirectory = JSON.parse(bowerrcContent).directory;
- } catch (exception) {
- debug('failed to parse bowerc: %s', exception);
- this.bowerDirectory = null;
- }
- }
-
- this.bowerDirectory = this.bowerDirectory || 'bower_components';
- debug('bowerDirectory: %s', this.bowerDirectory);
-};
-
Project.prototype.hasDependencies = function() {
return !!this.nodeModulesPath;
};
@@ -307,22 +266,6 @@ Project.prototype.dependencies = function(pkg, excludeDevDeps) {
};
/**
- Returns the bower dependencies for this project.
-
- @private
- @method bowerDependencies
- @param {String} bower Path to bower.json
- @return {Object} Bower dependencies
- */
-Project.prototype.bowerDependencies = function(bower) {
- if (!bower) {
- var bowerPath = path.join(this.root, 'bower.json');
- bower = (existsSync(bowerPath)) ? require(bowerPath) : {};
- }
- return assign({}, bower['devDependencies'], bower['dependencies']);
-};
-
-/**
Provides the list of paths to consult for addons that may be provided
internally to this project. Used for middleware addons with built-in support.
@@ -12,8 +12,8 @@ build_opts='--aot --base-href --environment --i18n-file --i18n-format --locale -
generate_opts='class component directive enum module pipe route service c cl d e m p r s --help'
github_pages_deploy_opts='--base-href --environment --gh-token --gh-username --message --skip-build --target --user-page -bh -e -t'
help_opts='--json --verbose -v'
-init_opts='--dry-run inline-style inline-template --link-cli --mobile --name --prefix --routing --skip-bower --skip-npm --source-dir --style --verbose -d -is -it -lc -n -p -sb -sd -sn -v'
-new_opts='--directory --dry-run inline-style inline-template --link-cli --mobile --prefix --routing --skip-bower --skip-git --skip-npm --source-dir --style --verbose -d -dir -is -it -lc -p -sb -sd -sg -sn -v'
+init_opts='--dry-run inline-style inline-template --link-cli --mobile --name --prefix --routing --skip-npm --source-dir --style --verbose -d -is -it -lc -n -p -sb -sd -sn -v'
+new_opts='--directory --dry-run inline-style inline-template --link-cli --mobile --prefix --routing --skip-git --skip-npm --source-dir --style --verbose -d -dir -is -it -lc -p -sb -sd -sg -sn -v'
serve_opts='--aot --environment --hmr --host --i18n-file --i18n-format --live-reload --live-reload-base-url --live-reload-host --live-reload-live-css --live-reload-port --locale --open --port --proxy-config --sourcemap --ssl --ssl-cert --ssl-key --target --watcher -H -e -lr -lrbu -lrh -lrp -o -p -pc -sm -t -w'
set_opts='--global -g'
test_opts='--browsers --build --code-coverage --colors --lint --log-level --port --reporters --single-run --sourcemap --watch -cc -l -sm -sr -w'
@@ -11,7 +11,7 @@ describe('Acceptance: ng destroy', function () {
return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
}).then(function () {
- return ng(['new', 'foo', '--skip-npm', '--skip-bower']);
+ return ng(['new', 'foo', '--skip-npm']);
});
});
@@ -16,7 +16,7 @@ describe('Acceptance: ng generate class', function () {
return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
}).then(function () {
- return ng(['new', 'foo', '--skip-npm', '--skip-bower']);
+ return ng(['new', 'foo', '--skip-npm']);
});
});
@@ -20,7 +20,7 @@ describe('Acceptance: ng generate component', function () {
return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
}).then(function () {
- return ng(['new', 'foo', '--skip-npm', '--skip-bower']);
+ return ng(['new', 'foo', '--skip-npm']);
});
});
@@ -19,7 +19,7 @@ describe('Acceptance: ng generate directive', function () {
return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
}).then(function () {
- return ng(['new', 'foo', '--skip-npm', '--skip-bower']);
+ return ng(['new', 'foo', '--skip-npm']);
});
});
@@ -15,7 +15,7 @@ describe('Acceptance: ng generate module', function () {
return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
}).then(function () {
- return ng(['new', 'foo', '--skip-npm', '--skip-bower']);
+ return ng(['new', 'foo', '--skip-npm']);
});
});
@@ -20,7 +20,7 @@ describe('Acceptance: ng generate pipe', function () {
return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
}).then(function () {
- return ng(['new', 'foo', '--skip-npm', '--skip-bower']);
+ return ng(['new', 'foo', '--skip-npm']);
});
});
@@ -21,7 +21,7 @@ xdescribe('Acceptance: ng generate route', function () {
return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
}).then(function () {
- return ng(['new', 'foo', '--skip-npm', '--skip-bower']);
+ return ng(['new', 'foo', '--skip-npm']);
});
});
@@ -19,7 +19,7 @@ describe('Acceptance: ng generate service', function () {
return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
}).then(function () {
- return ng(['new', 'foo', '--skip-npm', '--skip-bower']);
+ return ng(['new', 'foo', '--skip-npm']);
});
});
@@ -37,7 +37,7 @@ describe('Acceptance: ng github-pages:deploy', function() {
this.timeout(10000);
return tmp.setup('./tmp')
.then(() => process.chdir('./tmp'))
- .then(() => ng(['new', project, '--skip-npm', '--skip-bower']))
+ .then(() => ng(['new', project, '--skip-npm']))
.then(() => setupDist())
.finally(() => execStub = new ExecStub());
});
Oops, something went wrong.

0 comments on commit d929adc

Please sign in to comment.