Skip to content

Commit

Permalink
chore: 测试hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Cnotech committed Sep 12, 2024
1 parent b3fd8bf commit 862c702
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
9 changes: 6 additions & 3 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export default {
"*.ts": "eslint --fix",
"*.rs": () => ["cargo fmt", "cargo clippy --fix --allow-dirty --allow-staged"],
"*.md": () => ["pnpm doc:translate --check"]
};
"*.rs": () => [
"cargo fmt",
"cargo clippy --fix --allow-dirty --allow-staged",
],
"*.{md,mdx}": () => ["pnpm doc:translate --check"],
};
16 changes: 8 additions & 8 deletions doc/en/nep/definition/1-package.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Do not include underscores (`_`), please use spaces or hyphens (`-`) instead.
* Example: `name = "VSCode"`

### description
A brief description of the package, try to extract from official channels.
A brief description of the package, try to extract the introduction from official channels.
* Type: `String`
* Example: `description = "Microsoft's cross-platform open-source editor"`
* Example: `description = "An open-source cross-platform editor developed by Microsoft"`

### template
Package template, in the current version, it can only be "Software".
Expand All @@ -41,7 +41,7 @@ Supports wrapping author email with `<>`.
* Example: `authors = ["Cno <[email protected]>", "Microsoft"]`

### license
<Tag>Optional</Tag> Open source license [SPDX identifier](https://spdx.org/licenses/) or EULA link.
<Tag>Optional</Tag> Open-source license [SPDX identifier](https://spdx.org/licenses/) or EULA link.
* Type: `String`
* Example: `license = "MIT"`

Expand All @@ -53,7 +53,7 @@ Supports wrapping author email with `<>`.
### strict
<Tag>Optional</Tag> Whether to use strict mode, the default is `true`.

When strict mode is enabled, if an error occurs in a step, the workflow will immediately stop execution and report an error; otherwise, the workflow will only warn of the error and continue to run the subsequent steps.
When strict mode is enabled, if an error occurs in a step, the workflow will immediately stop execution and report an error; otherwise, the workflow will only warn the error and continue to run the subsequent steps.

:::warning
Note that if you want to use the built-in variable [`ExitCode`](/nep/definition/2-context#exitcode), please set `strict` to `false`.
Expand All @@ -67,9 +67,9 @@ Software package exclusive table.
### scope
Software distribution domain, usually fill in the name of the upstream organization.

If the direct upstream of the software package is the distributor (organization), use the name of the distributor, such as `PortableApps`; if the direct upstream of the software package is the official website, use the name of the developer (organization), such as `Microsoft`.
If the direct upstream of the software package is the distributor/organization, use the distributor's name, such as `PortableApps`; if the direct upstream of the software package is the official website, use the developer's/organization's name, such as `Microsoft`.

If the upstream organization is a formal organization with an independent domain name, capitalize the beginning of the distribution domain, such as using `GitHub` as the distribution domain for `GitHub Desktop` published by GitHub; if the upstream organization represents a general reference to a group, use a lowercase distribution domain, such as using `github` as the distribution domain for open source projects hosted on GitHub Releases.
If the upstream organization is a formal organization with an independent domain name, capitalize the beginning of the distribution domain, such as using `GitHub` as the distribution domain for `GitHub Desktop` published by GitHub; if the upstream organization represents a general reference to a group, use a lowercase beginning for the distribution domain, such as using `github` as the distribution domain for open-source projects hosted on GitHub Releases.
* Type: `String`
* Example: `scope = "Microsoft"`

Expand All @@ -79,7 +79,7 @@ Software upstream URL, which can be the official website's download page or the
* Example: `upstream = "https://code.visualstudio.com/"`

### category
Software category, recommended to be one of the Edgeless plugin package categories.
Software category, it is recommended to be one of the Edgeless plugin package categories.
* Type: `String`
* Example: `category = "Integrated Development"`

Expand All @@ -98,7 +98,7 @@ Software language, `Multi` indicates multiple languages.
### main_program
<Tag>Optional</Tag> Main program path, which can be a relative or absolute path.

If using an absolute path, it must start with a [built-in variable](/nep/workflow/2-context.html#built-in-variables).
If using an absolute path, it must start with [built-in variables](/nep/workflow/2-context.html#built-in-variables).
* Type: `String`
* Example:
```toml
Expand Down
2 changes: 1 addition & 1 deletion doc/zh/nep/definition/1-package.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ExSemVer 规范在 [SemVer](https://semver.org) 的基础上在`PATCH`和`PRE`
### scope
软件发行域,通常填写上游组织名称。

若软件包的直接上游为发行商(组织)则使用发行商的名称,例如 `PortableApps`;若软件包的直接上游为官方网站则使用开发商(组织)的名称,例如 `Microsoft`
若软件包的直接上游为发行商/组织则使用发行商的名称,例如 `PortableApps`;若软件包的直接上游为官方网站则使用开发商/组织的名称,例如 `Microsoft`

若上游组织为正式的、拥有独立域名的组织,则将发行域开头大写,例如对于 GitHub 发布的 `GitHub Desktop` 软件使用 `GitHub` 作为发行域;若上游组织表示对一个群体的泛指,则将发行域开头小写,例如对于将发行托管在 GitHub Releases 上的开源项目使用 `github` 作为发行域。
* 类型:`String`
Expand Down
5 changes: 3 additions & 2 deletions scripts/translate_wiki/prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ You must strictly follow the rules below.
- Never change the Markdown markup structure. Don't add or remove links. Do not change any URL.
- Never change the contents of code blocks even if they appear to have a bug.
- Always preserve the original line breaks. Do not add or remove blank lines. Do not add lines or sections that doesn't correspond to the original text.
- Never touch the url such as `(https://example.com#id)`.
- Never touch the url such as `(https://example.com#id)`, never change the upper and lower case of url hash.
- Never touch HTML-like tags such as `<Tag>` `</Tag>`.
- Never touch abbreviations like `ept` `nep` or any other abbreviations.
- Translate "外包" into "Outer-package" and "内包" into "Inner-package"; Translate "装箱单" into "manifest", "新一代" into "Next-generation".
- Translate comments that start with '#' or '//' in a code block
- Translate comments that start with '#' or '//' in a code block
- Use "open-source" instead of "open source"
4 changes: 2 additions & 2 deletions scripts/translate_wiki/store.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"en": "0cd61b07a5f31c7265e5ca49e6a4f1bd"
},
"nep/definition/1-package.mdx": {
"zh": "790bc61a34cc1d380a13a8a7fe582675",
"en": "0659e9f28c97d8be32196deb040f3895"
"zh": "fa187c5132811b973826c783be5e772c",
"en": "122769ca9f04f91e3a1ba7edeb96d64d"
},
"nep/definition/2-context.md": {
"zh": "79e2ac30ca439a3b2cc2fa1554e374cd",
Expand Down
1 change: 1 addition & 0 deletions scripts/translate_wiki/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export async function readStoreMd5(fileBasePath: string): Promise<StoreNode> {
const json = await getCachedJson();
return json[fileBasePath] ?? { zh: undefined, en: undefined };
}

export async function writeStoreMd5(fileBasePath: string, node: StoreNode) {
const json = await getCachedJson();
json[fileBasePath] = node;
Expand Down

0 comments on commit 862c702

Please sign in to comment.