@codemoreira/esad 1.1.0 โ†’ 1.1.2

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/esad.js CHANGED
@@ -10,7 +10,7 @@ const deployCommand = require('../src/cli/commands/deploy');
10
10
  const devCommand = require('../src/cli/commands/dev');
11
11
 
12
12
  program
13
- .version('1.1.0')
13
+ .version('1.1.2')
14
14
  .description('esad - Easy Super App Development Toolkit');
15
15
 
16
16
  // --- COMMMAND: esad init ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemoreira/esad",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Easy Super App Development - Zero-Config CLI and DevTools for React Native Module Federation",
5
5
  "main": "src/plugin/index.js",
6
6
  "exports": {
@@ -1,4 +1,7 @@
1
+ const { runProcess } = require('../utils/process');
1
2
  const { getWorkspaceConfig } = require('../utils/config');
3
+ const fs = require('fs-extra');
4
+ const path = require('path');
2
5
 
3
6
  module.exports = async (cdnName) => {
4
7
  const configObj = getWorkspaceConfig();
@@ -6,8 +9,36 @@ module.exports = async (cdnName) => {
6
9
  console.error(`โŒ Error: Call this command from inside an ESAD workspace (esad.config.json not found).`);
7
10
  return;
8
11
  }
12
+
9
13
  const finalCdnName = cdnName || `${configObj.data.projectName}-cdn`;
10
- console.log(`\n๐Ÿ“ฆ Creating CDN Registry: ${finalCdnName}...\n`);
11
- // Placeholder for backend cloning
12
- console.log(`[TODO] Scaffold Node Express backend into ./${finalCdnName}`);
14
+ const cdnPath = path.join(process.cwd(), finalCdnName);
15
+
16
+ if (fs.existsSync(cdnPath)) {
17
+ console.error(`โŒ Error: Directory ./${finalCdnName} already exists.`);
18
+ return;
19
+ }
20
+
21
+ console.log(`\n๐Ÿ“ฆ Initializing Flux Registry & CDN: ${finalCdnName}...\n`);
22
+
23
+ try {
24
+ // 1. Clone the template
25
+ console.log(`๐Ÿ“ก Cloning template from GitHub...`);
26
+ await runProcess('git', ['clone', 'https://github.com/CodeMoreira/simple-cdn.git', finalCdnName]);
27
+
28
+ // 2. Remove .git from template
29
+ console.log(`๐Ÿงน Cleaning up template metadata...`);
30
+ await fs.remove(path.join(cdnPath, '.git'));
31
+
32
+ // 3. Install dependencies
33
+ console.log(`\n๐Ÿ“ฅ Installing dependencies (this may take a minute)...`);
34
+ await runProcess('npm', ['install'], cdnPath);
35
+
36
+ console.log(`\nโœ… CDN Registry created successfully in ./${finalCdnName}\n`);
37
+ console.log(`To start your CDN:`);
38
+ console.log(` cd ${finalCdnName}`);
39
+ console.log(` npm start\n`);
40
+
41
+ } catch (error) {
42
+ console.error(`\nโŒ Failed to create CDN: ${error.message}`);
43
+ }
13
44
  };
@@ -156,7 +156,7 @@ export default function Dashboard() {
156
156
  <Text className="text-lg font-semibold text-slate-800 mb-4">Your Modules</Text>
157
157
 
158
158
  {MOCK_MODULES.map(m => (
159
- <Link key={m.id} href={\`/(protected)/module/${m.id}\`} asChild>
159
+ <Link key={m.id} href={\`/(protected)/module/\${m.id}\`} asChild>
160
160
  <TouchableOpacity className="bg-white p-6 rounded-2xl mb-4 shadow-sm border border-slate-100 flex-row items-center">
161
161
  <Text className="text-3xl mr-4">{m.icon}</Text>
162
162
  <View className="flex-1">