From aef65c3ea8c5814188cbf3a88486fadada81d0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20P=C3=B6mp?= Date: Mon, 31 Jul 2023 11:20:17 +0200 Subject: [PATCH] fix(ngx-codejar): line numbers not working with CodeJar >= 4 BREAKING CHANGE: - Linenumbers feature was dropped in main CodeJar repository since v4. You have to install package codejar-linenumbers instead. ! changed installation instructions! - minimum CodeJar version is 4 about now. Closes #2 --- apps/demo/project.json | 5 ++- libs/ngx-codejar/package.json | 2 +- .../src/lib/ngx-code-jar.component.ts | 2 +- package-lock.json | 33 ++++++++++++++----- package.json | 3 +- 5 files changed, 32 insertions(+), 13 deletions(-) diff --git a/apps/demo/project.json b/apps/demo/project.json index 96a3004..bbf0a0b 100644 --- a/apps/demo/project.json +++ b/apps/demo/project.json @@ -16,7 +16,10 @@ "polyfills": ["zone.js"], "tsConfig": "apps/demo/tsconfig.app.json", "assets": ["apps/demo/src/favicon.ico", "apps/demo/src/assets"], - "styles": ["node_modules/highlight.js/styles/github-dark.css", "node_modules/prismjs/themes/prism-dark.css","apps/demo/src/styles.scss"], + "styles": ["node_modules/highlight.js/styles/github-dark.css", + "node_modules/prismjs/themes/prism-dark.css","apps/demo/src/styles.scss", + "node_modules/codejar-linenumbers/es/codejar-linenumbers.css" + ], "scripts": [] }, "configurations": { diff --git a/libs/ngx-codejar/package.json b/libs/ngx-codejar/package.json index ce695c6..f97099b 100644 --- a/libs/ngx-codejar/package.json +++ b/libs/ngx-codejar/package.json @@ -3,7 +3,7 @@ "version": "5.2.0", "description": "Angular wrapper for CodeJar supporting Prism.js and Highlight.js. With this you can easily add code-editors to your Angular app.", "peerDependencies": { - "codejar": ">= 3.7.0", + "codejar": "^4.0.0", "@angular/common": ">= 14.0.0", "@angular/core": ">= 14.0.0" }, diff --git a/libs/ngx-codejar/src/lib/ngx-code-jar.component.ts b/libs/ngx-codejar/src/lib/ngx-code-jar.component.ts index f2abd8d..b271fbe 100644 --- a/libs/ngx-codejar/src/lib/ngx-code-jar.component.ts +++ b/libs/ngx-codejar/src/lib/ngx-code-jar.component.ts @@ -14,7 +14,7 @@ import { } from '@angular/core'; import {CodeJar, Position} from 'codejar'; import {CodeJarContainer, CodeJarOptions} from './codejar.typings'; -import {withLineNumbers} from 'codejar/linenumbers.js'; +import {withLineNumbers} from 'codejar-linenumbers'; import {CommonModule} from '@angular/common'; @Component({ diff --git a/package-lock.json b/package-lock.json index 27b0d65..9c27d45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ngx-codejar", - "version": "0.0.0", + "version": "5.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ngx-codejar", - "version": "0.0.0", + "version": "5.2.0", "license": "MIT", "dependencies": { "@angular/animations": "~15.2.0", @@ -18,7 +18,8 @@ "@angular/platform-browser-dynamic": "~15.2.0", "@angular/router": "~15.2.0", "@nrwl/angular": "15.9.4", - "codejar": "3.7.0", + "codejar": "^4.1.1", + "codejar-linenumbers": "^1.0.0", "highlight.js": "^11.5.1", "prismjs": "^1.28.0", "rxjs": "~7.8.0", @@ -8689,9 +8690,17 @@ } }, "node_modules/codejar": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/codejar/-/codejar-3.7.0.tgz", - "integrity": "sha512-rqyDu2zNwfu1EhXI++LEMQDzhykS+V0BV52RemtCj5lczgTgWSufyEa+tS7RP7qCXH/WXOkU0eIthmFUzvG78Q==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/codejar/-/codejar-4.1.1.tgz", + "integrity": "sha512-TuqJpX3Q4mQgH5n9nLSfpUluWe3VRZFY5qUju/px+x7MKVNrGXjq3zCaNRzJ7nr0RZKkUVGXS1D9NPhodhkx8g==" + }, + "node_modules/codejar-linenumbers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/codejar-linenumbers/-/codejar-linenumbers-1.0.0.tgz", + "integrity": "sha512-soqwKASGmuXSsTPzYLi/yRscjCgw+oNhSbIX54rr6y85BzLhtgUumckw/BhiKpcqsplsRSvpvVGy7m46JRawMw==", + "peerDependencies": { + "codejar": ">= 4.0.0" + } }, "node_modules/collect-v8-coverage": { "version": "1.0.1", @@ -27290,9 +27299,15 @@ "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==" }, "codejar": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/codejar/-/codejar-3.7.0.tgz", - "integrity": "sha512-rqyDu2zNwfu1EhXI++LEMQDzhykS+V0BV52RemtCj5lczgTgWSufyEa+tS7RP7qCXH/WXOkU0eIthmFUzvG78Q==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/codejar/-/codejar-4.1.1.tgz", + "integrity": "sha512-TuqJpX3Q4mQgH5n9nLSfpUluWe3VRZFY5qUju/px+x7MKVNrGXjq3zCaNRzJ7nr0RZKkUVGXS1D9NPhodhkx8g==" + }, + "codejar-linenumbers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/codejar-linenumbers/-/codejar-linenumbers-1.0.0.tgz", + "integrity": "sha512-soqwKASGmuXSsTPzYLi/yRscjCgw+oNhSbIX54rr6y85BzLhtgUumckw/BhiKpcqsplsRSvpvVGy7m46JRawMw==", + "requires": {} }, "collect-v8-coverage": { "version": "1.0.1", diff --git a/package.json b/package.json index 1298dd5..7028f50 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "@angular/platform-browser-dynamic": "~15.2.0", "@angular/router": "~15.2.0", "@nrwl/angular": "15.9.4", - "codejar": "3.7.0", + "codejar": "^4.1.1", + "codejar-linenumbers": "^1.0.0", "highlight.js": "^11.5.1", "prismjs": "^1.28.0", "rxjs": "~7.8.0",