Skip to content

Commit

Permalink
Rename to putstack and add a release script
Browse files Browse the repository at this point in the history
  • Loading branch information
Pewtro committed Sep 4, 2023
1 parent 5f418da commit 8a92719
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 732 deletions.
10 changes: 1 addition & 9 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
module.exports = {
root: true,
extends: ['@putro/typescript'],
extends: ['@putstack/typescript'],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.eslint.json'],
},
overrides: [
{
files: ['packages/eslint-config-typescript/**/index.js', 'packages/prettier/index.js'],
rules: {
'unicorn/prefer-module': 'off',
},
},
],
};
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install Dependencies
run: yarn

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ A repository where I can upload various libraries or configurations that I often

## Configurations

- `@putro/eslint-config-typescript` - A strict configuration for ESLint to be used in TypeScript projects.
- It also comes with a `@putro/eslint-config-typescript/base` option that is less strict, and thus might be easier to integrate into existing projects.
- `@putro/prettier-config` - A prettier configuration that has sensible defaults, that should never require adjustment.
- `@putstack/eslint-config-typescript` - A strict configuration for ESLint to be used in TypeScript projects.
- It also comes with a `@putstack/eslint-config-typescript/base` option that is less strict, and thus might be easier to integrate into existing projects.
- `@putstack/prettier-config` - A prettier configuration that has sensible defaults, that should never require adjustment.

## Libraries

Expand Down
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
{
"name": "@putro/root",
"name": "@putstack/root",
"version": "1.0.0",
"license": "MIT",
"author": "Putro",
"description": "Root package for @putro/* packages",
"description": "Root package for @putstack/* packages",
"repository": "https://github.com/Pewtro/putro",
"private": true,
"workspaces": [
"packages/*"
],
"dependencies": {},
"devDependencies": {
"@putro/eslint-config-typescript": "*",
"@putro/prettier-config": "*",
"@types/node": "20.5.6",
"@vitest/coverage-v8": "0.34.3",
"@putstack/eslint-config-typescript": "*",
"@putstack/prettier-config": "*",
"@types/node": "20.5.9",
"@typescript-eslint/rule-tester": "6.6.0",
"eslint": "8.48.0",
"husky": "8.0.3",
"lint-staged": "14.0.1",
"postinstall-postinstall": "2.1.0",
"prettier": "3.0.2",
"typescript": "5.1.6",
"vitest": "0.34.3"
"prettier": "3.0.3",
"typescript": "5.2.2"
},
"peerDependencies": {},
"scripts": {
Expand All @@ -38,5 +37,5 @@
"yarn --silent lint:fix"
]
},
"prettier": "@putro/prettier-config"
"prettier": "@putstack/prettier-config"
}
4 changes: 2 additions & 2 deletions packages/eslint-config-typescript/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ All notable changes to this configuration will be documented in this file.

### Features

- First release of `@putro/eslint-config-typescript` that provides sensible, but strict, defaults for new and existing projects.
- If the default is too strict, there is also a `@putro/eslint-config-typescript/base` that is less strict that you can start out with.
- First release of `@putstack/eslint-config-typescript` that provides sensible, but strict, defaults for new and existing projects.
- If the default is too strict, there is also a `@putstack/eslint-config-typescript/base` that is less strict that you can start out with.
-
8 changes: 4 additions & 4 deletions packages/eslint-config-typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ The default version is quite strict, so an existing project might opt for using
To install this package run the following command in the terminal in the root directory of your application.

```
npm install --save-dev @putro/eslint-config-typescript
npm install --save-dev @putstack/eslint-config-typescript
```

**OR**

```
yarn add -D @putro/eslint-config-typescript
yarn add -D @putstack/eslint-config-typescript
```

## Usage
Expand All @@ -25,7 +25,7 @@ Add this to your config by editing your .eslintrc.cjs or equivalent.

```
{
extends: ['@putro/typescript'],
extends: ['@putstack/typescript'],
}
```

Expand All @@ -34,7 +34,7 @@ To see what is dincluded in which package, please view [this section](#eslint-pl

```
{
extends: ['@putro/typescript/base']
extends: ['@putstack/typescript/base']
}
```

Expand Down
4 changes: 4 additions & 0 deletions packages/eslint-config-typescript/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module.exports = {
extends: ['./base', 'plugin:unicorn/recommended'],
rules: {
//JavaScript Modules (ESM) are too finnicky to be used by default for now.
'unicorn/prefer-module': 'off',
},
};
6 changes: 3 additions & 3 deletions packages/eslint-config-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@putro/eslint-config-typescript",
"name": "@putstack/eslint-config-typescript",
"version": "1.0.0",
"license": "MIT",
"author": "Putro",
Expand All @@ -12,8 +12,8 @@
],
"dependencies": {},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "6.4.1",
"@typescript-eslint/parser": "6.4.1",
"@typescript-eslint/eslint-plugin": "6.5.0",
"@typescript-eslint/parser": "6.5.0",
"eslint-plugin-progress": "0.0.1",
"eslint-plugin-sonarjs": "0.21.0",
"eslint-plugin-unicorn": "48.0.1"
Expand Down
4 changes: 4 additions & 0 deletions packages/eslint-config-typescript/tests/eslint-rule-tester.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester/dist';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const ruleTester = new RuleTester();
8 changes: 4 additions & 4 deletions packages/prettier-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ This is a simple configuration for Prettier that I use across projects.
To install this package run the following command in the terminal in the root directory of your application.

```
npm install --save-dev @putro/prettier-config
npm install --save-dev @putstack/prettier-config
```

**OR**

```
yarn add -D @putro/prettier-config
yarn add -D @putstack/prettier-config
```

## Usage

Add a key in your **package.json** file.

```
"prettier": "@putro/prettier-config"
"prettier": "@putstack/prettier-config"
```

**OR**
Expand All @@ -34,7 +34,7 @@ Create a **prettier.config.js** or **.prettierrc.js** file and export an object.

```
module.exports = {
...require("@putro/prettier-config"),
...require("@putstack/prettier-config"),
endOfLine: 'lf', //to overwriter any configuration
}
```
Expand Down
6 changes: 3 additions & 3 deletions packages/prettier-config/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@putro/prettier-config",
"name": "@putstack/prettier-config",
"version": "1.0.0",
"license": "MIT",
"author": "Putro",
Expand All @@ -17,9 +17,9 @@
],
"dependencies": {},
"devDependencies": {
"prettier": "3.0.2"
"prettier": "3.0.3"
},
"peerDependencies": {
"prettier": ">=3"
"prettier": ">=3.0.3"
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"strict": true,
"skipLibCheck": true
},
"include": ["*.*ts", "*.*js", "packages/**/*"]
"include": ["*.*ts", "*.*js", "packages/**/*"],
}
Loading

0 comments on commit 8a92719

Please sign in to comment.