@xfilecom/xframe 0.1.24 → 0.1.25

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/bin/xframe.js CHANGED
@@ -400,6 +400,31 @@ function patchWebTsconfigFrontCorePath(targetRoot) {
400
400
  }
401
401
  }
402
402
 
403
+ /** 템플릿 Vite 의 로컬 front-core alias → 생성 앱은 설치된 npm 패키지 루트 */
404
+ const TEMPLATE_VITE_FRONT_CORE_MARKERS = [
405
+ "path.resolve(__dirname, '../../../../front-core/src')",
406
+ "path.resolve(__dirname, '../../../..', 'front-core', 'src')",
407
+ ];
408
+ const SCAFFOLD_VITE_FRONT_CORE =
409
+ "path.resolve(__dirname, '../../node_modules/@xfilecom/front-core')";
410
+
411
+ function patchWebViteFrontCoreAlias(targetRoot) {
412
+ for (const sub of ['client', 'admin']) {
413
+ const p = path.join(targetRoot, 'web', sub, 'vite.config.ts');
414
+ if (!fs.existsSync(p)) continue;
415
+ let raw = fs.readFileSync(p, 'utf8');
416
+ let next = raw;
417
+ for (const marker of TEMPLATE_VITE_FRONT_CORE_MARKERS) {
418
+ if (next.includes(marker)) {
419
+ next = next.split(marker).join(SCAFFOLD_VITE_FRONT_CORE);
420
+ }
421
+ }
422
+ if (next !== raw) {
423
+ fs.writeFileSync(p, next, 'utf8');
424
+ }
425
+ }
426
+ }
427
+
403
428
  function isValidNpmName(name) {
404
429
  if (!name || typeof name !== 'string') return false;
405
430
  if (name.length > 214) return false;
@@ -518,6 +543,7 @@ async function main() {
518
543
 
519
544
  /** 템플릿은 모노레포 기준 front-core 소스를 가리키고, 생성 앱은 설치된 패키지로 바꿉니다. */
520
545
  patchWebTsconfigFrontCorePath(targetRoot);
546
+ patchWebViteFrontCoreAlias(targetRoot);
521
547
 
522
548
  console.log(`Created ${packageName} at ${targetRoot}
523
549
 
package/defaults.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "backendCore": "^1.0.5",
3
- "frontCore": "^0.2.10"
2
+ "backendCore": "^1.0.6",
3
+ "frontCore": "^0.2.11"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfilecom/xframe",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "Scaffold full-stack app: Nest + @xfilecom/backend-core, Vite/React + @xfilecom/front-core",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -7,8 +7,11 @@ import react from '@vitejs/plugin-react';
7
7
 
8
8
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
9
 
10
- /** xframe 모노레포 안: 로컬 front-core 소스 → Vite가 바로 번들 (npm dist 생략). */
11
- const frontCoreSrc = path.resolve(__dirname, '../../../../front-core/src');
10
+ /**
11
+ * 모노레포에서 템플릿 개발 시: …/packages/xframe/packages/front-core/src
12
+ * (`npx @xfilecom/xframe <dir>` 로 프로젝트를 만들면 CLI 가 node_modules 패키지 경로로 덮어씀)
13
+ */
14
+ const frontCoreSrc = path.resolve(__dirname, '../../../..', 'front-core', 'src');
12
15
 
13
16
  const webSharedSrc = path.resolve(__dirname, '../shared/src');
14
17
 
@@ -7,8 +7,11 @@ import react from '@vitejs/plugin-react';
7
7
 
8
8
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
9
 
10
- /** xframe 모노레포 안: 로컬 front-core 소스 → Vite가 바로 번들 (npm dist 생략). */
11
- const frontCoreSrc = path.resolve(__dirname, '../../../../front-core/src');
10
+ /**
11
+ * 모노레포에서 템플릿 개발 시: …/packages/xframe/packages/front-core/src
12
+ * (`npx @xfilecom/xframe <dir>` 로 프로젝트를 만들면 CLI 가 node_modules 패키지 경로로 덮어씀)
13
+ */
14
+ const frontCoreSrc = path.resolve(__dirname, '../../../..', 'front-core', 'src');
12
15
 
13
16
  /** file:../shared 복사본이 아닌 워크스페이스 web/shared/src (플레이스홀더 패키지 이름과 동일 키) */
14
17
  const webSharedSrc = path.resolve(__dirname, '../shared/src');