@decaf-ts/utils 0.3.13 → 0.4.1
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 +20 -2
- package/dist/utils.cjs +298 -141
- package/dist/utils.esm.cjs +225 -80
- package/lib/cli/commands/build-scripts.cjs +227 -77
- package/lib/cli/commands/build-scripts.d.ts +18 -4
- package/lib/esm/cli/commands/build-scripts.d.ts +18 -4
- package/lib/esm/cli/commands/build-scripts.js +225 -78
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-

|
|
2
2
|
|
|
3
3
|
## Decaf's Utils Module
|
|
4
4
|
|
|
@@ -445,6 +445,24 @@ writer.error('Command not found: node'); // This will be logged as an error
|
|
|
445
445
|
```
|
|
446
446
|
|
|
447
447
|
|
|
448
|
+
## Coding Principles
|
|
449
|
+
|
|
450
|
+
- group similar functionality in folders (analog to namespaces but without any namespace declaration)
|
|
451
|
+
- one class per file;
|
|
452
|
+
- one interface per file (unless interface is just used as a type);
|
|
453
|
+
- group types as other interfaces in a types.ts file per folder;
|
|
454
|
+
- group constants or enums in a constants.ts file per folder;
|
|
455
|
+
- group decorators in a decorators.ts file per folder;
|
|
456
|
+
- always import from the specific file, never from a folder or index file (exceptions for dependencies on other packages);
|
|
457
|
+
- prefer the usage of established design patters where applicable:
|
|
458
|
+
- Singleton (can be an anti-pattern. use with care);
|
|
459
|
+
- factory;
|
|
460
|
+
- observer;
|
|
461
|
+
- strategy;
|
|
462
|
+
- builder;
|
|
463
|
+
- etc;
|
|
464
|
+
|
|
465
|
+
|
|
448
466
|
### Related
|
|
449
467
|
|
|
450
468
|
[](https://github.com/decaf-ts/decaf-ts)
|
|
@@ -483,4 +501,4 @@ So if you can, if this project in any way. either by learning something or simpl
|
|
|
483
501
|
|
|
484
502
|
This project is released under the [MIT License](./LICENSE.md).
|
|
485
503
|
|
|
486
|
-
By developers, for developers...
|
|
504
|
+
By developers, for developers...
|