minista 3.1.2 → 3.1.3

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.
@@ -18,12 +18,12 @@ function getStories(config) {
18
18
  const jsStories = Object.keys(JS_STORIES).map((storyFileKey) => {
19
19
  const storyFile = JS_STORIES[storyFileKey];
20
20
  const storyMeta = storyFile.default;
21
- const storyBase = "/" + config.main.storyapp.outDir;
22
- const storyId = (storyMeta.id || storyMeta.title || "").split("/").map((id) => id.trim().toLowerCase()).join("/");
23
- const storyTitle = (storyMeta.title || "").split("/").map((title) => title.trim()).join(" / ");
24
- if (!storyId || !storyTitle) {
21
+ if (!storyMeta?.id || !storyMeta?.title) {
25
22
  return [];
26
23
  }
24
+ const storyBase = "/" + config.main.storyapp.outDir;
25
+ const storyId = (storyMeta.id || storyMeta.title).split("/").map((id) => id.trim().toLowerCase()).join("/");
26
+ const storyTitle = storyMeta.title.split("/").map((title) => title.trim()).join(" / ");
27
27
  const storyList = Object.keys(storyFile).filter((key) => !["default", "metadata", "frontmatter"].includes(key)).map((key) => ({ storyKey: key, storyObj: storyFile[key] }));
28
28
  return storyList.map((item) => {
29
29
  const currentObj = item.storyObj;
@@ -1,5 +1,4 @@
1
1
  import path from "node:path";
2
- import { parse as parseUrl } from "node:url";
3
2
  import fetch from "node-fetch";
4
3
  import fs from "fs-extra";
5
4
  import fg from "fast-glob";
@@ -8,7 +7,7 @@ import { generateRemoteCache, generateRemotes } from "../generate/remote.js";
8
7
  import { getElements } from "../utility/element.js";
9
8
  import { getUniquePaths } from "../utility/path.js";
10
9
  function getRemoteExt(url) {
11
- const pathname = parseUrl(url).pathname || "";
10
+ const pathname = new URL(url).pathname || "";
12
11
  const parsedName = path.parse(pathname);
13
12
  return parsedName.ext.replace(/^\./, "") || "";
14
13
  }
@@ -1,5 +1,4 @@
1
1
  import path from "node:path";
2
- import { parse as parseUrl } from "node:url";
3
2
  import fs from "fs-extra";
4
3
  function getHtmlPath(pathname) {
5
4
  let fileName = pathname.endsWith("/") ? path.join(pathname, "index.html") : pathname + ".html";
@@ -22,9 +21,14 @@ function getUniquePaths(paths, excludes) {
22
21
  }
23
22
  }
24
23
  function isLocalPath(root, url) {
25
- const isAbsolute = parseUrl(url).protocol;
26
- if (!url || isAbsolute) {
24
+ if (!url)
27
25
  return false;
26
+ try {
27
+ const { protocol } = new URL(url);
28
+ if (protocol) {
29
+ return false;
30
+ }
31
+ } catch (_) {
28
32
  }
29
33
  const filePath = path.join(root, url);
30
34
  return fs.existsSync(filePath);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "minista",
3
3
  "description": "Static site generator with 100% static export from React and Vite",
4
- "version": "3.1.2",
4
+ "version": "3.1.3",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=14.15.0"
@@ -77,17 +77,17 @@
77
77
  "@qrac/svgstore": "^3.0.3",
78
78
  "@svgr/core": "^8.0.0",
79
79
  "@svgr/plugin-jsx": "^8.0.1",
80
- "@vitejs/plugin-react": "^4.0.0",
80
+ "@vitejs/plugin-react": "^4.0.3",
81
81
  "archiver": "^5.3.1",
82
82
  "cac": "^6.7.14",
83
- "dayjs": "^1.11.7",
83
+ "dayjs": "^1.11.9",
84
84
  "deepmerge-ts": "^5.1.0",
85
- "esbuild": "^0.17.19",
86
- "fast-glob": "^3.2.12",
85
+ "esbuild": "^0.18.15",
86
+ "fast-glob": "^3.3.0",
87
87
  "fs-extra": "^11.1.1",
88
88
  "iconv-lite": "^0.6.3",
89
89
  "image-size": "^1.0.2",
90
- "js-beautify": "^1.14.7",
90
+ "js-beautify": "^1.14.9",
91
91
  "mime-types": "^2.1.35",
92
92
  "mojigiri": "^0.3.0",
93
93
  "node-fetch": "^3.3.1",
@@ -95,7 +95,7 @@
95
95
  "picocolors": "^1.0.0",
96
96
  "picomatch": "^2.3.1",
97
97
  "react-helmet-async": "^1.3.0",
98
- "react-router-dom": "^6.11.2",
98
+ "react-router-dom": "^6.14.2",
99
99
  "rehype-highlight": "^6.0.0",
100
100
  "rehype-raw": "^6.1.1",
101
101
  "rehype-react": "^7.2.0",
@@ -104,8 +104,8 @@
104
104
  "remark-mdx-frontmatter": "^3.0.0",
105
105
  "remark-parse": "^10.0.2",
106
106
  "remark-rehype": "^10.1.0",
107
- "sharp": "^0.32.1",
107
+ "sharp": "^0.32.4",
108
108
  "unified": "^10.1.2",
109
- "vite": "^4.3.9"
109
+ "vite": "^4.4.6"
110
110
  }
111
111
  }