unictive-angular 1.0.13 → 1.0.14

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.
Files changed (95) hide show
  1. package/README.md +25 -0
  2. package/bin/index.js +10 -7
  3. package/bin/utils/auth.js +0 -1
  4. package/bin/utils/createStructure.js +36 -7
  5. package/bin/utils/{setupAssets.js → refactorAngularJson.js} +63 -3
  6. package/bin/utils/resource/.postcssrc.json +12 -0
  7. package/bin/utils/resource/package.json +48 -0
  8. package/bin/utils/resource/src/app/MODULES/auth/README.md +10 -0
  9. package/bin/utils/resource/src/app/MODULES/dashboard/README.md +10 -0
  10. package/bin/utils/resource/src/app/MODULES/home/README.md +10 -0
  11. package/bin/utils/resource/src/app/app.config.ts +20 -0
  12. package/bin/utils/resource/src/app/app.html +263 -0
  13. package/bin/utils/resource/src/app/app.routes.ts +3 -0
  14. package/bin/utils/resource/src/app/app.scss +6 -0
  15. package/bin/utils/resource/src/app/app.spec.ts +25 -0
  16. package/bin/utils/resource/src/app/app.ts +32 -0
  17. package/bin/utils/resource/src/app/core/README.md +10 -0
  18. package/bin/utils/resource/src/app/core/config/README.md +10 -0
  19. package/bin/utils/resource/src/app/core/guards/README.md +10 -0
  20. package/bin/utils/resource/src/app/core/interceptors/README.md +10 -0
  21. package/bin/utils/resource/src/app/core/interceptors/error.interceptor.ts +47 -0
  22. package/bin/utils/resource/src/app/core/interceptors/jsonrpc.ts +440 -0
  23. package/bin/utils/resource/src/app/core/interceptors/jwt.interceptor.ts +36 -0
  24. package/bin/utils/resource/src/app/core/models/README.md +10 -0
  25. package/bin/utils/resource/src/app/core/services/README.md +10 -0
  26. package/bin/utils/resource/src/app/shared/README.md +10 -0
  27. package/bin/utils/resource/src/app/shared/directives/README.md +10 -0
  28. package/bin/utils/resource/src/app/shared/pipes/README.md +10 -0
  29. package/bin/utils/resource/src/app/shared/ui/README.md +10 -0
  30. package/bin/utils/resource/src/app/shared/utils/README.md +10 -0
  31. package/bin/utils/resource/src/app/shared/utils/logger.ts +40 -0
  32. package/bin/utils/resource/src/app/shared/widgets/test/test.component.css +0 -0
  33. package/bin/utils/resource/src/app/shared/widgets/test/test.component.html +20 -0
  34. package/bin/utils/resource/src/app/shared/widgets/test/test.component.ts +56 -0
  35. package/bin/utils/resource/src/app/shared/widgets/test/test.module.ts +10 -0
  36. package/bin/utils/resource/src/environments/environment.prod.ts +6 -0
  37. package/bin/utils/resource/src/environments/environment.staging.ts +6 -0
  38. package/bin/utils/resource/src/environments/environment.ts +6 -0
  39. package/bin/utils/resource/src/index.html +16 -0
  40. package/bin/utils/resource/src/main.ts +6 -0
  41. package/bin/utils/resource/src/styles.scss +2 -0
  42. package/bin/utils/resource/src/tailwind.css +11 -0
  43. package/bin/utils/resource/tailwind.config.js +19 -0
  44. package/bin/utils/resource/tsconfig.json +46 -0
  45. package/coba/.editorconfig +17 -0
  46. package/coba/.postcssrc.json +12 -0
  47. package/coba/.vscode/extensions.json +4 -0
  48. package/coba/.vscode/launch.json +20 -0
  49. package/coba/.vscode/tasks.json +42 -0
  50. package/coba/README.md +59 -0
  51. package/coba/angular.json +102 -0
  52. package/coba/package-lock.json +10696 -0
  53. package/coba/package.json +48 -0
  54. package/coba/public/favicon.ico +0 -0
  55. package/coba/src/app/MODULES/auth/README.md +10 -0
  56. package/coba/src/app/MODULES/dashboard/README.md +10 -0
  57. package/coba/src/app/MODULES/home/README.md +10 -0
  58. package/coba/src/app/app.config.ts +20 -0
  59. package/coba/src/app/app.html +263 -0
  60. package/coba/src/app/app.routes.ts +3 -0
  61. package/coba/src/app/app.scss +6 -0
  62. package/coba/src/app/app.spec.ts +25 -0
  63. package/coba/src/app/app.ts +32 -0
  64. package/coba/src/app/core/README.md +10 -0
  65. package/coba/src/app/core/config/README.md +10 -0
  66. package/coba/src/app/core/guards/README.md +10 -0
  67. package/coba/src/app/core/interceptors/README.md +10 -0
  68. package/coba/src/app/core/interceptors/error.interceptor.ts +47 -0
  69. package/coba/src/app/core/interceptors/jsonrpc.ts +440 -0
  70. package/coba/src/app/core/interceptors/jwt.interceptor.ts +36 -0
  71. package/coba/src/app/core/models/README.md +10 -0
  72. package/coba/src/app/core/services/README.md +10 -0
  73. package/coba/src/app/shared/README.md +10 -0
  74. package/coba/src/app/shared/directives/README.md +10 -0
  75. package/coba/src/app/shared/pipes/README.md +10 -0
  76. package/coba/src/app/shared/ui/README.md +10 -0
  77. package/coba/src/app/shared/utils/README.md +10 -0
  78. package/coba/src/app/shared/utils/logger.ts +40 -0
  79. package/coba/src/app/shared/widgets/test/test.component.css +0 -0
  80. package/coba/src/app/shared/widgets/test/test.component.html +20 -0
  81. package/coba/src/app/shared/widgets/test/test.component.ts +56 -0
  82. package/coba/src/app/shared/widgets/test/test.module.ts +10 -0
  83. package/coba/src/environments/environment.prod.ts +6 -0
  84. package/coba/src/environments/environment.staging.ts +6 -0
  85. package/coba/src/environments/environment.ts +6 -0
  86. package/coba/src/index.html +16 -0
  87. package/coba/src/main.ts +6 -0
  88. package/coba/src/styles.scss +2 -0
  89. package/coba/src/tailwind.css +11 -0
  90. package/coba/tailwind.config.js +19 -0
  91. package/coba/tsconfig.app.json +15 -0
  92. package/coba/tsconfig.json +46 -0
  93. package/coba/tsconfig.spec.json +14 -0
  94. package/package.json +1 -1
  95. package/test/node_modules/@tailwindcss/oxide-win32-x64-msvc/tailwindcss-oxide.win32-x64-msvc.node +0 -0
