@decaf-ts/core 0.3.36 → 0.3.38
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/LICENSE.md +0 -0
- package/README.md +37 -243
- package/dist/core.js +2 -0
- package/dist/{core.bundle.min.js.LICENSE.txt → core.js.LICENSE.txt} +0 -0
- package/dist/esm/core.js +2 -0
- package/dist/esm/{core.bundle.min.esm.js.LICENSE.txt → core.js.LICENSE.txt} +0 -0
- package/dist/{lib → types}/identity/decorators.d.ts +1 -1
- package/dist/{lib → types}/identity/index.d.ts +0 -0
- package/dist/{lib → types}/identity/utils.d.ts +0 -0
- package/{lib/esm → dist/types}/index.d.ts +1 -1
- package/dist/{lib → types}/interfaces/Builder.d.ts +0 -0
- package/dist/{lib → types}/interfaces/Executor.d.ts +0 -0
- package/dist/{lib → types}/interfaces/Observable.d.ts +0 -0
- package/dist/{lib → types}/interfaces/Observer.d.ts +0 -0
- package/dist/{lib → types}/interfaces/Paginatable.d.ts +0 -0
- package/dist/{lib → types}/interfaces/Queriable.d.ts +0 -0
- package/dist/{lib → types}/interfaces/RawExecutor.d.ts +0 -0
- package/dist/{lib → types}/interfaces/SequenceOptions.d.ts +0 -0
- package/dist/{lib → types}/interfaces/index.d.ts +0 -0
- package/dist/{lib → types}/model/BaseModel.d.ts +0 -0
- package/dist/{lib → types}/model/IdentifiedBaseModel.d.ts +0 -0
- package/dist/{lib → types}/model/User.d.ts +0 -0
- package/{lib → dist/types}/model/construction.d.ts +1 -1
- package/dist/{lib → types}/model/decorators.d.ts +0 -0
- package/dist/{lib → types}/model/index.d.ts +0 -0
- package/dist/{lib → types}/model/types.d.ts +0 -0
- package/dist/{lib → types}/persistence/Adapter.d.ts +0 -0
- package/dist/{lib → types}/persistence/Sequence.d.ts +0 -0
- package/dist/{lib → types}/persistence/constants.d.ts +0 -0
- package/dist/{lib → types}/persistence/decorators.d.ts +0 -0
- package/dist/{lib → types}/persistence/errors.d.ts +0 -0
- package/dist/{lib → types}/persistence/index.d.ts +0 -0
- package/dist/{lib → types}/query/Clause.d.ts +0 -0
- package/dist/{lib → types}/query/ClauseFactory.d.ts +0 -0
- package/dist/{lib → types}/query/Condition.d.ts +0 -0
- package/dist/{lib → types}/query/Paginator.d.ts +0 -0
- package/dist/{lib → types}/query/Query.d.ts +0 -0
- package/dist/{lib → types}/query/Statement.d.ts +0 -0
- package/dist/{lib → types}/query/clauses/FromClause.d.ts +0 -0
- package/dist/{lib → types}/query/clauses/GroupByClause.d.ts +0 -0
- package/dist/{lib → types}/query/clauses/InsertClause.d.ts +0 -0
- package/dist/{lib → types}/query/clauses/LimitClause.d.ts +0 -0
- package/dist/{lib → types}/query/clauses/OffsetClause.d.ts +0 -0
- package/dist/{lib → types}/query/clauses/OrderByClause.d.ts +0 -0
- package/dist/{lib → types}/query/clauses/SelectClause.d.ts +0 -0
- package/dist/{lib → types}/query/clauses/SelectorBasedClause.d.ts +0 -0
- package/dist/{lib → types}/query/clauses/ValuesClause.d.ts +0 -0
- package/dist/{lib → types}/query/clauses/WhereClause.d.ts +0 -0
- package/dist/{lib → types}/query/clauses/index.d.ts +0 -0
- package/dist/{lib → types}/query/constants.d.ts +0 -0
- package/dist/{lib → types}/query/errors.d.ts +0 -0
- package/dist/{lib → types}/query/index.d.ts +0 -0
- package/dist/{lib → types}/query/options.d.ts +0 -0
- package/dist/{lib → types}/query/selectors.d.ts +0 -0
- package/dist/{lib → types}/query/types.d.ts +0 -0
- package/dist/{lib → types}/repository/Context.d.ts +0 -0
- package/dist/{lib → types}/repository/Repository.d.ts +0 -0
- package/dist/{lib → types}/repository/constants.d.ts +0 -0
- package/dist/{lib → types}/repository/decorators.d.ts +0 -0
- package/dist/{lib → types}/repository/errors.d.ts +0 -0
- package/dist/{lib → types}/repository/index.d.ts +0 -0
- package/dist/{lib → types}/repository/injectables.d.ts +0 -0
- package/dist/{lib → types}/repository/types.d.ts +0 -0
- package/dist/{lib → types}/repository/utils.d.ts +0 -0
- package/dist/{lib → types}/validators/ClauseSequenceValidator.d.ts +3 -3
- package/dist/{lib → types}/validators/decorators.d.ts +0 -0
- package/dist/{lib → types}/validators/index.d.ts +0 -0
- package/lib/esm/identity/decorators.js +1 -1
- package/lib/esm/identity/index.js +1 -1
- package/lib/esm/identity/utils.js +1 -1
- package/lib/esm/index.js +2 -2
- package/lib/esm/interfaces/Builder.js +1 -1
- package/lib/esm/interfaces/Executor.js +1 -1
- package/lib/esm/interfaces/Observable.js +1 -1
- package/lib/esm/interfaces/Observer.js +1 -1
- package/lib/esm/interfaces/Paginatable.js +1 -1
- package/lib/esm/interfaces/Queriable.js +1 -1
- package/lib/esm/interfaces/RawExecutor.js +1 -1
- package/lib/esm/interfaces/SequenceOptions.js +1 -1
- package/lib/esm/interfaces/index.js +1 -1
- package/lib/esm/model/BaseModel.js +1 -1
- package/lib/esm/model/IdentifiedBaseModel.js +1 -1
- package/lib/esm/model/User.js +1 -1
- package/lib/esm/model/construction.js +1 -1
- package/lib/esm/model/decorators.js +1 -1
- package/lib/esm/model/index.js +1 -1
- package/lib/esm/model/types.js +1 -1
- package/lib/esm/persistence/Adapter.js +1 -1
- package/lib/esm/persistence/Sequence.js +1 -1
- package/lib/esm/persistence/constants.js +1 -1
- package/lib/esm/persistence/decorators.js +1 -1
- package/lib/esm/persistence/errors.js +1 -1
- package/lib/esm/persistence/index.js +1 -1
- package/lib/esm/query/Clause.js +1 -1
- package/lib/esm/query/ClauseFactory.js +1 -1
- package/lib/esm/query/Condition.js +1 -1
- package/lib/esm/query/Paginator.js +1 -1
- package/lib/esm/query/Query.js +1 -1
- package/lib/esm/query/Statement.js +1 -1
- package/lib/esm/query/clauses/FromClause.js +1 -1
- package/lib/esm/query/clauses/GroupByClause.js +1 -1
- package/lib/esm/query/clauses/InsertClause.js +1 -1
- package/lib/esm/query/clauses/LimitClause.js +1 -1
- package/lib/esm/query/clauses/OffsetClause.js +1 -1
- package/lib/esm/query/clauses/OrderByClause.js +1 -1
- package/lib/esm/query/clauses/SelectClause.js +1 -1
- package/lib/esm/query/clauses/SelectorBasedClause.js +45 -0
- package/lib/esm/query/clauses/ValuesClause.js +37 -0
- package/lib/esm/query/clauses/WhereClause.js +72 -0
- package/lib/esm/query/clauses/index.js +12 -0
- package/lib/esm/query/constants.js +1 -1
- package/lib/esm/query/errors.js +1 -1
- package/lib/esm/query/index.js +1 -1
- package/lib/esm/query/options.js +1 -1
- package/lib/esm/query/selectors.js +1 -1
- package/lib/esm/query/types.js +1 -1
- package/lib/esm/repository/Context.js +1 -1
- package/lib/esm/repository/Repository.js +1 -1
- package/lib/esm/repository/constants.js +1 -1
- package/lib/esm/repository/decorators.js +1 -1
- package/lib/esm/repository/errors.js +1 -1
- package/lib/esm/repository/index.js +1 -1
- package/lib/esm/repository/injectables.js +1 -1
- package/lib/esm/repository/types.js +1 -1
- package/lib/esm/repository/utils.js +1 -1
- package/lib/esm/validators/ClauseSequenceValidator.js +8 -8
- package/lib/esm/validators/decorators.js +1 -1
- package/lib/esm/validators/index.js +1 -1
- package/lib/identity/decorators.cjs +2 -0
- package/lib/identity/index.cjs +2 -0
- package/lib/identity/utils.cjs +2 -0
- package/lib/index.cjs +3 -1
- package/lib/interfaces/Builder.cjs +2 -0
- package/lib/interfaces/Executor.cjs +2 -0
- package/lib/interfaces/Observable.cjs +2 -0
- package/lib/interfaces/Observer.cjs +2 -0
- package/lib/interfaces/Paginatable.cjs +2 -0
- package/lib/interfaces/Queriable.cjs +2 -0
- package/lib/interfaces/RawExecutor.cjs +2 -0
- package/lib/interfaces/SequenceOptions.cjs +2 -0
- package/lib/interfaces/index.cjs +2 -0
- package/lib/model/BaseModel.cjs +2 -0
- package/lib/model/IdentifiedBaseModel.cjs +2 -0
- package/lib/model/User.cjs +2 -0
- package/lib/model/construction.cjs +2 -0
- package/lib/model/decorators.cjs +2 -0
- package/lib/model/index.cjs +2 -0
- package/lib/model/types.cjs +2 -0
- package/lib/persistence/Adapter.cjs +2 -0
- package/lib/persistence/Sequence.cjs +2 -0
- package/lib/persistence/constants.cjs +2 -0
- package/lib/persistence/decorators.cjs +2 -0
- package/lib/persistence/errors.cjs +2 -0
- package/lib/persistence/index.cjs +2 -0
- package/lib/query/Clause.cjs +2 -0
- package/lib/query/ClauseFactory.cjs +2 -0
- package/lib/query/Condition.cjs +2 -0
- package/lib/query/Paginator.cjs +2 -0
- package/lib/query/Query.cjs +2 -0
- package/lib/query/Statement.cjs +2 -0
- package/lib/query/clauses/FromClause.cjs +2 -0
- package/lib/query/clauses/GroupByClause.cjs +2 -0
- package/lib/query/clauses/InsertClause.cjs +2 -0
- package/lib/query/clauses/LimitClause.cjs +2 -0
- package/lib/query/clauses/OffsetClause.cjs +2 -0
- package/lib/query/clauses/OrderByClause.cjs +2 -0
- package/lib/query/clauses/SelectClause.cjs +2 -0
- package/lib/query/clauses/SelectorBasedClause.cjs +2 -0
- package/lib/query/clauses/ValuesClause.cjs +2 -0
- package/lib/query/clauses/WhereClause.cjs +2 -0
- package/lib/query/clauses/index.cjs +2 -0
- package/lib/query/constants.cjs +2 -0
- package/lib/query/errors.cjs +2 -0
- package/lib/query/index.cjs +2 -0
- package/lib/query/options.cjs +2 -0
- package/lib/query/selectors.cjs +2 -0
- package/lib/query/types.cjs +2 -0
- package/lib/repository/Context.cjs +2 -0
- package/lib/repository/Repository.cjs +2 -0
- package/lib/repository/constants.cjs +2 -0
- package/lib/repository/decorators.cjs +2 -0
- package/lib/repository/errors.cjs +2 -0
- package/lib/repository/index.cjs +2 -0
- package/lib/repository/injectables.cjs +2 -0
- package/lib/repository/types.cjs +2 -0
- package/lib/repository/utils.cjs +2 -0
- package/lib/validators/ClauseSequenceValidator.cjs +9 -7
- package/lib/validators/decorators.cjs +2 -0
- package/lib/validators/index.cjs +2 -0
- package/package.json +27 -16
- package/dist/core.bundle.min.js +0 -2
- package/dist/esm/core.bundle.min.esm.js +0 -2
- package/dist/lib/index.d.ts +0 -25
- package/dist/lib/model/construction.d.ts +0 -15
- package/lib/esm/identity/decorators.d.ts +0 -24
- package/lib/esm/identity/index.d.ts +0 -2
- package/lib/esm/identity/utils.d.ts +0 -3
- package/lib/esm/interfaces/Builder.d.ts +0 -16
- package/lib/esm/interfaces/Executor.d.ts +0 -19
- package/lib/esm/interfaces/Observable.d.ts +0 -31
- package/lib/esm/interfaces/Observer.d.ts +0 -16
- package/lib/esm/interfaces/Paginatable.d.ts +0 -4
- package/lib/esm/interfaces/Queriable.d.ts +0 -6
- package/lib/esm/interfaces/RawExecutor.d.ts +0 -20
- package/lib/esm/interfaces/SequenceOptions.d.ts +0 -19
- package/lib/esm/interfaces/index.d.ts +0 -7
- package/lib/esm/model/BaseModel.d.ts +0 -6
- package/lib/esm/model/IdentifiedBaseModel.d.ts +0 -7
- package/lib/esm/model/User.d.ts +0 -8
- package/lib/esm/model/construction.d.ts +0 -15
- package/lib/esm/model/decorators.d.ts +0 -75
- package/lib/esm/model/index.d.ts +0 -4
- package/lib/esm/model/types.d.ts +0 -6
- package/lib/esm/persistence/Adapter.d.ts +0 -86
- package/lib/esm/persistence/Sequence.d.ts +0 -22
- package/lib/esm/persistence/constants.d.ts +0 -22
- package/lib/esm/persistence/decorators.d.ts +0 -1
- package/lib/esm/persistence/errors.d.ts +0 -7
- package/lib/esm/persistence/index.d.ts +0 -5
- package/lib/esm/query/Clause.d.ts +0 -50
- package/lib/esm/query/ClauseFactory.d.ts +0 -71
- package/lib/esm/query/Condition.d.ts +0 -75
- package/lib/esm/query/Paginator.d.ts +0 -22
- package/lib/esm/query/Query.d.ts +0 -43
- package/lib/esm/query/Statement.d.ts +0 -55
- package/lib/esm/query/clauses/FromClause.d.ts +0 -45
- package/lib/esm/query/clauses/GroupByClause.d.ts +0 -21
- package/lib/esm/query/clauses/InsertClause.d.ts +0 -37
- package/lib/esm/query/clauses/LimitClause.d.ts +0 -29
- package/lib/esm/query/clauses/OffsetClause.d.ts +0 -21
- package/lib/esm/query/clauses/OrderByClause.d.ts +0 -37
- package/lib/esm/query/clauses/SelectClause.d.ts +0 -47
- package/lib/esm/query/clauses/SelectorBasedClause.d.ts +0 -25
- package/lib/esm/query/clauses/ValuesClause.d.ts +0 -21
- package/lib/esm/query/clauses/WhereClause.d.ts +0 -46
- package/lib/esm/query/clauses/index.d.ts +0 -10
- package/lib/esm/query/constants.d.ts +0 -79
- package/lib/esm/query/errors.d.ts +0 -7
- package/lib/esm/query/index.d.ts +0 -12
- package/lib/esm/query/options.d.ts +0 -372
- package/lib/esm/query/selectors.d.ts +0 -38
- package/lib/esm/query/types.d.ts +0 -2
- package/lib/esm/repository/Context.d.ts +0 -10
- package/lib/esm/repository/Repository.d.ts +0 -70
- package/lib/esm/repository/constants.d.ts +0 -25
- package/lib/esm/repository/decorators.d.ts +0 -2
- package/lib/esm/repository/errors.d.ts +0 -12
- package/lib/esm/repository/index.d.ts +0 -8
- package/lib/esm/repository/injectables.d.ts +0 -5
- package/lib/esm/repository/types.d.ts +0 -15
- package/lib/esm/repository/utils.d.ts +0 -3
- package/lib/esm/validators/ClauseSequenceValidator.d.ts +0 -28
- package/lib/esm/validators/decorators.d.ts +0 -10
- package/lib/esm/validators/index.d.ts +0 -2
- package/lib/identity/decorators.d.ts +0 -24
- package/lib/identity/index.d.ts +0 -2
- package/lib/identity/utils.d.ts +0 -3
- package/lib/index.d.ts +0 -25
- package/lib/interfaces/Builder.d.ts +0 -16
- package/lib/interfaces/Executor.d.ts +0 -19
- package/lib/interfaces/Observable.d.ts +0 -31
- package/lib/interfaces/Observer.d.ts +0 -16
- package/lib/interfaces/Paginatable.d.ts +0 -4
- package/lib/interfaces/Queriable.d.ts +0 -6
- package/lib/interfaces/RawExecutor.d.ts +0 -20
- package/lib/interfaces/SequenceOptions.d.ts +0 -19
- package/lib/interfaces/index.d.ts +0 -7
- package/lib/model/BaseModel.d.ts +0 -6
- package/lib/model/IdentifiedBaseModel.d.ts +0 -7
- package/lib/model/User.d.ts +0 -8
- package/lib/model/decorators.d.ts +0 -75
- package/lib/model/index.d.ts +0 -4
- package/lib/model/types.d.ts +0 -6
- package/lib/persistence/Adapter.d.ts +0 -86
- package/lib/persistence/Sequence.d.ts +0 -22
- package/lib/persistence/constants.d.ts +0 -22
- package/lib/persistence/decorators.d.ts +0 -1
- package/lib/persistence/errors.d.ts +0 -7
- package/lib/persistence/index.d.ts +0 -5
- package/lib/query/Clause.d.ts +0 -50
- package/lib/query/ClauseFactory.d.ts +0 -71
- package/lib/query/Condition.d.ts +0 -75
- package/lib/query/Paginator.d.ts +0 -22
- package/lib/query/Query.d.ts +0 -43
- package/lib/query/Statement.d.ts +0 -55
- package/lib/query/clauses/FromClause.d.ts +0 -45
- package/lib/query/clauses/GroupByClause.d.ts +0 -21
- package/lib/query/clauses/InsertClause.d.ts +0 -37
- package/lib/query/clauses/LimitClause.d.ts +0 -29
- package/lib/query/clauses/OffsetClause.d.ts +0 -21
- package/lib/query/clauses/OrderByClause.d.ts +0 -37
- package/lib/query/clauses/SelectClause.d.ts +0 -47
- package/lib/query/clauses/SelectorBasedClause.d.ts +0 -25
- package/lib/query/clauses/ValuesClause.d.ts +0 -21
- package/lib/query/clauses/WhereClause.d.ts +0 -46
- package/lib/query/clauses/index.d.ts +0 -10
- package/lib/query/constants.d.ts +0 -79
- package/lib/query/errors.d.ts +0 -7
- package/lib/query/index.d.ts +0 -12
- package/lib/query/options.d.ts +0 -372
- package/lib/query/selectors.d.ts +0 -38
- package/lib/query/types.d.ts +0 -2
- package/lib/repository/Context.d.ts +0 -10
- package/lib/repository/Repository.d.ts +0 -70
- package/lib/repository/constants.d.ts +0 -25
- package/lib/repository/decorators.d.ts +0 -2
- package/lib/repository/errors.d.ts +0 -12
- package/lib/repository/index.d.ts +0 -8
- package/lib/repository/injectables.d.ts +0 -5
- package/lib/repository/types.d.ts +0 -15
- package/lib/repository/utils.d.ts +0 -3
- package/lib/validators/ClauseSequenceValidator.d.ts +0 -28
- package/lib/validators/decorators.d.ts +0 -10
- package/lib/validators/index.d.ts +0 -2
package/LICENSE.md
CHANGED
File without changes
|
package/README.md
CHANGED
@@ -1,271 +1,67 @@
|
|
1
1
|

