@@ -7,3 +7,79 @@ Hilla 是一个用于 Java 的全栈 Web 框架。
7
7
8
8
[ 官方网站] ( https://hilla.dev/ )
9
9
:::
10
+
11
+ ## 快速上手
12
+
13
+ ### 系统环境
14
+
15
+ 除了常用的设备和工具外,只需要两件基本的东西:
16
+
17
+ - [ Node.js] ( https://nodejs.org/ ) 18.0 或更高版本。
18
+ - [ JDK] ( https://adoptium.net/zh-CN/ ) 17 或更高版本。
19
+
20
+ ### 使用 Spring initializr 创建项目
21
+
22
+ 前往 https://start.spring.io/ 或使用 IDEA 创建 Spring 项目。
23
+ 创建项目时注意:
24
+
25
+ - Project(项目类型):Gradle - Kotlin
26
+ - Language(项目语言):Kotlin
27
+ - Project Metadata:按需自定。
28
+ - Dependencies(项目依赖):
29
+ + [ Spring Boot DevTools] ( https://springdoc.cn/spring-boot/using.html#using.devtools )
30
+ + Spring Configuration Processor
31
+ + Hilla
32
+ + ...以及其他你需要的依赖项;
33
+
34
+ > 选用 Hilla 时通常无需依赖 Spring Web;
35
+ > 也无需依赖 Spring Reactive Web([ Vaadin Flow] ( https://vaadin.com/docs/latest/guide/quick-start ) 了解一下?
36
+
37
+ ### 使用 Hilla CLI 创建项目
38
+
39
+ > 使用 Hilla CLI 创建的项目默认使用 [ Maven] 构建,如果想使用 [ Gradle] 构建,请直接使用 Spring initializr 创建项目
40
+
41
+ 在终端执行以下命令,使用 Hilla CLI 创建新项目:
42
+
43
+ ``` sh
44
+ npx @hilla/cli init my-hilla-app
45
+ ```
46
+
47
+ 默认会创建 [ React] 应用,如果想使用 [ Lit] 的话,需要加上 ` --lit ` 选项:
48
+
49
+ ``` sh
50
+ npx @hilla/cli init --lit my-hilla-app
51
+ ```
52
+
53
+ 也可以加上 ` --auth ` 选项来创建具有基本 [ 安全配置] ( https://hilla.dev/docs/lit/guides/security/configuring ) 的项目:
54
+
55
+ ``` sh
56
+ npx @hilla/cli init --lit --auth hilla-with-auth
57
+ ```
58
+
59
+ #### Hilla CLI 帮助
60
+
61
+ ``` text {1}
62
+ $ npx @hilla/cli init -h
63
+ 用法: hilla-init [options] <projectName>
64
+
65
+ 选项:
66
+ --empty 创建一个没有菜单和一个空视图的项目
67
+ --react UI 使用 React(默认)
68
+ --lit UI 使用 Lit
69
+ --latest 使用最新的主要版本(默认)
70
+ --pre 使用最新的预发布版本(如果可用)
71
+ --next 使用下一个主要版本的预发布版本(如果可用)
72
+ --auth 向应用程序添加身份验证支持
73
+ --push 向应用程序添加推送支持/响应端点
74
+ --git 初始化项目的 Git 仓库并提交初始文件
75
+ --preset <preset> 使用碰巧知道存在的给定预设
76
+ --server <server> 仅用于内部测试
77
+ -h, --help 显示命令帮助
78
+ ```
79
+
80
+ [ Gradle ] : /docs/开发/工具/Gradle/
81
+ [ Maven ] : /docs/开发/工具/Maven/
82
+ [ Kotlin ] : /docs/开发/语言/Kotlin/
83
+ [ SpringBoot ] : /docs/开发/框架/Spring/Boot/
84
+ [ React ] : /docs/开发/框架/React/
85
+ [ Lit ] : /docs/开发/框架/Lit/
0 commit comments