@forsakringskassan/docs-generator 2.28.9 → 2.28.11

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/dist/index.mjs CHANGED
@@ -4,8 +4,8 @@ const require = $createRequire(import.meta.url);
4
4
 
5
5
  import fs from 'node:fs/promises';
6
6
  import path from 'node:path/posix';
7
- import { g as globSync, m as minimatch, M as MarkdownIt, d as dedent, e as closest, f as distance, h as fm, i as isCI, j as glob, k as moduleImporter, l as cliProgress, t as tinylr, w as watch, n as createInstance, o as fse } from './vendor-B8uiqaoK.mjs';
8
- import { g as generateId, p as parseInfostring, i as isDocumentPage, n as normalizePath, a as getFingerprint, h as hasTag, f as findTag, b as getOutputFilePath, d as htmlencode, e as exampleWorkerUrl, c as createMarkdownRenderer, j as generateExample } from './create-markdown-renderer-CyfvyYyU.mjs';
7
+ import { g as globSync, m as minimatch, M as MarkdownIt, d as dedent, e as closest, f as distance, h as fm, i as isCI, j as glob, k as moduleImporter, l as cliProgress, t as tinylr, w as watch, n as createInstance, o as fse } from './vendor-CMzqoPR8.mjs';
8
+ import { g as generateId, p as parseInfostring, i as isDocumentPage, n as normalizePath, a as getFingerprint, h as hasTag, f as findTag, b as getOutputFilePath, d as htmlencode, e as exampleWorkerUrl, c as createMarkdownRenderer, j as generateExample } from './create-markdown-renderer-DcyK76t5.mjs';
9
9
  import path$1 from 'node:path';
10
10
  import require$$1 from 'crypto';
11
11
  import 'node:crypto';
@@ -23,7 +23,6 @@ import { t as tsconfigPath } from './tsconfig-path-bG7G_cK8.mjs';
23
23
  import esbuild$1, { build } from 'esbuild';
24
24
  import { Worker } from 'node:worker_threads';
25
25
  import nunjucks from 'nunjucks';
26
- import express from 'express';
27
26
  import 'fs';
28
27
  import 'node:events';
29
28
  import 'node:stream';
@@ -48,7 +47,7 @@ import 'tls';
48
47
  import 'tty';
49
48
  import 'querystring';
50
49
  import 'vue';
51
- import './vue3-BnNvoOYe.mjs';
50
+ import './vue3-CprzF_70.mjs';
52
51
 
53
52
  function toArray$2(value) {
54
53
  return Array.isArray(value) ? value : [value];
@@ -2936,7 +2935,26 @@ function createRebuilder(callback, livereload) {
2936
2935
  }
2937
2936
  return rebuild;
2938
2937
  }
2938
+ function isImportError(err) {
2939
+ return Boolean(err && typeof err === "object" && "code" in err);
2940
+ }
2941
+ async function importExpress() {
2942
+ try {
2943
+ const { default: express } = await import('express');
2944
+ return express;
2945
+ } catch (err) {
2946
+ if (isImportError(err) && err.code === "ERR_MODULE_NOT_FOUND") {
2947
+ throw new Error(
2948
+ "docs-generator serve() requires the optional peerDependency express to be installed",
2949
+ { cause: err }
2950
+ );
2951
+ } else {
2952
+ throw err;
2953
+ }
2954
+ }
2955
+ }
2939
2956
  async function serve(options) {
2957
+ const express = await importExpress();
2940
2958
  const app = express();
2941
2959
  app.use(express.static(options.outputFolder));
2942
2960
  const server = app.listen(8080);