Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(): added docs, update presets #42

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ node_modules
.yarn/install-state.gz

# testing
/coverage
coverage

# production
# build
lib
build
buildInfo.json
Expand All @@ -19,6 +19,3 @@ buildInfo.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Ignore build files
buildInfo.json
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Extend preset:
"src/**/*"
]
}
``````
```

## @chyzwar/eslint-config

Expand Down
1 change: 1 addition & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

{
"workspaces": [
"packages/*",
Expand Down
24 changes: 24 additions & 0 deletions packages/eslint-config/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## @chyzwar/eslint-config

Strict preset for eslint. Intention is to include plugin dependacies and make it easy manage configs in one place. It support number of sub-presets:

- node
- react

### Instalation

```
yarn add eslint @chyzwar/eslint-config
```

### Examples

Example of usage in eslint.cjs
```js
module.exports = {
extends: "@hyper/eslint-config/node",
parserOptions: {
tsconfigRootDir: __dirname,
},
};
```
10 changes: 10 additions & 0 deletions packages/eslint-config/rules/typescript.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@

module.exports = {

/**
* @see https://typescript-eslint.io/rules/consistent-type-exports
*/
"@typescript-eslint/consistent-type-exports": "error",

/**
* @see https://typescript-eslint.io/rules/consistent-type-imports
*/
"@typescript-eslint/consistent-type-imports": "error",

/**
* Good rule but do not play nicely with Promises
* @see https://github.com/typescript-eslint/typescript-eslint/issues/1956
Expand Down
64 changes: 62 additions & 2 deletions packages/runner/Readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,68 @@
# Runnner
## Runnner

Simple task runner inspired by:

- [just](https://github.com/microsoft/just)
- [undertaker](https://github.com/gulpjs/undertaker)

## Examples
### Instalation

yarn add @chyzwar/runner

### Examples

Example of config file runner.config.js
```js
import {spawnTask, dockerTask, parallelTask, seriesTask} from "@hyper/runner";

spawnTask("build:watch",
"yarn", ["build:watch"],
);

spawnTask("start:ui",
"yarn", ["start"],
{
cwd: "./packages/ui"
}
);
spawnTask("build:ui",
"yarn", ["build"],
{
cwd: "./packages/ui"
}
);

spawnTask("start:api",
"yarn", ["start"],
{
cwd: "./packages/api"
}
);
spawnTask("build:api",
"yarn", ["build"],
{
cwd: "./packages/api"
}
);

dockerTask("postgres", "postgres", {
interactive: true,
rm: true,
name: "PostgresDB",
ports: [
"5434:5432"
],
env: {
POSTGRES_PASSWORD: "postgres",
},
});


seriesTask("start:prod", ["build:api", "build:ui", "start:api:prod"])
parallelTask("start", [
"build:watch",
"postgres",
"start:api",
"start:ui"
])
```
24 changes: 24 additions & 0 deletions packages/tsconfig/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## @chyzwar/tsconfig

### Instalation
```
yarn add "@chyzwar/tsconfig
```

### Usage

Extend preset:

```json
{
"extends": "@chyzwar/tsconfig/lib.json",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src",
"tsBuildInfoFile": "./lib/buildInfo.json"
},
"include": [
"src/**/*"
]
}
```
4 changes: 2 additions & 2 deletions packages/tsconfig/api.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compileOnSave": true,
"compilerOptions": {
"moduleResolution": "node16",
"module": "ES2022",
"moduleResolution": "Node16",
"module": "Node16",
"target": "ES2022",
"newLine": "lf",
"jsx": "react",
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfig/bundler.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"allowUnreachableCode": false,
"strict": true,
"alwaysStrict": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": false,
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfig/lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"allowUnreachableCode": false,
"strict": true,
"alwaysStrict": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": false,
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfig/react.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"allowUnreachableCode": false,
"strict": true,
"alwaysStrict": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": false,
Expand Down