@@ -0,0 +1,10 @@
1
+ # UTILS
2
+
3
+ Folder ini untuk layer **utils**.
4
+
5
+ - **domain** → berisi entity, interface, dan aturan bisnis murni
6
+ - **application** → berisi use case, service koordinasi domain
7
+ - **infrastructure** → berisi API call, repository, integrasi eksternal
8
+ - **presentation** → berisi komponen Angular, routing, dan UI
9
+
10
+ > Bagian ini adalah bagian dari arsitektur **Clean Architecture** untuk fitur ini.
@@ -0,0 +1,40 @@
1
+ import { environment } from 'src/environments/environment';
2
+
3
+ export const logger = {
4
+ /**
5
+ * Log information when not in production
6
+ * @param label - Label for the information
7
+ * @param data - Data to log
8
+ */
9
+ log(labelOrData: string | unknown, data?: unknown): void {
10
+ if (environment.envName != 'prod') {
11
+ if (typeof labelOrData === 'string' && data !== undefined) {
12
+ console.log(`🔥 [${labelOrData}]`, data);
13
+ } else {
14
+ console.log('🔥', labelOrData);
15
+ }
16
+ }
17
+ },
18
+
19
+ /**
20
+ * Log error when not in production
21
+ * @param label - Label for the error
22
+ * @param error - Error to log
23
+ */
24
+ error(label: string, error: unknown): void {
25
+ if (environment.envName != 'prod') {
26
+ console.error(`❌ [${label}]`, error);
27
+ }
28
+ },
29
+
30
+ /**
31
+ * Log warning when not in production
32
+ * @param label - Label for the warning
33
+ * @param data - Data to log
34
+ */
35
+ warn(label: string, data: unknown): void {
36
+ if (environment.envName != 'prod') {
37
+ console.warn(`⚠️ [${label}]`, data);
38
+ }
39
+ },
40
+ };
@@ -0,0 +1,20 @@
1
+ <div class="fixed inset-0 bgs z-50 flex items-center justify-center">
2
+ <div class="absolute transition-all duration-100 ease-in-out transform hover:scale-110"
3
+ style="padding: 50px; box-sizing: content-box;"
4
+ [ngStyle]="{ top: boxPosition.top, left: boxPosition.left, position: 'absolute' }" (mouseenter)="onMouseEnterBox()">
5
+
6
+ <div (click)="onLogout()"
7
+ class=" w-40 h-20 bg-black text-white flex items-center text-center justify-center cursor-pointer rounded-xl shadow-lg">
8
+ Tangkap
9
+ </div>
10
+ </div>
11
+
12
+ <div class="absolute top-5 right-5 text-white text-xl space-y-2 text-right bg-amber-900 p-2 rounded-2xl">
13
+ <div>Waktu: {{ timer }} detik</div>
14
+ <div>Skor: {{ score }}</div>
15
+ </div>
16
+
17
+ <div *ngIf="gameEnded" class="absolute bottom-10 text-white text-2xl font-bold">
18
+ Permainan Selesai! Skor akhir: {{ score }}
19
+ </div>
20
+ </div>
@@ -0,0 +1,56 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'app-test-box',
5
+ templateUrl: './test.component.html',
6
+ styleUrls: ['./test.component.css'],
7
+ standalone: false,
8
+ })
9
+ export class TestComponent implements OnInit {
10
+ boxPosition = { top: '50%', left: '50%' };
11
+ gameStarted = false;
12
+ gameEnded = false;
13
+ timer = 60;
14
+ score = 0;
15
+ intervalId: any;
16
+ constructor() { }
17
+
18
+ ngOnInit() {
19
+ this.startGame();
20
+ }
21
+ startGame() {
22
+ this.gameStarted = true;
23
+ this.timer = 60;
24
+ this.score = 0;
25
+ this.gameEnded = false;
26
+ this.moveBoxRandomly();
27
+
28
+ this.intervalId = setInterval(() => {
29
+ this.timer--;
30
+ if (this.timer <= 0) {
31
+ clearInterval(this.intervalId);
32
+ this.gameEnded = true;
33
+ }
34
+ }, 1000);
35
+ }
36
+
37
+ onMouseEnterBox() {
38
+ if (!this.gameEnded) {
39
+ this.score++;
40
+ this.moveBoxRandomly();
41
+ }
42
+ }
43
+
44
+ moveBoxRandomly() {
45
+ const top = Math.random() * 90;
46
+ const left = Math.random() * 90;
47
+ this.boxPosition = {
48
+ top: `${top}%`,
49
+ left: `${left}%`,
50
+ };
51
+ }
52
+
53
+ onLogout() {
54
+ // this.auth.onLogout();
55
+ }
56
+ }
@@ -0,0 +1,10 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { TestComponent } from './test.component';
4
+
5
+ @NgModule({
6
+ imports: [CommonModule],
7
+ declarations: [TestComponent],
8
+ exports: [TestComponent],
9
+ })
10
+ export class TestBoxModule {}
@@ -0,0 +1,6 @@
1
+ export const environment = {
2
+ production: true,
3
+ apiUrl: 'https://api.example.com',
4
+ envName: 'prod',
5
+ tokenName: 'token',
6
+ };
@@ -0,0 +1,6 @@
1
+ export const environment = {
2
+ production: false,
3
+ apiUrl: 'https://staging.example.com/api',
4
+ envName: 'staging',
5
+ tokenName: 'token',
6
+ };
@@ -0,0 +1,6 @@
1
+ export const environment = {
2
+ production: false,
3
+ apiUrl: 'http://localhost:3000/api',
4
+ envName: 'dev',
5
+ tokenName: 'token',
6
+ };
@@ -0,0 +1,16 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <title>Angular</title>
7
+ <base href="/">
8
+ <meta name="viewport" content="width=device-width, initial-scale=1">
9
+ <link rel="icon" type="image/x-icon" href="favicon.ico">
10
+ </head>
11
+
12
+ <body>
13
+ <app-root></app-root>
14
+ </body>
15
+
16
+ </html>
@@ -0,0 +1,6 @@
1
+ import { bootstrapApplication } from '@angular/platform-browser';
2
+ import { appConfig } from './app/app.config';
3
+ import { App } from './app/app';
4
+
5
+ bootstrapApplication(App, appConfig)
6
+ .catch((err) => console.error(err));
@@ -0,0 +1,2 @@
1
+ // @import "tailwindcss";
2
+
@@ -0,0 +1,11 @@
1
+ /* You can add global styles to this file, and also import other style files */
2
+ @import "tailwindcss";
3
+ /* @import "~@ng-select/ng-select/themes/default.theme.css"; */
4
+ /* @import "./theme/components.scss";
5
+ @import "./theme/fontstyle.scss";
6
+ @import "./theme/typography.scss";
7
+ @import "./theme/variables.scss"; */
8
+
9
+
10
+
11
+
@@ -0,0 +1,19 @@
1
+ // tailwind.config.js
2
+ module.exports = {
3
+ content: ["./src/**/*.{html,ts,scss}"], // sesuaikan dengan proyekmu
4
+
5
+ theme: {
6
+ extend: {
7
+ colors: {
8
+ brand: '#1E40AF', // kamu bisa ganti nama dan nilainya
9
+ },
10
+ fontFamily: {
11
+ inter_bold: ['Inter-Bold', 'sans-serif'],
12
+ inter_semibold: ['Inter-Semibold', 'sans-serif'],
13
+ inter_regular: ['Inter-Regular', 'sans-serif'],
14
+ },
15
+ },
16
+ },
17
+ plugins: [],
18
+ }
19
+
@@ -0,0 +1,46 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "compileOnSave": false,
5
+ "compilerOptions": {
6
+ "baseUrl": "./",
7
+ "strict": true,
8
+ "noImplicitOverride": true,
9
+ "noPropertyAccessFromIndexSignature": true,
10
+ "noImplicitReturns": true,
11
+ "noFallthroughCasesInSwitch": true,
12
+ "skipLibCheck": true,
13
+ "isolatedModules": true,
14
+ "experimentalDecorators": true,
15
+ "importHelpers": true,
16
+ "target": "ES2022",
17
+ "module": "preserve",
18
+ "paths": {
19
+ "@api": ["src/app/API"],
20
+ "@api/*": ["src/app/API/*"],
21
+ "@core": ["src/app/core"],
22
+ "@core/*": ["src/app/core/*"],
23
+ "@MODULES": ["src/app/MODULES"],
24
+ "@MODULES/*": ["src/app/MODULES/*"],
25
+ "@shared": ["src/app/shared"],
26
+ "@shared/*": ["src/app/shared/*"],
27
+ },
28
+ },
29
+ "angularCompilerOptions": {
30
+ "enableI18nLegacyMessageIdFormat": false,
31
+ "strictInjectionParameters": true,
32
+ "strictInputAccessModifiers": true,
33
+ "typeCheckHostBindings": true,
34
+ "strictTemplates": true
35
+ },
36
+
37
+ "files": [],
38
+ "references": [
39
+ {
40
+ "path": "./tsconfig.app.json"
41
+ },
42
+ {
43
+ "path": "./tsconfig.spec.json"
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,17 @@
1
+ # Editor configuration, see https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ indent_size = 2
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.ts]
12
+ quote_type = single
13
+ ij_typescript_use_double_quotes = false
14
+
15
+ [*.md]
16
+ max_line_length = off
17
+ trim_trailing_whitespace = false
@@ -0,0 +1,12 @@
1
+ {
2
+ "plugins": {
3
+ "@tailwindcss/postcss": {
4
+ "config": "./tailwind.config.js"
5
+
6
+
7
+ },
8
+ "autoprefixer": {}
9
+ }
10
+
11
+ }
12
+
@@ -0,0 +1,4 @@
1
+ {
2
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3
+ "recommendations": ["angular.ng-template"]
4
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3
+ "version": "0.2.0",
4
+ "configurations": [
5
+ {
6
+ "name": "ng serve",
7
+ "type": "chrome",
8
+ "request": "launch",
9
+ "preLaunchTask": "npm: start",
10
+ "url": "http://localhost:4200/"
11
+ },
12
+ {
13
+ "name": "ng test",
14
+ "type": "chrome",
15
+ "request": "launch",
16
+ "preLaunchTask": "npm: test",
17
+ "url": "http://localhost:9876/debug.html"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
3
+ "version": "2.0.0",
4
+ "tasks": [
5
+ {
6
+ "type": "npm",
7
+ "script": "start",
8
+ "isBackground": true,
9
+ "problemMatcher": {
10
+ "owner": "typescript",
11
+ "pattern": "$tsc",
12
+ "background": {
13
+ "activeOnStart": true,
14
+ "beginsPattern": {
15
+ "regexp": "(.*?)"
16
+ },
17
+ "endsPattern": {
18
+ "regexp": "bundle generation complete"
19
+ }
20
+ }
21
+ }
22
+ },
23
+ {
24
+ "type": "npm",
25
+ "script": "test",
26
+ "isBackground": true,
27
+ "problemMatcher": {
28
+ "owner": "typescript",
29
+ "pattern": "$tsc",
30
+ "background": {
31
+ "activeOnStart": true,
32
+ "beginsPattern": {
33
+ "regexp": "(.*?)"
34
+ },
35
+ "endsPattern": {
36
+ "regexp": "bundle generation complete"
37
+ }
38
+ }
39
+ }
40
+ }
41
+ ]
42
+ }
package/coba/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # Coba
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.0.3.
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.
@@ -0,0 +1,102 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "coba": {
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/build:application",
19
+ "options": {
20
+ "browser": "src/main.ts",
21
+ "tsConfig": "tsconfig.app.json",
22
+ "inlineStyleLanguage": "scss",
23
+ "assets": [
24
+ {
25
+ "glob": "**/*",
26
+ "input": "public"
27
+ },
28
+ "src/assets"
29
+ ],
30
+ "styles": [
31
+ "src/styles.scss",
32
+ "src/tailwind.css"
33
+ ]
34
+ },
35
+ "configurations": {
36
+ "production": {
37
+ "fileReplacements": [
38
+ {
39
+ "replace": "src/environments/environment.ts",
40
+ "with": "src/environments/environment.prod.ts"
41
+ }
42
+ ]
43
+ },
44
+ "development": {
45
+ "optimization": false,
46
+ "extractLicenses": false,
47
+ "sourceMap": true
48
+ },
49
+ "dev": {
50
+ "fileReplacements": [
51
+ {
52
+ "replace": "src/environments/environment.ts",
53
+ "with": "src/environments/environment.dev.ts"
54
+ }
55
+ ]
56
+ },
57
+ "staging": {
58
+ "fileReplacements": [
59
+ {
60
+ "replace": "src/environments/environment.ts",
61
+ "with": "src/environments/environment.staging.ts"
62
+ }
63
+ ]
64
+ }
65
+ },
66
+ "defaultConfiguration": "production"
67
+ },
68
+ "serve": {
69
+ "builder": "@angular/build:dev-server",
70
+ "configurations": {
71
+ "production": {
72
+ "buildTarget": "coba:build:production"
73
+ },
74
+ "development": {
75
+ "buildTarget": "coba:build:development"
76
+ }
77
+ },
78
+ "defaultConfiguration": "development"
79
+ },
80
+ "extract-i18n": {
81
+ "builder": "@angular/build:extract-i18n"
82
+ },
83
+ "test": {
84
+ "builder": "@angular/build:karma",
85
+ "options": {
86
+ "tsConfig": "tsconfig.spec.json",
87
+ "inlineStyleLanguage": "scss",
88
+ "assets": [
89
+ {
90
+ "glob": "**/*",
91
+ "input": "public"
92
+ }
93
+ ],
94
+ "styles": [
95
+ "src/styles.scss"
96
+ ]
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+ }