@decaf-ts/decorator-validation
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -66,2 +66,2 @@ /** | ||
export * from "./model"; | ||
export declare const VERSION = "1.0.24"; | ||
export declare const VERSION = "1.1.0"; |
@@ -66,4 +66,4 @@ /** | ||
export * from "./model"; | ||
export const VERSION = "1.0.24"; | ||
export const VERSION = "1.1.0"; | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVIOzs7O0dBSUc7QUFFSDs7OztHQUlHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUgsY0FBYyxTQUFTLENBQUM7QUFDeEIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxTQUFTLENBQUM7QUFFeEIsTUFBTSxDQUFDLE1BQU0sT0FBTyxHQUFHLFFBQVEsQ0FBQyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQG1vZHVsZSBkZWNvcmF0b3ItdmFsaWRhdGlvblxuICovXG5cbi8qKlxuICogQHN1bW1hcnkgRGVmaW5lcyB0aGUgTW9kZWwgb2JqZWN0XG4gKiBAbmFtZXNwYWNlIE1vZGVsXG4gKiBAbWVtYmVyT2YgbW9kdWxlOmRlY29yYXRvci12YWxpZGF0aW9uXG4gKi9cblxuLyoqXG4gKiBAc3VtbWFyeSBIb2xkcyBhbGwgdGhlIHN1cHBvcnRlZCBkZWNvcmF0b3JzXG4gKiBAbmFtZXNwYWNlIERlY29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biAqIEBuYW1lc3BhY2UgVmFsaWRhdG9yc1xuICogQG1lbWJlck9mIG1vZHVsZTpkZWNvcmF0b3ItdmFsaWRhdGlvbi5WYWxpZGF0aW9uXG4gKi9cblxuLyoqXG4gKiBAbmFtZXNwYWNlIFV0aWxzXG4gKiBAbWVtYmVyT2YgbW9kdWxlOmRlY29yYXRvci12YWxpZGF0aW9uXG4gKi9cblxuLyoqXG4gKiBAbmFtZXNwYWNlIERhdGVzXG4gKiBAbWVtYmVyT2YgbW9kdWxlOmRlY29yYXRvci12YWxpZGF0aW9uLlV0aWxzXG4gKi9cblxuLyoqXG4gKiBAbmFtZXNwYWNlIEVxdWFsaXR5XG4gKiBAbWVtYmVyT2YgbW9kdWxlOmRlY29yYXRvci12YWxpZGF0aW9uLlV0aWxzXG4gKi9cblxuLyoqXG4gKiBAbmFtZXNwYWNlIEhhc2hpbmdcbiAqIEBtZW1iZXJPZiBtb2R1bGU6ZGVjb3JhdG9yLXZhbGlkYXRpb24uVXRpbHNcbiAqL1xuXG4vKipcbiAqIEBuYW1lc3BhY2UgU2VyaWFsaXphdGlvblxuICogQG1lbWJlck9mIG1vZHVsZTpkZWNvcmF0b3ItdmFsaWRhdGlvbi5VdGlsc1xuICovXG5cbi8qKlxuICogQG5hbWVzcGFjZSBGb3JtYXRcbiAqIEBtZW1iZXJPZiBtb2R1bGU6ZGVjb3JhdG9yLXZhbGlkYXRpb24uVXRpbHNcbiAqL1xuXG5leHBvcnQgKiBmcm9tIFwiLi91dGlsc1wiO1xuZXhwb3J0ICogZnJvbSBcIi4vcmVmbGVjdGlvblwiO1xuZXhwb3J0ICogZnJvbSBcIi4vdmFsaWRhdGlvblwiO1xuZXhwb3J0ICogZnJvbSBcIi4vbW9kZWxcIjtcblxuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBcIjEuMS4wXCI7XG4iXX0= |
@@ -66,2 +66,2 @@ /** | ||
export * from "./model"; | ||
export declare const VERSION = "1.0.24"; | ||
export declare const VERSION = "1.1.0"; |
{ | ||
"name": "@decaf-ts/decorator-validation", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "simple decorator based validation engine", | ||
@@ -5,0 +5,0 @@ "type": "module", |
137
README.md
@@ -39,115 +39,2 @@ ![Banner](./workdocs/assets/Banner.png) | ||
- TODO: Model Deep Cloning | ||
### ***Initial Setup*** | ||
#### if you use github | ||
create a new project using this one as a template. | ||
clone it `git clone <project>` and navigate to the root folder `cd <project>` | ||
#### If your project has private dependencies or publishes to private npm registries, create an `.npmrc` containing: | ||
```text | ||
@<scope1>:registry=https://<ADDRESS>.com/api/v4/packages/npm/ | ||
@<scope2>:registry=https://<ADDRESS>.<DOMAIN>.com/api/v4/packages/npm/ | ||
//<ADDRESS>.<DOMAIN>.com/:_authToken=${TOKEN} | ||
//<ADDRESS>.<DOMAIN>.com/api/v4/groups/<GROUP_ID>/packages/npm/:_authToken=${TOKEN} | ||
//<ADDRESS>.<DOMAIN>.com/api/v4/projects/<PROJECT_ID>/packages/npm/:_authToken=${TOKEN} | ||
``` | ||
Changing: | ||
- <ADDRESS> to `gitlab` or `github` (or other); | ||
- <DOMAIN> to your domain if any (if you are using plain gitlab or github use empty and take care to remove the extra `.`); | ||
- <GROUP_ID> to your project's group id (if any). otherwise remove this line | ||
- <PROJECT_ID> to your project's id | ||
and adding a `.token` file containing your access token to the private registries na repositories. | ||
### Installation | ||
Run `npm install` (or `npm run do-install` if you have private dependencies and a `.token` file) to install the dependencies: | ||
If this is the first time you are running this command it will also: | ||
- update this repository's dependencies to their latest version; | ||
- creates a `.token` file which you can leave empty unless you have private dependencies or publish to private registries | ||
- delete this 'first run script' file and npm call from the `package.json`; | ||
- try to commit the updated `package.json` and deleted files (having ssh access helps here); | ||
## Linting | ||
This repo comes with eslint + prettier preconfigured to the default standards | ||
## Testing | ||
Preconfigured Jest based testing: | ||
- unit tests under the `tests/unit` folder; | ||
- include a default bundle test (helps with circular dependencies and such); | ||
- integration tests under the `tests/integration` folder; | ||
- stores converage results under `workdocs/coverage`; | ||
- publishes coverage result to docs; | ||
- ignores `cli.ts` from coverage since that is an executable file; | ||
- defines the coverage threshold in `jest.config.ts`; | ||
### Releases | ||
This repository automates releases in the following manner: | ||
- run `npm run release -- <major|minor|patch|version> <message>`: | ||
- if arguments are missing you will be prompted for them; | ||
- it will run `npm run prepare-release` npm script; | ||
- it will commit all changes; | ||
- it will push the new tag; | ||
If publishing to a private repo's npm registry, make sure you add to your `package.json`: | ||
```json | ||
{ | ||
"publishConfig": { | ||
"<SCOPE>:registry": " https://<REGISTRY>/api/v4/projects/<PROJECT_ID>/packages/npm/" | ||
} | ||
} | ||
``` | ||
Where: | ||
- `<SCOPE>` - Is the scope of your package; | ||
- `<REGISTRY>` - your registry host; | ||
- `<PROJECT_ID>` - you project ID number (easy to grab via UI in gitlab or by | ||
running `$("meta[name=octolytics-dimension-repository_id]").getAttribute('content')` in the repository page in github) | ||
; | ||
### Publishing | ||
Unless the `-no-ci` flag is passed in the commit message to the `npm run release` command, publishing will be handled | ||
automatically by github/gitlab (triggered by the tag). | ||
When the `-no-ci` flag is passed then you can: | ||
- run `npm run publish`. This command assumes : | ||
- you have previously run the `npm run release`; | ||
- you have you publishing properly configured in `npmrc` and `package.json`; | ||
- The token for any special access required is stored in the `.token` file; | ||
## Continuous Integration/Deployment | ||
While the implementationfor gitlab and github are not perfectly matched, they are perfectly usable. | ||
The template comes with ci/cd for : | ||
- gitlab (with caching for performance): | ||
- stages: | ||
- dependencies: Installs dependencies (on `package-lock.json` changes, caches node modules); | ||
- build: builds the code (on `src/*` changes, caches `lib` and `dist`); | ||
- test: tests the code (on `src/*`, `test/*` changes, caches `workdocs/{resources, badges, coverage}`); | ||
- deploy: | ||
- deploys to package registry on a tag (public|private); | ||
- deploys docker image to docker registry (private); | ||
- Deploys the documentation to the repository pages; | ||
- github: | ||
- jest-test: standard `install -> build -> test` loop; | ||
- jest-coverage: extracts coverage from the tests; | ||
- codeql-analysis: Code quality analisys; | ||
- pages: builds the documentation and deploys to github pages | ||
- release-on-tag: issues a release when the tag does not contain `-no-ci` string | ||
- publish-on-release: publishes to package registry when the tag does not contain the `-no-ci` string | ||
- Requires Variables: | ||
- CONSECUTIVE_ACTION_TRIGGER: secret to enable actions to trigger other actions; | ||
- NPM_TOKEN: npm/docker registry token | ||
## Considerations | ||
@@ -167,26 +54,2 @@ | ||
``` | ||
## Documentation | ||
The repository proposes a way to generate documentation that while still not ideal, produces verys consitest results. | ||
In the code you see an example on how to properly document each code object, but the overall structure is: | ||
- each package is a `@module`; | ||
- Classes and Interfaces are categorized into `@category` and `@subcategory`; | ||
- All other objects are categorized by `@namespace` and `@memberOf`; | ||
- Enums and const are declared as `@const` and both must describe their properties as `@property` (when constants are objects); | ||
- Interfaces must declare their methods `@method`; | ||
There is one smple step to generating the documentation (automated in CI): | ||
- `npm run docs` - this has several stages, defined under the `gulp docs` (gulpfile.js): | ||
- compiles the Readme file via md compile: | ||
- enables keeping separate files for sections that are then joined into a single file; | ||
- Allows keeping specific files in the jsdocs tutorial folder so they show up on their own menu; | ||
- compiles the documentation from the source code using jsdocs: | ||
- uses the better docs template with the category and component plugins | ||
- uses the mermaid jsdoc plugin to embue uml diagrams in the docs | ||
- includes a nav link to the test coverage results; | ||
- copies the jsdoc and mds to `/docs`; | ||
- copies the `./workdocs/{drawings, uml, assets, resources}` to `./docs`; | ||
The produced `docs` folder contains the resulting documentation; | ||
### Related | ||
@@ -193,0 +56,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
938064
166