cat-documents-ng 0.0.5 → 0.0.7
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/.github/PULL_REQUEST_TEMPLATE.md +32 -0
- package/.github/workflows/pr-validation.yml +87 -0
- package/.husky/pre-commit +4 -0
- package/README.md +59 -63
- package/angular.json +119 -0
- package/eslint.config.cjs +148 -0
- package/package.json +66 -19
- package/projects/cat-document-lib/README.md +63 -0
- package/{jest.config.mjs → projects/cat-document-lib/jest.config.mjs} +18 -18
- package/{ng-package.json → projects/cat-document-lib/ng-package.json} +10 -10
- package/projects/cat-document-lib/package-lock.json +599 -0
- package/projects/cat-document-lib/package.json +19 -0
- package/{setup-jest.ts → projects/cat-document-lib/setup-jest.ts} +9 -9
- package/{src/shared → projects/cat-document-lib/src/Shared}/constant/SHARED.ts +231 -231
- package/{src/shared → projects/cat-document-lib/src/Shared}/constant/URLS.ts +31 -31
- package/{src/shared → projects/cat-document-lib/src/Shared}/services/app-config.service.spec.ts +16 -16
- package/{src/shared → projects/cat-document-lib/src/Shared}/services/app-config.service.ts +73 -73
- package/{src/shared → projects/cat-document-lib/src/Shared}/services/global-error.handler.ts +29 -29
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.html +5 -5
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.ts +82 -82
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.html +34 -34
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.scss +11 -11
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.ts +73 -73
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.html +32 -32
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.scss +21 -21
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.spec.ts +23 -23
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.ts +40 -40
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.html +55 -55
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.scss +26 -26
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.spec.ts +24 -24
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.ts +184 -184
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.html +244 -244
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.scss +35 -35
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.spec.ts +21 -21
- package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.ts +125 -125
- package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.html +46 -46
- package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.ts +51 -51
- package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.html +1 -1
- package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.ts +29 -29
- package/{src → projects/cat-document-lib/src}/lib/document/document.module.ts +191 -191
- package/{src → projects/cat-document-lib/src}/lib/document/models/document.model.ts +39 -39
- package/{src → projects/cat-document-lib/src}/lib/document/models/folder.model.ts +35 -35
- package/{src → projects/cat-document-lib/src}/lib/document/services/file-format.service.spec.ts +16 -16
- package/{src → projects/cat-document-lib/src}/lib/document/services/file-format.service.ts +41 -41
- package/{src → projects/cat-document-lib/src}/lib/document/state/document.query.ts +23 -23
- package/{src → projects/cat-document-lib/src}/lib/document/state/document.service.ts +95 -95
- package/{src → projects/cat-document-lib/src}/lib/document/state/document.state.ts +39 -39
- package/{src → projects/cat-document-lib/src}/lib/document/state/document.store.ts +23 -23
- package/{src → projects/cat-document-lib/src}/public-api.ts +8 -8
- package/{tsconfig.lib.json → projects/cat-document-lib/tsconfig.lib.json} +15 -15
- package/{tsconfig.lib.prod.json → projects/cat-document-lib/tsconfig.lib.prod.json} +11 -11
- package/{tsconfig.spec.json → projects/cat-document-lib/tsconfig.spec.json} +15 -15
- package/public/favicon.ico +0 -0
- package/src/app/app.component.html +1 -0
- package/src/app/app.component.scss +0 -0
- package/src/app/app.component.spec.ts +29 -0
- package/src/app/app.component.ts +15 -0
- package/src/app/app.module.ts +60 -0
- package/src/app/app.routing.module.ts +19 -0
- package/src/index.html +13 -0
- package/src/main.ts +5 -0
- package/src/styles.scss +39 -0
- package/tsconfig.app.json +15 -0
- package/tsconfig.json +32 -0
- package/src/assets/config/app.config.json +0 -4
- /package/{src → projects/cat-document-lib/src}/assets/images/FolderImg.png +0 -0
- /package/{src → projects/cat-document-lib/src}/assets/images/Frame.png +0 -0
- /package/{src → projects/cat-document-lib/src}/assets/images/document.png +0 -0
- /package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.scss +0 -0
- /package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.spec.ts +0 -0
- /package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.spec.ts +0 -0
- /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.scss +0 -0
- /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
- /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.scss +0 -0
- /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
## Hello Developer,
|
|
2
|
+
Thank you for raising the Pull Request!
|
|
3
|
+
We greatly appreciate your efforts and contributions to the team. To ensure the quality and standards our team is committed to, we kindly request you to complete the checklist below before submitting the PR.
|
|
4
|
+
|
|
5
|
+
## Pull Request Checklist
|
|
6
|
+
|
|
7
|
+
### Code Quality
|
|
8
|
+
- [Y/N] Code adheres to coding standards and style guides.
|
|
9
|
+
- [Y/N] Code is properly commented and documented.
|
|
10
|
+
- [Y/N] No Hard-coded values are added.
|
|
11
|
+
- [Y/N] PR doesn't include more than 10 files.
|
|
12
|
+
|
|
13
|
+
### Clean Coding
|
|
14
|
+
- [Y/N] Classes and methods adheres to Single Responsibility Principle
|
|
15
|
+
- [Y/N] Classes are not exceeding 200 lines of code
|
|
16
|
+
- [Y/N] Methods are not exceeding 20 lines of code
|
|
17
|
+
|
|
18
|
+
### Testing
|
|
19
|
+
- [Y/N] Unit tests are written and executed.
|
|
20
|
+
- [Y/N] All tests pass successfully.
|
|
21
|
+
- [Y/N] Manual testing is completed and verified.
|
|
22
|
+
|
|
23
|
+
### Functionality
|
|
24
|
+
- [Y/N] Feature behaves as expected.
|
|
25
|
+
- [Y/N] Edge cases are handled.
|
|
26
|
+
|
|
27
|
+
### Documentation
|
|
28
|
+
- [Y/N] Relevant documentation is updated (e.g., README, user guides, API docs).
|
|
29
|
+
|
|
30
|
+
### Dependencies
|
|
31
|
+
- [Y/N] No unused dependencies or imports.
|
|
32
|
+
- [Y/N] Dependencies are updated and compatible.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: PR Validation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- qa
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
lint:
|
|
10
|
+
name: Run Linting
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
node-version: [22]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v3
|
|
20
|
+
|
|
21
|
+
- name: Setup Node.js
|
|
22
|
+
uses: actions/setup-node@v3
|
|
23
|
+
with:
|
|
24
|
+
node-version: ${{ matrix.node-version }}
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: npm install
|
|
28
|
+
|
|
29
|
+
- name: Run linting
|
|
30
|
+
run: npm run lint
|
|
31
|
+
|
|
32
|
+
check-commit:
|
|
33
|
+
name: Check Commit
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
|
|
36
|
+
steps:
|
|
37
|
+
# Checkout the repository
|
|
38
|
+
- name: Checkout code
|
|
39
|
+
uses: actions/checkout@v3
|
|
40
|
+
with:
|
|
41
|
+
fetch-depth: 0
|
|
42
|
+
|
|
43
|
+
- name: Check Commit messages
|
|
44
|
+
id: check-commit-messages
|
|
45
|
+
run: |
|
|
46
|
+
# Validate commit messages
|
|
47
|
+
git log --no-merges --pretty=%B ${{ github.event.pull_request.base.sha || 'HEAD~20' }}..HEAD | while read -r commit_msg || [[ -n "$commit_msg" ]]; do
|
|
48
|
+
|
|
49
|
+
# Skip empty commit messages
|
|
50
|
+
if [[ -z "$commit_msg" ]]; then
|
|
51
|
+
continue
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
echo "🔍 Checking commit message: '$commit_msg'"
|
|
55
|
+
|
|
56
|
+
if echo "$commit_msg" | grep -Eq '^(docs|test|feature|fix|refactor):|^\((docs|test|feature|fix|refactor)\):'; then
|
|
57
|
+
echo "✅ Valid commit message: '$commit_msg'"
|
|
58
|
+
else
|
|
59
|
+
echo "❌ Invalid commit message: '$commit_msg'"
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
done
|
|
63
|
+
|
|
64
|
+
echo "✅ All commit messages passed validation."
|
|
65
|
+
|
|
66
|
+
# tests:
|
|
67
|
+
# name: Run Tests
|
|
68
|
+
# runs-on: ubuntu-latest
|
|
69
|
+
|
|
70
|
+
# strategy:
|
|
71
|
+
# matrix:
|
|
72
|
+
# node-version: [22]
|
|
73
|
+
|
|
74
|
+
# steps:
|
|
75
|
+
# - name: Checkout code
|
|
76
|
+
# uses: actions/checkout@v3
|
|
77
|
+
|
|
78
|
+
# - name: Setup Node.js
|
|
79
|
+
# uses: actions/setup-node@v3
|
|
80
|
+
# with:
|
|
81
|
+
# node-version: ${{ matrix.node-version }}
|
|
82
|
+
|
|
83
|
+
# - name: Install dependencies
|
|
84
|
+
# run: npm install
|
|
85
|
+
|
|
86
|
+
# - name: Run tests
|
|
87
|
+
# run: npm test
|
package/README.md
CHANGED
|
@@ -1,63 +1,59 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
ng
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## Additional Resources
|
|
62
|
-
|
|
63
|
-
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
1
|
+
# CatDocumentsNg
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.5.
|
|
4
|
+
|
|
5
|
+
## Development server
|
|
6
|
+
|
|
7
|
+
To start a local development server, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng serve
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
|
14
|
+
|
|
15
|
+
## Code scaffolding
|
|
16
|
+
|
|
17
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
ng generate component component-name
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
ng generate --help
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Building
|
|
30
|
+
|
|
31
|
+
To build the project run:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
ng build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
|
38
|
+
|
|
39
|
+
## Running unit tests
|
|
40
|
+
|
|
41
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
ng test
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Running end-to-end tests
|
|
48
|
+
|
|
49
|
+
For end-to-end (e2e) testing, run:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
ng e2e
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
56
|
+
|
|
57
|
+
## Additional Resources
|
|
58
|
+
|
|
59
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
package/angular.json
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"projects": {
|
|
6
|
+
"cat-documents-ng": {
|
|
7
|
+
"projectType": "application",
|
|
8
|
+
"schematics": {
|
|
9
|
+
"@schematics/angular:component": {
|
|
10
|
+
"style": "scss"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"root": "",
|
|
14
|
+
"sourceRoot": "src",
|
|
15
|
+
"prefix": "app",
|
|
16
|
+
"architect": {
|
|
17
|
+
"build": {
|
|
18
|
+
"builder": "@angular-devkit/build-angular:application",
|
|
19
|
+
"options": {
|
|
20
|
+
"outputPath": "dist/cat-documents-ng",
|
|
21
|
+
"index": "src/index.html",
|
|
22
|
+
"browser": "src/main.ts",
|
|
23
|
+
"polyfills": ["zone.js"],
|
|
24
|
+
"tsConfig": "tsconfig.app.json",
|
|
25
|
+
"inlineStyleLanguage": "scss",
|
|
26
|
+
"assets": [
|
|
27
|
+
"src/favicon.ico",
|
|
28
|
+
"src/assets",
|
|
29
|
+
{
|
|
30
|
+
"glob": "**/*",
|
|
31
|
+
"input": "dist/cat-document-lib/src/assets",
|
|
32
|
+
"output": "assets"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"styles": [
|
|
36
|
+
"./node_modules/primeng/resources/themes/saga-blue/theme.css",
|
|
37
|
+
"./node_modules/primeng/resources/primeng.min.css",
|
|
38
|
+
"./node_modules/primeicons/primeicons.css",
|
|
39
|
+
"./node_modules/primeflex/primeflex.css",
|
|
40
|
+
"src/styles.scss"
|
|
41
|
+
],
|
|
42
|
+
"scripts": []
|
|
43
|
+
},
|
|
44
|
+
"configurations": {
|
|
45
|
+
"production": {
|
|
46
|
+
"budgets": [
|
|
47
|
+
{
|
|
48
|
+
"type": "initial",
|
|
49
|
+
"maximumWarning": "3mb",
|
|
50
|
+
"maximumError": "3MB"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "anyComponentStyle",
|
|
54
|
+
"maximumWarning": "4kB",
|
|
55
|
+
"maximumError": "8kB"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"outputHashing": "all"
|
|
59
|
+
},
|
|
60
|
+
"development": {
|
|
61
|
+
"optimization": false,
|
|
62
|
+
"extractLicenses": false,
|
|
63
|
+
"sourceMap": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"defaultConfiguration": "production"
|
|
67
|
+
},
|
|
68
|
+
"serve": {
|
|
69
|
+
"builder": "@angular-devkit/build-angular:dev-server",
|
|
70
|
+
"configurations": {
|
|
71
|
+
"production": {
|
|
72
|
+
"buildTarget": "cat-documents-ng:build:production"
|
|
73
|
+
},
|
|
74
|
+
"development": {
|
|
75
|
+
"buildTarget": "cat-documents-ng:build:development"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"defaultConfiguration": "development"
|
|
79
|
+
},
|
|
80
|
+
"extract-i18n": {
|
|
81
|
+
"builder": "@angular-devkit/build-angular:extract-i18n"
|
|
82
|
+
},
|
|
83
|
+
"lint": {
|
|
84
|
+
"builder": "@angular-eslint/builder:lint",
|
|
85
|
+
"options": {
|
|
86
|
+
"eslintConfig": "eslint.config.js",
|
|
87
|
+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"cat-document-lib": {
|
|
93
|
+
"projectType": "library",
|
|
94
|
+
"root": "projects/cat-document-lib",
|
|
95
|
+
"sourceRoot": "projects/cat-document-lib/src",
|
|
96
|
+
"prefix": "lib",
|
|
97
|
+
"architect": {
|
|
98
|
+
"build": {
|
|
99
|
+
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
100
|
+
"options": {
|
|
101
|
+
"project": "projects/cat-document-lib/ng-package.json"
|
|
102
|
+
},
|
|
103
|
+
"configurations": {
|
|
104
|
+
"production": {
|
|
105
|
+
"tsConfig": "projects/cat-document-lib/tsconfig.lib.prod.json"
|
|
106
|
+
},
|
|
107
|
+
"development": {
|
|
108
|
+
"tsConfig": "projects/cat-document-lib/tsconfig.lib.json"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"defaultConfiguration": "production"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"cli": {
|
|
117
|
+
"analytics": "77456047-823c-4f1a-b41d-1ddee393b72d"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
const eslint = require("@eslint/js");
|
|
3
|
+
const tseslint = require("@typescript-eslint/eslint-plugin");
|
|
4
|
+
const tseslintParser = require("@typescript-eslint/parser");
|
|
5
|
+
const angular = require("@angular-eslint/eslint-plugin");
|
|
6
|
+
const jsdoc = require("eslint-plugin-jsdoc");
|
|
7
|
+
const angularParser = require("@angular-eslint/template-parser");
|
|
8
|
+
|
|
9
|
+
module.exports = [
|
|
10
|
+
{
|
|
11
|
+
files: ["**/*.ts"],
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parser: tseslintParser, // Use TypeScript parser for .ts files
|
|
14
|
+
parserOptions: {
|
|
15
|
+
ecmaVersion: 2020,
|
|
16
|
+
sourceType: "module",
|
|
17
|
+
project: "./tsconfig.json", // Ensure this points to your tsconfig.json
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
plugins: {
|
|
21
|
+
"@typescript-eslint": tseslint,
|
|
22
|
+
"@angular-eslint": angular,
|
|
23
|
+
jsdoc,
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
"@angular-eslint/directive-selector": [
|
|
27
|
+
"error",
|
|
28
|
+
{
|
|
29
|
+
type: "attribute",
|
|
30
|
+
style: "camelCase",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
"@angular-eslint/component-selector": [
|
|
34
|
+
"error",
|
|
35
|
+
{
|
|
36
|
+
type: "element",
|
|
37
|
+
style: "kebab-case",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
"jsdoc/check-access": 1, // Recommended
|
|
41
|
+
"jsdoc/check-alignment": 1, // Recommended
|
|
42
|
+
"jsdoc/check-param-names": 1, // Recommended
|
|
43
|
+
"jsdoc/check-property-names": 1, // Recommended
|
|
44
|
+
"jsdoc/check-tag-names": 1, // Recommended
|
|
45
|
+
"jsdoc/check-types": 1, // Recommended
|
|
46
|
+
"jsdoc/check-values": 1, // Recommended
|
|
47
|
+
"jsdoc/empty-tags": 1, // Recommended
|
|
48
|
+
"jsdoc/implements-on-classes": 1, // Recommended
|
|
49
|
+
"jsdoc/multiline-blocks": 1, // Recommended
|
|
50
|
+
"jsdoc/no-multi-asterisks": 1, // Recommended
|
|
51
|
+
"jsdoc/no-undefined-types": 1, // Recommended
|
|
52
|
+
"jsdoc/require-jsdoc": [
|
|
53
|
+
"error",
|
|
54
|
+
{
|
|
55
|
+
"contexts": [
|
|
56
|
+
"ClassDeclaration",
|
|
57
|
+
"ClassExpression",
|
|
58
|
+
"ArrowFunctionExpression",
|
|
59
|
+
"FunctionDeclaration",
|
|
60
|
+
"FunctionExpression",
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
'jsdoc/require-description': 'error',
|
|
65
|
+
"jsdoc/require-param": 1, // Recommended
|
|
66
|
+
"jsdoc/require-param-description": 1, // Recommended
|
|
67
|
+
"jsdoc/require-param-name": 1, // Recommended
|
|
68
|
+
"jsdoc/require-param-type": 1, // Recommended
|
|
69
|
+
"jsdoc/require-property": 1, // Recommended
|
|
70
|
+
"jsdoc/require-property-description": 1, // Recommended
|
|
71
|
+
"jsdoc/require-property-name": 1, // Recommended
|
|
72
|
+
"jsdoc/require-property-type": 1, // Recommended
|
|
73
|
+
"jsdoc/require-returns": 1, // Recommended
|
|
74
|
+
"jsdoc/require-returns-check": 1, // Recommended
|
|
75
|
+
"jsdoc/require-returns-description": 1, // Recommended
|
|
76
|
+
"jsdoc/require-returns-type": 1, // Recommended
|
|
77
|
+
"jsdoc/require-yields": 1, // Recommended
|
|
78
|
+
"jsdoc/require-yields-check": 1, // Recommended
|
|
79
|
+
"jsdoc/tag-lines": 1, // Recommended
|
|
80
|
+
"jsdoc/valid-types": 1, // Recommended
|
|
81
|
+
"max-lines": [
|
|
82
|
+
"error",
|
|
83
|
+
{
|
|
84
|
+
max: 200,
|
|
85
|
+
skipBlankLines: true,
|
|
86
|
+
skipComments: true,
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
"max-lines-per-function": [
|
|
90
|
+
"error",
|
|
91
|
+
{
|
|
92
|
+
max: 20,
|
|
93
|
+
skipBlankLines: true,
|
|
94
|
+
skipComments: true,
|
|
95
|
+
IIFEs: true,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
files: ["**/*.html"],
|
|
102
|
+
languageOptions: {
|
|
103
|
+
parser: angularParser, // Use Angular template parser
|
|
104
|
+
},
|
|
105
|
+
plugins: {
|
|
106
|
+
"@angular-eslint": angular,
|
|
107
|
+
},
|
|
108
|
+
rules: {
|
|
109
|
+
// Add custom template rules here if needed
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
files: ["**/*.spec.ts"],
|
|
114
|
+
languageOptions: {
|
|
115
|
+
parser: tseslintParser, // Use TypeScript parser for .spec.ts files
|
|
116
|
+
parserOptions: {
|
|
117
|
+
ecmaVersion: 2020,
|
|
118
|
+
sourceType: "module",
|
|
119
|
+
project: "./tsconfig.json", // Ensure this points to your tsconfig.json
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
plugins: {
|
|
123
|
+
"@typescript-eslint": tseslint,
|
|
124
|
+
"@angular-eslint": angular,
|
|
125
|
+
},
|
|
126
|
+
rules: {
|
|
127
|
+
// Custom rules for spec files, e.g., allow certain things that are specific to testing
|
|
128
|
+
"max-lines": [
|
|
129
|
+
"error", // You might want to warn rather than error in test files
|
|
130
|
+
{
|
|
131
|
+
max: 500, // Allow more lines in spec files
|
|
132
|
+
skipBlankLines: true,
|
|
133
|
+
skipComments: true,
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
"max-lines-per-function": [
|
|
137
|
+
"error", // You might want to relax this for test files as well
|
|
138
|
+
{
|
|
139
|
+
max: 50, // Allow more lines in functions in spec files
|
|
140
|
+
skipBlankLines: true,
|
|
141
|
+
skipComments: true,
|
|
142
|
+
IIFEs: true,
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
// Add other rules specific to testing or Jest (if applicable)
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
];
|
package/package.json
CHANGED
|
@@ -1,19 +1,66 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cat-documents-ng",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"@
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "cat-documents-ng",
|
|
3
|
+
"version": "0.0.7",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"ng": "ng",
|
|
6
|
+
"start": "ng serve",
|
|
7
|
+
"build": "ng build",
|
|
8
|
+
"watch": "ng build --watch --configuration development",
|
|
9
|
+
"test": "jest --config projects/cat-document-lib/jest.config.mjs",
|
|
10
|
+
"lint": "ng lint",
|
|
11
|
+
"prepare": "husky install"
|
|
12
|
+
},
|
|
13
|
+
"private": false,
|
|
14
|
+
"type": "module",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@angular/animations": "^19.0.4",
|
|
17
|
+
"@angular/cdk": "^18.2.14",
|
|
18
|
+
"@angular/common": "^19.0.0",
|
|
19
|
+
"@angular/compiler": "^19.0.0",
|
|
20
|
+
"@angular/core": "^19.0.0",
|
|
21
|
+
"@angular/forms": "^19.0.0",
|
|
22
|
+
"@angular/platform-browser": "^19.0.0",
|
|
23
|
+
"@angular/platform-browser-dynamic": "^19.0.0",
|
|
24
|
+
"@angular/router": "^19.0.0",
|
|
25
|
+
"@datorama/akita": "^8.0.1",
|
|
26
|
+
"jsdocs": "^1.0.0",
|
|
27
|
+
"moment": "^2.30.1",
|
|
28
|
+
"ng2-pdf-viewer": "^9.1.5",
|
|
29
|
+
"primeflex": "^3.3.1",
|
|
30
|
+
"primeicons": "^7.0.0",
|
|
31
|
+
"primeng": "^17.18.10",
|
|
32
|
+
"rxjs": "~7.8.0",
|
|
33
|
+
"tslib": "^2.3.0",
|
|
34
|
+
"zone.js": "~0.15.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@angular-devkit/build-angular": "^19.0.5",
|
|
38
|
+
"@angular-eslint/eslint-plugin": "^19.0.2",
|
|
39
|
+
"@angular-eslint/eslint-plugin-template": "^19.0.2",
|
|
40
|
+
"@angular-eslint/template-parser": "^19.0.2",
|
|
41
|
+
"@angular/cli": "^19.0.5",
|
|
42
|
+
"@angular/compiler-cli": "^19.0.0",
|
|
43
|
+
"@eslint/js": "^9.17.0",
|
|
44
|
+
"@jest/globals": "^29.7.0",
|
|
45
|
+
"@types/jest": "^29.5.14",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^8.18.0",
|
|
47
|
+
"@typescript-eslint/parser": "^8.18.0",
|
|
48
|
+
"angular-eslint": "19.0.2",
|
|
49
|
+
"eslint": "^9.17.0",
|
|
50
|
+
"eslint-plugin-jsdoc": "^50.6.1",
|
|
51
|
+
"husky": "^9.1.7",
|
|
52
|
+
"jest": "^29.7.0",
|
|
53
|
+
"jest-preset-angular": "^14.4.2",
|
|
54
|
+
"lint-staged": "^15.2.11",
|
|
55
|
+
"ng-packagr": "^19.0.0",
|
|
56
|
+
"ts-jest": "^29.2.5",
|
|
57
|
+
"typescript": "~5.6.2",
|
|
58
|
+
"typescript-eslint": "8.18.0"
|
|
59
|
+
},
|
|
60
|
+
"lint-staged": {
|
|
61
|
+
"**/*.ts": "eslint",
|
|
62
|
+
"**/*.js": "eslint --fix",
|
|
63
|
+
"**/*.html": "eslint --fix",
|
|
64
|
+
"*.js": "eslint --cache --fix"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# CatDocumentLib
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build cat-document-lib
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
```bash
|
|
35
|
+
cd dist/cat-document-lib
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
39
|
+
```bash
|
|
40
|
+
npm publish
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Running unit tests
|
|
44
|
+
|
|
45
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ng test
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Running end-to-end tests
|
|
52
|
+
|
|
53
|
+
For end-to-end (e2e) testing, run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ng e2e
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
60
|
+
|
|
61
|
+
## Additional Resources
|
|
62
|
+
|
|
63
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|