@varlet/cli 1.27.9-alpha.1653036733481 → 1.27.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/commands/compile.js
CHANGED
|
@@ -90,15 +90,19 @@ function compile(cmd) {
|
|
|
90
90
|
return [4 /*yield*/, Promise.all([runTask('types', compileTypes_1.compileTypes), runTask('template highlight', compileTemplateHighlight_1.compileTemplateHighlight)])];
|
|
91
91
|
case 2:
|
|
92
92
|
_b.sent();
|
|
93
|
+
process.env.TARGET_MODULE = 'module';
|
|
93
94
|
return [4 /*yield*/, runTask('module', compileModule_1.compileModule)];
|
|
94
95
|
case 3:
|
|
95
96
|
_b.sent();
|
|
97
|
+
process.env.TARGET_MODULE = 'esm-bundle';
|
|
96
98
|
return [4 /*yield*/, runTask('esm bundle', function () { return (0, compileModule_1.compileModule)('esm-bundle'); })];
|
|
97
99
|
case 4:
|
|
98
100
|
_b.sent();
|
|
101
|
+
process.env.TARGET_MODULE = 'commonjs';
|
|
99
102
|
return [4 /*yield*/, runTask('commonjs', function () { return (0, compileModule_1.compileModule)('commonjs'); })];
|
|
100
103
|
case 5:
|
|
101
104
|
_b.sent();
|
|
105
|
+
process.env.TARGET_MODULE = 'umd';
|
|
102
106
|
_a = !cmd.noUmd;
|
|
103
107
|
if (!_a) return [3 /*break*/, 7];
|
|
104
108
|
return [4 /*yield*/, runTask('umd', function () { return (0, compileModule_1.compileModule)('umd'); })];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/cli",
|
|
3
|
-
"version": "1.27.9
|
|
3
|
+
"version": "1.27.9",
|
|
4
4
|
"description": "cli of varlet",
|
|
5
5
|
"bin": {
|
|
6
6
|
"varlet-cli": "./lib/index.js"
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@babel/helper-plugin-utils": "^7.14.5",
|
|
34
34
|
"@babel/preset-env": "^7.14.8",
|
|
35
35
|
"@babel/preset-typescript": "^7.14.5",
|
|
36
|
-
"@varlet/icons": "1.27.9
|
|
37
|
-
"@varlet/markdown-vite-plugin": "1.27.9
|
|
38
|
-
"@varlet/touch-emulator": "1.27.9
|
|
36
|
+
"@varlet/icons": "1.27.9",
|
|
37
|
+
"@varlet/markdown-vite-plugin": "1.27.9",
|
|
38
|
+
"@varlet/touch-emulator": "1.27.9",
|
|
39
39
|
"@vitejs/plugin-vue": "2.2.0",
|
|
40
40
|
"@vitejs/plugin-vue-jsx": "1.3.5",
|
|
41
41
|
"@vue/babel-plugin-jsx": "1.1.1",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@types/semver": "^7.3.9"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@varlet/touch-emulator": "1.27.9
|
|
79
|
+
"@varlet/touch-emulator": "1.27.9",
|
|
80
80
|
"@vue/test-utils": "^2.0.0-rc.6",
|
|
81
81
|
"clipboard": "^2.0.6",
|
|
82
82
|
"live-server": "^1.2.1",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { defineComponent, onMounted, onBeforeUnmount, ref, useAttrs } from 'vue'
|
|
2
|
+
import { defineComponent, onMounted, onBeforeUnmount, onUnmounted, ref, useAttrs } from 'vue'
|
|
3
3
|
import { animationBoxData, animationEl, animationElClientRect } from '../floating'
|
|
4
4
|
|
|
5
5
|
export default defineComponent({
|
|
@@ -15,7 +15,8 @@ export default defineComponent({
|
|
|
15
15
|
mutationObserver.value = new MutationObserver(() => {
|
|
16
16
|
animationElClientRect.value = varletLogoAnimationRef?.value?.getBoundingClientRect();
|
|
17
17
|
});
|
|
18
|
-
|
|
18
|
+
const logoContainer = varletLogoAnimationRef.value?.parentNode?.parentNode
|
|
19
|
+
mutationObserver.value.observe(logoContainer || document.body, {
|
|
19
20
|
attributes: true,
|
|
20
21
|
subtree: true,
|
|
21
22
|
childList:true
|
|
@@ -26,6 +27,11 @@ export default defineComponent({
|
|
|
26
27
|
mutationObserver.value?.disconnect();
|
|
27
28
|
})
|
|
28
29
|
|
|
30
|
+
onUnmounted(() => {
|
|
31
|
+
animationEl.value = undefined
|
|
32
|
+
animationElClientRect.value = undefined
|
|
33
|
+
})
|
|
34
|
+
|
|
29
35
|
return {
|
|
30
36
|
varletLogoAnimationRef,
|
|
31
37
|
}
|
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
<div class="varlet-site-header__lead">
|
|
4
4
|
<animation-box class="varlet-site-header__logo" @click="backRoot" />
|
|
5
5
|
<div class="varlet-site-header__title" v-if="title" @click="backRoot">{{ title }}</div>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div class="varlet-site-header__tail">
|
|
6
9
|
<div
|
|
7
10
|
class="varlet-site-header__versions"
|
|
8
11
|
@mouseenter="isOpenVersionsMenu = true"
|
|
9
12
|
@mouseleave="isOpenVersionsMenu = false"
|
|
10
|
-
v-if="
|
|
13
|
+
v-if="versionItems"
|
|
11
14
|
>
|
|
12
|
-
{{
|
|
15
|
+
<span style="font-size: 14px;">{{ currentVersion }}</span>
|
|
13
16
|
<var-site-icon name="chevron-down" />
|
|
14
17
|
<transition name="fade">
|
|
15
18
|
<div
|
|
@@ -21,16 +24,14 @@
|
|
|
21
24
|
v-for="(value, key) in nonEmptyVersions"
|
|
22
25
|
v-ripple
|
|
23
26
|
:key="key"
|
|
24
|
-
:class="{ 'varlet-site-header__animation-list--active':
|
|
27
|
+
:class="{ 'varlet-site-header__animation-list--active': currentVersion === key }"
|
|
25
28
|
@click="open(value)"
|
|
26
|
-
|
|
29
|
+
>{{ key }}
|
|
27
30
|
</var-site-cell>
|
|
28
31
|
</div>
|
|
29
32
|
</transition>
|
|
30
33
|
</div>
|
|
31
|
-
</div>
|
|
32
34
|
|
|
33
|
-
<div class="varlet-site-header__tail">
|
|
34
35
|
<a class="varlet-site-header__link" target="_blank" :href="playground" v-ripple v-if="playground">
|
|
35
36
|
<var-site-icon name="code-json" :size="24" />
|
|
36
37
|
</a>
|
|
@@ -99,8 +100,8 @@ export default defineComponent({
|
|
|
99
100
|
const logo: Ref<string> = ref(get(config, 'logo'))
|
|
100
101
|
const themesKey = get(config, 'themesKey')
|
|
101
102
|
const languages: Ref<Record<string, string>> = ref(get(config, 'pc.header.i18n'))
|
|
102
|
-
const
|
|
103
|
-
const
|
|
103
|
+
const currentVersion: Ref<string> = ref(get(config, 'pc.header.version.current'))
|
|
104
|
+
const versionItems: Ref<Record<string, string>> = ref(get(config, 'pc.header.version.items'))
|
|
104
105
|
const playground: Ref<string> = ref(get(config, 'pc.header.playground'))
|
|
105
106
|
const github: Ref<string> = ref(get(config, 'pc.header.github'))
|
|
106
107
|
const redirect = get(config, 'pc.redirect')
|
|
@@ -111,7 +112,7 @@ export default defineComponent({
|
|
|
111
112
|
const isOpenVersionsMenu: Ref<boolean> = ref(false)
|
|
112
113
|
const router = useRouter()
|
|
113
114
|
const nonEmptyLanguages: ComputedRef<Record<string, string>> = computed(() => removeEmpty(languages.value))
|
|
114
|
-
const nonEmptyVersions: ComputedRef<Record<string, string>> = computed(() => removeEmpty(
|
|
115
|
+
const nonEmptyVersions: ComputedRef<Record<string, string>> = computed(() => removeEmpty(versionItems.value))
|
|
115
116
|
|
|
116
117
|
const backRoot = () => {
|
|
117
118
|
const { language: lang } = getPCLocationInfo()
|
|
@@ -139,7 +140,7 @@ export default defineComponent({
|
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
const open = (value: string) => {
|
|
142
|
-
if (value !==
|
|
143
|
+
if (value !== currentVersion.value) {
|
|
143
144
|
setTimeout(() => {
|
|
144
145
|
window.location.href = value
|
|
145
146
|
}, 350);
|
|
@@ -156,9 +157,9 @@ export default defineComponent({
|
|
|
156
157
|
return {
|
|
157
158
|
logo,
|
|
158
159
|
title,
|
|
159
|
-
|
|
160
|
+
currentVersion,
|
|
160
161
|
languages,
|
|
161
|
-
|
|
162
|
+
versionItems,
|
|
162
163
|
nonEmptyLanguages,
|
|
163
164
|
nonEmptyVersions,
|
|
164
165
|
playground,
|
|
@@ -280,6 +281,7 @@ export default defineComponent({
|
|
|
280
281
|
position: relative;
|
|
281
282
|
cursor: pointer;
|
|
282
283
|
transition: background-color 0.25s;
|
|
284
|
+
margin-right: 6px;
|
|
283
285
|
|
|
284
286
|
&:hover {
|
|
285
287
|
background: var(--site-config-color-nav-button-hover-background);
|
|
@@ -31,7 +31,6 @@ export default defineComponent({
|
|
|
31
31
|
if (!floatingState.value && from.path !== '/') {
|
|
32
32
|
floatingState.value = true
|
|
33
33
|
}
|
|
34
|
-
await nextTick()
|
|
35
34
|
})
|
|
36
35
|
|
|
37
36
|
onMounted(() => {
|
|
@@ -76,7 +75,7 @@ export default defineComponent({
|
|
|
76
75
|
</script>
|
|
77
76
|
|
|
78
77
|
<template>
|
|
79
|
-
<Teleport :to="animationEl
|
|
78
|
+
<Teleport :to="animationEl || 'body'">
|
|
80
79
|
<img
|
|
81
80
|
v-show="!floatingState"
|
|
82
81
|
v-bind="animationBoxData.attrs"
|
|
@@ -85,6 +84,7 @@ export default defineComponent({
|
|
|
85
84
|
alt="logo"
|
|
86
85
|
v-if="logo && animationEl"
|
|
87
86
|
class="varlet-cli-logo-animation"
|
|
87
|
+
:class="{ 'varlet-cli-logo-position': !animationEl }"
|
|
88
88
|
/>
|
|
89
89
|
</Teleport>
|
|
90
90
|
<div v-show="floatingState">
|