esa-cli 0.0.2-beta.9 → 1.0.0

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 (85) hide show
  1. package/README.md +32 -149
  2. package/dist/commands/commit/index.js +49 -104
  3. package/dist/commands/commit/prodBuild.js +2 -3
  4. package/dist/commands/common/constant.js +4 -4
  5. package/dist/commands/common/utils.js +419 -0
  6. package/dist/commands/config.js +2 -2
  7. package/dist/commands/deploy/helper.js +51 -54
  8. package/dist/commands/deploy/index.js +51 -174
  9. package/dist/commands/deployments/delete.js +32 -22
  10. package/dist/commands/deployments/index.js +4 -4
  11. package/dist/commands/deployments/list.js +21 -34
  12. package/dist/commands/dev/build.js +3 -3
  13. package/dist/commands/dev/doProcess.js +5 -5
  14. package/dist/commands/dev/ew2/cacheService.js +33 -0
  15. package/dist/commands/dev/ew2/devEntry.js +2 -1
  16. package/dist/commands/dev/ew2/devPack.js +31 -20
  17. package/dist/commands/dev/ew2/kvService.js +50 -0
  18. package/dist/commands/dev/ew2/mock/cache.js +99 -15
  19. package/dist/commands/dev/ew2/mock/kv.js +142 -21
  20. package/dist/commands/dev/ew2/server.js +165 -29
  21. package/dist/commands/dev/index.js +17 -18
  22. package/dist/commands/dev/mockWorker/devPack.js +19 -10
  23. package/dist/commands/dev/mockWorker/server.js +7 -6
  24. package/dist/commands/domain/add.js +4 -4
  25. package/dist/commands/domain/delete.js +7 -7
  26. package/dist/commands/domain/index.js +4 -4
  27. package/dist/commands/domain/list.js +10 -10
  28. package/dist/commands/init/helper.js +654 -20
  29. package/dist/commands/init/index.js +88 -152
  30. package/dist/commands/init/snippets/nextjs/next.config.mjs +6 -0
  31. package/dist/commands/init/snippets/nextjs/next.config.ts +7 -0
  32. package/dist/commands/init/snippets/react-router/react-router.config.ts +7 -0
  33. package/dist/commands/init/template.jsonc +84 -0
  34. package/dist/commands/init/types.js +1 -0
  35. package/dist/commands/lang.js +2 -2
  36. package/dist/commands/login/index.js +74 -34
  37. package/dist/commands/logout.js +6 -6
  38. package/dist/commands/route/add.js +105 -49
  39. package/dist/commands/route/delete.js +33 -27
  40. package/dist/commands/route/helper.js +123 -0
  41. package/dist/commands/route/index.js +4 -4
  42. package/dist/commands/route/list.js +56 -17
  43. package/dist/commands/routine/delete.js +9 -8
  44. package/dist/commands/routine/index.js +6 -5
  45. package/dist/commands/routine/list.js +45 -39
  46. package/dist/commands/site/index.js +3 -3
  47. package/dist/commands/site/list.js +6 -7
  48. package/dist/commands/utils.js +61 -25
  49. package/dist/components/descriptionInput.js +1 -1
  50. package/dist/components/filterSelector.js +1 -1
  51. package/dist/components/mutiLevelSelect.js +19 -20
  52. package/dist/components/mutiSelectTable.js +1 -1
  53. package/dist/components/routeBuilder.js +68 -0
  54. package/dist/components/selectInput.js +2 -3
  55. package/dist/components/selectItem.js +1 -1
  56. package/dist/docs/Commands_en.md +164 -117
  57. package/dist/docs/Commands_zh_CN.md +155 -107
  58. package/dist/docs/Config_en.md +70 -0
  59. package/dist/docs/Config_zh_CN.md +68 -0
  60. package/dist/i18n/index.js +2 -2
  61. package/dist/i18n/locales.json +447 -71
  62. package/dist/index.js +28 -13
  63. package/dist/libs/api.js +32 -9
  64. package/dist/libs/apiService.js +294 -73
  65. package/dist/libs/git/index.js +86 -9
  66. package/dist/libs/interface.js +0 -1
  67. package/dist/libs/logger.js +162 -10
  68. package/dist/libs/service.js +2 -2
  69. package/dist/libs/templates/index.js +1 -1
  70. package/dist/utils/checkAssetsExist.js +80 -0
  71. package/dist/utils/checkDevPort.js +5 -19
  72. package/dist/utils/checkEntryFileExist.js +10 -0
  73. package/dist/utils/checkIsRoutineCreated.js +27 -21
  74. package/dist/utils/checkVersion.js +119 -1
  75. package/dist/utils/command.js +149 -0
  76. package/dist/utils/compress.js +142 -0
  77. package/dist/utils/download.js +8 -8
  78. package/dist/utils/fileMd5.js +1 -1
  79. package/dist/utils/fileUtils/index.js +136 -45
  80. package/dist/utils/installDeno.js +4 -4
  81. package/dist/utils/installEw2.js +9 -9
  82. package/dist/utils/openInBrowser.js +1 -1
  83. package/dist/utils/prompt.js +97 -0
  84. package/package.json +24 -13
  85. package/zh_CN.md +29 -154
