@forsakringskassan/docs-generator 2.14.4 → 2.15.0

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.
@@ -3,10 +3,10 @@
3
3
  var path$1 = require('node:path');
4
4
  var esbuild = require('esbuild');
5
5
  var vue = require('vue');
6
- var vue3 = require('./vue3-BqgRpcI0.js');
6
+ var vue3 = require('./vue3-CI942beq.js');
7
7
  var path = require('node:path/posix');
8
8
  require('@vue/compiler-sfc');
9
- require('./vendor-Bb38Rlio.js');
9
+ require('./vendor-Dlhn3sOl.js');
10
10
  require('node:url');
11
11
  require('fs');
12
12
  require('node:fs');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var vendor = require('./vendor-Bb38Rlio.js');
3
+ var vendor = require('./vendor-Dlhn3sOl.js');
4
4
  var path = require('node:path/posix');
5
5
  var path$1 = require('node:path');
6
6
  require('crypto');
@@ -8,7 +8,7 @@ var crypto = require('node:crypto');
8
8
  require('node:child_process');
9
9
  var fs = require('node:fs');
10
10
  var vue = require('vue');
11
- var vue3 = require('./vue3-BqgRpcI0.js');
11
+ var vue3 = require('./vue3-CI942beq.js');
12
12
 
13
13
  function findDocument(haystack, needle) {
14
14
  const match = haystack.find((it) => {
@@ -101,6 +101,17 @@ function getExampleName(filename) {
101
101
  return path$1.parse(filename).name;
102
102
  }
103
103
 
104
+ function normalizeLanguage(lang) {
105
+ switch (lang) {
106
+ case "ts":
107
+ return "typescript";
108
+ case "js":
109
+ return "javascript";
110
+ default:
111
+ return lang;
112
+ }
113
+ }
114
+
104
115
  function removeLinesInline(lines, { begin, end }) {
105
116
  for (let i = begin; i <= end; i++) {
106
117
  lines[i] = "";
@@ -119,11 +130,12 @@ function removeLinesInline(lines, { begin, end }) {
119
130
  function cutSnippets(code) {
120
131
  const lines = code.split(/\n/).map((it, index, lines2) => index < lines2.length - 1 ? `${it}
121
132
  ` : it);
122
- const directive = /\/\* +--- +cut (above|below|begin|end) +--- +\*\//;
133
+ const directive = /(?:\/\* +--- +cut (?<js>above|below|begin|end) +--- +\*\/|<!---? +cut (?<html>above|below|begin|end) +---?>)/;
123
134
  let buffer = -1;
124
135
  lines.forEach((line, index) => {
125
136
  const match = line.match(directive);
126
- const [, instruction] = match ?? ["", null];
137
+ const { js, html } = match?.groups ?? { js: null, html: null };
138
+ const instruction = js ?? html;
127
139
  if (!instruction) {
128
140
  return;
129
141
  }
@@ -182,11 +194,14 @@ function maybeDedent(value) {
182
194
  }
183
195
  }
184
196
  const transformations = {
197
+ html: [cutSnippets, maybeDedent],
198
+ vue: [cutSnippets, maybeDedent],
185
199
  javascript: [cutSnippets, stripEslintComments, maybeDedent],
186
200
  typescript: [cutSnippets, stripEslintComments, maybeDedent]
187
201
  };
188
202
  function transformCode(code, lang) {
189
- const fns = transformations[lang] ?? [];
203
+ const normalizedLanguage = normalizeLanguage(lang);
204
+ const fns = transformations[normalizedLanguage] ?? [];
190
205
  for (const fn of fns) {
191
206
  code = fn(code);
192
207
  }
@@ -280,16 +295,6 @@ function generateStaticExample(options) {
280
295
  };
281
296
  }
282
297
 
283
- function normalizeLanguage(lang) {
284
- switch (lang) {
285
- case "ts":
286
- return "typescript";
287
- case "js":
288
- return "javascript";
289
- default:
290
- return lang;
291
- }
292
- }
293
298
  function parseInfostring(infostring) {
294
299
  const [rawLanguage, ...rawTags] = infostring.trim().split(/\s+/);
295
300
  return {
package/dist/index.js CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  var fs = require('node:fs/promises');
4
4
  var path = require('node:path/posix');
5
- var vendor = require('./vendor-Bb38Rlio.js');
5
+ var vendor = require('./vendor-Dlhn3sOl.js');
6
6
  var path$1 = require('node:path');
7
7
  var require$$1 = require('crypto');
8
8
  require('node:crypto');
9
- var createMarkdownRenderer = require('./create-markdown-renderer-KS2pk3bP.js');
9
+ var createMarkdownRenderer = require('./create-markdown-renderer-CDFtdfff.js');
10
10
  var node_child_process = require('node:child_process');
11
11
  var util = require('node:util');
12
12
  var vueDocgenApi = require('vue-docgen-api');
@@ -43,7 +43,7 @@ require('tls');
43
43
  require('tty');
44
44
  require('querystring');
45
45
  require('vue');
46
- require('./vue3-BqgRpcI0.js');
46
+ require('./vue3-CI942beq.js');
47
47
 
48
48
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
49
49
  function toArray$2(value) {
package/dist/markdown.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var createMarkdownRenderer = require('./create-markdown-renderer-KS2pk3bP.js');
4
- require('./vendor-Bb38Rlio.js');
3
+ var createMarkdownRenderer = require('./create-markdown-renderer-CDFtdfff.js');
4
+ require('./vendor-Dlhn3sOl.js');
5
5
  require('node:url');
6
6
  require('node:path');
7
7
  require('fs');
@@ -37,7 +37,7 @@ require('querystring');
37
37
  require('node:path/posix');
38
38
  require('node:crypto');
39
39
  require('vue');
40
- require('./vue3-BqgRpcI0.js');
40
+ require('./vue3-CI942beq.js');
41
41
 
42
42
 
43
43