Skip to content

Commit

Permalink
feat(package): SweetAlert2 is now a peer dependency
Browse files Browse the repository at this point in the history
BREAKING CHANGE: If you haven't specified sweetalert2 in your direct dependencies yet, do it now!
  • Loading branch information
toverux committed Oct 10, 2017
1 parent f1f8b60 commit 00ee2d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
11 changes: 5 additions & 6 deletions README.md
Expand Up @@ -6,17 +6,16 @@

## :package: Installation & Usage

1) Install via the npm registry:
1) Install NgSweetAlert2 and SweetAlert2 via the npm registry:

```bash
npm install --save @toverux/ngsweetalert2

# or, using yarn instead of npm (yarnpkg.com):
yarn add @toverux/ngsweetalert2
npm install --save sweetalert2 @toverux/ngsweetalert2
```

2) Then, import SweetAlert's CSS file, exactly like you're doing usually with vendor styles. Could be a TypeScript `import` with Webpack, a SASS `@import`, or even a `<link>` tag: that depends of you build system.
2) Then, import SweetAlert's CSS (or SCSS) file, exactly like you're doing usually with vendor styles. Could be a TypeScript `import` with Webpack, a SASS `@import`, or even a `<link>` tag: that depends of you build system.

Its path is `node_modules/sweetalert2/dist/sweetalert2.css`.

3) Finally, import the module:

```typescript
Expand Down
7 changes: 3 additions & 4 deletions package.json
Expand Up @@ -15,11 +15,9 @@
"webpack-watch": "yarn webpack-build -- --watch",
"semantic-release": "semantic-release pre && npm publish --access=public && semantic-release post"
},
"dependencies": {
"sweetalert2": "^6.6.0"
},
"peerDependencies": {
"@angular/core": ">=2.0.0"
"@angular/core": ">=2.0.0",
"sweetalert2": ">=6.0.0"
},
"devDependencies": {
"@angular/compiler": "^4.0.1",
Expand All @@ -29,6 +27,7 @@
"codelyzer": "^3.1.2",
"rxjs": "^5.0.3",
"semantic-release": "^8.0.3",
"sweetalert2": "^6.10.2",
"tslint": "^5.6.0",
"tslint-loader": "^3.3.0",
"typescript": "^2.1.5",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Expand Up @@ -3192,7 +3192,7 @@ supports-color@^4.0.0, supports-color@^4.2.1:
dependencies:
has-flag "^2.0.0"

sweetalert2@^6.6.0:
sweetalert2@^6.10.2:
version "6.10.2"
resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-6.10.2.tgz#2fdd0d70027d142a08b6b96d4525c71fddfcfe85"

Expand Down

0 comments on commit 00ee2d5

Please sign in to comment.