Skip to content

Commit 0ea447e

Browse files
committed
✨ feat: im ready
1 parent b425abc commit 0ea447e

File tree

7 files changed

+86
-92
lines changed

7 files changed

+86
-92
lines changed

.publish/releases/0.3.0.md

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,26 @@
1-
# 0.2.0 - XXXXXXXXXXXXXXXXXXXXXXXXXXXX
1+
# 0.3.0 - 游乐园
22

3-
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3+
> “很简单呀,只要我想象着冰淇凌在我手里就好了呀。”爱丽丝边舔冰淇凌边说,“不过…… 之后就会逐渐变得很累,会困得直接睡着。而且只有清楚记得细节的东西才可以,逃出来的时候,我想要变出一顶帽子遮住自己的脸,却变出了一只吞掉大象的蛇,可怕。”
44
5-
## 客户端包现在基于 Fetch
6-
7-
客户端包现在会默认使用 Fetch。以前,你需要手动通过 `handler` 告诉客户端包如何发送请求,如何存储数据:
5+
## 全新的创建工具
86

9-
```ts
10-
import { createClient } from "client";
7+
现在,Milkio 提供了一个工具,来帮助你方便地创建新工程。
118

12-
export const client = createClient({
13-
baseUrl: "http://localhost:9000/",
14-
storage: localStorage,
15-
async handler(url, body, headers) {
16-
return await (await fetch(url, { method: "POST", body, headers })).text();
17-
},
18-
});
9+
```bash
10+
bun create milkio
1911
```
2012

21-
现在,默认情况下,客户端包会使用 Fetch 来发送请求,并使用 `localStorage` 来存储数据
13+
只要运行命令并回答一系列问题,你就可以得到一个全新的 Milkio 工程
2214

23-
```ts
24-
import { createClient } from "client";
15+
## Windows 支持
2516

