Skip to content

Commit a72c36f

Browse files
antfususnux
andauthored
refactor!: project maintanace (Akryum#959)
* refactor: project maintanace * fix: using `exports` field in package.json (Akryum#937) Co-authored-by: Anthony Fu <[email protected]> * chore: clean up * chore: to vitepress * feat: migrate theme editor * chore: move files --------- Co-authored-by: Ferdinand Thiessen <[email protected]>
1 parent b163937 commit a72c36f

File tree

136 files changed

+9875
-15757
lines changed

Some content is hidden

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

136 files changed

+9875
-15757
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 }}

CONTRIBUTING.md

+5-5
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.

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.

packages/docs/.gitignore renamed to docs/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ dist
1010
.basement
1111
config.local.js
1212
basement_dist
13+
.vitepress/cache

docs/.postcssrc.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"plugins": {
3+
"autoprefixer": {},
4+
"tailwindcss": {}
5+
}
6+
}
+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Ported from https://github.com/buttons/vue-github-button/blob/main/index.js
2+
3+
import { defineComponent, h } from 'vue'
4+
import { hasOwn, hyphenate } from '@vue/shared'
5+
6+
export default defineComponent({
7+
name: 'github-button',
8+
props: {
9+
href: String,
10+
ariaLabel: String,
11+
title: String,
12+
dataIcon: String,
13+
dataColorScheme: String,
14+
dataSize: String,
15+
dataShowCount: String,
16+
dataText: String
17+
},
18+
render: function () {
19+
const props = { ref: '_' }
20+
for (const key in this.$props) {
21+
props[hyphenate(key)] = this.$props[key]
22+
}
23+
return h('span', [
24+
hasOwn(this.$slots, 'default')
25+
? h('a', props, this.$slots.default())
26+
: h('a', props)
27+
])
28+
},
29+
mounted: function () {
30+
this.paint()
31+
},
32+
beforeUpdate: function () {
33+
this.reset()
34+
},
35+
updated: function () {
36+
this.paint()
37+
},
38+
beforeUnmount: function () {
39+
this.reset()
40+
},
41+
methods: {
42+
paint: function () {
43+
const _ = this.$el.appendChild(document.createElement('span'))
44+
const _this = this
45+
import('github-buttons').then(function (module) {
46+
module.render(_.appendChild(_this.$refs._), function (el) {
47+
try {
48+
_.parentNode.replaceChild(el, _)
49+
} catch (_) {}
50+
})
51+
})
52+
},
53+
reset: function () {
54+
this.$el.replaceChild(/** @type {HTMLAnchorElement} */ (this.$refs._), this.$el.lastChild)
55+
}
56+
}
57+
})

packages/docs/src/.vuepress/components/SponsorButton.vue renamed to docs/.vitepress/components/SponsorButton.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</template>
1313

