Skip to content

Commit

Permalink
update dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bisquit committed Aug 23, 2023
1 parent 565755f commit add4c33
Show file tree
Hide file tree
Showing 25 changed files with 316 additions and 770 deletions.
7 changes: 0 additions & 7 deletions .editorconfig

This file was deleted.

18 changes: 18 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*eslint-env commonjs*/

/** @type {import('eslint/lib/shared/types').ConfigData} */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'simple-import-sort'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
},
ignorePatterns: [],
};
15 changes: 0 additions & 15 deletions .github/release.yml

This file was deleted.

9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
- main
pull_request:

env:
NODE_VERSION: 20

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -19,14 +16,14 @@ jobs:
version: 8
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: install
run: pnpm i

- name: validate
run: pnpm validate
- name: staticcheck
run: pnpm staticcheck

- name: test
run: pnpm test:ci
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
tags:
- 'v*'

env:
NODE_VERSION: 20

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -21,21 +18,21 @@ jobs:
version: 8
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: '.nvmrc'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: install
run: pnpm i

- name: validate
run: pnpm validate
- name: staticcheck
run: pnpm staticcheck

- name: build
run: pnpm build

- name: publish
run: pnpm publish --no-git-checks
run: pnpm publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
NPM_CONFIG_PROVENANCE: true
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: install
run: pnpm i

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pnpm i

# Run src (index.ts) directly
pnpm dev
pnpm dev https://github.com/bisquit/rpget/tree/main/sample/dir-1
pnpm dev https://github.com/bisquit/ghget/tree/main/sample/dir-1
```

### Unit Testing
Expand All @@ -33,14 +33,14 @@ pnpm build --watch
pnpm build:debug --watch

# Then, cd any directory
rpget
ghget
```

If you installed published version, be sure removing it to avoid confliction.

```sh
pnpm ls -g
pnpm rm -g rpget
pnpm rm -g ghget
```

## publish
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<img src="./assets/screenshot.png" width="70%" />
</div>

# rpget
# ghget

<a href="https://www.npmjs.com/package/rpget"><img src="https://img.shields.io/npm/v/rpget"></a>
[![CI](https://github.com/bisquit/rpget/actions/workflows/ci.yml/badge.svg)](https://github.com/bisquit/rpget/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/bisquit/rpget/branch/main/graph/badge.svg?token=CLG9UC6RG9)](https://codecov.io/gh/bisquit/rpget)
<a href="https://www.npmjs.com/package/ghget"><img src="https://img.shields.io/npm/v/ghget"></a>
[![CI](https://github.com/bisquit/ghget/actions/workflows/ci.yml/badge.svg)](https://github.com/bisquit/ghget/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/bisquit/ghget/branch/main/graph/badge.svg?token=CLG9UC6RG9)](https://codecov.io/gh/bisquit/ghget)

Download a directory or file from a repository URL you are viewing:

Expand Down Expand Up @@ -39,32 +39,32 @@ To keep it simple and robust, we are taking advantage of the CLI's authenticatio
You can quickly try with `npx`

```sh
npx rpget@latest https://github.com/bisquit/rpget/tree/main/sample
npx ghget@latest https://github.com/bisquit/ghget/tree/main/sample
```

or install globally

```sh
npm i -g rpget
npm i -g ghget
```

```sh
yarn global add rpget
yarn global add ghget
```

```sh
pnpm add -g rpget
pnpm add -g ghget
```

## Usage

Hit `rpget <url>`.
Hit `ghget <url>`.

```sh
rpget https://github.com/bisquit/rpget/tree/main/sample
ghget https://github.com/bisquit/ghget/tree/main/sample
```

See [examples](https://github.com/bisquit/rpget/blob/main/e2e/README.md#for-github).
See [examples](https://github.com/bisquit/ghget/blob/main/e2e/README.md#for-github).

## How it works

Expand Down
2 changes: 2 additions & 0 deletions changelogithub.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/*eslint-env commonjs*/
module.exports = require('@bisquit/changelogithub-config');
30 changes: 15 additions & 15 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Curretly, E2E is hand-testing for cross patterns.

```sh
# remove installed version
pnpm rm -g rpget
pnpm rm -g ghget

# install latest dependencies
pnpm i
Expand Down Expand Up @@ -38,51 +38,51 @@ Also, authenticate GitHub CLI and GLab CLI.

```sh
# GitHub x directory
rpget https://github.com/bisquit/rpget/tree/main/sample
ghget https://github.com/bisquit/ghget/tree/main/sample
#==> sample

# GitHub x file
rpget https://github.com/bisquit/rpget/blob/main/sample/README.md
ghget https://github.com/bisquit/ghget/blob/main/sample/README.md
#==> README.md

# GitHub x root
rpget https://github.com/bisquit/rpget
#==> rpget
ghget https://github.com/bisquit/ghget
#==> ghget

# GitHub x cancel
rpget https://github.com/bisquit/rpget # Then cancel confirm with `No`
ghget https://github.com/bisquit/ghget # Then cancel confirm with `No`
#==> 'Cancelled.'
rpget https://github.com/bisquit/rpget # Then hit Ctrl + C
ghget https://github.com/bisquit/ghget # Then hit Ctrl + C
#==> 'Cancelled.'

# GitHub x error
rpget https://github.com/bisquit/rpget/tree/m
ghget https://github.com/bisquit/ghget/tree/m
#==> 'ERROR'
```

#### for GitLab

```sh
# GitLab x directoy
rpget https://gitlab.com/bisquit-lab/rpget-test/-/tree/main/sample
ghget https://gitlab.com/bisquit-lab/ghget-test/-/tree/main/sample
#==> sample

# GitLab x file
rpget https://gitlab.com/bisquit-lab/rpget-test/-/tree/main/sample/README.md
ghget https://gitlab.com/bisquit-lab/ghget-test/-/tree/main/sample/README.md
#==> README.md

# GitLab x root
rpget https://gitlab.com/bisquit-lab/rpget-test
#==> rpget-test
ghget https://gitlab.com/bisquit-lab/ghget-test
#==> ghget-test

# GitLab x cancel
rpget https://gitlab.com/bisquit-lab/rpget-test # Then cancel confirm with `No`
ghget https://gitlab.com/bisquit-lab/ghget-test # Then cancel confirm with `No`
#==> 'Cancelled.'
rpget https://gitlab.com/bisquit-lab/rpget-test # Then hit Ctrl + C
ghget https://gitlab.com/bisquit-lab/ghget-test # Then hit Ctrl + C
#==> 'Cancelled.'

# GitLab x error
rpget https://gitlab.com/bisquit-lab/rpget-test/-/tree/m
ghget https://gitlab.com/bisquit-lab/ghget-test/-/tree/m
#==> 'ERROR'
```

Expand Down
Loading

0 comments on commit add4c33

Please sign in to comment.