create-synapse-mfe 1.0.11 โ 1.0.12
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 +7 -7
- package/bin/index.js +9 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# create-synapse-mfe
|
|
1
|
+
# create-synapse-mfe
|
|
2
2
|
|
|
3
3
|
A lightning-fast, zero-dependency CLI scaffolding tool for bootstrapping a modern, scalable **Micro-Frontend (MFE)** architecture using **Vite**, **React**, and **Module Federation**.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Features
|
|
6
6
|
|
|
7
7
|
- **Zero Dependencies**: Built with native Node.js (`child_process`, `fs`) for instant execution.
|
|
8
8
|
- **Vite & Module Federation**: Pre-configured for high-performance React applications.
|
|
9
9
|
- **Enterprise Ready**: Includes a Host (Shell) app, Remote apps, and shared libraries out of the box.
|
|
10
10
|
- **Nx Monorepo Style**: Organized for scalable development.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Usage
|
|
13
13
|
|
|
14
14
|
You do not need to install this package globally. Simply run it directly using `npx`:
|
|
15
15
|
|
|
@@ -25,7 +25,7 @@ The CLI will interactively ask for your project name (default: `synapse-workspac
|
|
|
25
25
|
npx create-synapse-mfe@latest my-awesome-mfe
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Next Steps After Scaffolding
|
|
29
29
|
|
|
30
30
|
Once your project is generated, follow these simple steps to spin up the entire Micro-Frontend ecosystem:
|
|
31
31
|
|
|
@@ -40,7 +40,7 @@ pnpm install
|
|
|
40
40
|
pnpm run dev:new
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
##
|
|
43
|
+
## Default Mock Credentials (Development)
|
|
44
44
|
|
|
45
45
|
Saat `MSW` aktif di mode development, gunakan akun berikut untuk login cepat:
|
|
46
46
|
|
|
@@ -55,7 +55,7 @@ Catatan:
|
|
|
55
55
|
- `auth-mfe` menampilkan kredensial mock otomatis di bawah form login (dev + MSW).
|
|
56
56
|
- Dokumentasi detail tersedia di `/docs/api-mocking`, `/docs/api-interceptors`, dan `/docs/security`.
|
|
57
57
|
|
|
58
|
-
##
|
|
58
|
+
## Architecture Blueprint
|
|
59
59
|
|
|
60
60
|
The generated workspace pulls from a clean-slate boilerplate that includes:
|
|
61
61
|
|
|
@@ -64,6 +64,6 @@ The generated workspace pulls from a clean-slate boilerplate that includes:
|
|
|
64
64
|
- `apps/docs-mfe`: A remote documentation micro-frontend.
|
|
65
65
|
- `libs/`: Shared libraries holding UI components, types, and API logic.
|
|
66
66
|
|
|
67
|
-
##
|
|
67
|
+
## License
|
|
68
68
|
|
|
69
69
|
MIT
|
package/bin/index.js
CHANGED
|
@@ -25,9 +25,9 @@ const rl = readline.createInterface({
|
|
|
25
25
|
output: process.stdout,
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
console.log('\x1b[36m%s\x1b[0m', '
|
|
28
|
+
console.log('\x1b[36m%s\x1b[0m', 'Welcome to create-synapse-mfe CLI v1.0.5!');
|
|
29
29
|
console.log('Scaffolding a Vite-powered Micro-Frontend Architecture...');
|
|
30
|
-
console.log("\x1b[
|
|
30
|
+
console.log("\x1b[32mWhat's new in v1.0.4:\x1b[0m");
|
|
31
31
|
console.log(
|
|
32
32
|
' \x1b[34m- Hardened security (removed token from query params & sessionStorage)\x1b[0m'
|
|
33
33
|
);
|
|
@@ -57,13 +57,13 @@ const getProjectName = () => {
|
|
|
57
57
|
|
|
58
58
|
if (fs.existsSync(projectPath)) {
|
|
59
59
|
console.error(
|
|
60
|
-
`\n\x1b[
|
|
60
|
+
`\n\x1b[31mError: Folder "${projectName}" sudah ada! Harap pilih nama lain.\x1b[0m`
|
|
61
61
|
);
|
|
62
62
|
process.exit(1);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
console.log(
|
|
66
|
-
`\n\x1b[
|
|
66
|
+
`\n\x1b[32mMengkloning blueprint MFE ke dalam \x1b[1m${projectName}\x1b[0m...\x1b[0m`
|
|
67
67
|
);
|
|
68
68
|
|
|
69
69
|
const cloneCmd = `git clone --depth 1 ${GIT_REPO} "${projectName}"`;
|
|
@@ -71,7 +71,7 @@ const getProjectName = () => {
|
|
|
71
71
|
process.exit(1);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
console.log(`\n\x1b[
|
|
74
|
+
console.log(`\n\x1b[32mMembersihkan jejak git lama (Re-initializing)...\x1b[0m`);
|
|
75
75
|
const gitFolder = path.join(projectPath, '.git');
|
|
76
76
|
if (fs.existsSync(gitFolder)) {
|
|
77
77
|
fs.rmSync(gitFolder, { recursive: true, force: true });
|
|
@@ -88,16 +88,16 @@ const getProjectName = () => {
|
|
|
88
88
|
fs.rmSync(npmWorkflow, { force: true });
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
console.log(`\x1b[
|
|
91
|
+
console.log(`\x1b[32mMemulai repositori Git baru...\x1b[0m`);
|
|
92
92
|
runCommand(`git init`, { cwd: projectPath });
|
|
93
93
|
|
|
94
|
-
console.log(`\n\x1b[
|
|
94
|
+
console.log(`\n\x1b[36mBerhasil! Proyek "\x1b[1m${projectName}\x1b[0m\x1b[36m" telah siap.\n`);
|
|
95
95
|
console.log('Langkah selanjutnya yang harus Anda lakukan:');
|
|
96
96
|
console.log(`\x1b[33m cd ${projectName}\x1b[0m`);
|
|
97
97
|
console.log('\x1b[33m pnpm install\x1b[0m');
|
|
98
98
|
console.log('\x1b[33m pnpm run dev:new\n\x1b[0m');
|
|
99
99
|
|
|
100
|
-
console.log('\x1b[
|
|
100
|
+
console.log('\x1b[36mMock credentials (development):\x1b[0m');
|
|
101
101
|
console.log(' \x1b[34m- auth-mfe (/auth/login): admin@Synapse.com / password123\x1b[0m');
|
|
102
102
|
console.log(' \x1b[34m- auth-mfe (/auth/login): user@Synapse.com / password123\x1b[0m');
|
|
103
103
|
console.log(' \x1b[34m- standalone MFE (isolated): dev@synapse.local / password123\x1b[0m');
|
|
@@ -105,7 +105,7 @@ const getProjectName = () => {
|
|
|
105
105
|
' \x1b[34m- docs: /docs/api-mocking, /docs/api-interceptors, /docs/security\x1b[0m\n'
|
|
106
106
|
);
|
|
107
107
|
|
|
108
|
-
console.log('\x1b[35mSelamat Mengoding Micro-Frontend
|
|
108
|
+
console.log('\x1b[35mSelamat Mengoding Micro-Frontend!\x1b[0m\n');
|
|
109
109
|
|
|
110
110
|
rl.close();
|
|
111
111
|
process.exit(0);
|