Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
build: remove bower support (#191)
Browse files Browse the repository at this point in the history
- refactor Gruntfile configuration
- remove unsused devDependencies (autoprefixer/complexity/connect/csslint/cssmin/jshint/less/...)

BREAKING CHANGE: bower support has been removed
  Before:
  ```sh
  $ bower install ovh-api-services
  ```

  After:
  ```sh
  $ yarn add ovh-api-services # or npm install ovh-api-services
  ```
  • Loading branch information
antleblanc authored Jul 5, 2019
1 parent c124f60 commit a718318
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 1,717 deletions.
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ node_modules
.tmp
.idea
npm-debug.log
bower_components
.work
.DS_Store
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.tmp
.idea
npm-debug.log
bower_components
.work
.eslintignore
.editorconfig
Expand Down
81 changes: 3 additions & 78 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module.exports = function (grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
bower: grunt.file.readJSON("bower.json"),
distdir: "dist",
srcdir: "src",
builddir: ".work/.tmp",
Expand Down Expand Up @@ -76,22 +75,6 @@ module.exports = function (grunt) {
target: ["src/**/!(*.spec|*.integration).js"]
},

// Check complexity
complexity: {
generic: {
src: [
"<%= srcdir %>/**/*.js",
"!<%= srcdir %>/**/*.spec.js"
],
options: {
errorsOnly: false,
cyclomatic: 12,
halstead: 45,
maintainability: 82
}
}
},

// Watch
delta: {
dist: {
Expand All @@ -109,10 +92,9 @@ module.exports = function (grunt) {
options: {
pushTo: "origin",
files: [
"package.json",
"bower.json"
"package.json"
],
updateConfigs: ["pkg", "bower"],
updateConfigs: ["pkg"],
commitFiles: ["-a"]
}
},
Expand All @@ -123,66 +105,9 @@ module.exports = function (grunt) {
configFile: "karma.conf.js",
singleRun: true
}
},

// Example
wiredep: {
example: {
src: "example/index.html",
overrides: {},
devDependencies: true,
exclude: ["angular-sanitize", "angular-mocks", "angular-scenario"]
}
},

injector: {
example: {
options: {
transform: function (filePath) {
return '<script src="' + filePath + '" type="text/javascript"></script>';
},
starttag: "<!-- injector:js -->",
endtag: "<!-- endinjector:js -->"
},
files: {
"example/index.html": [
"<%= distdir %>/<%= name %>.js",
"example/<%= name %>.example.js"
]
}
},
exampleCss: {
options: {
transform: function (filePath) {
return '<link rel="stylesheet" href="..' + filePath + '">';
},
starttag: "<!-- injector:css -->",
endtag: "<!-- endinjector:css -->"
},
files: {
"example/index.html": [
"<%= distdir %>/<%= name %>.css",
"bower_components/responsive-popover/dist/responsive-popover.css",
"bower_components/bootstrap/dist/css/bootstrap.css"
]
}
}
},

connect: {
options: {
port: 7711,
hostname: "*"
},
example: {
options: {
keepalive: true
}
}
}
});

grunt.registerTask("example", ["wiredep:example", "less:example", "autoprefixer:example", "injector:example", "injector:exampleCss", "connect:example"]);
});

grunt.registerTask("default", ["build"]);
grunt.task.renameTask("watch", "delta");
Expand Down
14 changes: 2 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
NODE=node
NPM=npm
GRUNT=grunt
BOWER=bower
GIT=git
CD=cd
ECHO=@echo
Expand All @@ -13,7 +12,6 @@ MV=mv
RSYNC=rsync -av --delete --exclude=".git"

#### FOLDERS ####
BOWER_DIR=bower_components
NODE_DIR=node_modules
GRUNT_DEP=$(NODE_DIR)/grunt

Expand All @@ -22,10 +20,6 @@ GRUNT_DEP=$(NODE_DIR)/grunt
VERSION=`grep -Po '(?<="version": ")[^"]*' package.json`

#### OTHER ####
ifneq ($(strip $(bower_registry)),)
BOWER_PARAM=--config.registry=$(bower_registry)
endif


help:
$(ECHO) "_____________________________"
Expand All @@ -43,19 +37,17 @@ help:

clean:
$(DEL) $(NODE_DIR)
$(DEL) $(BOWER_DIR)

install:
$(NPM) install
$(BOWER) install --allow-root $(BOWER_PARAM)

dev:
$(GRUNT) watch

test: $(GRUNT_DEP) $(BOWER_DIR)
test: $(GRUNT_DEP)
$(GRUNT) eslint

build: $(GRUNT_DEP) $(BOWER_DIR)
build: $(GRUNT_DEP)
$(GRUNT) build

version:
Expand All @@ -68,8 +60,6 @@ release: update-release build commit-release
# Sub tasks #
#############

$(BOWER_DIR): install

$(NODE_DIR)/%: install
# DO NOT DELETE - this comment is needed because make does not process this step
# if there's no task def; seems to be related to the % suffix.
Expand Down
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,8 @@

## Installation

### Download module with bower

```sh
$ bower install ovh-api-services --save
```

### Download module with NPM

```sh
$ npm install ovh-api-services --save
$ yarn add ovh-api-services
```

- Add Angular dependency "ovh-api-services"
Expand Down
35 changes: 0 additions & 35 deletions bower.json

This file was deleted.

10 changes: 0 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,14 @@
"eslint": "^4.1.1",
"eslint-config-ovh": "^0.1.1",
"grunt": "0.4.x",
"grunt-autoprefixer": "~2.2.0",
"grunt-bump": "~0.5.0",
"grunt-complexity": "~0.1.0",
"grunt-contrib-clean": "~0.6.0",
"grunt-contrib-concat": "~0.5.0",
"grunt-contrib-connect": "^0.10.1",
"grunt-contrib-copy": "~0.7.0",
"grunt-contrib-csslint": "~0.4.0",
"grunt-contrib-cssmin": "~0.12.2",
"grunt-contrib-jshint": "~0.11.0",
"grunt-contrib-less": "~1.0.0",
"grunt-contrib-uglify": "~0.8.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-eslint": "^20.0.0",
"grunt-injector": "^0.6.0",
"grunt-ng-annotate": "~0.10.0",
"grunt-wiredep": "^2.0.0",
"jasmine-core": "^2.6.4",
"matchdep": "^0.3.0"
},
"dependencies": {
Expand Down
Loading

0 comments on commit a718318

Please sign in to comment.