nextjs-cms 0.5.14 → 0.5.16
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/core/config/loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/core/config/loader.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,QAAO,OAwCnC,CAAA"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { existsSync } from 'fs';
|
|
2
2
|
import { resolve, join } from 'path';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return req(id);
|
|
7
|
-
};
|
|
3
|
+
import { createRequire } from 'module';
|
|
4
|
+
// Create a require function that works in ES modules
|
|
5
|
+
const safeRequire = createRequire(import.meta.url);
|
|
8
6
|
export const loadConfigModule = () => {
|
|
9
7
|
const cwd = process.cwd();
|
|
10
8
|
const candidates = [
|
|
@@ -29,7 +27,7 @@ export const loadConfigModule = () => {
|
|
|
29
27
|
unregister = register({ format: 'cjs', loader: 'ts' }).unregister;
|
|
30
28
|
}
|
|
31
29
|
catch {
|
|
32
|
-
throw new Error(`Unable to load TypeScript config '${found}'. Install 'esbuild-register'
|
|
30
|
+
throw new Error(`Unable to load TypeScript config '${found}'. Install 'esbuild-register', or provide lz.config.js/json.`);
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
33
|
const mod = safeRequire(found);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionFactory.d.ts","sourceRoot":"","sources":["../../../src/core/factories/SectionFactory.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAA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'chalk';
|
|
|
5
5
|
import { eq } from 'drizzle-orm';
|
|
6
6
|
import chokidar from 'chokidar';
|
|
7
7
|
import fs from 'fs';
|
|
8
|
+
import { createRequire } from 'module';
|
|
8
9
|
import { db } from '../../db/client.js';
|
|
9
10
|
import { AdminPrivilegesTable } from '../../db/schema.js';
|
|
10
11
|
import { getCMSConfig } from '../config/index.js';
|
|
11
12
|
const cmsConfig = getCMSConfig();
|
|
12
13
|
const hotMarkerFile = resolve(process.cwd(), 'next-cms-sectioninfo.js');
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return req(id);
|
|
16
|
-
};
|
|
14
|
+
// Create a require function that works in ES modules
|
|
15
|
+
const safeRequire = createRequire(import.meta.url);
|
|
17
16
|
/**
|
|
18
17
|
* Register esbuild-register only once per process.
|
|
19
18
|
* Node's require cache ensures each TS module is evaluated once.
|
|
@@ -25,7 +24,7 @@ let tsLoaderRegistered = false;
|
|
|
25
24
|
* @returns The default export of the section file.
|
|
26
25
|
*/
|
|
27
26
|
const requireModuleRuntime = (absPath) => {
|
|
28
|
-
const isTs = absPath.endsWith('.
|
|
27
|
+
const isTs = absPath.endsWith('.ts') || absPath.endsWith('.cts') || absPath.endsWith('.mts');
|
|
29
28
|
if (isTs && !tsLoaderRegistered) {
|
|
30
29
|
try {
|
|
31
30
|
const { register } = safeRequire('esbuild-register/dist/node');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextjs-cms",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.16",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -153,8 +153,8 @@
|
|
|
153
153
|
"tsx": "^4.20.6",
|
|
154
154
|
"typescript": "^5.9.2",
|
|
155
155
|
"@lzcms/eslint-config": "0.3.0",
|
|
156
|
-
"@lzcms/
|
|
157
|
-
"@lzcms/
|
|
156
|
+
"@lzcms/tsconfig": "0.1.0",
|
|
157
|
+
"@lzcms/prettier-config": "0.1.0"
|
|
158
158
|
},
|
|
159
159
|
"license": "MIT",
|
|
160
160
|
"keywords": [
|