From 1dc997a8151886687e5891418d8550a6f9dd9621 Mon Sep 17 00:00:00 2001 From: Justin Ma Date: Tue, 3 Oct 2023 10:08:29 +0800 Subject: [PATCH] Update CONTRIBUTING.md and lefthook module (#1092) --- CONTRIBUTING.md | 17 ++++++++--- lefthook.yml | 2 +- package-lock.json | 72 +++++++++++++++++++++++------------------------ package.json | 2 +- 4 files changed, 51 insertions(+), 42 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c24d08abc7c..231e24c5536 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,15 +12,24 @@ This website is based on Vuepress. If you're adding a new page to the book, to make it appear, put it also to `.vuepress/configs/sidebar/{locale}.ts`. +## Display Nu Code Snippets With Syntax Highlighting + +To display Nushell code snippets with syntax highlighting support you can wrap the Nu codes with \```nu \``` or \```nushell \```, for example: + +```nu +# List the top five largest files +ls | where type == file | sort-by -r size | first 5 +``` + ## Translation Guide -1. First of all, make sure you have installed `node.js`, `yarn`, and then clone the doc repo locally: +1. First of all, make sure you have installed `node.js`(v18.12.0 or above), and then clone the doc repo locally: `git clone git@github.com:nushell/nushell.github.io.git nu-docs`; -2. Run `yarn install` in `nu-docs` dir after your cloning; +2. Run `npm install` in `nu-docs` dir after your cloning; 3. Add a book dir(if not exists) for the specified locale in the docs' root folder, say `zh-CN`, and then create a `book` child folder for all your translated documents, and a README.md for the home page of your locale; -4. Modify the vuepress config file `nu-docs/.vuepress/config.js`, add `zh-CN` related configs, here is a [commit](https://github.com/nushell/nushell.github.io/commit/46d1672) for reference; +4. Modify the vuepress config file `nu-docs/.vuepress/config.js`, add `zh-CN` related configs, here is an example [commit](https://github.com/nushell/nushell.github.io/commit/46d1672) for reference; 5. Add README.md in the `book` dir, and that will be the default introduction page of Nushell. Note: Please **DO NOT** translate the file name of the docs. -6. Run `yarn vuepress dev`, then open **http://localhost:8080/** in your browser, switch to the language you are going to translate into, and you will see the introduction page you have just created. You can translate the docs and save them to get a preview in the browser; +6. Run `npm run dev`, then open **http://localhost:8080/** in your browser, switch to the language you are going to translate into, and you will see the introduction page you have just created. You can translate the docs and save them to get a preview in the browser; 7. Update the `nu-docs/i18n-meta.json` file, fill the locale value of the doc you have just finished. It's recommended to use `commit_id@author` or simply a `commit_id` to indicate your translation end to the specified commit; 8. Commit your changes, It's recommended to squash all your commits in one commit with a commit message like this: `Translate your_doc_file.md to zh-CN from commit: f3dc86d3d`; 9. Send a Pull Request; diff --git a/lefthook.yml b/lefthook.yml index c551aa3a318..3b5c1f05e6d 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -11,7 +11,7 @@ # tags: backend security # run: bundle audit # -min_version: 1.4.3 +min_version: 1.5.0 no_tty: false skip_output: - meta # Skips lefthook version printing diff --git a/package-lock.json b/package-lock.json index d7cec037c40..3258ce52db6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@vuepress/plugin-medium-zoom": "2.0.0-beta.67", "@vuepress/plugin-shiki": "^2.0.0-beta.67", "@vuepress/theme-default": "2.0.0-beta.67", - "lefthook": "^1.4.10", + "lefthook": "^1.5.0", "patch-package": "^8.0.0", "prettier": "^3.0.3", "shiki": "^0.14.4", @@ -2844,29 +2844,29 @@ } }, "node_modules/lefthook": { - "version": "1.4.10", - "resolved": "https://registry.npmmirror.com/lefthook/-/lefthook-1.4.10.tgz", - "integrity": "sha512-d0XRT7LoHdPYKNdCQNcIx4arFzTb0fro/PQrwJ1qSLBVlN9ljaYszLqsrVMzTNSPjGU1Pb1FbSw1GMxLG9G8kA==", + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/lefthook/-/lefthook-1.5.0.tgz", + "integrity": "sha512-XDmHDgtWD3wydwdtkZc7Kw7QPp3z+QLIXJeFO+hlZjSUDnezUetKRDByY6YenzEU9Ij4ckKlc4iP7m+fnlwW8A==", "dev": true, "hasInstallScript": true, "bin": { "lefthook": "bin/index.js" }, "optionalDependencies": { - "lefthook-darwin-arm64": "1.4.10", - "lefthook-darwin-x64": "1.4.10", - "lefthook-freebsd-arm64": "1.4.10", - "lefthook-freebsd-x64": "1.4.10", - "lefthook-linux-arm64": "1.4.10", - "lefthook-linux-x64": "1.4.10", - "lefthook-windows-arm64": "1.4.10", - "lefthook-windows-x64": "1.4.10" + "lefthook-darwin-arm64": "1.5.0", + "lefthook-darwin-x64": "1.5.0", + "lefthook-freebsd-arm64": "1.5.0", + "lefthook-freebsd-x64": "1.5.0", + "lefthook-linux-arm64": "1.5.0", + "lefthook-linux-x64": "1.5.0", + "lefthook-windows-arm64": "1.5.0", + "lefthook-windows-x64": "1.5.0" } }, "node_modules/lefthook-darwin-arm64": { - "version": "1.4.10", - "resolved": "https://registry.npmmirror.com/lefthook-darwin-arm64/-/lefthook-darwin-arm64-1.4.10.tgz", - "integrity": "sha512-mHYTdvsevxwQLMtgDKM8igaY7JUwlGpoMQMrjLiuMuW9SSv0Bl8gZtilEWcxOiWxGcIUwV4Xw+90tlwKQlO7Qg==", + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/lefthook-darwin-arm64/-/lefthook-darwin-arm64-1.5.0.tgz", + "integrity": "sha512-URLZLiaIbwCuN9RD9r99udSvLPbsbGpQ4lFEVuWTkdI5f9pKFBv7Kw5wsCRiQk2vYQFP/vINMXQKO4g2NmToSw==", "cpu": [ "arm64" ], @@ -2877,9 +2877,9 @@ ] }, "node_modules/lefthook-darwin-x64": { - "version": "1.4.10", - "resolved": "https://registry.npmmirror.com/lefthook-darwin-x64/-/lefthook-darwin-x64-1.4.10.tgz", - "integrity": "sha512-rfa9AClAS5gXix0eyv0vV70r7s4jt7dWlR6TSky+rRcxWJ88Vay9U1ZpHlVTAh0karaiHrh6e7AQX+7WbGWUBA==", + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/lefthook-darwin-x64/-/lefthook-darwin-x64-1.5.0.tgz", + "integrity": "sha512-IrpnZ7Gw4DGNQhE2tWim2v8XFBO5+8CtaOsI+dvXnDyE8OSN2iyojByuqoA4vsLfrYjoG7AykFzoWp6FZZsRng==", "cpu": [ "x64" ], @@ -2890,9 +2890,9 @@ ] }, "node_modules/lefthook-freebsd-arm64": { - "version": "1.4.10", - "resolved": "https://registry.npmmirror.com/lefthook-freebsd-arm64/-/lefthook-freebsd-arm64-1.4.10.tgz", - "integrity": "sha512-Nh4jEg1OQwsQ+i/kt9XIufQONVj6iEhGWwWoyfycT71wHFCrbNy348Q84EjHTltIUAvE/5jrQdnRDOL6pMZ/Tw==", + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/lefthook-freebsd-arm64/-/lefthook-freebsd-arm64-1.5.0.tgz", + "integrity": "sha512-sVVABorbSa+KWqT/8Sb3PlIlzeO8BQJxBcECRPwjCNd2o34ocVpeZCmRFs5jn3aF+QzUqCSAFyH6XOTvw+G74A==", "cpu": [ "arm64" ], @@ -2903,9 +2903,9 @@ ] }, "node_modules/lefthook-freebsd-x64": { - "version": "1.4.10", - "resolved": "https://registry.npmmirror.com/lefthook-freebsd-x64/-/lefthook-freebsd-x64-1.4.10.tgz", - "integrity": "sha512-3DiI2asrtiYvGXLb6H1ATj7yEj14B6A4c33HLmN5J94PP6rVw6xU2G/PIIAz2wi7/W3igEmuT79F8JJT1mqc7A==", + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/lefthook-freebsd-x64/-/lefthook-freebsd-x64-1.5.0.tgz", + "integrity": "sha512-cHnpP67BWYDTnx6o4eq52JWYuV4dbpGRJeKH3FItnSpiwbmWJlnXgOI5PVfD9uxB8B6KQ4iaaff8zh2pdUaSPA==", "cpu": [ "x64" ], @@ -2916,9 +2916,9 @@ ] }, "node_modules/lefthook-linux-arm64": { - "version": "1.4.10", - "resolved": "https://registry.npmmirror.com/lefthook-linux-arm64/-/lefthook-linux-arm64-1.4.10.tgz", - "integrity": "sha512-gXwTaEYYLfIIPX2Z63aijPSqmvZf003OKjhBB1Og74qWDxfhKs4zZXoWEdc1BARq6U9hImKdyOD/zDc31uB4mw==", + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/lefthook-linux-arm64/-/lefthook-linux-arm64-1.5.0.tgz", + "integrity": "sha512-gPB+Tta9xt3dDcB539uSHvKAE3bcxmWbkkQpW3NGlKJOoSLbtHEFd9ZJlNXTJryNxf3zR0uPZj3z4YvfsQUeug==", "cpu": [ "arm64" ], @@ -2929,9 +2929,9 @@ ] }, "node_modules/lefthook-linux-x64": { - "version": "1.4.10", - "resolved": "https://registry.npmmirror.com/lefthook-linux-x64/-/lefthook-linux-x64-1.4.10.tgz", - "integrity": "sha512-svWdDgk2hXpcE37yY27DTbyIgnJuqofrNc30cmHonLO3VQC5CyLwp45CiNtY6qxW0UVBxqSuGuZcB2TPZQfyWQ==", + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/lefthook-linux-x64/-/lefthook-linux-x64-1.5.0.tgz", + "integrity": "sha512-Y3GiUC+8inZpA1bKI0LT9huk0ZGB1VCItdltys5Xe9FCFtkYYgBt981jTjiy2uxDy18DpWnDBlVwjhpyS6kYGw==", "cpu": [ "x64" ], @@ -2942,9 +2942,9 @@ ] }, "node_modules/lefthook-windows-arm64": { - "version": "1.4.10", - "resolved": "https://registry.npmmirror.com/lefthook-windows-arm64/-/lefthook-windows-arm64-1.4.10.tgz", - "integrity": "sha512-ntP30mgAdcbDP1fqL6CXn/60tLXVVYQo0aDLLcI/oBI2ff1Im6zeBDVtujv33KdDVrx5Mu9qi7bQstgG02PzvA==", + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/lefthook-windows-arm64/-/lefthook-windows-arm64-1.5.0.tgz", + "integrity": "sha512-A/sLFrVy1Ivzz61Exv+ymM1T21d/7sraR9+SjpvJ5rz01GhZHbs0Y+T2R/cO0vJfN56gGW+lRrLDEk6UkbURCQ==", "cpu": [ "arm64" ], @@ -2955,9 +2955,9 @@ ] }, "node_modules/lefthook-windows-x64": { - "version": "1.4.10", - "resolved": "https://registry.npmmirror.com/lefthook-windows-x64/-/lefthook-windows-x64-1.4.10.tgz", - "integrity": "sha512-MwEGtGpe6EJPfE5jvtxvHsmn2/sQP7+zo2FUf87o2CafmqAOR/R7EvQ7qeg6z6T33cWxnyQSBN23tV10bKhtOQ==", + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/lefthook-windows-x64/-/lefthook-windows-x64-1.5.0.tgz", + "integrity": "sha512-FBAEhsAXaPMj0dN9a7/GFxaY1N9i1NRbr9TnEDId4lsdNvN3+Al1jNYoTuDRkH5Z5UipruR3j7KhiHX4T+K8cw==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index 4cc8e46586d..8597de7be42 100755 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@vuepress/plugin-medium-zoom": "2.0.0-beta.67", "@vuepress/plugin-shiki": "^2.0.0-beta.67", "@vuepress/theme-default": "2.0.0-beta.67", - "lefthook": "^1.4.10", + "lefthook": "^1.5.0", "patch-package": "^8.0.0", "prettier": "^3.0.3", "shiki": "^0.14.4",