markdown-magic 4.0.1 → 4.0.2

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.
Files changed (2) hide show
  1. package/package.json +17 -15
  2. package/src/index.js +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-magic",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "Automatically update markdown files with content from external sources",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -17,6 +17,16 @@
17
17
  "cli.js",
18
18
  "types"
19
19
  ],
20
+ "scripts": {
21
+ "types": "tsc --emitDeclarationOnly --outDir types",
22
+ "docs": "node examples/generate-readme.js",
23
+ "test": "uvu . '.test.([mc]js|[jt]sx?)$'",
24
+ "cli": "node ./cli.js --path 'README.md' --config ./markdown.config.js",
25
+ "postpublish": "git push origin && git push origin --tags",
26
+ "release:patch": "pnpm version patch --git-tag-version && pnpm publish",
27
+ "release:minor": "pnpm version minor --git-tag-version && pnpm publish",
28
+ "release:major": "pnpm version major --git-tag-version && pnpm publish"
29
+ },
20
30
  "author": "David Wells",
21
31
  "license": "MIT",
22
32
  "homepage": "https://github.com/DavidWells/markdown-magic#readme",
@@ -26,6 +36,9 @@
26
36
  },
27
37
  "dependencies": {
28
38
  "@davidwells/md-utils": "0.0.53",
39
+ "comment-block-parser": "1.1.0",
40
+ "comment-block-replacer": "0.1.1",
41
+ "comment-block-transformer": "0.2.0",
29
42
  "globrex": "^0.1.2",
30
43
  "gray-matter": "^4.0.3",
31
44
  "is-glob": "^4.0.3",
@@ -39,10 +52,7 @@
39
52
  "punycode": "^2.3.1",
40
53
  "smart-glob": "^1.0.2",
41
54
  "string-width": "^4.2.3",
42
- "sync-request": "^6.1.0",
43
- "comment-block-parser": "1.0.7",
44
- "comment-block-transformer": "0.1.1",
45
- "comment-block-replacer": "0.1.0"
55
+ "sync-request": "^6.1.0"
46
56
  },
47
57
  "devDependencies": {
48
58
  "ansi-styles": "^4.2.1",
@@ -56,13 +66,5 @@
56
66
  "publishConfig": {
57
67
  "access": "public"
58
68
  },
59
- "scripts": {
60
- "types": "tsc --emitDeclarationOnly --outDir types",
61
- "docs": "node examples/generate-readme.js",
62
- "test": "uvu . '.test.([mc]js|[jt]sx?)$'",
63
- "cli": "node ./cli.js --path 'README.md' --config ./markdown.config.js",
64
- "release:patch": "pnpm version patch --git-tag-version && pnpm publish",
65
- "release:minor": "pnpm version minor --git-tag-version && pnpm publish",
66
- "release:major": "pnpm version major --git-tag-version && pnpm publish"
67
- }
68
- }
69
+ "gitHead": "546a15fac58d28315057449adf122a5ab8575901"
70
+ }
package/src/index.js CHANGED
@@ -501,10 +501,11 @@ async function markdownMagic(globOrOpts = {}, options = {}) {
501
501
  errors = missing.map((item, i) => {
502
502
  const errorMessage = `Missing ${item.missingTransforms.length} transforms in ${item.srcPath}`
503
503
  const issues = item.missingTransforms.map((trn) => {
504
+ const lines = trn.block && trn.block.lines ? trn.block.lines : trn.lines
504
505
  // logger('trn', trn)
505
506
  // const rowData = getRowAndColumnFromCharPos(item.updatedContents, trn.open.start)
506
- const location = `${item.srcPath}:${trn.lines[0]}:0`
507
- const message = `Transform "${trn.transform}" at line ${trn.lines[0]} does not exist. → ${location}`
507
+ const location = `${item.srcPath}:${lines[0]}:0`
508
+ const message = `Transform "${trn.transform}" at line ${lines[0]} does not exist. → ${location}`
508
509
  return {
509
510
  message,
510
511
  location