@@ -1,224 +1,272 @@
1
- # Commands
1
+ ## 命令一览
2
2
 
3
- ### init
3
+ ### esa-cli init [name]
4
4
 
5
- 选择模版初始化项目。
5
+ 初始化一个函数和Pages项目(支持框架或模板)。
6
6
 
7
7
  ```bash
8
- $ esa init [OPTIONS]
8
+ esa-cli init [name]
9
9
  ```
10
10
 
11
- - -c, --config `boolean` `optional`
12
- - 在您的项目中生成一个esa.toml配置文件。
11
+ - 位置参数:
12
+ - name:项目名
13
13
 
14
- ### routine [script]
14
+ - 选项:
15
+ - -f, --framework string:选择前端框架(react/vue/nextjs...)
16
+ - -l, --language string:选择语言(typescript/javascript)。可选:typescript | javascript
17
+ - -t, --template string:指定模板名称
18
+ - -y, --yes boolean:对所有交互询问选择“是”(默认 false),模版采用helloworld
19
+ - --git boolean:在项目中初始化 git
20
+ - --deploy boolean:初始化完成后自动部署
15
21
 
16
- 管理边缘函数。
22
+ ---
17
23
 
18
- #### delete <routineName>
24
+ ### esa-cli dev [entry]
19
25
 
20
- 删除一个边缘函数。
26
+ 启动本地开发服务器。
21
27
 
22
28
  ```bash
23
- $ esa routine delete <routineName>
29
+ esa-cli dev [entry]
24
30
  ```
25
31
 
26
- - routineName `string` `required`
27
- - 要删除的边缘函数名称。
32
+ - 位置参数:
33
+ - entry:函数和Pages入口文件
28
34
 
29
- #### list
35
+ - 选项:
36
+ - -p, --port number:监听端口
37
+ - -m, --minify boolean:开发模式下压缩代码(默认 false)
38
+ - --refresh-command string:保存自动刷新前执行的命令
39
+ - --local-upstream string:在本地开发中作为源站的主机
40
+ - --debug boolean:输出调试日志(默认 false)
30
41
 
31
- 查看所有边缘函数。
42
+ ---
43
+
44
+ ### esa-cli commit [entry]
45
+
46
+ 提交代码并保存为新版本。
32
47
 
33
48
  ```bash
34
- $ esa routine list
49
+ esa-cli commit [entry]
35
50
  ```
36
51
 
37
- ### route [script]
52
+ - 选项:
53
+ - -m, --minify boolean:提交前压缩代码(默认 false)
54
+ - -a, --assets string:静态资源目录
55
+ - -d, --description string:版本/例程描述(跳过交互输入)
56
+ - -n, --name string:函数和Pages名称
38
57
 
39
- 管理绑定到边缘函数的路由。
58
+ ---
40
59
 
41
- #### add [route] [site]
60
+ ### esa-cli deploy [entry]
42
61
 
43
- 将路由绑定到边缘函数。
62
+ 生成一个代码版本,并同时部署项目到仿真和线上环境
44
63
 
45
64
  ```bash
46
- $ esa route add [route] [site]
65
+ esa-cli deploy [entry]
47
66
  ```
48
67
 
