@haloduck/core 1.0.0

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 ADDED
@@ -0,0 +1,116 @@
1
+ # @haloduck/core
2
+
3
+ HaloDuck Core Library는 Angular 기반 애플리케이션을 위한 핵심 라이브러리입니다.
4
+
5
+ ## 설치
6
+
7
+ ```bash
8
+ npm install @haloduck/core
9
+ ```
10
+
11
+ ## 설치 후
12
+ ### Copy scripts
13
+ Copy script files to `scripts` folder in the root folder.
14
+ ```bash
15
+ npx haloduck-copy-scripts
16
+ ```
17
+ ### Update `package.json`
18
+ ```bash
19
+ "scripts": {
20
+ ...
21
+ "prebuild": "ts-node scripts/generate-build-timestamp.ts"
22
+ }
23
+ ```
24
+ ## 주요 기능
25
+
26
+ - **인증 서비스**: AWS Amplify 기반 인증 관리
27
+ - **API 서비스**: RESTful API 통신을 위한 기본 서비스
28
+ - **상태 관리**: NgRx 기반 전역 상태 관리
29
+ - **가드**: 라우트 보호를 위한 인증 가드
30
+ - **인터셉터**: HTTP 요청/응답 처리
31
+ - **파이프**: 데이터 변환을 위한 유틸리티 파이프
32
+ - **모델**: 타입 정의 및 인터페이스
33
+
34
+ ## 사용법
35
+
36
+ ### 기본 설정
37
+
38
+ ```typescript
39
+ Amplify.configure({
40
+ Auth: {
41
+ Cognito: awsCognito as CognitoUserPoolConfig,
42
+ },
43
+ });
44
+
45
+ export const appConfig: ApplicationConfig = {
46
+ providers: [
47
+ // ...
48
+ provideHttpClient(
49
+ withInterceptors([idTokenInterceptor, dummyMemberIdInterceptor]),
50
+ ),
51
+ // ...
52
+ provideStore({
53
+ global: globalReducer,
54
+ }),
55
+ provideEffects(GlobalEffects),
56
+ provideStoreDevtools({ maxAge: 25, logOnly: !isDevMode() }),
57
+ // ...
58
+ provideQuillConfig({
59
+ modules: {
60
+ syntax: false,
61
+ },
62
+ }),
63
+ // ...
64
+ provideServiceWorker('ngsw-worker.js', {
65
+ enabled: environment.usePwa,
66
+ registrationStrategy: 'registerWhenStable:30000',
67
+ }),
68
+ // ...
69
+ provideTransloco({
70
+ config: {
71
+ availableLangs: ['en', 'ko', 'ja'],
72
+ defaultLang: 'en',
73
+ // Remove this option if your application doesn't support changing language in runtime.
74
+ reRenderOnLangChange: true,
75
+ prodMode: !isDevMode(),
76
+ },
77
+ loader: TranslocoHttpLoader,
78
+ }),
79
+ provideHaloduckTransloco(),
80
+ // ...
81
+ provideHaloduckCoreConfig({
82
+ stage: environment.stage,
83
+ appName: environment.appName,
84
+ defaultLanguage: 'en',
85
+ dateFormat: {
86
+ long: 'yyyy-MM-dd',
87
+ short: 'yyMMdd',
88
+ },
89
+ apiUrl: environment.service.apiUrl,
90
+ cdnUrl: environment.service.cdnUrl,
91
+ map: {
92
+ googleApiKey: environment.service.google.apiKey,
93
+ mapId: environment.service.google.id,
94
+ defaultLngLat: environment.service.google.defaultLngLat,
95
+ },
96
+ }),
97
+ /// ...
98
+ ],
99
+ };
100
+
101
+ ```
102
+
103
+ ## 의존성
104
+
105
+ - Angular 19.2.0+
106
+ - RxJS 7.8.0+
107
+ - NgRx 19.0.0+
108
+ - AWS Amplify 6.12.1+
109
+
110
+ ## 라이선스
111
+
112
+ MIT License
113
+
114
+ ## 지원
115
+
116
+ 이슈나 질문이 있으시면 [GitHub Issues](https://github.com/haloduck/haloduck-frontend/issues)에 등록해 주세요.
@@ -0,0 +1,12 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const now = new Date();
5
+ const timestamp = now.toISOString();
6
+
7
+ const content = `export const BUILD_TIMESTAMP = '${timestamp}';\n`;
8
+
9
+ const filePath = path.join(__dirname, './build-timestamp.ts');
10
+ fs.writeFileSync(filePath, content);
11
+
12
+ console.log('✅ Build timestamp generated:', timestamp);
Binary file
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@haloduck/core",
3
+ "version": "1.0.0",
4
+ "description": "HaloDuck Core Library - Angular 기반 핵심 라이브러리",
5
+ "keywords": ["angular", "haloduck", "core", "library", "typescript"],
6
+ "author": "HaloDuck",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/haloduck/haloduck-frontend.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/haloduck/haloduck-frontend/issues"
14
+ },
15
+ "homepage": "https://github.com/haloduck/haloduck-frontend#readme",
16
+ "main": "bundles/haloduck-core.umd.js",
17
+ "module": "fesm2022/haloduck-core.mjs",
18
+ "es2022": "fesm2022/haloduck-core.mjs",
19
+ "esm2022": "fesm2022/haloduck-core.mjs",
20
+ "fesm2022": "fesm2022/haloduck-core.mjs",
21
+ "typings": "index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "import": "./fesm2022/haloduck-core.mjs",
25
+ "require": "./bundles/haloduck-core.umd.js",
26
+ "types": "./index.d.ts"
27
+ }
28
+ },
29
+ "scripts": {
30
+ "build": "ng build @haloduck/core",
31
+ "build:prod": "ng build @haloduck/core --configuration production",
32
+ "test": "ng test @haloduck/core",
33
+ "lint": "ng lint @haloduck/core",
34
+ "prepublishOnly": "npm run build:prod"
35
+ },
36
+ "peerDependencies": {
37
+ "@angular/common": "^19.2.0",
38
+ "@angular/core": "^19.2.0",
39
+ "@angular/router": "^19.2.0",
40
+ "rxjs": "~7.8.0",
41
+ "@ngrx/effects": "^19.0.0",
42
+ "@ngrx/store": "^19.0.0",
43
+ "aws-amplify": "^6.12.1"
44
+ },
45
+ "dependencies": {
46
+ "tslib": "^2.3.0"
47
+ },
48
+ "sideEffects": false,
49
+ "bin": {
50
+ "haloduck-copy-scripts": "./scripts/copy-scripts.js"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ }
55
+ }
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ function copyFolderSync(from, to) {
7
+ fs.mkdirSync(to, { recursive: true });
8
+ for (const file of fs.readdirSync(from)) {
9
+ const src = path.join(from, file);
10
+ const dest = path.join(to, file);
11
+ if (fs.lstatSync(src).isDirectory()) {
12
+ copyFolderSync(src, dest);
13
+ } else {
14
+ fs.copyFileSync(src, dest);
15
+ }
16
+ }
17
+ }
18
+
19
+ module.exports = { copyFolderSync };
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ const path = require('path');
3
+ const copyFolderSync = require('./copy-folder').copyFolderSync;
4
+
5
+ const targetDir = path.resolve(process.cwd(), 'scripts');
6
+ const sourceDir = path.resolve(__dirname, '../assets/scripts');
7
+
8
+ copyFolderSync(sourceDir, targetDir);