gaesup-world 0.9.61 → 0.9.64

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 (3) hide show
  1. package/index.py +81 -0
  2. package/output.md +327 -0
  3. package/package.json +10 -13
package/index.py ADDED
@@ -0,0 +1,81 @@
1
+ import os
2
+
3
+ def get_language(extension):
4
+ """
5
+ 파일 확장자에 따라 코드 블록의 언어를 반환합니다.
6
+ """
7
+ mapping = {
8
+ '.ts': 'typescript',
9
+ '.tsx': 'tsx',
10
+ '.css.ts': 'typescript', # CSS-in-JS 로직을 고려하여 'typescript'로 지정
11
+ }
12
+ return mapping.get(extension, '')
13
+
14
+ def extract_code_separated(folder_path, output_md, supported_extensions):
15
+ """
16
+ 지정된 폴더 내의 특정 확장자를 가진 파일들을 확장자별로 그룹화하여 Markdown 파일로 저장합니다.
17
+ """
18
+ # 확장자별 파일 목록 초기화
19
+ files_by_extension = {ext: [] for ext in supported_extensions}
20
+
21
+ # 폴더를 재귀적으로 탐색하여 파일 분류
22
+ for root, dirs, files in os.walk(folder_path):
23
+ for file in files:
24
+ for ext in supported_extensions:
25
+ if file.endswith(ext):
26
+ relative_path = os.path.relpath(os.path.join(root, file), folder_path)
27
+ files_by_extension[ext].append(relative_path)
28
+ break
29
+
30
+ # Markdown 파일 열기
31
+ with open(output_md, 'w', encoding='utf-8') as md_file:
32
+ md_file.write('# 코드 추출 결과\n\n')
33
+
34
+ for ext in supported_extensions:
35
+ if files_by_extension[ext]:
36
+ # 섹션 제목 작성
37
+ if ext == '.ts':
38
+ section_title = '## TypeScript Files (.ts)'
39
+ elif ext == '.tsx':
40
+ section_title = '## TypeScript React Files (.tsx)'
41
+ elif ext == '.css.ts':
42
+ section_title = '## CSS TypeScript Files (.css.ts)'
43
+ else:
44
+ section_title = f'## {ext} Files'
45
+
46
+ md_file.write(f'{section_title}\n\n')
47
+
48
+ for relative_path in files_by_extension[ext]:
49
+ file_path = os.path.join(folder_path, relative_path)
50
+ language = get_language(ext)
51
+
52
+ # 파일 내용 읽기
53
+ try:
54
+ with open(file_path, 'r', encoding='utf-8') as f:
55
+ code = f.read()
56
+ except Exception as e:
57
+ print(f"파일을 읽는 중 오류 발생: {file_path}\n오류 내용: {e}")
58
+ continue
59
+
60
+ # 파일명을 소제목으로 추가
61
+ md_file.write(f'### {relative_path}\n\n')
62
+
63
+ # 코드 블록 추가
64
+ md_file.write(f'```{language}\n{code}\n```\n\n')
65
+
66
+ print(f"코드 추출이 완료되었습니다. 출력 파일: {output_md}")
67
+
68
+ if __name__ == "__main__":
69
+ # 파일 확장자를 리스트로 지정
70
+ supported_extensions = [".css.ts"] # 필요에 따라 확장자 추가
71
+
72
+ # 폴더 경로와 출력 Markdown 파일 경로 설정
73
+ folder_path = './src' # 코드 추출할 폴더 경로
74
+ output_md = './output.md' # 출력할 Markdown 파일 경로
75
+
76
+ # 폴더 존재 여부 확인
77
+ if not os.path.isdir(folder_path):
78
+ print(f"에러: 지정된 폴더가 존재하지 않습니다: {folder_path}")
79
+ exit(1)
80
+
81
+ extract_code_separated(folder_path, output_md, supported_extensions)
package/output.md ADDED
@@ -0,0 +1,327 @@
1
+ # 코드 추출 결과
2
+
3
+ ## CSS TypeScript Files (.css.ts)
4
+
5
+ ### gaesup/tools/gamepad/style.css.ts
6
+
7
+ ```typescript
8
+ // style.css.ts
9
+ import { globalStyle, style } from "@vanilla-extract/css";
10
+
11
+ export const gamePad = style({
12
+ display: "grid",
13
+ alignItems: "center",
14
+ justifyContent: "center",
15
+ gridTemplateColumns: "repeat(3, 1fr)",
16
+ gridTemplateRows: "repeat(3, 1fr)",
17
+ });
18
+
19
+ export const padButton = style({
20
+ display: "flex",
21
+ justifyContent: "center",
22
+ alignItems: "center",
23
+ position: "relative",
24
+ width: "5rem",
25
+ height: "5rem",
26
+ borderRadius: "50%",
27
+ fontSize: "1rem",
28
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
29
+ color: "white",
30
+ boxShadow: "0 0 0.5rem rgba(0, 0, 0, 0.5)",
31
+ cursor: "pointer",
32
+ transition: "all 0.3s ease-in",
33
+ margin: "0.5rem",
34
+ selectors: {
35
+ "&:hover": {
36
+ boxShadow: "0 0 1rem rgba(0, 0, 0, 0.5)",
37
+ },
38
+ "&::after": {
39
+ content: '""',
40
+ position: "absolute",
41
+ width: "4rem",
42
+ height: "4rem",
43
+ borderRadius: "50%",
44
+ background: "rgba(0, 0, 0, 0.2)",
45
+ zIndex: 100000,
46
+ },
47
+ },
48
+ });
49
+
50
+ export const isClicked = style({
51
+ background:
52
+ "radial-gradient(circle at center, rgba(245, 177, 97, 1) 0.4%, rgba(236, 54, 110, 1) 100.2%)",
53
+ boxShadow: "0 0 1rem rgba(245, 177, 97, 1)",
54
+ color: "black",
55
+ transition: "all 0.3s ease-in",
56
+ selectors: {
57
+ "&:hover": {
58
+ boxShadow: "0 0 2rem rgba(245, 177, 97, 1)",
59
+ },
60
+ },
61
+ });
62
+
63
+ // 사용자 선택 방지 글로벌 스타일
64
+ globalStyle(`${gamePad} *`, {
65
+ WebkitTouchCallout: "none",
66
+ WebkitUserSelect: "none",
67
+ MozUserSelect: "none",
68
+ msUserSelect: "none",
69
+ userSelect: "none",
70
+ });
71
+
72
+ ```
73
+
74
+ ### gaesup/tools/teleport/style.css.ts
75
+
76
+ ```typescript
77
+ import { style } from "@vanilla-extract/css";
78
+
79
+ export const teleport = style({
80
+ display: "flex",
81
+ justifyContent: "center",
82
+ alignItems: "center",
83
+ textAlign: "center",
84
+ margin: "1rem",
85
+ fontSize: "0.8rem",
86
+ borderRadius: "50%",
87
+ width: "5rem",
88
+ height: "5rem",
89
+ color: "white",
90
+ background: "rgba(0, 0, 0, 0.6)",
91
+ boxShadow: "0 0 5px 0 rgba(0, 0, 0, 0.6)",
92
+ transition: "all 0.2s ease-in",
93
+ cursor: "pointer",
94
+ });
95
+
96
+ ```
97
+
98
+ ### gaesup/tools/minimap/style.css.ts
99
+
100
+ ```typescript
101
+ // style.css.ts
102
+ import { globalFontFace, keyframes, style } from "@vanilla-extract/css";
103
+
104
+ // @font-face 정의
105
+ globalFontFace("Open Sans", {
106
+ src: 'url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&display=swap")',
107
+ fontWeight: "300",
108
+ fontStyle: "normal",
109
+ });
110
+
111
+ // 키프레임 정의
112
+ const pulseWhite = keyframes({
113
+ "0%": {
114
+ boxShadow: "0 0 0 0 rgba(255, 255, 255, 0.7)",
115
+ opacity: 1,
116
+ },
117
+ "70%": {
118
+ boxShadow: "0 0 0 10px rgba(255, 255, 255, 0)",
119
+ opacity: 0.7,
120
+ },
121
+ "100%": {
122
+ boxShadow: "0 0 0 0 rgba(255, 255, 255, 0)",
123
+ opacity: 1,
124
+ },
125
+ });
126
+
127
+ // 스타일 정의
128
+ export const minimap = style({
129
+ margin: "1rem",
130
+ borderRadius: "50%",
131
+ background: "rgba(0, 0, 0, 0.6)",
132
+ boxShadow: "0 0 10px rgba(0, 0, 0, 0.5)",
133
+ backdropFilter: "blur(1rem)",
134
+ WebkitBackdropFilter: "blur(1rem)",
135
+ width: "18rem",
136
+ height: "18rem",
137
+ border: "4px solid rgba(0, 0, 0, 0.5)",
138
+ overflow: "hidden",
139
+ "@media": {
140
+ "screen and (max-width: 1024px)": {
141
+ width: "17rem",
142
+ height: "17rem",
143
+ },
144
+ "screen and (max-width: 768px)": {
145
+ width: "16rem",
146
+ height: "16rem",
147
+ },
148
+ },
149
+ });
150
+
151
+ export const minimapOuter = style({
152
+ position: "absolute",
153
+ display: "flex",
154
+ alignItems: "center",
155
+ justifyContent: "center",
156
+ textAlign: "center",
157
+ width: "18rem",
158
+ height: "18rem",
159
+ overflow: "hidden",
160
+ });
161
+
162
+ export const minimapInner = style({
163
+ position: "relative",
164
+ display: "flex",
165
+ top: "50%",
166
+ left: "50%",
167
+ width: "18rem",
168
+ height: "18rem",
169
+ transformOrigin: "50% 50%",
170
+ borderRadius: "50%",
171
+ overflow: "hidden",
172
+ "@media": {
173
+ "screen and (max-width: 1024px)": {
174
+ width: "17rem",
175
+ height: "17rem",
176
+ },
177
+ "screen and (max-width: 768px)": {
178
+ width: "16rem",
179
+ height: "16rem",
180
+ },
181
+ },
182
+ });
183
+
184
+ export const avatar = style({
185
+ position: "absolute",
186
+ display: "flex",
187
+ alignItems: "center",
188
+ justifyContent: "center",
189
+ textAlign: "center",
190
+ top: "50%",
191
+ left: "50%",
192
+ transform: "translate(-50%, -50%)",
193
+ width: "2rem",
194
+ height: "2rem",
195
+ borderRadius: "50%",
196
+ background: "rgba(5, 222, 250, 1)",
197
+ boxShadow: "0 0 10px rgba(5, 222, 250, 1)",
198
+ border: "2px solid transparent",
199
+ objectFit: "cover",
200
+ zIndex: 100,
201
+ animation: `${pulseWhite} 2s infinite`,
202
+ });
203
+
204
+ export const plusMinus = style({
205
+ position: "relative",
206
+ display: "flex",
207
+ justifyContent: "center",
208
+ alignItems: "center",
209
+ width: "2rem",
210
+ height: "2rem",
211
+ borderRadius: "50%",
212
+ background: "rgba(0, 0, 0, 0.5)",
213
+ boxShadow: "0 0 5px rgba(0, 0, 0, 0.5)",
214
+ transition: "all 0.5s ease-in",
215
+ cursor: "pointer",
216
+ border: "2px solid transparent",
217
+ ":hover": {
218
+ boxShadow: "0 0 10px rgba(0, 0, 0, 0.5)",
219
+ },
220
+ });
221
+
222
+ export const scale = style({
223
+ position: "absolute",
224
+ width: "13rem",
225
+ bottom: "-5rem",
226
+ left: "50%",
227
+ transform: "translateX(-50%)",
228
+ display: "flex",
229
+ alignItems: "center",
230
+ justifyContent: "space-between",
231
+ textAlign: "center",
232
+ fontSize: "1.2rem",
233
+ color: "white",
234
+ textShadow: "0 0 10px black",
235
+ padding: "0.5rem",
236
+ borderRadius: "0.5rem",
237
+ boxShadow: "0 0 10px black",
238
+ background: "rgba(0, 0, 0, 0.5)",
239
+ zIndex: 3,
240
+ WebkitBackdropFilter: "blur(2rem)",
241
+ backdropFilter: "blur(2rem)",
242
+ fontFamily: '"Open Sans", sans-serif',
243
+ fontWeight: 300,
244
+ });
245
+
246
+ export const text = style({
247
+ position: "relative",
248
+ fontSize: "1rem",
249
+ color: "black",
250
+ padding: "0.5rem",
251
+ borderRadius: "0.5rem",
252
+ background: "rgba(255, 255, 255, 0.5)",
253
+ boxShadow: "0 0 10px rgba(255, 255, 255, 0.5)",
254
+ zIndex: 3,
255
+ });
256
+
257
+ export const minimapObject = style({
258
+ position: "absolute",
259
+ display: "flex",
260
+ alignItems: "center",
261
+ justifyContent: "center",
262
+ textAlign: "center",
263
+ borderRadius: "2px",
264
+ background: "rgba(0, 0, 0, 0.3)",
265
+ });
266
+
267
+ export const imageObject = style({
268
+ position: "absolute",
269
+ display: "flex",
270
+ alignItems: "center",
271
+ justifyContent: "center",
272
+ textAlign: "center",
273
+ background: `
274
+ linear-gradient(to bottom, transparent 95%, rgba(0, 0, 0, 0.2) 20%) 0 0 / 100% 40px repeat-y,
275
+ linear-gradient(to right, transparent 38px, rgba(0, 0, 0, 0.2) 38px) 0 0 / 40px 100% repeat-x transparent
276
+ `,
277
+ });
278
+
279
+ export const textObject = style({
280
+ position: "absolute",
281
+ display: "flex",
282
+ alignItems: "center",
283
+ justifyContent: "center",
284
+ textAlign: "center",
285
+ });
286
+
287
+ const directionBase = style({
288
+ position: "absolute",
289
+ color: "white",
290
+ fontSize: "1.5rem",
291
+ zIndex: 2000,
292
+ });
293
+
294
+ export const east = style([
295
+ directionBase,
296
+ {
297
+ top: "50%",
298
+ right: 0,
299
+ },
300
+ ]);
301
+
302
+ export const west = style([
303
+ directionBase,
304
+ {
305
+ top: "50%",
306
+ left: 0,
307
+ },
308
+ ]);
309
+
310
+ export const south = style([
311
+ directionBase,
312
+ {
313
+ top: 0,
314
+ left: "50%",
315
+ },
316
+ ]);
317
+
318
+ export const north = style([
319
+ directionBase,
320
+ {
321
+ bottom: 0,
322
+ left: "50%",
323
+ },
324
+ ]);
325
+
326
+ ```
327
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.9.61",
3
+ "version": "0.9.64",
4
4
  "type": "module",