49
- #### delete <route>
68
+ - 选项:
69
+ - entry 可选参数,默认以 `esa.jsonc`中entry配置为准
70
+ - -v, --version string:指定要部署的版本(跳过交互选择)
71
+ - -e, --environment string:部署环境。可选:staging | production
72
+ - -n, --name string:函数和Pages名称
73
+ - -a, --assets string:静态资源目录(例如:./dist)
74
+ - -d, --description string:版本描述
75
+ - -m, --minify boolean:是否压缩代码
76
+
77
+ ---
50
78
 
51
- 删除一个绑定路由。
79
+ ### esa-cli deployments list
80
+
81
+ 列出当前函数和Pages下所有代码版本。
52
82
 
53
83
  ```bash
54
- $ esa route delete <route>
84
+ esa-cli deployments list
55
85
  ```
56
86
 
57
- - route `string` `required`
58
- - 要删除的路由名称。
87
+ 无额外选项。
88
+
89
+ ---
59
90
 
60
- #### list
91
+ ### esa-cli deployments delete [deploymentId...]
61
92
 
62
- 查看所有绑定路由。
93
+ 删除当前函数和Pages的一个或多个代码版本。
63
94
 
64
95
  ```bash
65
- $ esa route list
96
+ esa-cli deployments delete [deploymentId...]
66
97
  ```
67
98
 
68
- ### login
69
-
70
- 登录。
99
+ - 位置参数:
100
+ - deploymentId...:要删除的部署版本ID(可一次传多个)
71
101
 
72
- ```bash
73
- $ esa login
74
- ```
102
+ ---
75
103
 
76
- ### dev [entry]
104
+ ### esa-cli project list
77
105
 
78
- 启动本地调试。
106
+ 列出账号下所有的函数和Pages。
79
107
 
80
108
  ```bash
81
- $ esa dev [entry] [OPTIONS]
109
+ esa-cli project list
82
110
  ```
83
111
 
84
- - entry `string` `optional`
85
- - 入口文件路径。
112
+ 无额外选项。
86
113
 
87
- - -port, --p `number` `optional`
88
- - 监听端口。
114
+ ---
89
115
 
90
- - --inspect-port `number` `optional`
91
- - 用于 Chrome inspect 调试工具的端口。
116
+ ### esa-cli project delete <projectName>
92
117
 
93
- - -minify, --m `boolean` `optional`
94
- - 开发打包时压缩代码。
118
+ 删除指定函数和Pages。
119
+
120
+ ```bash
121
+ esa-cli project delete <projectName>
122
+ ```
95
123
 
96
- - --local-upstream `string` `optional`
97
- - 在开发时作为源站的域名。
124
+ - 位置参数:
125
+ - projectName:要删除的函数或Pages名称
98
126
 
99
- - --refresh-command `string` `optional`
100
- - 提供一个在保存自动刷新前执行的命令。
127
+ ---
101
128
 
102
- ### deploy [entry]
129
+ ### esa-cli site list
103
130
 
104
- 部署您的项目。
131
+ 列出账号下所有已激活站点。
105
132
 
106
133
  ```bash
107
- $ esa deploy [entry]
134
+ esa-cli site list
108
135
  ```
109
136
 
110
- - entry `string` `optional`
111
- - 入口文件路径。
137
+ 无额外选项。
112
138
 
113
- ### domain [script]
139
+ ---
114
140
 
115
- 管理绑定到边缘函数的域名。
141
+ ### esa-cli domain add <domain>
116
142
 
117
- #### add <domain>
118
-
119
- 绑定域名到边缘函数。
143
+ 绑定域名到当前函数和Pages。
120
144
 
121
145
  ```bash
122
- $ esa domain add <domain>
146
+ esa-cli domain add <domain>
123
147
  ```
124
148
 
125
- - domain `string` `required`
126
- - 需要添加的域名。
149
+ - 位置参数:
150
+ - domain:要绑定的域名
151
+
152
+ ---
127
153
 
128
- #### delete <domain>
154
+ ### esa-cli domain list
129
155
 
130
- 删除一个绑定域名。
156
+ 查看当前函数和Pages所有已绑定域名。
131
157
 
132
158
  ```bash
133
- $ esa domain delete <domain>
159
+ esa-cli domain list
134
160
  ```
135
161
 
136
- - domains `string` `required`
137
- - 要删除的绑定域名。
162
+ 无额外选项。
163
+
164
+ ---
138
165
 
