@deot/docs-dever 1.1.3 → 1.1.5
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 +3 -3
- package/dist/index.js +3 -3
- package/package.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -565,7 +565,7 @@ var configureWorkspaceServer = (options, resolvedWorkspace) => (server) => {
|
|
|
565
565
|
let realResourceRoot = realWorkspace;
|
|
566
566
|
try {
|
|
567
567
|
const rawPathname = getRawPathname(req.url || "/");
|
|
568
|
-
if (/^\/__docs\/preview
|
|
568
|
+
if (/^\/__docs\/(?:preview|raw-editor|markdown-editor)$/.test(rawPathname) && String(req.headers.accept || "").includes("text/html")) return next();
|
|
569
569
|
if (!options.preview && rawPathname.startsWith("/__docs/module/")) {
|
|
570
570
|
respondWorkspaceModule(req, res, resolved.projectRoot).catch((reason) => {
|
|
571
571
|
if (res.writableEnded) return;
|
|
@@ -746,7 +746,7 @@ var createHistoryPlugin = (options, resolvedWorkspace) => ({
|
|
|
746
746
|
const requestUrl = req.url || "/";
|
|
747
747
|
const url = requestUrl.replace(/\/+/g, "/").replace(/[?#].*$/s, "") || "";
|
|
748
748
|
const accept = String(req.headers?.accept || "text/html");
|
|
749
|
-
const isPreviewPage = /^\/__docs\/preview
|
|
749
|
+
const isPreviewPage = /^\/__docs\/(?:preview|raw-editor|markdown-editor)$/.test(url) && accept.includes("text/html");
|
|
750
750
|
const candidate = node_path.resolve(root, `.${url}`);
|
|
751
751
|
const isFile = node_fs.existsSync(candidate) && node_fs.statSync(candidate).isFile();
|
|
752
752
|
if (options.preview && url.startsWith("/__docs/") && !isPreviewPage) {
|
|
@@ -985,7 +985,7 @@ var createPreviewRequestHandler = (options) => {
|
|
|
985
985
|
return;
|
|
986
986
|
}
|
|
987
987
|
const pathname = decodeRequestPath(req.url || "/");
|
|
988
|
-
const isPreviewPage = /^\/__docs\/preview
|
|
988
|
+
const isPreviewPage = /^\/__docs\/(?:preview|raw-editor|markdown-editor)$/.test(pathname) && String(req.headers.accept || "").includes("text/html");
|
|
989
989
|
if (pathname.startsWith("/__docs/") && !isPreviewPage) {
|
|
990
990
|
res.statusCode = 404;
|
|
991
991
|
res.end("Not Found");
|
package/dist/index.js
CHANGED
|
@@ -536,7 +536,7 @@ var configureWorkspaceServer = (options, resolvedWorkspace) => (server) => {
|
|
|
536
536
|
let realResourceRoot = realWorkspace;
|
|
537
537
|
try {
|
|
538
538
|
const rawPathname = getRawPathname(req.url || "/");
|
|
539
|
-
if (/^\/__docs\/preview
|
|
539
|
+
if (/^\/__docs\/(?:preview|raw-editor|markdown-editor)$/.test(rawPathname) && String(req.headers.accept || "").includes("text/html")) return next();
|
|
540
540
|
if (!options.preview && rawPathname.startsWith("/__docs/module/")) {
|
|
541
541
|
respondWorkspaceModule(req, res, resolved.projectRoot).catch((reason) => {
|
|
542
542
|
if (res.writableEnded) return;
|
|
@@ -717,7 +717,7 @@ var createHistoryPlugin = (options, resolvedWorkspace) => ({
|
|
|
717
717
|
const requestUrl = req.url || "/";
|
|
718
718
|
const url = requestUrl.replace(/\/+/g, "/").replace(/[?#].*$/s, "") || "";
|
|
719
719
|
const accept = String(req.headers?.accept || "text/html");
|
|
720
|
-
const isPreviewPage = /^\/__docs\/preview
|
|
720
|
+
const isPreviewPage = /^\/__docs\/(?:preview|raw-editor|markdown-editor)$/.test(url) && accept.includes("text/html");
|
|
721
721
|
const candidate = path.resolve(root, `.${url}`);
|
|
722
722
|
const isFile = fs$1.existsSync(candidate) && fs$1.statSync(candidate).isFile();
|
|
723
723
|
if (options.preview && url.startsWith("/__docs/") && !isPreviewPage) {
|
|
@@ -956,7 +956,7 @@ var createPreviewRequestHandler = (options) => {
|
|
|
956
956
|
return;
|
|
957
957
|
}
|
|
958
958
|
const pathname = decodeRequestPath(req.url || "/");
|
|
959
|
-
const isPreviewPage = /^\/__docs\/preview
|
|
959
|
+
const isPreviewPage = /^\/__docs\/(?:preview|raw-editor|markdown-editor)$/.test(pathname) && String(req.headers.accept || "").includes("text/html");
|
|
960
960
|
if (pathname.startsWith("/__docs/") && !isPreviewPage) {
|
|
961
961
|
res.statusCode = 404;
|
|
962
962
|
res.end("Not Found");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deot/docs-dever",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@deot/dev-shared": "^2.9.
|
|
24
|
-
"autoprefixer": "^10.
|
|
25
|
-
"cssnano": "^
|
|
26
|
-
"ejs": "^
|
|
27
|
-
"fs-extra": "^11.
|
|
28
|
-
"inquirer": "^14.
|
|
29
|
-
"lodash-es": "^4.
|
|
30
|
-
"sass": "^1.
|
|
31
|
-
"vite": "^8.
|
|
23
|
+
"@deot/dev-shared": "^2.9.14",
|
|
24
|
+
"autoprefixer": "^10.6.1",
|
|
25
|
+
"cssnano": "^9.4.0",
|
|
26
|
+
"ejs": "^7.0.1",
|
|
27
|
+
"fs-extra": "^11.4.1",
|
|
28
|
+
"inquirer": "^14.2.3",
|
|
29
|
+
"lodash-es": "^4.18.1",
|
|
30
|
+
"sass": "^1.105.1",
|
|
31
|
+
"vite": "^8.3.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {}
|
|
34
34
|
}
|