Git Product home page Git Product logo

Comments (15)

NextZeus avatar NextZeus commented on June 7, 2024 3

admin和robot毕竟是工具,项目还是纯净些好。想用admin和robot手动弄一下就行了。

from pinus.

mybios avatar mybios commented on June 7, 2024

这个可以有,后续可以把cli的功能做强大点,让这两个变成可选项。毕竟现在已经是插件模式。

from pinus.

zengqingsong avatar zengqingsong commented on June 7, 2024

这个是基于Pomelo的那个版本开发的?

from pinus.

whtiehack avatar whtiehack commented on June 7, 2024

@zengqingsong
yes. pinus 是TS版的 pomelo.并且修复了一些bug,做了一些优化

from pinus.

didoupt avatar didoupt commented on June 7, 2024

各位大佬,我是新手一个,想问一下,怎么添加admin-server,和robot-server??

from pinus.

YunlongJiao-B avatar YunlongJiao-B commented on June 7, 2024

@didoupeanut
直接看pomelo的文档。。

from pinus.

didoupt avatar didoupt commented on June 7, 2024

我把pinus项目中的robot-example 项目独立出来,一编译就报错:
报错信息:
node_modules/pinus-robot/lib/agent/agent.ts:1:17 - error TS2503: Cannot find namespace 'SocketIOClient'.

1 import Socket = SocketIOClient.Socket;

我把example中的websocket-chat 独立出来,也是报错,两者的共同点都是引用了pinus-robot 和pinus-robot-plugn.
这个有大佬帮忙解释一下嘛?

我把引用注释掉就不会有编译问题了

from pinus.

whtiehack avatar whtiehack commented on June 7, 2024

@didoupeanut
目前版本 1.4.10 没有遇到你说的问题

from pinus.

didoupt avatar didoupt commented on June 7, 2024

两个插件都是1.4.9,我看看1.4.10有没有这个问题

from pinus.

didoupt avatar didoupt commented on June 7, 2024

1.4.10还是有问题。vscode控制台打印:

PS E:\pinus\chat\server-game> npm run build

[email protected] build E:\pinus\chat\server-game
tsc && node copy

node_modules/pinus-robot/lib/agent/agent.ts:1:17 - error TS2503: Cannot find namespace 'SocketIOClient'.

1 import Socket = SocketIOClient.Socket;
~~~~~~~~~~~~~~

Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: tsc && node copy
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2020-08-27T08_54_14_012Z-debug.log

工程配置:
{
"name": "pinus",
"version": "0.0.1",
"private": false,
"bin": {
"$": "./dist/bin/app.js"
},
"main": "./dist/app",
"scripts": {
"start": "npm run build && cd dist && node app",
"build": "node_modules/.bin/tsc && node copy"
},
"dependencies": {
"@types/node": "8.10.54",
"@types/bluebird": "^3.5.19",
"pinus": "1.4.10",
"pinus-robot": "^1.4.10",
"pinus-robot-plugin": "^1.4.10",
"bluebird": "^3.5.1",
"source-map-support": "^0.5.0",
"reflect-metadata": "^0.1.10"
},
"devDependencies": {
"cpy": "^8.1.0",
"tslint": "5.20.1",
"typescript": "3.7.3"
}
}

ts配置文件我没改:

{
"compilerOptions": {
// types option has been previously configured
"types": [
// add node as an option
"node"
],
"module": "commonjs", //指定生成哪个模块系统代码
"target": "es2017",
"lib": [
"es2015",
"es2016",
"es2017",
"esnext.asynciterable"
],
"noImplicitAny": false, //在表达式和声明上有隐含的'any'类型时报错。
"noImplicitThis": false,
"inlineSourceMap": true,
"rootDirs": [
"."
], //仅用来控制输出的目录结构--outDir。
"outDir": "./dist", //重定向输出目录。
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution": "node",
"watch": false //在监视模式下运行编译器。会监视输出文件,在它们改变时重新编译。
},
"include": [
".//*.ts", "copy.js"
],
"exclude": [
"./dist/
/."
]
}

我只是释放了app.ts的注释:

import { pinus } from 'pinus';
import * as routeUtil from './app/util/routeUtil';
import { preload } from './preload';
// 就是这行引用,导致ts编译报错,不知道为什么我这里编译会检查依赖,加上了"skipLibCheck": true, 也没用
import { createRobotPlugin } from 'pinus-robot-plugin';

// 原来的代码。。。

// if (app.isMaster()) {
// app.use(createRobotPlugin({ scriptFile: __dirname + '/robot/robot.js' }));
// }

// start app
app.start();

from pinus.

whtiehack avatar whtiehack commented on June 7, 2024

npm install @types/socket.io-client 试一下

from pinus.

didoupt avatar didoupt commented on June 7, 2024

可以了,给工程加上这个依赖就可以用robot插件了,

from pinus.

didoupt avatar didoupt commented on June 7, 2024

我检查了一下,@types/socket.io-client 这个依赖是在pinus-rpc中添加的,但是在robot插件中没有,pinus中也没有,所以如果没有加上pinus-rpc依赖就会有问题,所以这个是不是考虑加到pinus中呢?或者创建项目的时候给加上? @whtiehack

from pinus.

whtiehack avatar whtiehack commented on June 7, 2024

pinus-robot 有这个依赖的.不知道为什么你那会报错.

from pinus.

Forever90 avatar Forever90 commented on June 7, 2024

node_modules/pinus-robot/lib/agent/agent.ts:1:17 - error TS2503: Cannot find namespace 'SocketIOClient'.

1 import Socket = SocketIOClient.Socket;
~~~~~~~~~~~~~~

我用npm中下载的pinus-example-robot, 直接运行dist 可以,但是重新编译ts脚本 就报这个错,是怎么回事呢

from pinus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.