@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.
@@ -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}:\s*(.+?)(?:\s+#.*)?$`, 'm'));
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 slots = ['api', 'admin', 'web'];
153
- for (const slot of slots) {
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 (slot !== 'api' && kind !== GlobalTypeEnum.FRONTEND)
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
 
@@ -41,6 +41,12 @@ configs:
41
41
  options:
42
42
  enabled: true
43
43
  queueLogEnabled: true
44
+ redis:
45
+ options:
46
+ enabled: true
47
+ mongo:
48
+ options:
49
+ enabled: true
44
50
  loggers:
45
51
  loadPath: logs
46
52
  logLevel: debug
@@ -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