metalsmith-markdown-partials 2.4.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,9 +7,15 @@ A Metalsmith plugin that enables the use of Markdown partials.
7
7
  [![license: MIT][license-badge]][license-url]
8
8
  [![coverage][coverage-badge]][coverage-url]
9
9
  [![ESM/CommonJS][modules-badge]][npm-url]
10
+ [![Known Vulnerabilities](https://snyk.io/test/npm/metalsmith-markdown-partials/badge.svg)](https://snyk.io/test/npm/metalsmith-markdown-partials)
10
11
 
11
12
  Markdown fragments are inserted into the contents of a page markdown file by replacing an include marker with markdown partials. This allows for modular markdown and promotes reuse of content.
12
13
 
14
+ ## Features
15
+ - This plugin supports both ESM and CommonJS environments with no configuration needed:
16
+ - ESM: `import mdPartials from 'metalsmith-markdown-partials'`
17
+ - CommonJS: `const mdPartials = require('metalsmith-markdown-partials')`
18
+
13
19
  ## Installation
14
20
 
15
21
  ```js
@@ -19,9 +25,6 @@ $ npm install --save metalsmith-markdown-partials
19
25
  ## Usage
20
26
 
21
27
  ```js
22
- var mdPartials = require('metalsmith-markdown-partials');
23
-
24
- ...
25
28
  .use(mdPartials({
26
29
  libraryPath: './markdown-partials/',
27
30
  fileSuffix: '.md.njk',
@@ -155,22 +158,13 @@ To use this plugin with the Metalsmith CLI, add `metalsmith-markdown-partials` t
155
158
  }
156
159
  ```
157
160
 
158
- ## Author
159
-
160
- - [werner@glinka.co](https://github.com/wernerglinka)
161
-
162
161
  ## Test Coverage
163
162
 
164
163
  This project maintains high statement and line coverage for the source code. Coverage is verified during the release process using the c8 coverage tool.
165
164
 
166
- Coverage report (from latest test run):
167
-
168
- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
169
- ----------|---------|----------|---------|---------|-------------------
170
- All files | 94.11 | 79.16 | 100 | 94.11 |
171
- index.js | 94.11 | 79.16 | 100 | 94.11 | 83-85,135-137,175-177,186-187
172
-
165
+ ## Author
173
166
 
167
+ [werner@glinka.co](https://github.com/wernerglinka)
174
168
 
175
169
  ## License
176
170
 
@@ -182,6 +176,6 @@ Code released under [the MIT license](https://github.com/wernerglinka/metalsmith
182
176
  [metalsmith-url]: https://metalsmith.io
183
177
  [license-badge]: https://img.shields.io/github/license/wernerglinka/metalsmith-markdown-partials
184
178
  [license-url]: LICENSE
185
- [coverage-badge]: https://img.shields.io/badge/coverage-94%25-brightgreen
179
+ [coverage-badge]: https://img.shields.io/badge/test%20coverage-94%25-brightgreen
186
180
  [coverage-url]: #test-coverage
187
181
  [modules-badge]: https://img.shields.io/badge/modules-ESM%2FCJS-blue
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "metalsmith-markdown-partials",
3
- "version": "2.4.0",
4
- "description": "A Metalsmith plugin that allows the use of partial markdowm files",
3
+ "version": "2.5.1",
4
+ "description": "A Metalsmith plugin that allows the use of partial markdown files",
5
5
  "keywords": [
6
6
  "metalsmith-plugin",
7
7
  "metalsmith",
@@ -13,13 +13,20 @@
13
13
  "module": "./lib/index.js",
14
14
  "exports": {
15
15
  "import": "./lib/index.js",
16
- "require": "./lib/index.cjs"
16
+ "require": "./lib/index.cjs",
17
+ "default": "./lib/index.js"
17
18
  },
18
19
  "type": "module",
19
20
  "repository": {
20
21
  "type": "git",
21
22
  "url": "git+https://github.com/wernerglinka/metalsmith-markdown-partials.git"
22
23
  },
24
+ "files": [
25
+ "src",
26
+ "lib",
27
+ "LICENSE",
28
+ "README.md"
29
+ ],
23
30
  "author": {
24
31
  "name": "Werner Glinka",
25
32
  "email": "werner@glinka.co"
@@ -32,16 +39,16 @@
32
39
  "scripts": {
33
40
  "build": "microbundle --entry src/index.js --output lib/index.js --target node -f esm,cjs --strict --generateTypes=false",
34
41
  "changelog": "auto-changelog -u --commit-limit false --ignore-commit-pattern '^((dev|chore|ci):|Release)'",
35
- "coverage": "npm test && c8 report --reporter=text-lcov > ./coverage.info",
42
+ "coverage": "c8 --include=src/**/*.js --reporter=lcov --reporter=text-summary mocha 'test/index.js' 'test/cjs.test.cjs' -t 15000",
36
43
  "format": "prettier --write \"**/*.{yml,md,js,json}\"",
37
44
  "format:check": "prettier --list-different \"**/*.{yml,md,js,json}\"",
38
45
  "lint": "eslint --fix .",
39
46
  "lint:check": "eslint --fix-dry-run .",
40
47
  "prepublishOnly": "npm run build",
41
- "update-coverage": "node scripts/update-coverage-badge.js",
42
- "prerelease": "npm run update-coverage && git add README.md && git commit -m \"Update coverage badge in README\" || true",
43
- "release": "npm run build && GITHUB_TOKEN=$(grep GITHUB_TOKEN .env | cut -d '=' -f2) ./node_modules/.bin/release-it . ",
44
- "release:check": "npm run lint:check && npm run build && GITHUB_TOKEN=$(grep GITHUB_TOKEN .env | cut -d '=' -f2) ./node_modules/.bin/release-it . --dry-run",
48
+ "release:patch": "release-it patch",
49
+ "release:minor": "release-it minor",
50
+ "release:major": "release-it major",
51
+ "release:check": "npm run lint:check && npm run build && release-it --dry-run",
45
52
  "test": "c8 --include=src/**/*.js mocha 'test/index.js' 'test/cjs.test.cjs' -t 15000",
46
53
  "test:esm": "c8 --include=src/**/*.js mocha test/index.js -t 15000",
47
54
  "test:cjs": "c8 --include=src/**/*.js mocha test/cjs.test.cjs -t 15000",
@@ -51,21 +58,24 @@
51
58
  "devDependencies": {
52
59
  "auto-changelog": "^2.5.0",
53
60
  "c8": "^10.1.3",
54
- "eslint": "^9.14.0",
55
- "eslint-config-prettier": "^9.1.0",
61
+ "eslint": "^9.32.0",
62
+ "eslint-config-prettier": "^10.1.8",
56
63
  "metalsmith": "^2.6.3",
57
64
  "microbundle": "^0.15.1",
58
- "mocha": "^10.8.2",
59
- "prettier": "^3.3.3",
60
- "release-it": "^17.10.0"
65
+ "mocha": "^11.7.1",
66
+ "prettier": "^3.6.2",
67
+ "release-it": "19.0.4"
61
68
  },
62
69
  "peerDependencies": {
63
70
  "metalsmith": "^2.5.1"
64
71
  },
65
72
  "engines": {
66
- "node": ">=8"
73
+ "node": ">=18.0.0"
67
74
  },
68
75
  "publishConfig": {
69
76
  "access": "public"
77
+ },
78
+ "dependencies": {
79
+ "depcheck": "^1.4.7"
70
80
  }
71
81
  }
package/.c8rc.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "all": true,
3
- "include": ["src/**/*.js"],
4
- "exclude": ["node_modules/**", "test/**", "lib/**"],
5
- "reporter": ["text", "lcov"],
6
- "report-dir": "./coverage",
7
- "watermarks": {
8
- "lines": [80, 95],
9
- "functions": [80, 95],
10
- "branches": [80, 95],
11
- "statements": [80, 95]
12
- }
13
- }
package/.env DELETED
@@ -1 +0,0 @@
1
- GITHUB_TOKEN=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
package/.eslintrc.yml DELETED
@@ -1,8 +0,0 @@
1
- env:
2
- node: true
3
- es6: true
4
- extends:
5
- - 'eslint:recommended'
6
- - 'prettier'
7
- parserOptions:
8
- ecmaVersion: 2017
package/.gitattributes DELETED
@@ -1,7 +0,0 @@
1
- # Automatically normalize line endings for all text-based files
2
- # http://git-scm.com/docs/gitattributes#_end_of_line_conversion
3
- * text=auto eol=lf
4
-
5
- # For binary file types, prevent converting CRLF chars
6
- *.jpg -text
7
- *.png -text
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 20.12.1
package/.prettierignore DELETED
@@ -1,3 +0,0 @@
1
- test/fixtures/**
2
- .nyc_output/**
3
- package-lock.json
package/.release-it.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "hooks": {
3
- "before:init": ["npm run lint", "npm test"],
4
- "after:bump": "auto-changelog -p --commit-limit false --ignore-commit-pattern '^((dev|chore|ci):|Release)'",
5
- "after:npm:bump": "npm pack && ls *.tgz",
6
- "after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
7
- },
8
- "git": {
9
- "commitMessage": "Release ${version}",
10
- "commitArgs": ["-S"],
11
- "tagAnnotation": "Release ${version}",
12
- "tagArgs": ["-s"],
13
- "changelog": "auto-changelog -u --commit-limit false --ignore-commit-pattern '^((dev|chore|ci):|Release)' --stdout -t https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs"
14
- },
15
- "npm": { "publish": false },
16
- "github": {
17
- "release": true,
18
- "releaseName": "metalsmith-markdown-partials ${version}",
19
- "tokenRef": "GITHUB_TOKEN",
20
- "assets": ["metalsmith-markdown-partials-${version}.tgz"]
21
- }
22
- }
package/CHANGELOG.md DELETED
@@ -1,83 +0,0 @@
1
- ### Changelog
2
-
3
- All notable changes to this project will be documented in this file. Dates are displayed in UTC.
4
-
5
- Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
-
7
- #### [v2.4.0](https://github.com/wernerglinka/metalsmith-markdown-partials/compare/v2.3.1...v2.4.0)
8
-
9
- - feat: add dual ESM/CJS module support [`84b61d3`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/84b61d39b4d01f01066ac98719ffa15959254166)
10
- - updated dependencies [`07a2658`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/07a2658c276ed31c5630e30dd2924b96f2267e44)
11
- - updated to ms2.6 [`27a9944`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/27a9944d46388f558146eac1dcceb6a198cf1c68)
12
- - updated packages, ms to 2.5.0 [`c8ab04f`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/c8ab04f15994cbf243fc4e1deaf63515d6b86a34)
13
- - converted plugin to es6 [`b9a7573`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/b9a75738fa4c381b033016b435058d621289b551)
14
- - updated dependencies [`dec7b1b`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/dec7b1bdfcebc1dabf4102fc39d75a4ba9e87792)
15
- - Update coverage badge in README [`c375bdb`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/c375bdbbe899cbac465dddf19f6aaff949bcddb9)
16
- - Bump package.json to 2.3.1 [`dde7e7a`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/dde7e7a6d65489201412638385774e4c844137bc)
17
- - Bump package.json to 2.3.0 [`1623204`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/1623204d7b21bda03b774bdce9d480686786d7ac)
18
- - Bump package.json to 2.2.0 [`297b94d`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/297b94d7055b0168bc08dad2f183ce70e77acf16)
19
- - Bump package.json to 2.1.1 [`a7bf8a7`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/a7bf8a7fe34a6f2e20ab1bd393b4a1b59b21dd7d)
20
- - Bump package.json to 2.1.0 [`14d0fc7`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/14d0fc7d31333644c2b2bde7209eb8aa8a592ecf)
21
-
22
- #### [v2.3.1](https://github.com/wernerglinka/metalsmith-markdown-partials/compare/v2.3.0...v2.3.1)
23
-
24
- > 11 November 2024
25
-
26
- - updated dependencies [`7fc7b23`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/7fc7b233da4d6fb3a24584349a144f0a7b88f3db)
27
- - Bump package.json to 2.3.1 [`eaadf39`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/eaadf391660aa1cc99697c8ecc25d1ea310358ea)
28
-
29
- #### [v2.3.0](https://github.com/wernerglinka/metalsmith-markdown-partials/compare/v2.2.0...v2.3.0)
30
-
31
- > 31 January 2024
32
-
33
- - converted plugin to es6 [`f14e341`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/f14e341185f76bcc1a4954abf2f1d84931623799)
34
- - Bump package.json to 2.3.0 [`f419a58`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/f419a58a79fbda033756f7127b44597c27b0aa4e)
35
-
36
- #### [v2.2.0](https://github.com/wernerglinka/metalsmith-markdown-partials/compare/v2.1.1...v2.2.0)
37
-
38
- > 2 June 2023
39
-
40
- - updated to ms2.6 [`4f52254`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/4f52254fc276df1def382ae5981e137f260c108a)
41
- - Bump package.json to 2.2.0 [`2ab528c`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/2ab528cefca34187a6accc11f146ac0ad8ce7686)
42
-
43
- #### [v2.1.1](https://github.com/wernerglinka/metalsmith-markdown-partials/compare/v2.1.0...v2.1.1)
44
-
45
- > 18 October 2022
46
-
47
- - updated dependencies [`a8a94d1`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/a8a94d124e017ace3aebdb0f900d252713f79f12)
48
- - Bump package.json to 2.1.1 [`e313840`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/e313840d40cf148fe5a63a79f658e85de70c4186)
49
-
50
- #### [v2.1.0](https://github.com/wernerglinka/metalsmith-markdown-partials/compare/v2.0.2...v2.1.0)
51
-
52
- > 24 September 2022
53
-
54
- - updated packages, ms to 2.5.0 [`6bcffce`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/6bcffcee79a9535ad638cac873b1559e102c1d60)
55
- - Bump package.json to 2.1.0 [`e2e0691`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/e2e0691345181406e50e4041a15f7f192b5ec0d2)
56
- - Bump package.json to 2.0.4 [`1252474`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/125247419f2dac902c9af2bd0b06c3164bb02c35)
57
- - Bump package.json to 2.0.3 [`7a9de6a`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/7a9de6a33828819988b14da0f65378fab5aafea9)
58
-
59
- #### [v2.0.2](https://github.com/wernerglinka/metalsmith-markdown-partials/compare/v2.0.1...v2.0.2)
60
-
61
- > 3 February 2022
62
-
63
- - updated readme file [`c3998e9`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/c3998e9d5dc8ccb3cbd0bdd6114c43bdae5f212a)
64
-
65
- #### [v2.0.1](https://github.com/wernerglinka/metalsmith-markdown-partials/compare/v2.0.0...v2.0.1)
66
-
67
- > 3 February 2022
68
-
69
- - refactored plugin code, moved library into content folder [`124154d`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/124154da94875adf561987dd890451d0d5f70183)
70
-
71
- #### v2.0.0
72
-
73
- > 1 February 2022
74
-
75
- - added various config files [`1be389c`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/1be389cb9aedf82405c08c79cdfa866e7d3560d9)
76
- - updated readme [`d037ed5`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/d037ed5a42f0743f28e37bc07c0a52393ad53028)
77
- - updated to ES6 style JS, added license [`37b000f`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/37b000fa3669d928f693ec23a7ccfa629c0e7163)
78
- - added test [`d998103`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/d998103cb57b4a35ac9224afb11f4264b56f4abe)
79
- - initial commit [`9a91277`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/9a91277da228d9a718b2c86b012901559c95470d)
80
- - streamlined code and added to readme.md [`67c32be`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/67c32be34771325f407b9652dc3e7760971e3574)
81
- - added package.json [`86bfc7d`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/86bfc7d8de66be9127d612c5c5a9a79258a413f8)
82
- - removed initial debug directory [`46643bd`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/46643bd1aa19f45a9bf1b2513b6c7683da3eff78)
83
- - added install snippet [`321fb60`](https://github.com/wernerglinka/metalsmith-markdown-partials/commit/321fb6042240e1147b90468938911f6d8ed88f28)