139
- #### list
166
+ ### esa-cli domain delete <domain>
140
167
 
141
- 查看所有绑定域名。
168
+ 删除当前函数和Pages下已绑定域名。
142
169
 
143
170
  ```bash
144
- $ esa domain list
171
+ esa-cli domain delete <domain>
145
172
  ```
146
173
 
147
- ### deployments [script]
174
+ - 位置参数:
175
+ - domain:要删除绑定的域名
148
176
 
149
- 管理您的部署。
177
+ ---
150
178
 
151
- #### delete <deploymentId>
179
+ #### esa-cli route add
152
180
 
153
- 删除一个部署版本。
181
+ 为当前函数和Pages绑定一个路由。
154
182
 
155
183
  ```bash
156
- $ esa deployments delete <deploymentId>
184
+ esa-cli route add [route] [site] [--alias <routeName>] [--route <route>] [--site <site>]
157
185
  ```
158
186
 
159
- - deploymentId `string` `required`
160
- - 要删除的部署版本ID。
187
+ - 位置参数(可选):
188
+ - route:路由值,例如:example.com/_ 或 _.example.com/\*
189
+ - site:站点名称,例如:example.com
161
190
 
162
- #### list
191
+ - 选项:
192
+ - -r, --route string:路由值,例如:example.com/\*
193
+ - 主机名支持以 `*` 开头表示后缀匹配(如:`*.example.com`)
194
+ - 路径支持以 `*` 结尾表示前缀匹配(如:`/api/*`)
195
+ - -s, --site string:站点名称(需为已激活站点)
196
+ - -a, --alias string:路由名称(别名) 例如:apple、orange等
163
197
 
164
- 查看所有部署。
198
+ ---
199
+
200
+ ### esa-cli route list
201
+
202
+ 查看函数和Pages所有已绑定路由。
165
203
 
166
204
  ```bash
167
- $ esa deployments list
205
+ esa-cli route list
168
206
  ```
169
207
 
170
- ### commit [entry]
208
+ 无额外选项。
209
+
210
+ ---
171
211
 
172
- 提交代码,保存为一个版本。
212
+ ### esa-cli route delete <routeName>
213
+
214
+ 删除函数和Pages下已绑定路由。
173
215
 
174
216
  ```bash
175
- $ esa commit [entry] [OPTIONS]
217
+ esa-cli route delete <routeName>
176
218
  ```
177
219
 
178
- - entry `string` `optional`
179
- - 入口文件路径。
220
+ - 位置参数:
221
+ - routeName:要删除的路由名称
180
222
 
181
- - -m, --minify `boolean` `optional`
182
- - 上传前压缩代码。
223
+ ---
183
224
 
184
- ### logout
225
+ ### esa-cli login
185
226
 
186
- 注销登录。
227
+ 登录。
187
228
 
188
229
  ```bash
189
- $ esa logout
230
+ esa-cli login
190
231
  ```
191
232
 
192
- ### config
233
+ - 选项:
234
+ - --access-key-id, --ak string:AccessKey ID (AK)
235
+ - --access-key-secret, --sk string:AccessKey Secret (SK)
236
+ - 从环境变量中读取process.env
237
+ - ESA_ACCESS_KEY_ID
238
+ - ESA_ACCESS_KEY_SECRET
239
+
240
+ ---
193
241
 
194
- 使用 -l 或 -g 修改本地或全局配置。
242
+ ### esa-cli logout
243
+
244
+ 退出登录。
195
245
 
196
246
  ```bash
197
- $ esa config [OPTIONS]
247
+ esa-cli logout
198
248
  ```
199
249
 
200
- - -g, --global `boolean` `optional`
201
- - 编辑全局配置文件。
202
-
203
- - -l, --local `boolean` `optional`
204
- - 编辑本地配置文件。
250
+ ---
205
251
 
206
- ### lang
252
+ ### esa-cli config [-l | -g]
207
253
 
208
- 选择语言。
254
+ 修改本地或全局配置。
209
255
 
210
256
  ```bash
211
- $ esa lang
257
+ esa-cli config [--local] [--global]
212
258
  ```
213
259
 
214
- ### site [script]
260
+ - 选项:
261
+ - -l, --local boolean:编辑本地配置文件(默认 false)
262
+ - -g, --global boolean:编辑全局配置文件(默认 false)
215
263
 