5
5
  "main": "dist/index.ts",
6
6
  "types": "dist/index.d.ts",
@@ -15,23 +15,16 @@
15
15
  "prepare": "yarn clean && tsc -p tsconfig.build.json && yarn copy-files",
16
16
  "predeploy": "yarn build",
17
17
  "deploy": "gh-pages -d dist",
18
- "test": "jest",
19
- "publish": "yarn prepare && yarn npm publish --access public"
18
+ "test": "jest"
20
19
  },
21
- "peerDependencies": {
20
+ "dependencies": {
22
21
  "@dimforge/rapier3d": "^0.14.0",
23
22
  "@dimforge/rapier3d-compat": "^0.14.0",
23
+ "@react-icons/all-files": "^4.1.0",
24
24
  "@react-three/drei": "9.112.0",
25
25
  "@react-three/fiber": "8.17.7",
26
- "@react-three/rapier": "^1.4.0",
27
- "react": "^18.3.1",
28
- "react-dom": "^18.3.1",
29
- "three": "^0.168.0",
30
- "three-stdlib": "^2.32.2"
31
- },
32
- "dependencies": {
33
- "@react-icons/all-files": "^4.1.0",
34
26
  "@react-three/postprocessing": "^2.16.2",
27
+ "@react-three/rapier": "^1.4.0",
35
28
  "@types/lodash": "^4.17.7",
36
29
  "@types/three": "^0.168.0",
37
30
  "gh-pages": "^6.1.1",
@@ -40,9 +33,13 @@
40
33
  "lodash": "^4.17.21",
41
34
  "lru-cache": "^11.0.1",
42
35
  "node-fetch": "3.3.2",
36
+ "react": "^18.3.1",
43
37
  "react-device-detect": "^2.2.3",
38
+ "react-dom": "^18.3.1",
44
39
  "react-icons": "^5.3.0",
45
- "react-use-refs": "^1.0.1"
40
+ "react-use-refs": "^1.0.1",
41
+ "three": "^0.168.0",
42
+ "three-stdlib": "^2.32.2"
46
43
  },
47
44
  "devDependencies": {
48
45
  "@types/react": "^18.3.5",