Skip to content

Commit

Permalink
feat(repository): created type safe fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurchishin committed Sep 26, 2023
0 parents commit 62f895c
Show file tree
Hide file tree
Showing 30 changed files with 1,633 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add files here to ignore them from eslint checks
node_modules
dist
43 changes: 43 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"root": true,
"settings": {
"jest": {
"version": 29
}
},
"overrides": [
{
"files": ["*.ts"],
"extends": ["@anylint/eslint-config/typescript"],
"rules": {
"import/no-unresolved": [
"error",
{
"commonjs": true,
"caseSensitive": true,
"ignore": ["bun:*"]
}
]
}
},
{
"files": ["*.js"],
"extends": ["@anylint/eslint-config/javascript"],
"rules": {}
},
{
"files": ["*.cjs", "*.mjs"],
"extends": ["@anylint/eslint-config/javascript"],
"env": {
"node": true,
"commonjs": true
},
"rules": {}
},
{
"files": ["*.test.ts", "*.spec.ts"],
"extends": ["@anylint/eslint-config/jest", "@anylint/eslint-config/tests"],
"rules": {}
}
]
}
60 changes: 60 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on:
workflow_dispatch:
branches:
- master
inputs:
increment:
description: Increment version type
default: patch
type: choice
options:
- patch
- minor
- major

name: Publish package

jobs:
publish:
name: Publish package (${{inputs.increment}})
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
name: Checkout
with:
ref: ${{github.event.ref}}
fetch-depth: 0
- uses: actions/setup-node@v3
name: Setup node
with:
node-version: 18.14.2
registry-url: https://registry.npmjs.org/
- run: npm i bun -g
name: Install bun
- run: bun install --frozen-lockfile
name: Install dependencies
- run: |
echo "Bun version: $(bun -v)"
echo "NodeJS version: $(node -v)"
echo "NPM version: $(npm -v)"
name: Display versions
- run: bun run type-check
name: Type check code
- run: bun run test
name: Test code
- run: bun run format
name: Format code
- run: bun run lint
name: Lint code

- run: bun run build
name: Build code

- run: bun run release --increment ${{inputs.increment}}
name: Publish ${{inputs.increment}} release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
42 changes: 42 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Branch validation

on:
push:
branches:
- master

jobs:
install:
name: Branch validation
runs-on: macos-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
name: Checkout
with:
ref: ${{github.event.ref}}
fetch-depth: 0
- uses: actions/setup-node@v3
name: Setup node
with:
node-version: 18.14.2
registry-url: https://registry.npmjs.org/
- run: npm i bun -g
name: Install bun
- run: bun install --frozen-lockfile
name: Install dependencies
- run: |
echo "Bun version: $(bun -v)"
echo "NodeJS version: $(node -v)"
echo "NPM version: $(npm -v)"
name: Display versions
- run: bun run type-check
name: Type check code
- run: bun run test
name: Test code
- run: bun run format
name: Format code
- run: bun run lint
name: Lint code
172 changes: 172 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
\*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
\*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

\*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.cache
.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

.cache/

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp
.cache

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.\*

# IntelliJ based IDEs
.idea
8 changes: 8 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

bun run type-check
bun run format
bun run lint
bun run test

1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.14.2
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add files here to ignore them from prettier formatting
node_modules
dist
Loading

0 comments on commit 62f895c

Please sign in to comment.