@fecommunity/reactpress 4.0.0-beta.10 → 4.0.0-beta.11
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 +20 -26
- package/out/bin/reactpress.js +2 -0
- package/out/core/services/theme-bootstrap.js +3 -2
- package/package.json +1 -1
- package/server/bin/reactpress-server.js +19 -0
- package/server/dist/app.module.js +5 -5
- package/server/dist/main.js +2 -0
- package/server/dist/modules/extension/preview-draft.store.js +1 -1
- package/server/dist/modules/extension/theme.service.js +19 -19
- package/server/dist/modules/setting/setting.constant.js +3 -3
- package/server/dist/modules/setting/setting.service.js +9 -9
- package/server/package-lock.json +38 -1
- package/server/package.json +1 -1
- package/toolkit/package.json +13 -1
package/README.md
CHANGED
|
@@ -1,47 +1,41 @@
|
|
|
1
|
-
# @fecommunity/reactpress
|
|
1
|
+
# @fecommunity/reactpress
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
ReactPress 4 CLI — zero-dependency publishing platform. Initialize a local SQLite site and bundled API with a single command.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Monorepo docs: [github.com/fecommunity/reactpress](https://github.com/fecommunity/reactpress) · Chinese overview: [README-zh_CN.md](../README-zh_CN.md)
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install -g @fecommunity/reactpress
|
|
10
|
+
npm install -g @fecommunity/reactpress
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Requires Node.js 18+. On first install, `postinstall` downloads bundled server runtime dependencies (~1–2 minutes).
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## 快速开始
|
|
15
|
+
## Quick start
|
|
18
16
|
|
|
19
17
|
```bash
|
|
20
|
-
mkdir my-
|
|
21
|
-
reactpress
|
|
22
|
-
reactpress-cli start
|
|
18
|
+
mkdir my-site && cd my-site
|
|
19
|
+
reactpress init
|
|
23
20
|
```
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
- Site: `http://localhost:3001`
|
|
23
|
+
- Admin: `http://localhost:3001/admin/` (`admin` / `admin`)
|
|
24
|
+
- API: `http://127.0.0.1:3002/api`
|
|
26
25
|
|
|
27
|
-
##
|
|
26
|
+
## Commands
|
|
28
27
|
|
|
29
|
-
|
|
|
30
|
-
|
|
31
|
-
| `reactpress
|
|
32
|
-
| `reactpress
|
|
33
|
-
| `reactpress-cli stop` | 停止服务 |
|
|
34
|
-
| `reactpress-cli restart` | 重启服务 |
|
|
35
|
-
| `reactpress-cli status` | 查看状态 |
|
|
36
|
-
| `reactpress-cli config [key] [value]` | 查看/修改配置 |
|
|
37
|
-
| `reactpress-cli config server.port 3003 --apply` | 改端口并重启 |
|
|
28
|
+
| Command | Description |
|
|
29
|
+
|---------|-------------|
|
|
30
|
+
| `reactpress init [dir]` | Initialize project (default command) |
|
|
31
|
+
| `reactpress doctor [dir]` | Diagnose Node.js, ports, database, and services |
|
|
38
32
|
|
|
39
|
-
##
|
|
33
|
+
## Requirements
|
|
40
34
|
|
|
41
35
|
- Node.js 18+
|
|
42
36
|
- macOS / Linux / Windows
|
|
43
|
-
-
|
|
37
|
+
- No Docker, nginx, or MySQL required (embedded SQLite + bundled API)
|
|
44
38
|
|
|
45
|
-
##
|
|
39
|
+
## License
|
|
46
40
|
|
|
47
41
|
MIT © FECommunity
|
package/out/bin/reactpress.js
CHANGED
|
@@ -65,6 +65,8 @@ async function startServices(projectRoot) {
|
|
|
65
65
|
const code = await runLifecycleCommand('start', projectRoot);
|
|
66
66
|
if (code !== 0)
|
|
67
67
|
process.exit(code);
|
|
68
|
+
const { ensureDefaultTheme } = require('../core/services/theme-bootstrap');
|
|
69
|
+
await ensureDefaultTheme(projectRoot);
|
|
68
70
|
printRunningPanel(projectRoot);
|
|
69
71
|
try {
|
|
70
72
|
const themeBin = getThemeBin(projectRoot);
|
|
@@ -18,7 +18,7 @@ function writeActiveThemeManifest(projectRoot, themeId, themeDir) {
|
|
|
18
18
|
}
|
|
19
19
|
/** Install catalog featured theme when no resolvable theme exists (npm standalone init). */
|
|
20
20
|
async function ensureDefaultTheme(projectRoot) {
|
|
21
|
-
const { hasResolvableActiveTheme
|
|
21
|
+
const { hasResolvableActiveTheme } = require('../../lib/theme-runtime');
|
|
22
22
|
const { installThemeFromNpm } = require('../../lib/theme-install');
|
|
23
23
|
const { readThemeCatalog } = require('../../lib/theme-registry');
|
|
24
24
|
const { t } = require('../../lib/i18n');
|
|
@@ -27,7 +27,8 @@ async function ensureDefaultTheme(projectRoot) {
|
|
|
27
27
|
return { installed: false, skipped: true };
|
|
28
28
|
}
|
|
29
29
|
const catalog = readThemeCatalog(root);
|
|
30
|
-
const featured = catalog.themes.find((entry) => entry.featured && entry.npm) ??
|
|
30
|
+
const featured = catalog.themes.find((entry) => entry.featured && entry.npm) ??
|
|
31
|
+
catalog.themes.find((entry) => entry.npm);
|
|
31
32
|
if (!featured?.npm) {
|
|
32
33
|
return { installed: false, error: 'NO_CATALOG_THEME' };
|
|
33
34
|
}
|
package/package.json
CHANGED
|
@@ -154,6 +154,22 @@ function startWithPM2() {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
// Function to prepend bundled runtime paths so sibling toolkit/ can resolve server/node_modules.
|
|
158
|
+
function prependNodePath(...dirs) {
|
|
159
|
+
const Module = require('module');
|
|
160
|
+
const sep = path.delimiter;
|
|
161
|
+
const parts = (process.env.NODE_PATH || '').split(sep).filter(Boolean);
|
|
162
|
+
for (const dir of dirs) {
|
|
163
|
+
if (fs.existsSync(dir) && !parts.includes(dir)) {
|
|
164
|
+
parts.unshift(dir);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (parts.length) {
|
|
168
|
+
process.env.NODE_PATH = parts.join(sep);
|
|
169
|
+
Module._initPaths();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
157
173
|
// Function to start with regular Node.js
|
|
158
174
|
function startWithNode() {
|
|
159
175
|
// Check if the server is built
|
|
@@ -186,6 +202,9 @@ function startWithNode() {
|
|
|
186
202
|
// Set environment variables
|
|
187
203
|
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
|
|
188
204
|
|
|
205
|
+
// Bundled CLI layout: toolkit/ is a sibling of server/; expose server deps to toolkit requires.
|
|
206
|
+
prependNodePath(path.join(serverDir, 'node_modules'));
|
|
207
|
+
|
|
189
208
|
// Import and run the server (require() alone does not invoke main — see dist/main.js)
|
|
190
209
|
try {
|
|
191
210
|
const mainModule = require(distPath);
|
|
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.AppModule = void 0;
|
|
10
|
-
const
|
|
10
|
+
const config_1 = require("../../toolkit/dist/config");
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
|
-
const
|
|
12
|
+
const config_2 = require("@nestjs/config");
|
|
13
13
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
14
14
|
const typeorm_options_1 = require("./database/typeorm-options");
|
|
15
15
|
const api_key_module_1 = require("./modules/api-key/api-key.module");
|
|
@@ -35,10 +35,10 @@ let AppModule = class AppModule {
|
|
|
35
35
|
AppModule = __decorate([
|
|
36
36
|
(0, common_1.Module)({
|
|
37
37
|
imports: [
|
|
38
|
-
|
|
38
|
+
config_2.ConfigModule.forRoot({ isGlobal: true, envFilePath: [config_1.config.file] }),
|
|
39
39
|
typeorm_1.TypeOrmModule.forRootAsync({
|
|
40
|
-
imports: [
|
|
41
|
-
inject: [
|
|
40
|
+
imports: [config_2.ConfigModule],
|
|
41
|
+
inject: [config_2.ConfigService],
|
|
42
42
|
useFactory: async (configService) => (0, typeorm_options_1.createTypeOrmOptions)(configService),
|
|
43
43
|
}),
|
|
44
44
|
user_module_1.UserModule,
|
package/server/dist/main.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.main = void 0;
|
|
3
4
|
require("./node-polyfills");
|
|
4
5
|
const bodyParser = require("body-parser");
|
|
5
6
|
const express = require("express");
|
|
@@ -141,6 +142,7 @@ const main = async () => {
|
|
|
141
142
|
process.exit(1);
|
|
142
143
|
}
|
|
143
144
|
};
|
|
145
|
+
exports.main = main;
|
|
144
146
|
const getProjectRoot = () => {
|
|
145
147
|
if (process.env.REACTPRESS_ORIGINAL_CWD) {
|
|
146
148
|
if (!(0, local_api_quiet_util_1.isLocalApiQuiet)()) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getPreviewDraft = exports.putPreviewDraft = void 0;
|
|
4
|
-
const
|
|
4
|
+
const extension_1 = require("../../../../toolkit/dist/theme/extension");
|
|
5
5
|
const crypto_1 = require("crypto");
|
|
6
6
|
const TTL_MS = 30 * 60 * 1000;
|
|
7
7
|
const store = new Map();
|
|
@@ -14,8 +14,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
var ThemeService_1;
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.ThemeService = void 0;
|
|
17
|
-
const
|
|
18
|
-
const
|
|
17
|
+
const extension_1 = require("../../../../toolkit/dist/theme/extension");
|
|
18
|
+
const extension_2 = require("../../../../toolkit/dist/theme/extension");
|
|
19
19
|
const node_1 = require("../../../../toolkit/dist/theme/node");
|
|
20
20
|
const common_1 = require("@nestjs/common");
|
|
21
21
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
@@ -26,7 +26,7 @@ const typeorm_2 = require("typeorm");
|
|
|
26
26
|
const project_root_util_1 = require("../../utils/project-root.util");
|
|
27
27
|
const setting_service_1 = require("../setting/setting.service");
|
|
28
28
|
const setting_entity_1 = require("../setting/setting.entity");
|
|
29
|
-
const
|
|
29
|
+
const theme_placeholder_cover_1 = require("../../utils/theme-placeholder-cover");
|
|
30
30
|
const theme_registry_bridge_1 = require("./theme-registry.bridge");
|
|
31
31
|
const preview_draft_store_1 = require("./preview-draft.store");
|
|
32
32
|
function projectRoot() {
|
|
@@ -119,14 +119,14 @@ let ThemeService = ThemeService_1 = class ThemeService {
|
|
|
119
119
|
return null;
|
|
120
120
|
try {
|
|
121
121
|
const raw = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
122
|
-
const parsed = (0,
|
|
122
|
+
const parsed = (0, extension_2.parseThemeManifest)(raw);
|
|
123
123
|
if (parsed)
|
|
124
124
|
return parsed;
|
|
125
125
|
if (raw && typeof raw.id === 'string') {
|
|
126
|
-
return (0,
|
|
126
|
+
return (0, extension_2.parseThemeManifest)(Object.assign(Object.assign({}, raw), { id: raw.id }));
|
|
127
127
|
}
|
|
128
128
|
const id = path.basename(themeDir);
|
|
129
|
-
return (0,
|
|
129
|
+
return (0, extension_2.parseThemeManifest)(Object.assign({ id, name: id, version: '1.0.0' }, raw));
|
|
130
130
|
}
|
|
131
131
|
catch (_a) {
|
|
132
132
|
return null;
|
|
@@ -222,11 +222,11 @@ let ThemeService = ThemeService_1 = class ThemeService {
|
|
|
222
222
|
}
|
|
223
223
|
async getThemeState() {
|
|
224
224
|
const row = await this.getSettingRow();
|
|
225
|
-
return (0,
|
|
225
|
+
return (0, extension_2.getThemeStateFromGlobalSetting)(this.parseGlobalSetting(row));
|
|
226
226
|
}
|
|
227
227
|
async saveThemeState(patch) {
|
|
228
228
|
const row = await this.getSettingRow();
|
|
229
|
-
const merged = (0,
|
|
229
|
+
const merged = (0, extension_2.mergeThemeStateIntoGlobalSetting)(this.parseGlobalSetting(row), patch);
|
|
230
230
|
row.globalSetting = JSON.stringify(merged);
|
|
231
231
|
await this.settingRepository.save(row);
|
|
232
232
|
return merged.theme;
|
|
@@ -367,7 +367,7 @@ let ThemeService = ThemeService_1 = class ThemeService {
|
|
|
367
367
|
const manifest = this.getThemeManifestForConfig(themeId);
|
|
368
368
|
if (!manifest)
|
|
369
369
|
throw new common_1.NotFoundException(`Theme "${themeId}" not found`);
|
|
370
|
-
const schema = (0,
|
|
370
|
+
const schema = (0, extension_2.getConfigurationSchemaFromManifest)(manifest, themeId);
|
|
371
371
|
return { themeId, schema };
|
|
372
372
|
}
|
|
373
373
|
async getThemeConfiguration(themeId) {
|
|
@@ -378,7 +378,7 @@ let ThemeService = ThemeService_1 = class ThemeService {
|
|
|
378
378
|
if (!manifest)
|
|
379
379
|
throw new common_1.NotFoundException(`Theme "${themeId}" not found`);
|
|
380
380
|
const row = await this.getSettingRow();
|
|
381
|
-
const configuration = (0,
|
|
381
|
+
const configuration = (0, extension_2.getMergedThemeConfiguration)(this.parseGlobalSetting(row), themeId, {
|
|
382
382
|
manifest,
|
|
383
383
|
});
|
|
384
384
|
return { themeId, configuration };
|
|
@@ -391,7 +391,7 @@ let ThemeService = ThemeService_1 = class ThemeService {
|
|
|
391
391
|
const manifest = this.getThemeManifestForConfig(themeId);
|
|
392
392
|
if (!manifest)
|
|
393
393
|
throw new common_1.NotFoundException(`Theme "${themeId}" not found`);
|
|
394
|
-
const schema = (0,
|
|
394
|
+
const schema = (0, extension_2.getConfigurationSchemaFromManifest)(manifest, themeId);
|
|
395
395
|
if (!schema) {
|
|
396
396
|
throw new common_1.BadRequestException(`Theme "${themeId}" does not declare options schema`);
|
|
397
397
|
}
|
|
@@ -399,21 +399,21 @@ let ThemeService = ThemeService_1 = class ThemeService {
|
|
|
399
399
|
const globalRaw = this.parseGlobalSetting(row);
|
|
400
400
|
const locale = (_a = options === null || options === void 0 ? void 0 : options.locale) !== null && _a !== void 0 ? _a : 'zh';
|
|
401
401
|
if (options === null || options === void 0 ? void 0 : options.replace) {
|
|
402
|
-
const seed = (_b = (0,
|
|
403
|
-
const validation = (0,
|
|
402
|
+
const seed = (_b = (0, extension_2.getThemeConfigurationSeed)(themeId, locale)) !== null && _b !== void 0 ? _b : (0, extension_2.getMergedThemeConfiguration)(globalRaw, themeId, { locale, manifest });
|
|
403
|
+
const validation = (0, extension_2.validateThemeConfiguration)(schema, seed);
|
|
404
404
|
if (!validation.valid) {
|
|
405
405
|
throw new common_1.BadRequestException((_c = validation.message) !== null && _c !== void 0 ? _c : 'Invalid configuration');
|
|
406
406
|
}
|
|
407
|
-
const mergedGlobal = (0,
|
|
407
|
+
const mergedGlobal = (0, extension_2.mergeConfigIntoGlobalSetting)(globalRaw, themeId, seed);
|
|
408
408
|
row.globalSetting = JSON.stringify(mergedGlobal);
|
|
409
409
|
await this.settingRepository.save(row);
|
|
410
410
|
return { themeId, configuration: seed };
|
|
411
411
|
}
|
|
412
|
-
const result = (0,
|
|
412
|
+
const result = (0, extension_2.validateAndMergeThemeConfiguration)(themeId, globalRaw, patch, manifest);
|
|
413
413
|
if (!result.ok) {
|
|
414
414
|
throw new common_1.BadRequestException('message' in result ? result.message : 'Invalid configuration');
|
|
415
415
|
}
|
|
416
|
-
const mergedGlobal = (0,
|
|
416
|
+
const mergedGlobal = (0, extension_2.mergeConfigIntoGlobalSetting)(globalRaw, themeId, result.config);
|
|
417
417
|
row.globalSetting = JSON.stringify(mergedGlobal);
|
|
418
418
|
await this.settingRepository.save(row);
|
|
419
419
|
return { themeId, configuration: result.config };
|
|
@@ -798,7 +798,7 @@ let ThemeService = ThemeService_1 = class ThemeService {
|
|
|
798
798
|
var _a;
|
|
799
799
|
const manifest = this.getThemeManifestFromSources(id);
|
|
800
800
|
const defaults = this.themeAppearanceDefaults(manifest);
|
|
801
|
-
return (0,
|
|
801
|
+
return (0, theme_placeholder_cover_1.buildThemePlaceholderCoverSvg)({
|
|
802
802
|
id,
|
|
803
803
|
name: (_a = manifest === null || manifest === void 0 ? void 0 : manifest.name) !== null && _a !== void 0 ? _a : id,
|
|
804
804
|
primary: defaults.primaryColor,
|
|
@@ -916,7 +916,7 @@ let ThemeService = ThemeService_1 = class ThemeService {
|
|
|
916
916
|
state.activeTheme,
|
|
917
917
|
'hello-world',
|
|
918
918
|
...state.installedThemes,
|
|
919
|
-
|
|
919
|
+
extension_2.defaultSiteThemeState.activeTheme,
|
|
920
920
|
];
|
|
921
921
|
const seen = new Set();
|
|
922
922
|
for (const id of candidates) {
|
|
@@ -948,7 +948,7 @@ let ThemeService = ThemeService_1 = class ThemeService {
|
|
|
948
948
|
activeTheme = saved.activeTheme;
|
|
949
949
|
}
|
|
950
950
|
else if (!activeTheme) {
|
|
951
|
-
const saved = await this.saveThemeState(
|
|
951
|
+
const saved = await this.saveThemeState(extension_2.defaultSiteThemeState);
|
|
952
952
|
activeTheme = saved.activeTheme;
|
|
953
953
|
}
|
|
954
954
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UNPROTECTED_KEYS = exports.settings = exports.i18n = void 0;
|
|
4
|
-
const
|
|
4
|
+
const extension_1 = require("../../../../toolkit/dist/theme/extension");
|
|
5
5
|
var config_1 = require("../../../../toolkit/dist/config");
|
|
6
6
|
Object.defineProperty(exports, "i18n", { enumerable: true, get: function () { return config_1.messages; } });
|
|
7
|
-
exports.settings =
|
|
8
|
-
exports.UNPROTECTED_KEYS = [...
|
|
7
|
+
exports.settings = extension_1.systemGlobalSettingDefaults;
|
|
8
|
+
exports.UNPROTECTED_KEYS = [...extension_1.PUBLIC_SETTING_KEYS];
|
|
9
9
|
//# sourceMappingURL=setting.constant.js.map
|
|
@@ -13,7 +13,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.SettingService = void 0;
|
|
16
|
-
const
|
|
16
|
+
const extension_1 = require("../../../../toolkit/dist/theme/extension");
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
|
18
18
|
const config_1 = require("@nestjs/config");
|
|
19
19
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
@@ -121,8 +121,8 @@ let SettingService = class SettingService {
|
|
|
121
121
|
catch (_b) {
|
|
122
122
|
data = {};
|
|
123
123
|
}
|
|
124
|
-
const themeState = (0,
|
|
125
|
-
const defaultTheme = (0,
|
|
124
|
+
const themeState = (0, extension_1.getThemeStateFromGlobalSetting)(data);
|
|
125
|
+
const defaultTheme = (0, extension_1.getThemeStateFromGlobalSetting)(setting_constant_1.settings);
|
|
126
126
|
const mergedTheme = Object.assign(Object.assign(Object.assign({}, defaultTheme), themeState), { mods: Object.assign(Object.assign({}, defaultTheme.mods), themeState.mods), installedThemes: ((_a = themeState.installedThemes) === null || _a === void 0 ? void 0 : _a.length) > 0 ? themeState.installedThemes : defaultTheme.installedThemes });
|
|
127
127
|
const mergedSettings = Object.assign(Object.assign({}, data), { theme: mergedTheme });
|
|
128
128
|
const mergedSettingsString = JSON.stringify(mergedSettings);
|
|
@@ -166,7 +166,7 @@ let SettingService = class SettingService {
|
|
|
166
166
|
catch (_a) {
|
|
167
167
|
gs = {};
|
|
168
168
|
}
|
|
169
|
-
const { global, changed } = (0,
|
|
169
|
+
const { global, changed } = (0, extension_1.migrateLegacyAppearanceToThemeMods)(gs, target);
|
|
170
170
|
if (changed) {
|
|
171
171
|
target.globalSetting = JSON.stringify(global);
|
|
172
172
|
await this.settingRepository.save(target);
|
|
@@ -184,14 +184,14 @@ let SettingService = class SettingService {
|
|
|
184
184
|
catch (_a) {
|
|
185
185
|
gs = {};
|
|
186
186
|
}
|
|
187
|
-
const themeState = (0,
|
|
187
|
+
const themeState = (0, extension_1.getThemeStateFromGlobalSetting)(gs);
|
|
188
188
|
const activeTheme = themeState.activeTheme || 'hello-world';
|
|
189
189
|
const config = gs.config && typeof gs.config === 'object'
|
|
190
190
|
? Object.assign({}, gs.config)
|
|
191
191
|
: {};
|
|
192
192
|
let changed = false;
|
|
193
193
|
for (const themeId of THEMES_WITH_CONFIGURATION) {
|
|
194
|
-
const seed = (0,
|
|
194
|
+
const seed = (0, extension_1.getThemeConfigurationSeed)(themeId, 'zh');
|
|
195
195
|
if (!seed)
|
|
196
196
|
continue;
|
|
197
197
|
const current = config[themeId];
|
|
@@ -221,16 +221,16 @@ let SettingService = class SettingService {
|
|
|
221
221
|
if (isAdmin && !innerInvoke) {
|
|
222
222
|
return res;
|
|
223
223
|
}
|
|
224
|
-
const effective = (0,
|
|
224
|
+
const effective = (0, extension_1.resolveEffectiveSettingRow)(res);
|
|
225
225
|
if (innerInvoke) {
|
|
226
226
|
return effective;
|
|
227
227
|
}
|
|
228
|
-
return (0,
|
|
228
|
+
return (0, extension_1.buildPublicSettingView)(effective);
|
|
229
229
|
}
|
|
230
230
|
async update(setting) {
|
|
231
231
|
var _a;
|
|
232
232
|
const old = await this.ensureSettingRow();
|
|
233
|
-
const sanitized = (0,
|
|
233
|
+
const sanitized = (0, extension_1.pickSystemSettingPatch)(setting);
|
|
234
234
|
if ('smtpPass' in sanitized && !String((_a = sanitized.smtpPass) !== null && _a !== void 0 ? _a : '').trim()) {
|
|
235
235
|
delete sanitized.smtpPass;
|
|
236
236
|
}
|
package/server/package-lock.json
CHANGED
|
@@ -47,6 +47,8 @@
|
|
|
47
47
|
"passport": "^0.4.1",
|
|
48
48
|
"passport-jwt": "^4.0.0",
|
|
49
49
|
"pm2": "^5.2.0",
|
|
50
|
+
"react": "^19.2.7",
|
|
51
|
+
"react-dom": "^19.2.7",
|
|
50
52
|
"reflect-metadata": "^0.1.13",
|
|
51
53
|
"rimraf": "^3.0.0",
|
|
52
54
|
"rxjs": "^6.5.3",
|
|
@@ -91,7 +93,15 @@
|
|
|
91
93
|
},
|
|
92
94
|
"../toolkit": {
|
|
93
95
|
"name": "@fecommunity/reactpress-toolkit",
|
|
94
|
-
"version": "4.0.0-beta.10"
|
|
96
|
+
"version": "4.0.0-beta.10",
|
|
97
|
+
"dependencies": {
|
|
98
|
+
"ajv": "^8.17.1",
|
|
99
|
+
"axios": "^1.12.2",
|
|
100
|
+
"dotenv": "^8.6.0",
|
|
101
|
+
"fs-extra": "^10.0.0",
|
|
102
|
+
"lodash": "^4.17.21",
|
|
103
|
+
"swagger-typescript-api": "^12.0.4"
|
|
104
|
+
}
|
|
95
105
|
},
|
|
96
106
|
"node_modules/@angular-devkit/core": {
|
|
97
107
|
"version": "7.3.8",
|
|
@@ -15817,6 +15827,27 @@
|
|
|
15817
15827
|
"node": ">=0.10.0"
|
|
15818
15828
|
}
|
|
15819
15829
|
},
|
|
15830
|
+
"node_modules/react": {
|
|
15831
|
+
"version": "19.2.7",
|
|
15832
|
+
"resolved": "https://registry.npmjs.org/react/-/react-19.2.7.tgz",
|
|
15833
|
+
"integrity": "sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==",
|
|
15834
|
+
"license": "MIT",
|
|
15835
|
+
"engines": {
|
|
15836
|
+
"node": ">=0.10.0"
|
|
15837
|
+
}
|
|
15838
|
+
},
|
|
15839
|
+
"node_modules/react-dom": {
|
|
15840
|
+
"version": "19.2.7",
|
|
15841
|
+
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.7.tgz",
|
|
15842
|
+
"integrity": "sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==",
|
|
15843
|
+
"license": "MIT",
|
|
15844
|
+
"dependencies": {
|
|
15845
|
+
"scheduler": "^0.27.0"
|
|
15846
|
+
},
|
|
15847
|
+
"peerDependencies": {
|
|
15848
|
+
"react": "^19.2.7"
|
|
15849
|
+
}
|
|
15850
|
+
},
|
|
15820
15851
|
"node_modules/react-is": {
|
|
15821
15852
|
"version": "16.13.1",
|
|
15822
15853
|
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
|
@@ -16731,6 +16762,12 @@
|
|
|
16731
16762
|
"node": ">=11.0.0"
|
|
16732
16763
|
}
|
|
16733
16764
|
},
|
|
16765
|
+
"node_modules/scheduler": {
|
|
16766
|
+
"version": "0.27.0",
|
|
16767
|
+
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
|
|
16768
|
+
"integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",
|
|
16769
|
+
"license": "MIT"
|
|
16770
|
+
},
|
|
16734
16771
|
"node_modules/schema-utils": {
|
|
16735
16772
|
"version": "1.0.0",
|
|
16736
16773
|
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz",
|
package/server/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fecommunity/reactpress-server",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.11",
|
|
4
4
|
"deprecated": "Use the built-in API in @fecommunity/reactpress (CLI). Standalone server publishing stopped from 3.1.",
|
|
5
5
|
"description": "ReactPress NestJS CMS API — headless REST for the publishing platform (MySQL or SQLite)",
|
|
6
6
|
"author": "fecommunity",
|
package/toolkit/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fecommunity/reactpress-toolkit",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.11",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
"types": "./dist/theme/node.d.ts",
|
|
45
45
|
"default": "./dist/theme/node.js"
|
|
46
46
|
},
|
|
47
|
+
"./theme/extension": {
|
|
48
|
+
"types": "./dist/theme/extension/index.d.ts",
|
|
49
|
+
"default": "./dist/theme/extension/index.js"
|
|
50
|
+
},
|
|
47
51
|
"./theme/providers": {
|
|
48
52
|
"types": "./dist/theme/providers/index.d.ts",
|
|
49
53
|
"default": "./dist/theme/providers/index.js"
|
|
@@ -92,5 +96,13 @@
|
|
|
92
96
|
"types": "./dist/plugin/node.d.ts",
|
|
93
97
|
"default": "./dist/plugin/node.js"
|
|
94
98
|
}
|
|
99
|
+
},
|
|
100
|
+
"dependencies": {
|
|
101
|
+
"ajv": "^8.17.1",
|
|
102
|
+
"axios": "^1.12.2",
|
|
103
|
+
"dotenv": "^8.6.0",
|
|
104
|
+
"fs-extra": "^10.0.0",
|
|
105
|
+
"lodash": "^4.17.21",
|
|
106
|
+
"swagger-typescript-api": "^12.0.4"
|
|
95
107
|
}
|
|
96
108
|
}
|