valaxy 0.21.1 → 0.22.2-beta.5
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/bin/{valaxy.mjs → valaxy.js} +1 -1
- package/client/composables/common.ts +37 -0
- package/client/composables/global.ts +4 -4
- package/client/composables/locale.ts +8 -5
- package/client/composables/outline/anchor.ts +4 -2
- package/client/main.ts +9 -5
- package/client/templates/loader.vue +10 -0
- package/client/utils/time.ts +21 -55
- package/dist/chunk-ACYXZDCP.js +2 -0
- package/dist/{chunk-KQEK3EI2.mjs → chunk-BKO6YTFK.js} +1 -1
- package/dist/chunk-ESOXDAAD.js +158 -0
- package/dist/node/cli/index.d.ts +12 -2
- package/dist/node/cli/index.js +2 -0
- package/dist/node/index.d.ts +8 -2
- package/dist/node/index.js +2 -0
- package/dist/node/worker_shikiResolveLang.d.ts +10 -0
- package/dist/node/worker_shikiResolveLang.js +2 -0
- package/dist/types/index.d.ts +5 -1
- package/dist/types/{index.mjs → index.js} +1 -1
- package/package.json +16 -23
- package/types/data.ts +5 -1
- package/bin/valaxy.cjs +0 -10
- package/dist/chunk-QBQ5XWB7.cjs +0 -1
- package/dist/chunk-TWPNJIK4.cjs +0 -161
- package/dist/chunk-WZQPPSXL.mjs +0 -162
- package/dist/config-Dxu7i2Zs.d.cts +0 -741
- package/dist/node/cli/index.cjs +0 -1
- package/dist/node/cli/index.d.cts +0 -6
- package/dist/node/cli/index.mjs +0 -2
- package/dist/node/index.cjs +0 -1
- package/dist/node/index.d.cts +0 -649
- package/dist/node/index.mjs +0 -2
- package/dist/types/index.cjs +0 -1
- package/dist/types/index.d.cts +0 -31
|
@@ -31,6 +31,43 @@ export function useFrontmatter<T extends Record<string, any> = PostFrontMatter>(
|
|
|
31
31
|
return frontmatter
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* 获取加密文章数据
|
|
36
|
+
*/
|
|
37
|
+
export function useEncryptedContent() {
|
|
38
|
+
// const value = inject<string>('valaxy:encryptedContent')
|
|
39
|
+
// inject 还没有插入
|
|
40
|
+
const route = useRoute()
|
|
41
|
+
return computed(() => {
|
|
42
|
+
return route.meta.$encryptedContent || ''
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 获取部分加密内容
|
|
48
|
+
*/
|
|
49
|
+
export function usePartiallyEncryptedContents() {
|
|
50
|
+
// const value = inject<string>('valaxy:partiallyEncryptedContents')
|
|
51
|
+
// inject 还没有插入
|
|
52
|
+
const route = useRoute()
|
|
53
|
+
return computed(() => {
|
|
54
|
+
return route.meta.$partiallyEncryptedContents || []
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* encryptedPhotos
|
|
60
|
+
* 获取加密相册数据
|
|
61
|
+
*/
|
|
62
|
+
export function useEncryptedPhotos() {
|
|
63
|
+
// const value = inject<string>('valaxy:encryptedPhotos')
|
|
64
|
+
// inject 还没有插入
|
|
65
|
+
const route = useRoute()
|
|
66
|
+
return computed(() => {
|
|
67
|
+
return route.meta.$encryptedPhotos || ''
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
|
|
34
71
|
/**
|
|
35
72
|
* inject pageData
|
|
36
73
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useSiteConfig } from 'valaxy'
|
|
2
|
-
import { onBeforeMount
|
|
3
|
-
|
|
4
|
-
export const timezone = ref<string>()
|
|
2
|
+
import { onBeforeMount } from 'vue'
|
|
3
|
+
import { dayjs } from '../utils/time'
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* use timezone
|
|
@@ -11,6 +10,7 @@ export function useTimezone() {
|
|
|
11
10
|
const siteConfig = useSiteConfig()
|
|
12
11
|
|
|
13
12
|
onBeforeMount(() => {
|
|
14
|
-
|
|
13
|
+
if (siteConfig.value.timezone)
|
|
14
|
+
dayjs.tz.setDefault(siteConfig.value.timezone)
|
|
15
15
|
})
|
|
16
16
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { isClient, useStorage } from '@vueuse/core'
|
|
2
|
-
import
|
|
2
|
+
import dayjs from 'dayjs'
|
|
3
3
|
// not optimize deps all locales
|
|
4
|
-
import { enUS } from 'date-fns/locale/en-US'
|
|
5
|
-
import { zhCN } from 'date-fns/locale/zh-CN'
|
|
6
4
|
import { useI18n } from 'vue-i18n'
|
|
7
5
|
|
|
6
|
+
import 'dayjs/locale/en'
|
|
7
|
+
import 'dayjs/locale/zh-cn'
|
|
8
|
+
|
|
8
9
|
export function useLocale() {
|
|
9
10
|
const { availableLocales, locale } = useI18n()
|
|
10
11
|
const lang = useStorage('valaxy-locale', locale.value)
|
|
11
12
|
// set date locale
|
|
12
|
-
setDefaultOptions({ locale: locale.value === 'zh-CN' ? zhCN : enUS })
|
|
13
|
+
// setDefaultOptions({ locale: locale.value === 'zh-CN' ? zhCN : enUS })
|
|
14
|
+
dayjs.locale(locale.value === 'zh-CN' ? 'zh-cn' : 'en')
|
|
13
15
|
|
|
14
16
|
const toggleLocales = () => {
|
|
15
17
|
// change to some real logic
|
|
@@ -20,7 +22,8 @@ export function useLocale() {
|
|
|
20
22
|
lang.value = locale.value
|
|
21
23
|
|
|
22
24
|
// set date locale
|
|
23
|
-
setDefaultOptions({ locale: locale.value === 'zh-CN' ? zhCN : enUS })
|
|
25
|
+
// setDefaultOptions({ locale: locale.value === 'zh-CN' ? zhCN : enUS })
|
|
26
|
+
dayjs.locale(locale.value === 'zh-CN' ? 'zh-cn' : 'en')
|
|
24
27
|
|
|
25
28
|
if (isClient)
|
|
26
29
|
document.documentElement.setAttribute('lang', locale.value)
|
|
@@ -136,8 +136,10 @@ export function useActiveAnchor(
|
|
|
136
136
|
marker.value.style.opacity = '1'
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
|
-
marker.value
|
|
140
|
-
|
|
139
|
+
if (marker.value) {
|
|
140
|
+
marker.value.style.top = `${topOffset}px`
|
|
141
|
+
marker.value.style.opacity = '0'
|
|
142
|
+
}
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
}
|
package/client/main.ts
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import type { ViteSSGContext } from 'vite-ssg'
|
|
2
|
+
import { DataLoaderPlugin } from 'unplugin-vue-router/data-loaders'
|
|
2
3
|
import { initValaxyConfig, valaxyConfigSymbol } from 'valaxy'
|
|
3
4
|
import { setupLayouts } from 'virtual:generated-layouts'
|
|
4
5
|
import { ViteSSG } from 'vite-ssg'
|
|
5
|
-
import { routes } from 'vue-router/auto-routes'
|
|
6
6
|
|
|
7
|
+
import { routes } from 'vue-router/auto-routes'
|
|
7
8
|
// import App from '/@valaxyjs/App.vue'
|
|
8
9
|
import App from './App.vue'
|
|
9
|
-
import AppLink from './components/AppLink.vue'
|
|
10
10
|
|
|
11
|
+
import AppLink from './components/AppLink.vue'
|
|
11
12
|
import setupMain from './setup/main'
|
|
12
|
-
import { setupValaxyDevTools } from './utils/dev'
|
|
13
13
|
|
|
14
|
+
import { setupValaxyDevTools } from './utils/dev'
|
|
14
15
|
// reset styles, load css before app
|
|
15
16
|
// import '@unocss/reset/tailwind.css'
|
|
16
17
|
// https://unocss.dev/guide/style-reset#tailwind-compat
|
|
17
18
|
// minus the background color override for buttons to avoid conflicts with UI frameworks
|
|
18
19
|
import '@unocss/reset/tailwind-compat.css'
|
|
20
|
+
|
|
19
21
|
// css
|
|
20
22
|
import './styles/css/css-vars.css'
|
|
21
23
|
|
|
22
24
|
import './styles/css/main.css'
|
|
23
|
-
|
|
24
25
|
// generate user styles
|
|
25
26
|
import '/@valaxyjs/styles'
|
|
26
27
|
import 'uno.css'
|
|
@@ -78,7 +79,10 @@ export const createApp = ViteSSG(
|
|
|
78
79
|
},
|
|
79
80
|
(ctx) => {
|
|
80
81
|
// app-level provide
|
|
81
|
-
const { app } = ctx
|
|
82
|
+
const { app, router } = ctx
|
|
83
|
+
|
|
84
|
+
// Register the plugin before the router
|
|
85
|
+
app.use(DataLoaderPlugin, { router })
|
|
82
86
|
|
|
83
87
|
app.provide(valaxyConfigSymbol, valaxyConfig)
|
|
84
88
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineBasicLoader } from 'unplugin-vue-router/data-loaders/basic'
|
|
3
|
+
|
|
4
|
+
export const usePageData = defineBasicLoader('/relativePath', async (_to) => {
|
|
5
|
+
// custom basic loader
|
|
6
|
+
}, {
|
|
7
|
+
// @see https://uvr.esm.is/data-loaders/defining-loaders.html#non-blocking-loaders-with-lazy
|
|
8
|
+
lazy: (to, from) => to.name === from.name,
|
|
9
|
+
})
|
|
10
|
+
</script>
|
package/client/utils/time.ts
CHANGED
|
@@ -1,64 +1,30 @@
|
|
|
1
|
-
import type { ToDateOptionsWithTZ } from 'date-fns-tz'
|
|
2
1
|
import type { Post } from '../../types'
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
// dayjs
|
|
3
|
+
import dayjs from 'dayjs'
|
|
4
|
+
import relativeTime from 'dayjs/plugin/relativeTime'
|
|
5
|
+
import timezone from 'dayjs/plugin/timezone'
|
|
6
|
+
import utc from 'dayjs/plugin/utc'
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
dayjs.extend(relativeTime)
|
|
9
|
+
dayjs.extend(timezone)
|
|
10
|
+
dayjs.extend(utc)
|
|
11
|
+
|
|
12
|
+
// https://day.js.org/docs/en/timezone/set-default-timezone
|
|
13
|
+
export { dayjs }
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
|
-
* format the date
|
|
13
|
-
*
|
|
14
|
-
* @param formatStr the string of tokens
|
|
15
|
-
* @param timezone the time zone of this local time, can be an offset or IANA time zone
|
|
16
|
-
* @param options the object with options. See [Options]{@link https://date-fns.org/docs/Options}
|
|
16
|
+
* format the date (dayjs)
|
|
17
|
+
* with default timezone
|
|
17
18
|
*/
|
|
18
|
-
export function formatDate(date
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Format the timezone-less date to ISO. If none is specified, use the client's timezone.
|
|
27
|
-
* If the input date is already in ISO format, the timezone won't be applied.
|
|
28
|
-
*/
|
|
29
|
-
date = handleTimeWithZone(date, timezone || globalTimezone.value || clientTimezone).toString()
|
|
30
|
-
// Convert to the client's timezone unless the user specifies otherwise
|
|
31
|
-
const zonedDate = toZonedTime(date, options?.timeZone || clientTimezone, mergedOptions)
|
|
32
|
-
// The format function will never change the underlying date
|
|
33
|
-
return formatWithTZ(zonedDate, formatStr, { timeZone: options?.timeZone })
|
|
19
|
+
export function formatDate(date?: string | number | Date, options: {
|
|
20
|
+
template?: string
|
|
21
|
+
timezone?: string
|
|
22
|
+
// keepLocalTime?: boolean
|
|
23
|
+
} = {}) {
|
|
24
|
+
if (typeof date === 'string') {
|
|
25
|
+
date = new Date(date)
|
|
34
26
|
}
|
|
35
|
-
|
|
36
|
-
console.error(
|
|
37
|
-
'The date format provided is non-standard. The recommended format is \'yyyy-MM-dd HH:mm:ss\'',
|
|
38
|
-
'\nError formatting date:',
|
|
39
|
-
date.toString(),
|
|
40
|
-
error,
|
|
41
|
-
)
|
|
42
|
-
return format(referenceDate, formatStr)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function handleTimeWithZone(date: string | number | Date, timezone: string) {
|
|
47
|
-
if (typeof date !== 'string')
|
|
48
|
-
date = toDate(date).toISOString()
|
|
49
|
-
|
|
50
|
-
let dateTime = DateTime.fromISO(date, { setZone: true })
|
|
51
|
-
|
|
52
|
-
const toDateTime = (date: string, zone: string) => {
|
|
53
|
-
// Attempt to format the date using a function that handles non-ISO 8601 formats
|
|
54
|
-
const isoDate = format(date, 'yyyy-MM-dd\'T\'HH:mm:ss')
|
|
55
|
-
return DateTime.fromISO(isoDate, { zone })
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (!dateTime.isValid || !dateTime.zoneName)
|
|
59
|
-
dateTime = toDateTime(date, timezone)
|
|
60
|
-
|
|
61
|
-
return dateTime
|
|
27
|
+
return dayjs.tz(dayjs.utc(date), options.timezone).format(options.template || 'YYYY-MM-DD')
|
|
62
28
|
}
|
|
63
29
|
|
|
64
30
|
/**
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
2
|
+
import{a as w,d as h,e as d}from"./chunk-BKO6YTFK.js";d();d();function Q(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Z(e,t,n,r){function o(s){return s instanceof n?s:new n(function(c){c(s)})}return new(n||(n=Promise))(function(s,c){function l(i){try{u(r.next(i))}catch(p){c(p)}}function a(i){try{u(r.throw(i))}catch(p){c(p)}}function u(i){i.done?s(i.value):o(i.value).then(l,a)}u((r=r.apply(e,t||[])).next())})}import{createHash as me}from"node:crypto";import G from"node:fs";import se from"node:module";import b from"node:path";import{fileURLToPath as be,pathToFileURL as X}from"node:url";import{MessageChannel as he,Worker as _e,parentPort as we,receiveMessageOnPort as ge,workerData as re}from"node:worker_threads";d();import{createRequire as de}from"node:module";var j=process.cwd(),A=typeof w>"u"?de(import.meta.url):w,ee=[".ts",".tsx",...Object.keys(A.extensions)];d();import q from"node:fs";import _ from"node:path";var ye=e=>{try{return A.resolve(e)}catch{}},W=e=>!!ye(e),I=(e,t=!1)=>{if(typeof e=="string")return q.existsSync(e)&&(t||q.statSync(e).isFile())?e:"";for(let n of e??[])if(I(n,t))return n;return""},te=(e,t=ee)=>{let n=[...t,""].find(r=>I(e+r));return n==null?"":e+n},D=(e,t,n)=>{if(console.assert(_.isAbsolute(e)),!I(e,!0)||e!==j&&!e.startsWith(j+_.sep))return"";e=_.resolve(q.statSync(e).isDirectory()?e:_.resolve(e,".."));let r=typeof t=="string",o=r?t:"package.json";do{let s=I(_.resolve(e,o),r&&n);if(s)return s;e=_.resolve(e,"..")}while(e===j||e.startsWith(j+_.sep));return""};d();var ve=4,f={TsNode:"ts-node",EsbuildRegister:"esbuild-register",EsbuildRunner:"esbuild-runner",SWC:"swc",TSX:"tsx"},{NODE_OPTIONS:k,SYNCKIT_EXEC_ARGV:B,SYNCKIT_GLOBAL_SHIMS:Se,SYNCKIT_TIMEOUT:ne,SYNCKIT_TS_RUNNER:Ee}=process.env,ie=Number(process.versions.node.split(".")[0])>=20,xe=ne?+ne:void 0,Te=B?.split(",")||[],je=Ee,Oe=["1","true"].includes(Se),Pe=[{moduleName:"node-fetch",globalName:"fetch"},{moduleName:"node:perf_hooks",globalName:"performance",named:"performance"}],Ne=16,g;function Re(e){if(e&&typeof e=="object"){let t={};for(let n in e)t[n]=e[n];return t}}function nt(e,t){g??(g=new Map);let n=g.get(e);if(n)return n;if(!b.isAbsolute(e))throw new Error("`workerPath` must be absolute");let r=Ce(e,typeof t=="number"?{timeout:t}:t);return g.set(e,r),r}var F=typeof w>"u"?se.createRequire(import.meta.url):w,$e=e=>new URL(`data:text/javascript,${encodeURIComponent(e)}`),ae=e=>{var t;try{return!!(!((t=G.statSync(e,{throwIfNoEntry:!1}))===null||t===void 0)&&t.isFile())}catch{return!1}},Ie=(e,{execArgv:t,tsRunner:n})=>{let r=b.extname(e);if(!/[/\\]node_modules[/\\]/.test(e)&&(!r||/^\.[cm]?js$/.test(r))){let a=r?e.slice(0,-r.length):e,u;switch(r){case".cjs":{u=[".cts",".cjs"];break}case".mjs":{u=[".mts",".mjs"];break}default:{u=[".ts",".js"];break}}let i=te(a,u),p;i&&(!r||(p=i!==a))&&(e=i,p&&(r=b.extname(e)))}let o=/\.[cm]?ts$/.test(e),s=e.endsWith(".mjs"),c=e.endsWith(".mts");if(o){if(!c){let a=D(e);a&&(c=F(a).type==="module")}switch(n==null&&W(f.TsNode)&&(n=f.TsNode),n){case f.TsNode:{c?t.includes("--loader")||(t=["--loader",`${f.TsNode}/esm`,...t]):t.includes("-r")||(t=["-r",`${f.TsNode}/register`,...t]);break}case f.EsbuildRegister:{t.includes("-r")||(t=["-r",f.EsbuildRegister,...t]);break}case f.EsbuildRunner:{t.includes("-r")||(t=["-r",`${f.EsbuildRunner}/register`,...t]);break}case f.SWC:{t.includes("-r")||(t=["-r",`@${f.SWC}-node/register`,...t]);break}case f.TSX:{t.includes("--loader")||(t=["--loader",f.TSX,...t]);break}default:throw new Error(`Unknown ts runner: ${String(n)}`)}}else if(!s){let a=D(e);a&&(s=F(a).type==="module")}let l;if(process.versions.pnp){let a=k?.split(/\s+/),u;try{u=F.resolve("pnpapi")}catch{}if(u&&!a?.some((i,p)=>["-r","--require"].includes(i)&&u===F.resolve(a[p+1]))&&!t.includes(u)){t=["-r",u,...t];let i=b.resolve(u,"../.pnp.loader.mjs");ae(i)&&(l=X(i).toString(),ie||(t=["--experimental-loader",l,...t]))}}return{ext:r,isTs:o,jsUseEsm:s,tsRunner:n,tsUseEsm:c,workerPath:e,pnpLoaderPath:l,execArgv:t}},De=e=>me("md5").update(e).digest("hex"),V=(e,t="import")=>{let{moduleName:n,globalName:r,named:o,conditional:s}=typeof e=="string"?{moduleName:e}:e,c=t==="import"?`import${r?" "+(o===null?"* as "+r:o?.trim()?`{${o}}`:r)+" from":""} '${b.isAbsolute(n)?String(X(n)):n}'`:`${r?"const "+(o?.trim()?`{${o}}`:r)+"=":""}require('${n.replace(/\\/g,"\\\\")}')`;if(!r)return c;let l=`globalThis.${r}=${o?.trim()?o:r}`;return c+(s===!1?`;${l}`:`;if(!globalThis.${r})${l}`)},Fe=(e,t)=>e.reduce((n,r)=>`${n}${n?";":""}${V(r,t)}`,""),v,U,Ue=typeof h>"u"?b.dirname(be(import.meta.url)):h,O,S,oe=(e,t,n="import")=>{v??(v=new Map);let r=v.get(e);if(r){let[l,a]=r;if(n==="require"&&!a||n==="import"&&a&&ae(a))return l}let o=Fe(t,n),s=o,c;return n==="import"&&(U||(U=b.resolve(D(Ue),"../node_modules/.synckit")),G.mkdirSync(U,{recursive:!0}),c=b.resolve(U,De(e)+".mjs"),s=V(c),G.writeFileSync(c,o)),v.set(e,[s,c]),s};function Ce(e,{timeout:t=xe,execArgv:n=Te,tsRunner:r=je,transferList:o=[],globalShims:s=Oe}={}){let{port1:c,port2:l}=new he,{isTs:a,ext:u,jsUseEsm:i,tsUseEsm:p,tsRunner:P,workerPath:E,pnpLoaderPath:ce,execArgv:ue}=Ie(e,{execArgv:n,tsRunner:r}),K=X(E);if(/\.[cm]ts$/.test(E)){let y=!p||Number.parseFloat(process.versions.node)>=Ne;if(P){if([f.EsbuildRegister,f.EsbuildRunner,f.SWC,...y?[]:[f.TSX]].includes(P))throw new Error(`${P} is not supported for ${u} files yet`+(y?", you can try [tsx](https://github.com/esbuild-kit/tsx) instead":""))}else throw new Error("No ts runner specified, ts worker path is not supported")}let C=(s===!0?Pe:Array.isArray(s)?s:[]).filter(({moduleName:y})=>W(y));S??(S=new Int32Array(O??(O=new SharedArrayBuffer(ve)),0,1));let H=C.length>0,Y=a?!p:!i&&H,z=new _e(i&&H||p&&P===f.TsNode?$e(`${oe(E,C)};import '${String(K)}'`):Y?`${oe(E,C,"require")};${V(E,"require")}`:K,{eval:Y,workerData:{sharedBuffer:O,workerPort:l,pnpLoaderPath:ce},transferList:[l,...o],execArgv:ue}),fe=0,J=(y,m,x)=>{let L=Date.now(),T=Atomics.wait(S,0,0,x);if(Atomics.store(S,0,0),!["ok","not-equal"].includes(T)){let M={id:m,cmd:"abort"};throw y.postMessage(M),new Error("Internal error: Atomics.wait() failed: "+T)}let N=ge(c).message,{id:R}=N,pe=Q(N,["id"]);if(R<m){let M=Date.now()-L;return J(y,m,x?x-M:void 0)}if(m!==R)throw new Error(`Internal error: Expected id ${m} but got id ${R}`);return Object.assign({id:R},pe)},le=(...y)=>{let m=fe++,x={id:m,args:y};z.postMessage(x);let{result:L,error:T,properties:N}=J(c,m,t);if(T)throw Object.assign(T,N);return L};return z.unref(),le}function ot(e){if(!re)return;let{workerPort:t,sharedBuffer:n,pnpLoaderPath:r}=re;r&&ie&&se.register(r);let o=new Int32Array(n,0,1);we.on("message",({id:s,args:c})=>{Z(this,void 0,void 0,function*(){let l=!1,a=i=>{i.id===s&&i.cmd==="abort"&&(l=!0)};t.on("message",a);let u;try{u={id:s,result:yield e(...c)}}catch(i){u={id:s,error:i,properties:Re(i)}}t.off("message",a),!l&&(t.postMessage(u),Atomics.add(o,0,1),Atomics.notify(o,0))})})}export{nt as a,ot as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
2
|
-
var n=Object.create;var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var
|
|
2
|
+
var n=Object.create;var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var u=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var l=(t,e)=>()=>(t&&(e=t(t=0)),e);var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var s=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of p(e))!f.call(t,m)&&m!==o&&i(t,m,{get:()=>e[m],enumerable:!(r=a(e,m))||r.enumerable});return t};var F=(t,e,o)=>(o=t!=null?n(c(t)):{},s(e||!t||!t.__esModule?i(o,"default",{value:t,enumerable:!0}):o,t));import{fileURLToPath as _}from"url";import d from"path";var g,h,T,x=l(()=>{"use strict";g=()=>_(import.meta.url),h=()=>d.dirname(g()),T=h()});export{u as a,D as b,F as c,T as d,x as e};
|