зеркало из https://github.com/microsoft/rnx-kit.git
docs: add list of packages to main README (#243)
This commit is contained in:
Родитель
25050e7be5
Коммит
7c8dac3391
67
README.md
67
README.md
|
@ -1,14 +1,53 @@
|
|||
|
||||
# Contributing
|
||||
|
||||
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
||||
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
||||
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
|
||||
|
||||
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
|
||||
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
|
||||
provided by the bot. You will only need to do this once across all repos using our CLA.
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
||||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
||||
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
```
|
||||
▄████████ ███▄▄▄▄ ▀████ ▐████▀ ▄█ ▄█▄ ▄█ ███
|
||||
███ ███ ███▀▀▀██▄ ███▌ ████▀ ███ ▄███▀ ███ ▀█████████▄
|
||||
███ ███ ███ ███ ███ ▐███ ███▐██▀ ███▌ ▀███▀▀██
|
||||
▄███▄▄▄▄██▀ ███ ███ ▀███▄███▀ ▄█████▀ ███▌ ███ ▀
|
||||
▀▀███▀▀▀▀▀ ███ ███ ████▀██▄ ▀▀█████▄ ███▌ ███
|
||||
▀███████████ ███ ███ ▐███ ▀███ ███▐██▄ ███ ███
|
||||
███ ███ ███ ███ ▄███ ███▄ ███ ▀███▄ ███ ███
|
||||
███ ███ ▀█ █▀ ████ ███▄ ███ ▀█▀ █▀ ▄████▀
|
||||
███ ███ ▀
|
||||
```
|
||||
|
||||
# rnx-kit
|
||||
|
||||
`rnx-kit` is a collection of tools that are useful for React Native apps and
|
||||
libraries.
|
||||
|
||||
# Packages
|
||||
|
||||
<!-- The following table can be updated by running `yarn update-readme` -->
|
||||
<!-- @rnx-kit start -->
|
||||
|
||||
| Name | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||
| [@rnx-kit/babel-plugin-import-path-remapper](https://github.com/microsoft/rnx-kit/tree/main/packages/babel-plugin-import-path-remapper) | Babel plugin for remapping 'lib/' imports to 'src/' |
|
||||
| [@rnx-kit/babel-preset-metro-react-native](https://github.com/microsoft/rnx-kit/tree/main/packages/babel-preset-metro-react-native) | Babel preset for React Native applications |
|
||||
| [@rnx-kit/bundle-diff](https://github.com/microsoft/rnx-kit/tree/main/packages/bundle-diff) | Simple tool for diffing the content of two bundles |
|
||||
| [@rnx-kit/cli](https://github.com/microsoft/rnx-kit/tree/main/packages/cli) | Command-line interface for rnx-kit |
|
||||
| [@rnx-kit/config](https://github.com/microsoft/rnx-kit/tree/main/packages/config) | Package for defining and querying information about rnx kits |
|
||||
| [@rnx-kit/dep-check](https://github.com/microsoft/rnx-kit/tree/main/packages/dep-check) | Dependency checker for React Native apps |
|
||||
| [@rnx-kit/metro-config](https://github.com/microsoft/rnx-kit/tree/main/packages/metro-config) | Metro config for monorepos |
|
||||
| [@rnx-kit/metro-plugin-cyclic-dependencies-detector](https://github.com/microsoft/rnx-kit/tree/main/packages/metro-plugin-cyclic-dependencies-detector) | Cyclic dependencies detector for Metro |
|
||||
| [@rnx-kit/metro-plugin-duplicates-checker](https://github.com/microsoft/rnx-kit/tree/main/packages/metro-plugin-duplicates-checker) | Duplicate packages checker |
|
||||
| [@rnx-kit/metro-plugin-typescript-validation](https://github.com/microsoft/rnx-kit/tree/main/packages/metro-plugin-typescript-validation) | Typescript validation during Metro bundling |
|
||||
| [@rnx-kit/metro-serializer](https://github.com/microsoft/rnx-kit/tree/main/packages/metro-serializer) | Metro's default JavaScript bundle serializer but with plugin support |
|
||||
| [@rnx-kit/third-party-notices](https://github.com/microsoft/rnx-kit/tree/main/packages/third-party-notices) | Library and tool to build a third party notices file based on a js bundle's source map |
|
||||
| [@rnx-kit/tools](https://github.com/microsoft/rnx-kit/tree/main/packages/tools) | Common tooling for the react-native-sdk |
|
||||
|
||||
<!-- @rnx-kit end -->
|
||||
|
||||
# Contributing
|
||||
|
||||
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
||||
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
||||
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
|
||||
|
||||
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
|
||||
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
|
||||
provided by the bot. You will only need to do this once across all repos using our CLA.
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
||||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
||||
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/rnx-kit.git"
|
||||
"url": "https://github.com/microsoft/rnx-kit.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "lage build --grouped",
|
||||
|
@ -27,12 +27,14 @@
|
|||
"preinstall": "node ./scripts/preinstall.js",
|
||||
"postinstall": "node ./scripts/postinstall.js",
|
||||
"publish:beachball": "beachball publish --bump-deps -m\"📦 applying package updates ***NO_CI***\"",
|
||||
"test": "lage test --verbose --grouped"
|
||||
"test": "lage test --verbose --grouped",
|
||||
"update-readme": "node scripts/update-readme.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.0.0",
|
||||
"beachball": "^2.2.0",
|
||||
"lage": "^0.29.0",
|
||||
"markdown-table": "^2.0.0",
|
||||
"metro": "^0.59.0",
|
||||
"metro-config": "^0.59.0",
|
||||
"metro-react-native-babel-preset": "^0.59.0"
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
const fs = require("fs");
|
||||
const markdownTable = require("markdown-table");
|
||||
const path = require("path");
|
||||
|
||||
const PACKAGE_JSON = "package.json";
|
||||
const PACKAGES = "packages";
|
||||
const README = "README.md";
|
||||
const TOKEN_START = "<!-- @rnx-kit start -->";
|
||||
const TOKEN_END = "<!-- @rnx-kit end -->";
|
||||
|
||||
function readFile(path) {
|
||||
return fs.readFileSync(path, { encoding: "utf-8" });
|
||||
}
|
||||
|
||||
const repoUrl = (() => {
|
||||
const manifest = JSON.parse(readFile(PACKAGE_JSON));
|
||||
return manifest.repository.url.replace(/\.git$/, "");
|
||||
})();
|
||||
|
||||
const packages = fs.readdirSync(PACKAGES).reduce((packages, packageDir) => {
|
||||
const packagePath = path.join(PACKAGES, packageDir);
|
||||
const manifestPath = path.join(packagePath, PACKAGE_JSON);
|
||||
const content = readFile(manifestPath);
|
||||
const manifest = JSON.parse(content);
|
||||
if (!manifest["private"]) {
|
||||
const { name, description } = manifest;
|
||||
const link = `[${name}](${repoUrl}/tree/main/${packagePath})`;
|
||||
packages.push([link, description]);
|
||||
}
|
||||
return packages;
|
||||
}, []);
|
||||
|
||||
const table = markdownTable([["Name", "Description"], ...packages]);
|
||||
|
||||
const readme = readFile(README);
|
||||
const updatedReadme = readme.replace(
|
||||
new RegExp(`${TOKEN_START}([^]+)${TOKEN_END}`),
|
||||
`${TOKEN_START}\n\n${table}\n\n${TOKEN_END}`
|
||||
);
|
||||
|
||||
if (updatedReadme !== readme) {
|
||||
fs.writeFileSync(README, updatedReadme);
|
||||
}
|
|
@ -7035,6 +7035,13 @@ map-visit@^1.0.0:
|
|||
dependencies:
|
||||
object-visit "^1.0.0"
|
||||
|
||||
markdown-table@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b"
|
||||
integrity sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==
|
||||
dependencies:
|
||||
repeat-string "^1.0.0"
|
||||
|
||||
marked-terminal@^4.1.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-4.1.1.tgz#34a6f063cd6cfe26bffaf5bac3724e24242168a9"
|
||||
|
@ -8864,7 +8871,7 @@ repeat-element@^1.1.2:
|
|||
resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce"
|
||||
integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==
|
||||
|
||||
repeat-string@^1.6.1:
|
||||
repeat-string@^1.0.0, repeat-string@^1.6.1:
|
||||
version "1.6.1"
|
||||
resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
|
||||
integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc=
|
||||
|
|
Загрузка…
Ссылка в новой задаче