Skip to content

Commit

Permalink
fix: fix causing a compilation error in Vite
Browse files Browse the repository at this point in the history
  • Loading branch information
eyelly-wu committed Oct 27, 2023
1 parent bacc370 commit 0858bbc
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 59 deletions.
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<p style="font-size: 18px;">Lightweight, simple, flexible, automatic translation internationalization tool for Solid</p>

English | [简体中文](https://github.com/i18n-pro/solid/blob/v1.0.0/README_zh-CN.md)
English | [简体中文](https://github.com/i18n-pro/solid/blob/v1.0.1/README_zh-CN.md)



Expand Down Expand Up @@ -100,16 +100,16 @@ render(

# Help Document

>To avoid unnecessary duplicate document content, some of the documents in this library are linked to the content in `i18n-pro` <br />The `i18n-pro` related link in the current document is based on the `2.0.0` version. If you are using a different version, you need to check the document corresponding to the version you are using to avoid inconsistent usage
>To avoid unnecessary duplicate document content, some of the documents in this library are linked to the content in `i18n-pro` <br />The `i18n-pro` related link in the current document is based on the `2.1.0` version. If you are using a different version, you need to check the document corresponding to the version you are using to avoid inconsistent usage
* Current Library
* [Quick Start](https://github.com/i18n-pro/solid/blob/v1.0.0/docs/dist/USAGE.md)
* [API](https://github.com/i18n-pro/solid/blob/v1.0.0/docs/dist/API.md)
* [Changelog](https://github.com/i18n-pro/solid/blob/v1.0.0/docs/dist/CHANGELOG.md)
* [Quick Start](https://github.com/i18n-pro/solid/blob/v1.0.1/docs/dist/USAGE.md)
* [API](https://github.com/i18n-pro/solid/blob/v1.0.1/docs/dist/API.md)
* [Changelog](https://github.com/i18n-pro/solid/blob/v1.0.1/docs/dist/CHANGELOG.md)
* i18n-pro
* [Command Line](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/COMMAND_LINE.md)
* [Matching Rules](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/MATCH_RULE.md)
* [Q&A](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/Q&A.md)
* [Translation Log](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/OUTPUT_LOG.md)
* [Command Line](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/COMMAND_LINE.md)
* [Matching Rules](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/MATCH_RULE.md)
* [Q&A](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/Q&A.md)
* [Translation Log](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/OUTPUT_LOG.md)


# License
Expand Down
18 changes: 9 additions & 9 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<p style="font-size: 18px;">适用于 Solid 的轻量、简单、灵活、自动翻译的国际化工具</p>

[English](https://github.com/i18n-pro/solid/tree/v1.0.0#readme) | 简体中文
[English](https://github.com/i18n-pro/solid/tree/v1.0.1#readme) | 简体中文



Expand Down Expand Up @@ -100,16 +100,16 @@ render(

# 帮助文档

>为了避免不必要的重复文档内容,该库的部分文档是链接 `i18n-pro` 中的内容<br />当前文档中 `i18n-pro` 相关链接是基于 `2.0.0` 版本,如果你使用的非该版本,需查看你所使用版本对应的文档,以免用法不一致
>为了避免不必要的重复文档内容,该库的部分文档是链接 `i18n-pro` 中的内容<br />当前文档中 `i18n-pro` 相关链接是基于 `2.1.0` 版本,如果你使用的非该版本,需查看你所使用版本对应的文档,以免用法不一致
* 当前库
* [快速上手](https://github.com/i18n-pro/solid/blob/v1.0.0/docs/dist/USAGE_zh-CN.md)
* [API](https://github.com/i18n-pro/solid/blob/v1.0.0/docs/dist/API_zh-CN.md)
* [更新日志](https://github.com/i18n-pro/solid/blob/v1.0.0/docs/dist/CHANGELOG_zh-CN.md)
* [快速上手](https://github.com/i18n-pro/solid/blob/v1.0.1/docs/dist/USAGE_zh-CN.md)
* [API](https://github.com/i18n-pro/solid/blob/v1.0.1/docs/dist/API_zh-CN.md)
* [更新日志](https://github.com/i18n-pro/solid/blob/v1.0.1/docs/dist/CHANGELOG_zh-CN.md)
* i18n-pro
* [命令行](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/COMMAND_LINE_zh-CN.md)
* [匹配规则](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/MATCH_RULE_zh-CN.md)
* [Q&A](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/Q&A_zh-CN.md)
* [翻译日志](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/OUTPUT_LOG_zh-CN.md)
* [命令行](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/COMMAND_LINE_zh-CN.md)
* [匹配规则](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/MATCH_RULE_zh-CN.md)
* [Q&A](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/Q&A_zh-CN.md)
* [翻译日志](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/OUTPUT_LOG_zh-CN.md)


# License
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions docs/dist/API.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# API

>To avoid unnecessary duplicate document content, some of the documents in this library are linked to the content in `i18n-pro` <br />The `i18n-pro` related link in the current document is based on the `2.0.0` version. If you are using a different version, you need to check the document corresponding to the version you are using to avoid inconsistent usage
>To avoid unnecessary duplicate document content, some of the documents in this library are linked to the content in `i18n-pro` <br />The `i18n-pro` related link in the current document is based on the `2.1.0` version. If you are using a different version, you need to check the document corresponding to the version you are using to avoid inconsistent usage
<details >
<summary>Table of Contents</summary>
Expand All @@ -18,12 +18,12 @@ Configure container components for internationalization initialization propertie
<h3 id="i18nprovider-type">Type</h3>
<pre>
(
props: <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API.md#i18nstate">I18nState</a> & { children: JSXElement },
props: <a href="https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/API.md#i18nstate">I18nState</a> & { children: JSXElement },
) => JSXElement
</pre>

<h3 id="i18nprovider-parameter-description">Parameter Description</h3>
The other parameters are consistent with the <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API.md#initi18n">initI18n</a> parameters<table>
The other parameters are consistent with the <a href="https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/API.md#initi18n">initI18n</a> parameters<table>
<tr>
<th>Parameter name</th>
<th>Description</th>
Expand All @@ -41,9 +41,9 @@ Hook method for obtaining internationalization API and state<br />Note: Since `
<h3 id="usei18n-type">Type</h3>
<pre>
() => ({
<a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API.md#t">t</a>,
<a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API.md#seti18n">setI18n</a>,
<a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API.md#i18nstate">i18nState</a>,
<a href="https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/API.md#t">t</a>,
<a href="https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/API.md#seti18n">setI18n</a>,
<a href="https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/API.md#i18nstate">i18nState</a>,
})
</pre>

12 changes: 6 additions & 6 deletions docs/dist/API_zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# API

>为了避免不必要的重复文档内容,该库的部分文档是链接 `i18n-pro` 中的内容<br />当前文档中 `i18n-pro` 相关链接是基于 `2.0.0` 版本,如果你使用的非该版本,需查看你所使用版本对应的文档,以免用法不一致
>为了避免不必要的重复文档内容,该库的部分文档是链接 `i18n-pro` 中的内容<br />当前文档中 `i18n-pro` 相关链接是基于 `2.1.0` 版本,如果你使用的非该版本,需查看你所使用版本对应的文档,以免用法不一致
<details >
<summary>目录</summary>
Expand All @@ -18,12 +18,12 @@
<h3 id="i18nprovider-类型">类型</h3>
<pre>
(
props: <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API_zh-CN.md#i18nstate">I18nState</a> & { children: JSXElement },
props: <a href="https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/API_zh-CN.md#i18nstate">I18nState</a> & { children: JSXElement },
) => JSXElement
</pre>

<h3 id="i18nprovider-参数说明">参数说明</h3>
其他参数与 <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API_zh-CN.md#initi18n">initI18n</a> 参数一致<table>
其他参数与 <a href="https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/API_zh-CN.md#initi18n">initI18n</a> 参数一致<table>
<tr>
<th>参数名</th>
<th>说明</th>
Expand All @@ -41,9 +41,9 @@
<h3 id="usei18n-类型">类型</h3>
<pre>
() => ({
<a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API_zh-CN.md#t">t</a>,
<a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API_zh-CN.md#seti18n">setI18n</a>,
<a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API_zh-CN.md#i18nstate">i18nState</a>,
<a href="https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/API_zh-CN.md#t">t</a>,
<a href="https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/API_zh-CN.md#seti18n">setI18n</a>,
<a href="https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/API_zh-CN.md#i18nstate">i18nState</a>,
})
</pre>

14 changes: 13 additions & 1 deletion docs/dist/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,30 @@
# Changelog


English | [简体中文](https://github.com/i18n-pro/solid/blob/v1.0.0/docs/dist/CHANGELOG_zh-CN.md)
English | [简体中文](https://github.com/i18n-pro/solid/blob/v1.0.1/docs/dist/CHANGELOG_zh-CN.md)


<details >
<summary>Table of Contents</summary>

&emsp;&emsp;[[1.0.1] - 2023-10-27](#101---2023-10-27)<br/>
&emsp;&emsp;&emsp;&emsp;[Command Line Tool](#101-command-line-tool)<br/>
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;[Fixed](#101-command-line-tool-fixed)<br/>
&emsp;&emsp;[[1.0.0] - 2023-09-16](#100---2023-09-16)<br/>
&emsp;&emsp;&emsp;&emsp;[API](#100-api)<br/>
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;[Added](#100-api-added)<br/>

</details>

## [1.0.1] - 2023-10-27

<h3 id="101-command-line-tool">Command Line Tool</h3>

<h4 id="101-command-line-tool-fixed">Fixed</h4>

* Fixed the absence of the `type` property configuration in `package.json` which was causing a compilation error in `Vite`


## [1.0.0] - 2023-09-16

<h3 id="100-api">API</h3>
Expand Down
14 changes: 13 additions & 1 deletion docs/dist/CHANGELOG_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,30 @@
# 更新日志


[English](https://github.com/i18n-pro/solid/blob/v1.0.0/docs/dist/CHANGELOG.md) | 简体中文
[English](https://github.com/i18n-pro/solid/blob/v1.0.1/docs/dist/CHANGELOG.md) | 简体中文


<details >
<summary>目录</summary>

&emsp;&emsp;[[1.0.1] - 2023-10-27](#101---2023-10-27)<br/>
&emsp;&emsp;&emsp;&emsp;[命令行工具](#101-命令行工具)<br/>
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;[Fixed](#101-命令行工具-fixed)<br/>
&emsp;&emsp;[[1.0.0] - 2023-09-16](#100---2023-09-16)<br/>
&emsp;&emsp;&emsp;&emsp;[API](#100-api)<br/>
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;[Added](#100-api-added)<br/>

</details>

## [1.0.1] - 2023-10-27

<h3 id="101-命令行工具">命令行工具</h3>

<h4 id="101-命令行工具-fixed">Fixed</h4>

* 修复在 `package.json` 中未配置 `type` 属性会导致 `Vite` 编译报错


## [1.0.0] - 2023-09-16

<h3 id="100-api">API</h3>
Expand Down
10 changes: 5 additions & 5 deletions docs/dist/USAGE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Quick Start

>To avoid unnecessary duplicate document content, some of the documents in this library are linked to the content in `i18n-pro` <br />The `i18n-pro` related link in the current document is based on the `2.0.0` version. If you are using a different version, you need to check the document corresponding to the version you are using to avoid inconsistent usage
>To avoid unnecessary duplicate document content, some of the documents in this library are linked to the content in `i18n-pro` <br />The `i18n-pro` related link in the current document is based on the `2.1.0` version. If you are using a different version, you need to check the document corresponding to the version you are using to avoid inconsistent usage
<details >
<summary>Table of Contents</summary>
Expand Down Expand Up @@ -68,13 +68,13 @@ render(


## 3. Initialize Command Line Configuration File
[Please refer to](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/USAGE.md#3-initialize-command-line-configuration-file)
[Please refer to](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/USAGE.md#3-initialize-command-line-configuration-file)

## 4. Adjust `i18nrc.js` Configuration
[Please refer to](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/USAGE.md#4-adjust--i18nrcjs--configuration)
[Please refer to](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/USAGE.md#4-adjust--i18nrcjs--configuration)

## 5. Execute Translation Command
[Please refer to](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/USAGE.md#5-execute-translation-command)
[Please refer to](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/USAGE.md#5-execute-translation-command)

## 6. Importing Language Pack
The language pack already exists, so it needs to be applied to the project
Expand Down Expand Up @@ -169,4 +169,4 @@ render(


## 8. Demo
Real code examples can refer to [Live Demo](https://github.com/i18n-pro/solid/tree/v1.0.0#live-demo) in the `README` document
Real code examples can refer to [Live Demo](https://github.com/i18n-pro/solid/tree/v1.0.1#live-demo) in the `README` document
10 changes: 5 additions & 5 deletions docs/dist/USAGE_zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# 快速上手

>为了避免不必要的重复文档内容,该库的部分文档是链接 `i18n-pro` 中的内容<br />当前文档中 `i18n-pro` 相关链接是基于 `2.0.0` 版本,如果你使用的非该版本,需查看你所使用版本对应的文档,以免用法不一致
>为了避免不必要的重复文档内容,该库的部分文档是链接 `i18n-pro` 中的内容<br />当前文档中 `i18n-pro` 相关链接是基于 `2.1.0` 版本,如果你使用的非该版本,需查看你所使用版本对应的文档,以免用法不一致
<details >
<summary>目录</summary>
Expand Down Expand Up @@ -68,13 +68,13 @@ render(


## 3. 初始化命令行配置文件
[请参考](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/USAGE_zh-CN.md#3-初始化命令行配置文件)
[请参考](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/USAGE_zh-CN.md#3-初始化命令行配置文件)

## 4. 调整 `i18nrc.js` 配置
[请参考](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/USAGE_zh-CN.md#4-调整-i18nrcjs-配置)
[请参考](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/USAGE_zh-CN.md#4-调整-i18nrcjs-配置)

## 5. 执行翻译命令
[请参考](https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/USAGE_zh-CN.md#5-执行翻译命令)
[请参考](https://github.com/i18n-pro/core/blob/v2.1.0/docs/dist/USAGE_zh-CN.md#5-执行翻译命令)

## 6. 引入语言包
语言包已经有了,就需要应用到项目中了
Expand Down Expand Up @@ -169,4 +169,4 @@ render(


## 8. Demo
真实代码示例可参考 `README` 文档中的 [Live Demo](https://github.com/i18n-pro/solid/blob/v1.0.0/README_zh-CN.md#live-demo)
真实代码示例可参考 `README` 文档中的 [Live Demo](https://github.com/i18n-pro/solid/blob/v1.0.1/README_zh-CN.md#live-demo)
21 changes: 21 additions & 0 deletions docs/src/changelog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ function V_1_0_0() {
)
}

function V_1_0_1() {
return (
<Template
version="1.0.1"
date="2023-10-27"
commandLine={{
fixed: [
'U',
t(
'修复在{0}中未配置{1}属性会导致{2}编译报错',
' `package.json` ',
' `type` ',
' `Vite` ',
),
],
}}
/>
)
}

export default function ChangeLog(props) {
initI18n(props)

Expand All @@ -25,6 +45,7 @@ export default function ChangeLog(props) {
<H1 skip>{t('更新日志')}</H1>
{renderLanguage('CHANGELOG')}
<TableOfContents text={t('目录')} open={false} />
<V_1_0_1 />
<V_1_0_0 />
</>
)
Expand Down
12 changes: 2 additions & 10 deletions docs/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,16 @@
"可以通过{0}来切换语言": "You can switch languages through {0}",
"真实代码示例可参考{0}文档中的{1}": "Real code examples can refer to {1} in the {0} document",
"注意:为了避免幽灵依赖导致 i18n 命令不能使用的问题,使用 pnpm 必须要安装 i18n-pro": "Note: To prevent issues where the i18n command cannot be used due to ghost dependencies, it is essential to install i18n-pro when using pnpm",
"会在 Vue 的全局属性上注册如下 3 个属性,它们各自的类型及使用说明可点击链接查看": "It will register the following 3 properties on Vue's global properties. You can click on the links to view their respective types and usage instructions",
"注册的全局属性,使用时是否需要带前缀{0}": "Registered global properties, do you need to bring prefix {0} when used",
"默认为 true,只能通过{0}来访问属性;若配置为 false,则可以直接通过{1}来访问属性": "The default is TRUE, you can only access the properties through {0}; if configured to false, you can directly access the properties through {1}",
"该库是基于{0}结合{1}的{2}特性来实现的": "This library is implemented based on {0} combined with {1}'s {2} feature",
"适用于 {0} 的轻量、简单、灵活、自动翻译的国际化工具": "Lightweight, simple, flexible, automatic translation internationalization tool for {0}",
"注册插件": "Register Plugin",
"用{0}包裹{1}": "Wrap {1} with {0}",
"初始化国际化状态并返回其插件函数": "Initialize internationalization state and return its plugin function",
"全局属性、响应式机制和插件机制": "Global Properties, Reactivity System and Plugin System",
"当前库仅适用于{0}, 需要支持{1}的请点击{2}查看": "The current library is only applicable to {0}. If you need to support {1}, please click {2} to view",
"该属性配置后,针对{0}和{1}都会生效": "After configuring this property, it will take effect for both {0} and {1}",
"新增{0}和{1}基础实现": "Add basic implementation for {0} and {1}",
"在{0}中获取国际化状态和 API 的方法": "Method to get internationalization state and API in {0}",
"组合式 API": "Composition API",
"选项式 API": "Options API",
"配置国际化初始化属性的容器组件": "Configure container components for internationalization initialization properties",
"获取国际化 API 和状态的 hook 方法": "Hook method for obtaining internationalization API and state",
"接入{0}和{1},并用{2}包裹{3}": "Connect {0} and {1}, and wrap {3} with {2}",
"需要国际化的内容": "Content that requires internationalization",
"注意:由于{0}是一个响应式的状态,使用时需要{1}这样来使用": "Note: Since {0} is a reactive state, it needs to be accessed as {1} when used"
"注意:由于{0}是一个响应式的状态,使用时需要{1}这样来使用": "Note: Since {0} is a reactive state, it needs to be accessed as {1} when used",
"修复在{0}中未配置{1}属性会导致{2}编译报错": "Fixed the absence of the {1} property configuration in {0} which was causing a compilation error in {2}"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@i18n-pro/solid",
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"description": "Lightweight, simple, flexible, automatic translation internationalization tool for Solid(适用于 Solid 的轻量、简单、灵活、自动翻译的国际化工具)",
"keywords": [
"solid",
Expand Down
12 changes: 6 additions & 6 deletions rollup.config.js → rollup.config.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ts from 'rollup-plugin-typescript2'
import prettier from 'rollup-plugin-prettier'
import { terser } from 'rollup-plugin-terser'
import { version, name } from './package.json'
import solid from 'vite-plugin-solid'
const ts = require('rollup-plugin-typescript2')
const prettier = require('rollup-plugin-prettier')
const { terser } = require('rollup-plugin-terser')
const { version, name } = require('./package.json')
const solid = require('vite-plugin-solid')

const formats = ['esm.min']

Expand All @@ -18,7 +18,7 @@ const banner = `/*

const minBanner = `// ${name} v${version} ${new Date().toLocaleString()} ${copyright}`

export default formats.map((format, index) => {
module.exports = formats.map((format, index) => {
const isLast = index === formats.length - 1
let pluginsExtra = []

Expand Down

0 comments on commit 0858bbc

Please sign in to comment.