Skip to content

Commit

Permalink
feat(cookie-law module): compile and bundle the module under the lib …
Browse files Browse the repository at this point in the history
…folder
  • Loading branch information
andreasonny83 committed Feb 11, 2017
1 parent fc0a3ba commit 8af0b0e
Show file tree
Hide file tree
Showing 17 changed files with 861 additions and 331 deletions.
14 changes: 10 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# common
node_modules
config
coverage
demo
*.log
.DS_Store
.nyc_output
.test
.tmp

.coveralls.yml
.editorconfig
.travis.yml
appveyor.yml
# source/config
src
karma.conf.js
rollup.config.js
*.yml
.gitignore
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ script:
- npm run lint
- npm run test:headless
- npm run coveralls
- npm run build
- npm run build_prod

after_success:
- npm run semantic-release
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ angular2-cookie-law is an HTML `<cookie-law>` tag enhanced with styling and anim

```bash
# To get the latest stable version and update package.json file:
npm install angular2-cookie-law --save
$ npm install angular2-cookie-law --save
```

or `yarn` with:

```bash
yarn add angular2-cookie-law
$ yarn add angular2-cookie-law
```

## Setup
Expand Down Expand Up @@ -140,18 +140,19 @@ available in this repository for a real Angular2 application using the `Angular2
From your terminal, navigate inside the `demo` folder, then install all the Node dependencies using npm:

```bash
npm install
$ cd demo
$ npm install
```
Or Yarn with:

```bash
yarn install
$ yarn install
```

Then initialize the application with:

```bash
npm start
$ npm start
```

Open your browser to [http://localhost:9008/](http://localhost:9008/)
Expand Down
17 changes: 1 addition & 16 deletions config/webpack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,6 @@
debug: true,
options: {}
})
],

/**
* Include polyfills or mocks for various node stuff
* Description: Node configuration
*
* See: https://webpack.github.io/docs/configuration.html#node
*/
node: {
global: true,
process: false,
crypto: 'empty',
module: false,
clearImmediate: false,
setImmediate: false
}
]
};
}
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@angular/core": "2.4.1",
"@angular/platform-browser": "2.4.1",
"@angular/platform-browser-dynamic": "2.4.1",
"angular2-cookie-law": "^0.1.7",
"angular2-cookie-law": "file:../",
"core-js": "2.4.1",
"rxjs": "5.0.2",
"zone.js": "0.7.4"
Expand Down
7 changes: 6 additions & 1 deletion demo/src/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ import { Component } from '@angular/core';
</a>
</div>
<cookie-law>allo</cookie-law>
<cookie-law>
Allo! This is my awesome cookie-law message.
<a href="https://github.com/andreasonny83/angular2-cookie-law">
Click here for more info
</a>
</cookie-law>
`,
styles: [`
a.link {
Expand Down
54 changes: 24 additions & 30 deletions demo/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ acorn-dynamic-import@^2.0.0:
acorn "^4.0.3"

acorn@^4.0.3, acorn@^4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a"
version "4.0.11"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0"

ajv-keywords@^1.1.1:
version "1.5.1"
Expand All @@ -78,9 +78,8 @@ align-text@^0.1.1, align-text@^0.1.3:
longest "^1.0.1"
repeat-string "^1.5.2"

angular2-cookie-law@^0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/angular2-cookie-law/-/angular2-cookie-law-0.1.7.tgz#f07dfbbc86d50de89e43f6e30b1e3a55cbeefaa5"
"angular2-cookie-law@file:../":
version "0.0.0-development"

[email protected]:
version "0.6.0"
Expand All @@ -104,8 +103,8 @@ anymatch@^1.3.0:
micromatch "^2.1.5"

aproba@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.0.4.tgz#2713680775e7614c8ba186c065d4e2e52d1072c0"
version "1.1.1"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab"

are-we-there-yet@~1.1.2:
version "1.1.2"
Expand Down Expand Up @@ -200,8 +199,8 @@ aws-sign2@~0.6.0:
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f"

aws4@^1.2.1:
version "1.5.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755"
version "1.6.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e"

balanced-match@^0.4.1:
version "0.4.2"
Expand All @@ -216,8 +215,8 @@ [email protected]:
resolved "https://registry.yarnpkg.com/batch/-/batch-0.5.3.tgz#3f3414f380321743bfc1042f9a83ff1d5824d464"

bcrypt-pbkdf@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.0.tgz#3ca76b85241c7170bf7d9703e7b9aa74630040d4"
version "1.0.1"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d"
dependencies:
tweetnacl "^0.14.3"

Expand Down Expand Up @@ -261,8 +260,8 @@ braces@^1.8.2:
repeat-element "^1.1.2"

brorand@^1.0.1:
version "1.0.6"
resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.0.6.tgz#4028706b915f91f7b349a2e0bf3c376039d216e5"
version "1.0.7"
resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.0.7.tgz#6677fa5e4901bdbf9c9ec2a748e28dca407a9bfc"

browserify-aes@^1.0.0, browserify-aes@^1.0.4:
version "1.0.6"
Expand Down Expand Up @@ -610,8 +609,8 @@ [email protected]:
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"

elliptic@^6.0.0:
version "6.3.2"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.2.tgz#e4c81e0829cf0a65ab70e998b8232723b5c1bc48"
version "6.3.3"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.3.tgz#5482d9646d54bcb89fd7d994fc9e2e9568876e3f"
dependencies:
bn.js "^4.4.0"
brorand "^1.0.1"
Expand All @@ -636,8 +635,8 @@ enhanced-resolve@^2.3.0:
tapable "^0.2.3"

enhanced-resolve@^3.0.0:
version "3.0.3"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.0.3.tgz#df14c06b5fc5eecade1094c9c5a12b4b3edc0b62"
version "3.1.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.1.0.tgz#9f4b626f577245edcf4b2ad83d86e17f4f421dec"
dependencies:
graceful-fs "^4.1.2"
memory-fs "^0.4.0"
Expand Down Expand Up @@ -847,8 +846,8 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10:
rimraf "2"

gauge@~2.7.1:
version "2.7.2"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.2.tgz#15cecc31b02d05345a5d6b0e171cdb3ad2307774"
version "2.7.3"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09"
dependencies:
aproba "^1.0.3"
console-control-strings "^1.0.0"
Expand All @@ -857,7 +856,6 @@ gauge@~2.7.1:
signal-exit "^3.0.0"
string-width "^1.0.1"
strip-ansi "^3.0.1"
supports-color "^0.2.0"
wide-align "^1.1.0"

generate-function@^2.0.0:
Expand Down Expand Up @@ -959,8 +957,8 @@ [email protected]:
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"

hosted-git-info@^2.1.4:
version "2.1.5"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b"
version "2.2.0"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.2.0.tgz#7a0d097863d886c0fabbdcd37bf1758d8becf8a5"

hpack.js@^2.1.6:
version "2.1.6"
Expand Down Expand Up @@ -1392,8 +1390,8 @@ node-libs-browser@^2.0.0:
vm-browserify "0.0.4"

node-pre-gyp@^0.6.29:
version "0.6.32"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.32.tgz#fc452b376e7319b3d255f5f34853ef6fd8fe1fd5"
version "0.6.33"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz#640ac55198f6a925972e0c16c4ac26a034d5ecc9"
dependencies:
mkdirp "~0.5.1"
nopt "~3.0.6"
Expand Down Expand Up @@ -2006,10 +2004,6 @@ strip-json-comments@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91"

supports-color@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a"

supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
Expand Down Expand Up @@ -2194,8 +2188,8 @@ wbuf@^1.1.0, wbuf@^1.4.0:
minimalistic-assert "^1.0.0"

webpack-dev-middleware@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.9.0.tgz#a1c67a3dfd8a5c5d62740aa0babe61758b4c84aa"
version "1.10.0"
resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.10.0.tgz#7d5be2651e692fddfafd8aaed177c16ff51f0eb8"
dependencies:
memory-fs "~0.4.1"
mime "^1.3.4"
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './src/cookie-law.module';
export * from './lib/cookie-law.module';
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require("./src/cookie-law.module"));
__export(require("./lib/cookie-law.module"));
33 changes: 20 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
"description": "Angular2 component that provides a banner to inform users about cookie law",
"main": "index.js",
"scripts": {
"prebuild": "rm -rf lib",
"build": "rollup -c -f umd -o lib/angular2-cookie-law.umd.js",
"build": "tsc -p tsconfig-tsc.json",
"build_prod": "npm run clean && npm run inline && npm run ngc && npm run build && npm run rollup",
"clean": "rm -rf lib && mkdir lib",
"commit": "git-cz",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls",
"inline": "ng2-inline -o lib -f -b src src/**/*.ts",
"lint": "tslint -c tslint.json src/**/*.ts",
"ngc": "ngc -p tsconfig-ngc.json",
"precommit": "npm run lint && npm run test:headless",
"rollup": "rollup -c",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"test:headless": "karma start --browsers PhantomJS",
"test": "karma start"
Expand All @@ -35,6 +39,7 @@
"devDependencies": {
"@angular/common": "2.4.1",
"@angular/compiler": "2.4.1",
"@angular/compiler-cli": "2.4.1",
"@angular/core": "2.4.1",
"@angular/platform-browser": "2.4.1",
"@angular/platform-browser-dynamic": "2.4.1",
Expand All @@ -43,37 +48,39 @@
"@types/selenium-webdriver": "2.53.33",
"@types/source-map": "0.1.27",
"@types/webpack": "1.12.34",
"angular2-inline-template-style": "1.0.0",
"angular2-template-loader": "0.6.0",
"awesome-typescript-loader": "2.2.4",
"codelyzer": "2.0.0-beta.4",
"codelyzer": "2.0.0",
"commitizen": "2.9.5",
"core-js": "2.4.1",
"coveralls": "2.11.15",
"cz-conventional-changelog": "1.2.0",
"husky": "0.13.1",
"istanbul-instrumenter-loader": "1.2.0",
"istanbul-instrumenter-loader": "2.0.0",
"jasmine-core": "2.5.2",
"karma": "1.3.0",
"karma": "1.4.1",
"karma-chrome-launcher": "2.0.0",
"karma-coverage": "1.1.1",
"karma-jasmine": "1.1.0",
"karma-mocha-reporter": "2.2.2",
"karma-phantomjs-launcher": "1.0.2",
"karma-remap-coverage": "0.1.4",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "2.0.1",
"karma-webpack": "2.0.2",
"raw-loader": "0.5.1",
"rollup": "^0.41.4",
"rollup-plugin-sourcemaps": "^0.4.1",
"rollup-plugin-typescript": "^0.8.1",
"rxjs": "5.0.2",
"rollup": "0.41.4",
"rollup-plugin-angular": "0.4.4",
"rollup-plugin-sourcemaps": "0.4.1",
"rollup-plugin-typescript": "0.8.1",
"rxjs": "5.1.0",
"semantic-release": "6.3.2",
"source-map-loader": "0.1.5",
"ts-helpers": "1.1.2",
"tslint": "3.15.1",
"typescript": "2.1.1",
"tslint": "4.0.0",
"typescript": "2.0.6",
"webpack": "2.2.0",
"zone.js": "0.6.26"
"zone.js": "0.7.2"
},
"config": {
"commitizen": {
Expand Down
Loading

0 comments on commit 8af0b0e

Please sign in to comment.