@decaf-ts/decorator-validation 1.0.24 → 1.1.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 +0 -137
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +2 -2
- package/lib/index.cjs +2 -2
- package/lib/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,119 +36,6 @@ Provides access to common features in other languages:
|
|
|
36
36
|
- Model Hashing;
|
|
37
37
|
- Model Equality;
|
|
38
38
|
- TODO: Model Deep Cloning
|
|
39
|
-
### ***Initial Setup***
|
|
40
|
-
|
|
41
|
-
#### if you use github
|
|
42
|
-
|
|
43
|
-
create a new project using this one as a template.
|
|
44
|
-
|
|
45
|
-
clone it `git clone <project>` and navigate to the root folder `cd <project>`
|
|
46
|
-
|
|
47
|
-
#### If your project has private dependencies or publishes to private npm registries, create an `.npmrc` containing:
|
|
48
|
-
|
|
49
|
-
```text
|
|
50
|
-
@<scope1>:registry=https://<ADDRESS>.com/api/v4/packages/npm/
|
|
51
|
-
@<scope2>:registry=https://<ADDRESS>.<DOMAIN>.com/api/v4/packages/npm/
|
|
52
|
-
//<ADDRESS>.<DOMAIN>.com/:_authToken=${TOKEN}
|
|
53
|
-
//<ADDRESS>.<DOMAIN>.com/api/v4/groups/<GROUP_ID>/packages/npm/:_authToken=${TOKEN}
|
|
54
|
-
//<ADDRESS>.<DOMAIN>.com/api/v4/projects/<PROJECT_ID>/packages/npm/:_authToken=${TOKEN}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Changing:
|
|
58
|
-
- <ADDRESS> to `gitlab` or `github` (or other);
|
|
59
|
-
- <DOMAIN> to your domain if any (if you are using plain gitlab or github use empty and take care to remove the extra `.`);
|
|
60
|
-
- <GROUP_ID> to your project's group id (if any). otherwise remove this line
|
|
61
|
-
- <PROJECT_ID> to your project's id
|
|
62
|
-
|
|
63
|
-
and adding a `.token` file containing your access token to the private registries na repositories.
|
|
64
|
-
|
|
65
|
-
### Installation
|
|
66
|
-
|
|
67
|
-
Run `npm install` (or `npm run do-install` if you have private dependencies and a `.token` file) to install the dependencies:
|
|
68
|
-
|
|
69
|
-
If this is the first time you are running this command it will also:
|
|
70
|
-
- update this repository's dependencies to their latest version;
|
|
71
|
-
- creates a `.token` file which you can leave empty unless you have private dependencies or publish to private registries
|
|
72
|
-
- delete this 'first run script' file and npm call from the `package.json`;
|
|
73
|
-
- try to commit the updated `package.json` and deleted files (having ssh access helps here);
|
|
74
|
-
## Linting
|
|
75
|
-
|
|
76
|
-
This repo comes with eslint + prettier preconfigured to the default standards
|
|
77
|
-
## Testing
|
|
78
|
-
|
|
79
|
-
Preconfigured Jest based testing:
|
|
80
|
-
|
|
81
|
-
- unit tests under the `tests/unit` folder;
|
|
82
|
-
- include a default bundle test (helps with circular dependencies and such);
|
|
83
|
-
- integration tests under the `tests/integration` folder;
|
|
84
|
-
- stores converage results under `workdocs/coverage`;
|
|
85
|
-
- publishes coverage result to docs;
|
|
86
|
-
- ignores `cli.ts` from coverage since that is an executable file;
|
|
87
|
-
- defines the coverage threshold in `jest.config.ts`;
|
|
88
|
-
### Releases
|
|
89
|
-
|
|
90
|
-
This repository automates releases in the following manner:
|
|
91
|
-
|
|
92
|
-
- run `npm run release -- <major|minor|patch|version> <message>`:
|
|
93
|
-
- if arguments are missing you will be prompted for them;
|
|
94
|
-
- it will run `npm run prepare-release` npm script;
|
|
95
|
-
- it will commit all changes;
|
|
96
|
-
- it will push the new tag;
|
|
97
|
-
|
|
98
|
-
If publishing to a private repo's npm registry, make sure you add to your `package.json`:
|
|
99
|
-
|
|
100
|
-
```json
|
|
101
|
-
{
|
|
102
|
-
"publishConfig": {
|
|
103
|
-
"<SCOPE>:registry": " https://<REGISTRY>/api/v4/projects/<PROJECT_ID>/packages/npm/"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Where:
|
|
109
|
-
|
|
110
|
-
- `<SCOPE>` - Is the scope of your package;
|
|
111
|
-
- `<REGISTRY>` - your registry host;
|
|
112
|
-
- `<PROJECT_ID>` - you project ID number (easy to grab via UI in gitlab or by
|
|
113
|
-
running `$("meta[name=octolytics-dimension-repository_id]").getAttribute('content')` in the repository page in github)
|
|
114
|
-
;
|
|
115
|
-
|
|
116
|
-
### Publishing
|
|
117
|
-
|
|
118
|
-
Unless the `-no-ci` flag is passed in the commit message to the `npm run release` command, publishing will be handled
|
|
119
|
-
automatically by github/gitlab (triggered by the tag).
|
|
120
|
-
|
|
121
|
-
When the `-no-ci` flag is passed then you can:
|
|
122
|
-
|
|
123
|
-
- run `npm run publish`. This command assumes :
|
|
124
|
-
- you have previously run the `npm run release`;
|
|
125
|
-
- you have you publishing properly configured in `npmrc` and `package.json`;
|
|
126
|
-
- The token for any special access required is stored in the `.token` file;
|
|
127
|
-
|
|
128
|
-
## Continuous Integration/Deployment
|
|
129
|
-
|
|
130
|
-
While the implementationfor gitlab and github are not perfectly matched, they are perfectly usable.
|
|
131
|
-
|
|
132
|
-
The template comes with ci/cd for :
|
|
133
|
-
- gitlab (with caching for performance):
|
|
134
|
-
- stages:
|
|
135
|
-
- dependencies: Installs dependencies (on `package-lock.json` changes, caches node modules);
|
|
136
|
-
- build: builds the code (on `src/*` changes, caches `lib` and `dist`);
|
|
137
|
-
- test: tests the code (on `src/*`, `test/*` changes, caches `workdocs/{resources, badges, coverage}`);
|
|
138
|
-
- deploy:
|
|
139
|
-
- deploys to package registry on a tag (public|private);
|
|
140
|
-
- deploys docker image to docker registry (private);
|
|
141
|
-
- Deploys the documentation to the repository pages;
|
|
142
|
-
- github:
|
|
143
|
-
- jest-test: standard `install -> build -> test` loop;
|
|
144
|
-
- jest-coverage: extracts coverage from the tests;
|
|
145
|
-
- codeql-analysis: Code quality analisys;
|
|
146
|
-
- pages: builds the documentation and deploys to github pages
|
|
147
|
-
- release-on-tag: issues a release when the tag does not contain `-no-ci` string
|
|
148
|
-
- publish-on-release: publishes to package registry when the tag does not contain the `-no-ci` string
|
|
149
|
-
- Requires Variables:
|
|
150
|
-
- CONSECUTIVE_ACTION_TRIGGER: secret to enable actions to trigger other actions;
|
|
151
|
-
- NPM_TOKEN: npm/docker registry token
|
|
152
39
|
## Considerations
|
|
153
40
|
|
|
154
41
|
#### Typescript Compilation options
|
|
@@ -163,30 +50,6 @@ when importing these libraries the following flag in `tsconfig.compilerOptions`
|
|
|
163
50
|
"useDefineForClassFields": false
|
|
164
51
|
}
|
|
165
52
|
```
|
|
166
|
-
## Documentation
|
|
167
|
-
|
|
168
|
-
The repository proposes a way to generate documentation that while still not ideal, produces verys consitest results.
|
|
169
|
-
|
|
170
|
-
In the code you see an example on how to properly document each code object, but the overall structure is:
|
|
171
|
-
- each package is a `@module`;
|
|
172
|
-
- Classes and Interfaces are categorized into `@category` and `@subcategory`;
|
|
173
|
-
- All other objects are categorized by `@namespace` and `@memberOf`;
|
|
174
|
-
- Enums and const are declared as `@const` and both must describe their properties as `@property` (when constants are objects);
|
|
175
|
-
- Interfaces must declare their methods `@method`;
|
|
176
|
-
|
|
177
|
-
There is one smple step to generating the documentation (automated in CI):
|
|
178
|
-
- `npm run docs` - this has several stages, defined under the `gulp docs` (gulpfile.js):
|
|
179
|
-
- compiles the Readme file via md compile:
|
|
180
|
-
- enables keeping separate files for sections that are then joined into a single file;
|
|
181
|
-
- Allows keeping specific files in the jsdocs tutorial folder so they show up on their own menu;
|
|
182
|
-
- compiles the documentation from the source code using jsdocs:
|
|
183
|
-
- uses the better docs template with the category and component plugins
|
|
184
|
-
- uses the mermaid jsdoc plugin to embue uml diagrams in the docs
|
|
185
|
-
- includes a nav link to the test coverage results;
|
|
186
|
-
- copies the jsdoc and mds to `/docs`;
|
|
187
|
-
- copies the `./workdocs/{drawings, uml, assets, resources}` to `./docs`;
|
|
188
|
-
|
|
189
|
-
The produced `docs` folder contains the resulting documentation;
|
|
190
53
|
### Related
|
|
191
54
|
|
|
192
55
|
[](https://github.com/decaf-ts/decorator-validation)
|
package/lib/esm/index.d.ts
CHANGED
package/lib/esm/index.js
CHANGED
|
@@ -63,6 +63,6 @@ export * from "./utils";
|
|
|
63
63
|
export * from "./reflection";
|
|
64
64
|
export * from "./validation";
|
|
65
65
|
export * from "./model";
|
|
66
|
-
export const VERSION = "1.0
|
|
66
|
+
export const VERSION = "1.1.0";
|
|
67
67
|
|
|
68
|
-
//# sourceMappingURL=data:application/json;charset=utf8;base64,
|
|
68
|
+
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVIOzs7O0dBSUc7QUFFSDs7OztHQUlHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUgsY0FBYyxTQUFTLENBQUM7QUFDeEIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxTQUFTLENBQUM7QUFFeEIsTUFBTSxDQUFDLE1BQU0sT0FBTyxHQUFHLE9BQU8sQ0FBQyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQG1vZHVsZSBkZWNvcmF0b3ItdmFsaWRhdGlvblxuICovXG5cbi8qKlxuICogQHN1bW1hcnkgRGVmaW5lcyB0aGUgTW9kZWwgb2JqZWN0XG4gKiBAbmFtZXNwYWNlIE1vZGVsXG4gKiBAbWVtYmVyT2YgbW9kdWxlOmRlY29yYXRvci12YWxpZGF0aW9uXG4gKi9cblxuLyoqXG4gKiBAc3VtbWFyeSBIb2xkcyBh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FtZXNwYWNlIEVxdWFsaXR5XG4gKiBAbWVtYmVyT2YgbW9kdWxlOmRlY29yYXRvci12YWxpZGF0aW9uLlV0aWxzXG4gKi9cblxuLyoqXG4gKiBAbmFtZXNwYWNlIEhhc2hpbmdcbiAqIEBtZW1iZXJPZiBtb2R1bGU6ZGVjb3JhdG9yLXZhbGlkYXRpb24uVXRpbHNcbiAqL1xuXG4vKipcbiAqIEBuYW1lc3BhY2UgU2VyaWFsaXphdGlvblxuICogQG1lbWJlck9mIG1vZHVsZTpkZWNvcmF0b3ItdmFsaWRhdGlvbi5VdGlsc1xuICovXG5cbi8qKlxuICogQG5hbWVzcGFjZSBGb3JtYXRcbiAqIEBtZW1iZXJPZiBtb2R1bGU6ZGVjb3JhdG9yLXZhbGlkYXRpb24uVXRpbHNcbiAqL1xuXG5leHBvcnQgKiBmcm9tIFwiLi91dGlsc1wiO1xuZXhwb3J0ICogZnJvbSBcIi4vcmVmbGVjdGlvblwiO1xuZXhwb3J0ICogZnJvbSBcIi4vdmFsaWRhdGlvblwiO1xuZXhwb3J0ICogZnJvbSBcIi4vbW9kZWxcIjtcblxuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBcIjEuMS4wXCI7XG4iXX0=
|
package/lib/index.cjs
CHANGED
|
@@ -80,6 +80,6 @@ __exportStar(require("./utils/index.cjs"), exports);
|
|
|
80
80
|
__exportStar(require("./reflection/index.cjs"), exports);
|
|
81
81
|
__exportStar(require("./validation/index.cjs"), exports);
|
|
82
82
|
__exportStar(require("./model/index.cjs"), exports);
|
|
83
|
-
exports.VERSION = "1.0
|
|
83
|
+
exports.VERSION = "1.1.0";
|
|
84
84
|
|
|
85
|
-
//# sourceMappingURL=data:application/json;charset=utf8;base64,
|
|
85
|
+
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7O0dBRUc7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