Skip to content
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

Type: lodash opt & enable experimental features use tools kit #227

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"prettier.configPath": ".prettierrc"
}
60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "@vue-hooks-plus/monorepo",
"version": "1.0.0",
"private": true,
"name": "@vue-hooks-plus/monorepo",
"version": "1.0.0",
"private": true,
"scripts": {
"bootstrap": "tsx scripts/bootstrap.ts",
"build:vitepress-demo-block":"cd packages/vitepress/vitepress-demo-block && pnpm build",
"docs:dev":"pnpm build:vitepress-demo-block && tsx scripts/docs.ts dev",
"docs:build":"pnpm build:vitepress-demo-block && tsx scripts/docs.ts build",
"docs:build-github":"pnpm build:vitepress-demo-block && tsx scripts/gitPage.ts github",
"docs:build-gitee":"pnpm build:vitepress-demo-block && tsx scripts/gitPage.ts gitee",
"clean": " rimraf dist lib es",
"bootstrap": "tsx scripts/bootstrap.ts",
"build:vitepress-demo-block": "cd packages/vitepress/vitepress-demo-block && pnpm build",
"docs:dev": "pnpm build:vitepress-demo-block && tsx scripts/docs.ts dev",
"docs:build": "pnpm build:vitepress-demo-block && tsx scripts/docs.ts build",
"docs:build-github": "pnpm build:vitepress-demo-block && tsx scripts/gitPage.ts github",
"docs:build-gitee": "pnpm build:vitepress-demo-block && tsx scripts/gitPage.ts gitee",
"clean": " rimraf dist lib es",
"build": "pnpm bootstrap && tsx scripts/build.ts",
"test": "vitest",
"test": "vitest",
"test:ui": "vitest --ui",
"coverage": "vitest run --coverage",
"coverage": "vitest run --coverage",
"prepare": "husky install"
},
"devDependencies": {
Expand All @@ -30,20 +30,20 @@
"@types/node": "^17.0.21",
"@types/qs": "^6.9.7",
"@vitejs/plugin-vue": "^2.3.1",
"@vue/compiler-core": "^3.2.37",
"@vue-hooks-plus/vite-plugin-gen-temp": "^2.6.6",
"@vue/compiler-core": "^3.2.37",
"@vue-hooks-plus/vite-plugin-gen-temp": "^2.6.6",
"@vue-hooks-plus/md-demo-plugins": "^1.0.0",
"@vue-hooks-plus/vitepress": "^1.2.4",
"@vue-hooks-plus/vitepress-demo-block": "workspace:^1.0.0",
"@vue-hooks-plus/use-immer":"workspace:^1.0.0",
"@vue-hooks-plus/use-worker":"workspace:^1.0.0",
"@vue-hooks-plus/use-request":"workspace:^2.0.0",
"@vue-hooks-plus/use-request-plugins":"workspace:^2.0.0",
"@vue-hooks-plus/types":"workspace:^2.0.0",
"@vue-hooks-plus/eslint-config":"workspace:^1.0.0",
"@vue-hooks-plus/use-immer": "workspace:^1.0.0",
"@vue-hooks-plus/use-worker": "workspace:^1.0.0",
"@vue-hooks-plus/use-request": "workspace:^2.0.0",
"@vue-hooks-plus/use-request-plugins": "workspace:^2.0.0",
"@vue-hooks-plus/types": "workspace:^2.0.0",
"@vue-hooks-plus/eslint-config": "workspace:^1.0.0",
"@vue/test-utils": "^2.1.0",
"@vitest/coverage-c8":"^0.25.7",
"execa":"^6.1.0",
"@vitest/coverage-c8": "^0.25.7",
"execa": "^6.1.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"cross-env": "^7.0.3",
Expand All @@ -52,12 +52,12 @@
"gh-pages": "^4.0.0",
"happy-dom": "^7.5.10",
"less": "^4.1.3",
"kolorist": "^1.6.0",
"kolorist": "^1.6.0",
"prettier": "^1.19.1",
"rimraf": "^3.0.2",
"ts-morph": "^13.0.2",
"ts-node": "^10.7.0",
"tsx": "^3.11.0",
"tsx": "^3.11.0",
"typeit": "^8.7.0",
"typescript": "^5.0.4",
"vite": "3.0.2",
Expand All @@ -68,11 +68,11 @@
"vue": "^3.2.25",
"vue-tsc": "1.0.9",
"vue-typical": "^2.1.0",
"pinia":"^2.0.34",
"broadcast-channel":"^5.1.0",
"three":"0.147.0",
"axios": "^1.4.0",
"vue-demi": "^0.13.11"
"pinia": "^2.0.34",
"broadcast-channel": "^5.1.0",
"three": "0.147.0",
"axios": "^1.4.0",
"vue-demi": "^0.13.11"
},
"lint-staged": {
"*.{js,ts,tsx,vue}": [
Expand All @@ -88,4 +88,4 @@
"vue hooks",
"typeScript"
]
}
}
6 changes: 3 additions & 3 deletions packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@
"type": "tsc -d"
},
"dependencies": {
"@vue/devtools-api": "^6.5.0",
"@vue/devtools-api": "^6.5.0",
"@types/js-cookie": "^3.0.1",
"js-cookie": "^3.0.1",
"lodash": "^4.17.21",
"qs": "^6.11.0",
"query-string": "^7.1.1",
"screenfull": "^5.0.0"
},
"peerDependencies": {
"peerDependencies": {
"vue": "^3.2.25"
},
"repository": "https://github.com/InhiblabCore/vue-hooks-plus",
"homepage": "https://github.com/InhiblabCore/vue-hooks-plus",
"author": "NelsonYong",
"license": "MIT"
}
}
1 change: 0 additions & 1 deletion packages/hooks/src/useKeyPress/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ref } from 'vue'
// import { isFunction, isNumber, isString } from 'lodash'
import { BasicTarget, getTargetElement } from '../utils/domTarget'
import useDeepCompareEffectWithTarget from '../utils/useDeepCompareWithTarget'
import { isNumber, isFunction, isString } from '../utils'
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useRequest/plugins/useDebouncePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const useDebouncePlugin: UseRequestPlugin<unknown, unknown[]> = (
fetchInstance,
{ debounceWait, debounceLeading, debounceTrailing, debounceMaxWait }
) => {
const debouncedRef = ref<DebouncedFunc<any>>();
const debouncedRef = ref<DebouncedFunc<(callback: () => void) => void>>();
const options = computed(() => {
const ret: DebounceSettings = {};
const debounceLeading_ = unref(debounceLeading)
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useRequest/plugins/useThrottlePlugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { computed, unref, watchEffect } from 'vue'
import { DebouncedFunc, ThrottleSettings } from 'lodash'
import type { DebouncedFunc, ThrottleSettings } from 'lodash'
import throttle from 'lodash/throttle'
import { UseRequestPlugin } from '../types'

Expand Down
7 changes: 0 additions & 7 deletions packages/resolvers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,5 @@
},
"peerDependencies": {
"vue-hooks-plus": ">=1.5.2"
},
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"vue"
]
}
}
}
5 changes: 5 additions & 0 deletions packages/tools/lodash/.internal/freeGlobal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** Detect free variable `global` from Node.js. */
const freeGlobal =
typeof global === 'object' && global !== null && global.Object === Object && global

export default freeGlobal
17 changes: 17 additions & 0 deletions packages/tools/lodash/.internal/root.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* global globalThis, self */
import freeGlobal from './freeGlobal'

/** Detect free variable `globalThis` */
const freeGlobalThis =
typeof globalThis === 'object' &&
globalThis !== null &&
globalThis.Object === Object &&
globalThis

/** Detect free variable `self`. */
const freeSelf = typeof self === 'object' && self !== null && self.Object === Object && self

/** Used as a reference to the global object. */
const root = freeGlobalThis || freeGlobal || freeSelf || Function('return this')()

export default root
Loading
Loading