@devisfuture/electron-modular 1.1.3 → 1.1.4
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 +8 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,6 +66,13 @@ TypeScript setup:
|
|
|
66
66
|
|
|
67
67
|
> Tip: This package is published as ESM. When importing local modules, use `.js` extensions in runtime imports, e.g. `import { UserModule } from "./user/module.js"`.
|
|
68
68
|
|
|
69
|
+
## Folders (build outputs)
|
|
70
|
+
|
|
71
|
+
The `folders` option in `initSettings` tells the framework where your build artifacts live:
|
|
72
|
+
|
|
73
|
+
- `distRenderer` — the build output folder for your renderer (web) bundle (e.g. Vite/webpack output).
|
|
74
|
+
- `distMain` — the build output folder for your main process bundle (compiled ESM files).
|
|
75
|
+
|
|
69
76
|
---
|
|
70
77
|
|
|
71
78
|
## Quick Start
|
|
@@ -179,7 +186,7 @@ export class UserService {
|
|
|
179
186
|
|
|
180
187
|
### Approach 2: Provider Pattern (Advanced)
|
|
181
188
|
|
|
182
|
-
Use `provide` and `useFactory` to expose only necessary
|
|
189
|
+
Use `provide` and `useFactory` to expose only necessary types.
|
|
183
190
|
|
|
184
191
|
#### tokens.ts
|
|
185
192
|
|
|
@@ -666,8 +673,6 @@ my-feature/
|
|
|
666
673
|
|
|
667
674
|
### 1. Use Providers for Cross-Module Communication
|
|
668
675
|
|
|
669
|
-
✅ **Good:**
|
|
670
|
-
|
|
671
676
|
```typescript
|
|
672
677
|
{
|
|
673
678
|
provide: AUTH_PROVIDER,
|
|
@@ -679,19 +684,10 @@ my-feature/
|
|
|
679
684
|
}
|
|
680
685
|
```
|
|
681
686
|
|
|
682
|
-
❌ **Bad:**
|
|
683
|
-
|
|
684
|
-
```typescript
|
|
685
|
-
// Don't export entire service
|
|
686
|
-
exports: [AuthService];
|
|
687
|
-
```
|
|
688
|
-
|
|
689
687
|
### 2. Keep Services Focused
|
|
690
688
|
|
|
691
689
|
Each service should have a single responsibility.
|
|
692
690
|
|
|
693
|
-
✅ **Good:**
|
|
694
|
-
|
|
695
691
|
```typescript
|
|
696
692
|
@Injectable()
|
|
697
693
|
export class ResourcesService {
|
|
@@ -706,8 +702,6 @@ export class CacheWindowsService {
|
|
|
706
702
|
|
|
707
703
|
### 3. Use Tokens for All Cross-Module Dependencies
|
|
708
704
|
|
|
709
|
-
✅ **Good:**
|
|
710
|
-
|
|
711
705
|
```typescript
|
|
712
706
|
export const RESOURCES_REST_API_PROVIDER = Symbol("RESOURCES_REST_API_PROVIDER");
|
|
713
707
|
|
package/package.json
CHANGED