From e972c36ab49b286f6bead5e31c8b1c596ee89ccf Mon Sep 17 00:00:00 2001 From: zongz Date: Wed, 28 Aug 2024 14:30:30 +0800 Subject: [PATCH] feat: add doc for include and exclude in package section Signed-off-by: zongz --- .../package-management/4-how-to/8-kcl_mod.md | 8 +++-- .../package-management/4-how-to/8-kcl_mod.md | 32 +++++++++++++++++++ .../package-management/4-how-to/8-kcl_mod.md | 32 +++++++++++++++++++ .../package-management/4-how-to/8-kcl_mod.md | 32 +++++++++++++++++++ .../package-management/4-how-to/8-kcl_mod.md | 8 +++-- .../package-management/4-how-to/8-kcl_mod.md | 8 +++-- 6 files changed, 114 insertions(+), 6 deletions(-) diff --git a/docs/user_docs/guides/package-management/4-how-to/8-kcl_mod.md b/docs/user_docs/guides/package-management/4-how-to/8-kcl_mod.md index 2e3abcfd..96739cc6 100644 --- a/docs/user_docs/guides/package-management/4-how-to/8-kcl_mod.md +++ b/docs/user_docs/guides/package-management/4-how-to/8-kcl_mod.md @@ -12,22 +12,26 @@ In the MVP version, the sections we plan to support are as follows: - [version](#package) — The version of the package. - [edition](#package) — The KCL compiler edition. - [description](#package) — The description of the package. + - [include](#package) - The include file paths when packaging and publishing. + - [exclude](#package) - The exclude file paths when packaging and publishing. - Dependency tables: - [dependencies](#dependencies) - Package library dependencies. - Compiler settings: - - [profile] - The compiler settings. + - profile - The compiler settings. - [entries](#entries) - The entry points of the package when compiling. ## package The first section in a `kcl.mod` is [package]. -``` +```toml [package] name = "hello_world" # the name of the package version = "0.1.0" # the current version, obeying semver edition = "0.5.0" # the KCL compiler version description = "This is a hello world package." # the description of the package +include = ["src/", "README.md", "LICENSE"] # the include file paths when packaging and publishing +exclude = ["target/", ".git/", "*.log"] # the exclude file paths when packaging and publishing ``` ## dependencies diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/guides/package-management/4-how-to/8-kcl_mod.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/guides/package-management/4-how-to/8-kcl_mod.md index 6857b9a8..a24d2b27 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/guides/package-management/4-how-to/8-kcl_mod.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/guides/package-management/4-how-to/8-kcl_mod.md @@ -12,6 +12,8 @@ - [version](#package) — 包的版本。 - [edition](#package) — KCL 编译器版本。 - [description](#package) — 包的描述。 + - [include](#include) - 在打包和发布时包含的文件。 + - [exclude](#exclude) - 在打包和发布时排除的文件。 - 依赖表: - [dependencies](#dependencies) - 包库依赖项。 - 编译器设置: @@ -72,6 +74,36 @@ edition = "0.5.0" description = "This is my package." ``` +### 2.5. include + +你可以使用 `include` 字段指定打包和发布时包含的文件。 + +`include` 是 `package` 部分的字段。 + +```toml +[package] +name = "hello_world" +version = "0.1.0" +edition = "0.5.0" +description = "This is a hello world package." +include = ["src/", "README.md", "LICENSE"] # 打包和发布时包含的文件 +``` + +### 2.6. exclude + +你可以使用 `exclude` 字段指定打包和发布时排除的文件。 + +`exclude` 是 `package` 部分的字段。 + +```toml +[package] +name = "hello_world" +version = "0.1.0" +edition = "0.5.0" +description = "This is a hello world package." +exclude = ["target/", ".git/", "*.log"] # 打包和发布时排除的文件 +``` + ## 3. dependencies 你的 kcl 包可以依赖于来自 OCI 仓库、Git 存储库或本地文件系统子目录的其他库。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/guides/package-management/4-how-to/8-kcl_mod.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/guides/package-management/4-how-to/8-kcl_mod.md index 6857b9a8..a24d2b27 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/guides/package-management/4-how-to/8-kcl_mod.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/guides/package-management/4-how-to/8-kcl_mod.md @@ -12,6 +12,8 @@ - [version](#package) — 包的版本。 - [edition](#package) — KCL 编译器版本。 - [description](#package) — 包的描述。 + - [include](#include) - 在打包和发布时包含的文件。 + - [exclude](#exclude) - 在打包和发布时排除的文件。 - 依赖表: - [dependencies](#dependencies) - 包库依赖项。 - 编译器设置: @@ -72,6 +74,36 @@ edition = "0.5.0" description = "This is my package." ``` +### 2.5. include + +你可以使用 `include` 字段指定打包和发布时包含的文件。 + +`include` 是 `package` 部分的字段。 + +```toml +[package] +name = "hello_world" +version = "0.1.0" +edition = "0.5.0" +description = "This is a hello world package." +include = ["src/", "README.md", "LICENSE"] # 打包和发布时包含的文件 +``` + +### 2.6. exclude + +你可以使用 `exclude` 字段指定打包和发布时排除的文件。 + +`exclude` 是 `package` 部分的字段。 + +```toml +[package] +name = "hello_world" +version = "0.1.0" +edition = "0.5.0" +description = "This is a hello world package." +exclude = ["target/", ".git/", "*.log"] # 打包和发布时排除的文件 +``` + ## 3. dependencies 你的 kcl 包可以依赖于来自 OCI 仓库、Git 存储库或本地文件系统子目录的其他库。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.9/user_docs/guides/package-management/4-how-to/8-kcl_mod.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.9/user_docs/guides/package-management/4-how-to/8-kcl_mod.md index 6857b9a8..a24d2b27 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.9/user_docs/guides/package-management/4-how-to/8-kcl_mod.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.9/user_docs/guides/package-management/4-how-to/8-kcl_mod.md @@ -12,6 +12,8 @@ - [version](#package) — 包的版本。 - [edition](#package) — KCL 编译器版本。 - [description](#package) — 包的描述。 + - [include](#include) - 在打包和发布时包含的文件。 + - [exclude](#exclude) - 在打包和发布时排除的文件。 - 依赖表: - [dependencies](#dependencies) - 包库依赖项。 - 编译器设置: @@ -72,6 +74,36 @@ edition = "0.5.0" description = "This is my package." ``` +### 2.5. include + +你可以使用 `include` 字段指定打包和发布时包含的文件。 + +`include` 是 `package` 部分的字段。 + +```toml +[package] +name = "hello_world" +version = "0.1.0" +edition = "0.5.0" +description = "This is a hello world package." +include = ["src/", "README.md", "LICENSE"] # 打包和发布时包含的文件 +``` + +### 2.6. exclude + +你可以使用 `exclude` 字段指定打包和发布时排除的文件。 + +`exclude` 是 `package` 部分的字段。 + +```toml +[package] +name = "hello_world" +version = "0.1.0" +edition = "0.5.0" +description = "This is a hello world package." +exclude = ["target/", ".git/", "*.log"] # 打包和发布时排除的文件 +``` + ## 3. dependencies 你的 kcl 包可以依赖于来自 OCI 仓库、Git 存储库或本地文件系统子目录的其他库。 diff --git a/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/8-kcl_mod.md b/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/8-kcl_mod.md index 2e3abcfd..96739cc6 100644 --- a/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/8-kcl_mod.md +++ b/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/8-kcl_mod.md @@ -12,22 +12,26 @@ In the MVP version, the sections we plan to support are as follows: - [version](#package) — The version of the package. - [edition](#package) — The KCL compiler edition. - [description](#package) — The description of the package. + - [include](#package) - The include file paths when packaging and publishing. + - [exclude](#package) - The exclude file paths when packaging and publishing. - Dependency tables: - [dependencies](#dependencies) - Package library dependencies. - Compiler settings: - - [profile] - The compiler settings. + - profile - The compiler settings. - [entries](#entries) - The entry points of the package when compiling. ## package The first section in a `kcl.mod` is [package]. -``` +```toml [package] name = "hello_world" # the name of the package version = "0.1.0" # the current version, obeying semver edition = "0.5.0" # the KCL compiler version description = "This is a hello world package." # the description of the package +include = ["src/", "README.md", "LICENSE"] # the include file paths when packaging and publishing +exclude = ["target/", ".git/", "*.log"] # the exclude file paths when packaging and publishing ``` ## dependencies diff --git a/versioned_docs/version-0.9/user_docs/guides/package-management/4-how-to/8-kcl_mod.md b/versioned_docs/version-0.9/user_docs/guides/package-management/4-how-to/8-kcl_mod.md index 2e3abcfd..96739cc6 100644 --- a/versioned_docs/version-0.9/user_docs/guides/package-management/4-how-to/8-kcl_mod.md +++ b/versioned_docs/version-0.9/user_docs/guides/package-management/4-how-to/8-kcl_mod.md @@ -12,22 +12,26 @@ In the MVP version, the sections we plan to support are as follows: - [version](#package) — The version of the package. - [edition](#package) — The KCL compiler edition. - [description](#package) — The description of the package. + - [include](#package) - The include file paths when packaging and publishing. + - [exclude](#package) - The exclude file paths when packaging and publishing. - Dependency tables: - [dependencies](#dependencies) - Package library dependencies. - Compiler settings: - - [profile] - The compiler settings. + - profile - The compiler settings. - [entries](#entries) - The entry points of the package when compiling. ## package The first section in a `kcl.mod` is [package]. -``` +```toml [package] name = "hello_world" # the name of the package version = "0.1.0" # the current version, obeying semver edition = "0.5.0" # the KCL compiler version description = "This is a hello world package." # the description of the package +include = ["src/", "README.md", "LICENSE"] # the include file paths when packaging and publishing +exclude = ["target/", ".git/", "*.log"] # the exclude file paths when packaging and publishing ``` ## dependencies