Skip to content

Commit

Permalink
Merge pull request #208 from spiltcoffee/beta
Browse files Browse the repository at this point in the history
postdfm v6.0.0
  • Loading branch information
spiltcoffee authored Jan 26, 2021
2 parents 9022042 + 691e458 commit e1c2cc4
Show file tree
Hide file tree
Showing 123 changed files with 6,651 additions and 3,908 deletions.
6 changes: 6 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
- ./@postdfm/ast2dfm/dist
- ./@postdfm/dfm2ast/dist
- ./@postdfm/dfm2ast/src
- ./@postdfm/plugin/dist
- ./@postdfm/transform/dist

lint:
executor: node-executor
Expand Down Expand Up @@ -138,6 +140,10 @@ jobs:
path: ~/repo/packages/@postdfm/ast2dfm/package.json
- store_artifacts:
path: ~/repo/packages/@postdfm/dfm2ast/package.json
- store_artifacts:
path: ~/repo/packages/@postdfm/plugin/package.json
- store_artifacts:
path: ~/repo/packages/@postdfm/transform/package.json

workflows:
version: 2
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require("./eslint.config")();
module.exports = require("./eslint.config")();
18 changes: 9 additions & 9 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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
```

Expand All @@ -71,15 +71,15 @@ 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
```

To have as many issues as possible fixed by the tools, run:

```bash
~/postdfm (master)
~/postdfm (main)
$ yarn lint:fix
$ yarn format:fix
```
Expand All @@ -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
```

Expand All @@ -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
```

Expand All @@ -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
```

Expand All @@ -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
```

Expand All @@ -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
```

Expand Down
50 changes: 25 additions & 25 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
name: Bug report
about: Create a report to help us improve
title: "[Bug] "
labels: "bug"
assignees: ""
---

### What versions am I using of...

- `nodejs`: x.x.x
- `npm`/`yarn`: x.x.x
- `postdfm`: x.x.x

### What did I do?

### What was I expecting?

### What happened instead?

### What do I think is the problem?

### Am I willing to make a pull request with failing tests to help speed up the fix?

### Am I willing to make a pull request with the fix as well?
---
name: Bug report
about: Create a report to help us improve
title: "[Bug] "
labels: "bug"
assignees: ""
---

### What versions am I using of...

- `nodejs`: x.x.x
- `npm`/`yarn`: x.x.x
- `postdfm`: x.x.x

### What did I do?

### What was I expecting?

### What happened instead?

### What do I think is the problem?

### Am I willing to make a pull request with failing tests to help speed up the fix?

### Am I willing to make a pull request with the fix as well?
22 changes: 11 additions & 11 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature] "
labels: "feature"
assignees: ""
---

### What doesn't `postdfm` do that I would like it to?

### Am I willing to make a pull request with an implementation of the feature?
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature] "
labels: "feature"
assignees: ""
---

### What doesn't `postdfm` do that I would like it to?

### Am I willing to make a pull request with an implementation of the feature?
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname $0)/_/husky.sh"

yarn run commitlint --edit $1
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname $0)/_/husky.sh"

yarn run lint-staged
yarn test
64 changes: 14 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,33 @@
>
> 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

- [Packages](#packages)
- [Installation](#installation)
- [Example Usage](#example-usage)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

## 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` (README)](/packages/postdfm) | [![npm](https://img.shields.io/npm/v/postdfm.svg?label=npm)](https://www.npmjs.com/package/postdfm) |
| [`@postdfm/ast` (README)](/packages/@postdfm/ast) | [![npm](https://img.shields.io/npm/v/@postdfm/ast.svg?label=npm)](https://www.npmjs.com/package/@postdfm/ast) |
| [`@postdfm/ast2dfm` (README)](/packages/@postdfm/ast2dfm) | [![npm](https://img.shields.io/npm/v/@postdfm/ast2dfm.svg?label=npm)](https://www.npmjs.com/package/@postdfm/ast2dfm) |
| [`@postdfm/dfm2ast` (README)](/packages/@postdfm/dfm2ast) | [![npm](https://img.shields.io/npm/v/@postdfm/dfm2ast.svg?label=npm)](https://www.npmjs.com/package/@postdfm/dfm2ast) |
| [`@postdfm/plugin` (README)](/packages/@postdfm/plugin) | [![npm](https://img.shields.io/npm/v/@postdfm/plugin.svg?label=npm)](https://www.npmjs.com/package/@postdfm/plugin) |
| [`@postdfm/transform` (README)](/packages/@postdfm/transform) | [![npm](https://img.shields.io/npm/v/@postdfm/transform.svg?label=npm)](https://www.npmjs.com/package/@postdfm/transform) |

## Installation
## Usage

The `postdfm` project is an interface wrapping all the separate modules together.
See the [`postdfm`](/packages/postdfm) package for usage information.

```shell
# npm
$ npm install postdfm

# yarn
$ yarn add postdfm
```

## Example Usage

```js
const fs = require("fs");
const postdfm = require("postdfm");

const cisDfm = fs.readFileSync(
"cis.dfm",
//.dfm files tend to be ascii instead of utf8
"ascii"
);

const runner = postdfm({
transformers: [
function(ast) {
//transform and return the ast
return transformedAst;
}
]
});

const transDfm = runner.processSync(dfm, {
//filename used for reporting errors
from: "cis.dfm"
});

fs.writeFileSync("trans.dfm", transDfm);
```

See the [`postdfm`](packages/postdfm) package for more information.
See the [`@postdfm/plugin`](/packages/@postdfm/plugin) package for Plugin usage information.

## Contributing

Expand Down
Loading

0 comments on commit e1c2cc4

Please sign in to comment.