valaxy 0.0.7 → 0.0.8
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/dist/build-RREYJOHF.mjs +1 -0
- package/dist/build-TIU2KH77.js +1 -0
- package/dist/chunk-44DGW27S.js +1 -0
- package/dist/chunk-CSMXFOVS.mjs +1 -0
- package/dist/chunk-EM2KSV5V.js +83 -0
- package/dist/chunk-HUI4MBPM.js +1 -0
- package/dist/chunk-MWP3FN5Q.mjs +83 -0
- package/dist/chunk-RKUUEWDF.mjs +1 -0
- package/dist/index.d.ts +350 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/dist/node/cli.js +5 -5
- package/dist/node/cli.mjs +5 -5
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/package.json +3 -3
- package/src/client/composables/category.ts +2 -2
- package/src/client/composables/common.ts +3 -2
- package/src/client/composables/post.ts +2 -2
- package/src/client/composables/tag.ts +2 -1
- package/src/{core → client}/config.ts +1 -1
- package/src/client/index.ts +4 -0
- package/src/client/utils/index.ts +2 -0
- package/src/client/utils/time.ts +1 -1
- package/src/index.ts +1 -1
- package/src/node/plugins/extendConfig.ts +17 -1
- package/src/node/plugins/preset.ts +9 -1
- package/src/node/vite.ts +1 -32
- package/tsup.config.ts +7 -4
- package/dist/build-OOT6HK6S.js +0 -1
- package/dist/build-SG32QSQ3.mjs +0 -1
- package/dist/chunk-7JDYOPID.js +0 -1
- package/dist/chunk-JJEBEWGI.mjs +0 -1
- package/dist/chunk-L3EDI35I.js +0 -1
- package/dist/chunk-L5SNNWFJ.js +0 -78
- package/dist/chunk-MVJUGWXR.mjs +0 -1
- package/dist/chunk-QI435Q25.mjs +0 -78
- package/dist/types/index.d.ts +0 -110
- package/dist/types/index.js +0 -1
- package/dist/types/index.mjs +0 -1
- package/src/core/index.ts +0 -5
- package/src/core/utils.ts +0 -1
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valaxy",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "📄 Vite & Vue powered static blog generator.",
|
|
5
|
-
"main": "
|
|
6
|
-
"types": "dist/
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"vite",
|
|
9
9
|
"vue",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Post } from '
|
|
1
|
+
import type { Post } from '../../types'
|
|
2
2
|
import { usePostList } from './post'
|
|
3
3
|
|
|
4
4
|
export interface ParentCategory {
|
|
@@ -32,7 +32,7 @@ export function useCategory() {
|
|
|
32
32
|
|
|
33
33
|
const uncategorized = categoryMap.children.get('Uncategorized') as PostCategory
|
|
34
34
|
|
|
35
|
-
posts.value.forEach((post) => {
|
|
35
|
+
posts.value.forEach((post: Post) => {
|
|
36
36
|
if (post.categories) {
|
|
37
37
|
if (Array.isArray(post.categories)) {
|
|
38
38
|
const len = post.categories.length
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useRoute } from 'vue-router'
|
|
2
|
-
import type { Post } from 'valaxy'
|
|
3
2
|
import { computed } from 'vue'
|
|
4
3
|
|
|
5
|
-
import { isDev
|
|
4
|
+
import { isDev } from '../..'
|
|
5
|
+
import type { Post } from '../../types'
|
|
6
|
+
import { useConfig } from '../config'
|
|
6
7
|
|
|
7
8
|
export function useFrontmatter() {
|
|
8
9
|
const route = useRoute()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { sortByDate } from 'valaxy'
|
|
2
1
|
import type { StyleValue } from 'vue'
|
|
3
2
|
import { computed } from 'vue'
|
|
4
3
|
import { useRoute, useRouter } from 'vue-router'
|
|
5
|
-
import { useThemeConfig } from '
|
|
4
|
+
import { useThemeConfig } from '../config'
|
|
5
|
+
import { sortByDate } from '../utils'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* get post list
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TinyColor } from '@ctrl/tinycolor'
|
|
2
|
+
import type { Post } from '../../types'
|
|
2
3
|
import { usePostList } from './post'
|
|
3
4
|
|
|
4
5
|
export type Tags = Map<string, {
|
|
@@ -41,7 +42,7 @@ export function useTag() {
|
|
|
41
42
|
|
|
42
43
|
const tagMap: Tags = new Map()
|
|
43
44
|
|
|
44
|
-
posts.value.forEach((post) => {
|
|
45
|
+
posts.value.forEach((post: Post) => {
|
|
45
46
|
if (post.tags) {
|
|
46
47
|
let tags: string[]
|
|
47
48
|
if (typeof post.tags === 'string')
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import valaxyConfig from '@valaxyjs/config'
|
|
3
3
|
import type { ComputedRef, InjectionKey } from 'vue'
|
|
4
4
|
import { computed, inject, readonly, shallowRef } from 'vue'
|
|
5
|
-
import type { ThemeConfig } from 'valaxy-theme-yun'
|
|
5
|
+
import type { ThemeConfig } from '../../../valaxy-theme-yun'
|
|
6
6
|
import type { ValaxyConfig } from '../types'
|
|
7
7
|
|
|
8
8
|
/**
|
package/src/client/utils/time.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './client'
|
|
2
2
|
export * from './types'
|
|
@@ -16,11 +16,27 @@ export function createConfigPlugin(options: ResolvedValaxyOptions): Plugin {
|
|
|
16
16
|
'@valaxyjs/client': `${toAtFS(options.clientRoot)}/`,
|
|
17
17
|
'@valaxyjs/config': '/@valaxyjs/config',
|
|
18
18
|
'valaxy/package.json': toAtFS(resolve(options.clientRoot, '../../package.json')),
|
|
19
|
-
'valaxy': toAtFS(resolve(options.clientRoot, '
|
|
19
|
+
'valaxy': toAtFS(resolve(options.clientRoot, '../index.ts')),
|
|
20
20
|
'@valaxyjs/core': toAtFS(resolve(options.clientRoot, '../core')),
|
|
21
21
|
[`valaxy-theme-${options.theme}`]: `${toAtFS(resolve(options.themeRoot))}/`,
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
|
+
|
|
25
|
+
optimizeDeps: {
|
|
26
|
+
entries: [resolve(options.clientRoot, 'main.ts'), options.configFile],
|
|
27
|
+
|
|
28
|
+
include: [
|
|
29
|
+
'vue',
|
|
30
|
+
'vue-router',
|
|
31
|
+
'@vueuse/core',
|
|
32
|
+
'@vueuse/head',
|
|
33
|
+
'dayjs',
|
|
34
|
+
'nprogress',
|
|
35
|
+
],
|
|
36
|
+
exclude: [
|
|
37
|
+
'vue-demi',
|
|
38
|
+
],
|
|
39
|
+
},
|
|
24
40
|
}
|
|
25
41
|
return mergeConfig(config, injection)
|
|
26
42
|
},
|
|
@@ -24,9 +24,14 @@ import { createUnocssPlugin } from './unocss'
|
|
|
24
24
|
import { createConfigPlugin } from './extendConfig'
|
|
25
25
|
import { createValaxyPlugin } from '.'
|
|
26
26
|
|
|
27
|
+
export interface ValaxyPluginOptions {
|
|
28
|
+
components?: Parameters<typeof Components>[0]
|
|
29
|
+
}
|
|
30
|
+
|
|
27
31
|
export function ViteValaxyPlugins(
|
|
28
32
|
options: ResolvedValaxyOptions,
|
|
29
33
|
serverOptions: ValaxyServerOptions = {},
|
|
34
|
+
pluginOptions: ValaxyPluginOptions = {},
|
|
30
35
|
mode: Mode = 'dev',
|
|
31
36
|
): (PluginOption | PluginOption[])[] | undefined {
|
|
32
37
|
const { clientRoot, themeRoot, userRoot } = options
|
|
@@ -40,6 +45,7 @@ export function ViteValaxyPlugins(
|
|
|
40
45
|
const _md = setupMarkdownPlugins(mdIt, options.config.markdownIt)
|
|
41
46
|
|
|
42
47
|
const roots = [clientRoot, themeRoot, userRoot]
|
|
48
|
+
|
|
43
49
|
return [
|
|
44
50
|
Vue({
|
|
45
51
|
include: [/\.vue$/, /\.md$/],
|
|
@@ -123,8 +129,10 @@ export function ViteValaxyPlugins(
|
|
|
123
129
|
allowOverrides: true,
|
|
124
130
|
// override: user -> theme -> client
|
|
125
131
|
// latter override former
|
|
126
|
-
dirs: roots.map(root => `${root}/components`),
|
|
132
|
+
dirs: roots.map(root => `${root}/components`).concat(['src/components', 'components']),
|
|
127
133
|
dts: `${options.userRoot}/components.d.ts`,
|
|
134
|
+
|
|
135
|
+
...pluginOptions,
|
|
128
136
|
}),
|
|
129
137
|
|
|
130
138
|
// https://github.com/antfu/unocss
|
package/src/node/vite.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
|
-
|
|
3
1
|
import generateSitemap from 'vite-ssg-sitemap'
|
|
4
2
|
import type { InlineConfig } from 'vite'
|
|
5
3
|
import { searchForWorkspaceRoot } from 'vite'
|
|
6
4
|
import type { ResolvedValaxyOptions, ValaxyServerOptions } from './options'
|
|
7
5
|
|
|
8
6
|
import { ViteValaxyPlugins } from './plugins/preset'
|
|
9
|
-
import { VALAXY_CONFIG_ID } from './plugins/valaxy'
|
|
10
7
|
|
|
11
8
|
export type Mode = 'dev' | 'build'
|
|
12
9
|
|
|
13
10
|
export function createViteConfig(options: ResolvedValaxyOptions, serverOptions: ValaxyServerOptions = {}, mode: Mode = 'dev'): InlineConfig {
|
|
14
|
-
const { configFile } = options
|
|
15
|
-
|
|
16
11
|
const viteConfig: InlineConfig = {
|
|
17
12
|
// remove vue-i18n warnings
|
|
18
13
|
// https://vue-i18n.intlify.dev/guide/advanced/optimization.html#reduce-bundle-size-with-feature-build-flags
|
|
@@ -26,24 +21,11 @@ export function createViteConfig(options: ResolvedValaxyOptions, serverOptions:
|
|
|
26
21
|
// __VUE_I18N_LEGACY_API__: 'false',
|
|
27
22
|
// },
|
|
28
23
|
|
|
29
|
-
resolve: {
|
|
30
|
-
alias: {
|
|
31
|
-
'@/': `${options.userRoot}/`,
|
|
32
|
-
'~/': `${options.clientRoot}/`,
|
|
33
|
-
'@valaxyjs/client': `${options.clientRoot}/`,
|
|
34
|
-
'valaxy/package.json': `${path.resolve(options.clientRoot, '../../package.json')}`,
|
|
35
|
-
'valaxy': `${path.resolve(options.clientRoot, '..')}`,
|
|
36
|
-
[VALAXY_CONFIG_ID]: `/${VALAXY_CONFIG_ID}`,
|
|
37
|
-
'@valaxyjs/core': `${path.resolve(options.clientRoot, '../core')}`,
|
|
38
|
-
[`valaxy-theme-${options.theme}`]: `${path.resolve(options.themeRoot)}/`,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
|
|
42
24
|
root: options.clientRoot,
|
|
43
25
|
// todo user base
|
|
44
26
|
// base: '/',
|
|
45
27
|
|
|
46
|
-
plugins: ViteValaxyPlugins(options, serverOptions, mode),
|
|
28
|
+
plugins: ViteValaxyPlugins(options, serverOptions, {}, mode),
|
|
47
29
|
|
|
48
30
|
server: {
|
|
49
31
|
fs: {
|
|
@@ -55,19 +37,6 @@ export function createViteConfig(options: ResolvedValaxyOptions, serverOptions:
|
|
|
55
37
|
},
|
|
56
38
|
},
|
|
57
39
|
|
|
58
|
-
optimizeDeps: {
|
|
59
|
-
entries: [path.resolve(options.clientRoot, 'main.ts'), configFile],
|
|
60
|
-
|
|
61
|
-
include: [
|
|
62
|
-
'vue',
|
|
63
|
-
'vue-router',
|
|
64
|
-
'@vueuse/core',
|
|
65
|
-
'@vueuse/head',
|
|
66
|
-
],
|
|
67
|
-
exclude: [
|
|
68
|
-
'vue-demi',
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
40
|
}
|
|
72
41
|
|
|
73
42
|
if (mode === 'build') {
|
package/tsup.config.ts
CHANGED
|
@@ -2,16 +2,19 @@ import { defineConfig } from 'tsup'
|
|
|
2
2
|
|
|
3
3
|
export default defineConfig((options) => {
|
|
4
4
|
return {
|
|
5
|
-
entry: [
|
|
5
|
+
entry: [
|
|
6
|
+
'src/node/index.ts',
|
|
7
|
+
'src/node/cli.ts',
|
|
8
|
+
'src/index.ts',
|
|
9
|
+
],
|
|
6
10
|
splitting: true,
|
|
7
11
|
clean: true,
|
|
8
12
|
dts: true,
|
|
9
13
|
format: ['cjs', 'esm'],
|
|
10
14
|
minify: !options.watch,
|
|
11
15
|
external: [
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'chalk',
|
|
16
|
+
'@valaxyjs/config',
|
|
17
|
+
'valaxy-theme-yun',
|
|
15
18
|
],
|
|
16
19
|
}
|
|
17
20
|
})
|
package/dist/build-OOT6HK6S.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkL5SNNWFJjs = require('./chunk-L5SNNWFJ.js');var _chunkL3EDI35Ijs = require('./chunk-L3EDI35I.js');_chunkL3EDI35Ijs.e.call(void 0, );var _vite = require('vite');async function a(n,e={}){let t=_vite.mergeConfig.call(void 0, e,_chunkL5SNNWFJjs.d.call(void 0, n));await _vite.build.call(void 0, t)}exports.build = a;
|
package/dist/build-SG32QSQ3.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as o}from"./chunk-QI435Q25.mjs";import{e as i}from"./chunk-MVJUGWXR.mjs";i();import{mergeConfig as r,build as f}from"vite";async function a(n,e={}){let t=r(e,o(n));await f(t)}export{a as build};
|
package/dist/chunk-7JDYOPID.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkL5SNNWFJjs = require('./chunk-L5SNNWFJ.js');var _chunkL3EDI35Ijs = require('./chunk-L3EDI35I.js');_chunkL3EDI35Ijs.e.call(void 0, );var _vite = require('vite');async function c(o,t={},i={}){return process.env.EDITOR=process.env.EDITOR||"code",await _vite.createServer.call(void 0, _vite.mergeConfig.call(void 0, t,_chunkL5SNNWFJjs.d.call(void 0, o,i)))}exports.a = c;
|
package/dist/chunk-JJEBEWGI.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as r}from"./chunk-QI435Q25.mjs";import{e}from"./chunk-MVJUGWXR.mjs";e();import{createServer as n,mergeConfig as a}from"vite";async function c(o,t={},i={}){return process.env.EDITOR=process.env.EDITOR||"code",await n(a(t,r(o,i)))}export{c as a};
|
package/dist/chunk-L3EDI35I.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var c=Object.create;var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,d=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;var l=(e,n,t)=>n in e?a(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,f= exports.a =(e,n)=>{for(var t in n||(n={}))g.call(n,t)&&l(e,t,n[t]);if(s)for(var t of s(n))u.call(n,t)&&l(e,t,n[t]);return e};var h=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(n,t)=>(typeof require!="undefined"?require:n)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var y=(e,n)=>()=>(e&&(n=e(e=0)),n);var x=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var b=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of m(n))!g.call(e,i)&&i!==t&&a(e,i,{get:()=>n[i],enumerable:!(r=p(n,i))||r.enumerable});return e};var k=(e,n,t)=>(t=e!=null?c(d(e)):{},b(n||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e));var o=y(()=>{});o();o();var V={url:"",lang:"en",title:"Valaxy Blog",subtitle:"Next Generation Static Blog Framework.",author:{avatar:"https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-with-bg.jpg",name:"YunYouJun",status:{emoji:"\u{1F60A}",message:"All at sea."}},social:[],description:"A blog generated by Valaxy.",license:{enabled:!0,language:"",type:"by-nc-sa"},sponsor:{enable:!0,title:"\u6211\u5F88\u53EF\u7231\uFF0C\u8BF7\u7ED9\u6211\u94B1",methods:[{name:"\u652F\u4ED8\u5B9D",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/alipay-qrcode.jpg",color:"#00A3EE",icon:"i-ri-alipay-line"},{name:"QQ \u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/qqpay-qrcode.png",color:"#12B7F5",icon:"i-ri-qq-line"},{name:"\u5FAE\u4FE1\u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/wechatpay-qrcode.jpg",color:"#2DC100",icon:"i-ri-wechat-pay-line"}]},search:{algolia:{enable:!1,appId:"",apiKey:"",indexName:"",chunkSize:5e3}},comment:{waline:{enable:!1,serverURL:""}},theme:"yun",themeConfig:{},unocss:{},markdown:{excerpt:"<!-- more -->"},markdownIt:{toc:{listType:"ol"},katex:{}}};o();exports.a = f; exports.b = h; exports.c = x; exports.d = k; exports.e = o; exports.f = V;
|