|
2
|
-
## Typescript Template
|
3
2
|
|
3
|
+
## Core Module
|
4
4
|
|
5
|
+
Introduces the Persistence Adapter concept, a Facade implementation managing all the particularities of each persistence layer.
|
5
6
|
|
6
|
-

|
7
|
-

|
8
|
-

|
9
|
-
[](http://www.pdmfc.com)
|
10
|
-
[](https://github.com/decaf-ts/ts-workspace/actions?query=workflow%3ACodeQL)
|
11
7
|
|
12
|
-
|
13
|
-

|
10
|
+

|
11
|
+

|
12
|
+
|
13
|
+
[](https://github.com/decaf-ts/core/actions/workflows/nodejs-build-prod.yaml)
|
14
|
+
[](https://github.com/decaf-ts/core/actions/workflows/codeql-analysis.yml)[](https://github.com/decaf-ts/core/actions/workflows/snyk-analysis.yaml)
|
15
|
+
[](https://github.com/decaf-ts/core/actions/workflows/pages.yaml)
|
16
|
+
[](https://github.com/decaf-ts/core/actions/workflows/release-on-tag.yaml)
|
17
|
+
|
18
|
+

|
19
|
+

|
20
|
+

|
15
21
|

|
16
22
|
|
17
|
-

|
18
|
-

|
19
|
-

|
20
|
-

|
23
|
+

|
24
|
+

|
25
|
+

|
26
|
+

|
21
27
|
|
22
28
|
|
23
|
-

|
30
|
+

|
31
|
+

|
26
32
|
|
27
33
|

|
28
34
|

|
29
35
|
|
30
|
-
|
36
|
+
Documentation available [here](https://decaf-ts.github.io/core/)
|
31
37
|
|
32
|
-
|
38
|
+
### Description
|
33
39
|
|
34
|
-
Defines a 'way' to write jsDocs to optimize the output
|
35
40
|
|
36
|
-
Optimized for github in terms of badges. CI is equivalent between Gitlab and Github.
|
37
41
|
|
38
|
-
|
42
|
+
### How to Use
|
39
43
|
|
40
|
-
|
44
|
+
- [Initial Setup](../../workdocs/tutorials/For%20Developers.md#_initial-setup_)
|
45
|
+
- [Installation](../../workdocs/tutorials/For%20Developers.md#installation)
|
41
46
|
|
42
|
-
### ***Initial Setup***
|
43
47
|
|
44
|
-
#### if you use github
|
45
48
|
|
46
|
-
create a new project using this one as a template.
|
47
49
|
|
48
|
-
|
49
|
-
|
50
|
-
#### If your project has private dependencies or publishes to private npm registries, create an `.npmrc` containing:
|
50
|
+
### Related
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
//<ADDRESS>.<DOMAIN>.com/:_authToken=${TOKEN}
|
56
|
-
//<ADDRESS>.<DOMAIN>.com/api/v4/groups/<GROUP_ID>/packages/npm/:_authToken=${TOKEN}
|
57
|
-
//<ADDRESS>.<DOMAIN>.com/api/v4/projects/<PROJECT_ID>/packages/npm/:_authToken=${TOKEN}
|
58
|
-
```
|
52
|
+
[](https://github.com/decaf-ts/decaf-ts)
|
53
|
+
[](https://github.com/decaf-ts/decorator-validation)
|
54
|
+
[](https://github.com/decaf-ts/db-decorators)
|
59
55
|
|
60
|
-
Changing:
|
61
|
-
- <ADDRESS> to `gitlab` or `github` (or other);
|
62
|
-
- <DOMAIN> to your domain if any (if you are using plain gitlab or github use empty and take care to remove the extra `.`);
|
63
|
-
- <GROUP_ID> to your project's group id (if any). otherwise remove this line
|
64
|
-
- <PROJECT_ID> to your project's id
|
65
56
|
|
66
|
-
|
57
|
+
### Social
|
67
58
|
|
68
|
-
|
59
|
+
[](https://www.linkedin.com/in/decaf-ts/)
|
69
60
|
|
70
|
-
Run `npm install` (or `npm run do-install` if you have private dependencies and a `.token` file) to install the dependencies:
|
71
61
|
|
72
|
-
If this is the first time you are running this command it will also:
|
73
|
-
- update this repository's dependencies to their latest version;
|
74
|
-
- creates a `.token` file which you can leave empty unless you have private dependencies or publish to private registries
|
75
|
-
- delete this 'first run script' file and npm call from the `package.json`;
|
76
|
-
- try to commit the updated `package.json` and deleted files (having ssh access helps here);
|
77
|
-
## Linting
|
78
|
-
|
79
|
-
This repo comes with eslint + prettier preconfigured to the default standards
|
80
|
-
## Testing
|
81
|
-
|
82
|
-
Preconfigured Jest based testing:
|
83
|
-
|
84
|
-
- unit tests under the `tests/unit` folder;
|
85
|
-
- include a default bundle test (helps with circular dependencies and such);
|
86
|
-
- integration tests under the `tests/integration` folder;
|
87
|
-
- stores converage results under `workdocs/coverage`;
|
88
|
-
- publishes coverage result to docs;
|
89
|
-
- ignores `cli.ts` from coverage since that is an executable file;
|
90
|
-
- defines the coverage threshold in `jest.config.ts`;
|
91
|
-
### Releases
|
92
|
-
|
93
|
-
This repository automates releases in the following manner:
|
94
|
-
|
95
|
-
- run `npm run release -- <major|minor|patch|version> <message>`:
|
96
|
-
- if arguments are missing you will be prompted for them;
|
97
|
-
- it will run `npm run prepare-release` npm script;
|
98
|
-
- it will commit all changes;
|
99
|
-
- it will push the new tag;
|
100
|
-
|
101
|
-
If publishing to a private repo's npm registry, make sure you add to your `package.json`:
|
102
|
-
|
103
|
-
```json
|
104
|
-
{
|
105
|
-
"publishConfig": {
|
106
|
-
"<SCOPE>:registry": " https://<REGISTRY>/api/v4/projects/<PROJECT_ID>/packages/npm/"
|
107
|
-
}
|
108
|
-
}
|
109
|
-
```
|
110
|
-
|
111
|
-
Where:
|
112
|
-
|
113
|
-
- `<SCOPE>` - Is the scope of your package;
|
114
|
-
- `<REGISTRY>` - your registry host;
|
115
|
-
- `<PROJECT_ID>` - you project ID number (easy to grab via UI in gitlab or by
|
116
|
-
running `$("meta[name=octolytics-dimension-repository_id]").getAttribute('content')` in the repository page in github)
|
117
|
-
;
|
118
|
-
|
119
|
-
### Publishing
|
120
|
-
|
121
|
-
Unless the `-no-ci` flag is passed in the commit message to the `npm run release` command, publishing will be handled
|
122
|
-
automatically by github/gitlab (triggered by the tag).
|
123
|
-
|
124
|
-
When the `-no-ci` flag is passed then you can:
|
125
|
-
|
126
|
-
- run `npm run publish`. This command assumes :
|
127
|
-
- you have previously run the `npm run release`;
|
128
|
-
- you have you publishing properly configured in `npmrc` and `package.json`;
|
129
|
-
- The token for any special access required is stored in the `.token` file;
|
130
|
-
|
131
|
-
## Continuous Integration/Deployment
|
132
|
-
|
133
|
-
While the implementationfor gitlab and github are not perfectly matched, they are perfectly usable.
|
134
|
-
|
135
|
-
The template comes with ci/cd for :
|
136
|
-
- gitlab (with caching for performance):
|
137
|
-
- stages:
|
138
|
-
- dependencies: Installs dependencies (on `package-lock.json` changes, caches node modules);
|
139
|
-
- build: builds the code (on `src/*` changes, caches `lib` and `dist`);
|
140
|
-
- test: tests the code (on `src/*`, `test/*` changes, caches `workdocs/{resources, badges, coverage}`);
|
141
|
-
- deploy:
|
142
|
-
- deploys to package registry on a tag (public|private);
|
143
|
-
- deploys docker image to docker registry (private);
|
144
|
-
- Deploys the documentation to the repository pages;
|
145
|
-
- github:
|
146
|
-
- jest-test: standard `install -> build -> test` loop;
|
147
|
-
- jest-coverage: extracts coverage from the tests;
|
148
|
-
- codeql-analysis: Code quality analisys;
|
149
|
-
- pages: builds the documentation and deploys to github pages
|
150
|
-
- release-on-tag: issues a release when the tag does not contain `-no-ci` string
|
151
|
-
- publish-on-release: publishes to package registry when the tag does not contain the `-no-ci` string
|
152
|
-
- Requires Variables:
|
153
|
-
- CONSECUTIVE_ACTION_TRIGGER: secret to enable actions to trigger other actions;
|
154
|
-
- NPM_TOKEN: npm/docker registry token
|
155
|
-
## Considerations
|
156
|
-
- Setup for a linux based environment (Sorry windows users. use WSL... or just change already);
|
157
|
-
- Setup for node 20, but will work at least with 16;
|
158
|
-
- Requires docker to build documentation (drawings and PlantUML)
|
159
|
-
## Documentation
|
160
|
-
|
161
|
-
The repository proposes a way to generate documentation that while still not ideal, produces verys consitest results.
|
162
|
-
|
163
|
-
In the code you see an example on how to properly document each code object, but the overall structure is:
|
164
|
-
- each package is a `@module`;
|
165
|
-
- Classes and Interfaces are categorized into `@category` and `@subcategory`;
|
166
|
-
- All other objects are categorized by `@namespace` and `@memberOf`;
|
167
|
-
- Enums and const are declared as `@const` and both must describe their properties as `@property` (when constants are objects);
|
168
|
-
- Interfaces must declare their methods `@method`;
|
169
|
-
|
170
|
-
There are 3 steps the generating the documentation (automated in CI):
|
171
|
-
- `npm run drawings` - generates png files from each drawing in the `workdocs/drawings` folder and moves them to the `workdocs/resources` folder (requires Docker);
|
172
|
-
- `npm run uml` - generates png files from each PlantUML diagram in the `workdocs/uml` folder and moves them to the `workdocs/resources` folder (requires Docker);
|
173
|
-
- `npm run docs` - this has several stages, defined under the `gulp docs` (gulpfile.js):
|
174
|
-
- compiles the Readme file via md compile:
|
175
|
-
- enables keeping separate files for sections that are then joined into a single file;
|
176
|
-
- Allows keeping specific files in the jsdocs tutorial folder so they show up on their own menu;
|
177
|
-
- compiles the documentation from the source code using jsdocs:
|
178
|
-
- uses the better docs template with the category and component plugins
|
179
|
-
- uses the mermaid jsdoc plugin to embue uml diagrams in the docs
|
180
|
-
- includes a nav link to the test coverage results;
|
181
|
-
- copies the jsdoc and mds to `/docs`;
|
182
|
-
- copies the `./workdocs/{drawings, uml, assets, resources}` to `./docs`;
|
183
|
-
|
184
|
-
The produced `docs` folder contains the resulting documentation;
|
185
|
-
### Related
|
186
62
|
|
187
|
-
[](https://github.com/decaf-ts/ts-workspace)
|
188
|
-
### Social
|
189
63
|
|
190
|
-
|
191
|
-
### Scripts
|
192
|
-
|
193
|
-
The following npm scripts are available for development:
|
194
|
-
|
195
|
-
- `preinstall` - will run only on the first install to trigger the dep update. will self delete;
|
196
|
-
- `do-install` - sets a `TOKEN` environment variable to the contents of `.token` and runs npm install (useful when you
|
197
|
-
have private dependencies);
|
198
|
-
- `flash-forward` - updates all dependencies. Take care, This may not be desirable is some cases;
|
199
|
-
- `reset` - updates all dependencies. Take care, This may not be desirable is some cases;
|
200
|
-
- `build` - builds the code (via gulp `gulpfile.js`) in development mode (generates `lib` and `dist` folder);
|
201
|
-
- `build:prod` - builds the code (via gulp `gulpfile.js`) in production mode (generates `lib` and `dist` folder);
|
202
|
-
- `test` - runs unit tests;
|
203
|
-
- `test:integration` - runs it tests;
|
204
|
-
- `test:all` - runs all tests;
|
205
|
-
- `lint` - runs es lint on the code folder;
|
206
|
-
- `lint-fix` - tries to auto-fix the code folder;
|
207
|
-
- `prepare-release` - defines the commands to run prior to a new tag (defaults to linting, building production code,
|
208
|
-
running tests and documentation generation);
|
209
|
-
- `release` - triggers a new tag being pushed to master (via `./bin/tag_release.sh`);
|
210
|
-
- `clean-publish` - cleans the package.json for publishing;
|
211
|
-
- `coverage` - runs all test, calculates coverage and generates badges for readme;
|
212
|
-
- `drawings` - compiles all DrawIO `*.drawio` files in the `workdocs/drawings` folder to png and moves them to
|
213
|
-
the `workdocs/resources` folder;
|
214
|
-
- `uml` - compiles all PlantUML `*.puml` files in the `workdocs/uml` folder to png and moves them to
|
215
|
-
the `workdocs/resources` folder;
|
216
|
-
- `docs` - compiles all the coverage, drawings, uml, jsdocs and md docs into a readable web page under `./docs`;
|
217
|
-
|
218
|
-
### Repository Structure
|
219
|
-
|
220
|
-
```
|
221
|
-
ts-workspace
|
222
|
-
│
|
223
|
-
│ .gitignore <-- Defines files ignored to git
|
224
|
-
│ .npmignore <-- Defines files ignored by npm
|
225
|
-
│ .nmprc <-- Defines the Npm registry for this package
|
226
|
-
│ .eslintrc.cjs <-- linting for the project
|
227
|
-
│ .prettier.config.cjs <-- Code style for the project
|
228
|
-
│ .gitlab-ci.yml <-- Gillab CI/CD file
|
229
|
-
│ gulpfile.js <-- Gulp build scripts. used for building na other features (eg docs)
|
230
|
-
│ jest.config.ts <-- Tests Configuration file
|
231
|
-
│ mdCompile.json <-- md Documentation generation configuration file
|
232
|
-
│ jsdocs.json <-- jsdoc Documentation generation configuration file
|
233
|
-
│ Dockerfile <-- minimal example of a node service Dockerfile
|
234
|
-
│ LICENCE.md <-- Licence disclamer
|
235
|
-
│ package.json
|
236
|
-
│ package-lock.json
|
237
|
-
│ README.md <-- Readme File dynamically compiled from 'workdocs' via the 'docs' npm script
|
238
|
-
│ tsconfig.json <-- Typescript config file. Is overriden in 'gulpfile.js'
|
239
|
-
│
|
240
|
-
└───bin
|
241
|
-
│ │ tag_release.sh <-- Script to help with releases
|
242
|
-
│
|
243
|
-
└───docs
|
244
|
-
│ │ ... <-- Dinamically generated folder, containing the compiled documentation for this repository. generated via the 'docs' npm script
|
245
|
-
│
|
246
|
-
└───src
|
247
|
-
│ │ ... <-- Source code for this repository
|
248
|
-
│
|
249
|
-
└───tests
|
250
|
-
│ │───unit <-- Unit tests
|
251
|
-
│ └───integration <-- Integration tests
|
252
|
-
│
|
253
|
-
└───workdocs <-- Folder with all pre-compiled documentation
|
254
|
-
│ │───assets <-- Documentation asset folder
|
255
|
-
│ │───badges <-- Auto generated coverage badges folder
|
256
|
-
│ │───coverage <-- Auto generated coverage results
|
257
|
-
│ │───drawings <-- DrawIO folder. Drawings (*.drawio) here will be processed to generate documentation (requires docker)
|
258
|
-
│ │───uml <-- PlantUML folder. Diagrams (*.puml) here will be processed to generate documentation (requires docker)
|
259
|
-
│ │───tutorials <-- Tutorial folder
|
260
|
-
│ │ ... <-- Categorized *.md files that are merged to generate the final readme (via md compile)
|
261
|
-
│ │ Readme.md <-- Entry point to the README.md
|
262
|
-
│
|
263
|
-
└───dist
|
264
|
-
│ │ ... <-- Dinamically generated folder containing the bundles for distribution
|
265
|
-
│
|
266
|
-
└───lib
|
267
|
-
| ... <-- Dinamically generated folder containing the compiled code
|
268
|
-
```
|
64
|
+
#### Languages
|
269
65
|
|
270
66
|

|
271
67
|

|
@@ -284,14 +80,12 @@ I am grateful for any contributions made to this project. Please read [this](./w
|
|
284
80
|
|
285
81
|
The first and easiest way you can support it is by [Contributing](./workdocs/98-Contributing.md). Even just finding a typo in the documentation is important.
|
286
82
|
|
287
|
-
Financial support is always welcome and helps keep
|
83
|
+
Financial support is always welcome and helps keep both me and the project alive and healthy.
|
288
84
|
|
289
85
|
So if you can, if this project in any way. either by learning something or simply by helping you save precious time, please consider donating.
|
290
86
|
|
291
87
|
## License
|
292
88
|
|
293
|
-
This project is released under the [MIT License](LICENSE.md).
|
294
|
-
|
295
|
-
#### Disclaimer:
|
89
|
+
This project is released under the [MIT License](./LICENSE.md).
|
296
90
|
|
297
|
-
|
91
|
+
By developers, for developers...
|