From 63f0bd967c74691b862a1936333a5243ce67a0db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Jun 2021 00:40:17 +0000 Subject: [PATCH 01/16] Bump postcss from 7.0.35 to 7.0.36 Bumps [postcss](https://github.com/postcss/postcss) from 7.0.35 to 7.0.36. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/7.0.35...7.0.36) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 213 +++++++++++++++++++++++----------------------- 1 file changed, 107 insertions(+), 106 deletions(-) diff --git a/package-lock.json b/package-lock.json index 63bd4e7..e265d32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2789,9 +2789,9 @@ "dev": true }, "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -4038,9 +4038,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -4097,9 +4097,9 @@ "dev": true }, "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -4313,9 +4313,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -6283,7 +6283,8 @@ }, "ini": { "version": "1.3.5", - "resolved": "", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, "injection-js": { @@ -8887,9 +8888,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -8935,9 +8936,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -8974,9 +8975,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9012,9 +9013,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9051,9 +9052,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9089,9 +9090,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9147,9 +9148,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9185,9 +9186,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9229,9 +9230,9 @@ "dev": true }, "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9284,9 +9285,9 @@ "dev": true }, "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9357,9 +9358,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9395,9 +9396,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9432,9 +9433,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9469,9 +9470,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9506,9 +9507,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9543,9 +9544,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9581,9 +9582,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9629,9 +9630,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9668,9 +9669,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9727,9 +9728,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9764,9 +9765,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -9903,9 +9904,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -10034,9 +10035,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -10071,9 +10072,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -10109,9 +10110,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -10182,9 +10183,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -10226,9 +10227,9 @@ "dev": true }, "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -10294,9 +10295,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -10332,9 +10333,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -10370,9 +10371,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -11245,9 +11246,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", From a8d86042d571d397a9fd99993e154c87ef084f54 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Aug 2021 00:37:41 +0000 Subject: [PATCH 02/16] Bump tar from 6.1.0 to 6.1.4 Bumps [tar](https://github.com/npm/node-tar) from 6.1.0 to 6.1.4. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/node-tar/compare/v6.1.0...v6.1.4) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 63bd4e7..21fabc3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6283,7 +6283,8 @@ }, "ini": { "version": "1.3.5", - "resolved": "", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, "injection-js": { @@ -12453,9 +12454,9 @@ "dev": true }, "tar": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz", - "integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.4.tgz", + "integrity": "sha512-kcPWrO8S5ABjuZ/v1xQHP8xCEvj1dQ1d9iAb6Qs4jLYzaAIYWwST2IQpz7Ud8VNYRI+fGhFjrnzRKmRggKWg3g==", "dev": true, "requires": { "chownr": "^2.0.0", From f9a2d149b871201b580b3a278502243d2045d885 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Aug 2021 01:33:26 +0000 Subject: [PATCH 03/16] Bump path-parse from 1.0.6 to 1.0.7 Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 21fabc3..ec11b4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8779,9 +8779,9 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-to-regexp": { From 61362545e38375b3b77af3aef0a3661c6935b04a Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sun, 22 Aug 2021 02:55:18 +0200 Subject: [PATCH 04/16] Update bug_report.md --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 66eb7f4..eff2063 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,6 +26,6 @@ What behavior did you actually see? #### Environment - Angular: -- ngx-scrollbar: +- ngx-highlightjs: - Browser(s): - Operating System (e.g. Windows, macOS, Ubuntu): From 20029e1a0c50e40d1de650f8c32a645719cabf7e Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 03:17:42 +0200 Subject: [PATCH 05/16] improve workflow --- projects/ngx-highlightjs-demo/src/app/app.component.ts | 1 - projects/ngx-highlightjs-demo/src/app/app.module.ts | 2 -- tsconfig.json | 6 +++--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/projects/ngx-highlightjs-demo/src/app/app.component.ts b/projects/ngx-highlightjs-demo/src/app/app.component.ts index 2f81744..99572c5 100644 --- a/projects/ngx-highlightjs-demo/src/app/app.component.ts +++ b/projects/ngx-highlightjs-demo/src/app/app.component.ts @@ -1,6 +1,5 @@ import { Component, ChangeDetectionStrategy } from '@angular/core'; import { animationFrameScheduler } from 'rxjs'; -// import { Gist } from '../../../ngx-highlightjs/plus/src/gist.model'; import { Gist } from 'ngx-highlightjs/plus'; @Component({ diff --git a/projects/ngx-highlightjs-demo/src/app/app.module.ts b/projects/ngx-highlightjs-demo/src/app/app.module.ts index 99f2519..bcf062d 100644 --- a/projects/ngx-highlightjs-demo/src/app/app.module.ts +++ b/projects/ngx-highlightjs-demo/src/app/app.module.ts @@ -6,8 +6,6 @@ import { FlexLayoutModule } from '@angular/flex-layout'; import { NgScrollbarModule } from 'ngx-scrollbar'; import { MaterialModule } from './material/material.module'; -// import { HighlightPlusModule, GIST_OPTIONS } from '../../../ngx-highlightjs/plus/src/public_api'; -// import { HIGHLIGHT_OPTIONS } from '../../../ngx-highlightjs/src/public-api'; import { HIGHLIGHT_OPTIONS } from 'ngx-highlightjs'; import { HighlightPlusModule, GIST_OPTIONS } from 'ngx-highlightjs/plus'; diff --git a/tsconfig.json b/tsconfig.json index 59f5ede..6c961f1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,10 +20,10 @@ ], "paths": { "ngx-higlightjs": [ - "dist/ngx-higlightjs" + "projects/ngx-higlightjs/src/public-api" ], - "ngx-higlightjs/*": [ - "dist/ngx-higlightjs/*" + "ngx-higlightjs/plus": [ + "projects/ngx-higlightjs/plus/src/public_api" ] } } From d22d645eab01497e91013876daf43c2935bb150e Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 03:24:11 +0200 Subject: [PATCH 06/16] Update tests --- .../src/lib/highlight.loader.spec.ts | 29 +++++++++++++++++++ .../src/lib/highlight.service.spec.ts | 25 +++++++++++++--- .../ngx-highlightjs/src/lib/highlight.spec.ts | 7 +++-- 3 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 projects/ngx-highlightjs/src/lib/highlight.loader.spec.ts diff --git a/projects/ngx-highlightjs/src/lib/highlight.loader.spec.ts b/projects/ngx-highlightjs/src/lib/highlight.loader.spec.ts new file mode 100644 index 0000000..2340817 --- /dev/null +++ b/projects/ngx-highlightjs/src/lib/highlight.loader.spec.ts @@ -0,0 +1,29 @@ +import { TestBed, waitForAsync } from '@angular/core/testing'; + +import { HighlightJS } from './highlight.service'; +import { BehaviorSubject } from 'rxjs'; +import * as hljs from 'highlight.js'; +import { HighlightLoader } from './highlight.loader'; + + +// Fake Highlight Loader +const highlightLoaderStub = { + ready: new BehaviorSubject(hljs) +}; + +describe('HighlightService', () => { + + let loader: HighlightLoader; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + providers: [{ provide: HighlightLoader, useValue: highlightLoaderStub }] + }).compileComponents(); + loader = TestBed.inject(HighlightLoader); + })); + + it('should be created', () => { + const service: HighlightJS = TestBed.inject(HighlightJS); + expect(service).toBeTruthy(); + }); +}); diff --git a/projects/ngx-highlightjs/src/lib/highlight.service.spec.ts b/projects/ngx-highlightjs/src/lib/highlight.service.spec.ts index b0487e3..2340817 100644 --- a/projects/ngx-highlightjs/src/lib/highlight.service.spec.ts +++ b/projects/ngx-highlightjs/src/lib/highlight.service.spec.ts @@ -1,12 +1,29 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed, waitForAsync } from '@angular/core/testing'; import { HighlightJS } from './highlight.service'; +import { BehaviorSubject } from 'rxjs'; +import * as hljs from 'highlight.js'; +import { HighlightLoader } from './highlight.loader'; -describe('HiglightManager', () => { - beforeEach(() => TestBed.configureTestingModule({})); + +// Fake Highlight Loader +const highlightLoaderStub = { + ready: new BehaviorSubject(hljs) +}; + +describe('HighlightService', () => { + + let loader: HighlightLoader; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + providers: [{ provide: HighlightLoader, useValue: highlightLoaderStub }] + }).compileComponents(); + loader = TestBed.inject(HighlightLoader); + })); it('should be created', () => { - const service: HighlightJS = TestBed.get(HighlightJS); + const service: HighlightJS = TestBed.inject(HighlightJS); expect(service).toBeTruthy(); }); }); diff --git a/projects/ngx-highlightjs/src/lib/highlight.spec.ts b/projects/ngx-highlightjs/src/lib/highlight.spec.ts index bed7297..9f312fa 100644 --- a/projects/ngx-highlightjs/src/lib/highlight.spec.ts +++ b/projects/ngx-highlightjs/src/lib/highlight.spec.ts @@ -1,10 +1,11 @@ -import { ComponentFixture, fakeAsync, flushMicrotasks, TestBed, tick, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing'; import { Component, DebugElement, Input, OnInit } from '@angular/core'; import { By } from '@angular/platform-browser'; import { BehaviorSubject } from 'rxjs'; import * as hljs from 'highlight.js'; import { Highlight } from './highlight'; import { HighlightLoader } from './highlight.loader'; +import { HighlightLibrary } from './highlight.model'; @Component({ template: `` @@ -34,7 +35,7 @@ describe('Highlight Directive', () => { declarations: [Highlight, TestHighlightComponent], providers: [{ provide: HighlightLoader, useValue: highlightLoaderStub }] }).compileComponents(); - loader = TestBed.get(HighlightLoader); + loader = TestBed.inject(HighlightLoader); })); beforeEach(() => { @@ -57,7 +58,7 @@ describe('Highlight Directive', () => { component.code = testCode; fixture.detectChanges(); let highlightedCode; - loader.ready.subscribe((lib) => highlightedCode = lib.highlightAuto(testCode, null).value); + loader.ready.subscribe((lib: HighlightLibrary) => highlightedCode = lib.highlightAuto(testCode, null).value); tick(500); expect(directiveElement.nativeElement.innerHTML).toBe(highlightedCode); })); From 7be7d6e9c1a42d541fad3120530293681924baf6 Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 03:24:24 +0200 Subject: [PATCH 07/16] remove unnecessary pipe --- projects/ngx-highlightjs/src/lib/highlight.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/ngx-highlightjs/src/lib/highlight.service.ts b/projects/ngx-highlightjs/src/lib/highlight.service.ts index d48a680..20515c0 100644 --- a/projects/ngx-highlightjs/src/lib/highlight.service.ts +++ b/projects/ngx-highlightjs/src/lib/highlight.service.ts @@ -18,7 +18,7 @@ export class HighlightJS { constructor(private _loader: HighlightLoader, @Optional() @Inject(HIGHLIGHT_OPTIONS) options: HighlightOptions) { // Load highlight.js library on init - _loader.ready.pipe().subscribe((hljs: HighlightLibrary) => { + _loader.ready.subscribe((hljs: HighlightLibrary) => { this._hljs = hljs; if (options && options.config) { // Set global config if present From 0a76249a5a99fe89fb228add9904775f513ededf Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 05:30:25 +0200 Subject: [PATCH 08/16] feat: Update to highlight.js v11 --- CHANGELOG.md | 15 ++- package-lock.json | 102 +++++++----------- package.json | 2 +- projects/ngx-highlightjs/package.json | 8 +- .../src/lib/highlight.model.ts | 95 ++++++++++------ .../src/lib/highlight.service.ts | 100 +++++++++++------ .../ngx-highlightjs/src/lib/highlight.spec.ts | 2 +- projects/ngx-highlightjs/src/lib/highlight.ts | 15 ++- 8 files changed, 193 insertions(+), 146 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b455551..0a35495 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,22 @@ # Changelog +## 5.0.0 + +- Upgrade usage to highlight.js v11, you can find the breaking changes from the official page [here](https://highlightjs.readthedocs.io/en/latest/upgrade-11.html). +- feat: Add the missing functions from v11 in `HighlightJS` service. +- Remove deprecated function in v11, such as `initHighlighting()`, `highlightBlock()`, `fixMarkup()` from `HighlightJS` service. + +### Breaking changes + +- refactor: `(highlighted)` output has been updated to highlight.js v11, the result object has a new interface `HighlightAutoResult`. +- refactor: `HighlightJS.configure(config)` has been updated the config interface to highlight.js v11. + ## 4.1.4 - Upgrade to Angular 12 -- Set peer dependency of hljs to v10 +- Set peer dependency of highlight.js to v10 + + > The library is still compatible with the new version of highlight.js v11 but the highlighting function will be deprecated in their next release ## 4.1.3 diff --git a/package-lock.json b/package-lock.json index 3f5a99a..986a8c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4341,15 +4341,15 @@ } }, "css-select": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-3.1.2.tgz", - "integrity": "sha512-qmss1EihSuBNWNNhHjxzxSfJoFBM/lERB/Q4EnsJQQC62R2evJDW481091oAdOr9uh46/0n4nrg0It5cAnj1RA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz", + "integrity": "sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA==", "dev": true, "requires": { "boolbase": "^1.0.0", - "css-what": "^4.0.0", - "domhandler": "^4.0.0", - "domutils": "^2.4.3", + "css-what": "^5.0.0", + "domhandler": "^4.2.0", + "domutils": "^2.6.0", "nth-check": "^2.0.0" } }, @@ -4382,9 +4382,9 @@ } }, "css-what": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-4.0.0.tgz", - "integrity": "sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz", + "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==", "dev": true }, "cssauron": { @@ -4785,9 +4785,9 @@ } }, "domutils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.6.0.tgz", - "integrity": "sha512-y0BezHuy4MDYxh6OvolXYsH+1EMGmFbwv5FKW7ovwMG6zTPWqNPq3WF9ayZssFq+UlKdffGLbOEaghNdaOm1WA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", + "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", "dev": true, "requires": { "dom-serializer": "^1.0.1", @@ -5837,9 +5837,9 @@ "dev": true }, "highlight.js": { - "version": "10.7.2", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.2.tgz", - "integrity": "sha512-oFLl873u4usRM9K63j4ME9u3etNF0PLiJhSQ8rdfuL51Wn3zkD6drf9ZW0dOzjnZI22YYG24z30JcmfCZjMgYg==" + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.2.0.tgz", + "integrity": "sha512-JOySjtOEcyG8s4MLR2MNbLUyaXqUunmSnL2kdV/KuGJOmHZuAR5xC54Ko7goAXBWNhf09Vy3B+U7vR62UZ/0iw==" }, "highlightjs-line-numbers.js": { "version": "2.8.0", @@ -6283,8 +6283,7 @@ }, "ini": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "resolved": "", "dev": true }, "injection-js": { @@ -7000,9 +6999,9 @@ } }, "jszip": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.5.0.tgz", - "integrity": "sha512-WRtu7TPCmYePR1nazfrtuF216cIVon/3GWOvHS9QR5bIwSbnxtdpma6un3jyGGNhHsKCSzn5Ypk+EkDRvTGiFA==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.1.tgz", + "integrity": "sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==", "dev": true, "requires": { "lie": "~3.3.0", @@ -8012,6 +8011,13 @@ "highlight.js": "^10.0.0", "highlightjs-line-numbers.js": "^2.8.0", "tslib": "^2.0.0" + }, + "dependencies": { + "highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==" + } } }, "ngx-scrollbar": { @@ -8646,9 +8652,9 @@ } }, "pako": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", - "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", "dev": true }, "parent-module": { @@ -12385,54 +12391,20 @@ } }, "svgo": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.3.0.tgz", - "integrity": "sha512-fz4IKjNO6HDPgIQxu4IxwtubtbSfGEAJUq/IXyTPIkGhWck/faiiwfkvsB8LnBkKLvSoyNNIY6d13lZprJMc9Q==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.4.0.tgz", + "integrity": "sha512-W25S1UUm9Lm9VnE0TvCzL7aso/NCzDEaXLaElCUO/KaVitw0+IBicSVfM1L1c0YHK5TOFh73yQ2naCpVHEQ/OQ==", "dev": true, "requires": { "@trysound/sax": "0.1.1", - "chalk": "^4.1.0", + "colorette": "^1.2.2", "commander": "^7.1.0", - "css-select": "^3.1.2", + "css-select": "^4.1.3", "css-tree": "^1.1.2", "csso": "^4.2.0", "stable": "^0.1.8" }, "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "commander": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", @@ -12973,9 +12945,9 @@ } }, "url-parse": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz", - "integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz", + "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==", "dev": true, "requires": { "querystringify": "^2.1.1", diff --git a/package.json b/package.json index e8033be..929bff7 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@angular/platform-browser": "~12.0.2", "@angular/platform-browser-dynamic": "~12.0.2", "@angular/router": "~12.0.2", - "highlight.js": "^10.7.2", + "highlight.js": "^11.2.0", "highlightjs-line-numbers.js": "^2.8.0", "ngx-highlightjs": "^4.1.4", "ngx-scrollbar": "^7.5.6", diff --git a/projects/ngx-highlightjs/package.json b/projects/ngx-highlightjs/package.json index 02f6375..6b34bfe 100644 --- a/projects/ngx-highlightjs/package.json +++ b/projects/ngx-highlightjs/package.json @@ -1,6 +1,6 @@ { "name": "ngx-highlightjs", - "version": "4.1.4", + "version": "5.0.0", "description": "Instant code highlighting, auto-detect language, super easy to use.", "homepage": "http://github.com/murhafsousli/ngx-highlightjs", "author": { @@ -25,13 +25,13 @@ ], "license": "MIT", "dependencies": { - "highlight.js": "^10.0.0", + "highlight.js": ">=11.0.0", "highlightjs-line-numbers.js": "^2.8.0", "tslib": "^2.0.0" }, "peerDependencies": { - "@angular/common": ">=8.0.0", - "@angular/core": ">=8.0.0", + "@angular/common": ">=12.0.0", + "@angular/core": ">=12.0.0", "rxjs": ">=6.0.0" } } diff --git a/projects/ngx-highlightjs/src/lib/highlight.model.ts b/projects/ngx-highlightjs/src/lib/highlight.model.ts index 66c3232..21baf87 100644 --- a/projects/ngx-highlightjs/src/lib/highlight.model.ts +++ b/projects/ngx-highlightjs/src/lib/highlight.model.ts @@ -1,17 +1,18 @@ import { InjectionToken } from '@angular/core'; +/** + * Full documentation is available here https://highlightjs.readthedocs.io/en/latest/api.html + */ + export interface HighlightLibrary { /** - * Core highlighting function. - * @param name Accepts a language name, or an alias - * @param value A string with the code to highlight. - * @param ignore_illegals When present and evaluates to a true value, forces highlighting to finish - * even in case of detecting illegal syntax for the language instead of throwing an exception. - * @param continuation An optional mode stack representing unfinished parsing. - * When present, the function will restart parsing from this state instead of initializing a new one + * Core highlighting function. Accepts the code to highlight (string) and a list of options (object) + * @param code Accepts the code to highlight + * @param language must be present and specify the language name or alias of the grammar to be used for highlighting + * @param ignoreIllegals (optional) when set to true it forces highlighting to finish even in case of detecting illegal syntax for the language instead of throwing an exception. */ - highlight(name: string, value: string, ignore_illegals: boolean, continuation?: any): HighlightResult; + highlight(code: string, { language, ignoreIllegals }: { language: string, ignoreIllegals: boolean }): HighlightResult; /** * Highlighting with language detection. @@ -19,23 +20,23 @@ export interface HighlightLibrary { * @param languageSubset An optional array of language names and aliases restricting detection to only those languages. * The subset can also be set with configure, but the local parameter overrides the option if set. */ - highlightAuto(value: string, languageSubset: string[]): HighlightResult; + highlightAuto(value: string, languageSubset: string[]): HighlightAutoResult; /** - * Post-processing of the highlighted markup. - * Currently consists of replacing indentation TAB characters and using
tags instead of new-line characters. - * Options are set globally with configure. - * @param value Accepts a string with the highlighted markup + * Applies highlighting to a DOM node containing code. + * This function is the one to use to apply highlighting dynamically after page load or within initialization code of third-party + * JavaScript frameworks. + * The function uses language detection by default but you can specify the language in the class attribute of the DOM node. + * See the scopes reference for all available language names and scopes. + * @param element Element to highlight */ - fixMarkup(value: string): string; + highlightElement(element: HTMLElement): void; /** - * Applies highlighting to a DOM node containing code. - * The function uses language detection by default but you can specify the language in the class attribute of the DOM node. - * See the class reference for all available language names and aliases. - * @param block The element to apply highlight on. + * Applies highlighting to all elements on a page matching the configured cssSelector. The default cssSelector value is 'pre code', + * which highlights all code blocks. This can be called before or after the page’s onload event has fired. */ - highlightBlock(block: HTMLElement): void; + highlightAll(): void; /** * Configures global options: @@ -44,17 +45,25 @@ export interface HighlightLibrary { configure(config: HighlightConfig): void; /** - * Applies highlighting to all
..
blocks on a page. + * Adds new language to the library under the specified name. Used mostly internally. + * @param languageName A string with the name of the language being registered + * @param languageDefinition A function that returns an object which represents the language definition. + * The function is passed the hljs object to be able to use common regular expressions defined within it. */ - initHighlighting(): void; + registerLanguage(languageName: string, languageDefinition: () => any): void; /** - * Adds new language to the library under the specified name. Used mostly internally. - * @param name A string with the name of the language being registered - * @param language A function that returns an object which represents the language definition. - * The function is passed the hljs object to be able to use common regular expressions defined within it. + * Removes a language and its aliases from the library. Used mostly internall + * @param languageName: a string with the name of the language being removed. + */ + unregisterLanguage(languageName: string): void; + + /** + * Adds new language alias or aliases to the library for the specified language name defined under languageName key. + * @param alias: A string or array with the name of alias being registered + * @param languageName: the language name as specified by registerLanguage. */ - registerLanguage(name: string, language: () => any): void; + registerAliases(alias: string | string[], { languageName }: { languageName: string }): void; /** * @return The languages names list. @@ -68,6 +77,16 @@ export interface HighlightLibrary { */ getLanguage(name: string): any; + /** + * Enables safe mode. This is the default mode, providing the most reliable experience for production usage. + */ + safeMode(): void; + + /** + * Enables debug/development mode. + */ + debugMode(): void; + /** * Add line numbers to code element * @param el Code element @@ -76,21 +95,31 @@ export interface HighlightLibrary { } export interface HighlightConfig { - /** tabReplace: a string used to replace TAB characters in indentation. */ - tabReplace?: string; - /** useBR: a flag to generate
tags instead of new-line characters in the output, useful when code is marked up using a non-
 container. */
-  useBR?: boolean;
   /** classPrefix: a string prefix added before class names in the generated markup, used for backwards compatibility with stylesheets. */
   classPrefix?: string;
   /** languages: an array of language names and aliases restricting auto detection to only these languages. */
   languages?: string[];
+  /** languageDetectRe: a regex to configure how CSS class names map to language (allows class names like say color-as-php vs the default of language-php, etc.) */
+  languageDetectRe: string;
+  /** noHighlightRe: a regex to configure which CSS classes are to be skipped completely. */
+  noHighlightRe: string;
+  /** a CSS selector to configure which elements are affected by hljs.highlightAll. Defaults to 'pre code'. */
+  cssSelector: string;
 }
 
 export interface HighlightResult {
   language?: string;
-  second_best?: any;
-  top?: any;
-  value?: string;
+  value?: string | undefined;
+  relevance?: number;
+  top: any;
+  code: string;
+  illegal: boolean;
+}
+
+export interface HighlightAutoResult {
+  language?: string;
+  secondBest?: any;
+  value?: string | undefined;
   relevance?: number;
 }
 
