Skip to content

Commit c95d31b

Browse files
authored
Move lib dependencies to peerDependencies (#416)
1 parent 7e7cfe7 commit c95d31b

File tree

6 files changed

+1862
-1472
lines changed

6 files changed

+1862
-1472
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ StackBlitz available @ [https://stackblitz.com/edit/ngx-markdown](https://stackb
5151

5252
### ngx-markdown
5353

54-
To add ngx-markdown library to your `package.json` use the following command.
54+
To add ngx-markdown library to your `package.json` use the following commands.
5555

5656
```bash
57-
npm install ngx-markdown --save
57+
npm install ngx-markdown marked --save
58+
npm install @types/marked --save-dev
5859
```
5960

6061
As the library is using [Marked](https://github.com/chjj/marked) parser you will need to add `node_modules/marked/marked.min.js` to your application.
@@ -71,6 +72,12 @@ If you are using [Angular CLI](https://cli.angular.io/) you can follow the `angu
7172

7273
> :bell: Syntax highlight is **optional**, skip this step if you are not planning to use it
7374
75+
To add [Prism.js](http://prismjs.com/) library to your `package.json` use the following command.
76+
77+
```bash
78+
npm install prismjs --save
79+
```
80+
7481
To activate [Prism.js](http://prismjs.com/) syntax highlight you will need to include...
7582
- prism.js core library - `node_modules/prismjs/prism.js` file
7683
- a highlight css theme - from `node_modules/prismjs/themes` directory
@@ -231,6 +238,12 @@ Optionally, to automatically present some lines as output without providing the
231238

232239
> :bell: Emoji support is **optional**, skip this step if you are not planning to use it
233240
241+
To add [Emoji-Toolkit](https://github.com/joypixels/emoji-toolkit) library to your `package.json` use the following command.
242+
243+
```bash
244+
npm install emoji-toolkit --save
245+
```
246+
234247
To activate [Emoji-Toolkit](https://github.com/joypixels/emoji-toolkit) for emoji suppport you will need to include...
235248
- Emoji-Toolkit library - `node_modules/emoji-toolkit/lib/js/joypixels.min.js`
236249

@@ -259,6 +272,12 @@ Using `markdown` component and/or directive, you will be able to use the `emoji`
259272

260273
> :bell: Math rendering is **optional**, skip this step if you are not planning to use it
261274
275+
To add [KaTeX](https://katex.org/) library to your `package.json` use the following command.
276+
277+
```bash
278+
npm install katex --save
279+
```
280+
262281
To activate [KaTeX](https://katex.org/) math rendering you will need to include...
263282
- KaTex JavaScript library - `node_modules/katex/dist/katex.min.js` file
264283
- KaTex Auto-Render extension - `node_modules/katex/dist/contrib/auto-render.min.js,` file
@@ -317,6 +336,12 @@ public options: KatexOptions = {
317336

318337
> :bell: Diagram support is **optional**, skip this step if you are not planning to use it
319338
339+
To add [Mermaid](https://mermaid-js.github.io/) library to your `package.json` use the following command.
340+
341+
```bash
342+
npm install mermaid --save
343+
```
344+
320345
To activate [Mermaid](https://mermaid-js.github.io/) diagramming and charting tool you will need to include...
321346
- Mermaid JavaScript library - `node_modules/mermaid/dist/mermaid.min.js` file
322347

@@ -367,6 +392,12 @@ public options: MermaidAPI.Config = {
367392

368393
> :bell: Copy-to-clipboard support is **optional**, skip this step if you are not planning to use it
369394
395+
To add [Clipboard](https://clipboardjs.com/) library to your `package.json` use the following command.
396+
397+
```bash
398+
npm install clipboard --save
399+
```
400+
370401
To activate [Clipboard](https://clipboardjs.com/) allowing copy-to-clipboard you will need to include...
371402
- Clipboard JavaScript library - `node_modules/clipboard/dist/clipboard.min.js` file
372403

demo/src/app/plugins/plugins.component.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<app-scrollspy-nav-layout [headings]="headings">
22
<h1>Plugins</h1>
33

4+
<markdown>
5+
<!-- Before to use any plugin, make sure you've installed the required libraries by following the [installation](https://jfcere.github.io/ngx-markdown/get-started#installation) section of the __Get Started__ page. -->
6+
Before to use any plugin, make sure you've installed the required libraries by following the [installation](/get-started#installation) section of the __Get Started__ page.
7+
</markdown>
8+
49
<!-- PLUGINS - Emoji -->
510
<section>
611
<h2 id="emoji">Emoji plugin</h2>

demo/src/scss/prism-theme.scss

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pre[class*="language-"] {
104104
color: #C586C0;
105105
}
106106

107+
.token.variable,
107108
.token.string,
108109
.token.char,
109110
.token.attr-value,
@@ -137,8 +138,13 @@ pre[class*="language-"] {
137138
cursor: help;
138139
}
139140

140-
.token.inserted {
141-
color: #8fce00;
141+
/* diff */
142+
143+
.language-diff {
144+
145+
.token.inserted {
146+
color: #8fce00;
147+
}
142148
}
143149

144150
/* Html */

lib/package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-markdown",
3-
"version": "14.0.1",
3+
"version": "15.0.0-next.0",
44
"description": "Angular library that uses marked to parse markdown to html combined with Prism.js for synthax highlights",
55
"homepage": "https://github.com/jfcere/ngx-markdown",
66
"license": "MIT",
@@ -26,21 +26,19 @@
2626
"clipboard",
2727
"clipboard.js"
2828
],
29-
"dependencies": {
29+
"peerDependencies": {
30+
"@angular/common": "^14.0.0",
31+
"@angular/core": "^14.0.0",
32+
"@angular/platform-browser": "^14.0.0",
3033
"@types/marked": "^4.0.3",
3134
"clipboard": "^2.0.11",
3235
"emoji-toolkit": "^6.6.0",
3336
"katex": "^0.16.0",
3437
"marked": "^4.0.17",
3538
"mermaid": "^9.1.2",
3639
"prismjs": "^1.28.0",
37-
"tslib": "^2.3.0"
38-
},
39-
"peerDependencies": {
40-
"@angular/common": "^14.0.0",
41-
"@angular/core": "^14.0.0",
42-
"@angular/platform-browser": "^14.0.0",
4340
"rxjs": "^6.5.3 || ^7.4.0",
41+
"tslib": "^2.3.0",
4442
"zone.js": "^0.11.4"
4543
}
4644
}

package.json

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-markdown",
3-
"version": "14.0.1",
3+
"version": "15.0.0-next.0",
44
"description": "Angular library that uses marked to parse markdown to html combined with Prism.js for synthax highlights",
55
"homepage": "https://github.com/jfcere/ngx-markdown",
66
"license": "MIT",
@@ -46,34 +46,41 @@
4646
"publish:lib": "npm publish ./dist/lib"
4747
},
4848
"dependencies": {
49-
"@angular/animations": "^14.0.0",
50-
"@angular/cdk": "^14.0.0",
51-
"@angular/common": "^14.0.0",
52-
"@angular/compiler": "^14.0.0",
53-
"@angular/core": "^14.0.0",
54-
"@angular/flex-layout": "13.0.0-beta.38",
55-
"@angular/forms": "^14.0.0",
56-
"@angular/material": "^14.0.0",
57-
"@angular/platform-browser": "^14.0.0",
58-
"@angular/platform-browser-dynamic": "^14.0.0",
59-
"@angular/router": "^14.0.0",
49+
"@angular/animations": "^14.2.0",
50+
"@angular/cdk": "^14.2.0",
51+
"@angular/common": "^14.2.0",
52+
"@angular/compiler": "^14.2.0",
53+
"@angular/core": "^14.2.0",
54+
"@angular/flex-layout": "14.0.0-beta.41",
55+
"@angular/forms": "^14.2.0",
56+
"@angular/material": "^14.2.0",
57+
"@angular/platform-browser": "^14.2.0",
58+
"@angular/platform-browser-dynamic": "^14.2.0",
59+
"@angular/router": "^14.2.0",
60+
"clipboard": "^2.0.11",
61+
"emoji-toolkit": "^6.6.0",
6062
"gumshoejs": "^5.1.2",
6163
"hammerjs": "~2.0.8",
62-
"ngx-markdown": "file:./lib",
64+
"katex": "^0.16.2",
65+
"marked": "^4.1.1",
66+
"mermaid": "^9.1.7",
67+
"ngx-markdown": "file:lib",
68+
"prismjs": "^1.29.0",
6369
"rxjs": "~6.5.3",
6470
"tslib": "^2.3.0",
6571
"zone.js": "~0.11.4"
6672
},
6773
"devDependencies": {
68-
"@angular-devkit/build-angular": "^14.0.0",
74+
"@angular-devkit/build-angular": "^14.2.0",
6975
"@angular-eslint/builder": "~12.6.1",
7076
"@angular-eslint/eslint-plugin": "~12.6.1",
7177
"@angular-eslint/eslint-plugin-template": "~12.6.1",
7278
"@angular-eslint/template-parser": "~12.6.1",
73-
"@angular/cli": "~14.0.0",
74-
"@angular/compiler-cli": "^14.0.0",
75-
"@angular/language-service": "^14.0.0",
79+
"@angular/cli": "~14.2.0",
80+
"@angular/compiler-cli": "^14.2.0",
81+
"@angular/language-service": "^14.2.0",
7682
"@types/jasmine": "~4.0.0",
83+
"@types/marked": "^4.0.7",
7784
"@typescript-eslint/eslint-plugin": "4.33.0",
7885
"@typescript-eslint/parser": "4.33.0",
7986
"angular-cli-ghpages": "^0.5.3",
@@ -84,15 +91,15 @@
8491
"eslint-plugin-import": "~2.25.2",
8592
"eslint-plugin-jsdoc": "~37.0.3",
8693
"eslint-plugin-prefer-arrow": "~1.2.3",
87-
"jasmine-core": "~4.1.0",
88-
"karma": "~6.3.0",
94+
"jasmine-core": "~4.3.0",
95+
"karma": "~6.4.0",
8996
"karma-chrome-launcher": "~3.1.0",
9097
"karma-coverage": "~2.2.0",
91-
"karma-jasmine": "~5.0.0",
92-
"karma-jasmine-html-reporter": "~1.7.0",
98+
"karma-jasmine": "~5.1.0",
99+
"karma-jasmine-html-reporter": "~2.0.0",
93100
"karma-junit-reporter": "^2.0.1",
94101
"linklocal": "^2.8.2",
95-
"ng-packagr": "^14.0.0",
102+
"ng-packagr": "^14.2.0",
96103
"raw-loader": "4.0.2",
97104
"rimraf": "^2.7.0",
98105
"typescript": "~4.7.2"

0 commit comments

Comments
 (0)