nextjs-cms 0.9.21 → 0.9.23
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/README.md +65 -13
- package/dist/api/actions/files.d.ts +30 -0
- package/dist/api/actions/files.d.ts.map +1 -0
- package/dist/api/actions/files.js +234 -0
- package/dist/api/actions/index.d.ts +4 -0
- package/dist/api/actions/index.d.ts.map +1 -0
- package/dist/api/actions/index.js +3 -0
- package/dist/api/actions/pages.d.ts +297 -0
- package/dist/api/actions/pages.d.ts.map +1 -0
- package/dist/api/actions/pages.js +1215 -0
- package/dist/api/actions/privileges.d.ts +25 -0
- package/dist/api/actions/privileges.d.ts.map +1 -0
- package/dist/api/actions/privileges.js +98 -0
- package/dist/api/client/index.d.ts +4 -0
- package/dist/api/client/index.d.ts.map +1 -0
- package/dist/api/client/index.js +3 -0
- package/dist/api/client.d.ts +30 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +82 -0
- package/dist/api/index.d.ts +1 -938
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +0 -13
- package/dist/api/lib/serverActions.d.ts +3 -3
- package/dist/api/plugin/index.d.ts +7 -0
- package/dist/api/plugin/index.d.ts.map +1 -0
- package/dist/api/plugin/index.js +5 -0
- package/dist/api/root.d.ts +18 -1844
- package/dist/api/root.d.ts.map +1 -1
- package/dist/api/root.js +18 -83
- package/dist/api/routers/navigation.d.ts +3 -3
- package/dist/api/server/index.d.ts +8 -0
- package/dist/api/server/index.d.ts.map +1 -0
- package/dist/api/server/index.js +3 -0
- package/dist/api/server.d.ts +2748 -0
- package/dist/api/server.d.ts.map +1 -0
- package/dist/api/server.js +100 -0
- package/dist/api/trpc/client.d.ts +19 -3
- package/dist/api/trpc/client.d.ts.map +1 -1
- package/dist/api/trpc/client.js +55 -1
- package/dist/api/trpc/query-client.d.ts +3 -1
- package/dist/api/trpc/query-client.d.ts.map +1 -1
- package/dist/api/trpc/query-client.js +25 -20
- package/dist/api/trpc/root.d.ts +906 -0
- package/dist/api/trpc/root.d.ts.map +1 -0
- package/dist/api/trpc/root.js +47 -0
- package/dist/api/trpc/routers/accountSettings.d.ts +66 -0
- package/dist/api/trpc/routers/accountSettings.d.ts.map +1 -0
- package/dist/api/trpc/routers/accountSettings.js +200 -0
- package/dist/api/trpc/routers/admins.d.ts +112 -0
- package/dist/api/trpc/routers/admins.d.ts.map +1 -0
- package/dist/api/trpc/routers/admins.js +331 -0
- package/dist/api/trpc/routers/auth.d.ts +54 -0
- package/dist/api/trpc/routers/auth.d.ts.map +1 -0
- package/dist/api/trpc/routers/auth.js +50 -0
- package/dist/api/trpc/routers/categorySection.d.ts +105 -0
- package/dist/api/trpc/routers/categorySection.d.ts.map +1 -0
- package/dist/api/trpc/routers/categorySection.js +49 -0
- package/dist/api/trpc/routers/config.d.ts +48 -0
- package/dist/api/trpc/routers/config.d.ts.map +1 -0
- package/dist/api/trpc/routers/config.js +18 -0
- package/dist/api/trpc/routers/cpanel.d.ts +82 -0
- package/dist/api/trpc/routers/cpanel.d.ts.map +1 -0
- package/dist/api/trpc/routers/cpanel.js +216 -0
- package/dist/api/trpc/routers/fields.d.ts +35 -0
- package/dist/api/trpc/routers/fields.d.ts.map +1 -0
- package/dist/api/trpc/routers/fields.js +81 -0
- package/dist/api/trpc/routers/files.d.ts +34 -0
- package/dist/api/trpc/routers/files.d.ts.map +1 -0
- package/dist/api/trpc/routers/files.js +14 -0
- package/dist/api/trpc/routers/gallery.d.ts +35 -0
- package/dist/api/trpc/routers/gallery.d.ts.map +1 -0
- package/dist/api/trpc/routers/gallery.js +92 -0
- package/dist/api/trpc/routers/hasItemsSection.d.ts +194 -0
- package/dist/api/trpc/routers/hasItemsSection.d.ts.map +1 -0
- package/dist/api/trpc/routers/hasItemsSection.js +86 -0
- package/dist/api/trpc/routers/logs.d.ts +59 -0
- package/dist/api/trpc/routers/logs.d.ts.map +1 -0
- package/dist/api/trpc/routers/logs.js +79 -0
- package/dist/api/trpc/routers/navigation.d.ts +65 -0
- package/dist/api/trpc/routers/navigation.d.ts.map +1 -0
- package/dist/api/trpc/routers/navigation.js +11 -0
- package/dist/api/trpc/routers/simpleSection.d.ts +93 -0
- package/dist/api/trpc/routers/simpleSection.d.ts.map +1 -0
- package/dist/api/trpc/routers/simpleSection.js +54 -0
- package/dist/api/trpc/server.d.ts +2789 -5
- package/dist/api/trpc/server.d.ts.map +1 -1
- package/dist/api/trpc/server.js +91 -52
- package/dist/api/trpc/trpc.d.ts +111 -0
- package/dist/api/trpc/trpc.d.ts.map +1 -0
- package/dist/api/trpc/trpc.js +99 -0
- package/dist/api/trpc/utils/async-caller-proxy.d.ts +2 -0
- package/dist/api/trpc/utils/async-caller-proxy.d.ts.map +1 -0
- package/dist/api/trpc/utils/async-caller-proxy.js +38 -0
- package/dist/api/trpc/utils/refresh-token-link.d.ts +6 -0
- package/dist/api/trpc/utils/refresh-token-link.d.ts.map +1 -0
- package/dist/api/trpc/utils/refresh-token-link.js +81 -0
- package/dist/api/trpc/utils/router-types.d.ts +7 -0
- package/dist/api/trpc/utils/router-types.d.ts.map +1 -0
- package/dist/api/trpc/utils/router-types.js +0 -0
- package/dist/api/use-axios-private.d.ts +6 -0
- package/dist/api/use-axios-private.d.ts.map +1 -0
- package/dist/api/use-axios-private.js +57 -0
- package/dist/api/utils/async-caller-proxy.d.ts +2 -0
- package/dist/api/utils/async-caller-proxy.d.ts.map +1 -0
- package/dist/api/utils/async-caller-proxy.js +36 -0
- package/dist/api/utils/lazy-caller-proxy.d.ts +2 -0
- package/dist/api/utils/lazy-caller-proxy.d.ts.map +1 -0
- package/dist/api/utils/lazy-caller-proxy.js +36 -0
- package/dist/api/utils/router-types.d.ts +7 -0
- package/dist/api/utils/router-types.d.ts.map +1 -0
- package/dist/api/utils/router-types.js +0 -0
- package/dist/auth/hooks/index.d.ts +1 -2
- package/dist/auth/hooks/index.d.ts.map +1 -1
- package/dist/auth/hooks/index.js +1 -2
- package/dist/auth/react.d.ts +1 -2
- package/dist/auth/react.d.ts.map +1 -1
- package/dist/auth/react.js +1 -2
- package/dist/auth/trpc.d.ts +1 -1
- package/dist/auth/trpc.d.ts.map +1 -1
- package/dist/auth/trpc.js +0 -1
- package/dist/cli/lib/fix-master-admin.d.ts.map +1 -1
- package/dist/cli/lib/fix-master-admin.js +12 -25
- package/dist/cli/lib/update-sections.d.ts.map +1 -1
- package/dist/cli/lib/update-sections.js +90 -46
- package/dist/core/config/config-loader.d.ts +23 -7
- package/dist/core/config/config-loader.d.ts.map +1 -1
- package/dist/core/config/config-loader.js +26 -9
- package/dist/core/db/table-checker/MysqlTable.d.ts.map +1 -1
- package/dist/core/db/table-checker/MysqlTable.js +3 -1
- package/dist/core/fields/date-range.d.ts +4 -4
- package/dist/core/fields/select.d.ts +1 -1
- package/dist/core/sections/category.d.ts +8 -8
- package/dist/core/sections/hasItems.d.ts +8 -8
- package/dist/core/sections/section.d.ts +5 -5
- package/dist/core/sections/simple.d.ts +4 -4
- package/dist/core/types/index.d.ts +17 -0
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/plugins/client.d.ts +19 -0
- package/dist/plugins/client.d.ts.map +1 -0
- package/dist/plugins/client.js +24 -0
- package/dist/plugins/define.d.ts +4 -0
- package/dist/plugins/define.d.ts.map +1 -0
- package/dist/plugins/define.js +3 -0
- package/dist/plugins/derive.d.ts +32 -0
- package/dist/plugins/derive.d.ts.map +1 -0
- package/dist/plugins/derive.js +77 -0
- package/dist/plugins/loader.d.ts +51 -7
- package/dist/plugins/loader.d.ts.map +1 -1
- package/dist/plugins/loader.js +111 -51
- package/dist/plugins/manifest.d.ts +28 -0
- package/dist/plugins/manifest.d.ts.map +1 -0
- package/dist/plugins/manifest.js +83 -0
- package/dist/plugins/prefetch.d.ts +16 -0
- package/dist/plugins/prefetch.d.ts.map +1 -0
- package/dist/plugins/prefetch.js +40 -0
- package/dist/plugins/registry.d.ts +22 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +25 -0
- package/dist/plugins/server.d.ts +2 -0
- package/dist/plugins/server.d.ts.map +1 -1
- package/dist/plugins/server.js +2 -0
- package/dist/plugins/types.d.ts +9 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +0 -0
- package/dist/translations/base/en.d.ts +5 -0
- package/dist/translations/base/en.d.ts.map +1 -1
- package/dist/translations/base/en.js +5 -0
- package/dist/translations/client.d.ts +64 -4
- package/dist/translations/client.d.ts.map +1 -1
- package/dist/translations/server.d.ts +64 -4
- package/dist/translations/server.d.ts.map +1 -1
- package/dist/utils/console-log.d.ts +18 -0
- package/dist/utils/console-log.d.ts.map +1 -0
- package/dist/utils/console-log.js +28 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/log.d.ts +18 -0
- package/dist/utils/log.d.ts.map +1 -0
- package/dist/utils/log.js +28 -0
- package/dist/validators/index.d.ts +1 -0
- package/dist/validators/index.d.ts.map +1 -1
- package/dist/validators/index.js +1 -0
- package/dist/validators/tags.d.ts +4 -0
- package/dist/validators/tags.d.ts.map +1 -0
- package/dist/validators/tags.js +8 -0
- package/package.json +36 -18
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/plugins/manifest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,kBAAkB,CAAA;IACzB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,kBAAkB,CAAA;IACzB,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAA;CACjC;AAED,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IAClE,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,iBAAiB,CAAA;IACzB,QAAQ,EAAE,cAAc,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;CACrB;AAoDD,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC,CA+B1E;AAED,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAUpF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import { getCMSConfig } from '../core/config/index.js';
|
|
5
|
+
const appRequire = createRequire(path.join(process.cwd(), 'package.json'));
|
|
6
|
+
const pkgRequire = createRequire(import.meta.url);
|
|
7
|
+
const resolvePluginPackageJson = (pluginPackage) => {
|
|
8
|
+
const target = `${pluginPackage}/package.json`;
|
|
9
|
+
try {
|
|
10
|
+
return appRequire.resolve(target);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
try {
|
|
14
|
+
return pkgRequire.resolve(target, { paths: [process.cwd()] });
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const readManifestFromPackage = (pluginPackage) => {
|
|
22
|
+
const pkgJsonPath = resolvePluginPackageJson(pluginPackage);
|
|
23
|
+
if (!pkgJsonPath) {
|
|
24
|
+
console.warn(`[plugins] Could not resolve "${pluginPackage}/package.json".`);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
let pkg;
|
|
28
|
+
try {
|
|
29
|
+
pkg = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
console.warn(`[plugins] Failed to read "${pkgJsonPath}":`, error);
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const manifest = pkg.pluginManifest;
|
|
36
|
+
if (!manifest) {
|
|
37
|
+
console.warn(`[plugins] Package "${pluginPackage}" is missing the "pluginManifest" field in package.json. ` +
|
|
38
|
+
`Plugins must declare metadata statically so the CLI can read it without evaluating plugin code.`);
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (!manifest.name || !manifest.registryName || !manifest.title) {
|
|
42
|
+
console.warn(`[plugins] Package "${pluginPackage}" has an invalid "pluginManifest" — required fields: name, registryName, title.`);
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return manifest;
|
|
46
|
+
};
|
|
47
|
+
export async function getPluginManifests() {
|
|
48
|
+
const config = await getCMSConfig();
|
|
49
|
+
const registrations = config.plugins ?? [];
|
|
50
|
+
const seenPackages = new Set();
|
|
51
|
+
const seenNames = new Set();
|
|
52
|
+
const loaded = [];
|
|
53
|
+
for (const registration of registrations) {
|
|
54
|
+
if (!registration.package)
|
|
55
|
+
continue;
|
|
56
|
+
if (seenPackages.has(registration.package))
|
|
57
|
+
continue;
|
|
58
|
+
const manifest = readManifestFromPackage(registration.package);
|
|
59
|
+
if (!manifest)
|
|
60
|
+
continue;
|
|
61
|
+
if (seenNames.has(manifest.name)) {
|
|
62
|
+
console.warn(`[plugins] Duplicate plugin name "${manifest.name}" — skipping "${registration.package}".`);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
seenPackages.add(registration.package);
|
|
66
|
+
seenNames.add(manifest.name);
|
|
67
|
+
loaded.push({
|
|
68
|
+
config: registration,
|
|
69
|
+
manifest,
|
|
70
|
+
moduleName: registration.package,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return loaded;
|
|
74
|
+
}
|
|
75
|
+
export async function getPluginRouteManifests() {
|
|
76
|
+
const loaded = await getPluginManifests();
|
|
77
|
+
return loaded.flatMap((entry) => (entry.manifest.routes ?? []).map((route) => ({
|
|
78
|
+
...route,
|
|
79
|
+
pluginId: entry.config.package,
|
|
80
|
+
pluginName: entry.manifest.name,
|
|
81
|
+
pluginRegistryName: entry.manifest.registryName,
|
|
82
|
+
})));
|
|
83
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LoadedPluginRoute } from './loader.js';
|
|
2
|
+
/**
|
|
3
|
+
* Walks a dot-path into a tRPC RSC `api` proxy and invokes `.prefetch()` at the leaf.
|
|
4
|
+
*
|
|
5
|
+
* Example: `runApiPrefetch(api, 'cpanelEmails.getEmails')` runs
|
|
6
|
+
* `await api.cpanelEmails.getEmails.prefetch()`.
|
|
7
|
+
*
|
|
8
|
+
* Throws if any segment is missing or the leaf has no `prefetch` helper, so a typo
|
|
9
|
+
* in `PluginRoute.prefetch` fails loudly during development.
|
|
10
|
+
*/
|
|
11
|
+
export declare function runApiPrefetch(api: unknown, dotPath: string): Promise<void>;
|
|
12
|
+
/** Normalizes a route's `prefetch` field (string | string[] | undefined) into an array. */
|
|
13
|
+
export declare function getRoutePrefetchPaths(route: Pick<LoadedPluginRoute, 'prefetch'>): string[];
|
|
14
|
+
/** Runs all declared prefetches for a route in parallel. */
|
|
15
|
+
export declare function runRoutePrefetches(api: unknown, route: Pick<LoadedPluginRoute, 'prefetch'>): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=prefetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefetch.d.ts","sourceRoot":"","sources":["../../src/plugins/prefetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBjF;AAED,2FAA2F;AAC3F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,MAAM,EAAE,CAG1F;AAED,4DAA4D;AAC5D,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAIhH"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walks a dot-path into a tRPC RSC `api` proxy and invokes `.prefetch()` at the leaf.
|
|
3
|
+
*
|
|
4
|
+
* Example: `runApiPrefetch(api, 'cpanelEmails.getEmails')` runs
|
|
5
|
+
* `await api.cpanelEmails.getEmails.prefetch()`.
|
|
6
|
+
*
|
|
7
|
+
* Throws if any segment is missing or the leaf has no `prefetch` helper, so a typo
|
|
8
|
+
* in `PluginRoute.prefetch` fails loudly during development.
|
|
9
|
+
*/
|
|
10
|
+
export async function runApiPrefetch(api, dotPath) {
|
|
11
|
+
const segments = dotPath.split('.').filter(Boolean);
|
|
12
|
+
if (segments.length === 0) {
|
|
13
|
+
throw new Error('[plugins] Empty prefetch path.');
|
|
14
|
+
}
|
|
15
|
+
let node = api;
|
|
16
|
+
for (const key of segments) {
|
|
17
|
+
if (node == null || (typeof node !== 'object' && typeof node !== 'function')) {
|
|
18
|
+
throw new Error(`[plugins] Cannot resolve prefetch path "${dotPath}" — segment "${key}" is unreachable.`);
|
|
19
|
+
}
|
|
20
|
+
node = node[key];
|
|
21
|
+
}
|
|
22
|
+
const prefetch = node?.prefetch;
|
|
23
|
+
if (typeof prefetch !== 'function') {
|
|
24
|
+
throw new Error(`[plugins] Prefetch path "${dotPath}" does not resolve to a procedure with a prefetch helper.`);
|
|
25
|
+
}
|
|
26
|
+
await prefetch();
|
|
27
|
+
}
|
|
28
|
+
/** Normalizes a route's `prefetch` field (string | string[] | undefined) into an array. */
|
|
29
|
+
export function getRoutePrefetchPaths(route) {
|
|
30
|
+
if (!route.prefetch)
|
|
31
|
+
return [];
|
|
32
|
+
return Array.isArray(route.prefetch) ? route.prefetch : [route.prefetch];
|
|
33
|
+
}
|
|
34
|
+
/** Runs all declared prefetches for a route in parallel. */
|
|
35
|
+
export async function runRoutePrefetches(api, route) {
|
|
36
|
+
const paths = getRoutePrefetchPaths(route);
|
|
37
|
+
if (paths.length === 0)
|
|
38
|
+
return;
|
|
39
|
+
await Promise.all(paths.map((path) => runApiPrefetch(api, path)));
|
|
40
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static import map for all official @nextjscms plugins.
|
|
3
|
+
*
|
|
4
|
+
* Why this file exists: the plugin loader needs to import plugin packages by
|
|
5
|
+
* name at runtime. Bare `await import(variable)` calls are rejected by
|
|
6
|
+
* Turbopack/webpack as "too dynamic" because the bundler cannot statically
|
|
7
|
+
* see which packages may be loaded. Listing each package as a literal
|
|
8
|
+
* `() => import('@nextjscms/plugin-x')` thunk lets the bundler analyze the
|
|
9
|
+
* import sites, and the host's module loader applies the correct export
|
|
10
|
+
* conditions at runtime — most importantly "react-server" during RSC
|
|
11
|
+
* requests, so plugin transitive deps marked `import 'server-only'` resolve
|
|
12
|
+
* to a no-op instead of throwing.
|
|
13
|
+
*
|
|
14
|
+
* Each thunk is wrapped in its own arrow so the import is deferred until the
|
|
15
|
+
* plugin is actually configured in cms.config.ts. Plugins not installed in
|
|
16
|
+
* the host app will fail at thunk invocation, which the loader treats as a
|
|
17
|
+
* normal "plugin not available" outcome.
|
|
18
|
+
*
|
|
19
|
+
* When a new official plugin is published, add an entry here.
|
|
20
|
+
*/
|
|
21
|
+
export declare const officialPluginRegistry: Record<string, () => Promise<unknown>>;
|
|
22
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/plugins/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAIzE,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static import map for all official @nextjscms plugins.
|
|
3
|
+
*
|
|
4
|
+
* Why this file exists: the plugin loader needs to import plugin packages by
|
|
5
|
+
* name at runtime. Bare `await import(variable)` calls are rejected by
|
|
6
|
+
* Turbopack/webpack as "too dynamic" because the bundler cannot statically
|
|
7
|
+
* see which packages may be loaded. Listing each package as a literal
|
|
8
|
+
* `() => import('@nextjscms/plugin-x')` thunk lets the bundler analyze the
|
|
9
|
+
* import sites, and the host's module loader applies the correct export
|
|
10
|
+
* conditions at runtime — most importantly "react-server" during RSC
|
|
11
|
+
* requests, so plugin transitive deps marked `import 'server-only'` resolve
|
|
12
|
+
* to a no-op instead of throwing.
|
|
13
|
+
*
|
|
14
|
+
* Each thunk is wrapped in its own arrow so the import is deferred until the
|
|
15
|
+
* plugin is actually configured in cms.config.ts. Plugins not installed in
|
|
16
|
+
* the host app will fail at thunk invocation, which the loader treats as a
|
|
17
|
+
* normal "plugin not available" outcome.
|
|
18
|
+
*
|
|
19
|
+
* When a new official plugin is published, add an entry here.
|
|
20
|
+
*/
|
|
21
|
+
export const officialPluginRegistry = {
|
|
22
|
+
'@nextjscms/plugin-cpanel-dashboard': () => import('@nextjscms/plugin-cpanel-dashboard'),
|
|
23
|
+
'@nextjscms/plugin-cpanel-emails': () => import('@nextjscms/plugin-cpanel-emails'),
|
|
24
|
+
'@nextjscms/plugin-google-analytics': () => import('@nextjscms/plugin-google-analytics'),
|
|
25
|
+
};
|
package/dist/plugins/server.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export * from './loader.js';
|
|
2
|
+
export { derivePluginName, derivePluginRouterKey, extractPluginName, PLUGIN_PACKAGE_PREFIX } from './derive.js';
|
|
3
|
+
export { runApiPrefetch, runRoutePrefetches, getRoutePrefetchPaths } from './prefetch.js';
|
|
2
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"}
|
|
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,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAC/G,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/plugins/server.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props passed to a plugin's server component by the host app.
|
|
3
|
+
*
|
|
4
|
+
* Currently empty — the host owns prefetching (declared via `PluginRoute.prefetch`)
|
|
5
|
+
* and wraps the plugin's tree in `<HydrateClient>`. Plugins receive no tRPC `api`
|
|
6
|
+
* proxy, which keeps the proxy off the RSC→Client serialization path.
|
|
7
|
+
*/
|
|
8
|
+
export type PluginServerComponentProps = Record<string, never>;
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA"}
|
|
File without changes
|
|
@@ -286,11 +286,15 @@ declare const _default: {
|
|
|
286
286
|
readonly deletePhotoText: "Are you sure you want to delete this photo? The photo will be permanently deleted after confirmation.";
|
|
287
287
|
readonly deleteVideo: "Delete Video";
|
|
288
288
|
readonly deleteVideoText: "Are you sure you want to delete this video? The video will be permanently deleted after confirmation.";
|
|
289
|
+
readonly deleteDocument: "Delete Document";
|
|
290
|
+
readonly deleteDocumentText: "Are you sure you want to delete this document? The document will be permanently deleted after confirmation.";
|
|
289
291
|
readonly yes: "Yes";
|
|
290
292
|
readonly no: "No";
|
|
291
293
|
readonly videoDeletedSuccessfully: "Video deleted successfully";
|
|
292
294
|
readonly photoDeletedSuccessfully: "Photo deleted successfully";
|
|
293
295
|
readonly photoMarkedForDeletion: "Photo will be deleted when you save.";
|
|
296
|
+
readonly videoMarkedForDeletion: "Video will be deleted when you save.";
|
|
297
|
+
readonly documentMarkedForDeletion: "Document will be deleted when you save.";
|
|
294
298
|
readonly undo: "Undo";
|
|
295
299
|
readonly selectFile: "Select File";
|
|
296
300
|
readonly mandatory: "Mandatory";
|
|
@@ -365,6 +369,7 @@ declare const _default: {
|
|
|
365
369
|
readonly addedAgo: "Added {time} ago";
|
|
366
370
|
readonly hoursAgo: "hours ago";
|
|
367
371
|
readonly main: "Main";
|
|
372
|
+
readonly plugins: "Plugins";
|
|
368
373
|
readonly categorySections: "Category Sections";
|
|
369
374
|
readonly sectionsWithItems: "Sections with Items";
|
|
370
375
|
readonly simpleSections: "Simple Sections";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/translations/base/en.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/translations/base/en.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAqgBU"}
|
|
@@ -286,11 +286,15 @@ export default {
|
|
|
286
286
|
deletePhotoText: 'Are you sure you want to delete this photo? The photo will be permanently deleted after confirmation.',
|
|
287
287
|
deleteVideo: 'Delete Video',
|
|
288
288
|
deleteVideoText: 'Are you sure you want to delete this video? The video will be permanently deleted after confirmation.',
|
|
289
|
+
deleteDocument: 'Delete Document',
|
|
290
|
+
deleteDocumentText: 'Are you sure you want to delete this document? The document will be permanently deleted after confirmation.',
|
|
289
291
|
yes: 'Yes',
|
|
290
292
|
no: 'No',
|
|
291
293
|
videoDeletedSuccessfully: 'Video deleted successfully',
|
|
292
294
|
photoDeletedSuccessfully: 'Photo deleted successfully',
|
|
293
295
|
photoMarkedForDeletion: 'Photo will be deleted when you save.',
|
|
296
|
+
videoMarkedForDeletion: 'Video will be deleted when you save.',
|
|
297
|
+
documentMarkedForDeletion: 'Document will be deleted when you save.',
|
|
294
298
|
undo: 'Undo',
|
|
295
299
|
selectFile: 'Select File',
|
|
296
300
|
mandatory: 'Mandatory',
|
|
@@ -365,6 +369,7 @@ export default {
|
|
|
365
369
|
addedAgo: 'Added {time} ago',
|
|
366
370
|
hoursAgo: 'hours ago',
|
|
367
371
|
main: 'Main',
|
|
372
|
+
plugins: 'Plugins',
|
|
368
373
|
categorySections: 'Category Sections',
|
|
369
374
|
sectionsWithItems: 'Sections with Items',
|
|
370
375
|
simpleSections: 'Simple Sections',
|