@xrystal/core 3.52.6 → 3.52.9
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/package.json +1 -1
- package/x/bin/commands/create.mjs +35 -5
- package/x/bin/commands/sync.mjs +65 -99
- package/x/bin/commands/tmp.mjs +3 -0
- package/x/bin/helpers/.generated/tmp-schema.mjs +30 -1
- package/x/bin/helpers/.generated/workspace.mjs +20 -17
- package/x/bin/helpers/cli-help.mjs +35 -13
- package/x/bin/helpers/create-target.mjs +49 -5
- package/x/bin/helpers/project-context.mjs +10 -7
- package/x/bin/helpers/sync-project.mjs +76 -0
- package/x/bin/helpers/sync-scope.mjs +71 -0
- package/x/bin/helpers/tmp-config.mjs +25 -0
- package/x/bin/helpers/workspace-resolve.mjs +2 -0
- package/x/dist/loader/kafka/index.js +7 -2
- package/x/dist/loader/logger/index.js +8 -6
- package/x/dist/loader/mongo/index.js +9 -0
- package/x/dist/loader/redis/index.js +9 -0
- package/x/dist/project/index.d.ts +1 -0
- package/x/dist/project/index.js +21 -14
- package/x/dist/utils/helpers/loader-options/index.d.ts +5 -0
- package/x/dist/utils/helpers/loader-options/index.js +16 -0
- package/x/dist/utils/helpers/tmp/index.d.ts +1 -0
- package/x/dist/utils/helpers/tmp/index.js +1 -0
- package/x/dist/utils/helpers/tmp/loader-boot-plan.d.ts +10 -0
- package/x/dist/utils/helpers/tmp/loader-boot-plan.js +36 -0
- package/x/dist/utils/helpers/tmp/tmp-schema.js +32 -1
- package/x/dist/utils/helpers/workspace/index.d.ts +10 -3
- package/x/dist/utils/helpers/workspace/index.js +17 -15
- package/x/templates/api-service/tmp.yml +6 -0
- package/x/templates/frontend/tmp.yml +61 -0
|
@@ -6,8 +6,8 @@ export const TMP_FILE = 'tmp.yml';
|
|
|
6
6
|
export const SKIP_DIRS = new Set(['node_modules', '.git', 'dist', '.turbo', 'coverage']);
|
|
7
7
|
export const DEFAULT_FOLDER_STRUCTURE = {
|
|
8
8
|
api: 'api',
|
|
9
|
-
admin: 'admin',
|
|
10
9
|
web: 'web',
|
|
10
|
+
mobile: 'mobile',
|
|
11
11
|
};
|
|
12
12
|
function parseScalar(raw) {
|
|
13
13
|
const trimmed = raw.trim();
|
|
@@ -43,18 +43,28 @@ export function readTmpFile(filePath) {
|
|
|
43
43
|
}
|
|
44
44
|
export function parseFolderStructure(text) {
|
|
45
45
|
const fsBlock = text.match(/folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? '';
|
|
46
|
+
if (/^[ \t]+admin:/m.test(fsBlock)) {
|
|
47
|
+
throw new Error('configs.folder-structure.admin removed — put admin panels under web/ (e.g. web/admin-ui)');
|
|
48
|
+
}
|
|
46
49
|
const readSlot = (key) => {
|
|
47
|
-
const scalar = fsBlock.match(new RegExp(`^[ \t]+${key}
|
|
50
|
+
const scalar = fsBlock.match(new RegExp(`^[ \t]+${key}:\\s*(.+?)(?:\\s+#.*)?$`, 'm'));
|
|
48
51
|
if (scalar)
|
|
49
52
|
return parseScalar(scalar[1]);
|
|
50
53
|
return DEFAULT_FOLDER_STRUCTURE[key];
|
|
51
54
|
};
|
|
52
55
|
return {
|
|
53
56
|
api: readSlot('api'),
|
|
54
|
-
admin: readSlot('admin'),
|
|
55
57
|
web: readSlot('web'),
|
|
58
|
+
mobile: readSlot('mobile'),
|
|
56
59
|
};
|
|
57
60
|
}
|
|
61
|
+
export function workspaceDiscoverySlots(fsMap) {
|
|
62
|
+
return [
|
|
63
|
+
{ slot: 'api', folder: fsMap.api, frontendOnly: false },
|
|
64
|
+
{ slot: 'web', folder: fsMap.web, frontendOnly: true },
|
|
65
|
+
{ slot: 'mobile', folder: fsMap.mobile, frontendOnly: true },
|
|
66
|
+
];
|
|
67
|
+
}
|
|
58
68
|
export { normalizeGlobalType } from '../../../utils/helpers/tmp/tmp-schema.js';
|
|
59
69
|
export function entryName(meta) {
|
|
60
70
|
const project = (meta.projectName ?? '').trim();
|
|
@@ -149,9 +159,8 @@ export function findEntries(workspaceRoot) {
|
|
|
149
159
|
const fsMap = wsMeta.folderStructure;
|
|
150
160
|
const entries = [];
|
|
151
161
|
const seen = new Set();
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
const folder = path.join(workspaceRoot, fsMap[slot]);
|
|
162
|
+
for (const { slot, folder: folderRel, frontendOnly } of workspaceDiscoverySlots(fsMap)) {
|
|
163
|
+
const folder = path.join(workspaceRoot, folderRel);
|
|
155
164
|
for (const tmpPath of walkTmpUnder(folder)) {
|
|
156
165
|
if (path.resolve(tmpPath) === path.join(workspaceRoot, TMP_FILE))
|
|
157
166
|
continue;
|
|
@@ -159,7 +168,7 @@ export function findEntries(workspaceRoot) {
|
|
|
159
168
|
const kind = entryType(meta, slot);
|
|
160
169
|
if (kind === GlobalTypeEnum.WORKSPACE)
|
|
161
170
|
continue;
|
|
162
|
-
if (
|
|
171
|
+
if (frontendOnly && kind !== GlobalTypeEnum.FRONTEND)
|
|
163
172
|
continue;
|
|
164
173
|
if (kind !== GlobalTypeEnum.API_SERVICE && kind !== GlobalTypeEnum.FRONTEND)
|
|
165
174
|
continue;
|
|
@@ -207,17 +216,10 @@ export function workspaceTmpTemplate(projectName) {
|
|
|
207
216
|
configs:
|
|
208
217
|
global:
|
|
209
218
|
type: workspace
|
|
210
|
-
runtime: bun
|
|
211
|
-
framework: bun
|
|
212
|
-
paths:
|
|
213
|
-
root: .
|
|
214
|
-
tmp: tmp.yml
|
|
215
|
-
options:
|
|
216
|
-
fileWatchIntervalMs: 500
|
|
217
219
|
folder-structure:
|
|
218
220
|
api: api
|
|
219
|
-
admin: admin
|
|
220
221
|
web: web
|
|
222
|
+
mobile: mobile
|
|
221
223
|
|
|
222
224
|
kubeconfig: ~/.kube/config
|
|
223
225
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
project:
|
|
2
|
+
name: "{{xry}}"
|
|
3
|
+
|
|
4
|
+
configs:
|
|
5
|
+
global:
|
|
6
|
+
type: frontend
|
|
7
|
+
runtime: bun
|
|
8
|
+
framework: fetch
|
|
9
|
+
paths:
|
|
10
|
+
root: ./x
|
|
11
|
+
tmp: tmp.yml
|
|
12
|
+
source: ./source
|
|
13
|
+
special:
|
|
14
|
+
tests: tests
|
|
15
|
+
environments: environments
|
|
16
|
+
dist: dist
|
|
17
|
+
vars:
|
|
18
|
+
xry: xry
|
|
19
|
+
build:
|
|
20
|
+
bundler: auto
|
|
21
|
+
typecheck: false
|
|
22
|
+
tscLenient: true
|
|
23
|
+
options:
|
|
24
|
+
fileWatchIntervalMs: 500
|
|
25
|
+
|
|
26
|
+
depends:
|
|
27
|
+
protocols:
|
|
28
|
+
- http
|
|
29
|
+
loaders:
|
|
30
|
+
configs:
|
|
31
|
+
loadPath: '@/utils/helpers/configs/index'
|
|
32
|
+
system:
|
|
33
|
+
gStore:
|
|
34
|
+
options:
|
|
35
|
+
bootstrap: true
|
|
36
|
+
autoCreateProps: true
|
|
37
|
+
kafka:
|
|
38
|
+
options:
|
|
39
|
+
enabled: false
|
|
40
|
+
queueLogEnabled: false
|
|
41
|
+
redis:
|
|
42
|
+
options:
|
|
43
|
+
enabled: false
|
|
44
|
+
mongo:
|
|
45
|
+
options:
|
|
46
|
+
enabled: false
|
|
47
|
+
loggers:
|
|
48
|
+
loadPath: logs
|
|
49
|
+
logLevel: info
|
|
50
|
+
localization:
|
|
51
|
+
loadPath: assets/langs
|
|
52
|
+
fallbackLang: en
|
|
53
|
+
preloadLangs:
|
|
54
|
+
- en
|
|
55
|
+
- tr
|
|
56
|
+
dto:
|
|
57
|
+
withDefaultHeaders: true
|
|
58
|
+
controller:
|
|
59
|
+
|
|
60
|
+
end:
|
|
61
|
+
version: 1
|