diff --git a/projects/ngx-highlightjs/src/lib/highlight.service.ts b/projects/ngx-highlightjs/src/lib/highlight.service.ts
index 20515c0..cfe19d4 100644
--- a/projects/ngx-highlightjs/src/lib/highlight.service.ts
+++ b/projects/ngx-highlightjs/src/lib/highlight.service.ts
@@ -1,7 +1,14 @@
 import { Injectable, Inject, Optional } from '@angular/core';
 import { Observable } from 'rxjs';
 import { filter, map, tap } from 'rxjs/operators';
-import { HighlightConfig, HighlightResult, HighlightLibrary, HighlightOptions, HIGHLIGHT_OPTIONS } from './highlight.model';
+import {
+  HighlightConfig,
+  HighlightResult,
+  HighlightLibrary,
+  HighlightOptions,
+  HIGHLIGHT_OPTIONS,
+  HighlightAutoResult
+} from './highlight.model';
 import { HighlightLoader } from './highlight.loader';
 
 @Injectable({
@@ -31,17 +38,14 @@ export class HighlightJS {
   }
 
   /**
-   * Core highlighting function.
-   * @param name Accepts a language name, or an alias
-   * @param value A string with the code to highlight.
-   * @param ignore_illegals When present and evaluates to a true value, forces highlighting to finish
-   * even in case of detecting illegal syntax for the language instead of throwing an exception.
-   * @param continuation An optional mode stack representing unfinished parsing.
-   * When present, the function will restart parsing from this state instead of initializing a new one
+   * Core highlighting function. Accepts the code to highlight (string) and a list of options (object)
+   * @param code Accepts the code to highlight
+   * @param language must be present and specify the language name or alias of the grammar to be used for highlighting
+   * @param ignoreIllegals (optional) when set to true it forces highlighting to finish even in case of detecting illegal syntax for the language instead of throwing an exception.
    */
-  highlight(name: string, value: string, ignore_illegals: boolean, continuation?: any): Observable {
+  highlight(code: string, { language, ignoreIllegals }: { language: string, ignoreIllegals: boolean }): Observable {
     return this._loader.ready.pipe(
-      map((hljs: HighlightLibrary) => hljs.highlight(name, value, ignore_illegals, continuation))
+      map((hljs: HighlightLibrary) => hljs.highlight(code, { language, ignoreIllegals }))
     );
   }
 
@@ -51,37 +55,36 @@ export class HighlightJS {
    * @param languageSubset An optional array of language names and aliases restricting detection to only those languages.
    * The subset can also be set with configure, but the local parameter overrides the option if set.
    */
-  highlightAuto(value: string, languageSubset: string[]): Observable {
+  highlightAuto(value: string, languageSubset: string[]): Observable {
     return this._loader.ready.pipe(
       map((hljs: HighlightLibrary) => hljs.highlightAuto(value, languageSubset))
     );
   }
 
   /**
-   * Post-processing of the highlighted markup.
-   * Currently consists of replacing indentation TAB characters and using 
tags instead of new-line characters. - * Options are set globally with configure. - * @param value Accepts a string with the highlighted markup + * Applies highlighting to a DOM node containing code. + * This function is the one to use to apply highlighting dynamically after page load or within initialization code of third-party JavaScript frameworks. + * The function uses language detection by default but you can specify the language in the class attribute of the DOM node. See the scopes reference for all available language names and scopes. + * @param element */ - fixMarkup(value: string): Observable { + highlightElement(element: HTMLElement): Observable { return this._loader.ready.pipe( - map((hljs: HighlightLibrary) => hljs.fixMarkup(value)) + map((hljs: HighlightLibrary) => hljs.highlightElement(element)) ); } /** - * Applies highlighting to a DOM node containing code. - * The function uses language detection by default but you can specify the language in the class attribute of the DOM node. - * See the class reference for all available language names and aliases. - * @param block The element to apply highlight on. + * Applies highlighting to all elements on a page matching the configured cssSelector. The default cssSelector value is 'pre code', + * which highlights all code blocks. This can be called before or after the page’s onload event has fired. */ - highlightBlock(block: HTMLElement): Observable { + highlightAll(): Observable { return this._loader.ready.pipe( - map((hljs: HighlightLibrary) => hljs.highlightBlock(block)) + map((hljs: HighlightLibrary) => hljs.highlightAll()) ); } /** + * @deprecated in version 12 * Configures global options: * @param config HighlightJs configuration argument */ @@ -92,30 +95,43 @@ export class HighlightJS { } /** - * Applies highlighting to all
..
blocks on a page. + * Adds new language to the library under the specified name. Used mostly internally. + * @param languageName A string with the name of the language being registered + * @param languageDefinition A function that returns an object which represents the language definition. + * The function is passed the hljs object to be able to use common regular expressions defined within it. */ - initHighlighting(): Observable { + registerLanguage(languageName: string, languageDefinition: () => any): Observable { return this._loader.ready.pipe( - map((hljs: HighlightLibrary) => hljs.initHighlighting()) + tap((hljs: HighlightLibrary) => hljs.registerLanguage(languageName, languageDefinition)) ); } /** - * Adds new language to the library under the specified name. Used mostly internally. - * @param name A string with the name of the language being registered - * @param language A function that returns an object which represents the language definition. - * The function is passed the hljs object to be able to use common regular expressions defined within it. + * Removes a language and its aliases from the library. Used mostly internall + * @param languageName: a string with the name of the language being removed. */ - registerLanguage(name: string, language: () => any): Observable { + unregisterLanguage(languageName: string): Observable { return this._loader.ready.pipe( - tap((hljs: HighlightLibrary) => hljs.registerLanguage(name, language)) + tap((hljs: HighlightLibrary) => hljs.unregisterLanguage(languageName)) ); } + /** + * Adds new language alias or aliases to the library for the specified language name defined under languageName key. + * @param alias: A string or array with the name of alias being registered + * @param languageName: the language name as specified by registerLanguage. + */ + registerAliases(alias: string | string[], { languageName }: { languageName: string }): Observable { + return this._loader.ready.pipe( + tap((hljs: HighlightLibrary) => hljs.registerAliases(alias, { languageName })) + ); + } + + /** * @return The languages names list. */ - listLanguages(): Observable { + listLanguages(): Observable { return this._loader.ready.pipe( map((hljs: HighlightLibrary) => hljs.listLanguages()) ); @@ -132,6 +148,24 @@ export class HighlightJS { ); } + /** + * Enables safe mode. This is the default mode, providing the most reliable experience for production usage. + */ + safeMode(): Observable { + return this._loader.ready.pipe( + map((hljs: HighlightLibrary) => hljs.safeMode()) + ); + } + + /** + * Enables debug/development mode. + */ + debugMode(): Observable { + return this._loader.ready.pipe( + map((hljs: HighlightLibrary) => hljs.debugMode()) + ); + } + /** * Display line numbers * @param el Code element diff --git a/projects/ngx-highlightjs/src/lib/highlight.spec.ts b/projects/ngx-highlightjs/src/lib/highlight.spec.ts index 9f312fa..5e69f84 100644 --- a/projects/ngx-highlightjs/src/lib/highlight.spec.ts +++ b/projects/ngx-highlightjs/src/lib/highlight.spec.ts @@ -2,7 +2,7 @@ import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angul import { Component, DebugElement, Input, OnInit } from '@angular/core'; import { By } from '@angular/platform-browser'; import { BehaviorSubject } from 'rxjs'; -import * as hljs from 'highlight.js'; +import hljs from 'highlight.js'; import { Highlight } from './highlight'; import { HighlightLoader } from './highlight.loader'; import { HighlightLibrary } from './highlight.model'; diff --git a/projects/ngx-highlightjs/src/lib/highlight.ts b/projects/ngx-highlightjs/src/lib/highlight.ts index 8b938dc..b1f5977 100644 --- a/projects/ngx-highlightjs/src/lib/highlight.ts +++ b/projects/ngx-highlightjs/src/lib/highlight.ts @@ -4,16 +4,16 @@ import { Output, Inject, Optional, + EventEmitter, OnChanges, SimpleChanges, - EventEmitter, ElementRef, SecurityContext } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser'; import { animationFrameScheduler } from 'rxjs'; import { HighlightJS } from './highlight.service'; -import { HIGHLIGHT_OPTIONS, HighlightOptions, HighlightResult } from './highlight.model'; +import { HIGHLIGHT_OPTIONS, HighlightOptions, HighlightAutoResult } from './highlight.model'; @Directive({ host: { @@ -40,7 +40,7 @@ export class Highlight implements OnChanges { @Input() lineNumbers!: boolean; // Stream that emits when code string is highlighted - @Output() highlighted = new EventEmitter(); + @Output() highlighted = new EventEmitter(); constructor(el: ElementRef, private _hljs: HighlightJS, @@ -52,8 +52,7 @@ export class Highlight implements OnChanges { ngOnChanges(changes: SimpleChanges) { if ( this.code && - changes.code && - typeof changes.code.currentValue !== 'undefined' && + changes?.code?.currentValue && changes.code.currentValue !== changes.code.previousValue ) { this.highlightElement(this.code, this.languages); @@ -69,9 +68,9 @@ export class Highlight implements OnChanges { highlightElement(code: string, languages: string[]): void { // Set code text before highlighting this.setTextContent(code); - this._hljs.highlightAuto(code, languages).subscribe((res: any) => { + this._hljs.highlightAuto(code, languages).subscribe((res: HighlightAutoResult) => { // Set highlighted code - this.setInnerHTML(res.value); + this.setInnerHTML(res.value || null); // Check if user want to show line numbers if (this.lineNumbers && this._options && this._options.lineNumbersLoader) { this.addLineNumbers(); @@ -112,7 +111,7 @@ export class Highlight implements OnChanges { ); } - private setInnerHTML(content: string) { + private setInnerHTML(content: string | null) { animationFrameScheduler.schedule(() => this._nativeElement.innerHTML = this._sanitizer.sanitize(SecurityContext.HTML, content) || '' ); From 77647cae3254e1e859b00a58fcbfc277edb8c295 Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 05:36:49 +0200 Subject: [PATCH 09/16] Update tsconfig --- .../ngx-highlightjs/tsconfig.lib.prod.json | 2 +- projects/ngx-highlightjs/tslint.json | 18 ------------------ tsconfig.json | 4 ++++ 3 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 projects/ngx-highlightjs/tslint.json diff --git a/projects/ngx-highlightjs/tsconfig.lib.prod.json b/projects/ngx-highlightjs/tsconfig.lib.prod.json index 04c0e66..2a2faa8 100644 --- a/projects/ngx-highlightjs/tsconfig.lib.prod.json +++ b/projects/ngx-highlightjs/tsconfig.lib.prod.json @@ -4,6 +4,6 @@ "declarationMap": false }, "angularCompilerOptions": { - "enableIvy": false + "compilationMode": "partial" } } diff --git a/projects/ngx-highlightjs/tslint.json b/projects/ngx-highlightjs/tslint.json deleted file mode 100644 index ed129cd..0000000 --- a/projects/ngx-highlightjs/tslint.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "../../tslint.json", - "rules": { - "directive-selector": [ - true, - "attribute", - "camelCase" - ], - "component-selector": [ - true, - "element", - "kebab-case" - ], - "variable-name": false, - "directive-class-suffix": false, - "no-host-metadata-property": false - } -} diff --git a/tsconfig.json b/tsconfig.json index 6c961f1..938e28c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,5 +26,9 @@ "projects/ngx-higlightjs/plus/src/public_api" ] } + }, + "angularCompilerOptions": { + "fullTemplateTypeCheck": true, + "strictInjectionParameters": true } } From a0153e8bc93a99ac976195161c093db48e4b9255 Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 05:37:49 +0200 Subject: [PATCH 10/16] Update license --- LICENSE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index bb9f135..8b38a85 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Murhaf Sousli +Copyright (c) 2018-2021 Murhaf Sousli Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. From 842ecd985be2ee7ecc3226bd7c1ac09122b0889f Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 05:39:12 +0200 Subject: [PATCH 11/16] Update tsconfig --- projects/ngx-highlightjs/tsconfig.lib.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/projects/ngx-highlightjs/tsconfig.lib.json b/projects/ngx-highlightjs/tsconfig.lib.json index 3a075c0..e9d8b5d 100644 --- a/projects/ngx-highlightjs/tsconfig.lib.json +++ b/projects/ngx-highlightjs/tsconfig.lib.json @@ -10,15 +10,7 @@ "lib": [ "dom", "es2018" - ], - "strict": true - }, - "angularCompilerOptions": { - "skipTemplateCodegen": true, - "strictMetadataEmit": true, - "fullTemplateTypeCheck": true, - "strictInjectionParameters": true, - "enableResourceInlining": true + ] }, "exclude": [ "src/test.ts", From 6db7d80c40673cbdcb2e657ec91cf2015287d2bf Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 05:40:20 +0200 Subject: [PATCH 12/16] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a35495..406b116 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 5.0.0 - Upgrade usage to highlight.js v11, you can find the breaking changes from the official page [here](https://highlightjs.readthedocs.io/en/latest/upgrade-11.html). +- Build the library with partial compilationMode. - feat: Add the missing functions from v11 in `HighlightJS` service. - Remove deprecated function in v11, such as `initHighlighting()`, `highlightBlock()`, `fixMarkup()` from `HighlightJS` service. From c8610d40cca1cf8d67b0e9b8d4158cd25692b8e9 Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 05:41:23 +0200 Subject: [PATCH 13/16] Update changelog --- .github/workflows/integrate.yml | 2 +- .github/workflows/netlify.yml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index af7ccc8..5a941f5 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -16,7 +16,7 @@ jobs: with: node-version: 14 - name: Install dependencies - run: npm install + run: npm ci - name: Build run: npm run build-lib - name: Test diff --git a/.github/workflows/netlify.yml b/.github/workflows/netlify.yml index 9593b54..570549a 100644 --- a/.github/workflows/netlify.yml +++ b/.github/workflows/netlify.yml @@ -14,9 +14,7 @@ jobs: with: node-version: 14 - name: Install dependencies - run: npm install - - name: Build and link library - run: npm run build-lib && npm run link-lib + run: npm ci - name: Build demo run: npm run build-demo - name: Deploy to Netlify From 4c9288fe6c104c9931f9bc11ab46e9ed4d78d159 Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 05:41:23 +0200 Subject: [PATCH 14/16] Update workflow --- .github/workflows/integrate.yml | 2 +- .github/workflows/netlify.yml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index af7ccc8..5a941f5 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -16,7 +16,7 @@ jobs: with: node-version: 14 - name: Install dependencies - run: npm install + run: npm ci - name: Build run: npm run build-lib - name: Test diff --git a/.github/workflows/netlify.yml b/.github/workflows/netlify.yml index 9593b54..570549a 100644 --- a/.github/workflows/netlify.yml +++ b/.github/workflows/netlify.yml @@ -14,9 +14,7 @@ jobs: with: node-version: 14 - name: Install dependencies - run: npm install - - name: Build and link library - run: npm run build-lib && npm run link-lib + run: npm ci - name: Build demo run: npm run build-demo - name: Deploy to Netlify From cf52efe26755718b0e58a95d17ed4424e4eef522 Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 05:47:37 +0200 Subject: [PATCH 15/16] Update karma config --- karma.conf.js | 24 ++++++-- package-lock.json | 78 ++++++++++---------------- package.json | 2 +- projects/ngx-highlightjs/karma.conf.js | 13 +++-- 4 files changed, 56 insertions(+), 61 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index fcdd726..0da8e84 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -9,16 +9,28 @@ module.exports = function (config) { require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), + require('karma-coverage'), require('@angular-devkit/build-angular/plugins/karma') ], client: { + jasmine: { + // you can add configuration options for Jasmine here + // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html + // for example, you can disable the random execution with `random: false` + // or set a specific seed with `seed: 4321` + }, clearContext: false // leave Jasmine Spec Runner output visible in browser }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, './coverage/ngx-highlight'), - reports: ['html', 'lcovonly', 'text-summary'], - fixWebpackSourcePaths: true + jasmineHtmlReporter: { + suppressAll: true // removes the duplicated traces + }, + coverageReporter: { + dir: require('path').join(__dirname, './coverage'), + subdir: '.', + reporters: [ + { type: 'html' }, + { type: 'text-summary' } + ] }, reporters: ['progress', 'kjhtml'], port: 9876, @@ -36,7 +48,7 @@ module.exports = function (config) { restartOnFileChange: true, capabilities: { chromeOptions: { - args: [ "--headless" ] + args: ["--headless"] }, 'browserName': 'chrome' }, diff --git a/package-lock.json b/package-lock.json index 986a8c5..5a286f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6789,48 +6789,6 @@ } } }, - "istanbul-lib-source-maps": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", - "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "rimraf": "^2.6.3", - "source-map": "^0.6.1" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "istanbul-reports": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", @@ -7184,17 +7142,37 @@ "which": "^1.2.1" } }, - "karma-coverage-istanbul-reporter": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/karma-coverage-istanbul-reporter/-/karma-coverage-istanbul-reporter-3.0.3.tgz", - "integrity": "sha512-wE4VFhG/QZv2Y4CdAYWDbMmcAHeS926ZIji4z+FkB2aF/EposRb6DP6G5ncT/wXhqUfAb/d7kZrNKPonbvsATw==", + "karma-coverage": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/karma-coverage/-/karma-coverage-2.0.3.tgz", + "integrity": "sha512-atDvLQqvPcLxhED0cmXYdsPMCQuh6Asa9FMZW1bhNqlVEhJoB9qyZ2BY1gu7D/rr5GLGb5QzYO4siQskxaWP/g==", "dev": true, "requires": { "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^4.0.1", "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^3.0.6", - "istanbul-reports": "^3.0.2", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.0", "minimatch": "^3.0.4" + }, + "dependencies": { + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } } }, "karma-jasmine": { @@ -7444,6 +7422,7 @@ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, + "optional": true, "requires": { "pify": "^4.0.1", "semver": "^5.6.0" @@ -7453,7 +7432,8 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true + "dev": true, + "optional": true } } }, diff --git a/package.json b/package.json index 929bff7..35cf14e 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "jasmine-spec-reporter": "~5.0.0", "karma": "~6.3.3", "karma-chrome-launcher": "~3.1.0", - "karma-coverage-istanbul-reporter": "~3.0.2", + "karma-coverage": "^2.0.3", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "ng-packagr": "^12.0.2", diff --git a/projects/ngx-highlightjs/karma.conf.js b/projects/ngx-highlightjs/karma.conf.js index c9f7994..443bd1f 100644 --- a/projects/ngx-highlightjs/karma.conf.js +++ b/projects/ngx-highlightjs/karma.conf.js @@ -9,16 +9,19 @@ module.exports = function (config) { require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), + require('karma-coverage'), require('@angular-devkit/build-angular/plugins/karma') ], client: { clearContext: false // leave Jasmine Spec Runner output visible in browser }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, '../../coverage/ngx-higlightjs'), - reports: ['html', 'lcovonly'], - fixWebpackSourcePaths: true + coverageReporter: { + dir: require('path').join(__dirname, '../../coverage/ngx-highlightjs'), + subdir: '.', + reporters: [ + { type: 'html' }, + { type: 'text-summary' } + ] }, reporters: ['progress', 'kjhtml'], port: 9876, From f08d6510b9f8b852891a39dce25dfce134b746ff Mon Sep 17 00:00:00 2001 From: Murhaf Sousli Date: Sat, 28 Aug 2021 05:53:39 +0200 Subject: [PATCH 16/16] Update README --- README.md | 2 +- projects/ngx-highlightjs/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index efa8c46..7f3be62 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ The following line will highlight the given code and append it to the host eleme | **[highlight]** | string | Accept code string to highlight, default `null` | | **[languages]** | string[] | An array of language names and aliases restricting auto detection to only these languages, default: `null` | | **[lineNumbers]** | boolean | A flag that indicates adding line numbers to highlighted code element | -| **(highlighted)** | HighlightResult | Stream that emits the result object when element is highlighted | +| **(highlighted)** | HighlightAutoResult | Stream that emits the result object when element is highlighted | ### NOTE diff --git a/projects/ngx-highlightjs/README.md b/projects/ngx-highlightjs/README.md index efa8c46..7f3be62 100644 --- a/projects/ngx-highlightjs/README.md +++ b/projects/ngx-highlightjs/README.md @@ -140,7 +140,7 @@ The following line will highlight the given code and append it to the host eleme | **[highlight]** | string | Accept code string to highlight, default `null` | | **[languages]** | string[] | An array of language names and aliases restricting auto detection to only these languages, default: `null` | | **[lineNumbers]** | boolean | A flag that indicates adding line numbers to highlighted code element | -| **(highlighted)** | HighlightResult | Stream that emits the result object when element is highlighted | +| **(highlighted)** | HighlightAutoResult | Stream that emits the result object when element is highlighted | ### NOTE