fix(client): プラグインの動作を修正

This commit is contained in:
syuilo 2020-07-18 20:03:46 +09:00
parent b39850de01
commit 705d40ab37
4 changed files with 11 additions and 9 deletions

View File

@ -47,7 +47,7 @@
"@koa/multer": "3.0.0", "@koa/multer": "3.0.0",
"@koa/router": "9.0.1", "@koa/router": "9.0.1",
"@sinonjs/fake-timers": "6.0.1", "@sinonjs/fake-timers": "6.0.1",
"@syuilo/aiscript": "0.7.2", "@syuilo/aiscript": "0.8.0",
"@types/bcryptjs": "2.4.2", "@types/bcryptjs": "2.4.2",
"@types/bull": "3.14.0", "@types/bull": "3.14.0",
"@types/cbor": "5.0.0", "@types/cbor": "5.0.0",

View File

@ -9,6 +9,8 @@ import PortalVue from 'portal-vue';
import VAnimateCss from 'v-animate-css'; import VAnimateCss from 'v-animate-css';
import VueI18n from 'vue-i18n'; import VueI18n from 'vue-i18n';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { AiScript } from '@syuilo/aiscript';
import { deserialize } from '@syuilo/aiscript/built/serializer';
import VueHotkey from './scripts/hotkey'; import VueHotkey from './scripts/hotkey';
import App from './app.vue'; import App from './app.vue';
@ -26,7 +28,6 @@ import createStore from './store';
import { clientDb, get, count } from './db'; import { clientDb, get, count } from './db';
import { setI18nContexts } from './scripts/set-i18n-contexts'; import { setI18nContexts } from './scripts/set-i18n-contexts';
import { createPluginEnv } from './scripts/aiscript/api'; import { createPluginEnv } from './scripts/aiscript/api';
import { AiScript } from '@syuilo/aiscript';
Vue.use(Vuex); Vue.use(Vuex);
Vue.use(VueHotkey); Vue.use(VueHotkey);
@ -267,7 +268,7 @@ os.init(async () => {
store.commit('initPlugin', { plugin, aiscript }); store.commit('initPlugin', { plugin, aiscript });
aiscript.exec(plugin.ast); aiscript.exec(deserialize(plugin.ast));
} }
if (store.getters.isSignedIn) { if (store.getters.isSignedIn) {

View File

@ -42,12 +42,13 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import { AiScript, parse } from '@syuilo/aiscript';
import { serialize } from '@syuilo/aiscript/built/serializer';
import { faPlug, faSave, faTrashAlt, faFolderOpen, faDownload, faCog } from '@fortawesome/free-solid-svg-icons'; import { faPlug, faSave, faTrashAlt, faFolderOpen, faDownload, faCog } from '@fortawesome/free-solid-svg-icons';
import MkButton from '../../components/ui/button.vue'; import MkButton from '../../components/ui/button.vue';
import MkTextarea from '../../components/ui/textarea.vue'; import MkTextarea from '../../components/ui/textarea.vue';
import MkSelect from '../../components/ui/select.vue'; import MkSelect from '../../components/ui/select.vue';
import MkInfo from '../../components/ui/info.vue'; import MkInfo from '../../components/ui/info.vue';
import { AiScript, parse } from '@syuilo/aiscript';
export default Vue.extend({ export default Vue.extend({
components: { components: {
@ -131,7 +132,7 @@ export default Vue.extend({
id, name, version, author, description, permissions, config id, name, version, author, description, permissions, config
}, },
token, token,
ast // TODO: astMapMapJSON ast: serialize(ast)
}); });
this.$root.dialog({ this.$root.dialog({

View File

@ -192,10 +192,10 @@
dependencies: dependencies:
"@sinonjs/commons" "^1.7.0" "@sinonjs/commons" "^1.7.0"
"@syuilo/aiscript@0.7.2": "@syuilo/aiscript@0.8.0":
version "0.7.2" version "0.8.0"
resolved "https://registry.yarnpkg.com/@syuilo/aiscript/-/aiscript-0.7.2.tgz#2f30adb14ffa9f1180af83c059927ab306b175a5" resolved "https://registry.yarnpkg.com/@syuilo/aiscript/-/aiscript-0.8.0.tgz#3a895ddd9f5bd5afa1648acb5fd3e6f94f434cbb"
integrity sha512-l8HVTJTq9KLzDqGswOIGlBepkacudUp70EScrLjL7nEL2NKcti7Ui5fwZCrmxazxgGz6NrVNX5UBIOFFyrwr0A== integrity sha512-mrZ3awYf1R81D+OWZctRFiAWUt6xL3A5ovBn2OD8+1hZyX3T7S+awqrhYVLoQPhd/cijz1RT6PE8AEUtuR1J8Q==
dependencies: dependencies:
autobind-decorator "2.4.0" autobind-decorator "2.4.0"
chalk "4.0.0" chalk "4.0.0"