Skip to content

Commit

Permalink
chore: convert to aegir project
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Apr 5, 2023
1 parent 2674c56 commit 81d8ba3
Show file tree
Hide file tree
Showing 14 changed files with 284 additions and 56 deletions.
5 changes: 4 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ updates:
directory: "/"
schedule:
interval: daily
time: "11:00"
time: "10:00"
open-pull-requests-limit: 10
commit-message:
prefix: "deps"
prefix-development: "deps(dev)"
8 changes: 8 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Automerge
on: [ pull_request ]

jobs:
automerge:
uses: protocol/.github/.github/workflows/automerge.yml@master
with:
job: 'automerge'
47 changes: 41 additions & 6 deletions .github/workflows/js-test-and-release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

name: test & maybe release
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down Expand Up @@ -96,6 +93,44 @@ jobs:
with:
flags: firefox-webworker

test-webkit:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node: [lts/*]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:webkit
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
flags: webkit

test-webkit-webworker:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node: [lts/*]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:webkit-webworker
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
flags: webkit-webworker

test-electron-main:
needs: check
runs-on: ubuntu-latest
Expand Down Expand Up @@ -125,9 +160,9 @@ jobs:
flags: electron-renderer

release:
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-electron-main, test-electron-renderer]
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-webkit, test-webkit-webworker, test-electron-main, test-electron-renderer]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
node_modules
build
dist
.docs
.coverage
node_modules
package-lock.json
yarn.lock
.vscode
4 changes: 4 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This project is dual licensed under MIT and Apache-2.0.

MIT: https://www.opensource.org/licenses/mit
Apache-2.0: https://www.apache.org/licenses/license-2.0
70 changes: 59 additions & 11 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
# eslint-config-ipfs
# eslint-config-ipfs <!-- omit in toc -->

![Node.js CI][node.js ci]
[![package][version.icon]][package.url]
[![styled with prettier][prettier.icon]][prettier.url]
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/eslint-config-ipfs.svg?style=flat-square)](https://codecov.io/gh/ipfs/eslint-config-ipfs)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/eslint-config-ipfs/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/eslint-config-ipfs/actions/workflows/js-test-and-release.yml?query=branch%3Amain)

> ESLint Shareable Config for IPFS project
## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Usage](#usage)
- [License](#license)
- [Contribute](#contribute)

## Install

```console
$ npm i eslint-config-ipfs
```

This package provides IPFS's .eslintrc as an extensible shared config.

## Usage

Provided configuration contains ESLint rules followed by JS libraries in the JS IPFS ecosystem. It provides slightly separate rule sets for `.js` and `.ts` files. To use this configuration you'll need `.eslintrc` file in your project
Provided configuration contains ESLint rules followed by JS libraries in the JS
IPFS ecosystem. It provides slightly separate rule sets for `.js` and `.ts`
files. To use this configuration you'll need `.eslintrc` file in your project
root with a following content:

```json
Expand All @@ -17,24 +35,54 @@ root with a following content:
}
```

If you use [AEgir][] this config will comes with it, so above `.eslintrc` is only thing you'll need. If you choose to use ESLint directly, you'll need to add this package to your (dev) dependcies and satisfy "typescript" optional peer dependency yourself.

### JS only setup

If you do not have `.ts` files in your tree chances are you don't care about typescript and don't want to add "typescript" dependency. In that case you can use another `.eslintrc` configuration with a following content:
Or a key in your `package.json` with:

```json
{
"extends": "ipfs/js"
"eslintConfig": {
"extends": "ipfs"
}
}
```

If you use [AEgir][] this config will comes with it, so above `.eslintrc` is the
only thing you'll need. If you choose to use ESLint directly, you'll need to add
this package to your (dev) dependencies and satisfy "typescript" peer dependency
yourself.

## License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

## Contribute

Contributions welcome! Please check out [the issues](https://github.com/ipfs/eslint-config-ipfs/issues).

Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.

Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

[node.js ci]: https://github.com/ipfs/eslint-config-ipfs/workflows/Node.js%20CI/badge.svg

[version.icon]: https://img.shields.io/npm/v/eslint-config-ipfs.svg

[package.url]: https://npmjs.org/package/eslint-config-ipfs

[downloads.image]: https://img.shields.io/npm/dm/eslint-config-ipfs.svg

[downloads.url]: https://npmjs.org/package/eslint-config-ipfs

[prettier.icon]: https://img.shields.io/badge/styled_with-prettier-ff69b4.svg

[prettier.url]: https://github.com/prettier/prettier

[ts-jsdoc]: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html

[aegir]: https://github.com/ipfs/aegir "Automated JavaScript project management."
122 changes: 110 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,125 @@
{
"name": "eslint-config-ipfs",
"version": "3.1.7",
"description": "ESLint Shareable Config for IPFS project",
"version": "0.0.0-dev",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/ipfs/eslint-config-ipfs#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/eslint-config-ipfs.git"
},
"bugs": {
"url": "https://github.com/ipfs/eslint-config-ipfs/issues"
},
"homepage": "https://github.com/ipfs/eslint-config-ipfs",
"keywords": [
"eslint",
"eslintconfig",
"ipfs"
],
"license": "(Apache-2.0 AND MIT)",
"main": "index.js",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"main": "src/index.js",
"files": [
"src",
"dist"
],
"eslintConfig": {
"extends": "."
},
"release": {
"branches": [
"main"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"breaking": true,
"release": "major"
},
{
"revert": true,
"release": "patch"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "docs",
"release": "patch"
},
{
"type": "test",
"release": "patch"
},
{
"type": "deps",
"release": "patch"
},
{
"scope": "no-release",
"release": false
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "chore",
"section": "Trivial Changes"
},
{
"type": "docs",
"section": "Documentation"
},
{
"type": "deps",
"section": "Dependencies"
},
{
"type": "test",
"section": "Tests"
}
]
}
}
],
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
"@semantic-release/git"
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check",
"test": "npm run test:node",
"test:node": "tape test/*.js"
"test:node": "aegir test -t node",
"release": "aegir release"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.23.0",
Expand All @@ -30,6 +134,7 @@
"eslint-plugin-promise": "^6.0.0"
},
"devDependencies": {
"aegir": "^38.1.8",
"eslint": "^8.15.0",
"tape": "^5.5.3",
"typescript": "*"
Expand All @@ -38,12 +143,5 @@
"typescript": {
"optional": true
}
},
"eslintConfig": {
"extends": "."
},
"repository": {
"type": "git",
"url": "git://github.com/ipfs/eslint-config-ipfs.git"
}
}
4 changes: 2 additions & 2 deletions index.js → src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ module.exports = {
overrides: [
{
files: ['*.js'],
extends: './js'
extends: './js.js'
},
{
files: ['*.ts'],
extends: './ts'
extends: './ts.js'
}
]
}
File renamed without changes.
2 changes: 1 addition & 1 deletion ts.js → src/ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
project: './tsconfig.json' // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/README.md#parseroptionsproject
},
extends: [
'./js',
'./js.js',
'standard-with-typescript'
],
plugins: [
Expand Down
7 changes: 0 additions & 7 deletions test/basic.js

This file was deleted.

0 comments on commit 81d8ba3

Please sign in to comment.