Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DASPRiD committed Feb 27, 2024
0 parents commit 9424426
Show file tree
Hide file tree
Showing 13 changed files with 3,844 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use pnpm 8.x
uses: pnpm/action-setup@v3
with:
version: 8

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install

- name: Biome CI
run: pnpm exec biome ci .

- name: Build
run: pnpm build

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
id: semantic
with:
semantic_version: 19.0.5
extra_plugins: |
@semantic-release/changelog@6.0
@semantic-release/git@10.0
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/dist
1 change: 1 addition & 0 deletions .lefthook/commit-msg/commitlint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo $(head -n1 $1) | npx commitlint --color
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Soliant Consulting

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# BitBucket Cloud CLI Auth

This project allows easy access token retrieval for BitBucket Cloud in CLI apps.

## Installation

### npm
```bash
npm i @soliantconsulting/bitbucket-cloud-cli-auth
```

### pnpm
```bash
pnpm add @soliantconsulting/bitbucket-cloud-cli-auth
```


## Usage

```typescript
import { getAccessToken } from "@soliantconsulting/bitbucket-cloud-cli-auth";

const accessToken = await getAccessToken(clientId, port);
```
55 changes: 55 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.2/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"include": [
"biome.json",
"release.config.cjs",
"commitlint.config.cjs",
"src/**/*"
]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"nursery": {
"noEmptyTypeParameters": "error",
"noInvalidUseBeforeDeclaration": "error",
"noUnusedImports": "error",
"noUnusedPrivateClassMembers": "error",
"noUselessLoneBlockStatements": "error",
"noUselessTernary": "error",
"useExportType": "error",
"useImportType": "error",
"useForOf": "error",
"useGroupedTypeImport": "error"
},
"complexity": {
"noExcessiveCognitiveComplexity": "warn",
"useSimplifiedLogicExpression": "error"
},
"correctness": {
"noNewSymbol": "error"
},
"style": {
"useBlockStatements": "error",
"useCollapsedElseIf": "error",
"useShorthandArrayType": "error",
"useShorthandAssign": "error",
"useSingleCaseStatement": "error"
},
"suspicious": {
"noApproximativeNumericConstant": "warn",
"noConsoleLog": "error"
}
}
},
"formatter": {
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 100
}
}
1 change: 1 addition & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
10 changes: 10 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true {staged_files} && git update-index --again

commit-msg:
scripts:
"commitlint.sh":
runner: bash
39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@soliantconsulting/bitbucket-cloud-cli-auth",
"version": "1.0.0",
"description": "CLI OAuth implementation for BitBucket Cloud",
"type": "module",
"author": "Soliant Consulting",
"license": "MIT",
"files": [
"dist/**/*"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"scripts": {
"build": "tsc",
"format": "biome format . --write",
"check": "biome check . --apply"
},
"devDependencies": {
"@biomejs/biome": "1.5.3",
"@commitlint/cli": "^18.5.0",
"@commitlint/config-conventional": "^18.5.0",
"@tsconfig/node20": "^20.1.2",
"@types/koa": "^2.15.0",
"@types/node": "^20.11.5",
"lefthook": "^1.6.0",
"typescript": "^5.3.3"
},
"dependencies": {
"koa": "^2.15.0"
}
}
Loading

0 comments on commit 9424426

Please sign in to comment.