26-
export const client = createClient({
27-
baseUrl: "http://localhost:9000/",
28-
});
29-
```
17+
Bun 已经完成了对 Windows 平台的正式支持,经过一系列的调整,现在 Milkio 也支持在 Windows 平台上使用了。
3018

31-
某些环境下,或许缺少一些,你可以提供 `storage``fetch``abort` 这些的 polyfill。其中对于 `storage`,是支持异步的。
19+
## 对 Stream API (Server-Sent Events) 的支持
3220

33-
## 对 Server-Sent Events 的初步支持
21+
文档:[VS Code Menubar](https://milkio.fun/essentials/stream)
3422

35-
现在 Milkio 初步支持 Server-Sent Events 了,当你的应用包括和大语言模型聊天,或者当他人评论你的博客时需要实时提醒时,这将很有用。
23+
现在 Milkio 支持了以流的方式发送 API 响应。当你的应用包括和大语言模型聊天,或者当他人评论你的博客时需要实时提醒时,这将很有用。
3624

3725
```ts
3826
export const api = defineApi({
@@ -44,27 +32,33 @@ export const api = defineApi({
4432
});
4533
```
4634

47-
## 全新的创建工具
48-
49-
现在,Milkio 提供了一个工具,来帮助你方便地创建新工程。
35+
## 客户端包现在基于 Fetch
5036

51-
```bash
52-
bun create milkio
53-
```
37+
客户端包现在会默认使用 Fetch。以前,你需要手动通过 `handler` 告诉客户端包如何发送请求,如何存储数据:
5438

55-
只要运行命令并回答一系列问题,你就可以得到一个全新的 Milkio 工程。
39+
```ts
40+
import { createClient } from "client";
5641

57-
## Windows 支持
42+
export const client = createClient({
43+
baseUrl: "http://localhost:9000/",
44+
storage: localStorage,
45+
async handler(url, body, headers) {
46+
return await (await fetch(url, { method: "POST", body, headers })).text();
47+
},
48+
});
49+
```
5850

59-
Bun 已经完成了对 Windows 平台的正式支持,经过一系列的调整,现在 Milkio 也支持在 Windows 平台上使用了
51+
现在,默认情况下,客户端包会使用 Fetch 来发送请求,并使用 `localStorage` 来存储数据
6052

61-
## 支持在 TypeScript 中使用 `import.meta.env`
53+
```ts
54+
import { createClient } from "client";
6255

63-
现在,在 TypeScript 中,你可以使用 `import.meta.env` 来获取环境变量了。
56+
export const client = createClient({
57+
baseUrl: "http://localhost:9000/",
58+
});
59+
```
6460

65-
```ts
66-
67-
`
61+
某些环境下,或许缺少一些所需的对象,你可以在选项中提供 `storage``fetch``abort` 这些的 polyfill。其中对于 `storage`,甚至支持异步的。
6862

6963
## 静态服务器
7064

generated/api-schema.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@
33
*/
44

55
// api
6-
import type * as foo from '../src/apps/foo'
7-
import type * as test from '../src/apps/test'
86
import type * as cookbook from '../src/apps/cookbook'
7+
import type * as test from '../src/apps/test'
8+
import type * as foo from '../src/apps/foo'
99

1010
import _apiValidator from './products/api-validator.ts'
1111

1212
export default {
1313
apiValidator: _apiValidator,
1414
apiMethodsSchema: {
15-
'foo': () => ({ module: import('../src/apps/foo') }),
16-
'test': () => ({ module: import('../src/apps/test') }),
1715
'cookbook': () => ({ module: import('../src/apps/cookbook') }),
16+
'test': () => ({ module: import('../src/apps/test') }),
17+
'foo': () => ({ module: import('../src/apps/foo') }),
1818

1919
},
2020
apiMethodsTypeSchema: {
21-
'foo': undefined as unknown as typeof foo,
22-
'test': undefined as unknown as typeof test,
2321
'cookbook': undefined as unknown as typeof cookbook,
22+
'test': undefined as unknown as typeof test,
23+
'foo': undefined as unknown as typeof foo,
2424

2525
},
2626
apiTestsSchema: {
27-
'foo': () => ({ module: import('../src/apps/foo') }),
2827
'test': () => ({ module: import('../src/apps/test') }),
28+
'foo': () => ({ module: import('../src/apps/foo') }),
2929

3030
},
3131
}

generated/cookbook.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"cookbook":{"foo":{"params":"{ sad: string }","cases":[{"name":"Basic","handler":"\t\t\tconst result = await test.execute(await test.randParams());\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"}]},"cookbook":{"params":"string & typia.tags.MinLength<3> & typia.tags.MaxLength<16>","cases":[]},"test":{"title":"test","desc":"\ntest","params":"undefined","cases":[{"name":"Basic","handler":"\t\t\tconst result = await test.execute(await test.randParams());\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"}]}},"readme":"# 你好世界\n\nHello world\n\n```sh\n世界你好 # enenen\n```\n\n","indexes":{"(root)":["foo","cookbook","test"]},"folderIndexes":{"(root)":[]},"generatedAt":"t!Date:2024-05-29T14:58:02.970Z"}
1+
{"cookbook":{"cookbook":{"params":"string & typia.tags.MinLength<3> & typia.tags.MaxLength<16>","cases":[]},"test":{"title":"test","desc":"\ntest","params":"undefined","cases":[{"name":"Basic","handler":"\t\t\tconst result = await test.execute(await test.randParams());\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"}]},"foo":{"params":"{ sad: string }","cases":[{"name":"Basic","handler":"\t\t\tconst result = await test.execute(await test.randParams());\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"}]}},"readme":"# 你好世界\n\nHello world\n\n```sh\n世界你好 # enenen\n```\n\n","indexes":{"(root)":["cookbook","test","foo"]},"folderIndexes":{"(root)":[]},"generatedAt":"t!Date:2024-05-29T15:02:38.325Z"}

generated/products/api-validator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* ⚠️This file is generated and modifications will be overwritten
33
*/
44
export default {
5-
generatedAt: 1716994684126,
5+
generatedAt: 1716994957461,
66
validate: {
7-
'foo': () => import('./apps/foo.ts'),
8-
'test': () => import('./apps/test.ts'),
97
'cookbook': () => import('./apps/cookbook.ts'),
8+
'test': () => import('./apps/test.ts'),
9+
'foo': () => import('./apps/foo.ts'),
1010
},
1111
};

0 commit comments

Comments
 (0)