Skip to content

Commit c8b181f

Browse files
committed
refactor: project maintanace
1 parent e43bdf9 commit c8b181f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+14066
-15273
lines changed

.github/workflows/release-note.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Create release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
name: Create Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0 # Fetch all tags
21+
22+
- name: Create Release for Tag
23+
id: release_tag
24+
uses: Akryum/[email protected]
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
with:
28+
tag_name: ${{ github.ref }}

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"references.preferredLocation": "peek"
3+
}

CONTRIBUTING.md

+5-5
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

demos/demo-vue3/package.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "demo2",
3+
"version": "2.0.0-beta.20",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vite",
7+
"build": "vite build",
8+
"test:e2e": "echo \"TODO\"",
9+
"lint": "eslint . --ext .js,.vue"
10+
},
11+
"dependencies": {
12+
"core-js": "^3.30.2",
13+
"floating-vue": "workspace:*",
14+
"vue": "^3.3.4",
15+
"vue-router": "^4.2.1"
16+
},
17+
"devDependencies": {
18+
"@vitejs/plugin-vue": "^4.2.3",
19+
"@vue/compiler-sfc": "^3.3.4",
20+
"@vue/eslint-config-standard": "^8.0.1",
21+
"autoprefixer": "^10.4.14",
22+
"babel-eslint": "^10.1.0",
23+
"eslint": "^8.41.0",
24+
"eslint-plugin-cypress": "^2.13.3",
25+
"eslint-plugin-import": "^2.27.5",
26+
"eslint-plugin-node": "^11.1.0",
27+
"eslint-plugin-promise": "^6.1.1",
28+
"eslint-plugin-standard": "^5.0.0",
29+
"eslint-plugin-vue": "^9.13.0",
30+
"postcss": "^8.4.23",
31+
"tailwindcss": "^3.3.2",
32+
"vite": "^4.3.8"
33+
}
34+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

lerna.json

-8
This file was deleted.

netlify.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build.environment]
2-
NODE_VERSION = "16"
2+
NODE_VERSION = "18"

package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
22
"name": "floating-vue-monorepo",
3+
"packageManager": "[email protected]",
34
"version": "2.0.0-beta.20",
45
"private": true,
56
"workspaces": [
67
"packages/*"
78
],
89
"scripts": {
9-
"build": "lerna run build --ignore demo",
10-
"lint": "lerna run lint",
11-
"release": "yarn run lint && lerna publish && yarn run changelog",
12-
"changelog": "node ./scripts/update-version.mjs && conventional-changelog -p angular -i CHANGELOG.md -s -r 2 && (git add CHANGELOG.md && git add package.json && git commit -m \"chore: changelog\" && git push || exit 0)"
10+
"build": "pnpm -r --filter=\"./packages/*\" run build",
11+
"lint": "pnpm -r run lint",
12+
"release": "pnpm run lint && pnpm run build && sheep release -b main"
1313
},
1414
"devDependencies": {
15-
"conventional-changelog-cli": "^2.1.1",
16-
"lerna": "^4.0.0"
15+
"@akryum/sheep": "^0.5.0"
1716
}
1817
}

packages/demo-vue3/package.json

-34
This file was deleted.

packages/floating-vue/package.json

