nextjs-cms 0.9.29 → 0.9.31
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/api/actions/pages.d.ts +3 -3
- package/dist/api/trpc/error-logging.d.ts +14 -0
- package/dist/api/trpc/error-logging.d.ts.map +1 -0
- package/dist/api/trpc/error-logging.js +75 -0
- package/dist/api/trpc/root.d.ts +3 -3
- package/dist/api/trpc/routers/navigation.d.ts +3 -3
- package/dist/api/trpc/server.d.ts +9 -9
- package/dist/api/trpc/server.d.ts.map +1 -1
- package/dist/plugins/derive.d.ts +0 -8
- package/dist/plugins/derive.d.ts.map +1 -1
- package/dist/plugins/derive.js +0 -32
- package/dist/plugins/loader.d.ts +3 -1
- package/dist/plugins/loader.d.ts.map +1 -1
- package/dist/plugins/loader.js +28 -6
- package/dist/plugins/server.d.ts +1 -1
- package/dist/plugins/server.d.ts.map +1 -1
- package/dist/plugins/server.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/api/trpc/server.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAUjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEvF,MAAM,WAAW,uBAAuB,CAAC,KAAK,SAAS,YAAY;IAC/D,OAAO,CAAC,EAAE,0BAA0B,CAAC,KAAK,CAAC,CAAA;IAC3C,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;CACjE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,K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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAM0/Y,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAA+1nB,CAAC;;;;;+BAA0E,CAAC;;;;;;+BAAgH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAAt4/B,CAAC;;;;;+BAAuE,CAAC;;;;;;+BAA6G,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAtFl4B,OAAO,CAAC,SAAS,CAAC;EAqFvD"}
|
package/dist/plugins/derive.d.ts
CHANGED
|
@@ -21,12 +21,4 @@ export declare function derivePluginName(pluginPackage: string): string;
|
|
|
21
21
|
* "@nextjscms/plugin-google-analytics" → "googleAnalytics"
|
|
22
22
|
*/
|
|
23
23
|
export declare function derivePluginRouterKey(pluginPackage: string): string;
|
|
24
|
-
/**
|
|
25
|
-
* Helper for plugin routers: derive the plugin's canonical name by reading
|
|
26
|
-
* its own package.json. Pass `import.meta.url` from the plugin's router file.
|
|
27
|
-
*
|
|
28
|
-
* Walks up from the calling module's directory until it finds a package.json
|
|
29
|
-
* with a "name" field, then applies {@link derivePluginName}.
|
|
30
|
-
*/
|
|
31
|
-
export declare function extractPluginName(importMetaUrl: string): string;
|
|
32
24
|
//# sourceMappingURL=derive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../src/plugins/derive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../src/plugins/derive.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,uBAAuB,CAAA;AAEzD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAe9D;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAanE"}
|
package/dist/plugins/derive.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
1
|
export const PLUGIN_PACKAGE_PREFIX = '@nextjscms/plugin-';
|
|
5
2
|
/**
|
|
6
3
|
* Derive a plugin's canonical internal name from its npm package name.
|
|
@@ -46,32 +43,3 @@ export function derivePluginRouterKey(pluginPackage) {
|
|
|
46
43
|
}
|
|
47
44
|
return first + rest.map((part) => part[0]?.toUpperCase() + part.slice(1)).join('');
|
|
48
45
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Helper for plugin routers: derive the plugin's canonical name by reading
|
|
51
|
-
* its own package.json. Pass `import.meta.url` from the plugin's router file.
|
|
52
|
-
*
|
|
53
|
-
* Walks up from the calling module's directory until it finds a package.json
|
|
54
|
-
* with a "name" field, then applies {@link derivePluginName}.
|
|
55
|
-
*/
|
|
56
|
-
export function extractPluginName(importMetaUrl) {
|
|
57
|
-
const startDir = path.dirname(fileURLToPath(importMetaUrl));
|
|
58
|
-
let dir = startDir;
|
|
59
|
-
while (true) {
|
|
60
|
-
const candidate = path.join(dir, 'package.json');
|
|
61
|
-
if (fs.existsSync(candidate)) {
|
|
62
|
-
try {
|
|
63
|
-
const parsed = JSON.parse(fs.readFileSync(candidate, 'utf8'));
|
|
64
|
-
if (parsed.name)
|
|
65
|
-
return derivePluginName(parsed.name);
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
// continue walking
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
const parent = path.dirname(dir);
|
|
72
|
-
if (parent === dir) {
|
|
73
|
-
throw new Error(`[plugins] extractPluginName: could not find package.json starting from "${startDir}".`);
|
|
74
|
-
}
|
|
75
|
-
dir = parent;
|
|
76
|
-
}
|
|
77
|
-
}
|
package/dist/plugins/loader.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { IconName } from 'lucide-react/dynamic';
|
|
1
2
|
import type { PluginConfigEntry } from '../core/config/config-loader.js';
|
|
2
3
|
import type { MultilingualString } from '../translations/language-utils.js';
|
|
3
|
-
import type { IconName } from 'lucide-react/dynamic';
|
|
4
4
|
import type { CMSPlugin, PluginRoute } from './types.js';
|
|
5
5
|
export type { CMSPlugin, CMSPluginDescriptor, CMSPluginDescriptorMultiRoute, CMSPluginDescriptorSingleRoute, CMSPluginMultiRoute, CMSPluginSingleRoute, PluginInitContext, PluginRoute, PluginRouteOverride, PluginRouteWithoutComponent, PluginRouteWithComponent, PluginRuntimeConfigEntry, } from './types.js';
|
|
6
6
|
/**
|
|
@@ -25,6 +25,8 @@ export interface LoadedPluginRoute extends PluginRoute {
|
|
|
25
25
|
pluginId: string;
|
|
26
26
|
pluginName: string;
|
|
27
27
|
}
|
|
28
|
+
type PackageResolver = (id: string) => unknown;
|
|
29
|
+
export declare const resolveServerOnlyEmptyPath: (resolvers: PackageResolver[]) => string;
|
|
28
30
|
export declare const loadPluginModule: (pluginPackage: string) => Promise<unknown>;
|
|
29
31
|
export declare function loadPlugins(): Promise<LoadedPlugin[]>;
|
|
30
32
|
export declare function getPluginRoutes(): Promise<LoadedPluginRoute[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/plugins/loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/plugins/loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAqB,WAAW,EAAE,MAAM,YAAY,CAAA;AAU3E,YAAY,EACR,SAAS,EACT,mBAAmB,EACnB,6BAA6B,EAC7B,8BAA8B,EAC9B,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,GAC3B,MAAM,YAAY,CAAA;AAEnB;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC7C,IAAI,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,iBAAiB,CAAA;IACzB,MAAM,EAAE,cAAc,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,YAAY;IACzB,YAAY,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MA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CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,CAAA;CAC3E,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,cAAc,CAAA;AAE1D;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAkCpE;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAI9E;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGpF"}
|
package/dist/plugins/loader.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// import 'server-only'
|
|
2
|
-
if (typeof window !== 'undefined') {
|
|
3
|
-
throw new Error('This module can only run on the server');
|
|
4
|
-
}
|
|
5
1
|
import { createRequire } from 'module';
|
|
6
2
|
import path from 'path';
|
|
7
3
|
import { getCMSConfig, getConfigImportVersion } from '../core/config/index.js';
|
|
4
|
+
import { logError, logInfo, logWarn } from '../utils/console-log.js';
|
|
8
5
|
import { derivePluginName, derivePluginRouterKey } from './derive.js';
|
|
9
|
-
import
|
|
6
|
+
// import 'server-only'
|
|
7
|
+
if (typeof window !== 'undefined') {
|
|
8
|
+
throw new Error('This module can only run on the server');
|
|
9
|
+
}
|
|
10
10
|
let cachedPlugins = null;
|
|
11
11
|
let cachedConfigVersion = -1;
|
|
12
12
|
let loadPromise = null;
|
|
@@ -14,9 +14,31 @@ let jitiInstance = null;
|
|
|
14
14
|
const appRequire = createRequire(path.join(process.cwd(), 'package.json'));
|
|
15
15
|
const pkgRequire = createRequire(import.meta.url);
|
|
16
16
|
let serverOnlyEmptyPath = null;
|
|
17
|
+
const SERVER_ONLY_PACKAGE = ['server', 'only'].join('-');
|
|
18
|
+
const SERVER_ONLY_EMPTY_FILE = 'empty.js';
|
|
19
|
+
export const resolveServerOnlyEmptyPath = (resolvers) => {
|
|
20
|
+
const errors = [];
|
|
21
|
+
for (const resolvePackage of resolvers) {
|
|
22
|
+
try {
|
|
23
|
+
const resolved = resolvePackage(SERVER_ONLY_PACKAGE);
|
|
24
|
+
if (typeof resolved === 'string') {
|
|
25
|
+
return path.join(path.dirname(resolved), SERVER_ONLY_EMPTY_FILE);
|
|
26
|
+
}
|
|
27
|
+
errors.push(`resolver returned ${typeof resolved}`);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
errors.push(error instanceof Error ? error.message : String(error));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
throw new Error(`[plugins] Unable to resolve "${SERVER_ONLY_PACKAGE}/${SERVER_ONLY_EMPTY_FILE}" for plugin loading. ` +
|
|
34
|
+
errors.join('; '));
|
|
35
|
+
};
|
|
17
36
|
const getServerOnlyEmptyPath = () => {
|
|
18
37
|
if (!serverOnlyEmptyPath) {
|
|
19
|
-
serverOnlyEmptyPath =
|
|
38
|
+
serverOnlyEmptyPath = resolveServerOnlyEmptyPath([
|
|
39
|
+
(id) => appRequire.resolve(id),
|
|
40
|
+
(id) => pkgRequire.resolve(id, { paths: [process.cwd()] }),
|
|
41
|
+
]);
|
|
20
42
|
}
|
|
21
43
|
return serverOnlyEmptyPath;
|
|
22
44
|
};
|
package/dist/plugins/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './loader.js';
|
|
2
|
-
export { derivePluginName, derivePluginRouterKey,
|
|
2
|
+
export { derivePluginName, derivePluginRouterKey, PLUGIN_PACKAGE_PREFIX } from './derive.js';
|
|
3
3
|
export { runApiPrefetch, runRoutePrefetches, getRoutePrefetchPaths } from './prefetch.js';
|
|
4
4
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/plugins/server.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/plugins/server.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAC5F,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/plugins/server.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './loader.js';
|
|
2
|
-
export { derivePluginName, derivePluginRouterKey,
|
|
2
|
+
export { derivePluginName, derivePluginRouterKey, PLUGIN_PACKAGE_PREFIX } from './derive.js';
|
|
3
3
|
export { runApiPrefetch, runRoutePrefetches, getRoutePrefetchPaths } from './prefetch.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextjs-cms",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.31",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -220,8 +220,8 @@
|
|
|
220
220
|
"tsx": "^4.20.6",
|
|
221
221
|
"typescript": "^5.9.2",
|
|
222
222
|
"@lzcms/eslint-config": "0.3.0",
|
|
223
|
-
"@lzcms/
|
|
224
|
-
"@lzcms/
|
|
223
|
+
"@lzcms/prettier-config": "0.1.0",
|
|
224
|
+
"@lzcms/tsconfig": "0.1.0"
|
|
225
225
|
},
|
|
226
226
|
"license": "MIT",
|
|
227
227
|
"keywords": [
|