create-mendix-widget-gleam 1.0.4 → 1.0.5
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 +8 -16
- package/package.json +1 -1
- package/src/index.mjs +49 -45
- package/template/docs/glendix_guide.md +1365 -0
- package/template/gleam.toml +1 -0
- package/template/manifest.toml +2 -0
- package/template/src/widget/__widget_name__.gleam +4 -4
- package/template/src/widget/mendix/action.gleam +0 -41
- package/template/src/widget/mendix/big.gleam +0 -86
- package/template/src/widget/mendix/date.gleam +0 -92
- package/template/src/widget/mendix/dynamic_value.gleam +0 -30
- package/template/src/widget/mendix/editable_value.gleam +0 -73
- package/template/src/widget/mendix/file.gleam +0 -34
- package/template/src/widget/mendix/filter.gleam +0 -109
- package/template/src/widget/mendix/formatter.gleam +0 -18
- package/template/src/widget/mendix/icon.gleam +0 -34
- package/template/src/widget/mendix/list_attribute.gleam +0 -57
- package/template/src/widget/mendix/list_value.gleam +0 -106
- package/template/src/widget/mendix/reference.gleam +0 -47
- package/template/src/widget/mendix/selection.gleam +0 -31
- package/template/src/widget/mendix.gleam +0 -65
- package/template/src/widget/mendix_ffi.mjs +0 -530
- package/template/src/widget/react/event.gleam +0 -33
- package/template/src/widget/react/hook.gleam +0 -65
- package/template/src/widget/react/html.gleam +0 -156
- package/template/src/widget/react/prop.gleam +0 -106
- package/template/src/widget/react.gleam +0 -85
- package/template/src/widget/react_ffi.mjs +0 -184
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Gleam 언어로 Mendix Pluggable Widget 프로젝트를 스케폴딩하는 CLI 도구.
|
|
4
4
|
|
|
5
|
-
JSX 없이,
|
|
5
|
+
JSX 없이, **Gleam + [glendix](https://hexdocs.pm/glendix/)**로 React 컴포넌트를 작성하여 Mendix Studio Pro에서 동작하는 위젯을 만든다.
|
|
6
6
|
|
|
7
7
|
## 사용법
|
|
8
8
|
|
|
@@ -24,16 +24,14 @@ my-widget/
|
|
|
24
24
|
src/
|
|
25
25
|
widget/ # Gleam 위젯 코드
|
|
26
26
|
my_widget.gleam # 메인 위젯 모듈
|
|
27
|
-
react_ffi.mjs # React FFI 어댑터
|
|
28
|
-
mendix_ffi.mjs # Mendix FFI 어댑터
|
|
29
|
-
react.gleam + react/ # React 바인딩 (타입, Props, Hooks, HTML)
|
|
30
|
-
mendix.gleam + mendix/ # Mendix API 바인딩 (전체 Pluggable Widget API)
|
|
31
27
|
editor_config.gleam # Studio Pro 속성 패널
|
|
32
28
|
scripts/ # 빌드/개발 스크립트
|
|
33
|
-
gleam.toml # Gleam 프로젝트 설정
|
|
29
|
+
gleam.toml # Gleam 프로젝트 설정 (glendix >= 1.0.0 의존성 포함)
|
|
34
30
|
CLAUDE.md # AI 어시스턴트용 프로젝트 컨텍스트
|
|
35
31
|
```
|
|
36
32
|
|
|
33
|
+
React/Mendix FFI 바인딩은 프로젝트에 포함되지 않으며, [glendix](https://hexdocs.pm/glendix/) Hex 패키지로 제공된다.
|
|
34
|
+
|
|
37
35
|
## 생성 후 시작하기
|
|
38
36
|
|
|
39
37
|
```bash
|
|
@@ -43,18 +41,12 @@ gleam run -m scripts/dev # 개발 서버 시작
|
|
|
43
41
|
gleam run -m scripts/build # 프로덕션 빌드 (.mpk 생성)
|
|
44
42
|
```
|
|
45
43
|
|
|
46
|
-
##
|
|
44
|
+
## glendix — React + Mendix 바인딩
|
|
47
45
|
|
|
48
|
-
생성된
|
|
46
|
+
생성된 프로젝트는 [glendix](https://hexdocs.pm/glendix/) Hex 패키지를 의존성으로 사용한다. glendix가 React 원시 함수와 Mendix Pluggable Widget API 전체에 대한 타입 안전한 Gleam 바인딩을 제공한다:
|
|
49
47
|
|
|
50
|
-
- **
|
|
51
|
-
- **
|
|
52
|
-
- **ListValue** — 데이터 목록 (필터, 정렬, 페이지네이션)
|
|
53
|
-
- **SelectionValue** — 단일/다중 선택
|
|
54
|
-
- **ReferenceValue** — 연관 관계 (단일/다중 참조)
|
|
55
|
-
- **JsDate / Big** — JS Date, Big.js 고정밀 십진수 래퍼
|
|
56
|
-
- **Filter** — 필터 조건 빌더
|
|
57
|
-
- **그 외** — DynamicValue, FileValue, WebIcon, ValueFormatter 등
|
|
48
|
+
- **React** — `react`, `react/prop`, `react/hook`, `react/event`, `react/html`
|
|
49
|
+
- **Mendix** — `mendix`, `mendix/editable_value`, `mendix/action`, `mendix/list_value`, `mendix/selection`, `mendix/reference`, `mendix/date`, `mendix/big`, `mendix/filter` 등
|
|
58
50
|
|
|
59
51
|
## 라이선스
|
|
60
52
|
|
package/package.json
CHANGED
package/src/index.mjs
CHANGED
|
@@ -125,12 +125,12 @@ Gleam 언어로 Mendix Pluggable Widget을 개발하여 "Hello World"를 화면
|
|
|
125
125
|
|
|
126
126
|
## Goal
|
|
127
127
|
|
|
128
|
-
**JSX를 사용하지 않고, 오직 Gleam으로만** 위젯을 작성한다. Gleam 코드를 JavaScript로 컴파일하고, 컴파일된 JS가 곧 Mendix Pluggable Widget의 진입점이 된다.
|
|
128
|
+
**JSX를 사용하지 않고, 오직 Gleam으로만** 위젯을 작성한다. Gleam 코드를 JavaScript로 컴파일하고, 컴파일된 JS가 곧 Mendix Pluggable Widget의 진입점이 된다. React와 Mendix API 바인딩은 [glendix](https://hexdocs.pm/glendix/) 패키지가 제공한다.
|
|
129
129
|
|
|
130
130
|
## Tech Stack
|
|
131
131
|
|
|
132
132
|
- **Gleam** → JavaScript 컴파일 (target: javascript)
|
|
133
|
-
- **
|
|
133
|
+
- **[glendix](https://hexdocs.pm/glendix/)** — React + Mendix Pluggable Widget API의 Gleam FFI 바인딩 (Hex 패키지)
|
|
134
134
|
- **Mendix Pluggable Widget** (React 19)
|
|
135
135
|
- **Package Manager**: ${pm} (npm 의존성은 \`gleam run -m scripts/install\`로 설치)
|
|
136
136
|
- **Build**: \`@mendix/pluggable-widgets-tools\` (Rollup 기반)
|
|
@@ -139,14 +139,8 @@ Gleam 언어로 Mendix Pluggable Widget을 개발하여 "Hello World"를 화면
|
|
|
139
139
|
|
|
140
140
|
\`\`\`
|
|
141
141
|
src/
|
|
142
|
-
widget/ #
|
|
142
|
+
widget/ # 위젯 고유 코드 (개발자가 작업하는 곳)
|
|
143
143
|
${names.snakeCase}.gleam # 위젯 메인 모듈
|
|
144
|
-
react_ffi.mjs # React FFI 어댑터 (React 원시 함수)
|
|
145
|
-
mendix_ffi.mjs # Mendix FFI 어댑터 (Mendix 런타임 타입 접근)
|
|
146
|
-
react.gleam # 핵심 타입 + createElement + fragment/text/none
|
|
147
|
-
react/ # React 모듈 (prop, hook, event, html)
|
|
148
|
-
mendix.gleam # Mendix 핵심 타입 + Props 접근자
|
|
149
|
-
mendix/ # Mendix API 모듈 (editable_value, action, list_value 등)
|
|
150
144
|
editor_config.gleam # Studio Pro 속성 패널 설정
|
|
151
145
|
scripts/ # 빌드/개발 스크립트 (gleam run -m으로 실행)
|
|
152
146
|
cmd.gleam # 셸 명령어 실행 유틸리티
|
|
@@ -164,17 +158,21 @@ src/
|
|
|
164
158
|
package.xml # Mendix 패키지 매니페스트
|
|
165
159
|
ui/
|
|
166
160
|
${names.pascalCase}.css # 위젯 스타일시트
|
|
167
|
-
gleam.toml # Gleam 프로젝트 설정
|
|
161
|
+
gleam.toml # Gleam 프로젝트 설정 (glendix 의존성 포함)
|
|
168
162
|
docs/
|
|
169
163
|
gleam_language_tour.md # Gleam 언어 레퍼런스
|
|
164
|
+
glendix_guide.md # glendix 사용 가이드
|
|
170
165
|
\`\`\`
|
|
171
166
|
|
|
167
|
+
React/Mendix FFI 바인딩은 이 프로젝트에 포함되지 않으며, [glendix](https://hexdocs.pm/glendix/) Hex 패키지로 제공된다.
|
|
168
|
+
|
|
172
169
|
## Build Pipeline
|
|
173
170
|
|
|
174
171
|
\`\`\`
|
|
175
|
-
[src/widget/*.gleam] + [
|
|
172
|
+
[src/widget/*.gleam] + [glendix 패키지 (Hex)]
|
|
176
173
|
↓ gleam run -m scripts/build
|
|
177
174
|
[build/dev/javascript/${names.snakeCase}/widget/*.mjs]
|
|
175
|
+
[build/dev/javascript/glendix/glendix/*.mjs]
|
|
178
176
|
↓ src/${names.pascalCase}.js (브릿지)가 import
|
|
179
177
|
↓ Rollup (pluggable-widgets-tools build:web)
|
|
180
178
|
[dist/1.0.0/mendix.${names.lowerCase}.${names.pascalCase}.mpk]
|
|
@@ -195,42 +193,50 @@ gleam test # Gleam 테스트 실행
|
|
|
195
193
|
gleam format # Gleam 코드 포맷팅
|
|
196
194
|
\`\`\`
|
|
197
195
|
|
|
198
|
-
##
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
- \`
|
|
212
|
-
- \`
|
|
213
|
-
- \`
|
|
214
|
-
- \`
|
|
215
|
-
- \`
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
- \`mendix
|
|
219
|
-
- \`mendix/
|
|
220
|
-
- \`mendix/
|
|
221
|
-
- \`mendix/
|
|
222
|
-
- \`mendix/
|
|
196
|
+
## glendix Guide
|
|
197
|
+
|
|
198
|
+
\`docs/glendix_guide.md\` 파일에 glendix 패키지의 사용법이 수록되어 있다. 주요 내용:
|
|
199
|
+
- 프로젝트 설정 및 첫 번째 위젯 만들기
|
|
200
|
+
- 핵심 개념: opaque 타입, undefined ↔ Option 변환, 파이프라인 API
|
|
201
|
+
- React 바인딩: 엘리먼트 생성, Props 빌더, HTML 태그 함수, Hooks, 이벤트 처리, 조건부/리스트 렌더링, 스타일
|
|
202
|
+
- Mendix 바인딩: Props 접근, ValueStatus, EditableValue, ActionValue, DynamicValue, ListValue, ListAttribute, Selection, Reference, Filter, JsDate, Big 등
|
|
203
|
+
- 실전 패턴: 폼 입력 위젯, 데이터 테이블, 검색 가능 리스트, 컴포넌트 합성
|
|
204
|
+
- 트러블슈팅
|
|
205
|
+
|
|
206
|
+
## glendix Modules
|
|
207
|
+
|
|
208
|
+
React:
|
|
209
|
+
- \`glendix/react\` — 핵심 타입 + createElement + fragment/text/none + 조건부 렌더링
|
|
210
|
+
- \`glendix/react/prop\` — Props 파이프라인 빌더
|
|
211
|
+
- \`glendix/react/hook\` — React Hooks (useState, useEffect 등)
|
|
212
|
+
- \`glendix/react/event\` — 이벤트 타입 + 값 추출
|
|
213
|
+
- \`glendix/react/html\` — HTML 태그 편의 함수
|
|
214
|
+
|
|
215
|
+
Mendix:
|
|
216
|
+
- \`glendix/mendix\` — \`ValueStatus\`, \`ObjectItem\`, Props 접근자
|
|
217
|
+
- \`glendix/mendix/editable_value\` — 편집 가능한 값
|
|
218
|
+
- \`glendix/mendix/action\` — 액션 실행
|
|
219
|
+
- \`glendix/mendix/dynamic_value\` — 동적 읽기 전용 값
|
|
220
|
+
- \`glendix/mendix/list_value\` — 리스트 데이터 + 정렬/필터
|
|
221
|
+
- \`glendix/mendix/list_attribute\` — 리스트 아이템별 접근
|
|
222
|
+
- \`glendix/mendix/selection\` — 단일/다중 선택
|
|
223
|
+
- \`glendix/mendix/reference\` — 참조 관계 값
|
|
224
|
+
- \`glendix/mendix/date\` — JS Date 래퍼
|
|
225
|
+
- \`glendix/mendix/big\` — Big.js 고정밀 십진수 래퍼
|
|
226
|
+
- \`glendix/mendix/file\` — 파일/이미지
|
|
227
|
+
- \`glendix/mendix/icon\` — 아이콘
|
|
228
|
+
- \`glendix/mendix/formatter\` — 값 포맷팅/파싱
|
|
229
|
+
- \`glendix/mendix/filter\` — 필터 조건 빌더
|
|
223
230
|
|
|
224
231
|
## Mendix Widget Conventions
|
|
225
232
|
|
|
226
233
|
- 위젯 ID: \`mendix.${names.lowerCase}.${names.pascalCase}\`
|
|
227
|
-
- JSX 파일을 작성하지 않는다. 모든 React 로직은 Gleam +
|
|
228
|
-
-
|
|
234
|
+
- JSX 파일을 작성하지 않는다. 모든 React 로직은 Gleam + glendix로 구현
|
|
235
|
+
- 위젯 프로젝트에 FFI 파일을 직접 작성하지 않는다 — React/Mendix FFI는 glendix가 제공
|
|
229
236
|
|
|
230
237
|
## Code Style
|
|
231
238
|
|
|
232
239
|
- Gleam 파일: \`gleam format\` 사용
|
|
233
|
-
- FFI 파일(\`react_ffi.mjs\`, \`mendix_ffi.mjs\`): API 노출만 담당, 비즈니스 로직 금지
|
|
234
240
|
- 한국어 주석 사용
|
|
235
241
|
`;
|
|
236
242
|
|
|
@@ -291,22 +297,20 @@ gleam format # 코드 포맷팅
|
|
|
291
297
|
|
|
292
298
|
\`\`\`
|
|
293
299
|
src/
|
|
294
|
-
widget/ #
|
|
300
|
+
widget/ # 위젯 고유 코드
|
|
295
301
|
${names.snakeCase}.gleam # 메인 위젯 모듈
|
|
296
|
-
react_ffi.mjs # React FFI 어댑터
|
|
297
|
-
mendix_ffi.mjs # Mendix FFI 어댑터
|
|
298
|
-
react.gleam + react/ # React 모듈 계층
|
|
299
|
-
mendix.gleam + mendix/ # Mendix API 모듈 계층
|
|
300
302
|
editor_config.gleam # Studio Pro 속성 패널
|
|
301
303
|
scripts/ # 빌드/개발 스크립트
|
|
302
304
|
${names.pascalCase}.js # Mendix 브릿지 진입점
|
|
303
305
|
${names.pascalCase}.xml # 위젯 속성 정의
|
|
304
306
|
\`\`\`
|
|
305
307
|
|
|
308
|
+
React/Mendix FFI 바인딩은 [glendix](https://hexdocs.pm/glendix/) Hex 패키지로 제공됩니다.
|
|
309
|
+
|
|
306
310
|
## 기술 스택
|
|
307
311
|
|
|
308
312
|
- **Gleam** → JavaScript 컴파일
|
|
309
|
-
- **
|
|
313
|
+
- **[glendix](https://hexdocs.pm/glendix/)** — React + Mendix API Gleam 바인딩
|
|
310
314
|
- **Mendix Pluggable Widget** (React 19)
|
|
311
315
|
- **${pm}** — 패키지 매니저
|
|
312
316
|
|