@canopy-iiif/app 1.6.22 → 1.8.0

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/lib/build/dev.js CHANGED
@@ -22,14 +22,24 @@ const {
22
22
  const APP_COMPONENTS_DIR = path.join(process.cwd(), "app", "components");
23
23
 
24
24
  function resolveTailwindCli() {
25
+ const root = process.cwd();
26
+ let cliEntry = null;
27
+ try {
28
+ cliEntry = require.resolve("@tailwindcss/cli/dist/index.mjs", { paths: [root] });
29
+ } catch (_) {
30
+ cliEntry = null;
31
+ }
32
+ if (cliEntry) {
33
+ return { cmd: process.execPath || "node", args: [cliEntry] };
34
+ }
25
35
  const bin = path.join(
26
- process.cwd(),
36
+ root,
27
37
  "node_modules",
28
38
  ".bin",
29
39
  process.platform === "win32" ? "tailwindcss.cmd" : "tailwindcss"
30
40
  );
31
41
  if (fs.existsSync(bin)) return { cmd: bin, args: [] };
32
- return { cmd: 'tailwindcss', args: [] };
42
+ return { cmd: "tailwindcss", args: [] };
33
43
  }
34
44
  const PORT = Number(process.env.PORT || 5001);
35
45
  const BUILD_MODULE_PATH = path.resolve(__dirname, "build.js");
package/lib/build/mdx.js CHANGED
@@ -14,6 +14,11 @@ const {
14
14
  readSiteMetadata,
15
15
  readPrimaryNavigation,
16
16
  } = require("../common");
17
+
18
+ const globalRoot = typeof globalThis !== "undefined" ? globalThis : global;
19
+ if (globalRoot && typeof globalRoot.__canopyRequire !== "function") {
20
+ globalRoot.__canopyRequire = typeof require === "function" ? require : null;
21
+ }
17
22
  let remarkGfm = null;
18
23
  try {
19
24
  const mod = require("remark-gfm");
@@ -8,8 +8,18 @@ const {
8
8
  } = require("../common");
9
9
 
10
10
  function resolveTailwindCli() {
11
+ const root = process.cwd();
12
+ let cliEntry = null;
13
+ try {
14
+ cliEntry = require.resolve("@tailwindcss/cli/dist/index.mjs", { paths: [root] });
15
+ } catch (_) {
16
+ cliEntry = null;
17
+ }
18
+ if (cliEntry) {
19
+ return {cmd: process.execPath || "node", args: [cliEntry]};
20
+ }
11
21
  const localBin = path.join(
12
- process.cwd(),
22
+ root,
13
23
  "node_modules",
14
24
  ".bin",
15
25
  process.platform === "win32" ? "tailwindcss.cmd" : "tailwindcss"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canopy-iiif/app",
3
- "version": "1.6.22",
3
+ "version": "1.8.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "Mat Jordan <mat@northwestern.edu>",