@easy-cms/next 0.1.0 → 0.2.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/dist/config.d.ts CHANGED
@@ -2,11 +2,14 @@
2
2
  interface NextConfigLike {
3
3
  serverExternalPackages?: string[];
4
4
  outputFileTracingIncludes?: Record<string, string[]>;
5
- [key: string]: unknown;
6
5
  }
7
- type NextConfigInput = NextConfigLike | ((phase: string, ctx: {
8
- defaultConfig: NextConfigLike;
9
- }) => NextConfigLike | Promise<NextConfigLike>);
6
+ /**
7
+ * A Next config object, or the function form Next also accepts. Generic rather than an index
8
+ * signature, so Next's own `NextConfig` interface is accepted as is.
9
+ */
10
+ type NextConfigInput<T extends object = NextConfigLike> = T | ((phase: string, ctx: {
11
+ defaultConfig: any;
12
+ }) => T | Promise<T>);
10
13
  interface WithEasyCMSOptions {
11
14
  /** Path to the Easy CMS config, relative to the project root. Default: `easy-cms.config.ts` (or .mts/.js/.mjs). */
12
15
  readonly configPath?: string;
@@ -24,8 +27,8 @@ declare const SERVER_EXTERNAL_PACKAGES: string[];
24
27
  * export default withEasyCMS({ ... })
25
28
  * ```
26
29
  */
27
- declare function withEasyCMS(nextConfig?: NextConfigInput, options?: WithEasyCMSOptions): (phase: string, ctx: {
28
- defaultConfig: NextConfigLike;
29
- }) => Promise<NextConfigLike>;
30
+ declare function withEasyCMS<T extends object = NextConfigLike>(nextConfig?: NextConfigInput<T>, options?: WithEasyCMSOptions): (phase: string, ctx: {
31
+ defaultConfig: any;
32
+ }) => Promise<T & Required<NextConfigLike>>;
30
33
 
31
- export { SERVER_EXTERNAL_PACKAGES, type WithEasyCMSOptions, withEasyCMS };
34
+ export { type NextConfigInput, SERVER_EXTERNAL_PACKAGES, type WithEasyCMSOptions, withEasyCMS };
package/dist/config.js CHANGED
@@ -20,7 +20,8 @@ var SERVER_EXTERNAL_PACKAGES = [
20
20
  ];
21
21
  function withEasyCMS(nextConfig = {}, options = {}) {
22
22
  return async (phase, ctx) => {
23
- const base = typeof nextConfig === "function" ? await nextConfig(phase, ctx) : nextConfig;
23
+ const config = typeof nextConfig === "function" ? await nextConfig(phase, ctx) : nextConfig;
24
+ const base = config;
24
25
  const root = process.cwd();
25
26
  const include = [...await tracedFiles(root, options.configPath)];
26
27
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/next",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Next.js adapter for Easy CMS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,16 +22,16 @@
22
22
  "node": ">=22.12"
23
23
  },
24
24
  "dependencies": {
25
- "@easy-cms/admin": "^0.1.0"
25
+ "@easy-cms/admin": "^0.2.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "next": ">=15.0.0",
29
- "@easy-cms/core": "^0.1.0"
29
+ "@easy-cms/core": "^0.2.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "next": "^16.3.6",
33
- "@easy-cms/db-sqlite": "^0.1.0",
34
- "@easy-cms/core": "^0.1.0"
33
+ "@easy-cms/core": "^0.2.0",
34
+ "@easy-cms/db-sqlite": "^0.2.0"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"