Update readmes and homepage links (#700)

This commit is contained in:
Elizabeth Craig 2023-03-09 16:18:43 -08:00 коммит произвёл GitHub
Родитель 88970b5b39
Коммит 8484242cfb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 83 добавлений и 58 удалений

Просмотреть файл

@ -3,15 +3,19 @@
[![npm version](https://badge.fury.io/js/just-task.svg)](https://badge.fury.io/js/just-task)
[![NPM Downloads](https://img.shields.io/npm/dm/just-task.svg?style=flat)](https://www.npmjs.com/package/just-task)
`Just` is a library that organizes build tasks for your JS projects. It consists of
<!-- start shared -->
- a build task definition library
- sane preset build flows for node and browser projects featuring TypeScript, Webpack and Jest
`Just` is a library that organizes build tasks for your JS projects. It consists of:
- `just-task`: a build task definition library
- `just-scripts`: sane preset build flows for node and browser projects featuring TypeScript, Webpack and Jest
## Documentation
All the documentation is online at https://microsoft.github.io/just/
<!-- end shared -->
## Building
See the [contributing instructions](./.github/CONTRIBUTING.md).

Просмотреть файл

@ -0,0 +1,18 @@
{
"changes": [
{
"type": "patch",
"comment": "Update readmes and homepage links",
"packageName": "just-scripts",
"email": "elcraig@microsoft.com",
"dependentChangeType": "patch"
},
{
"type": "patch",
"comment": "Update readmes and homepage links",
"packageName": "just-task",
"email": "elcraig@microsoft.com",
"dependentChangeType": "patch"
}
]
}

Просмотреть файл

@ -0,0 +1,17 @@
# just-scripts
[![npm version](https://badge.fury.io/js/just-scripts.svg)](https://badge.fury.io/js/just-scripts)
[![NPM Downloads](https://img.shields.io/npm/dm/just-scripts.svg?style=flat)](https://www.npmjs.com/package/just-scripts)
<!-- start shared -->
`Just` is a library that organizes build tasks for your JS projects. It consists of:
- `just-task`: a build task definition library
- `just-scripts`: sane preset build flows for node and browser projects featuring TypeScript, Webpack and Jest
## Documentation
All the documentation is online at https://microsoft.github.io/just/
<!-- end shared -->

Просмотреть файл

@ -7,6 +7,7 @@
"type": "git",
"url": "https://github.com/microsoft/just"
},
"homepage": "https://microsoft.github.io/just/",
"license": "MIT",
"author": "",
"main": "./lib/index.js",

Просмотреть файл

@ -1,61 +1,17 @@
# Just
# just-task
[![npm version](https://badge.fury.io/js/just-task.svg)](https://badge.fury.io/js/just-task)
[![NPM Downloads](https://img.shields.io/npm/dm/just-task.svg?style=flat)](https://www.npmjs.com/package/just-task)
`Just` is a library that organizes build tasks for your JS projects. It consists of
<!-- start shared -->
- a build task definition library
- sane preset build flows for node and browser projects featuring TypeScript, Webpack and jest
`Just` is a library that organizes build tasks for your JS projects. It consists of:
# Documentation
- `just-task`: a build task definition library
- `just-scripts`: sane preset build flows for node and browser projects featuring TypeScript, Webpack and Jest
## Documentation
All the documentation is online at https://microsoft.github.io/just/
# Building
This README contains only the instructions on how to build and contribute to the project. This is a monorepo that uses the [lerna](https://github.com/lerna/lerna) monorepo management utility. To get started, simply run the following:
`yarn`
and build all the packages this way:
`yarn build`
Development is usually done one package at a time. So go into each package and develop with the innerloop npm script:
```
cd packages/just-task
yarn dev
```
Tests are run with the `test` npm script:
```
cd packages/just-task
yarn test
```
# Packages
| Package | Description |
| ------------------ | --------------------------------------------------------------------------------------- |
| just-task | The task definition library that wraps `undertaker` and `yargs` libraries |
| just-scripts | A reusable preset of frequently used tasks in node and browser projects |
| just-scripts-utils | A set of utilities for `just-scripts` |
| just-task-logger | A shared pretty logger used to display timestamps along with a message |
| documentation | The Docusaurus site content and styles which generates the Github page for this library |
# 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.microsoft.com. Please refer [Contribution guide](https://github.com/microsoft/just/.github/CONTRIBUTING.md) for more details
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., label, 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.
<!-- end shared -->

Просмотреть файл

@ -7,6 +7,7 @@
"type": "git",
"url": "https://github.com/microsoft/just"
},
"homepage": "https://microsoft.github.io/just/",
"license": "MIT",
"author": "Ken Chau <kchau@microsoft.com>",
"main": "lib/index.js",

Просмотреть файл

@ -1,6 +1,34 @@
// @ts-check
const fs = require('fs');
const path = require('path');
const mainReadme = path.resolve(__dirname, '../README.md');
const justTaskReadme = path.resolve(__dirname, '../packages/just-task/README.md');
fs.copyFileSync(mainReadme, justTaskReadme);
const startComment = '<!-- start shared -->';
const endComment = '<!-- end shared -->';
const mainReadmePath = path.resolve(__dirname, '../README.md');
const children = ['just-task', 'just-scripts'];
const mainReadmeContent = fs.readFileSync(mainReadmePath, 'utf8');
function getSharedContent(content, readmePath) {
if (!content.includes(startComment) || !content.includes(endComment)) {
console.error(`Marker comments were deleted from ${readmePath} !`);
console.error(
'Please add them back in the following format around content that should be shared between packages:',
);
console.error(startComment);
console.error(endComment);
process.exit(1);
}
return content.split('<!-- start shared -->')[1].split('<!-- end shared -->')[0];
}
const sharedContent = getSharedContent(mainReadmeContent, mainReadmePath);
for (const childPkg of children) {
const childReadmePath = path.resolve(__dirname, `../packages/${childPkg}/README.md`);
const childReadmeContent = fs.readFileSync(childReadmePath, 'utf8');
const oldSharedContent = getSharedContent(childReadmeContent, childReadmePath);
const newChildReadmeContent = childReadmeContent.replace(oldSharedContent, sharedContent);
fs.writeFileSync(childReadmePath, newChildReadmeContent);
}