1414
<script>
15-
import GithubButton from 'vue-github-button'
15+
import GithubButton from './GitHubButton'
1616
1717
export default {
1818
components: {

packages/docs/src/.vuepress/components/ThemeEditor.vue renamed to docs/.vitepress/components/ThemeEditorVue.vue

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
<script>
1+
<script setup>
22
import ThemeEditor from './theme-editor/ThemeEditor.vue'
3-
4-
export default {
5-
components: {
6-
ThemeEditor,
7-
},
8-
}
93
</script>
104

115
<template>

packages/docs/src/.vuepress/components/theme-editor/ConfigEditor.vue renamed to docs/.vitepress/components/theme-editor/ConfigEditor.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { builtinThemes } from './builtin-themes'
33
import { mapState, state } from './state'
44
import { SHOW_EVENT_MAP, placements } from 'floating-vue'
5-
import { ToolIcon } from 'vue-feather-icons'
5+
import ToolIcon from '~icons/lucide/wrench'
66
import Tabs from './Tabs.vue'
77
import { loadValue, storeValue } from './util'
88

packages/docs/src/.vuepress/components/theme-editor/Input.vue renamed to docs/.vitepress/components/theme-editor/Input.vue

+3-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
export default {
33
inheritAttrs: false,
44
5-
model: {
6-
event: 'update',
7-
},
8-
95
props: {
106
// eslint-disable-next-line
11-
value: {},
7+
modelValue: {},
128
139
autoFocus: {
1410
type: Boolean,
@@ -19,10 +15,10 @@ export default {
1915
computed: {
2016
valueModel: {
2117
get () {
22-
return this.value
18+
return this.modelValue
2319
},
2420
set (value) {
25-
this.$emit('update', value)
21+
this.$emit('update:modelValue', value)
2622
},
2723
},
2824
},
@@ -41,6 +37,5 @@ export default {
4137
v-model="valueModel"
4238
v-bind="$attrs"
4339
class="border border-gray-300 rounded px-3 py-2 w-full"
44-
v-on="$listeners"
4540
>
4641
</template>

packages/docs/src/.vuepress/components/theme-editor/Sandbox.vue renamed to docs/.vitepress/components/theme-editor/Sandbox.vue

+9-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,19 @@ export default {
2525
},
2626
deep: true,
2727
},
28+
'allStyleOutput': {
29+
handler () {
30+
if (this.style)
31+
this.style.innerHTML = this.allStyleOutput
32+
},
33+
immediate: true,
34+
}
2835
},
2936
3037
mounted () {
3138
this.ready = true
39+
this.style = document.createElement('style')
40+
document.head.appendChild(this.style)
3241
},
3342
3443
errorCaptured (e) {
@@ -134,7 +143,5 @@ export default {
134143
</template>
135144
</div>
136145
</div>
137-
138-
<style v-text="allStyleOutput" />
139146
</div>
140147
</template>

packages/docs/src/.vuepress/components/theme-editor/StyleEditor.vue renamed to docs/.vitepress/components/theme-editor/StyleEditor.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script>
22
import { mapState } from './state'
33
import Tabs from './Tabs.vue'
4-
import { PenToolIcon } from 'vue-feather-icons'
4+
import PenToolIcon from '~icons/lucide/pen-tool'
55
import { loadValue, storeValue } from './util'
66
77
const TAB_KEY = 'v-tooltip.theme-editor.style-tab'
@@ -12,7 +12,7 @@ function inherit (key, defaultValue) {
1212
return this.currentStyle[key] == null
1313
},
1414
set (value) {
15-
this.$set(this.currentStyle, key, value ? undefined : getDefaultValue(defaultValue))
15+
this.currentStyle[key] = value ? undefined : getDefaultValue(defaultValue)
1616
},
1717
}
1818
}
@@ -67,7 +67,7 @@ export default {
6767
handler (value) {
6868
// Create new styles
6969
if (value == null) {
70-
this.$set(this.theme.styles, this.tab, {})
70+
this.theme.styles[this.tab] = {}
7171
}
7272
},
7373
immediate: true,

packages/docs/src/.vuepress/components/theme-editor/ThemeEditor.vue renamed to docs/.vitepress/components/theme-editor/ThemeEditor.vue

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11

22
<script>
33
import FloatingVue from 'floating-vue'
4-
import {
5-
AlertTriangleIcon,
6-
SettingsIcon,
7-
EyeIcon,
8-
CodeIcon,
9-
PlusIcon,
10-
} from 'vue-feather-icons'
4+
import AlertTriangleIcon from '~icons/lucide/alert-triangle'
5+
import SettingsIcon from '~icons/lucide/settings'
6+
import EyeIcon from '~icons/lucide/eye'
7+
import CodeIcon from '~icons/lucide/code'
8+
import PlusIcon from '~icons/lucide/plus'
119
import { loadSettings, loadLastTheme, mapState, loadThemes } from './state'
1210
import Sandbox from './Sandbox.vue'
1311
import StyleEditor from './StyleEditor.vue'

packages/docs/src/.vuepress/components/theme-editor/ThemesExplorer.vue renamed to docs/.vitepress/components/theme-editor/ThemesExplorer.vue

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<script>
2-
import {
3-
SearchIcon,
4-
PlusIcon,
5-
MoreVerticalIcon,
6-
Trash2Icon,
7-
} from 'vue-feather-icons'
2+
import SearchIcon from '~icons/lucide/search'
3+
import PlusIcon from '~icons/lucide/plus'
4+
import MoreVerticalIcon from '~icons/lucide/more-vertical'
5+
import Trash2Icon from '~icons/lucide/trash-2'
86
import Button from './Button.vue'
97
import Modal from './Modal.vue'
108
import { mapState, loadTheme, deleteTheme } from './state'

0 commit comments

Comments
 (0)