@crowdin/app-project-module 0.98.0-cf-13 → 0.98.0-cf-15

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.
@@ -5,5 +5,6 @@ export declare function getAboutPageOptions(config: Config | UnauthorizedConfig)
5
5
  logo: string;
6
6
  manifest: string;
7
7
  storeLink: string;
8
+ showDebugLink: boolean;
8
9
  }>;
9
10
  export default function handle(config: Config | UnauthorizedConfig): (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
@@ -35,6 +35,7 @@ function getAboutPageOptions(config) {
35
35
  logo: (0, util_1.getLogoUrl)(),
36
36
  manifest: config.baseUrl + '/manifest.json',
37
37
  storeLink: (config === null || config === void 0 ? void 0 : config.detailPage) || detailPage,
38
+ showDebugLink: process.env.SHOW_DEBUG_LINK === 'true',
38
39
  };
39
40
  });
40
41
  }
@@ -52,7 +52,7 @@ function serveStatic(config, staticPath) {
52
52
  if ((_a = config.assetsConfig) === null || _a === void 0 ? void 0 : _a.fetcher) {
53
53
  const assetsFetcher = config.assetsConfig.fetcher;
54
54
  return (req, res, next) => __awaiter(this, void 0, void 0, function* () {
55
- const assetPath = staticPath.startsWith('/') ? `${staticPath}${req.path}` : `/${staticPath}${req.path}`;
55
+ const assetPath = `/${staticPath}/${req.path}`.replace(/\/+/g, '/');
56
56
  yield proxyAssetsResponse(assetsFetcher, assetPath, config.baseUrl, req, res, next);
57
57
  });
58
58
  }
@@ -4,6 +4,7 @@ interface AboutPageProps {
4
4
  logo: string;
5
5
  manifest: string;
6
6
  storeLink?: string;
7
+ showDebugLink?: boolean;
7
8
  }
8
9
  export declare const AboutPage: FC<AboutPageProps>;
9
10
  export {};
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AboutPage = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
- const AboutPage = ({ name, logo, manifest, storeLink }) => (react_1.default.createElement("html", null,
8
+ const AboutPage = ({ name, logo, manifest, storeLink, showDebugLink }) => (react_1.default.createElement("html", null,
9
9
  react_1.default.createElement("head", null,
10
10
  react_1.default.createElement("title", null, name),
11
11
  react_1.default.createElement("meta", { charSet: "utf-8" }),
@@ -63,5 +63,14 @@ const AboutPage = ({ name, logo, manifest, storeLink }) => (react_1.default.crea
63
63
  "Read more about",
64
64
  ' ',
65
65
  react_1.default.createElement("a", { href: storeLink, target: "_blank", title: `${name} on Crowdin Store` }, name),
66
- ".")))))))));
66
+ ".")),
67
+ showDebugLink && (react_1.default.createElement("div", { className: "mt-4 pt-3 border-top" },
68
+ react_1.default.createElement("p", { className: "mb-2" },
69
+ react_1.default.createElement("strong", null, "Developer Tools")),
70
+ react_1.default.createElement("p", null,
71
+ "Access the",
72
+ ' ',
73
+ react_1.default.createElement("a", { href: "/__debug", target: "_blank", title: "Open developer console in a new tab" }, "Developer Console"),
74
+ ' ',
75
+ "to inspect requests, debug issues, and monitor application behavior."))))))))));
67
76
  exports.AboutPage = AboutPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.98.0-cf-13",
3
+ "version": "0.98.0-cf-15",
4
4
  "description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",