Skip to content

feat(dt-utils): refactor the dt-utils #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
50d84ab
chore: upgrade package & replace packaging tools
jin-sir Jun 22, 2025
9131eef
refactor: remove old functions
jin-sir Jun 22, 2025
82a4a25
refactor: rename browserCheck to checkBrowserSupport
jin-sir Jun 22, 2025
9963d6a
refactor: improve copy
jin-sir Jun 22, 2025
5f4b0bd
refactor: rename downLoadData to downloadFile
jin-sir Jun 22, 2025
58a28e5
refactor: rename convertBytes to formatBytes
jin-sir Jun 22, 2025
49bc19b
refactor: rename dateTime to formatDateTime
jin-sir Jun 22, 2025
492de08
feat: add formatSecond
jin-sir Jun 22, 2025
7157840
feat: add formatBase64
jin-sir Jun 22, 2025
bc628b4
refactor: rename generateFullUrlPath to generateUrlWithQuery
jin-sir Jun 22, 2025
ee4e777
refactor: merge generateAKey and getRandomStr into getKey
jin-sir Jun 22, 2025
8530435
refactor: improve getQueryParameters
jin-sir Jun 22, 2025
5cff92d
feat: add getTypeOfValue
jin-sir Jun 22, 2025
56ba7cc
refactor: improve isMacOS
jin-sir Jun 22, 2025
1705964
refactor: improve isMobile
jin-sir Jun 22, 2025
8df8b0e
refactor: improve isWindows
jin-sir Jun 22, 2025
d8eb0bd
refactor: localDB.set support batch set, localDB.clear support except…
jin-sir Jun 22, 2025
d35ca34
refactor: improve LocalIndexedDB
jin-sir Jun 22, 2025
1744d5b
feat: add sessionDB
jin-sir Jun 22, 2025
3166fec
feat: add shouldRender
jin-sir Jun 22, 2025
c20cf9d
refactor: merge getBase64 and base64Encode into toBase64
jin-sir Jun 22, 2025
a2774db
refactor: rename percent to toPercent
jin-sir Jun 22, 2025
4dea50d
refactor: rename exchangeOrder to toSortOrder
jin-sir Jun 22, 2025
20c180a
refactor: rename getThousandth to toThousand
jin-sir Jun 22, 2025
fb7148e
feat: add unit testing
jin-sir Jun 22, 2025
3f9cee2
chore: add entry file
jin-sir Jun 22, 2025
f5e2bf1
chore: remove docs
jin-sir Jun 22, 2025
44587fe
refactor: build site with VitePress and generate documentation using …
jin-sir Jun 22, 2025
2e8f0a5
chore: add docs:deploy script
jin-sir Jun 22, 2025
b766ac0
chore: replace yarn with pnpm
jin-sir Jul 29, 2025
2aa1db3
refactor: rename LocalIndexedDB to IndexedDB
jin-sir Aug 6, 2025
853ef05
refactor: improve code
jin-sir Aug 6, 2025
00c11ed
chore: translate English comments to Chinese
jin-sir Aug 8, 2025
c80bde9
chore: update project configuration and set TypeScript package version
jin-sir Aug 8, 2025
698f9d0
chore: update docs
jin-sir Aug 8, 2025
77ce923
Merge remote-tracking branch 'origin/master' into feat_utils
jin-sir Aug 8, 2025
94aba92
chore: replace yarn with pnpm
jin-sir Aug 8, 2025
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
13 changes: 0 additions & 13 deletions .editorconfig

This file was deleted.

4 changes: 0 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
module.exports = {
extends: [require.resolve('ko-lint-config/.eslintrc')],
rules: {
'no-console': 0,
'no-param-reassign': 0, // 函数的入参再次赋值
},
};
147 changes: 74 additions & 73 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,133 +1,134 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Triggers the workflow on push or pull request events but only for the master branch
on:
push:
branches: [master]
pull_request:
branches: [master]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Cache yarn.lock
uses: actions/cache@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: package-temp-dir
key: lock-${{ github.sha }}
node-version: 16.x

- name: Create yarn.lock
run: yarn generate-lock-entry
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 6.32.12
run_install: false

- name: Hack for single file
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
if [ ! -d "package-temp-dir" ]; then
mkdir package-temp-dir
fi
cp yarn.lock package-temp-dir
- name: Cache node_modules
id: node_modules_cache_id
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Cache pnpm store
uses: actions/cache@v4
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: yarn
shell: bash
run: pnpm install

prettier:
needs: [setup]
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Restore cache from yarn.lock
uses: actions/cache@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: package-temp-dir
key: lock-${{ github.sha }}
node-version: 16.x

- name: Restore cache from node_modules
uses: actions/cache@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
version: 6.32.12
run_install: false

- run: pnpm install

- name: Prettier check
run: yarn prettier
- name: Run Prettier
run: pnpm prettier

eslint:
needs: [setup]
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Restore cache from yarn.lock
uses: actions/cache@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: package-temp-dir
key: lock-${{ github.sha }}
node-version: 16.x

- name: Restore cache from node_modules
uses: actions/cache@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
version: 6.32.12
run_install: false

- name: Eslint check
run: yarn eslint
- run: pnpm install

- name: Run ESLint
run: pnpm eslint

test:
needs: [setup]
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Restore cache from yarn.lock
uses: actions/cache@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: package-temp-dir
key: lock-${{ github.sha }}
node-version: 16.x

- name: Restore cache from node_modules
uses: actions/cache@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
version: 6.32.12
run_install: false
- run: pnpm install

- name: Setup timezone
- name: Set up timezone
uses: zcong1993/setup-timezone@master
with:
timezone: Asia/Shanghai
timezone: Asia/Shanghai

- name: Unit Test
run: yarn test
- name: Run Tests
run: pnpm test

build:
runs-on: ubuntu-latest
needs: [setup, prettier, eslint, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Restore cache from yarn.lock
uses: actions/cache@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: package-temp-dir
key: lock-${{ github.sha }}
node-version: 16.x

- name: Restore cache from node_modules
uses: actions/cache@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
version: 6.32.12
run_install: false

- run: pnpm install

- name: Build test
run: yarn build
- name: Run Build
run: pnpm build
104 changes: 4 additions & 100 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,111 +1,15 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-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/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# 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 variables file
.env
.env.test

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

# Next.js build output
.next

# 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

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

docs/.vitepress/cache/
dist
lib
temp

# ide
# .vscode
.idea
.vscode
.DS_Store
8 changes: 0 additions & 8 deletions .vscode/extensions.json

This file was deleted.

42 changes: 0 additions & 42 deletions .vscode/settings.json

This file was deleted.

Loading