Skip to content

Commit 0c62419

Browse files
committed
feat: add filesDB for utils
1 parent 86d3042 commit 0c62419

File tree

15 files changed

+5508
-130
lines changed

15 files changed

+5508
-130
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: pnpm/action-setup@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: lts/*
21+
cache: pnpm
22+
23+
- name: Install
24+
run: pnpm install
25+
26+
- name: Lint
27+
run: pnpm lint
28+
29+
type-check:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: pnpm/action-setup@v2
34+
- uses: actions/setup-node@v4
35+
with:
36+
node-version: lts/*
37+
cache: pnpm
38+
39+
- name: Install
40+
run: pnpm install
41+
42+
- name: Typecheck
43+
run: pnpm type-check
44+
45+
test:
46+
runs-on: ${{ matrix.os }}
47+
48+
strategy:
49+
matrix:
50+
node-version: [lts/*]
51+
os: [ubuntu-latest]
52+
fail-fast: false
53+
54+
steps:
55+
- uses: actions/checkout@v4
56+
- uses: pnpm/action-setup@v4
57+
- name: Use Node.js ${{ matrix.node-version }}
58+
uses: actions/setup-node@v4
59+
with:
60+
node-version: ${{ matrix.node-version }}
61+
registry-url: https://registry.npmjs.org/
62+
cache: pnpm
63+
64+
- run: pnpm install
65+
- run: pnpm test

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
permissions:
11+
contents: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: lts/*
21+
22+
- run: npx changelogithub
23+
env:
24+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.gitignore

Lines changed: 4 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,6 @@
1-
# Logs
2-
logs
1+
dist
2+
node_modules
33
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
.pnpm-debug.log*
9-
10-
# Diagnostic reports (https://nodejs.org/api/report.html)
11-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12-
13-
# Runtime data
14-
pids
15-
*.pid
16-
*.seed
17-
*.pid.lock
18-
19-
# Directory for instrumented libs generated by jscoverage/JSCover
20-
lib-cov
21-
22-
# Coverage directory used by tools like istanbul
23-
coverage
24-
*.lcov
25-
26-
# nyc test coverage
27-
.nyc_output
28-
29-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30-
.grunt
31-
32-
# Bower dependency directory (https://bower.io/)
33-
bower_components
34-
35-
# node-waf configuration
36-
.lock-wscript
37-
38-
# Compiled binary addons (https://nodejs.org/api/addons.html)
39-
build/Release
40-
41-
# Dependency directories
42-
node_modules/
43-
jspm_packages/
44-
45-
# Snowpack dependency directory (https://snowpack.dev/)
46-
web_modules/
47-
48-
# TypeScript cache
49-
*.tsbuildinfo
50-
51-
# Optional npm cache directory
52-
.npm
53-
54-
# Optional eslint cache
4+
.DS_Store
5+
.output
556
.eslintcache
56-
57-
# Optional stylelint cache
58-
.stylelintcache
59-
60-
# Microbundle cache
61-
.rpt2_cache/
62-
.rts2_cache_cjs/
63-
.rts2_cache_es/
64-
.rts2_cache_umd/
65-
66-
# Optional REPL history
67-
.node_repl_history
68-
69-
# Output of 'npm pack'
70-
*.tgz
71-
72-
# Yarn Integrity file
73-
.yarn-integrity
74-
75-
# dotenv environment variable files
76-
.env
77-
.env.development.local
78-
.env.test.local
79-
.env.production.local
80-
.env.local
81-
82-
# parcel-bundler cache (https://parceljs.org/)
83-
.cache
84-
.parcel-cache
85-
86-
# Next.js build output
87-
.next
88-
out
89-
90-
# Nuxt.js build / generate output
91-
.nuxt
92-
dist
93-
94-
# Gatsby files
95-
.cache/
96-
# Comment in the public line in if your project uses Gatsby and not Next.js
97-
# https://nextjs.org/blog/next-9-1#public-directory-support
98-
# public
99-
100-
# vuepress build output
101-
.vuepress/dist
102-
103-
# vuepress v2.x temp and cache directory
104-
.temp
105-
.cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# TernJS port file
120-
.tern-port
121-
122-
# Stores VSCode versions used for testing VSCode extensions
123-
.vscode-test
124-
125-
# yarn v2
126-
.yarn/cache
127-
.yarn/unplugged
128-
.yarn/build-state.yml
129-
.yarn/install-state.gz
130-
.pnp.*

.vscode/extensions.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"recommendations": [
3+
"vue.volar",
4+
"vue.vscode-typescript-vue-plugin",
5+
"dbaeumer.vscode-eslint",
6+
"usernamehw.errorlens",
7+
"antfu.unocss",
8+
"antfu.vite",
9+
"lokalise.i18n-ally",
10+
"antfu.iconify"
11+
]
12+
}

.vscode/settings.json

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
// Disable the default formatter, use eslint instead
3+
"prettier.enable": false,
4+
"editor.formatOnSave": false,
5+
// Auto fix
6+
"editor.codeActionsOnSave": {
7+
"source.fixAll.eslint": "explicit",
8+
"source.organizeImports": "never"
9+
},
10+
// Silent the stylistic rules in you IDE, but still auto fix them
11+
"eslint.rules.customizations": [
12+
{
13+
"rule": "style/*",
14+
"severity": "off",
15+
"fixable": true
16+
},
17+
{
18+
"rule": "format/*",
19+
"severity": "off",
20+
"fixable": true
21+
},
22+
{
23+
"rule": "*-indent",
24+
"severity": "off",
25+
"fixable": true
26+
},
27+
{
28+
"rule": "*-spacing",
29+
"severity": "off",
30+
"fixable": true
31+
},
32+
{
33+
"rule": "*-spaces",
34+
"severity": "off",
35+
"fixable": true
36+
},
37+
{
38+
"rule": "*-order",
39+
"severity": "off",
40+
"fixable": true
41+
},
42+
{
43+
"rule": "*-dangle",
44+
"severity": "off",
45+
"fixable": true
46+
},
47+
{
48+
"rule": "*-newline",
49+
"severity": "off",
50+
"fixable": true
51+
},
52+
{
53+
"rule": "*quotes",
54+
"severity": "off",
55+
"fixable": true
56+
},
57+
{
58+
"rule": "*semi",
59+
"severity": "off",
60+
"fixable": true
61+
}
62+
],
63+
// Enable eslint for all supported languages
64+
"eslint.validate": [
65+
"javascript",
66+
"javascriptreact",
67+
"typescript",
68+
"typescriptreact",
69+
"vue",
70+
"html",
71+
"markdown",
72+
"json",
73+
"jsonc",
74+
"yaml",
75+
"toml",
76+
"xml",
77+
"gql",
78+
"graphql",
79+
"astro",
80+
"svelte",
81+
"css",
82+
"less",
83+
"scss",
84+
"pcss",
85+
"postcss"
86+
]
87+
}

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
1-
# utils
2-
Collection of common JavaScript / TypeScript utils by @kieranwv
1+
# @kieranwv/utils
2+
3+
[![Version](https://img.shields.io/github/v/release/kieranwv/utils?style=flat&label=%20&color=%2309090b)](https://github.com/kieranwv/utils/releases)
4+
[![Version](https://img.shields.io/npm/v/@kieranwv/utils?style=flat&label=npm&color=09090b)](https://www.npmjs.com/package/@kieranwv/utils)
5+
6+
Collection of common JavaScript / TypeScript utils by @kieranwv.
7+
8+
## Usage
9+
10+
```bash
11+
pnpm i @kieranwv/utils -D
12+
```
13+
14+
```js
15+
import { FilesDB } from '@kieranwv/utils'
16+
17+
const db = new FilesDB()
18+
```
19+
20+
## License
21+
22+
[MIT License](./LICENSE) © 2024 [Kieran Wang](https://github.com/kieranwv/)

eslint.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import antfu from '@antfu/eslint-config'
2+
3+
// ESLint config.
4+
// https://github.com/antfu/eslint-config
5+
export default antfu()

0 commit comments

Comments
 (0)