@rusaint/react-native 0.10.0-dev.6 → 0.11.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 CHANGED
@@ -1,15 +1,110 @@
1
- # @rusaint/react-native
1
+ <h1 align="center">@rusaint/react-native</h1>
2
+ <p align="center" style="font-style: italic;">빠르고 간편하며 믿을 수 있는 숭실대학교 u-saint 클라이언트</p>
3
+ <p align="center">
4
+ <a href="https://github.com/EATSTEAK/rusaint"><img alt="GitHub Badge" src="https://img.shields.io/badge/github-eatsteak/rusaint-8da0cb?style=for-the-badge&labelColor=555555&logo=github"></a>
5
+ <a href="https://www.npmjs.com/package/@rusaint/react-native"><img alt="NPM Distribution" src="https://img.shields.io/npm/v/%40rusaint%2Freact-native?style=for-the-badge&logo=npm&color=CB3837"></a>
6
+ <a href="https://docs.rs/rusaint"><img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-rusaint-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs"></a>
7
+ <a href="https://github.com/EATSTEAK/rusaint/LICENSE.md"><img alt="License" src="https://img.shields.io/github/license/EATSTEAK/rusaint?style=for-the-badge"></a>
8
+ </p>
2
9
 
3
- React native implementation of the rusaint, scraper library for SSU u-saint
10
+ ---
11
+
12
+ rusaint(_ru-saint, 루세인트_)는 [숭실대학교 u-saint](https://saint.ssu.ac.kr)를 정확하고 빠르게, 간편하게 파싱하고 다양한 환경에서 조작할 수 있는 Rust 기반 비공식
13
+ u-saint 클라이언트입니다.
14
+
15
+ u-saint의 기반인 [SAP Web Dynpro](https://en.wikipedia.org/wiki/Web_Dynpro)에서 사용하는 Lightspeed 라이브러리의 최소 동작을 구현하여 안전하게
16
+ u-saint 내부 요소들을 조작하고 파싱할 수 있습니다.
4
17
 
5
- ## Installation
18
+ - **JS 런타임 없음** — JS 런타임 없이 자체적으로 요청과 응답에 따른 처리를 수행하므로 HTTPS 요청이 가능한 모든 환경에서 실행 가능합니다.
19
+ - **빠른 속도** — 네이티브 환경으로 컴파일되는 Rust를 이용하고, 휴리스틱 없이 요청이 완료되면 곧바로 실행되어 빠르게 u-saint 를 조작 및 파싱 가능합니다.
20
+ - **멀티플랫폼 지원** — UniFFI를 통한 Kotlin, Swift, Python(예정) 지원 및 Node.js 용 WASM Wrapper(예정)를 제공하여 다양한 플랫폼에서 간편하게 이용할 수 있습니다.
21
+ - **간편한 기능 정의** — rusaint 에서 지원하지 않는 u-saint 애플리케이션에 대한 파싱 및 지원을 제공하는 API를 이용해 간편하게 정의할 수 있습니다.
6
22
 
7
- ```sh
8
- npm install @rusaint/react-native
23
+ ## 설치
24
+
25
+ ```bash
26
+ pnpm add @rusaint/react-native # or yarn, npm
9
27
  ```
10
28
 
11
- ## License
29
+ ## 문서
12
30
 
13
- MIT
31
+ [docs.rs](https://docs.rs/rusaint)
14
32
 
15
- ---
33
+ ## 예시
34
+
35
+ ```typescript
36
+ import {
37
+ CourseScheduleApplicationBuilder,
38
+ Lecture,
39
+ LectureCategory,
40
+ LectureCategoryBuilder,
41
+ SemesterType,
42
+ USaintSessionBuilder,
43
+ type CourseScheduleApplicationInterface,
44
+ } from '@rusaint/react-native';
45
+ import { useRef, useState, useEffect } from 'react';
46
+
47
+ // Creates an anonymous session
48
+ const session = new USaintSessionBuilder().anonymous();
49
+
50
+ // A hook for find lectures from the CourseScheduleApplication
51
+ export const useFindLectures = (
52
+ year: number,
53
+ semester: SemesterType,
54
+ category: LectureCategory
55
+ ) => {
56
+ const clientRef = useRef<CourseScheduleApplicationInterface | null>(null);
57
+ const [result, setResult] = useState<Lecture[]>([]);
58
+ useEffect(() => {
59
+ (async () => {
60
+ const client = await new CourseScheduleApplicationBuilder().build(
61
+ session
62
+ );
63
+ clientRef.current = client;
64
+ })();
65
+ }, []);
66
+
67
+ useEffect(() => {
68
+ (async () => {
69
+ let result = await clientRef.current?.findLectures(
70
+ year,
71
+ semester,
72
+ category
73
+ );
74
+ setResult(result || []);
75
+ console.log('Lectures fetched:', result);
76
+ })();
77
+ }, [year, semester, category]);
78
+ return result;
79
+ };
80
+
81
+ // Creates a category outside of the component
82
+ const category = new LectureCategoryBuilder().major(
83
+ 'IT대학',
84
+ '글로벌미디어학부',
85
+ undefined
86
+ );
87
+
88
+ // Use in the component
89
+ const result = useFindLectures(2025, SemesterType.One, category);
90
+ ```
91
+
92
+ ## Expo에서 사용하기
93
+
94
+ 현재 `@rusaint/react-native`는 Expo Module을 지원하지 않습니다. 따라서 Expo 프로젝트에서 사용하기 위해서는 `@react-native-community/cli`의 autolink 기능을 활성화하여 Turbo Module을 autolink 해야 합니다.
95
+
96
+ ```bash
97
+ pnpm add @react-native-community/cli -D # or use yarn, npm
98
+ ```
99
+
100
+ 으로 `@react-native-community/cli`를 설치합니다.
101
+
102
+ ```properties
103
+ # .env
104
+ EXPO_USE_COMMUNITY_AUTOLINKING=1 # Enable autolinking by @react-native-community/cli
105
+ ```
106
+
107
+ `EXPO_USE_COMMUNITY_AUTOLINKING` 환경변수를 `expo prebuild` 과정에 제공하여 모듈의 autolink를 활성화합니다.
108
+
109
+ > [!WARNING]
110
+ > Community autolinking을 활성화 하면 Expo Go를 사용할 수 없습니다.
@@ -6,11 +6,11 @@
6
6
  <dict>
7
7
  <key>ios-arm64-simulator/librusaint_ffi.a</key>
8
8
  <data>
9
- WMTX8Uu7Yv5bxeaZ6wZtxvJ8lvo=
9
+ M97cOfMZVh8LkReek1ZzZ0y/nvo=
10
10
  </data>
11
11
  <key>ios-arm64/librusaint_ffi.a</key>
12
12
  <data>
13
- v7wDDrmTvi7q8fXVjDpexcuceoc=
13
+ VFdkrjVaB/hB5Yk5FMBR+Wmlh/0=
14
14
  </data>
15
15
  </dict>
16
16
  <key>files2</key>
@@ -19,22 +19,22 @@
19
19
  <dict>
20
20
  <key>hash</key>
21
21
  <data>
22
- WMTX8Uu7Yv5bxeaZ6wZtxvJ8lvo=
22
+ M97cOfMZVh8LkReek1ZzZ0y/nvo=
23
23
  </data>
24
24
  <key>hash2</key>
25
25
  <data>
26
- ZzoOLLRMi4IV9/Q0Nwq7dF+SJJ4vrXuGY6mO8x7kwc8=
26
+ yJYbhXzGLAVtqc4p6jBOJ/tKxuNHYf7bLUiDCnUSrbM=
27
27
  </data>
28
28
  </dict>
29
29
  <key>ios-arm64/librusaint_ffi.a</key>
30
30
  <dict>
31
31
  <key>hash</key>
32
32
  <data>
33
- v7wDDrmTvi7q8fXVjDpexcuceoc=
33
+ VFdkrjVaB/hB5Yk5FMBR+Wmlh/0=
34
34
  </data>
35
35
  <key>hash2</key>
36
36
  <data>
37
- nzGg5HTRjtYjGDgMjt5kroWpKnUP4FC0hLB2JmZzVAQ=
37
+ T01ITFgaBuEe/JNV/nOBdj9UlMsZqm2EZvEbCDLBRTs=
38
38
  </data>
39
39
  </dict>
40
40
  </dict>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rusaint/react-native",
3
- "version": "0.10.0-dev.6",
3
+ "version": "0.11.1",
4
4
  "description": "React native implementation of the rusaint, scraper library for SSU u-saint",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -75,8 +75,8 @@
75
75
  "@eslint/js": "^9.23.0",
76
76
  "@evilmartians/lefthook": "^1.11.5",
77
77
  "@react-native-community/cli": "^18.0.0",
78
- "@react-native/eslint-config": "^0.79.2",
79
- "@react-native/eslint-plugin": "^0.79.2",
78
+ "@react-native/eslint-config": "^0.79.3",
79
+ "@react-native/eslint-plugin": "^0.79.3",
80
80
  "@release-it/conventional-changelog": "^10.0.0",
81
81
  "@types/jest": "^29.5.14",
82
82
  "@types/node": "^22.13.14",
@@ -90,7 +90,7 @@
90
90
  "react": "19.1.0",
91
91
  "react-native": "0.79.2",
92
92
  "react-native-builder-bob": "^0.40.0",
93
- "release-it": "^18.1.2",
93
+ "release-it": "^19.0.3",
94
94
  "turbo": "^2.4.4",
95
95
  "typescript": "^5.6.3",
96
96
  "typescript-eslint": "^8.28.0"
@@ -102,8 +102,8 @@
102
102
  "@types/react": "^19.0.0"
103
103
  },
104
104
  "peerDependencies": {
105
- "react": "^19.1.0",
106
- "react-native": "^0.79.2"
105
+ "react": "*",
106
+ "react-native": "^0.79.3"
107
107
  },
108
108
  "workspaces": [
109
109
  "example"
@@ -1,3 +1,5 @@
1
+ const pkg = require('./package.json');
2
+ const path = require('path');
1
3
  /**
2
4
  * @type {import('@react-native-community/cli-types').UserDependencyConfig}
3
5
  */