Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"root": true,
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"rules": {
"@typescript-eslint/no-explicit-any": "off"
},
"ignorePatterns": ["dist/", "node_modules/"]
}
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Description 📖
Write a short description about the Pull Request.

- Adds this feature
- Fixes this bug

## Issue refernece 🥥
<!-- uses the Closes keyword to automatically close issues after merging -->
- [ ] Closes #1

## Additional information ℹ️
<!-- add any additional remarks or screenshots here -->
175 changes: 175 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# 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*

# Caches

.cache

# 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/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

# 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

# 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

# Finder (MacOS) folder config
.DS_Store
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bunx commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bun run lint-staged
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"semi": false,
"printWidth": 120,
"singleQuote": true,
"plugins": ["prettier-plugin-organize-imports"]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"eslint.experimental.useFlatConfig": false,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# @hulla/api
## Welcome to `@hulla/api`

Currently preparing for `alpha` release in upcoming days 🚧
Binary file added bun.lockb
Binary file not shown.
32 changes: 32 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import pkg from './package.json'

// Check if the user has configured the package to use conventional commits.
// @ts-expect-error package.json is not typed.
const isConventional = pkg.config ? pkg.config['cz-emoji']?.conventional : false

// Regex for default and conventional commits.
const RE_DEFAULT_COMMIT =
/^(?::.*:|(?:\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]))\s(?<emoji>\((?<scope>.*)\)\s)?.*$/gm
const RE_CONVENTIONAL_COMMIT =
/^^(?<type>\w+)(?:\((?<scope>\w+)\))?\s(?<emoji>:.*:|(?:\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]))\s.*$/gm

module.exports = {
rules: {
'cz-emoji': [2, 'always'],
},
plugins: [
{
rules: {
'cz-emoji': ({ raw }) => {
const isValid = isConventional ? RE_CONVENTIONAL_COMMIT.test(raw) : RE_DEFAULT_COMMIT.test(raw)

const message = isConventional
? `Your commit message should follow conventional commit format.`
: `Your commit message should be: <emoji> (<scope>)?: <subject>`

return [isValid, message]
},
},
},
],
}
110 changes: 110 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"name": "@hulla/api",
"repository": {
"type": "git",
"url": "http://github.com/hulladev/api.git"
},
"module": "index.ts",
"type": "module",
"scripts": {
"bundle": "bunchee --dts -m --cwd",
"build": "bun bundle core && bun bundle integrations/query",
"lint": "eslint --ext .ts --fix .",
"prettier": "prettier --write .",
"test": "bun test",
"prepare": "husky",
"commit": "bunx cz"
},
"lint-staged": {
"*.ts": [
"eslint --fix",
"prettier --write"
]
},
"devDependencies": {
"@types/bun": "^1.0.11",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"bunchee": "^5.1.2",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"cz-emoji": "^1.3.2-canary.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"expect-type": "^0.19.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"msw": "^2.2.14",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
"typescript": "^5.0.0"
},
"exports": {
"./package.json": "./package.json",
".": {
"import": "./core/dist/index.mjs",
"module": "./core/dist/index.esm.js",
"require": "./core/dist/index.js"
}
},
"config": {
"commitizen": {
"path": "./node_modules/cz-emoji"
},
"cz-emoji": {
"skipScope": true,
"scopes": [],
"types": [
{
"emoji": "✅",
"code": ":white_check_mark: feat:",
"description": "a new functionality",
"name": "feat"
},
{
"emoji": "🐞",
"code": ":lady_beetle: fix:",
"description": "a bug fix",
"name": "fix"
},
{
"emoji": "🔧",
"code": ":wrench: update:",
"description": "a code change that neither fixes a bug nor adds a feature",
"name": "update"
},
{
"emoji": "📚",
"code": ":books: docs:",
"description": "documentations",
"name": "docs"
},
{
"emoji": "🧪",
"code": ":test_tube: tests:",
"description": "tests",
"name": "tests"
},
{
"emoji": "🪛",
"code": ":screwdriver: config:",
"description": "configuration files",
"name": "config"
},
{
"emoji": "📦",
"code": ":package: release:",
"description": "new release bundle",
"name": "release"
},
{
"emoji": "🤖",
"code": ":robot: devops:",
"description": "ci/cd or other form of automation",
"name": "devops"
}
]
}
}
}
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"noUnusedParameters": true,
"noPropertyAccessFromIndexSignature": true,
"paths": {
"@/*": ["./*"],
"@/*": ["./*"]
}
},
"include": ["./core", "./integrations", "./tests"],
"include": ["./core", "./integrations", "./tests"]
}