+24-23
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,44 @@
55
"author": "Guillaume Chau <[email protected]>",
66
"scripts": {
77
"dev": "cross-env NODE_ENV=development vite build --watch",
8-
"build": "cross-env NODE_ENV=production vite build && tsc -d --emitDeclarationOnly && vue-typegen gen -s src -o dist",
9-
"prepublishOnly": "yarn run lint && yarn run test && yarn run build",
10-
"test": "yarn run test:unit",
8+
"build": "cross-env NODE_ENV=production vite build && vue-tsc -d --emitDeclarationOnly",
9+
"prepublishOnly": "pnpm run lint && pnpm run test && pnpm run build",
10+
"test": "pnpm run test:unit",
1111
"lint": "eslint . --ext .js,.vue",
1212
"test:unit": "peeky run"
1313
},
1414
"main": "dist/floating-vue.umd.js",
15-
"module": "dist/floating-vue.es.js",
15+
"module": "dist/floating-vue.mjs",
1616
"types": "dist/index.d.ts",
1717
"dependencies": {
18-
"@floating-ui/dom": "^0.1.10",
18+
"@floating-ui/dom": "^1.2.8",
1919
"vue-resize": "^2.0.0-alpha.1"
2020
},
2121
"peerDependencies": {
2222
"vue": "^3.2.0"
2323
},
2424
"devDependencies": {
25-
"@babel/core": "^7.4.0",
26-
"@babel/preset-env": "^7.4.2",
27-
"@peeky/test": "^0.10.2",
28-
"@typescript-eslint/eslint-plugin": "^5.6.0",
29-
"@typescript-eslint/parser": "^5.6.0",
30-
"@vitejs/plugin-vue": "^2.0.1",
31-
"@vue/eslint-config-standard": "^6.0.0",
32-
"@vue/eslint-config-typescript": "^6.0.0",
33-
"@vue/test-utils": "^1.1.2",
34-
"babel-jest": "^26.6.3",
25+
"@babel/core": "^7.21.8",
26+
"@babel/preset-env": "^7.21.5",
27+
"@peeky/test": "^0.14.1",
28+
"@typescript-eslint/eslint-plugin": "^5.59.6",
29+
"@typescript-eslint/parser": "^5.59.6",
30+
"@vitejs/plugin-vue": "^4.2.3",
31+
"@vue/eslint-config-standard": "^8.0.1",
32+
"@vue/eslint-config-typescript": "^11.0.3",
33+
"@vue/test-utils": "^1.3.5",
34+
"babel-jest": "^29.5.0",
3535
"cross-env": "^7.0.3",
36-
"eslint": "^7.16.0",
37-
"eslint-plugin-import": "^2.22.1",
36+
"eslint": "^8.41.0",
37+
"eslint-plugin-import": "^2.27.5",
3838
"eslint-plugin-node": "^11.1.0",
39-
"eslint-plugin-promise": "^4.2.1",
40-
"eslint-plugin-vue": "^7.4.0",
41-
"fs-extra": "^9.0.1",
42-
"typescript": "^4.5.4",
43-
"vite": "^2.7.12",
44-
"vue": "^3.2.0",
39+
"eslint-plugin-promise": "^6.1.1",
40+
"eslint-plugin-vue": "^9.13.0",
41+
"fs-extra": "^11.1.1",
42+
"typescript": "^5.0.4",
43+
"vite": "^4.3.8",
44+
"vue": "^3.3.4",
45+
"vue-tsc": "^1.6.5",
4546
"vue-typegen": "^0.2.0"
4647
},
4748
"browserslist": [

packages/floating-vue/src/components/Dropdown.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<script lang="ts">
2-
import { defineComponent } from 'vue'
32
import PopperWrapper from './PopperWrapper.vue'
43
5-
export default defineComponent({
4+
const Component = ({
65
...PopperWrapper,
76
name: 'VDropdown',
87
vPopperTheme: 'dropdown',
9-
})
8+
}) as unknown as typeof PopperWrapper
9+
10+
export default Component
1011
</script>
1112

1213
<style>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<script lang="ts">
2-
import { defineComponent } from 'vue'
32
import PopperWrapper from './PopperWrapper.vue'
43
5-
export default defineComponent({
4+
const Component = ({
65
...PopperWrapper,
76
name: 'VMenu',
87
vPopperTheme: 'menu',
9-
})
8+
}) as unknown as typeof PopperWrapper
9+
10+
export default Component
1011
</script>

packages/floating-vue/src/components/Popper.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
shift,
77
flip,
88
arrow,
9-
getScrollParents,
9+
getOverflowAncestors,
1010
size,
1111
} from '@floating-ui/dom'
1212
import { supportsPassive, isIOS } from '../util/env'
@@ -643,10 +643,10 @@ export default () => defineComponent({
643643
options.middleware.push(size({
644644
boundary: this.boundary,
645645
padding: this.overflowPadding,
646-
apply: ({ width, height }) => {
646+
apply: ({ availableWidth, availableHeight }) => {
647647
// Apply and re-compute
648-
this.$_innerNode.style.maxWidth = width != null ? `${width}px` : null
649-
this.$_innerNode.style.maxHeight = height != null ? `${height}px` : null
648+
this.$_innerNode.style.maxWidth = availableWidth != null ? `${availableWidth}px` : null
649+
this.$_innerNode.style.maxHeight = availableHeight != null ? `${availableHeight}px` : null
650650
},
651651
}))
652652
}
@@ -693,6 +693,7 @@ export default () => defineComponent({
693693
clearTimeout(this.$_scheduleTimer)
694694

695695
if (this.isShown) {
696+
// eslint-disable-next-line @typescript-eslint/no-this-alias
696697
hidingPopper = this
697698
}
698699

@@ -726,8 +727,8 @@ export default () => defineComponent({
726727
// Scroll
727728
if (!this.positioningDisabled) {
728729
this.$_registerEventListeners([
729-
...getScrollParents(this.$_referenceNode),
730-
...getScrollParents(this.$_popperNode),
730+
...getOverflowAncestors(this.$_referenceNode),
731+
...getOverflowAncestors(this.$_popperNode),
731732
], 'scroll', () => {
732733
this.$_computePosition()
733734
})
@@ -952,7 +953,7 @@ export default () => defineComponent({
952953
$_handleGlobalClose (event, touch = false) {
953954
if (this.$_showFrameLocked) return
954955

955-
this.hide({ event: event })
956+
this.hide({ event })
956957

957958
if (event.closePopover) {
958959
this.$emit('close-directive')

packages/floating-vue/src/components/PopperWrapper.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}"
1717
:theme="finalTheme"
1818
:target-nodes="getTargetNodes"
19-
:popper-node="() => $refs.popperContent.$el"
19+
:popper-node="() => ($refs as any).popperContent.$el"
2020
:class="[
2121
themeClass,
2222
]"

packages/floating-vue/src/components/Tooltip.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<script lang="ts">
2-
import { defineComponent } from 'vue'
32
import PopperWrapper from './PopperWrapper.vue'
43
5-
export default defineComponent({
4+
const Component = ({
65
...PopperWrapper,
76
name: 'VTooltip',
87
vPopperTheme: 'tooltip',
9-
})
8+
}) as unknown as typeof PopperWrapper
9+
10+
export default Component
1011
</script>
1112

1213
<style>

packages/floating-vue/src/components/TooltipDirective.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
}"
1616
v-bind="$attrs"
1717
:theme="theme"
18-
:popper-node="() => $refs.popperContent.$el"
18+
:target-nodes="targetNodes"
19+
:popper-node="() => ($refs as any).popperContent.$el"
1920
@apply-show="onShow"
2021
@apply-hide="onHide"
2122
>
@@ -89,6 +90,11 @@ export default defineComponent({
8990
type: String,
9091
default: props => getDefaultConfig(props.theme, 'loadingContent'),
9192
},
93+
94+
targetNodes: {
95+
type: Function,
96+
required: true,
97+
},
9298
},
9399
94100
data () {
+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable */
2-
declare module '*.vue' {
3-
const component: any
4-
export default component
5-
}
2+
// declare module '*.vue' {
3+
// import { type DefineComponent } from 'vue'
4+
// const component: DefineComponent<{}, {}, any>
5+
// export default component
6+
// }

0 commit comments

Comments
 (0)