wetools / wept Goto Github PK
View Code? Open in Web Editor NEW微信小程序多端实时运行工具
微信小程序多端实时运行工具
wept --version
: 0.2.9node --version
: 5.7.0Impossible to import template file. It's working in WeChat IDE.
wept --version
: 0.5.2 103100node --version
: v6.2.2$ wept
listening on port 3000
undefined
undefined
E:\123\nodejs\global\node_modules\wept\node_modules.1.9.2@growl\lib\growl.js:27 2
args.push(quote(msg).replace(/\n/g, '\n'));
^
TypeError: Cannot read property 'replace' of undefined
at growl (E:\123\nodejs\global\node_modules\wept\node_modules.1.9.2@growl\l ib\growl.js:272:27)
at Object.exports.notifyError (E:\123\nodejs\global\node_modules\wept\build\ util.js:208:3)
at onError (E:\123\nodejs\global\node_modules\wept\build\init.js:44:8)
at E:\123\nodejs\global\node_modules\wept\build\init.js:31:42
at FSReqWrap.oncomplete (fs.js:117:15)
wept --version
: v 0.6node --version
: v6.3wept.json {babel:false} 这个选项。我在npm更新下来发现还是无效。但是我直接从你的git上面拉取wept/lib代码 覆盖 wept/build中代码生效。我对比了下文件,发现npm 更新的 parse.js中 确实 没有config.babel的代码。
wept --version
: 0.6.4node --version
: 6.3.10.6.4
版本后 wxml 中用绝对路径引入的模板出现路径错误提示之前用的 0.5.9版本无此问题
ENOENT: no such file or directory, open 'view/index/tmpl/react.wxml'
Error: ENOENT: no such file or directory, open 'view/index/tmpl/react.wxml'
at Error (native)
wept --version
: 0.2.7node --version
: v6.6.0会报 编译失败 的错误,详情请看截图
node --version
: v3.0.0xxx.nvm/versions/node/v5.0.0/lib/node_modules/wept/bin/wept:18
exec(osascript chrome.scpt ${port}
, {cwd: __dirname}, () => {
^
SyntaxError: Unexpected token )
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:413:25)
at Object.Module._extensions..js (module.js:448:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:471:10)
at startup (node.js:117:18)
at node.js:952:3
与官方工具保持一致
因为 TCP 握手开销的问题,文件多了加载会很慢
log 存储在localstorage。 在 app.js 中
刷新页面的时候
var logs = wx.getStorageSync('logs') || [];会报错
是不是需要JSON.parse 下呢?
wept --version
: 3.0.0-beta例如使用官方的默认项目, 项目中包含了一个logs的page , 浏览器里面想直接打开该page
输入 http://127.0.0.1:3000/#!pages/logs/logs
结果会重定向到index page页, 这个行为和之前的表现不一致。
这个问题比较严重希望尽快修复
wept --version
:node --version
:wept --version
: 0.29node --version
: 4.4.4图片显示不了
774a098cbcce19ee60760680dc9f5604_is.jpg:1 GET http://pic3.zhimg.com/774a098cbcce19ee60760680dc9f5604_is.jpg 403 (Forbidden)
pages 设置因为应用启动后每个页面都需要后台注册,所以无法热更新。
wept --version
: 0.5.9 112200node --version
: v7.0.0service.js?v=0.5.9:3430 Uncaught TypeError: Cannot read property 'core-js_shared' of undefined(…)
因为引入了babel-runtime,导致部分代码在wept中不工作,这份代码是在手机端和开发者工具都运行通过的,却在wept运行失败了。。
DEMO:
npm install wepy-cli -g
wepy new demo
cd demo
wepy build
cd dist
wept
目前仅支持页面模块热更新。
wept --version
: 不清楚运行 后是1028的。今天更新的版本
node --version
:
操作系统: window7
浏览器及浏览器版本:
与官方工具表现不一致?
var context = wx.createContext();
context.setStrokeStyle("#ff0000");
context.setLineWidth(5);
context.moveTo(30, 0);
context.lineTo(360, 0); //x坐标 y坐标 如果要画一条横线 x坐标 那么 50 y 0
context.stroke();
//画一个矩形 距离 左边50 距离顶部 100 高宽 为150 填充色 为 0094ff
context.rect(50, 100, 150, 150); //x y width height;
context.setFillStyle("#0094ff");
context.fill();
//画一个 描边矩形
context.rect(0, 0, 30, 30);
context.stroke(); //这个描边貌似 对 上面的也生效了
//所以要用到路径 开始和结束路径都要写
context.beginPath();
context.rect(50, 50, 30, 30);
context.setStrokeStyle("#876833");
context.stroke();
context.closePath();
//再不用路径 话看看颜色变成啥了 发现颜色已经变成了路径之后的颜色了。 在距离屏幕顶部50 然后画一个横线 宽为5
context.moveTo(0, 50);
context.lineTo(5, 50);
context.stroke(); //
//画一个一模一样大的然后再画个 缩放的 距离 左边60 距离 屏幕顶部 60 填充颜色颜色为 绿色 以及一个 黑色
var width = 50,
height = 50;
var x = 90,
y = 90; //
cotnext.beginPath();
context.rect(50, 50, 90, 90);
context.setFillStyle("#0000ff");
context.fill();
context.stroke();
context.closePath();
wx.drawCanvas({ canvasId: "1", actions: context.getActions() });
是我写错了吗 最后面的绘制不成功。 开始路径和关闭路径无效了。我懵逼了。然后在一改实时预览都不生效了。 更加懵逼了。
正在排查原因中...
wept --version
: 0.5.8 112200node --version
: v6.7.0引入第三方编译好的 css 样式库时,出现编译 不过 '' "media-qurey" 等问题,wcsc
目前测试访问我们公司 https 是可以的,但是访问 豆瓣 的 API 有 bug,我使用 node 提供的 https 模块是正常请求豆瓣的,但是用了 request 模块就不行, 目前正在排查中。
相关 issue:
#8
wept --version
: 0.5.0 103100node --version
: v6.3.0listening on port 3000
✓ service.js build success
<-- GET /
--> GET / 200 23ms 1.22kb
<-- GET /css/index.css?v=0.5.0
<-- GET /css/app.css?v=0.5.0
<-- GET /script/recorder.js?v=0.5.0
--> GET /css/index.css?v=0.5.0 200 9ms 3.24kb
--> GET /script/recorder.js?v=0.5.0 200 6ms 1.48kb
--> GET /css/app.css?v=0.5.0 200 7ms 5.2kb
<-- GET /script/build.js?v=0.5.0
--> GET /script/build.js?v=0.5.0 200 27ms 105.27kb
<-- GET /images/loading.gif
--> GET /images/loading.gif 200 2ms 2.7kb
<-- GET /appservice
--> GET /appservice 200 12ms 1.34kb
<-- GET /script/bridge.js?v=0.5.0
<-- GET /script/service.js?v=0.5.0
<-- GET /service.js
--> GET /service.js 200 8ms 25.2kb
--> GET /script/bridge.js?v=0.5.0 200 10ms 6.81kb
--> GET /script/service.js?v=0.5.0 200 14ms 24.18kb
<-- GET /app/pages/index/index.wxml?w=1920&r=1
--> GET /app/pages/index/index.wxml?w=1920&r=1 200 21ms 2.6kb
<-- GET /script/ViewBridge.js?v=0.5.0
<-- GET /script/view.js?v=0.5.0
<-- GET /app/app.wxss?w=1920&r=1
<-- GET /app/pages/index/index.wxss?w=1920&r=1
--> GET /script/ViewBridge.js?v=0.5.0 200 12ms 7.23kb
--> GET /script/view.js?v=0.5.0 200 49ms 55.22kb
Error: stdout maxBuffer exceeded
at Socket. (child_process.js:255:14)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:177:18)
at Socket.Readable.push (_stream_readable.js:135:10)
at Pipe.onread (net.js:542:20)
Error: app.wxss 编译失败,请检查
at /usr/local/lib/node_modules/wept/build/parser.js:62:27
at ChildProcess.exithandler (child_process.js:209:5)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
目前默认情况mac下会自动打开浏览器窗口
wept --version
:node --version
:listening on port 3000
Error: EMFILE: too many open files, open 'E:\Code\WxApp\WEPTest\node_modules\lodash_baseDifference.js'
at Error (native)
执行npm install 或者 npm pack 的时候调用prepublish的命令, 提示make命令找不到。 建议将prepublish的脚本改成js脚本
目前是使用process.cwd()
作为项目目录, 某些情况下可能不太灵活,希望添加自定义项目目录的设置参数
wept --version
: 0.3.8node --version
: 6.9.1npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\wept\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
'wept' is not recognized as an internal or external command,
operable program or batch file.
wept --version
: 3.8node --version
: 5.11.0service.js?v=0.3.8:2210 ReferenceError: getCurrentPages is not defined
at e.returnIndex (http://localhost:3000/service.js:738:21)
at e. (http://localhost:3000/script/service.js?v=0.3.8:2208:26)
at m (http://localhost:3000/script/service.js?v=0.3.8:1911:20)
at Function. (http://localhost:3000/script/service.js?v=0.3.8:1956:14)
at http://localhost:3000/script/service.js?v=0.3.8:2096:22
at http://localhost:3000/script/service.js?v=0.3.8:754:11
at Object.e.(anonymous function) [as PAGE_EVENT] (http://localhost:3000/script/service.js?v=0.3.8:895:39)
at n. (http://localhost:3000/script/bridge.js?v=0.3.8:528:34)
at n.emit (http://localhost:3000/script/bridge.js?v=0.3.8:384:59)
at r (http://localhost:3000/script/bridge.js?v=0.3.8:87:78)
请建议,谢谢!
wept --version
: 0.2.6node --version
: 6.2.0命令行中可以加入这个功能吗
wept --0.3.8 101400
:node --6.0.0
:无
weui for weapp demo 中的下弹式菜单无法弹出导致无法浏览整个 demo,官方工具中正常。
增强用户体验
目前只能通过命令行启动wept。 希望给一个入口能够通过js脚本使用wept模块。
如:
var wept = require('wept');
var root = 'xxx' //项目目录
wept(root, {
port: 3000
});
按照 #19 的解决方案似乎要支持自定义项目根目录,使用 process.chdir
不是一个很好的办法。如果能重构代码将项目目录储存起来,在使用fs操作相对路径的文件时加上项目目录前缀应该比较靠谱。
我大致看了下代码,如果要这样做,需要改的地方有些多,如果你觉得这样做是必要的,我明天可以帮忙重构一下。
wept --version
: 0.3.5 101400node --version
: v4.4.5Error: Cannot find module 'babel-runtime/regenerator'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/local/lib/node_modules/wept/build/server.js:3:20)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
wept --0.2.3
:node --6.0.0
:wx.request 一个请求,还是提示
URL 域名不合法,请在 mp 后台配置后重试
需要有什么配置嘛?
减少手工操作,提升用户体验
wept --version
: 最新node --version
: v6.8.1import Parse from '../libs/parse';
Uncaught SyntaxError: Unexpected token import
wept --version
:0.3.5 101400node --version
: v6.9.1例如 wept -h 192.168.1.102 -p 3000 通过手机进行扫码在真机进行预览,不知道此种情况能否做到时时刷新。
wept --version
:node --version
:➜ wept git:(master) ✗ wept -V
/usr/local/lib/node_modules/wept/lib/server.js:15
let socket
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object. (/usr/local/lib/node_modules/wept/bin/wept:3:16)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
Error: Command failed: /Users/brook/.nvm/versions/node/v6.2.1/lib/node_modules/wept/bin/wcsc -lc ./app.wxss
ERR: path `components/bottomnav/bottomnav.wxss` not found from `./app.wxss`.
今天更新后,wxss 里只要有 import 的路径全不对了
nodejs-v6.8
win10 64
wept --version
:node --version
:Error: Hostname/IP doesn't match certificate's altnames: "Host: xx.com. is not in the cert's altnames: DNS: xxx.com"
希望可以忽略https证书错误。
换算rpx的时候是根据window.screen.width
来计算,在打开开发者工具的时候界面会被压缩,用window.innerWidth
?
在浏览器中嵌入了微信小程序的iframe,但是父级无法与iframe通信,因为跨域,想通过postMessage但是iframe里无法使用document和window
请问还有别的方法可以通信吗
wept --version
: 0.2.3node --version
: 6.4.0wept --version
:node --version
:A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.