From a7e8dba47c2752fdbb78ffc9bb795757e55ad4d4 Mon Sep 17 00:00:00 2001 From: spiltcoffee Date: Tue, 26 Jan 2021 11:26:11 +1100 Subject: [PATCH] docs(readme): updated readmes --- .github/CONTRIBUTING.md | 18 +++++++++--------- README.md | 25 +++++++++++-------------- packages/@postdfm/ast/README.md | 4 ++-- packages/@postdfm/ast2dfm/README.md | 4 ++-- packages/@postdfm/dfm2ast/README.md | 4 ++-- packages/@postdfm/plugin/README.md | 4 ++-- packages/@postdfm/transform/README.md | 4 ++-- packages/postdfm/README.md | 15 +++++---------- 8 files changed, 35 insertions(+), 43 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e9e567b9..83711c4c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -51,7 +51,7 @@ You will need the following software to help develop this project: Before running any commands, you'll likely have to run the following: ```bash -~/postdfm (master) +~/postdfm (main) $ yarn install ``` @@ -60,7 +60,7 @@ $ yarn install In order to see all of the operations that would be run in the Continuous Integration, run: ```bash -~/postdfm (master) +~/postdfm (main) $ yarn ci ``` @@ -71,7 +71,7 @@ We use `prettier` for formatting and `eslint` with `typescript-eslint` for linti To see the linting and formatting issues, run: ```bash -~/postdfm (master) +~/postdfm (main) $ yarn lint:check $ yarn format:check ``` @@ -79,7 +79,7 @@ $ yarn format:check To have as many issues as possible fixed by the tools, run: ```bash -~/postdfm (master) +~/postdfm (main) $ yarn lint:fix $ yarn format:fix ``` @@ -91,7 +91,7 @@ Make sure to run `format:fix` last, as that's what the CI will perform. If there `postdfm` uses TypeScript and Nearley.js, so some compilation is required. Run: ```bash -~/postdfm (master) +~/postdfm (main) $ yarn compile ``` @@ -100,7 +100,7 @@ $ yarn compile `postdfm` uses Jest to run and report coverage of all tests in the project. Run: ```bash -~/postdfm (master) +~/postdfm (main) $ yarn test ``` @@ -109,7 +109,7 @@ $ yarn test Besides the README.md files for each project, `postdfm` uses TypeDoc to produce basic API documentation (viewable online at http://spiltcoffee.com). ```bash -~/postdfm (master) +~/postdfm (main) $ yarn docs ``` @@ -118,7 +118,7 @@ $ yarn docs The release step is performed automatically by the CI. You can run the command, but it won't do anything. ```bash -~/postdfm (master) +~/postdfm (main) $ yarn release ``` @@ -135,7 +135,7 @@ When making a commit, your code in the commit will be automatically linted, form You should try to fix whatever problems are occurring, but if you can't (like you're trying to add failing tests), please commit using the following: ```bash -~/postdfm (master) +~/postdfm (main) $ git commit --no-verify ``` diff --git a/README.md b/README.md index b6f1b517..cae41707 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ > > Inspired by the excellent PostCSS tool, motivated by my rage at the Delphi IDE. -[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/master.svg)](https://circleci.com) -[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/master.svg)](https://codecov.io) +[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/main.svg)](https://circleci.com) +[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/main.svg)](https://codecov.io) [![Known Vulnerabilities](https://snyk.io/test/github/spiltcoffee/postdfm/badge.svg?targetFile=package.json)](https://snyk.io/test/github/spiltcoffee/postdfm?targetFile=package.json) ## Table of Contents @@ -18,12 +18,14 @@ ## Packages -| Package | Version | -| ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | -| [`postdfm`](/packages/postdfm) | [![npm](https://img.shields.io/npm/v/postdfm.svg?label=npm)](https://www.npmjs.com/package/postdfm) | -| [`@postdfm/ast`](/packages/@postdfm/ast) | [![npm](https://img.shields.io/npm/v/@postdfm/ast.svg?label=npm)](https://www.npmjs.com/package/@postdfm/ast) | -| [`@postdfm/ast2dfm`](/packages/@postdfm/ast2dfm) | [![npm](https://img.shields.io/npm/v/@postdfm/ast2dfm.svg?label=npm)](https://www.npmjs.com/package/@postdfm/ast2dfm) | -| [`@postdfm/dfm2ast`](/packages/@postdfm/dfm2ast) | [![npm](https://img.shields.io/npm/v/@postdfm/dfm2ast.svg?label=npm)](https://www.npmjs.com/package/@postdfm/dfm2ast) | +| Package | Version | +| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| [`postdfm`](/packages/postdfm) | [![npm](https://img.shields.io/npm/v/postdfm.svg?label=npm)](https://www.npmjs.com/package/postdfm) | +| [`@postdfm/ast`](/packages/@postdfm/ast) | [![npm](https://img.shields.io/npm/v/@postdfm/ast.svg?label=npm)](https://www.npmjs.com/package/@postdfm/ast) | +| [`@postdfm/ast2dfm`](/packages/@postdfm/ast2dfm) | [![npm](https://img.shields.io/npm/v/@postdfm/ast2dfm.svg?label=npm)](https://www.npmjs.com/package/@postdfm/ast2dfm) | +| [`@postdfm/dfm2ast`](/packages/@postdfm/dfm2ast) | [![npm](https://img.shields.io/npm/v/@postdfm/dfm2ast.svg?label=npm)](https://www.npmjs.com/package/@postdfm/dfm2ast) | +| [`@postdfm/plugin`](/packages/@postdfm/plugin) | [![npm](https://img.shields.io/npm/v/@postdfm/plugin.svg?label=npm)](https://www.npmjs.com/package/@postdfm/plugin) | +| [`@postdfm/transform`](/packages/@postdfm/transform) | [![npm](https://img.shields.io/npm/v/@postdfm/transform.svg?label=npm)](https://www.npmjs.com/package/@postdfm/transform) | ## Installation @@ -50,12 +52,7 @@ const cisDfm = fs.readFileSync( ); const runner = postdfm({ - transformers: [ - function (ast) { - //transform and return the ast - return transformedAst; - }, - ], + transformers: [new Plugin()], }); const transDfm = runner.processSync(dfm, { diff --git a/packages/@postdfm/ast/README.md b/packages/@postdfm/ast/README.md index e6943463..5c039681 100644 --- a/packages/@postdfm/ast/README.md +++ b/packages/@postdfm/ast/README.md @@ -1,8 +1,8 @@ # @postdfm/ast [![npm](https://img.shields.io/npm/v/@postdfm/ast.svg?label=npm)](https://www.npmjs.com/package/@postdfm/ast) -[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/master.svg)](https://circleci.com) -[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/master.svg)](https://codecov.io) +[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/main.svg)](https://circleci.com) +[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/main.svg)](https://codecov.io) [![Known Vulnerabilities](https://snyk.io/test/github/spiltcoffee/postdfm/badge.svg?targetFile=packages/@postdfm/ast/package.json)](https://snyk.io/test/github/spiltcoffee/postdfm?targetFile=packages/@postdfm/ast/package.json) Sub-package for `postdfm`. diff --git a/packages/@postdfm/ast2dfm/README.md b/packages/@postdfm/ast2dfm/README.md index 3ab712eb..81ee1ff9 100644 --- a/packages/@postdfm/ast2dfm/README.md +++ b/packages/@postdfm/ast2dfm/README.md @@ -1,8 +1,8 @@ # @postdfm/ast2dfm [![npm](https://img.shields.io/npm/v/@postdfm/ast2dfm.svg?label=npm)](https://www.npmjs.com/package/@postdfm/ast2dfm) -[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/master.svg)](https://circleci.com) -[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/master.svg)](https://codecov.io) +[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/main.svg)](https://circleci.com) +[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/main.svg)](https://codecov.io) [![Known Vulnerabilities](https://snyk.io/test/github/spiltcoffee/postdfm/badge.svg?targetFile=packages/@postdfm/ast2dfm/package.json)](https://snyk.io/test/github/spiltcoffee/postdfm?targetFile=packages/@postdfm/ast2dfm/package.json) Sub-package for `postdfm`. diff --git a/packages/@postdfm/dfm2ast/README.md b/packages/@postdfm/dfm2ast/README.md index fd84e860..4317c4c8 100644 --- a/packages/@postdfm/dfm2ast/README.md +++ b/packages/@postdfm/dfm2ast/README.md @@ -1,8 +1,8 @@ # @postdfm/dfm2ast [![npm](https://img.shields.io/npm/v/@postdfm/dfm2ast.svg?label=npm)](https://www.npmjs.com/package/@postdfm/dfm2ast) -[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/master.svg)](https://circleci.com) -[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/master.svg)](https://codecov.io) +[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/main.svg)](https://circleci.com) +[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/main.svg)](https://codecov.io) [![Known Vulnerabilities](https://snyk.io/test/github/spiltcoffee/postdfm/badge.svg?targetFile=packages/@postdfm/dfm2ast/package.json)](https://snyk.io/test/github/spiltcoffee/postdfm?targetFile=packages/@postdfm/dfm2ast/package.json) Sub-package for `postdfm`. diff --git a/packages/@postdfm/plugin/README.md b/packages/@postdfm/plugin/README.md index 78e16222..94756fe7 100644 --- a/packages/@postdfm/plugin/README.md +++ b/packages/@postdfm/plugin/README.md @@ -1,8 +1,8 @@ # @postdfm/plugin [![npm](https://img.shields.io/npm/v/@postdfm/plugin.svg?label=npm)](https://www.npmjs.com/package/@postdfm/plugin) -[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/master.svg)](https://circleci.com) -[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/master.svg)](https://codecov.io) +[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/main.svg)](https://circleci.com) +[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/main.svg)](https://codecov.io) [![Known Vulnerabilities](https://snyk.io/test/github/spiltcoffee/postdfm/badge.svg?targetFile=packages/@postdfm/plugin/package.json)](https://snyk.io/test/github/spiltcoffee/postdfm?targetFile=packages/@postdfm/plugin/package.json) Sub-package for `postdfm`. diff --git a/packages/@postdfm/transform/README.md b/packages/@postdfm/transform/README.md index c20f01a7..f0aa193e 100644 --- a/packages/@postdfm/transform/README.md +++ b/packages/@postdfm/transform/README.md @@ -1,8 +1,8 @@ # @postdfm/transform [![npm](https://img.shields.io/npm/v/@postdfm/transform.svg?label=npm)](https://www.npmjs.com/package/@postdfm/transform) -[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/master.svg)](https://circleci.com) -[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/master.svg)](https://codecov.io) +[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/main.svg)](https://circleci.com) +[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/main.svg)](https://codecov.io) [![Known Vulnerabilities](https://snyk.io/test/github/spiltcoffee/postdfm/badge.svg?targetFile=packages/@postdfm/transform/package.json)](https://snyk.io/test/github/spiltcoffee/postdfm?targetFile=packages/@postdfm/transform/package.json) Sub-package for `postdfm`. diff --git a/packages/postdfm/README.md b/packages/postdfm/README.md index 965ff640..e33934cf 100644 --- a/packages/postdfm/README.md +++ b/packages/postdfm/README.md @@ -5,8 +5,8 @@ > Inspired by the excellent PostCSS tool, motivated by my rage at the Delphi IDE. [![npm](https://img.shields.io/npm/v/postdfm.svg?label=npm)](https://www.npmjs.com/package/postdfm) -[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/master.svg)](https://circleci.com) -[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/master.svg)](https://codecov.io) +[![CircleCI branch](https://img.shields.io/circleci/project/github/spiltcoffee/postdfm/main.svg)](https://circleci.com) +[![Codecov branch](https://img.shields.io/codecov/c/gh/spiltcoffee/postdfm/main.svg)](https://codecov.io) [![Known Vulnerabilities](https://snyk.io/test/github/spiltcoffee/postdfm/badge.svg?targetFile=packages/postdfm/package.json)](https://snyk.io/test/github/spiltcoffee/postdfm?targetFile=packages/postdfm/package.json) ## Table of Contents @@ -42,12 +42,7 @@ const cisDfm = fs.readFileSync( ); const runner = postdfm({ - transformers: [ - function (ast) { - //transform and return the ast - return transformedAst; - }, - ], + transformers: [new Plugin()], }); const transDfm = runner.processSync(dfm, { @@ -85,7 +80,7 @@ Process a file through the runner synchronously. Options to pass to an instance of `Runner`. -#### `options.transformers: Transformer[]` +#### `options.plugins: Plugin[]` Array of transformations to perform on AST. @@ -135,7 +130,7 @@ You can find the generated `typedoc` documentation [here](https://spiltcoffee.co Bug reports and feature requests are greatly appreciated, as are pull requests. -Please see the [Contributing Guide](https://github.com/spiltcoffee/postdfm/blob/master/.github/CONTRIBUTING.md) for instructions on how to contribute to this project. +Please see the [Contributing Guide](https://github.com/spiltcoffee/postdfm/blob/main/.github/CONTRIBUTING.md) for instructions on how to contribute to this project. ## License