From 3d168d4d8bc04c5d933545f4f531bdd639023a42 Mon Sep 17 00:00:00 2001 From: Cosmin Popovici Date: Thu, 25 Jul 2024 17:07:28 +0300 Subject: [PATCH] build(deps-dev): update posthtml-include to 2.0.1 --- package-lock.json | 16 ++++++++-------- package.json | 6 +++--- test/test-plugins.js | 15 ++++++++++++++- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 212e0be..5b0d11e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,12 +26,12 @@ "markdown-it-include": "^2.0.0", "markdown-it-toc-done-right": "^4.2.0", "posthtml-beautify": "^0.7.0", - "posthtml-include": "^1.7.4", + "posthtml-include": "^2.0.1", "posthtml-markdownit": "^3.1.0", "vitest": "^2.0.4" }, "engines": { - "node": ">=10" + "node": ">=18" } }, "node_modules/@ampproject/remapping": { @@ -3154,9 +3154,9 @@ } }, "node_modules/posthtml-include": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/posthtml-include/-/posthtml-include-1.7.4.tgz", - "integrity": "sha512-GO5QzHiM6/fXq8DxLoLN+jEW4sH/6nuGF9z+NJmP1qi1A3J2zCC7WwXrEwaPL3T8LrH+FL4IedK+mIJHbn5ZEA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/posthtml-include/-/posthtml-include-2.0.1.tgz", + "integrity": "sha512-1YXy4QWeJldosTKLPz6ecbI4e26jHmo3R97NNTKMQqITvZOY025+yvX/RUgvcD1VghLeACs0Y2P3GjtJo5s27Q==", "dev": true, "dependencies": { "posthtml": "^0.16.6", @@ -6300,9 +6300,9 @@ } }, "posthtml-include": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/posthtml-include/-/posthtml-include-1.7.4.tgz", - "integrity": "sha512-GO5QzHiM6/fXq8DxLoLN+jEW4sH/6nuGF9z+NJmP1qi1A3J2zCC7WwXrEwaPL3T8LrH+FL4IedK+mIJHbn5ZEA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/posthtml-include/-/posthtml-include-2.0.1.tgz", + "integrity": "sha512-1YXy4QWeJldosTKLPz6ecbI4e26jHmo3R97NNTKMQqITvZOY025+yvX/RUgvcD1VghLeACs0Y2P3GjtJo5s27Q==", "dev": true, "requires": { "posthtml": "^0.16.6", diff --git a/package.json b/package.json index 7a35d29..97f6ec3 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ }, "scripts": { "dev": "vitest", - "release": "npm run changelog && npx np", "docs": "node ./docs-src", - "lint": "biome lint ./src ./scripts", "test": "vitest run --coverage", + "lint": "biome lint ./src ./scripts", + "release": "npm run changelog && npx np", "changelog": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md && git commit -m 'chore: update changelog.md' && git push" }, "keywords": [ @@ -43,7 +43,7 @@ "markdown-it-include": "^2.0.0", "markdown-it-toc-done-right": "^4.2.0", "posthtml-beautify": "^0.7.0", - "posthtml-include": "^1.7.4", + "posthtml-include": "^2.0.1", "posthtml-markdownit": "^3.1.0", "vitest": "^2.0.4" } diff --git a/test/test-plugins.js b/test/test-plugins.js index 3034d8a..82cb390 100644 --- a/test/test-plugins.js +++ b/test/test-plugins.js @@ -45,7 +45,20 @@ test('Must include file using posthtml-include', async () => { const actual = ``; const expected = `

Included file

`; - const html = await posthtml([plugin({root: './test/templates', tag: 'component', attribute: 'src', plugins: [require('posthtml-include')({root: './test/templates', encoding: 'utf8'})]})]).process(actual).then(result => clean(result.html)); + const html = await posthtml([ + plugin({ + root: './test/templates', + tag: 'component', + attribute: 'src', + plugins: [ + require('posthtml-include')({ + root: './test/templates', + cwd: './test/templates', + encoding: 'utf8' + }) + ] + }) + ]).process(actual).then(result => clean(result.html)); expect(html).toBe(expected); });