flowdoc-gen 0.1.3 → 0.1.4
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.cjs +6 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -38,6 +38,10 @@ __export(src_exports, {
|
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(src_exports);
|
|
40
40
|
|
|
41
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_jiti@1.21.7_postcss@8.5.15_tsx@4.22.4_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js
|
|
42
|
+
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
43
|
+
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
44
|
+
|
|
41
45
|
// src/generate.ts
|
|
42
46
|
var import_fs3 = require("fs");
|
|
43
47
|
var import_path3 = require("path");
|
|
@@ -1111,7 +1115,6 @@ var matchesGlob = (path, pattern) => {
|
|
|
1111
1115
|
var capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
1112
1116
|
|
|
1113
1117
|
// src/generate.ts
|
|
1114
|
-
var import_meta = {};
|
|
1115
1118
|
var generate = async (opts = {}) => {
|
|
1116
1119
|
const cwd = process.cwd();
|
|
1117
1120
|
const spinner = opts.quiet ? null : (0, import_ora.default)();
|
|
@@ -1164,7 +1167,7 @@ var writeUiHtml = async (outputDir, config) => {
|
|
|
1164
1167
|
const brand = config.theme?.brand ?? "#6366f1";
|
|
1165
1168
|
const title = config.name;
|
|
1166
1169
|
const darkMode = config.theme?.darkMode !== false;
|
|
1167
|
-
const cliRoot = (0, import_path3.dirname)((0, import_path3.dirname)((0, import_url.fileURLToPath)(
|
|
1170
|
+
const cliRoot = (0, import_path3.dirname)((0, import_path3.dirname)((0, import_url.fileURLToPath)(importMetaUrl)));
|
|
1168
1171
|
const uiAssetsSource = (0, import_path3.join)(cliRoot, "ui-assets");
|
|
1169
1172
|
const uiAssetsDest = (0, import_path3.join)(outputDir, "assets");
|
|
1170
1173
|
if ((0, import_fs3.existsSync)(uiAssetsSource)) {
|
|
@@ -1323,7 +1326,6 @@ var init = (cwd = process.cwd()) => {
|
|
|
1323
1326
|
var import_fs6 = require("fs");
|
|
1324
1327
|
var import_path6 = require("path");
|
|
1325
1328
|
var import_url2 = require("url");
|
|
1326
|
-
var import_meta2 = {};
|
|
1327
1329
|
var MIME = {
|
|
1328
1330
|
".html": "text/html",
|
|
1329
1331
|
".js": "application/javascript",
|
|
@@ -1346,7 +1348,7 @@ var flowdoc = (opts = {}) => {
|
|
|
1346
1348
|
const spec = buildSpec(routes, config);
|
|
1347
1349
|
(0, import_fs6.mkdirSync)(outputDir, { recursive: true });
|
|
1348
1350
|
(0, import_fs6.writeFileSync)((0, import_path6.join)(outputDir, "flowdoc.json"), JSON.stringify(spec, null, 2));
|
|
1349
|
-
const cliRoot = (0, import_path6.dirname)((0, import_path6.dirname)((0, import_url2.fileURLToPath)(
|
|
1351
|
+
const cliRoot = (0, import_path6.dirname)((0, import_path6.dirname)((0, import_url2.fileURLToPath)(importMetaUrl)));
|
|
1350
1352
|
const uiAssetsSource = (0, import_path6.join)(cliRoot, "ui-assets");
|
|
1351
1353
|
if ((0, import_fs6.existsSync)(uiAssetsSource)) {
|
|
1352
1354
|
const dest = (0, import_path6.join)(outputDir, "assets");
|