216
- 管理站点。
264
+ ---
217
265
 
218
- #### list
266
+ ### esa-cli lang
219
267
 
220
- 列出站点。
268
+ 设置 CLI 语言。
221
269
 
222
270
  ```bash
223
- $ esa site list
271
+ esa-cli lang
224
272
  ```
@@ -0,0 +1,70 @@
1
+ ## ESA Configuration Guide
2
+
3
+ This document describes the structure, parameters, and example of the ESA (Edge Security Acceleration) project configuration file `esa.jsonc`, helping developers configure and manage ESA projects efficiently.
4
+
5
+ ## Project configuration file (esa.jsonc)
6
+
7
+ `esa.jsonc` is the core configuration file of an ESA project. It defines the project name, description, dynamic function entry, static asset hosting strategy, and local development settings. Below are the details of each field.
8
+
9
+ ### Parameter description
10
+
11
+ | **Parameter** | **Description** |
12
+ | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
13
+ | **name** | Target project name. If it exists, deployment goes into it; otherwise, a new project is created. |
14
+ | **description** | Project description. Optional, used to briefly document the purpose or functionality. |
15
+ | **entry** | Dynamic function entry file path, e.g.,`./src/index.ts`. Optional, set only when using a function. |
16
+ | **assets** | Static asset hosting configuration (each Pages project supports only one set of static assets). Includes `directory` and `notFoundStrategy`. |
17
+ | **dev** | Local development configuration. Optional; used to set dev server port and proxy. |
18
+
19
+ #### Field structure
20
+
21
+ - **name**: `string`
22
+ - Project name. Required.
23
+ - **description**: `string`
24
+ - Project description. Optional.
25
+ - **entry**: `string`
26
+ - Dynamic function entry file path, e.g., `./src/index.ts`. Optional.
27
+ - **assets**: `object`
28
+ - Static asset hosting settings. Optional. Includes:
29
+ - **directory**: `string`
30
+ - Build output directory, e.g., `./public`, `./dist`, or `./build`. The directory to be hosted statically.
31
+ - **notFoundStrategy?**: `string`
32
+ - Strategy when a request does not match any static asset. Accepted values:
33
+ - `singlePageApplication`: Return `index.html` from the static directory with `200 OK` (suitable for SPAs).
34
+ - `404Page`: Return `404.html` from the static directory with `404 Not Found`.
35
+ - **dev**: `object`
36
+ - Local development settings. Optional. Includes:
37
+ - **port**: `number`
38
+ - Dev server port. Default: `18080`.
39
+ - **localUpstream**: `string`
40
+ - Local upstream proxy URL for development.
41
+
42
+ > Note: If both a function script and `assets.notFoundStrategy` are configured, navigation requests will not trigger the function script. A navigation request is sent when a user directly visits a page (e.g., entering a URL or clicking a link) and includes the header `Sec-Fetch-Mode: navigate`.
43
+
44
+ ### JSONC example
45
+
46
+ Below is a typical `esa.jsonc` example for a Vite + React single-page application:
47
+
48
+ ```jsonc
49
+ {
50
+ "name": "vite-react-template",
51
+ "assets": {
52
+ "directory": "./dist",
53
+ "notFoundStrategy": "singlePageApplication"
54
+ },
55
+ "dev": {
56
+ "port": 18080
57
+ }
58
+ }
59
+ ```
60
+
61
+ #### Example notes
62
+
63
+ - **name**: Sets the project name to `vite-react-template`.
64
+ - **assets.directory**: Static asset directory is `./dist` (typical Vite build output).
65
+ - **assets.notFoundStrategy**: `singlePageApplication` returns `index.html` when not matched (SPA-friendly).
66
+ - **dev.port**: Dev server runs on port `18080`.
67
+
68
+ ### Reference
69
+
70
+ - [Pages build and routing guide](https://help.aliyun.com/zh/edge-security-acceleration/esa/build-pages)
@@ -0,0 +1,68 @@
1
+ # ESA 配置文件说明
2
+
3
+ 本文档介绍 ESA(Edge Security Acceleration)项目的配置文件 `esa.jsonc` 的结构、参数说明及示例,旨在帮助开发者快速配置和管理 ESA 项目。
4
+
5
+ ## 项目配置文件(esa.jsonc)
6
+
7
+ `esa.jsonc` 是 ESA 项目的核心配置文件,用于定义项目的名称、描述、入口文件、静态资源托管方式以及本地开发工具的配置。以下是配置文件中各字段的详细说明。
8
+
9
+ ### 参数说明
10
+
11
+ | **参数** | **说明** |
12
+ | --------------- | ---------------------------------------------------------------------------------------------------- |
13
+ | **name** | 目标项目名称。若项目已存在,则部署到该项目;若不存在,则以此名称创建新项目。 |
14
+ | **description** | 项目描述,可选字段,用于简要说明项目功能或用途。 |
15
+ | **entry** | 动态函数入口文件路径,例如 `./src/index.ts`。可选字段,用于指定动态函数的入口。 |
16
+ | **assets** | 静态资源托管配置(每个 Pages 项目仅支持一组静态资源)。包含 `directory` 和 `notFoundStrategy` 字段。 |
17
+ | **dev** | 本地开发工具配置,可选字段,用于设置开发服务器端口和代理地址。 |
18
+
19
+ #### 字段结构
20
+
21
+ - **name**: `string`
22
+ - 项目名称,必填字段,用于标识项目。
23
+ - **description**: `string`
24
+ - 项目描述,可选字段,用于记录项目的功能或用途。
25
+ - **entry**: `string`
26
+ - 动态函数入口文件路径,例如 `./src/index.ts`。可选字段,仅在需要动态函数时配置。
27
+ - **assets?**: `object`
28
+ - 静态资源托管配置,可选字段,包含以下子字段:
29
+ - **directory**: `string`
30
+ - 构建输出目录,例如 `./public`、 `./dist` 或 `./build`。指定静态资源托管的目录。
31
+ - **notFoundStrategy**: `string`
32
+ - 当请求路径未匹配到静态资源时的处理策略,可选值:
33
+ - `singlePageApplication`: 返回静态目录中的 `index.html`,状态码为 `200 OK`(适用于单页应用)。
34
+ - `404Page`: 返回静态目录中的 `404.html`,状态码为 `404 Not Found`。
35
+ - **dev**: `object`
36
+ - 本地开发工具配置,可选字段,包含以下子字段:
37
+ - **port?**: `number`
38
+ - 开发服务器端口,默认值为 `18080`。
39
+ - **localUpstream?**: `string`
40
+ - 本地上游代理地址,用于本地开发时的代理设置。
41
+
42
+ ### JSONC 示例
43
+
44
+ 以下是一个典型的 `esa.jsonc` 配置文件示例,展示了如何配置一个基于 Vite 和 React 的单页应用项目:
45
+
46
+ ```jsonc
47
+ {
48
+ "name": "vite-react-template",
49
+ "assets": {
50
+ "directory": "./dist",
51
+ "notFoundStrategy": "singlePageApplication"
52
+ },
53
+ "dev": {
54
+ "port": 18080
55
+ }
56
+ }
57
+ ```
58
+
59
+ #### 示例说明
60
+
61
+ - **name**: 指定项目名称为 `vite-react-template`。
62
+ - **assets.directory**: 静态资源托管目录为 `./dist`,通常是 Vite 构建后的输出目录。
63
+ - **assets.notFoundStrategy**: 配置为 `singlePageApplication`,表示未找到资源时返回 `index.html`,适用于单页应用。
64
+ - **dev.port**: 本地开发服务器运行在端口 `18080`。
65
+
66
+ ### 相关文档
67
+
68
+ - [Pages 构建和路由指南](https://help.aliyun.com/zh/edge-security-acceleration/esa/build-pages)
@@ -1,8 +1,8 @@
1
1
  import { resolve } from 'path';
2
- import { getCliConfig } from '../utils/fileUtils/index.js';
3
2
  import logger from '../libs/logger.js';
4
- import { readJson } from '../utils/readJson.js';
5
3
  import { getDirName } from '../utils/fileUtils/base.js';
4
+ import { getCliConfig } from '../utils/fileUtils/index.js';
5
+ import { readJson } from '../utils/readJson.js';
6
6
  const localesJson = readJson(resolve(getDirName(import.meta.url), './locales.json'));
7
7
  const t = (key, variables) => {
8
8
  var _a;