@easy-cms/next 1.20.0 → 1.20.1

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.
Files changed (2) hide show
  1. package/dist/config.js +17 -2
  2. package/package.json +5 -5
package/dist/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/config.ts
2
- import { existsSync } from "fs";
2
+ import { existsSync, realpathSync } from "fs";
3
3
  import { createRequire } from "module";
4
4
  import { dirname, isAbsolute, join, relative, resolve } from "path";
5
5
  import {
@@ -41,6 +41,21 @@ function withEasyCMS(nextConfig = {}, options = {}) {
41
41
  };
42
42
  };
43
43
  }
44
+ function packageLink(specifier, file, root) {
45
+ if (specifier.startsWith(".") || isAbsolute(specifier)) return [];
46
+ const name = specifier.split("/").slice(0, specifier.startsWith("@") ? 2 : 1).join("/");
47
+ for (let dir = root; ; dir = dirname(dir)) {
48
+ const folder = join(dir, "node_modules", name);
49
+ if (existsSync(join(folder, "package.json"))) {
50
+ const inside = relative(realpathSync(folder), file);
51
+ return [
52
+ join(folder, "package.json"),
53
+ ...inside.startsWith("..") ? [] : [join(folder, inside)]
54
+ ];
55
+ }
56
+ if (dirname(dir) === dir) return [];
57
+ }
58
+ }
44
59
  async function tracedFiles(root, configPath) {
45
60
  const toGlob = (path) => relative(root, path).replace(/\\/g, "/");
46
61
  const files = ["easy-cms/migrations/**"];
@@ -59,7 +74,7 @@ async function tracedFiles(root, configPath) {
59
74
  const withPlugins = config ? await applyPlugins(config).catch(() => config) : void 0;
60
75
  for (const specifier of withPlugins?.admin?.modules ?? []) {
61
76
  const module = resolveAdminModule(specifier, root);
62
- if (module) files.push(toGlob(module));
77
+ if (module) files.push(toGlob(module), ...packageLink(specifier, module, root).map(toGlob));
63
78
  else console.warn(`[easy-cms] Admin module "${specifier}" not found from ${root}.`);
64
79
  }
65
80
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/next",
3
- "version": "1.20.0",
3
+ "version": "1.20.1",
4
4
  "description": "Next.js adapter for Easy CMS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,19 +26,19 @@
26
26
  "node": ">=22.12"
27
27
  },
28
28
  "dependencies": {
29
- "@easy-cms/admin": "^1.20.0"
29
+ "@easy-cms/admin": "^1.20.1"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "next": ">=15.0.0",
33
33
  "react": ">=19.0.0",
34
- "@easy-cms/core": "^1.20.0"
34
+ "@easy-cms/core": "^1.20.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/react": "^19.2.0",
38
38
  "next": "^16.4.3",
39
39
  "react": "^19.2.0",
40
- "@easy-cms/core": "^1.20.0",
41
- "@easy-cms/db-sqlite": "^1.20.0"
40
+ "@easy-cms/db-sqlite": "^1.20.1",
41
+ "@easy-cms/core": "^1.20.1"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public"