Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# /node_modules and /bower_components ignored by default
dist/
.git/
tmp/
Expand Down
1 change: 0 additions & 1 deletion packages/angular-cli/blueprints/ng2/files/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

# dependencies
/node_modules
/bower_components

# IDEs and editors
/.idea
Expand Down
18 changes: 0 additions & 18 deletions packages/angular-cli/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand All @@ -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({
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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
});
}
});
}
});
Expand Down
1 change: 0 additions & 1 deletion packages/angular-cli/commands/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'] },
Expand Down
78 changes: 0 additions & 78 deletions packages/angular-cli/ember-cli/lib/models/blueprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 2 additions & 18 deletions packages/angular-cli/ember-cli/lib/models/installation-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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.');
Expand All @@ -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')));
};
Expand Down
57 changes: 0 additions & 57 deletions packages/angular-cli/ember-cli/lib/models/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
};
Expand Down Expand Up @@ -306,22 +265,6 @@ Project.prototype.dependencies = function(pkg, excludeDevDeps) {
return assign({}, devDependencies, pkg['dependencies']);
};

/**
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.
Expand Down
4 changes: 2 additions & 2 deletions packages/angular-cli/utilities/completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/destroy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/generate-class.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/generate-component.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/generate-directive.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/generate-module.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/generate-pipe.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/generate-route.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/generate-service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/github-pages-deploy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
Expand Down
Loading