Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): 更新goja等多个依赖库 #1103

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions dice/dice_jsvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os"
"path/filepath"
"regexp"
"runtime/debug"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -98,7 +99,6 @@ func (d *Dice) JsInit() {
d.JsScriptCron = cron.New()
d.JsScriptCronLock = &sync.Mutex{}
d.JsScriptCron.Start()

// 初始化
loop.Run(func(vm *goja.Runtime) {
vm.SetFieldNameMapper(goja.TagFieldNameMapper("jsbind", true))
Expand Down Expand Up @@ -598,7 +598,13 @@ func (d *Dice) JsInit() {
// `)
_, _ = vm.RunString(`Object.freeze(seal);Object.freeze(seal.deck);Object.freeze(seal.coc);Object.freeze(seal.ext);Object.freeze(seal.vars);`)
})
loop.Start()
go func() {
if r := recover(); r != nil {
log.Errorf("JS核心执行异常: %v 堆栈: %v", r, string(debug.Stack()))
}
loop.StartInForeground()
}()
// loop.Start()
(&d.Config).JsEnable = true
d.Logger.Info("已加载JS环境")
d.MarkModified()
Expand Down Expand Up @@ -634,7 +640,7 @@ func (d *Dice) jsClear() {
d.RegisterBuiltinSystemTemplate()
// 关闭js vm
if d.JsLoop != nil {
d.JsLoop.Stop()
d.JsLoop.Terminate()
d.JsLoop = nil
}
}
Expand Down
36 changes: 18 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module sealdice-core
go 1.22

require (
github.com/Masterminds/semver/v3 v3.2.1
github.com/Masterminds/semver/v3 v3.3.0
github.com/Milly/go-base2048 v0.1.0
github.com/ShiraazMoollatjie/goluhn v0.0.0-20211017190329-0d86158c056a
github.com/Szzrain/DingTalk-go v0.0.8-alpha
Expand All @@ -14,8 +14,8 @@ require (
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
github.com/blevesearch/bleve/v2 v2.3.10
github.com/bwmarrin/discordgo v0.28.1
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d
github.com/dop251/goja_nodejs v0.0.0-20231022114343-5c1f9037c9ab
github.com/dop251/goja v0.0.0-20241024094426-79f3a7efcdbd
github.com/dop251/goja_nodejs v0.0.0-20240728170619-29b559befffc
github.com/evanw/esbuild v0.23.1
github.com/fy0/go-autostart v0.0.0-20220515100644-a25d81ed766b
github.com/fy0/gojax v0.0.0-20221225152702-4140cf8509bd
Expand Down Expand Up @@ -54,25 +54,25 @@ require (
github.com/sacOO7/gowebsocket v0.0.0-20221109081133-70ac927be105
github.com/sahilm/fuzzy v0.1.1
github.com/samber/lo v1.44.0
github.com/schollz/progressbar/v3 v3.14.6
github.com/schollz/progressbar/v3 v3.17.0
github.com/sealdice/botgo v0.0.0-20240102160217-e61d5bdfe083
github.com/sealdice/dicescript v0.0.0-20240927083134-65269b7d051c
github.com/slack-go/slack v0.13.0
github.com/slack-go/slack v0.15.0
github.com/sunshineplan/imgconv v1.1.4
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a
github.com/tdewolff/minify/v2 v2.20.37
github.com/tidwall/buntdb v1.3.2
github.com/tidwall/gjson v1.18.0
github.com/tidwall/sjson v1.2.5
github.com/vmihailenco/msgpack v4.0.4+incompatible
github.com/xuri/excelize/v2 v2.8.1
github.com/xuri/excelize/v2 v2.9.0
github.com/yuin/goldmark v1.7.4
go.etcd.io/bbolt v1.3.9
go.etcd.io/bbolt v1.3.11
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.27.0
golang.org/x/crypto v0.28.0
golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8
golang.org/x/sys v0.25.0
golang.org/x/text v0.18.0
golang.org/x/sys v0.26.0
golang.org/x/text v0.19.0
golang.org/x/time v0.5.0
gopkg.in/elazarl/goproxy.v1 v1.0.0-20180725130230-947c36da3153
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
Expand Down Expand Up @@ -100,7 +100,7 @@ require (
github.com/blevesearch/zapx/v14 v14.3.10 // indirect
github.com/blevesearch/zapx/v15 v15.3.13 // indirect
github.com/disintegration/imaging v1.6.2 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a // indirect
github.com/elazarl/goproxy/ext v0.0.0-20230808193330-2592e75ae04a // indirect
Expand All @@ -112,7 +112,7 @@ require (
github.com/getlantern/ops v0.0.0-20190325191751-d70cb0d6f85f // indirect
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/go-resty/resty/v2 v2.11.0 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/go-sourcemap/sourcemap v2.1.4+incompatible // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/go-toast/toast v0.0.0-20190211030409-01e6764cf0a4 // indirect
github.com/gobuffalo/envy v1.7.0 // indirect
Expand All @@ -123,7 +123,7 @@ require (
github.com/golang/geo v0.0.0-20230404232722-c4acd7a044dc // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 // indirect
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
github.com/hhrutter/lzw v1.0.0 // indirect
github.com/hhrutter/tiff v1.0.1 // indirect
github.com/joho/godotenv v1.3.0 // indirect
Expand All @@ -143,7 +143,7 @@ require (
github.com/pdfcpu/pdfcpu v0.8.1 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.3 // indirect
github.com/richardlehane/msoleps v1.0.4 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/sacOO7/go-logger v0.0.0-20180719173527-9ac9add5a50d // indirect
Expand All @@ -159,14 +159,14 @@ require (
github.com/tidwall/tinyqueue v0.1.1 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 // indirect
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 // indirect
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d // indirect
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/image v0.19.0 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/term v0.24.0 // indirect
golang.org/x/term v0.25.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
Expand Down
Loading