Skip to content

Commit

Permalink
docs: improve documentation (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
wellwelwel authored Feb 23, 2024
1 parent fa554a6 commit 110ffdc
Show file tree
Hide file tree
Showing 15 changed files with 1,788 additions and 1,645 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
website/* linguist-vendored
website/** linguist-documentation
test/docker/** linguist-vendored
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit"
},
"eslint.validate": ["ts"]
"eslint.validate": ["ts"],
"deno.enable": false
}
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
[bun-version-image]: https://img.shields.io/badge/Bun->=0.5.3-f471b5
[deno-version-url]: https://github.com/denoland/deno
[deno-version-image]: https://img.shields.io/badge/Deno->=1.30.0-70ffaf
[npm-image]: https://img.shields.io/npm/v/poku.svg?color=3dc1d3
[npm-url]: https://npmjs.org/package/poku
[typescript-url]: https://github.com/microsoft/TypeScript
[typescript-version-image]: https://img.shields.io/badge/TypeScript->=5.0.2-3077c6
[ci-url]: https://github.com/wellwelwel/poku/actions/workflows/ci.yml?query=branch%3Amain
[ci-image]: https://img.shields.io/github/actions/workflow/status/wellwelwel/poku/ci.yml?event=push&style=flat&label=CI&branch=main
[ql-url]: https://github.com/wellwelwel/poku/actions/workflows/codeql.yml?query=branch%3Amain
[ql-image]: https://img.shields.io/github/actions/workflow/status/wellwelwel/poku/codeql.yml?event=push&style=flat&label=Code%20QL&branch=main
[license-url]: https://github.com/wellwelwel/poku/blob/main/LICENSE
[license-image]: https://img.shields.io/npm/l/poku.svg?maxAge=2592000&color=9c88ff

# Poku

Expand All @@ -23,8 +20,7 @@
[![Node.js Version][node-version-image]][node-version-url]
[![Bun Version][bun-version-image]][bun-version-url]
[![Deno Version][deno-version-image]][deno-version-url]
[![NPM Version][npm-image]][npm-url]
[![License][license-image]][license-url]
[![TypeScript Version][typescript-version-image]][typescript-url]
[![GitHub Workflow Status (with event)][ci-image]][ci-url]
[![GitHub Workflow Status (with event)][ql-image]][ql-url]

Expand Down
216 changes: 120 additions & 96 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
"test:node": "FILTER='node-' npm run test:ci",
"test:deno": "FILTER='deno-' npm run test:ci",
"test:bun": "FILTER='bun-' npm run test:ci",
"update": "npx npu;",
"prebuild": "rm -rf ./lib ./ci",
"build": "npx tsc; npx tsc -p tsconfig.test.json",
"postbuild": "npx tsx ./tools/compatibility/node.ts; chmod +x lib/bin/index.js; npm audit",
"eslint:checker": "npx eslint . --ext .js,.ts",
"eslint:fix": "npx eslint . --fix --config ./.eslintrc.json",
"lint:checker": "npm run eslint:checker; npm run prettier:checker",
"lint:fix": "npm run eslint:fix; npm run prettier:fix",
"prettier:checker": "npx prettier --check .",
"prettier:fix": "npx prettier --write .github/workflows/*.yml ."
"prettier:fix": "npx prettier --write .github/workflows/*.yml .",
"update": "npx npu; npm i; npm run lint:fix; npm audit"
},
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -78,16 +80,17 @@
"engines": {
"node": ">=6.0.0",
"bun": ">=0.5.3",
"deno": ">=1.17.0"
"deno": ">=1.17.0",
"typescript": ">=5.0.2"
},
"files": [
"lib"
],
"type": "commonjs",
"devDependencies": {
"@types/node": "^20.11.19",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"@types/node": "^20.11.20",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
Expand Down
26 changes: 11 additions & 15 deletions website/docs/documentation/assert/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import TabItem from '@theme/TabItem';

# `assert`

**Poku** includes the `assert` method native from [**Node.js**][node-version-url], keeping everything as it is, but providing human readability.<br/>
It supports both [**Bun**][bun-version-url] and [**Deno**][deno-version-url].

[node-version-url]: https://github.com/nodejs/node
[bun-version-url]: https://github.com/oven-sh/bun
[deno-version-url]: https://github.com/denoland/deno

> _Since **1.3.0**_
>
> [**Node.js**][node-version-url], [**Bun**][bun-version-url] and [**Deno**][deno-version-url] compatible.
- [**Node.js**][node-version-url], [**Bun**][bun-version-url] and [**Deno**][deno-version-url] compatible.

**Poku** includes the `assert` method native from [**Node.js**][node-version-url], keeping everything as it is, but providing human readability.<br/>
It supports both [**Bun**][bun-version-url] and [**Deno**][deno-version-url].
> _Since **1.3.0**_
## Migrating to **Poku**'s `assert`

Expand All @@ -29,11 +29,6 @@ _But only if you want to, of course._
- import assert from 'node:assert';
+ import { assert } from 'poku';
```

```ts
assert(true);
assert.deepStrictEqual(1, '1', 'My optional custom message');
```

</TabItem>
<TabItem value='Deno'>
Expand All @@ -42,15 +37,16 @@ _But only if you want to, of course._
- import assert from 'node:assert';
+ import { assert } from 'npm:poku';
```

```ts
assert(true);
assert.deepStrictEqual(1, '1', 'My optional custom message');
```

</TabItem>
</Tabs>

```ts
assert(true);
assert.deepStrictEqual(1, '1', 'My optional custom message');
// ...
```

## Available methods

- `assert(value[, message])`
Expand Down
39 changes: 22 additions & 17 deletions website/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ import '@site/src/css/features.scss';
[npm-image]: https://img.shields.io/npm/v/poku.svg?color=3dc1d3
[npm-url]: https://npmjs.org/package/poku
[typescript-url]: https://github.com/microsoft/TypeScript
[ci-url]: https://github.com/wellwelwel/poku/actions/workflows/ci.yml?query=branch%3Amain
[ci-image]: https://img.shields.io/github/actions/workflow/status/wellwelwel/poku/ci.yml?event=push&style=flat&label=CI&branch=main
[ql-url]: https://github.com/wellwelwel/poku/actions/workflows/codeql.yml?query=branch%3Amain
[ql-image]: https://img.shields.io/github/actions/workflow/status/wellwelwel/poku/codeql.yml?event=push&style=flat&label=Code%20QL&branch=main
[typescript-version-image]: https://img.shields.io/badge/TypeScript->=5.0.2-3077c6
[typescript-version-image]: https://img.shields.io/badge/TypeScript->=5.0.2-3077c6
[license-url]: https://github.com/wellwelwel/poku/blob/main/LICENSE
[license-image]: https://img.shields.io/npm/l/poku.svg?maxAge=2592000&color=9c88ff

Expand All @@ -41,10 +39,9 @@ import '@site/src/css/features.scss';
[![Node.js Version][node-version-image]][node-version-url]
[![Bun Version][bun-version-image]][bun-version-url]
[![Deno Version][deno-version-image]][deno-version-url]
[![TypeScript Version][typescript-version-image]][typescript-url]
[![NPM Version][npm-image]][npm-url]
[![License][license-image]][license-url]
[![GitHub Workflow Status (with event)][ci-image]][ci-url]
[![GitHub Workflow Status (with event)][ql-image]][ql-url]

Enjoying **Poku**? Consider giving him a star ⭐️

Expand Down Expand Up @@ -81,37 +78,40 @@ Enjoying **Poku**? Consider giving him a star ⭐️

<Tabs>
<TabItem default value='Node.js'>

```bash
npm install --save-dev poku
```

</TabItem>
<TabItem value='TypeScript (Node.js)'>

```bash
npm install --save-dev poku tsx
```

</TabItem>
<TabItem value='Bun'>

```bash
bun add --dev poku
```

</TabItem>
<TabItem value='Deno'>

```ts
import { poku } from 'npm:poku';
```
- **Poku** requires these permissions by default:
- `--allow-read`
- `--allow-env`
- `--allow-run`

</TabItem>
You can also use **Poku** with [**esm.sh**](https://esm.sh):

```ts
import { poku } from 'https://esm.sh/poku';
```

</TabItem>

</Tabs>

<hr />
Expand All @@ -122,7 +122,7 @@ import { poku } from 'npm:poku';

<Tabs>
<TabItem default value='Node.js, TypeScript (Node.js) and Bun'>

```ts
import { poku } from 'poku';

Expand All @@ -145,7 +145,7 @@ await poku(['targetDirA', 'targetDirB']);

<Tabs>
<TabItem default value='Node.js and TypeScript (Node.js)'>

```bash
npx poku targetDirA,targetDirB
```
Expand All @@ -164,6 +164,11 @@ bun poku targetDirA,targetDirB
deno run npm:poku targetDirA,targetDirB
```

**Poku** requires these permissions by default:
- `--allow-read`
- `--allow-env`
- `--allow-run`

</TabItem>
</Tabs>

Expand Down
5 changes: 4 additions & 1 deletion website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ const config: Config = {
customCss: './src/css/custom.scss',
},
blog: false,
googleTagManager: {
containerId: 'GTM-K554VSWG',
},
} satisfies Preset.Options,
],
],

themeConfig: {
image: 'img/social.jpg',
image: 'img/social.png',
navbar: {
logo: {
alt: 'This is Poku',
Expand Down
Loading

0 comments on commit 110ffdc

Please sign in to comment.