diff options
| -rw-r--r-- | .cargo/config.toml | 4 | ||||
| -rw-r--r-- | .github/workflows/ci.yml | 8 | ||||
| -rw-r--r-- | .gitignore | 9 | ||||
| -rw-r--r-- | .idea/.gitignore | 10 | ||||
| -rw-r--r-- | .idea/mingling.iml | 18 | ||||
| -rw-r--r-- | .idea/modules.xml | 8 | ||||
| -rw-r--r-- | .idea/runConfigurations/Check__All.xml | 26 | ||||
| -rw-r--r-- | .idea/runConfigurations/Check__Codes.xml | 26 | ||||
| -rw-r--r-- | .idea/runConfigurations/Check__Documents.xml | 26 | ||||
| -rw-r--r-- | .idea/runConfigurations/Refresh_All.xml | 27 | ||||
| -rw-r--r-- | .idea/runConfigurations/Run__Cargo_Format.xml | 23 | ||||
| -rw-r--r-- | .idea/runConfigurations/Run__Deploy_API_Docs.xml | 28 | ||||
| -rw-r--r-- | .idea/runConfigurations/Run__Fix_Documents_Codebox.xml | 28 | ||||
| -rw-r--r-- | .idea/runConfigurations/Run__Generate_Docsify_Sidebar.xml | 28 | ||||
| -rw-r--r-- | .idea/runConfigurations/Run__Package_All_Crates.xml | 28 | ||||
| -rw-r--r-- | .idea/runConfigurations/Run__Sync_Examples_To_Crates.xml | 28 | ||||
| -rw-r--r-- | .idea/runConfigurations/Run__Sync_Examples_To_Helpdoc.xml | 28 | ||||
| -rw-r--r-- | .idea/runConfigurations/Run__Sync_Feature_List.xml | 28 | ||||
| -rw-r--r-- | .idea/vcs.xml | 6 | ||||
| -rw-r--r-- | .vscode/tasks.json | 122 | ||||
| -rw-r--r-- | .zed/settings.json | 30 | ||||
| -rw-r--r-- | .zed/tasks.json | 71 | ||||
| -rw-r--r-- | CONTRIBUTING.md | 109 | ||||
| -rw-r--r-- | Cargo.lock | 4 | ||||
| -rw-r--r-- | Cargo.toml | 4 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | arg_picker_macros/Cargo.toml | 2 | ||||
| -rw-r--r-- | build.rs | 153 | ||||
| -rw-r--r-- | dev/ci/Cargo.lock (renamed from mingling_ci/Cargo.lock) | 0 | ||||
| -rw-r--r-- | dev/ci/Cargo.toml (renamed from mingling_ci/Cargo.toml) | 0 | ||||
| -rw-r--r-- | dev/ci/build.rs (renamed from mingling_ci/build.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/help.txt (renamed from mingling_ci/help.txt) | 0 | ||||
| -rw-r--r-- | dev/ci/src/bin/ci.rs (renamed from mingling_ci/src/bin/ci.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/cmd.rs (renamed from mingling_ci/src/cmd.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/cmd/cmd_git_lock.rs (renamed from mingling_ci/src/cmd/cmd_git_lock.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/cmd/cmd_git_unlock.rs (renamed from mingling_ci/src/cmd/cmd_git_unlock.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/cmd/cmd_report_clean.rs (renamed from mingling_ci/src/cmd/cmd_report_clean.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/cmd/cmd_report_collect.rs (renamed from mingling_ci/src/cmd/cmd_report_collect.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/cmd/cmd_show_features.rs (renamed from mingling_ci/src/cmd/cmd_show_features.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/cmd/cmd_show_manifests.rs (renamed from mingling_ci/src/cmd/cmd_show_manifests.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/examples.rs (renamed from mingling_ci/src/examples.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/git.rs (renamed from mingling_ci/src/git.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/lib.rs (renamed from mingling_ci/src/lib.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/markdown.rs (renamed from mingling_ci/src/markdown.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/markdown/compare.rs (renamed from mingling_ci/src/markdown/compare.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/markdown/project.rs (renamed from mingling_ci/src/markdown/project.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/markdown/test.rs (renamed from mingling_ci/src/markdown/test.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/progress.rs (renamed from mingling_ci/src/progress.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/reporter.rs (renamed from mingling_ci/src/reporter.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/res.rs (renamed from mingling_ci/src/res.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/res/collect_logs.rs (renamed from mingling_ci/src/res/collect_logs.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/res/crate_config.rs (renamed from mingling_ci/src/res/crate_config.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/res/features.rs (renamed from mingling_ci/src/res/features.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/res/manifests.rs (renamed from mingling_ci/src/res/manifests.rs) | 8 | ||||
| -rw-r--r-- | dev/ci/src/res/print.rs (renamed from mingling_ci/src/res/print.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/task.rs (renamed from mingling_ci/src/task.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/task/cmd_build_check.rs (renamed from mingling_ci/src/task/cmd_build_check.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/task/cmd_clippy_check.rs (renamed from mingling_ci/src/task/cmd_clippy_check.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/task/cmd_docs_check.rs (renamed from mingling_ci/src/task/cmd_docs_check.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/task/cmd_example_check.rs (renamed from mingling_ci/src/task/cmd_example_check.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/task/cmd_markdown_check.rs (renamed from mingling_ci/src/task/cmd_markdown_check.rs) | 2 | ||||
| -rw-r--r-- | dev/ci/src/task/cmd_markdown_compare.rs (renamed from mingling_ci/src/task/cmd_markdown_compare.rs) | 4 | ||||
| -rw-r--r-- | dev/ci/src/task/cmd_test.rs (renamed from mingling_ci/src/task/cmd_test.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/task/run.rs (renamed from mingling_ci/src/task/run.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/tools.rs (renamed from mingling_ci/src/tools.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/tools/docsify_refresh.rs (renamed from mingling_ci/src/tools/docsify_refresh.rs) | 0 | ||||
| -rw-r--r-- | dev/ci/src/tools/example_refresh.rs (renamed from mingling_ci/src/tools/example_refresh.rs) | 4 | ||||
| -rw-r--r-- | dev/ci/src/tools/features_refresh.rs (renamed from mingling_ci/src/tools/features_refresh.rs) | 2 | ||||
| -rw-r--r-- | dev/ci/tmpls/report.md (renamed from mingling_ci/tmpls/report.md) | 0 | ||||
| -rw-r--r-- | dev/ci/tmpls/task_section.md (renamed from mingling_ci/tmpls/task_section.md) | 0 | ||||
| -rw-r--r-- | dev/configs/ci-ignored-dirs.txt (renamed from .config/ci-ignored-dirs.txt) | 2 | ||||
| -rw-r--r-- | dev/configs/docs-lang.txt (renamed from .config/docs-lang.txt) | 0 | ||||
| -rw-r--r-- | dev/configs/rust-analyzer.json (renamed from .vscode/settings.json) | 2 | ||||
| -rw-r--r-- | dev/configs/verified-docs.toml (renamed from .config/verified-docs.toml) | 0 | ||||
| -rw-r--r-- | dev/configs/version-files.toml (renamed from .config/version-files.toml) | 0 | ||||
| -rw-r--r-- | dev/run/.gitignore (renamed from .run/.gitignore) | 0 | ||||
| -rw-r--r-- | dev/run/Cargo.lock (renamed from .run/Cargo.lock) | 0 | ||||
| -rw-r--r-- | dev/run/Cargo.toml (renamed from .run/Cargo.toml) | 0 | ||||
| -rw-r--r-- | dev/run/src/bin/ci.py (renamed from .run/src/bin/ci.py) | 0 | ||||
| -rw-r--r-- | dev/run/src/bin/clippy-fix.ps1 (renamed from .run/src/bin/clippy-fix.ps1) | 0 | ||||
| -rwxr-xr-x | dev/run/src/bin/clippy-fix.sh (renamed from .run/src/bin/clippy-fix.sh) | 0 | ||||
| -rw-r--r-- | dev/run/src/bin/cov-test.rs (renamed from .run/src/bin/cov-test.rs) | 0 | ||||
| -rw-r--r-- | dev/run/src/bin/deploy-api-docs.rs (renamed from .run/src/bin/deploy-api-docs.rs) | 0 | ||||
| -rw-r--r-- | dev/run/src/bin/display-dependency-order.rs (renamed from .run/src/bin/display-dependency-order.rs) | 0 | ||||
| -rw-r--r-- | dev/run/src/bin/http-page-preview.ps1 (renamed from .run/src/bin/http-page-preview.ps1) | 0 | ||||
| -rwxr-xr-x | dev/run/src/bin/http-page-preview.sh (renamed from .run/src/bin/http-page-preview.sh) | 0 | ||||
| -rw-r--r-- | dev/run/src/bin/install-mling.ps1 (renamed from .run/src/bin/install-mling.ps1) | 0 | ||||
| -rwxr-xr-x | dev/run/src/bin/install-mling.sh (renamed from .run/src/bin/install-mling.sh) | 0 | ||||
| -rw-r--r-- | dev/run/src/bin/package-all.rs (renamed from .run/src/bin/package-all.rs) | 0 | ||||
| -rw-r--r-- | dev/run/src/bin/update-version.rs (renamed from .run/src/bin/update-version.rs) | 8 | ||||
| -rw-r--r-- | dev/run/src/bin/windows-folder-hide.ps1 (renamed from .run/src/bin/windows-folder-hide.ps1) | 0 | ||||
| -rw-r--r-- | dev/run/src/dependency_order.rs (renamed from .run/src/dependency_order.rs) | 0 | ||||
| -rw-r--r-- | dev/run/src/lib.rs (renamed from .run/src/lib.rs) | 0 | ||||
| -rw-r--r-- | dev/run/src/verify.rs (renamed from .run/src/verify.rs) | 0 | ||||
| -rw-r--r-- | dist/index.html | 2 | ||||
| -rw-r--r-- | docs/_zh_CN/index.html | 2 | ||||
| -rw-r--r-- | docs/dev/README.md | 2 | ||||
| -rw-r--r-- | docs/dev/index.html | 2 | ||||
| -rw-r--r-- | docs/dev/pages/abouts/ci.md | 72 | ||||
| -rw-r--r-- | docs/dev/pages/abouts/code-verify-system.md | 20 | ||||
| -rw-r--r-- | docs/example-viewer.html | 4 | ||||
| -rw-r--r-- | docs/examples.html | 4 | ||||
| -rw-r--r-- | docs/examples.json (renamed from docs/example-pages/examples.json) | 0 | ||||
| -rw-r--r-- | docs/index.html (renamed from docs/doc.html) | 0 | ||||
| -rw-r--r-- | docs/licenses/docsify.md (renamed from docs/LICENSE) | 0 | ||||
| -rw-r--r-- | index.html | 6 | ||||
| -rw-r--r-- | mingling/src/docs/lib.md | 2 | ||||
| -rw-r--r-- | mingling_cli/Cargo.toml | 2 | ||||
| -rw-r--r-- | run.ps1 | 52 | ||||
| -rwxr-xr-x | run.sh | 52 |
110 files changed, 351 insertions, 787 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml index f0b35b3..8a25d59 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -4,5 +4,5 @@ target-dir = "./.temp/target" [env] [alias] -ci = "run --manifest-path mingling_ci/Cargo.toml --bin ci --quiet --" -dev_tool = "run --manifest-path .run/Cargo.toml --quiet --bin " +ci = "run --manifest-path dev/ci/Cargo.toml --bin ci --quiet --" +dev_tool = "run --manifest-path dev/run/Cargo.toml --quiet --bin " diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56667d4..1814307 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,9 +102,9 @@ jobs: shell: bash run: | if [ "$RUNNER_OS" = "Windows" ]; then - powershell -ExecutionPolicy Bypass -File .run/src/bin/install-mling.ps1 + powershell -ExecutionPolicy Bypass -File dev/run/src/bin/install-mling.ps1 else - bash .run/src/bin/install-mling.sh + bash dev/run/src/bin/install-mling.sh fi - name: Package mling @@ -181,13 +181,13 @@ jobs: run: rustup toolchain install nightly - name: Build API docs - run: cargo +nightly run --manifest-path .run/Cargo.toml --bin deploy-api-docs -- --docsrs + run: cargo +nightly run --manifest-path dev/run/Cargo.toml --bin deploy-api-docs -- --docsrs - name: Install cargo-llvm-cov run: cargo install --git https://github.com/Weicao-CatilGrass/cargo-llvm-cov cargo-llvm-cov - name: Run cov-test - run: cargo run --manifest-path .run/Cargo.toml --bin cov-test + run: cargo run --manifest-path dev/run/Cargo.toml --bin cov-test - name: Delete .temp directory before deployment run: rm -rf .temp @@ -10,10 +10,13 @@ docs/api-docs/ docs/cov-test/ # Drafts -__*.md +__*.* __*/ -__*.py -__*.rs # Fuck nul + +# Editors config +/.zed/ +/.vscode/ +/.idea/ diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 30cf57e..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Ignored default folder with query files -/queries/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/mingling.iml b/.idea/mingling.iml deleted file mode 100644 index ca57e6c..0000000 --- a/.idea/mingling.iml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module type="EMPTY_MODULE" version="4"> - <component name="NewModuleRootManager"> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/arg_picker/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/arg_picker_macros/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/mingling/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/mingling_core/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/mingling_core/tests" isTestSource="true" /> - <sourceFolder url="file://$MODULE_DIR$/mingling_macros/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/mingling_pathf/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/mling/src" isTestSource="false" /> - <excludeFolder url="file://$MODULE_DIR$/target" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - </component> -</module>
\ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 764f612..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ProjectModuleManager"> - <modules> - <module fileurl="file://$PROJECT_DIR$/.idea/mingling.iml" filepath="$PROJECT_DIR$/.idea/mingling.iml" /> - </modules> - </component> -</project>
\ No newline at end of file diff --git a/.idea/runConfigurations/Check__All.xml b/.idea/runConfigurations/Check__All.xml deleted file mode 100644 index 95af540..0000000 --- a/.idea/runConfigurations/Check__All.xml +++ /dev/null @@ -1,26 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Check: All" - type="CargoCommandRunConfiguration" - factoryName="Cargo Command" - folderName="CI" - > - <option - name="command" - value="run --manifest-path .run/Cargo.toml --bin ci --quiet -- -y" - /> - <option name="workingDirectory" value="file://$PROJECT_DIR$" /> - <envs /> - <option name="emulateTerminal" value="true" /> - <option name="channel" value="DEFAULT" /> - <option name="requiredFeatures" value="true" /> - <option name="allFeatures" value="false" /> - <option name="withSudo" value="false" /> - <option name="buildTarget" value="REMOTE" /> - <option name="backtrace" value="SHORT" /> - <option name="isRedirectInput" value="false" /> - <option name="redirectInputPath" value="" /> - <method v="2" /> - </configuration> -</component> diff --git a/.idea/runConfigurations/Check__Codes.xml b/.idea/runConfigurations/Check__Codes.xml deleted file mode 100644 index 75f5e09..0000000 --- a/.idea/runConfigurations/Check__Codes.xml +++ /dev/null @@ -1,26 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Check: Codes" - type="CargoCommandRunConfiguration" - factoryName="Cargo Command" - folderName="CI" - > - <option - name="command" - value="run --manifest-path .run/Cargo.toml --bin ci --quiet -- --check-build --check-clippy --check-test --check-arg-picker -y" - /> - <option name="workingDirectory" value="file://$PROJECT_DIR$" /> - <envs /> - <option name="emulateTerminal" value="true" /> - <option name="channel" value="DEFAULT" /> - <option name="requiredFeatures" value="true" /> - <option name="allFeatures" value="false" /> - <option name="withSudo" value="false" /> - <option name="buildTarget" value="REMOTE" /> - <option name="backtrace" value="SHORT" /> - <option name="isRedirectInput" value="false" /> - <option name="redirectInputPath" value="" /> - <method v="2" /> - </configuration> -</component> diff --git a/.idea/runConfigurations/Check__Documents.xml b/.idea/runConfigurations/Check__Documents.xml deleted file mode 100644 index 3b40bbb..0000000 --- a/.idea/runConfigurations/Check__Documents.xml +++ /dev/null @@ -1,26 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Check: Documents" - type="CargoCommandRunConfiguration" - factoryName="Cargo Command" - folderName="CI" - > - <option - name="command" - value="run --manifest-path .run/Cargo.toml --bin ci --quiet -- --check-markdown-code --check-examples --check-docs-refresh --check-api-docs -y" - /> - <option name="workingDirectory" value="file://$PROJECT_DIR$" /> - <envs /> - <option name="emulateTerminal" value="true" /> - <option name="channel" value="DEFAULT" /> - <option name="requiredFeatures" value="true" /> - <option name="allFeatures" value="false" /> - <option name="withSudo" value="false" /> - <option name="buildTarget" value="REMOTE" /> - <option name="backtrace" value="SHORT" /> - <option name="isRedirectInput" value="false" /> - <option name="redirectInputPath" value="" /> - <method v="2" /> - </configuration> -</component> diff --git a/.idea/runConfigurations/Refresh_All.xml b/.idea/runConfigurations/Refresh_All.xml deleted file mode 100644 index 24be845..0000000 --- a/.idea/runConfigurations/Refresh_All.xml +++ /dev/null @@ -1,27 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Refresh All" - type="CompoundRunConfigurationType" - > - <toRun name="Run: Cargo Format" type="CargoCommandRunConfiguration" /> - <toRun - name="Run: Fix Documents Codebox" - type="CargoCommandRunConfiguration" - /> - <toRun - name="Run: Generate Docsify Sidebar" - type="CargoCommandRunConfiguration" - /> - <toRun - name="Run: Sync Examples To Crates" - type="CargoCommandRunConfiguration" - /> - <toRun - name="Run: Sync Examples To Helpdoc" - type="CargoCommandRunConfiguration" - /> - <toRun name="Run: Sync Feature List" type="CargoCommandRunConfiguration" /> - <method v="2" /> - </configuration> -</component> diff --git a/.idea/runConfigurations/Run__Cargo_Format.xml b/.idea/runConfigurations/Run__Cargo_Format.xml deleted file mode 100644 index a99a91d..0000000 --- a/.idea/runConfigurations/Run__Cargo_Format.xml +++ /dev/null @@ -1,23 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Run: Cargo Format" - type="CargoCommandRunConfiguration" - factoryName="Cargo Command" - folderName="Tools" - > - <option name="command" value="fmt" /> - <option name="workingDirectory" value="file://$PROJECT_DIR$" /> - <envs /> - <option name="emulateTerminal" value="true" /> - <option name="channel" value="DEFAULT" /> - <option name="requiredFeatures" value="true" /> - <option name="allFeatures" value="false" /> - <option name="withSudo" value="false" /> - <option name="buildTarget" value="REMOTE" /> - <option name="backtrace" value="SHORT" /> - <option name="isRedirectInput" value="false" /> - <option name="redirectInputPath" value="" /> - <method v="2" /> - </configuration> -</component> diff --git a/.idea/runConfigurations/Run__Deploy_API_Docs.xml b/.idea/runConfigurations/Run__Deploy_API_Docs.xml deleted file mode 100644 index 1a32a64..0000000 --- a/.idea/runConfigurations/Run__Deploy_API_Docs.xml +++ /dev/null @@ -1,28 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Run: Deploy API Docs" - type="CargoCommandRunConfiguration" - factoryName="Cargo Command" - folderName="Tools" - > - <option - name="command" - value="run --manifest-path .run/Cargo.toml --quiet --bin deploy-api-docs" - /> - <option name="workingDirectory" value="file://$PROJECT_DIR$" /> - <envs /> - <option name="emulateTerminal" value="true" /> - <option name="channel" value="DEFAULT" /> - <option name="requiredFeatures" value="true" /> - <option name="allFeatures" value="false" /> - <option name="withSudo" value="false" /> - <option name="buildTarget" value="REMOTE" /> - <option name="backtrace" value="SHORT" /> - <option name="isRedirectInput" value="false" /> - <option name="redirectInputPath" value="" /> - <method v="2"> - <option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" /> - </method> - </configuration> -</component> diff --git a/.idea/runConfigurations/Run__Fix_Documents_Codebox.xml b/.idea/runConfigurations/Run__Fix_Documents_Codebox.xml deleted file mode 100644 index 0863ef1..0000000 --- a/.idea/runConfigurations/Run__Fix_Documents_Codebox.xml +++ /dev/null @@ -1,28 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Run: Fix Documents Codebox" - type="CargoCommandRunConfiguration" - factoryName="Cargo Command" - folderName="Tools" - > - <option - name="command" - value="run --manifest-path .run/Cargo.toml --quiet --bin docs-code-box-fix" - /> - <option name="workingDirectory" value="file://$PROJECT_DIR$" /> - <envs /> - <option name="emulateTerminal" value="true" /> - <option name="channel" value="DEFAULT" /> - <option name="requiredFeatures" value="true" /> - <option name="allFeatures" value="false" /> - <option name="withSudo" value="false" /> - <option name="buildTarget" value="REMOTE" /> - <option name="backtrace" value="SHORT" /> - <option name="isRedirectInput" value="false" /> - <option name="redirectInputPath" value="" /> - <method v="2"> - <option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" /> - </method> - </configuration> -</component> diff --git a/.idea/runConfigurations/Run__Generate_Docsify_Sidebar.xml b/.idea/runConfigurations/Run__Generate_Docsify_Sidebar.xml deleted file mode 100644 index a50a2dd..0000000 --- a/.idea/runConfigurations/Run__Generate_Docsify_Sidebar.xml +++ /dev/null @@ -1,28 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Run: Generate Docsify Sidebar" - type="CargoCommandRunConfiguration" - factoryName="Cargo Command" - folderName="Tools" - > - <option - name="command" - value="run --manifest-path .run/Cargo.toml --quiet --bin docsify-sidebar-gen" - /> - <option name="workingDirectory" value="file://$PROJECT_DIR$" /> - <envs /> - <option name="emulateTerminal" value="true" /> - <option name="channel" value="DEFAULT" /> - <option name="requiredFeatures" value="true" /> - <option name="allFeatures" value="false" /> - <option name="withSudo" value="false" /> - <option name="buildTarget" value="REMOTE" /> - <option name="backtrace" value="SHORT" /> - <option name="isRedirectInput" value="false" /> - <option name="redirectInputPath" value="" /> - <method v="2"> - <option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" /> - </method> - </configuration> -</component> diff --git a/.idea/runConfigurations/Run__Package_All_Crates.xml b/.idea/runConfigurations/Run__Package_All_Crates.xml deleted file mode 100644 index 336c9b3..0000000 --- a/.idea/runConfigurations/Run__Package_All_Crates.xml +++ /dev/null @@ -1,28 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Run: Package All Crates" - type="CargoCommandRunConfiguration" - factoryName="Cargo Command" - folderName="Tools" - > - <option - name="command" - value="run --manifest-path .run/Cargo.toml --quiet --bin package-all" - /> - <option name="workingDirectory" value="file://$PROJECT_DIR$" /> - <envs /> - <option name="emulateTerminal" value="true" /> - <option name="channel" value="DEFAULT" /> - <option name="requiredFeatures" value="true" /> - <option name="allFeatures" value="false" /> - <option name="withSudo" value="false" /> - <option name="buildTarget" value="REMOTE" /> - <option name="backtrace" value="SHORT" /> - <option name="isRedirectInput" value="false" /> - <option name="redirectInputPath" value="" /> - <method v="2"> - <option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" /> - </method> - </configuration> -</component> diff --git a/.idea/runConfigurations/Run__Sync_Examples_To_Crates.xml b/.idea/runConfigurations/Run__Sync_Examples_To_Crates.xml deleted file mode 100644 index 43db9bb..0000000 --- a/.idea/runConfigurations/Run__Sync_Examples_To_Crates.xml +++ /dev/null @@ -1,28 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Run: Sync Examples To Crates" - type="CargoCommandRunConfiguration" - factoryName="Cargo Command" - folderName="Tools" - > - <option - name="command" - value="run --manifest-path .run/Cargo.toml --quiet --bin refresh-docs" - /> - <option name="workingDirectory" value="file://$PROJECT_DIR$" /> - <envs /> - <option name="emulateTerminal" value="true" /> - <option name="channel" value="DEFAULT" /> - <option name="requiredFeatures" value="true" /> - <option name="allFeatures" value="false" /> - <option name="withSudo" value="false" /> - <option name="buildTarget" value="REMOTE" /> - <option name="backtrace" value="SHORT" /> - <option name="isRedirectInput" value="false" /> - <option name="redirectInputPath" value="" /> - <method v="2"> - <option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" /> - </method> - </configuration> -</component> diff --git a/.idea/runConfigurations/Run__Sync_Examples_To_Helpdoc.xml b/.idea/runConfigurations/Run__Sync_Examples_To_Helpdoc.xml deleted file mode 100644 index 8e7faff..0000000 --- a/.idea/runConfigurations/Run__Sync_Examples_To_Helpdoc.xml +++ /dev/null @@ -1,28 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Run: Sync Examples To Helpdoc" - type="CargoCommandRunConfiguration" - factoryName="Cargo Command" - folderName="Tools" - > - <option - name="command" - value="run --manifest-path .run/Cargo.toml --quiet --bin sync-examples" - /> - <option name="workingDirectory" value="file://$PROJECT_DIR$" /> - <envs /> - <option name="emulateTerminal" value="true" /> - <option name="channel" value="DEFAULT" /> - <option name="requiredFeatures" value="true" /> - <option name="allFeatures" value="false" /> - <option name="withSudo" value="false" /> - <option name="buildTarget" value="REMOTE" /> - <option name="backtrace" value="SHORT" /> - <option name="isRedirectInput" value="false" /> - <option name="redirectInputPath" value="" /> - <method v="2"> - <option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" /> - </method> - </configuration> -</component> diff --git a/.idea/runConfigurations/Run__Sync_Feature_List.xml b/.idea/runConfigurations/Run__Sync_Feature_List.xml deleted file mode 100644 index 1e6ed8f..0000000 --- a/.idea/runConfigurations/Run__Sync_Feature_List.xml +++ /dev/null @@ -1,28 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration - default="false" - name="Run: Sync Feature List" - type="CargoCommandRunConfiguration" - factoryName="Cargo Command" - folderName="Tools" - > - <option - name="command" - value="run --manifest-path .run/Cargo.toml --quiet --bin refresh-feature-mod" - /> - <option name="workingDirectory" value="file://$PROJECT_DIR$" /> - <envs /> - <option name="emulateTerminal" value="true" /> - <option name="channel" value="DEFAULT" /> - <option name="requiredFeatures" value="true" /> - <option name="allFeatures" value="false" /> - <option name="withSudo" value="false" /> - <option name="buildTarget" value="REMOTE" /> - <option name="backtrace" value="SHORT" /> - <option name="isRedirectInput" value="false" /> - <option name="redirectInputPath" value="" /> - <method v="2"> - <option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" /> - </method> - </configuration> -</component> diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="VcsDirectoryMappings"> - <mapping directory="" vcs="Git" /> - </component> -</project>
\ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 26460c1..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "Mingling CI", - "command": "cargo ci", - "type": "shell", - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "shared", - "showReuseMessage": true, - "clear": false, - }, - }, - { - "label": "TEST: All *.md Codes", - "command": "cargo dev_tool test-all-markdown-code", - "type": "shell", - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "shared", - "showReuseMessage": true, - "clear": false, - }, - }, - { - "label": "TEST: Current *.md Codes", - "command": "cargo dev_tool test-all-markdown-code -- \"${fileRelative}\"", - "type": "shell", - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "shared", - "showReuseMessage": true, - "clear": false, - }, - }, - { - "label": "REFRESH: All", - "command": "cargo dev_tool refresh-docs && cargo dev_tool docs-code-box-fix && cargo dev_tool docsify-sidebar-gen && cargo dev_tool refresh-feature-mod && cargo dev_tool sync-examples", - "type": "shell", - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "shared", - "showReuseMessage": true, - "clear": false, - }, - }, - { - "label": "REFRESH: Docs Code Box Fix", - "command": "cargo dev_tool docs-code-box-fix", - "type": "shell", - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "shared", - "showReuseMessage": true, - "clear": false, - }, - }, - { - "label": "REFRESH: Docsify Sidebar Gen", - "command": "cargo dev_tool docsify-sidebar-gen", - "type": "shell", - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "shared", - "showReuseMessage": true, - "clear": false, - }, - }, - { - "label": "REFRESH: Docs", - "command": "cargo dev_tool refresh-docs", - "type": "shell", - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "shared", - "showReuseMessage": true, - "clear": false, - }, - }, - { - "label": "REFRESH: Feature Mod", - "command": "cargo dev_tool refresh-feature-mod", - "type": "shell", - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "shared", - "showReuseMessage": true, - "clear": false, - }, - }, - { - "label": "REFRESH: Sync Examples", - "command": "cargo dev_tool sync-examples", - "type": "shell", - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "shared", - "showReuseMessage": true, - "clear": false, - }, - }, - ], -} diff --git a/.zed/settings.json b/.zed/settings.json deleted file mode 100644 index f4a55eb..0000000 --- a/.zed/settings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "lsp": { - "rust-analyzer": { - "initialization_options": { - "checkOnSave": true, - "check": { "command": "clippy" }, - "files": { - "exclude": ["**/target/**", "**/.temp/**"] - }, - "linkedProjects": [ - ".run/Cargo.toml", - "mingling_ci/Cargo.toml", - "mingling_pathf/test/Cargo.toml", - "arg_picker/Cargo.toml", - "arg_picker/test/Cargo.toml", - "mingling_cli/Cargo.toml" - ], - "cargo": { - "features": [] - }, - "procMacro": { - "enable": true, - "attributes": { - "enable": true - } - } - } - } - } -} diff --git a/.zed/tasks.json b/.zed/tasks.json deleted file mode 100644 index 550d950..0000000 --- a/.zed/tasks.json +++ /dev/null @@ -1,71 +0,0 @@ -[ - { - "label": "Mingling CI", - "command": "cargo ci", - "use_new_terminal": true, - "allow_concurrent_runs": false, - "hide": "on_success", - "save": "all", - }, - { - "label": "TEST: All *.md Codes", - "command": "cargo dev_tool test-all-markdown-code", - "use_new_terminal": true, - "allow_concurrent_runs": true, - "hide": "on_success", - "save": "all", - }, - { - "label": "TEST: Current *.md Codes", - "command": "cargo dev_tool test-all-markdown-code -- \"$ZED_RELATIVE_FILE\"", - "use_new_terminal": true, - "allow_concurrent_runs": true, - "hide": "on_success", - "save": "all", - }, - { - "label": "REFRESH: Docs Code Box Fix", - "command": "cargo dev_tool docs-code-box-fix", - "use_new_terminal": true, - "allow_concurrent_runs": true, - "hide": "on_success", - "save": "all", - "tags": ["refresh"], - }, - { - "label": "REFRESH: Docsify Sidebar Gen", - "command": "cargo dev_tool docsify-sidebar-gen", - "use_new_terminal": true, - "allow_concurrent_runs": true, - "hide": "on_success", - "save": "all", - "tags": ["refresh"], - }, - { - "label": "REFRESH: Docs", - "command": "cargo dev_tool refresh-docs", - "use_new_terminal": true, - "allow_concurrent_runs": true, - "hide": "on_success", - "save": "all", - "tags": ["refresh"], - }, - { - "label": "REFRESH: Feature Mod", - "command": "cargo dev_tool refresh-feature-mod", - "use_new_terminal": true, - "allow_concurrent_runs": true, - "hide": "on_success", - "save": "all", - "tags": ["refresh"], - }, - { - "label": "REFRESH: Sync Examples", - "command": "cargo dev_tool sync-examples", - "use_new_terminal": true, - "allow_concurrent_runs": true, - "hide": "on_success", - "save": "all", - "tags": ["refresh"], - }, -] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e34e93..60c1dbe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,35 +1,45 @@ # Contribution Guide -First of all, thank you for your interest in Mingling! 🎉 Whether it's fixing bugs, improving documentation, adding new features, or making suggestions, we welcome all contributions. +First of all, thank you for your interest in Mingling! 🎉 +Whether it's fixing bugs, improving documentation, adding new features, or making suggestions, +we welcome all contributions. Before contributing, we recommend reading [README](README.md) to get an overview of the project. ## 1. Project Structure 📦 -| Category | Path/Name | Description | -| --------------------------- | -------------------- | ----------------------------------------------------------------------- | -| **Entry crate** | `mingling/` | Project entry point | -| **Core library** | `mingling_core/` | Imported as an external dependency | -| **Macro library** | `mingling_macros/` | Imported as an external dependency | -| **Mingling Pathfinder** | `mingling_pathf/` | Build-time module path resolution for types | -| **Mingling Picker2** | `arg_picker/` | Mingling Arguments Parser | -| **Mingling Picker2 Macros** | `arg_picker_macros/` | Mingling Arguments Parser Macros | -| **Scaffolding tool** | `mling/` | Scaffolding tool `mingling-cli` | -| **Examples** | `examples/` | To add expected output tests, add a `test.toml` in the example's dir | -| **Documents** | `docs/` | All documents | -| **Dev Documents** | `docs/dev/` | Internal documents | -| **Resources** | `docs/res/` | All resources | -| **CI system** | `mingling_ci/` | CI crate built on the Mingling framework, invoked via `cargo ci` | -| **CI orchestration** | `.run/src/bin/ci.py` | Full pipeline script (lock → checks → refresh → unlock) | -| **Development tools** | `.run/src/bin` | Contains scripts and Rust tools (`deploy-api-docs`, `install-mling`, …) | -| **CI configs** | `.config/` | `ci-ignored-dirs.txt`, `verified-docs.toml`, `docs-lang.txt` | -| **Temporary files** | `.temp/` | Ignored by `.gitignore` | +| Category | Path/Name | Description | +| ----------------------- | -------------------- | ----------------------------------------------------------------------- | +| Main | | | +| **Entry crate** | `mingling/` | Project entry point | +| **Mingling CLI** | `mingling_cli/` | Mingling's toolchains | +| **Core library** | `mingling_core/` | Imported as an external dependency | +| **Macro library** | `mingling_macros/` | Imported as an external dependency | +| **Mingling Pathfinder** | `mingling_pathf/` | Build-time module path resolution for types | +| **Arg Picker** | `arg_picker/` | Mingling Arguments Parser | +| **Arg Picker Macros** | `arg_picker_macros/` | Mingling Arguments Parser Macros | +| Documents | | | +| **Examples** | `examples/` | To add expected output tests, add a `test.toml` in the example's dir | +| **Help Documents** | `docs/pages/` | User-facing help documents (raw) | +| **Help Documents** | `docs/[LANG]/pages` | User-facing help documents (translations) | +| **Dev Documents** | `docs/dev/` | Internal documents | +| **Resources** | `docs/res/` | All resources | +| Dev Tools | | | +| **CI system** | `dev/ci/` | CI crate built on the Mingling framework, invoked via `cargo ci` | +| **CI configs** | `dev/configs/` | `ci-ignored-dirs.txt`, `verified-docs.toml`, `docs-lang.txt` | +| **CI orchestration** | `.run/src/bin/ci.py` | Full pipeline script (lock → checks → refresh → unlock) | +| **Development tools** | `.run/src/bin` | Contains scripts and Rust tools (`deploy-api-docs`, `install-mling`, …) | +| Misc | | | +| **Temporary files** | `.temp/` | Ignored by `.gitignore` | ## 2. How to Contribute +To ensure your contribution goes smoothly, please choose the guide that best fits your contribution area. + ### Code Contribution -If you'd like to contribute to `mingling`, `mingling_core`, `mingling_macros`, or `mingling_pathf`, first share your idea on the [Github Issue](https://github.com/mingling-rs/mingling/issues) page to confirm before starting work. +If you'd like to contribute to `mingling`, `mingling_core`, `mingling_macros`, or `mingling_pathf`, +first share your idea on the [Github Issue](https://github.com/mingling-rs/mingling/issues) page to confirm before starting work. - **Before making changes**, make sure your branch stays **as close as possible** to the upstream `main` branch. - **After finishing**, run the full CI pipeline locally (see [ABOUT CI](https://mingling-rs.github.io/mingling/docs/dev/#/pages/abouts/ci) for how it works): @@ -38,13 +48,15 @@ If you'd like to contribute to `mingling`, `mingling_core`, `mingling_macros`, o ./run.sh ci ``` -If it passes locally, your changes are most likely correct. (`./run.sh ci` runs `python .run/src/bin/ci.py`, which locks the workspace, runs every check and refresh step, then unlocks — the final unlock fails if the run left the tree dirty.) +If it passes locally, your changes are most likely correct. (`./run.sh ci` runs `python .run/src/bin/ci.py`, +which locks the workspace, runs every check and refresh step, then unlocks — the final unlock fails +if the run left the tree dirty.) ### Example Code Contribution To add or modify examples under `examples/`, follow these rules: -- Place each example in `examples/<example-dir>/` +- Place each example in `examples/{{example-dir}}/` - Each dir must contain a `page.toml` file describing the example's metadata - `page.toml` format: @@ -77,12 +89,6 @@ If you change expected behavior, update the assertions in the example's `test.to After editing examples, run these commands to keep things in sync: ```bash -# Ensure code compiles -cargo ci build-check - -# Ensure code style -cargo ci clippy-check - # Check all examples behave as expected cargo ci example-check @@ -97,11 +103,21 @@ cargo ci example-refresh ### Documentation Contribution -To contribute docs, edit files under `docs/`. For other language translations, refer to the structure under `docs/zh_CN`. +To contribute to the documentation, please edit the files under `docs/`. +For translations into other languages, refer to the directory structure under `docs/zh_CN`. + +> [!Warning] +> +> Mingling's API is currently unstable, so adding documentation content may not be +> the best use of effort at this stage. +> +> It is recommended to **only fix typos, grammar issues, etc.** + +#### Verify -- **When editing docs**, prioritize **Chinese docs** first, then **English docs** — since I ([@Weicao-CatilGrass](https://github.com/Weicao-CatilGrass)) am a native Chinese speaker, this is more efficient. -- If your changes involve code, check the [Code Verify System](https://mingling-rs.github.io/mingling/docs/dev/#/pages/abouts/code-verify-system), which explains how CI checks code. -- **Before submitting**, always run: +Documentation is checked by `cargo ci markdown-check-all` and `cargo ci markdown-compare-all` to ensure that **all** languages have consistent documentation structure and that the code compiles. + +You can verify the documentation with the following commands: ```bash # Fix code box issues and regenerate sidebars @@ -126,7 +142,8 @@ No strict requirements here — just modify the relevant `*.html` files. Preview ### Dev Tool Contribution -`Mingling CI` code is under strict review. If you want to improve `mingling`'s CI pipeline (`mingling_ci/`) or other dev tools (under `.run/`), **please** first file an [Issue](https://github.com/mingling-rs/mingling/issues) and contact [Weicao-CatilGrass](https://github.com/Weicao-CatilGrass)! +`Mingling CI` code is under strict review. If you want to improve `mingling`'s CI pipeline (`dev/ci/`) or other dev tools (under `.run/`), +**please** first file an [Issue](https://github.com/mingling-rs/mingling/issues) and contact [Weicao-CatilGrass](https://github.com/Weicao-CatilGrass)! ## 3. Submission Guide 🖊 @@ -154,30 +171,6 @@ No strict requirements here — just modify the relevant `*.html` files. Preview 6. **Binary Resources** - For binary resource files (images, etc.), please be cautious about adding them to avoid repository bloat -## 4. Documentation Contribution 📕 - -### Documentation Location - -- English documentation: `docs/pages/` -- Chinese documentation: `docs/_zh_CN/pages/` - -### Documentation Build - -After editing documentation, refresh relevant files: - -```bash -# Fix code block blank line issues and regenerate sidebars -cargo ci docsify-refresh - -# Regenerate example docs module and examples index -cargo ci example-refresh -``` - -These steps are part of the full pipeline; `./run.sh ci` executes them automatically and fails if they leave the tree dirty (i.e. the generated files were stale). - -> [!TIP] -> You can check the [ABOUT CI](https://mingling-rs.github.io/mingling/docs/dev/#/pages/abouts/ci) section to learn how "Mingling CI" works. - ## 5. Regarding AI Agent Usage 🤖 - You are free to use AI agents to assist development — no restrictions @@ -191,6 +184,6 @@ Mingling uses the **MIT + Apache 2.0** dual license. For details, please see: - [LICENSE-MIT](LICENSE-MIT) - [LICENSE-APACHE](LICENSE-APACHE) -# Contributors +# Contributors ❤ <img src="https://contrib.rocks/image?repo=mingling-rs/mingling" /> @@ -316,6 +316,10 @@ dependencies = [ [[package]] name = "mingling-workspace" version = "0.5.0" +dependencies = [ + "serde", + "serde_json", +] [[package]] name = "mingling_core" @@ -83,3 +83,7 @@ name = "mingling-workspace" version.workspace = true edition.workspace = true publish = false + +[build-dependencies] +serde.workspace = true +serde_json.workspace = true @@ -176,7 +176,7 @@ This is because the Rust ecosystem already has excellent and mature crates to ha - 📦 Repo - [Github](https://github.com/mingling-rs/mingling) | [Gitee](https://gitee.com/mingling-rs/mingling) | [Origin](https://catilgrass.cn/mingling.git) - 🚪 Mainpage - [Github](https://mingling-rs.github.io/mingling/) | [crates.io](https://crates.io/crates/mingling) - 💡 Examples - [Github](https://mingling-rs.github.io/mingling/docs/examples.html) -- 📖 Help Doc - [EN](https://mingling-rs.github.io/mingling/docs/doc.html#/) | [中文](https://mingling-rs.github.io/mingling/docs/_zh_CN/index.html#/) +- 📖 Help Doc - [EN](https://mingling-rs.github.io/mingling/docs/index.html#/) | [中文](https://mingling-rs.github.io/mingling/docs/_zh_CN/index.html#/) - 📖 API Doc - [docs.rs](https://docs.rs/mingling/latest/mingling/) | [latest](https://mingling-rs.github.io/mingling/docs/api-docs/mingling/) - 📖 Coverage Test - [LLVM Coverage](https://mingling-rs.github.io/mingling/docs/cov-test/) - 📖 Dev Doc - [Github](https://mingling-rs.github.io/mingling/docs/dev/) diff --git a/arg_picker_macros/Cargo.toml b/arg_picker_macros/Cargo.toml index d7bffd2..a824b0d 100644 --- a/arg_picker_macros/Cargo.toml +++ b/arg_picker_macros/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/mingling-rs/mingling/tree/main/arg_picker" authors = ["Weicao-CatilGrass"] readme = "README.md" -description = "Mingling's lightweight argument parser macros" +description = "Macros for arg-picker" [lib] proc-macro = true @@ -1,13 +1,162 @@ -use std::{env::current_dir, fs}; +//! This module initializes the Mingling local repository workspace. +//! +//! It automatically generates necessary files for development. + +use serde_json::Value; +use std::env::current_dir; +use std::fs; fn main() { gen_fake_cargo_toml_in_temp_dir(); + gen_rust_analyzer_config_for_editors(); } +/// Generate a fake Cargo workspace to prevent temporary repositories under `.temp/` +/// from finding the root directory fn gen_fake_cargo_toml_in_temp_dir() { fs::write( - current_dir().unwrap().join(".temp").join("Cargo.toml"), + current_dir().unwrap().join(".temp/Cargo.toml"), "[workspace]", ) .unwrap(); } + +/// Generate Rust Analyzer configuration for editors. +/// +/// Copies the editor configuration at `dev/configs/rust-analyzer.json` to each +/// editor's configuration file. +/// +/// Supported editors: +/// - `Zed Editor` : ".zed/settings.json" +/// - `VS Code`: ".vscode/settings.json" +fn gen_rust_analyzer_config_for_editors() { + // Re-run this build script whenever the source config changes. + println!("cargo:rerun-if-changed=dev/configs/rust-analyzer.json"); + + let root = current_dir().unwrap(); + let source = root.join("dev/configs/rust-analyzer.json"); + let Ok(source_content) = fs::read_to_string(&source) else { + eprintln!( + "warning: `{}` not found, skip editor config generation", + source.display() + ); + return; + }; + + // VS Code uses the same flat `rust-analyzer.*` key format, so copy as-is. + let vscode_path = root.join(".vscode/settings.json"); + if ra_settings::write_if_changed(&vscode_path, &source_content) { + eprintln!("generated {}", vscode_path.display()); + } + + // Zed nests the same settings under `lsp.rust-analyzer.initialization_options`. + let Ok(config) = serde_json::from_str::<Value>(&source_content) else { + eprintln!( + "warning: failed to parse `{}` as JSON, skip Zed config", + source.display() + ); + return; + }; + let zed_path = root.join(".zed/settings.json"); + if ra_settings::write_if_changed( + &zed_path, + &ra_settings::to_pretty_json(&ra_settings::to_zed_settings(&config)), + ) { + eprintln!("generated {}", zed_path.display()); + } +} + +/// Internal helpers for generating editor configuration files. +/// +/// This module contains utilities for writing config files only when their +/// contents change, serializing settings in the repo's preferred JSON style, +/// and converting between the flat `rust-analyzer.*` key format used by VS Code +/// and the nested structure expected by the Zed editor. +mod ra_settings { + + use std::fs; + use std::path::Path; + + use serde::Serialize; + use serde_json::{Map, Value}; + + /// Write `content` to `path` only when it differs, so editors do not reload + /// unchanged settings files on every build. Returns whether a write happened. + pub fn write_if_changed(path: &Path, content: &str) -> bool { + if fs::read_to_string(path).is_ok_and(|existing| existing == content) { + return false; + } + if let Some(parent) = path.parent() { + fs::create_dir_all(parent).unwrap(); + } + fs::write(path, content).unwrap(); + true + } + + /// Serialize a value as 4-space-indented JSON (matching the repo's hand-written + /// config style), with a trailing newline. + pub fn to_pretty_json(value: &Value) -> String { + let mut buf = Vec::new(); + let mut ser = serde_json::Serializer::with_formatter( + &mut buf, + serde_json::ser::PrettyFormatter::with_indent(b" "), + ); + value.serialize(&mut ser).unwrap(); + String::from_utf8(buf).unwrap() + "\n" + } + + /// Convert VSCode-style flat `rust-analyzer.*` keys into the nested + /// `lsp.rust-analyzer.initialization_options` structure that Zed expects. + pub fn to_zed_settings(vscode: &Value) -> Value { + let mut init = Map::new(); + let Some(source) = vscode.as_object() else { + return Value::Object(init); + }; + + let unknown: Vec<&String> = source + .keys() + .filter(|k| !k.starts_with("rust-analyzer.")) + .collect(); + if !unknown.is_empty() { + eprintln!( + "warning: ignoring non-rust-analyzer keys when generating Zed config: {unknown:?}" + ); + } + + for (key, value) in source { + if let Some(rest) = key.strip_prefix("rust-analyzer.") { + insert_nested(&mut init, rest, value.clone()); + } + } + + let mut rust_analyzer = Map::new(); + rust_analyzer.insert("initialization_options".into(), Value::Object(init)); + let mut lsp = Map::new(); + lsp.insert("rust-analyzer".into(), Value::Object(rust_analyzer)); + let mut root = Map::new(); + root.insert("lsp".into(), Value::Object(lsp)); + Value::Object(root) + } + + /// Insert `value` at the dotted path `a.b.c` inside `map`, creating any + /// intermediate objects on the way. + fn insert_nested(map: &mut Map<String, Value>, path: &str, value: Value) { + let Some((head, tail)) = path.split_once('.') else { + map.insert(path.to_string(), value); + return; + }; + + let child = map + .entry(head.to_string()) + .or_insert_with(|| Value::Object(Map::new())); + match child { + Value::Object(child) => insert_nested(child, tail, value), + // A scalar already occupies this path; promote it to an object. + _ => { + let mut fresh = Map::new(); + insert_nested(&mut fresh, tail, value); + *child = Value::Object(fresh); + } + } + } +} diff --git a/mingling_ci/Cargo.lock b/dev/ci/Cargo.lock index 796176a..796176a 100644 --- a/mingling_ci/Cargo.lock +++ b/dev/ci/Cargo.lock diff --git a/mingling_ci/Cargo.toml b/dev/ci/Cargo.toml index c96043b..c96043b 100644 --- a/mingling_ci/Cargo.toml +++ b/dev/ci/Cargo.toml diff --git a/mingling_ci/build.rs b/dev/ci/build.rs index e0bcc0c..e0bcc0c 100644 --- a/mingling_ci/build.rs +++ b/dev/ci/build.rs diff --git a/mingling_ci/help.txt b/dev/ci/help.txt index de006bb..de006bb 100644 --- a/mingling_ci/help.txt +++ b/dev/ci/help.txt diff --git a/mingling_ci/src/bin/ci.rs b/dev/ci/src/bin/ci.rs index 5b1d748..5b1d748 100644 --- a/mingling_ci/src/bin/ci.rs +++ b/dev/ci/src/bin/ci.rs diff --git a/mingling_ci/src/cmd.rs b/dev/ci/src/cmd.rs index b9a02dc..b9a02dc 100644 --- a/mingling_ci/src/cmd.rs +++ b/dev/ci/src/cmd.rs diff --git a/mingling_ci/src/cmd/cmd_git_lock.rs b/dev/ci/src/cmd/cmd_git_lock.rs index 0e9bf22..0e9bf22 100644 --- a/mingling_ci/src/cmd/cmd_git_lock.rs +++ b/dev/ci/src/cmd/cmd_git_lock.rs diff --git a/mingling_ci/src/cmd/cmd_git_unlock.rs b/dev/ci/src/cmd/cmd_git_unlock.rs index 41efefc..41efefc 100644 --- a/mingling_ci/src/cmd/cmd_git_unlock.rs +++ b/dev/ci/src/cmd/cmd_git_unlock.rs diff --git a/mingling_ci/src/cmd/cmd_report_clean.rs b/dev/ci/src/cmd/cmd_report_clean.rs index 976851e..976851e 100644 --- a/mingling_ci/src/cmd/cmd_report_clean.rs +++ b/dev/ci/src/cmd/cmd_report_clean.rs diff --git a/mingling_ci/src/cmd/cmd_report_collect.rs b/dev/ci/src/cmd/cmd_report_collect.rs index 2eff074..2eff074 100644 --- a/mingling_ci/src/cmd/cmd_report_collect.rs +++ b/dev/ci/src/cmd/cmd_report_collect.rs diff --git a/mingling_ci/src/cmd/cmd_show_features.rs b/dev/ci/src/cmd/cmd_show_features.rs index 5fff0c5..5fff0c5 100644 --- a/mingling_ci/src/cmd/cmd_show_features.rs +++ b/dev/ci/src/cmd/cmd_show_features.rs diff --git a/mingling_ci/src/cmd/cmd_show_manifests.rs b/dev/ci/src/cmd/cmd_show_manifests.rs index 2be82d2..2be82d2 100644 --- a/mingling_ci/src/cmd/cmd_show_manifests.rs +++ b/dev/ci/src/cmd/cmd_show_manifests.rs diff --git a/mingling_ci/src/examples.rs b/dev/ci/src/examples.rs index 92d3475..92d3475 100644 --- a/mingling_ci/src/examples.rs +++ b/dev/ci/src/examples.rs diff --git a/mingling_ci/src/git.rs b/dev/ci/src/git.rs index a6fab2c..a6fab2c 100644 --- a/mingling_ci/src/git.rs +++ b/dev/ci/src/git.rs diff --git a/mingling_ci/src/lib.rs b/dev/ci/src/lib.rs index 32a0cbd..32a0cbd 100644 --- a/mingling_ci/src/lib.rs +++ b/dev/ci/src/lib.rs diff --git a/mingling_ci/src/markdown.rs b/dev/ci/src/markdown.rs index 75f2cbe..75f2cbe 100644 --- a/mingling_ci/src/markdown.rs +++ b/dev/ci/src/markdown.rs diff --git a/mingling_ci/src/markdown/compare.rs b/dev/ci/src/markdown/compare.rs index 1bf3c57..1bf3c57 100644 --- a/mingling_ci/src/markdown/compare.rs +++ b/dev/ci/src/markdown/compare.rs diff --git a/mingling_ci/src/markdown/project.rs b/dev/ci/src/markdown/project.rs index d781b7e..d781b7e 100644 --- a/mingling_ci/src/markdown/project.rs +++ b/dev/ci/src/markdown/project.rs diff --git a/mingling_ci/src/markdown/test.rs b/dev/ci/src/markdown/test.rs index 8ecf18d..8ecf18d 100644 --- a/mingling_ci/src/markdown/test.rs +++ b/dev/ci/src/markdown/test.rs diff --git a/mingling_ci/src/progress.rs b/dev/ci/src/progress.rs index bd62ae1..bd62ae1 100644 --- a/mingling_ci/src/progress.rs +++ b/dev/ci/src/progress.rs diff --git a/mingling_ci/src/reporter.rs b/dev/ci/src/reporter.rs index 1a1ac08..1a1ac08 100644 --- a/mingling_ci/src/reporter.rs +++ b/dev/ci/src/reporter.rs diff --git a/mingling_ci/src/res.rs b/dev/ci/src/res.rs index 54ed503..54ed503 100644 --- a/mingling_ci/src/res.rs +++ b/dev/ci/src/res.rs diff --git a/mingling_ci/src/res/collect_logs.rs b/dev/ci/src/res/collect_logs.rs index 6017168..6017168 100644 --- a/mingling_ci/src/res/collect_logs.rs +++ b/dev/ci/src/res/collect_logs.rs diff --git a/mingling_ci/src/res/crate_config.rs b/dev/ci/src/res/crate_config.rs index b20e83d..b20e83d 100644 --- a/mingling_ci/src/res/crate_config.rs +++ b/dev/ci/src/res/crate_config.rs diff --git a/mingling_ci/src/res/features.rs b/dev/ci/src/res/features.rs index 8009514..8009514 100644 --- a/mingling_ci/src/res/features.rs +++ b/dev/ci/src/res/features.rs diff --git a/mingling_ci/src/res/manifests.rs b/dev/ci/src/res/manifests.rs index 91836d6..7c72146 100644 --- a/mingling_ci/src/res/manifests.rs +++ b/dev/ci/src/res/manifests.rs @@ -7,8 +7,8 @@ use crate::ThisProgram; /// Directories whose manifests are excluded from CI checks. /// -/// Path is relative to the crate source file (`mingling_ci/src/res/`). -const IGNORED_DIRS_FILE: &str = include_str!("../../../.config/ci-ignored-dirs.txt"); +/// Path is relative to the crate source file (`dev/ci/src/res/`). +const IGNORED_DIRS_FILE: &str = include_str!("../../../configs/ci-ignored-dirs.txt"); /// All `Cargo.toml` manifests the CI will check. #[derive(Default, Clone)] @@ -27,7 +27,7 @@ pub fn manifests_setup(p: &mut Program<ThisProgram>) { /// Recursively collects every `Cargo.toml` under the current directory, /// skipping the legacy `.run` CI directory and any directory listed in -/// `.config/ci-ignored-dirs.txt`. +/// `dev/configs/ci-ignored-dirs.txt`. #[must_use] fn cargo_tomls() -> Vec<PathBuf> { let ignored = ignored_dirs(); @@ -55,7 +55,7 @@ fn cargo_tomls() -> Vec<PathBuf> { cargo_tomls } -/// Parses `.config/ci-ignored-dirs.txt` into directory prefixes: +/// Parses `dev/configs/ci-ignored-dirs.txt` into directory prefixes: /// non-empty lines that do not start with `#`, with the trailing `/` stripped /// (e.g. `./.temp/` → `./.temp`). fn ignored_dirs() -> Vec<String> { diff --git a/mingling_ci/src/res/print.rs b/dev/ci/src/res/print.rs index 9d844a6..9d844a6 100644 --- a/mingling_ci/src/res/print.rs +++ b/dev/ci/src/res/print.rs diff --git a/mingling_ci/src/task.rs b/dev/ci/src/task.rs index a42e458..a42e458 100644 --- a/mingling_ci/src/task.rs +++ b/dev/ci/src/task.rs diff --git a/mingling_ci/src/task/cmd_build_check.rs b/dev/ci/src/task/cmd_build_check.rs index f67fe2e..f67fe2e 100644 --- a/mingling_ci/src/task/cmd_build_check.rs +++ b/dev/ci/src/task/cmd_build_check.rs diff --git a/mingling_ci/src/task/cmd_clippy_check.rs b/dev/ci/src/task/cmd_clippy_check.rs index a0dd46e..a0dd46e 100644 --- a/mingling_ci/src/task/cmd_clippy_check.rs +++ b/dev/ci/src/task/cmd_clippy_check.rs diff --git a/mingling_ci/src/task/cmd_docs_check.rs b/dev/ci/src/task/cmd_docs_check.rs index 3a77d4d..3a77d4d 100644 --- a/mingling_ci/src/task/cmd_docs_check.rs +++ b/dev/ci/src/task/cmd_docs_check.rs diff --git a/mingling_ci/src/task/cmd_example_check.rs b/dev/ci/src/task/cmd_example_check.rs index 1b9f440..1b9f440 100644 --- a/mingling_ci/src/task/cmd_example_check.rs +++ b/dev/ci/src/task/cmd_example_check.rs diff --git a/mingling_ci/src/task/cmd_markdown_check.rs b/dev/ci/src/task/cmd_markdown_check.rs index 2408636..eb50fe5 100644 --- a/mingling_ci/src/task/cmd_markdown_check.rs +++ b/dev/ci/src/task/cmd_markdown_check.rs @@ -14,7 +14,7 @@ use crate::markdown::test::{MarkdownBlockOutcome, try_test_markdown_project}; use crate::reporter::{self, ReportResult}; use crate::res::{CargoError, MessagePrinter}; -const VERIFIED_DOCS: &str = ".config/verified-docs.toml"; +const VERIFIED_DOCS: &str = "dev/configs/verified-docs.toml"; #[command(node = "markdown-check")] pub async fn markdown_check(args: Vec<String>) -> Next { diff --git a/mingling_ci/src/task/cmd_markdown_compare.rs b/dev/ci/src/task/cmd_markdown_compare.rs index b014f1e..f3a6a1f 100644 --- a/mingling_ci/src/task/cmd_markdown_compare.rs +++ b/dev/ci/src/task/cmd_markdown_compare.rs @@ -15,7 +15,7 @@ use crate::reporter::{self, ReportResult}; use crate::task::cmd_markdown_check::{ErrorMarkdownArgs, ErrorMarkdownConfig, stem_of}; const DOCS_DIR: &str = "./docs"; -const LANG_CONFIG: &str = ".config/docs-lang.txt"; +const LANG_CONFIG: &str = "dev/configs/docs-lang.txt"; /// One file-pair outcome of a structure comparison. struct CompareOutcome { @@ -182,7 +182,7 @@ fn export_outcomes(outcomes: &[CompareOutcome]) -> usize { fail_count } -/// Reads `.config/docs-lang.txt`: the first line is the reference directory +/// Reads `dev/configs/docs-lang.txt`: the first line is the reference directory /// (relative to `./docs/`), the rest are translations that must mirror it. fn lang_config() -> Option<Vec<String>> { let content = std::fs::read_to_string(LANG_CONFIG).ok()?; diff --git a/mingling_ci/src/task/cmd_test.rs b/dev/ci/src/task/cmd_test.rs index 5b9f55a..5b9f55a 100644 --- a/mingling_ci/src/task/cmd_test.rs +++ b/dev/ci/src/task/cmd_test.rs diff --git a/mingling_ci/src/task/run.rs b/dev/ci/src/task/run.rs index ba752dd..ba752dd 100644 --- a/mingling_ci/src/task/run.rs +++ b/dev/ci/src/task/run.rs diff --git a/mingling_ci/src/tools.rs b/dev/ci/src/tools.rs index 13c2ec4..13c2ec4 100644 --- a/mingling_ci/src/tools.rs +++ b/dev/ci/src/tools.rs diff --git a/mingling_ci/src/tools/docsify_refresh.rs b/dev/ci/src/tools/docsify_refresh.rs index dfb9b11..dfb9b11 100644 --- a/mingling_ci/src/tools/docsify_refresh.rs +++ b/dev/ci/src/tools/docsify_refresh.rs diff --git a/mingling_ci/src/tools/example_refresh.rs b/dev/ci/src/tools/example_refresh.rs index ca8443c..056ec60 100644 --- a/mingling_ci/src/tools/example_refresh.rs +++ b/dev/ci/src/tools/example_refresh.rs @@ -17,8 +17,8 @@ use crate::res::{CargoError, MessagePrinter}; const EXAMPLE_ROOT: &str = "./examples"; const EXAMPLE_DOCS_OUTPUT: &str = "./mingling/src/example_docs.rs"; -const EXAMPLE_DOCS_TEMPLATE: &str = include_str!("../../../mingling/src/example_docs.rs.tmpl"); -const EXAMPLES_JSON_OUTPUT: &str = "./docs/example-pages/examples.json"; +const EXAMPLE_DOCS_TEMPLATE: &str = include_str!("../../../../mingling/src/example_docs.rs.tmpl"); +const EXAMPLES_JSON_OUTPUT: &str = "./docs/examples.json"; #[command(node = "example-refresh")] pub fn example_refresh() -> Next { diff --git a/mingling_ci/src/tools/features_refresh.rs b/dev/ci/src/tools/features_refresh.rs index 87aeead..6776fb0 100644 --- a/mingling_ci/src/tools/features_refresh.rs +++ b/dev/ci/src/tools/features_refresh.rs @@ -16,7 +16,7 @@ use crate::res::{CargoError, MessagePrinter}; const CARGO_TOML_PATH: &str = "./mingling/Cargo.toml"; const OUTPUT_PATH: &str = "./mingling/src/features.rs"; -const TEMPLATE_CONTENT: &str = include_str!("../../../mingling/src/features.rs.tmpl"); +const TEMPLATE_CONTENT: &str = include_str!("../../../../mingling/src/features.rs.tmpl"); #[command(node = "features-refresh")] pub fn features_refresh() -> Next { diff --git a/mingling_ci/tmpls/report.md b/dev/ci/tmpls/report.md index 020fda2..020fda2 100644 --- a/mingling_ci/tmpls/report.md +++ b/dev/ci/tmpls/report.md diff --git a/mingling_ci/tmpls/task_section.md b/dev/ci/tmpls/task_section.md index 78c9801..78c9801 100644 --- a/mingling_ci/tmpls/task_section.md +++ b/dev/ci/tmpls/task_section.md diff --git a/.config/ci-ignored-dirs.txt b/dev/configs/ci-ignored-dirs.txt index 08037c9..60b9e6e 100644 --- a/.config/ci-ignored-dirs.txt +++ b/dev/configs/ci-ignored-dirs.txt @@ -2,4 +2,4 @@ ./.temp/ # Self -./mingling_ci/ +./dev/ci/ diff --git a/.config/docs-lang.txt b/dev/configs/docs-lang.txt index 96d4f3c..96d4f3c 100644 --- a/.config/docs-lang.txt +++ b/dev/configs/docs-lang.txt diff --git a/.vscode/settings.json b/dev/configs/rust-analyzer.json index 6a905a8..ab97bf7 100644 --- a/.vscode/settings.json +++ b/dev/configs/rust-analyzer.json @@ -4,7 +4,7 @@ "rust-analyzer.files.exclude": ["**/target/**", "**/.temp/**"], "rust-analyzer.linkedProjects": [ ".run/Cargo.toml", - "mingling_ci/Cargo.toml", + "dev/ci/Cargo.toml", "mingling_pathf/test/Cargo.toml", "arg_picker/Cargo.toml", "arg_picker/test/Cargo.toml", diff --git a/.config/verified-docs.toml b/dev/configs/verified-docs.toml index df2469b..df2469b 100644 --- a/.config/verified-docs.toml +++ b/dev/configs/verified-docs.toml diff --git a/.config/version-files.toml b/dev/configs/version-files.toml index 30fda5e..30fda5e 100644 --- a/.config/version-files.toml +++ b/dev/configs/version-files.toml diff --git a/.run/.gitignore b/dev/run/.gitignore index 40f407e..40f407e 100644 --- a/.run/.gitignore +++ b/dev/run/.gitignore diff --git a/.run/Cargo.lock b/dev/run/Cargo.lock index 3117d0b..3117d0b 100644 --- a/.run/Cargo.lock +++ b/dev/run/Cargo.lock diff --git a/.run/Cargo.toml b/dev/run/Cargo.toml index 4935f2d..4935f2d 100644 --- a/.run/Cargo.toml +++ b/dev/run/Cargo.toml diff --git a/.run/src/bin/ci.py b/dev/run/src/bin/ci.py index 6234a19..6234a19 100644 --- a/.run/src/bin/ci.py +++ b/dev/run/src/bin/ci.py diff --git a/.run/src/bin/clippy-fix.ps1 b/dev/run/src/bin/clippy-fix.ps1 index 1d24f92..1d24f92 100644 --- a/.run/src/bin/clippy-fix.ps1 +++ b/dev/run/src/bin/clippy-fix.ps1 diff --git a/.run/src/bin/clippy-fix.sh b/dev/run/src/bin/clippy-fix.sh index 9771ad4..9771ad4 100755 --- a/.run/src/bin/clippy-fix.sh +++ b/dev/run/src/bin/clippy-fix.sh diff --git a/.run/src/bin/cov-test.rs b/dev/run/src/bin/cov-test.rs index f62ff01..f62ff01 100644 --- a/.run/src/bin/cov-test.rs +++ b/dev/run/src/bin/cov-test.rs diff --git a/.run/src/bin/deploy-api-docs.rs b/dev/run/src/bin/deploy-api-docs.rs index 961eb04..961eb04 100644 --- a/.run/src/bin/deploy-api-docs.rs +++ b/dev/run/src/bin/deploy-api-docs.rs diff --git a/.run/src/bin/display-dependency-order.rs b/dev/run/src/bin/display-dependency-order.rs index a31c67a..a31c67a 100644 --- a/.run/src/bin/display-dependency-order.rs +++ b/dev/run/src/bin/display-dependency-order.rs diff --git a/.run/src/bin/http-page-preview.ps1 b/dev/run/src/bin/http-page-preview.ps1 index 8cc3579..8cc3579 100644 --- a/.run/src/bin/http-page-preview.ps1 +++ b/dev/run/src/bin/http-page-preview.ps1 diff --git a/.run/src/bin/http-page-preview.sh b/dev/run/src/bin/http-page-preview.sh index bed4b1c..bed4b1c 100755 --- a/.run/src/bin/http-page-preview.sh +++ b/dev/run/src/bin/http-page-preview.sh diff --git a/.run/src/bin/install-mling.ps1 b/dev/run/src/bin/install-mling.ps1 index 2b55a09..2b55a09 100644 --- a/.run/src/bin/install-mling.ps1 +++ b/dev/run/src/bin/install-mling.ps1 diff --git a/.run/src/bin/install-mling.sh b/dev/run/src/bin/install-mling.sh index e8cfa18..e8cfa18 100755 --- a/.run/src/bin/install-mling.sh +++ b/dev/run/src/bin/install-mling.sh diff --git a/.run/src/bin/package-all.rs b/dev/run/src/bin/package-all.rs index ecdd133..ecdd133 100644 --- a/.run/src/bin/package-all.rs +++ b/dev/run/src/bin/package-all.rs diff --git a/.run/src/bin/update-version.rs b/dev/run/src/bin/update-version.rs index 2283662..679f419 100644 --- a/.run/src/bin/update-version.rs +++ b/dev/run/src/bin/update-version.rs @@ -56,11 +56,11 @@ fn main() { println_cargo_style!("Version: {} -> {}", current_ver, new_ver); // Read version-files.toml - let config_path = Path::new(".config").join("version-files.toml"); - let config_str = - std::fs::read_to_string(&config_path).expect("Failed to read .config/version-files.toml"); + let config_path = Path::new("dev/configs").join("version-files.toml"); + let config_str = std::fs::read_to_string(&config_path) + .expect("Failed to read dev/configs/version-files.toml"); let config: Config = - toml::from_str(&config_str).expect("Failed to parse .config/version-files.toml"); + toml::from_str(&config_str).expect("Failed to parse dev/configs/version-files.toml"); let mut updated_count = 0; let mut skipped_count = 0; diff --git a/.run/src/bin/windows-folder-hide.ps1 b/dev/run/src/bin/windows-folder-hide.ps1 index ff53202..ff53202 100644 --- a/.run/src/bin/windows-folder-hide.ps1 +++ b/dev/run/src/bin/windows-folder-hide.ps1 diff --git a/.run/src/dependency_order.rs b/dev/run/src/dependency_order.rs index 145bdbd..145bdbd 100644 --- a/.run/src/dependency_order.rs +++ b/dev/run/src/dependency_order.rs diff --git a/.run/src/lib.rs b/dev/run/src/lib.rs index b17a61f..b17a61f 100644 --- a/.run/src/lib.rs +++ b/dev/run/src/lib.rs diff --git a/.run/src/verify.rs b/dev/run/src/verify.rs index b79bb73..b79bb73 100644 --- a/.run/src/verify.rs +++ b/dev/run/src/verify.rs diff --git a/dist/index.html b/dist/index.html index 905e90a..116211f 100644 --- a/dist/index.html +++ b/dist/index.html @@ -908,7 +908,7 @@ mling update</code></pre> >GitHub</a > · - <a href="../docs/doc.html">Docs</a> + <a href="../docs/index.html">Docs</a> </footer> <script src="../docs/scripts/display-parse.js"></script> diff --git a/docs/_zh_CN/index.html b/docs/_zh_CN/index.html index ad21062..d0b9234 100644 --- a/docs/_zh_CN/index.html +++ b/docs/_zh_CN/index.html @@ -41,7 +41,7 @@ " >🌗 主题</a > - <a href="../doc.html"><b>English Docs</b></a> + <a href="../index.html"><b>English Docs</b></a> </nav> <div id="app"></div> diff --git a/docs/dev/README.md b/docs/dev/README.md index 9289fcf..29b7568 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md @@ -4,7 +4,7 @@ Internal development documentation for the <b>Mingling</b> codebase — design notes, issue discussions, and architectural decisions. </p> -This site is separate from the [Helpdoc](https://mingling-rs.github.io/mingling/docs/doc.html). +This site is separate from the [Helpdoc](https://mingling-rs.github.io/mingling/docs/index.html). The helpdoc is user-facing: `tutorials`, `feature guides`, and `how-to content` for developers _using_ Mingling to build CLI applications. diff --git a/docs/dev/index.html b/docs/dev/index.html index 1bfb5c5..327e397 100644 --- a/docs/dev/index.html +++ b/docs/dev/index.html @@ -125,7 +125,7 @@ " >🌓 Theme</a > - <a href="../doc.html">📖 Helpdoc</a> + <a href="../index.html">📖 Helpdoc</a> </nav> <div id="app"></div> diff --git a/docs/dev/pages/abouts/ci.md b/docs/dev/pages/abouts/ci.md index f9a58be..37015eb 100644 --- a/docs/dev/pages/abouts/ci.md +++ b/docs/dev/pages/abouts/ci.md @@ -3,7 +3,7 @@ CI workflow and local execution guide for Mingling </p> -Mingling's CI process is built into the project itself: the execution logic lives in `mingling_ci/`, a separate crate **built on the Mingling framework** — it dogfoods the very library it validates. You can run it locally via the `cargo ci` command, which produces the same results as the `CI` workflow in GitHub Actions. +Mingling's CI process is built into the project itself: the execution logic lives in `dev/ci/`, a separate crate **built on the Mingling framework** — it dogfoods the very library it validates. You can run it locally via the `cargo ci` command, which produces the same results as the `CI` workflow in GitHub Actions. During development, you can run `cargo ci <command>` at any time to verify that your code hasn't introduced regressions. @@ -13,7 +13,7 @@ An alias is defined in `.cargo/config.toml` at the project root: ```toml [alias] -ci = "run --manifest-path mingling_ci/Cargo.toml --bin ci --quiet --" +ci = "run --manifest-path dev/ci/Cargo.toml --bin ci --quiet --" ``` Run a single step: @@ -40,38 +40,38 @@ Every CI step is one subcommand. `cargo ci` with no subcommand prints the help p ### UTILS -| Command | What it does | -| --------------- | ----------------------------------------------------------------------- | +| Command | What it does | +| ---------------- | --------------------------------------------------------------------------------------- | | `report-collect` | Assembles the collected logs in `.temp/reports/collect/` into `.temp/reports/result.md` | -| `report-clean` | Deletes all collected logs and the generated report | -| `git-lock` | Locks the workspace for a CI run (temporary commit, see below) | -| `git-unlock` | Restores the workspace and checks idempotency (see below) | -| `show-manifests` | Prints every crate path that CI will check | -| `show-features` | Prints the `docs.rs` feature list of `mingling` | +| `report-clean` | Deletes all collected logs and the generated report | +| `git-lock` | Locks the workspace for a CI run (temporary commit, see below) | +| `git-unlock` | Restores the workspace and checks idempotency (see below) | +| `show-manifests` | Prints every crate path that CI will check | +| `show-features` | Prints the `docs.rs` feature list of `mingling` | ### TOOLS (refresh) -| Command | What it does | -| ------------------- | --------------------------------------------------------------------------------- | -| `example-refresh` | Regenerates `mingling/src/example_docs.rs` and `docs/example-pages/examples.json` | -| `docsify-refresh` | Fixes docsify code-box blank lines and regenerates `_sidebar.md` files | -| `features-refresh` | Regenerates `mingling/src/features.rs` from `mingling/Cargo.toml` | +| Command | What it does | +| ------------------ | ---------------------------------------------------------------------- | +| `example-refresh` | Regenerates `mingling/src/example_docs.rs` and `docs/examples.json` | +| `docsify-refresh` | Fixes docsify code-box blank lines and regenerates `_sidebar.md` files | +| `features-refresh` | Regenerates `mingling/src/features.rs` from `mingling/Cargo.toml` | These tools **write files**. Running them inside a `git-lock` / `git-unlock` pair turns them into an up-to-date check: if the generated files are stale, the tree becomes dirty and `git-unlock` fails. ### TASKS (checks) -| Command | What it does | -| ----------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `build-check` | Finds all `Cargo.toml` files (minus `.config/ci-ignored-dirs.txt`) and runs `cargo build` per crate in parallel. | -| `clippy-check` | Runs `cargo clippy ... -- -D warnings` for every crate in parallel; any warning fails the check. | -| `test-all` | Runs `cargo test` for every crate in parallel. Each base crate can override its command in its `mingling-ci.toml` (`[test].command`, with `<<<features>>>` expanded from the docs.rs feature list); `arg-picker` uses this to run `cargo test -p arg-picker`. | -| `example-check` | Builds every example and runs the expected-output tests declared in `examples/<example>/test.toml`. | -| `docs-check` | Builds the `mingling` API docs with the `[package.metadata.docs.rs]` features and `-D warnings`. | -| `markdown-check <PATH>` | Verifies the rust code blocks of a single markdown file compile. See [ABOUT_CODE_VERIFY](docs/_ABOUT_CODE_VERIFY.md). | -| `markdown-check-all` | Verifies all markdown files declared in `.config/verified-docs.toml`. | -| `markdown-compare <A> <B>` | Compares the *structure* of two markdown files or directories. | -| `markdown-compare-all` | Checks every translated docs directory mirrors the reference `./docs/pages/` (per `.config/docs-lang.txt`). | +| Command | What it does | +| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `build-check` | Finds all `Cargo.toml` files (minus `dev/configs/ci-ignored-dirs.txt`) and runs `cargo build` per crate in parallel. | +| `clippy-check` | Runs `cargo clippy ... -- -D warnings` for every crate in parallel; any warning fails the check. | +| `test-all` | Runs `cargo test` for every crate in parallel. Each base crate can override its command in its `mingling-ci.toml` (`[test].command`, with `<<<features>>>` expanded from the docs.rs feature list); `arg-picker` uses this to run `cargo test -p arg-picker`. | +| `example-check` | Builds every example and runs the expected-output tests declared in `examples/<example>/test.toml`. | +| `docs-check` | Builds the `mingling` API docs with the `[package.metadata.docs.rs]` features and `-D warnings`. | +| `markdown-check <PATH>` | Verifies the rust code blocks of a single markdown file compile. See [ABOUT_CODE_VERIFY](docs/_ABOUT_CODE_VERIFY.md). | +| `markdown-check-all` | Verifies all markdown files declared in `dev/configs/verified-docs.toml`. | +| `markdown-compare <A> <B>` | Compares the _structure_ of two markdown files or directories. | +| `markdown-compare-all` | Checks every translated docs directory mirrors the reference `./docs/pages/` (per `dev/configs/docs-lang.txt`). | ## Reports @@ -122,7 +122,7 @@ cargo ci git-unlock --show-diff This is what the CI workflow uses: an idempotency failure shows exactly what contaminated the workspace in the job logs. -> **Warning**: when unlocking a `true` lock, changes made *during* CI are discarded. Anything you had before locking comes back. +> **Warning**: when unlocking a `true` lock, changes made _during_ CI are discarded. Anything you had before locking comes back. ## GitHub Actions Workflow @@ -131,16 +131,16 @@ This is what the CI workflow uses: an idempotency failure shows exactly what con - Triggered on `push` to the `main` branch. - A `Check` job runs in a **item × platform** matrix (`ubuntu-latest`, `windows-latest`, `macos-latest`), each combination being `cargo ci <command>` inside a `git-lock` / `git-unlock` pair: -| Matrix item | Command | -| -------------- | -------------------------------------------------------------- | -| `build` | `cargo ci build-check` | -| `clippy` | `cargo ci clippy-check` | -| `test` | `cargo ci test-all` | -| `arg-picker` | `cargo ci test-all` (covered via its `mingling-ci.toml` override) | -| `markdown-code` | `cargo ci markdown-check-all && cargo ci markdown-compare-all` | -| `examples` | `cargo ci example-check` | -| `docs-refresh` | `cargo ci example-refresh` + `docsify-refresh` + `features-refresh` | -| `api-docs` | `cargo ci docs-check` | +| Matrix item | Command | +| --------------- | ------------------------------------------------------------------- | +| `build` | `cargo ci build-check` | +| `clippy` | `cargo ci clippy-check` | +| `test` | `cargo ci test-all` | +| `arg-picker` | `cargo ci test-all` (covered via its `mingling-ci.toml` override) | +| `markdown-code` | `cargo ci markdown-check-all && cargo ci markdown-compare-all` | +| `examples` | `cargo ci example-check` | +| `docs-refresh` | `cargo ci example-refresh` + `docsify-refresh` + `features-refresh` | +| `api-docs` | `cargo ci docs-check` | - Every matrix job uploads its `.temp/reports/collect/` as an artifact — **even on failure**, so failures are always collected. - A `Report` job (runs even when some checks failed) downloads all collect artifacts, runs `cargo ci report-collect`, and publishes `result.md` to the job summary via `$GITHUB_STEP_SUMMARY`. diff --git a/docs/dev/pages/abouts/code-verify-system.md b/docs/dev/pages/abouts/code-verify-system.md index c2a9215..f52052f 100644 --- a/docs/dev/pages/abouts/code-verify-system.md +++ b/docs/dev/pages/abouts/code-verify-system.md @@ -7,7 +7,7 @@ This system automatically extracts and compiles Rust code blocks from docs, ensu ## Config -Specify which Markdown files to verify via `.config/verified-docs.toml`: +Specify which Markdown files to verify via `dev/configs/verified-docs.toml`: ```toml [verified] @@ -210,18 +210,18 @@ Use `@@@` for: ## Structure Overview -| Module | Responsibility | -| --------------------------------------------- | ----------------------------------------------------------------------------------- | -| `mingling_ci/src/markdown/project.rs` | Block parsing, Cargo.toml/main.rs generation, FNV-1a dep hash | -| `mingling_ci/src/markdown/test.rs` | Grouping by dep hash, parallel `cargo check` execution | -| `mingling_ci/src/task/cmd_markdown_check.rs` | `markdown-check` / `markdown-check-all` commands: read config, collect files, report | -| `mingling_ci/src/markdown/compare.rs` | Structural signature comparison (for `markdown-compare`) | -| `mingling_ci/src/task/cmd_markdown_compare.rs`| `markdown-compare` / `markdown-compare-all` commands | -| `.config/verified-docs.toml` | Specifies which doc files to verify | +| Module | Responsibility | +| ----------------------------------------- | ------------------------------------------------------------------------------------ | +| `dev/ci/src/markdown/project.rs` | Block parsing, Cargo.toml/main.rs generation, FNV-1a dep hash | +| `dev/ci/src/markdown/test.rs` | Grouping by dep hash, parallel `cargo check` execution | +| `dev/ci/src/task/cmd_markdown_check.rs` | `markdown-check` / `markdown-check-all` commands: read config, collect files, report | +| `dev/ci/src/markdown/compare.rs` | Structural signature comparison (for `markdown-compare`) | +| `dev/ci/src/task/cmd_markdown_compare.rs` | `markdown-compare` / `markdown-compare-all` commands | +| `dev/configs/verified-docs.toml` | Specifies which doc files to verify | ### Structure Comparison -`markdown-compare` (two files or directories) and `markdown-compare-all` (all languages from `.config/docs-lang.txt`, whose first line is the reference directory) check that every translated docs directory **mirrors the structure** of the reference docs exactly: one token per line classifying headings, fenced code blocks (with language tag), `@@@` lines, blank lines, blockquotes, lists and plain text. Translated text may differ; the structure may not. +`markdown-compare` (two files or directories) and `markdown-compare-all` (all languages from `dev/configs/docs-lang.txt`, whose first line is the reference directory) check that every translated docs directory **mirrors the structure** of the reference docs exactly: one token per line classifying headings, fenced code blocks (with language tag), `@@@` lines, blank lines, blockquotes, lists and plain text. Translated text may differ; the structure may not. ## Full Example diff --git a/docs/example-viewer.html b/docs/example-viewer.html index 0417c30..77232ec 100644 --- a/docs/example-viewer.html +++ b/docs/example-viewer.html @@ -450,7 +450,7 @@ Mìng Lìng </a> <div class="nav-links"> - <a href="doc.html">Docs</a> + <a href="index.html">Docs</a> <a href="examples.html">Examples</a> <a href="https://github.com/mingling-rs/mingling" @@ -553,7 +553,7 @@ exampleName; // ── Load file list from auto-generated JSON ── - fetch("example-pages/examples.json") + fetch("examples.json") .then(function (r) { if (!r.ok) throw new Error("HTTP " + r.status); return r.json(); diff --git a/docs/examples.html b/docs/examples.html index 9d2ae8c..4ea41e8 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -426,7 +426,7 @@ Mìng Lìng </a> <div class="nav-links"> - <a href="doc.html">Docs</a> + <a href="index.html">Docs</a> <a href="examples.html" class="active">Examples</a> <a href="https://github.com/mingling-rs/mingling" @@ -476,7 +476,7 @@ // ── Load examples from auto-generated JSON ── var examples = []; - fetch("example-pages/examples.json") + fetch("examples.json") .then(function (r) { if (!r.ok) throw new Error("HTTP " + r.status); return r.json(); diff --git a/docs/example-pages/examples.json b/docs/examples.json index dd5b65b..dd5b65b 100644 --- a/docs/example-pages/examples.json +++ b/docs/examples.json diff --git a/docs/doc.html b/docs/index.html index a63fdd3..a63fdd3 100644 --- a/docs/doc.html +++ b/docs/index.html diff --git a/docs/LICENSE b/docs/licenses/docsify.md index bec4d76..bec4d76 100644 --- a/docs/LICENSE +++ b/docs/licenses/docsify.md @@ -1151,7 +1151,7 @@ Mìng Lìng </a> <div class="nav-links"> - <a href="docs/doc.html">Docs</a> + <a href="docs/index.html">Docs</a> <a href="docs/examples.html">Examples</a> <a href="https://github.com/mingling-rs/mingling" @@ -1198,7 +1198,7 @@ </p> <div class="cta-row"> - <a href="docs/doc.html" class="btn-primary"> Documents </a> + <a href="docs/index.html" class="btn-primary"> Documents </a> <a href="https://github.com/mingling-rs/mingling" target="_blank" @@ -1928,7 +1928,7 @@ mling proj-init</code></pre> </p> <p><a href="docs/examples.html">Examples</a></p> <p> - <a href="docs/doc.html#/" target="_blank">Help Doc</a> + <a href="docs/index.html#/" target="_blank">Help Doc</a> </p> <p> <a href="docs/_zh_CN/index.html#/" target="_blank" diff --git a/mingling/src/docs/lib.md b/mingling/src/docs/lib.md index 3b1f328..2f8c8b9 100644 --- a/mingling/src/docs/lib.md +++ b/mingling/src/docs/lib.md @@ -80,7 +80,7 @@ See [Examples](EXAMPLES/index.html) or [Helpdoc](https://mingling-rs.github.io/m ## About Features -All features of `Mingling` are opt-in. To learn what each feature provides, see [Features](feature/index.html) or [Helpdoc](https://mingling-rs.github.io/mingling/docs/doc.html#/pages/other/features) +All features of `Mingling` are opt-in. To learn what each feature provides, see [Features](feature/index.html) or [Helpdoc](https://mingling-rs.github.io/mingling/docs/index.html#/pages/other/features) ## Use unreleased version diff --git a/mingling_cli/Cargo.toml b/mingling_cli/Cargo.toml index 19b4c1b..577d2f8 100644 --- a/mingling_cli/Cargo.toml +++ b/mingling_cli/Cargo.toml @@ -7,7 +7,7 @@ repository = "https://github.com/mingling-rs/mingling/tree/main/mingling_cli" authors = ["Weicao-CatilGrass"] readme = "README.md" -description = "Mingling's scaffolding tool for generating, analyzing, and modifying Mingling projects" +description = "Mingling's toolchains for generating, analyzing, and modifying Mingling projects" keywords = ["cli", "cli-framework", "command-line", "tools"] categories = ["command-line-interface"] @@ -83,62 +83,62 @@ function Show-List { $tools = @{} -if (Test-Path ".run/src/bin/*.ps1") { - Get-ChildItem -Path ".run/src/bin/*.ps1" | ForEach-Object { +if (Test-Path "dev/run/src/bin/*.ps1") { + Get-ChildItem -Path "dev/run/src/bin/*.ps1" | ForEach-Object { $tools[$_.BaseName] = @{ Type = "ps1"; Path = $_.FullName } } } -if (Test-Path ".run/src/bin/*.cs") { - Get-ChildItem -Path ".run/src/bin/*.cs" | ForEach-Object { +if (Test-Path "dev/run/src/bin/*.cs") { + Get-ChildItem -Path "dev/run/src/bin/*.cs" | ForEach-Object { $tools[$_.BaseName] = @{ Type = "cs"; Path = $_.FullName } } } -if (Test-Path ".run/src/bin/*.exe") { - Get-ChildItem -Path ".run/src/bin/*.exe" | ForEach-Object { +if (Test-Path "dev/run/src/bin/*.exe") { + Get-ChildItem -Path "dev/run/src/bin/*.exe" | ForEach-Object { $tools[$_.BaseName] = @{ Type = "exe"; Path = $_.FullName } } } -if (Test-Path ".run/src/bin/*.go") { - Get-ChildItem -Path ".run/src/bin/*.go" | ForEach-Object { +if (Test-Path "dev/run/src/bin/*.go") { + Get-ChildItem -Path "dev/run/src/bin/*.go" | ForEach-Object { $tools[$_.BaseName] = @{ Type = "go"; Path = $_.FullName } } } -if (Test-Path ".run/src/bin/*.nim") { - Get-ChildItem -Path ".run/src/bin/*.nim" | ForEach-Object { +if (Test-Path "dev/run/src/bin/*.nim") { + Get-ChildItem -Path "dev/run/src/bin/*.nim" | ForEach-Object { $tools[$_.BaseName] = @{ Type = "nim"; Path = $_.FullName } } } -if (Test-Path ".run/src/bin/*.pl") { - Get-ChildItem -Path ".run/src/bin/*.pl" | ForEach-Object { +if (Test-Path "dev/run/src/bin/*.pl") { + Get-ChildItem -Path "dev/run/src/bin/*.pl" | ForEach-Object { $tools[$_.BaseName] = @{ Type = "pl"; Path = $_.FullName } } } -if (Test-Path ".run/src/bin/*.py") { - Get-ChildItem -Path ".run/src/bin/*.py" | ForEach-Object { +if (Test-Path "dev/run/src/bin/*.py") { + Get-ChildItem -Path "dev/run/src/bin/*.py" | ForEach-Object { $tools[$_.BaseName] = @{ Type = "py"; Path = $_.FullName } } } -if (Test-Path ".run/src/bin/*.rb") { - Get-ChildItem -Path ".run/src/bin/*.rb" | ForEach-Object { +if (Test-Path "dev/run/src/bin/*.rb") { + Get-ChildItem -Path "dev/run/src/bin/*.rb" | ForEach-Object { $tools[$_.BaseName] = @{ Type = "rb"; Path = $_.FullName } } } -if (Test-Path ".run/src/bin/*.rs") { - Get-ChildItem -Path ".run/src/bin/*.rs" | ForEach-Object { +if (Test-Path "dev/run/src/bin/*.rs") { + Get-ChildItem -Path "dev/run/src/bin/*.rs" | ForEach-Object { $tools[$_.BaseName] = @{ Type = "rs"; Path = $_.FullName } } } -if (Test-Path ".run/src/bin/*.zig") { - Get-ChildItem -Path ".run/src/bin/*.zig" | ForEach-Object { +if (Test-Path "dev/run/src/bin/*.zig") { + Get-ChildItem -Path "dev/run/src/bin/*.zig" | ForEach-Object { $tools[$_.BaseName] = @{ Type = "zig"; Path = $_.FullName } } } @@ -200,7 +200,7 @@ switch ($info.Type) { & $info.Path @script_args } "cs" { - $temp_dir = ".run/target/csproj/$target_name" + $temp_dir = "dev/run/target/csproj/$target_name" $null = New-Item -ItemType Directory -Path $temp_dir -Force $props_content = @' @@ -249,7 +249,7 @@ switch ($info.Type) { ruby $info.Path $script_args } "rs" { - if (-not (Test-Path ".run/Cargo.toml")) { + if (-not (Test-Path "dev/run/Cargo.toml")) { @" [package] name = "run_rust" @@ -259,12 +259,12 @@ edition = "2024" [workspace] [dependencies] -"@ | Set-Content -Path ".run/Cargo.toml" +"@ | Set-Content -Path "dev/run/Cargo.toml" } - cargo build --manifest-path ".run/Cargo.toml" --target-dir ".run/target" --bin $target_name --quiet - $binary = ".run/target/debug/$target_name.exe" + cargo build --manifest-path "dev/run/Cargo.toml" --target-dir "dev/run/target" --bin $target_name --quiet + $binary = "dev/run/target/debug/$target_name.exe" if (-not (Test-Path $binary)) { - $binary = ".run/target/debug/$target_name" + $binary = "dev/run/target/debug/$target_name" } & $binary $script_args } @@ -16,14 +16,14 @@ cd "$(dirname "$0")" || exit 1 declare -A tools -for file in .run/src/bin/*.sh; do +for file in dev/run/src/bin/*.sh; do if [ -f "$file" ]; then name=$(basename "$file" .sh) tools["$name"]="sh" fi done -for file in .run/src/bin/*; do +for file in dev/run/src/bin/*; do if [ -f "$file" ]; then name=$(basename "$file") if [[ ! "$name" == *.* ]]; then @@ -32,56 +32,56 @@ for file in .run/src/bin/*; do fi done -for file in .run/src/bin/*.cs; do +for file in dev/run/src/bin/*.cs; do if [ -f "$file" ]; then name=$(basename "$file" .cs) tools["$name"]="cs" fi done -for file in .run/src/bin/*.go; do +for file in dev/run/src/bin/*.go; do if [ -f "$file" ]; then name=$(basename "$file" .go) tools["$name"]="go" fi done -for file in .run/src/bin/*.nim; do +for file in dev/run/src/bin/*.nim; do if [ -f "$file" ]; then name=$(basename "$file" .nim) tools["$name"]="nim" fi done -for file in .run/src/bin/*.pl; do +for file in dev/run/src/bin/*.pl; do if [ -f "$file" ]; then name=$(basename "$file" .pl) tools["$name"]="pl" fi done -for file in .run/src/bin/*.py; do +for file in dev/run/src/bin/*.py; do if [ -f "$file" ]; then name=$(basename "$file" .py) tools["$name"]="py" fi done -for file in .run/src/bin/*.rb; do +for file in dev/run/src/bin/*.rb; do if [ -f "$file" ]; then name=$(basename "$file" .rb) tools["$name"]="rb" fi done -for file in .run/src/bin/*.rs; do +for file in dev/run/src/bin/*.rs; do if [ -f "$file" ]; then name=$(basename "$file" .rs) tools["$name"]="rs" fi done -for file in .run/src/bin/*.zig; do +for file in dev/run/src/bin/*.zig; do if [ -f "$file" ]; then name=$(basename "$file" .zig) tools["$name"]="zig" @@ -241,15 +241,15 @@ type="${tools[$target_name]}" case "$type" in sh) - chmod +x ".run/src/bin/$target_name.sh" - ".run/src/bin/$target_name.sh" "$@" + chmod +x "dev/run/src/bin/$target_name.sh" + "dev/run/src/bin/$target_name.sh" "$@" ;; binary) - chmod +x ".run/src/bin/$target_name" - ".run/src/bin/$target_name" "$@" + chmod +x "dev/run/src/bin/$target_name" + "dev/run/src/bin/$target_name" "$@" ;; cs) - temp_dir=".run/target/csproj/$target_name" + temp_dir="dev/run/target/csproj/$target_name" mkdir -p "$temp_dir" cat > "$temp_dir/Directory.Build.props" <<'PROPS' <Project> @@ -271,27 +271,27 @@ PROPS </Project> CSPROJ - cp ".run/src/bin/$target_name.cs" "$temp_dir/Program.cs" + cp "dev/run/src/bin/$target_name.cs" "$temp_dir/Program.cs" dotnet run --project "$temp_dir/$target_name.csproj" -- "$@" ;; go) - go run ".run/src/bin/$target_name.go" "$@" + go run "dev/run/src/bin/$target_name.go" "$@" ;; nim) - nim r --hints:off ".run/src/bin/$target_name.nim" "$@" + nim r --hints:off "dev/run/src/bin/$target_name.nim" "$@" ;; pl) - perl ".run/src/bin/$target_name.pl" "$@" + perl "dev/run/src/bin/$target_name.pl" "$@" ;; py) - python ".run/src/bin/$target_name.py" "$@" + python "dev/run/src/bin/$target_name.py" "$@" ;; rb) - ruby ".run/src/bin/$target_name.rb" "$@" + ruby "dev/run/src/bin/$target_name.rb" "$@" ;; rs) - if [ ! -f ".run/Cargo.toml" ]; then - cat > ".run/Cargo.toml" <<'EOF' + if [ ! -f "dev/run/Cargo.toml" ]; then + cat > "dev/run/Cargo.toml" <<'EOF' [package] name = "run_rust" version = "0.1.0" @@ -302,10 +302,10 @@ edition = "2024" [dependencies] EOF fi - cargo build --manifest-path ".run/Cargo.toml" --target-dir ".run/target" --bin "$target_name" --quiet - ".run/target/debug/$target_name" "$@" + cargo build --manifest-path "dev/run/Cargo.toml" --target-dir "dev/run/target" --bin "$target_name" --quiet + "dev/run/target/debug/$target_name" "$@" ;; zig) - zig run ".run/src/bin/$target_name.zig" "$@" + zig run "dev/run/src/bin/$target_name.zig" "$@" ;; esac |
