Full Code of Tencent/wepy for AI

master 253aa5bba394 cached
482 files
762.9 KB
225.1k tokens
858 symbols
1 requests
Download .txt
Showing preview only (870K chars total). Download the full file or copy to clipboard to get everything.
Repository: Tencent/wepy
Branch: master
Commit: 253aa5bba394
Files: 482
Total size: 762.9 KB

Directory structure:
gitextract_swnsaggd/

├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .github/
│   ├── ISSUE_TEMPLATE.md
│   ├── PULL_REQUEST_TEMPLATE.md
│   ├── stale.yml
│   └── workflows/
│       ├── ci.yml
│       └── release.yml
├── .gitignore
├── .npmignore
├── .nycrc
├── .prettierrc.yml
├── .travis.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── CONTRIBUTING_COMMIT.md
├── LICENSE
├── README.md
├── README_EN.md
├── lerna.json
├── package.json
├── packages/
│   ├── babel-plugin-import-regenerator/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── README_EN.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── mutiple-async/
│   │       │   │   ├── actual.js
│   │       │   │   └── expected.js
│   │       │   └── normal/
│   │       │       ├── actual.js
│   │       │       └── expected.js
│   │       └── index.test.js
│   ├── cli/
│   │   ├── .gitignore
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── bin/
│   │   │   ├── cli/
│   │   │   │   ├── ask.js
│   │   │   │   ├── check-version.js
│   │   │   │   ├── download.js
│   │   │   │   ├── eval.js
│   │   │   │   ├── filter.js
│   │   │   │   ├── generate.js
│   │   │   │   ├── git-user.js
│   │   │   │   ├── local-path.js
│   │   │   │   ├── logger.js
│   │   │   │   └── options.js
│   │   │   ├── wepy-build.js
│   │   │   ├── wepy-init.js
│   │   │   ├── wepy-list.js
│   │   │   ├── wepy-new.js
│   │   │   ├── wepy-upgrade.js
│   │   │   └── wepy.js
│   │   ├── core/
│   │   │   ├── ast/
│   │   │   │   ├── index.js
│   │   │   │   ├── paramsDetect.js
│   │   │   │   ├── parseClass.js
│   │   │   │   ├── toAST.js
│   │   │   │   ├── walker.js
│   │   │   │   └── wxml.js
│   │   │   ├── compile.js
│   │   │   ├── fileDep.js
│   │   │   ├── hook.js
│   │   │   ├── init/
│   │   │   │   ├── compiler.js
│   │   │   │   ├── parser.js
│   │   │   │   └── plugin.js
│   │   │   ├── loader.js
│   │   │   ├── moduleSet.js
│   │   │   ├── parseOptions.js
│   │   │   ├── plugins/
│   │   │   │   ├── build/
│   │   │   │   │   ├── app.js
│   │   │   │   │   ├── assets.js
│   │   │   │   │   ├── components.js
│   │   │   │   │   ├── pages.js
│   │   │   │   │   └── vendor.js
│   │   │   │   ├── compiler/
│   │   │   │   │   ├── before.js
│   │   │   │   │   ├── common.js
│   │   │   │   │   ├── index.js
│   │   │   │   │   └── wxss.js
│   │   │   │   ├── helper/
│   │   │   │   │   ├── errorHandler.js
│   │   │   │   │   ├── generateCodeFrame.js
│   │   │   │   │   ├── sfcCustomBlock.js
│   │   │   │   │   └── supportSrc.js
│   │   │   │   ├── parser/
│   │   │   │   │   ├── component.js
│   │   │   │   │   ├── config.js
│   │   │   │   │   ├── file.js
│   │   │   │   │   ├── script.js
│   │   │   │   │   ├── style.js
│   │   │   │   │   ├── template.js
│   │   │   │   │   ├── wpy.js
│   │   │   │   │   └── wxs.js
│   │   │   │   ├── scriptDepFix.js
│   │   │   │   ├── scriptInjection.js
│   │   │   │   └── template/
│   │   │   │       ├── attrs/
│   │   │   │       │   ├── bindClass.js
│   │   │   │       │   ├── bindStyle.js
│   │   │   │       │   ├── index.js
│   │   │   │       │   ├── ref.js
│   │   │   │       │   └── src.js
│   │   │   │       ├── directives/
│   │   │   │       │   ├── bind.js
│   │   │   │       │   ├── condition.js
│   │   │   │       │   ├── for.js
│   │   │   │       │   ├── index.js
│   │   │   │       │   ├── model.js
│   │   │   │       │   ├── other.js
│   │   │   │       │   └── v-on.js
│   │   │   │       ├── parse.js
│   │   │   │       └── util/
│   │   │   │           └── check.js
│   │   │   ├── tag.js
│   │   │   └── util/
│   │   │       ├── ast.js
│   │   │       ├── const.js
│   │   │       ├── error.js
│   │   │       ├── exprParser.js
│   │   │       ├── hash.js
│   │   │       ├── logger.js
│   │   │       ├── tools.js
│   │   │       └── xmllint.js
│   │   ├── index.js
│   │   ├── package.json
│   │   ├── test/
│   │   │   ├── config.js
│   │   │   └── core/
│   │   │       ├── fileDep.test.js
│   │   │       ├── fixtures/
│   │   │       │   └── template/
│   │   │       │       ├── assert/
│   │   │       │       │   ├── attrWithoutValue.wxml
│   │   │       │       │   ├── bindClass.wxml
│   │   │       │       │   ├── bindStyle.wxml
│   │   │       │       │   ├── joinStyle.wxml
│   │   │       │       │   ├── ref.wxml
│   │   │       │       │   ├── reference.wxml
│   │   │       │       │   ├── v-for.wxml
│   │   │       │       │   ├── v-if.wxml
│   │   │       │       │   ├── v-on/
│   │   │       │       │   │   ├── 0-0.tap.js
│   │   │       │       │   │   ├── 0-1.tap.js
│   │   │       │       │   │   ├── 0-10.tap.js
│   │   │       │       │   │   ├── 0-11.tap.js
│   │   │       │       │   │   ├── 0-12.tap.js
│   │   │       │       │   │   ├── 0-13.tap.js
│   │   │       │       │   │   ├── 0-14.tap.js
│   │   │       │       │   │   ├── 0-15.tap.js
│   │   │       │       │   │   ├── 0-2.tap.js
│   │   │       │       │   │   ├── 0-3.tap.js
│   │   │       │       │   │   ├── 0-4.tap.js
│   │   │       │       │   │   ├── 0-5.tap.js
│   │   │       │       │   │   ├── 0-6.tap.js
│   │   │       │       │   │   ├── 0-7.tap.js
│   │   │       │       │   │   ├── 0-8.tap.js
│   │   │       │       │   │   └── 0-9.click-right.js
│   │   │       │       │   ├── v-on.wxml
│   │   │       │       │   ├── v-on.wxs.wxml
│   │   │       │       │   └── v-show.wxml
│   │   │       │       └── original/
│   │   │       │           ├── attrWithoutValue.html
│   │   │       │           ├── bindClass.html
│   │   │       │           ├── bindStyle.html
│   │   │       │           ├── joinStyle.html
│   │   │       │           ├── ref.html
│   │   │       │           ├── reference.html
│   │   │       │           ├── v-for.html
│   │   │       │           ├── v-if.html
│   │   │       │           ├── v-on.html
│   │   │       │           ├── v-on.wxs.html
│   │   │       │           └── v-show.html
│   │   │       ├── hook.test.js
│   │   │       ├── init/
│   │   │       │   └── plugin.test.js
│   │   │       ├── parseOption.test.js
│   │   │       ├── plugins/
│   │   │       │   ├── helper/
│   │   │       │   │   └── sfcCustomBlock.test.js
│   │   │       │   └── template/
│   │   │       │       └── parse.test.js
│   │   │       └── tag.test.js
│   │   └── util/
│   │       └── logger.js
│   ├── compiler-babel/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   └── app.js
│   │       ├── helper/
│   │       │   ├── ast.js
│   │       │   └── index.js
│   │       └── index.test.js
│   ├── compiler-less/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── createPlugin.js
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── css/
│   │       │   │   ├── alias.css
│   │       │   │   ├── basic.css
│   │       │   │   ├── extend.css
│   │       │   │   ├── function.css
│   │       │   │   ├── guards.css
│   │       │   │   ├── import.css
│   │       │   │   ├── lazy.css
│   │       │   │   ├── list-each.css
│   │       │   │   ├── list.css
│   │       │   │   ├── selector.css
│   │       │   │   └── uri.css
│   │       │   └── less/
│   │       │       ├── alias.less
│   │       │       ├── basic.less
│   │       │       ├── extend.less
│   │       │       ├── fail-missing-file.less
│   │       │       ├── fail-uri-alias.less
│   │       │       ├── guards.less
│   │       │       ├── import.less
│   │       │       ├── lazy.less
│   │       │       ├── list-each.less
│   │       │       ├── list.less
│   │       │       ├── selector.less
│   │       │       ├── uri.less
│   │       │       └── vars/
│   │       │           ├── colors.less
│   │       │           └── modules.less
│   │       ├── helpers/
│   │       │   ├── lessc.js
│   │       │   └── specs.js
│   │       └── index.test.js
│   ├── compiler-postcss/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── css/
│   │       │   │   ├── basic.css
│   │       │   │   └── map.css
│   │       │   └── postcss/
│   │       │       ├── basic.postcss
│   │       │       └── map.postcss
│   │       ├── helpers/
│   │       │   ├── postcssc.js
│   │       │   └── specs.js
│   │       └── index.test.js
│   ├── compiler-sass/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── importsToResolve.js
│   │   ├── index.js
│   │   ├── package.json
│   │   ├── resolveImporter.js
│   │   ├── src/
│   │   │   └── index.js
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── css/
│   │       │   │   ├── alias.scss.css
│   │       │   │   ├── basic.sass.css
│   │       │   │   ├── basic.scss.css
│   │       │   │   ├── import.sass.css
│   │       │   │   └── import.scss.css
│   │       │   └── sass/
│   │       │       ├── alias.scss
│   │       │       ├── basic.sass
│   │       │       ├── basic.scss
│   │       │       ├── import.sass
│   │       │       ├── import.scss
│   │       │       └── vars/
│   │       │           └── colors.scss
│   │       ├── helpers/
│   │       │   ├── generate.js
│   │       │   └── specs.js
│   │       └── index.test.js
│   ├── compiler-stylus/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── createPlugin.js
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── css/
│   │       │   │   ├── alias.css
│   │       │   │   ├── basic.css
│   │       │   │   ├── extend.css
│   │       │   │   ├── function.css
│   │       │   │   ├── guards.css
│   │       │   │   ├── import.css
│   │       │   │   ├── list-each.css
│   │       │   │   ├── list.css
│   │       │   │   ├── selector.css
│   │       │   │   └── uri.css
│   │       │   └── stylus/
│   │       │       ├── alias.styl
│   │       │       ├── basic.styl
│   │       │       ├── extend.styl
│   │       │       ├── fail-missing-file.styl
│   │       │       ├── fail-uri-alias.styl
│   │       │       ├── guards.styl
│   │       │       ├── import.styl
│   │       │       ├── list-each.styl
│   │       │       ├── list.styl
│   │       │       ├── selector.styl
│   │       │       ├── uri.styl
│   │       │       └── vars/
│   │       │           ├── colors.styl
│   │       │           └── modules.styl
│   │       ├── helpers/
│   │       │   ├── specs.js
│   │       │   └── stylus.js
│   │       └── index.test.js
│   ├── compiler-typescript/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── index.js
│   │   └── package.json
│   ├── core/
│   │   ├── .nycrc
│   │   ├── CHANGELOG.md
│   │   ├── ant/
│   │   │   ├── apis/
│   │   │   │   └── index.js
│   │   │   ├── class/
│   │   │   │   ├── WepyComponent.js
│   │   │   │   └── WepyPage.js
│   │   │   ├── init/
│   │   │   │   ├── events.js
│   │   │   │   ├── index.js
│   │   │   │   ├── lifecycle.js
│   │   │   │   ├── methods.js
│   │   │   │   └── props.js
│   │   │   ├── native/
│   │   │   │   ├── app.js
│   │   │   │   ├── component.js
│   │   │   │   ├── index.js
│   │   │   │   └── page.js
│   │   │   └── wepy.js
│   │   ├── dist/
│   │   │   ├── wepy.ant.js
│   │   │   └── wepy.js
│   │   ├── index.ant.js
│   │   ├── index.js
│   │   ├── package.json
│   │   ├── shared/
│   │   │   ├── constants.js
│   │   │   ├── env.js
│   │   │   ├── extend.js
│   │   │   ├── index.js
│   │   │   └── util.js
│   │   ├── src/
│   │   │   ├── bar.js
│   │   │   ├── foo.js
│   │   │   └── index.js
│   │   ├── test/
│   │   │   ├── .istanbul.yml
│   │   │   ├── bar.spec.js
│   │   │   ├── foo.spec.js
│   │   │   ├── index.test.js
│   │   │   ├── mock/
│   │   │   │   ├── api/
│   │   │   │   │   └── createSelectorQuery.js
│   │   │   │   └── wxapi.js
│   │   │   └── weapp/
│   │   │       ├── class/
│   │   │       │   └── Dirty.js
│   │   │       ├── dispatcher/
│   │   │       │   └── index.test.js
│   │   │       ├── helper/
│   │   │       │   ├── index.js
│   │   │       │   └── libs/
│   │   │       │       ├── App.js
│   │   │       │       ├── Component.js
│   │   │       │       └── Page.js
│   │   │       ├── init/
│   │   │       │   ├── data.js
│   │   │       │   └── lifecycle.test.js
│   │   │       ├── observer/
│   │   │       │   ├── index.test.js
│   │   │       │   └── observerPath.test.js
│   │   │       └── util/
│   │   │           ├── debug.test.js
│   │   │           ├── error.test.js
│   │   │           ├── index.test.js
│   │   │           ├── model.test.js
│   │   │           └── next-tick.test.js
│   │   ├── types/
│   │   │   ├── index.d.ts
│   │   │   ├── options.d.ts
│   │   │   ├── plugin.d.ts
│   │   │   ├── test/
│   │   │   │   ├── tsconfig.json
│   │   │   │   ├── wepy.app.test.ts
│   │   │   │   ├── wepy.component.test.ts
│   │   │   │   ├── wepy.page.test.ts
│   │   │   │   └── wepy.test.ts
│   │   │   ├── tsconfig.json
│   │   │   ├── typings.json
│   │   │   ├── wepy.d.ts
│   │   │   └── wx/
│   │   │       ├── index.d.ts
│   │   │       ├── lib.wx.api.d.ts
│   │   │       ├── lib.wx.app.d.ts
│   │   │       ├── lib.wx.behavior.d.ts
│   │   │       ├── lib.wx.cloud.d.ts
│   │   │       ├── lib.wx.component.d.ts
│   │   │       └── lib.wx.page.d.ts
│   │   └── weapp/
│   │       ├── apis/
│   │       │   ├── index.js
│   │       │   ├── mixin.js
│   │       │   └── use.js
│   │       ├── class/
│   │       │   ├── Base.js
│   │       │   ├── Dirty.js
│   │       │   ├── Event.js
│   │       │   ├── WepyApp.js
│   │       │   ├── WepyComponent.js
│   │       │   ├── WepyConstructor.js
│   │       │   └── WepyPage.js
│   │       ├── config.js
│   │       ├── dispatcher/
│   │       │   └── index.js
│   │       ├── global.js
│   │       ├── init/
│   │       │   ├── computed.js
│   │       │   ├── data.js
│   │       │   ├── hooks.js
│   │       │   ├── index.js
│   │       │   ├── lifecycle.js
│   │       │   ├── methods.js
│   │       │   ├── mixins.js
│   │       │   ├── props.js
│   │       │   ├── relations.js
│   │       │   ├── render.js
│   │       │   └── watch.js
│   │       ├── native/
│   │       │   ├── app.js
│   │       │   ├── component.js
│   │       │   ├── index.js
│   │       │   └── page.js
│   │       ├── observer/
│   │       │   ├── array.js
│   │       │   ├── dep.js
│   │       │   ├── index.js
│   │       │   ├── observerPath.js
│   │       │   ├── scheduler.js
│   │       │   ├── traverse.js
│   │       │   └── watcher.js
│   │       ├── util/
│   │       │   ├── config.js
│   │       │   ├── debug.js
│   │       │   ├── error.js
│   │       │   ├── index.js
│   │       │   ├── model.js
│   │       │   └── next-tick.js
│   │       └── wepy.js
│   ├── plugin-define/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── README_EN.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── expected/
│   │       │   │   └── app.js
│   │       │   ├── src/
│   │       │   │   └── app.wpy
│   │       │   ├── weapp/
│   │       │   │   └── .gitignore
│   │       │   └── wepy.config.js
│   │       ├── index.integration.js
│   │       └── index.test.js
│   ├── plugin-eslint/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       └── index.test.js
│   ├── plugin-uglifyjs/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       └── index.test.js
│   ├── redux/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── README_EN.md
│   │   ├── dist/
│   │   │   └── index.js
│   │   ├── helper.js
│   │   ├── index.js
│   │   ├── install.js
│   │   └── package.json
│   ├── router/
│   │   ├── README.md
│   │   ├── core/
│   │   │   ├── config.js
│   │   │   ├── createRouter.js
│   │   │   ├── guard/
│   │   │   │   ├── createComponentGuard.js
│   │   │   │   ├── createRouterGuard.js
│   │   │   │   ├── globalGuard.js
│   │   │   │   ├── guardManager.js
│   │   │   │   └── index.js
│   │   │   ├── index.js
│   │   │   ├── routeManager.js
│   │   │   ├── routerApi.js
│   │   │   └── utils/
│   │   │       ├── getRealPageInfo.js
│   │   │       ├── queue.js
│   │   │       └── urlParse.js
│   │   ├── doc/
│   │   │   ├── config.md
│   │   │   ├── guard.md
│   │   │   ├── instance.md
│   │   │   ├── router.md
│   │   │   └── usage.md
│   │   ├── index.js
│   │   ├── install.js
│   │   └── package.json
│   ├── use-intercept/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── README_EN.md
│   │   ├── dist/
│   │   │   └── index.js
│   │   ├── index.js
│   │   ├── install.js
│   │   ├── package.json
│   │   └── test/
│   │       └── index.test.js
│   ├── use-promisify/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── README_EN.md
│   │   ├── dist/
│   │   │   └── index.js
│   │   ├── index.js
│   │   ├── install.js
│   │   ├── package.json
│   │   └── test/
│   │       └── index.test.js
│   └── x/
│       ├── CHANGELOG.md
│       ├── README.md
│       ├── README_EN.md
│       ├── dist/
│       │   └── index.js
│       ├── index.js
│       └── package.json
├── scripts/
│   ├── bootstrap.sh
│   ├── build.js
│   ├── build.sh
│   ├── ci-release.js
│   ├── clean.js
│   ├── config.js
│   ├── install_dev.sh
│   ├── npm-ci-release.js
│   ├── npm-tags.js
│   ├── npm_publish/
│   │   ├── index.js
│   │   └── lib/
│   │       ├── auto.js
│   │       ├── check_repo_clean.js
│   │       ├── interact.js
│   │       └── log.js
│   ├── release.js
│   ├── test-build.sh
│   └── unittest.js
├── test/
│   ├── build-cases/
│   │   ├── empty.sh
│   │   └── standard.sh
│   ├── build.sh
│   ├── scripts/
│   │   └── ci-release.test.js
│   └── unit.js
└── verpub.config.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true


================================================
FILE: .eslintignore
================================================
/lib
coverage/
packages/*/node_modules
packages/*/lib
packages/*/dist
packages/*/test/fixtures
packages/*/coverage
packages/wepy-cli/templates
packages/cli/test/core/fixtures
gulpfile.js



================================================
FILE: .eslintrc
================================================
{
  "parser": "babel-eslint",
  "env": {
    "es6": true,
    "node": true,
    "mocha": true
  },
  "rules": {
    "strict": [0],
    "eqeqeq": 2,
    "quotes": [2, "single", {"allowTemplateLiterals": true}],
    "no-underscore-dangle": 0,
    "eol-last": 0,
    "camelcase": 0,
    "no-loop-func": 0,
    "no-trailing-spaces": 0,
    "consistent-return": 0,
    "new-cap": 0,
    "no-shadow": 0,
    //"semi": 0,
    "no-process-exit": 0,
    "no-empty": 0,
    "yoda": 0,
    "no-new-func": 0
  }
}


================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
提交ISSUE前请确保已认真阅读以下内容

*Please read the following information carefully before you open an issue.*


在提交issue之前必须确认以下问题:

*Please make sure you understand the following points:*


* 必须是一个bug或者功能新增。

* *It must be a bug or a feature request*


* 必须是WePY相关问题,原生小程序问题去[开发者论坛](https://developers.weixin.qq.com/)。

* *It must be a WePY issue.*


* 已经在issue中搜索过,并且没有找到相似的issue或者解决方案。

* *I searched issue already but I didn't find any relevant issues or solutions.*


* 完善下面模板中的信息

* *Please fill out the following template*



阅读完后请在提交的issue中删除以上内容,包括分割线

DELETE THE INFORMATION ABOVE(INCLUDE THE SEPARATION LINE) BEFORE YOU OPEN AN ISSUE

------------------------
## Description

  [问题描述:站在其它人的角度尽可能清晰地、简洁地把问题描述清楚]
  
  [Description of the issue]

## Environment

  * Platform: [开发者工具/iOS/Andriod/Web]
  * Platform version: [对应工具或者iOS或者Andriod的版本号]
  * Wechat version: [微信版本号]
  * wepy-cli version: [wepy-cli -v]
  * wepy version: [在package.json里]
  * other version: [如果是插件问题,请列出问题插件的版本号]
  
## Reproduce

  [如何重现问题]
  
  [How to reproduce the issue]

### Observed Results

  [实际表现]
  
  [Observed Results]
  
### Expected Results

  [期望表现]
  
  [Expected Results]
  

## Relevant Code / Logs

  ```
  // TODO(you): code or logs here to reproduce the problem
  // 可以使用小程序代码片段功能,方便其它人帮助你定位代码问题
  // 详情可参考这里:https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
  ```


================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
<!--
Thank you for your pull request. Please provide a description above and review
the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.
-->

##### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [ ] `npm run test` passes
- [ ] tests and/or benchmarks are included
- [ ] cases or donate is changed or added
- [ ] documentation is changed or added


================================================
FILE: .github/stale.yml
================================================
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 3600
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 1700
# Issues with these labels will never be considered stale
exemptLabels:
  - pinned
  - security
# Label to use when marking an issue as stale
staleLabel: Inactive
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
  This issue has been automatically marked as stale because it has not had
  recent activity. It will be closed if no further activity occurs. Thank you
  for your contributions.
  因为这个 Issue 最近没有任何有效回复,所以被自动标记为了`stale`。
  如果在未来7天依旧没有任何激活操作,那么该 Issue 将会被自动关闭。
  感谢您的提问。
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false


================================================
FILE: .github/workflows/ci.yml
================================================
name: WePY CI Build

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-18.04
    strategy:
      matrix:
        node-version: [10.x]
    steps:
    - name: Install expect
      run: | 
        sudo apt -qy update && sudo apt install -y expect
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm install
    - run: npm run bootstrap 
    - run: npm run test
    - run: npm run bootstrap:prod
    - run: npm run test:build
    - name: Coveralls
      uses: coverallsapp/github-action@master
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
  release:
    if: github.event_name == 'push' && startsWith(github.event.head_commit.message, 'release:')
    name: Release
    runs-on: ubuntu-18.04
    needs: [build]
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v1
      with:
        node-version: 12
        registry-url: https://registry.npmjs.org/
    - run: git reset --hard
    - run: |
        git config --global user.email "gcaufy@gmail.com"
        git config --global user.name "WePY CI"
    - run: npm install
    - run: npm run bootstrap
    - run: git status
    - run: git checkout .
    - name: NPM release
      env:
        NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
      run: node ./scripts/ci-release.js
    - run: git status
    - run: git log


================================================
FILE: .github/workflows/release.yml
================================================
# This is a basic workflow to help you get started with Actions

name: Release

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  push:
    tags:
      - '**'
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: '10.19'
      - run: npm install
      - run: npm run bootstrap
      - run: npm run test
      - name: Set Tag Variable
        id: vars
        run: echo ::set-output name=tag::${GITHUB_REF:10}
      - name: Check Tag
        env:
          RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
        run: |
          echo $GITHUB_REF
          echo $RELEASE_VERSION
          echo ${{ steps.vars.outputs.tag }}

      - name: Build dist
        run: npm run build
      - name: NPM release
        env:
          TAG_NAME: ${{ steps.vars.outputs.tag}}
          NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
        run: |
          echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ~/.npmrc
          node ./scripts/npm-ci-release.js "$TAG_NAME"
          node ./scripts/npm-tags.js "$TAG_NAME" next


================================================
FILE: .gitignore
================================================
node_modules/
sftp-config.json
diff
log
npm-debug.log
demo/
.nyc_output/
.vscode
coverage
lerna-debug.log
/packages/*/lib
.DS_Store
.idea
/yarn.lock


================================================
FILE: .npmignore
================================================
node_modules/
coverage/
demo/
test/
ISSUE_TEMPLATE.md
appveyor.yml
README_zh-CN.md
*.map
src/
coverage

================================================
FILE: .nycrc
================================================
{
    "reporter": ["lcov", "text-summary"]
}


================================================
FILE: .prettierrc.yml
================================================
# 一行最多 120 字符
printWidth: 120
# 使用 2 个空格缩进
tabWidth: 2
# 不使用缩进符,而使用空格
useTabs: false
# 行尾不需要分号
semi: true
# 使用单引号
singleQuote: true
# 对象的 key 仅在必要时用引号
quoteProps: as-needed
# jsx 不使用单引号,而使用双引号
jsxSingleQuote: false
# 末尾不需要逗号
trailingComma: none
# 大括号内的首尾需要空格
bracketSpacing: true
# jsx 标签的反尖括号需要换行
jsxBracketSameLine: false
# 箭头函数,只有一个参数的时候,不需要括号
arrowParens: avoid
# 每个文件格式化的范围是文件的全部内容
rangeStart: 0
# 不需要写文件开头的 @prettier
requirePragma: false
# 不需要自动在文件开头插入 @prettier
insertPragma: false
# 使用默认的折行标准
proseWrap: preserve
# 根据显示样式决定 html 要不要折行
htmlWhitespaceSensitivity: css
# 换行符使用 lf
endOfLine: lf
# 后缀文件名特有规则
overrides:
  - files: '*.{wxss,less}'
    options:
      parser: less
  - files: '*.json,.*rc'
    options:
      parser: json
  - files: '*.{wxml,html}'
    options:
      parser: html
      htmlWhitespaceSensitivity: strict
      # 避免text标签换行
      printWidth: 999
  - files: '*.wxs'
    options:
      parser: babel


================================================
FILE: .travis.yml
================================================
language: node_js

node_js:
  - '10'

matrix:
  include:
    - os: linux
    - os: osx

sudo: false

before_install:
  - if [[ "$TRAVIS_OS_NAME" == "linux"                      ]] ; then sudo apt-get -qq update        ; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" && ! $(which expect) ]] ; then sudo apt-get install -y expect ; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx"                        ]] ; then stty cols 80                   ; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx"                        ]] ; then brew update                    ; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx"   && ! $(which expect) ]] ; then brew install expect            ; fi

install:
  - 'npm install'
  - 'npm run bootstrap'

script:
  - 'npm run test'
  - 'npm run bootstrap:prod'
  - 'npm run test:build'

after_script: 'npm install coveralls && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage'


================================================
FILE: CHANGELOG.md
================================================
# Change Log

## 2.1.0 (2020-07-04) (beta)

#### :rocket: New Feature
* `core`
  * [#2634](https://github.com/Tencent/wepy/pull/2634) feat: added routed lifecycle ([@Gcaufy](https://github.com/Gcaufy))
* `babel-plugin-import-regenerator`, `cli`, `compiler-babel`, `compiler-less`, `compiler-postcss`, `compiler-sass`, `compiler-stylus`, `compiler-typescript`, `core`, `plugin-define`, `plugin-eslint`, `plugin-uglifyjs`, `redux`, `use-intercept`, `use-promisify`, `x`
  * [#2620](https://github.com/Tencent/wepy/pull/2620) feat: added ci npm release support ([@Gcaufy](https://github.com/Gcaufy))

#### :bug: Bug Fix
* `core`
  * [#2633](https://github.com/Tencent/wepy/pull/2633) fix(core): 修复了 type 必填的问题 ([@Gcaufy](https://github.com/Gcaufy))

#### Committers: 5
- Damon Chen ([@chenyu445](https://github.com/chenyu445))
- Deep ([@deepfunc](https://github.com/deepfunc))
- Gcaufy ([@Gcaufy](https://github.com/Gcaufy))
- Sail ([@dlhandsome](https://github.com/dlhandsome))
- 这也太那个了吧 ([@dev-itsheng](https://github.com/dev-itsheng))


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

我们提倡您通过提 issue 和 pull request 方式来促进 WePY 的发展。


## Acknowledgements

非常感谢以下几位贡献者对于 WePY 的做出的贡献:

- dlhandsome [awsomeduan@gmail.com](mailto:awsomeduan@gmail.com)
- dolymood [dolymood@gmail.com](mailto:dolymood@gmail.com)
- baisheng [baisheng@gmail.com](mailto:baisheng@gmail.com)
- deepfunc [xiekai0601@gmail.com](mailto:xiekai0601@gmail.com)
- nishino-tsukasa [nishinotsukasavirgo@gmail.com](mailto:nishinotsukasavirgo@gmail.com)

其中特别致谢 dlhandsome 提交的38个 commits, 对 WePY 做出了1,350增加和362处删减(截止02/28/18日)。

WePY 持续招募贡献者,即使是在 issue 中回答问题,或者做一些简单的 bugfix ,也会给 WePY 带来很大的帮助。

WePY 已开发近一年,在此感谢所有开发者对于 WePY 的喜欢和支持,希望你能够成为 WePY 的核心贡献者,加入 WePY ,共同打造一个更棒的小程序开发框架!🍾🎉

​                       

## Issue 提交

#### 对于贡献者

在提 issue 前请确保满足一下条件:

- 必须是一个 bug 或者功能新增。
- 必须是 WePY 相关问题,原生小程序问题去[开发者论坛](https://developers.weixin.qq.com/)。
- 已经在 issue 中搜索过,并且没有找到相似的 issue 或者解决方案。
- 完善下面模板中的信息

如果已经满足以上条件,我们提供了 issue 的标准模版,请按照模板填写。

​             

##  Pull request

我们除了希望听到您的反馈和建议外,我们也希望您接受代码形式的直接帮助,对我们的 GitHub 发出 pull request 请求。

以下是具体步骤:

#### Fork仓库

点击 `Fork` 按钮,将需要参与的项目仓库 fork 到自己的 Github 中。

#### Clone 已 fork 项目

在自己的 github 中,找到 fork 下来的项目,git clone 到本地。

```bash
$ git clone git@github.com:<yourname>/wepy.git
```

#### 添加 WePY 仓库

将 fork 源仓库连接到本地仓库:

```bash
$ git remote add <name> <url>
# 例如:
$ git remote add wepy git@github.com:Tencent/wepy.git
```

#### 保持与 WePY 仓库的同步

更新上游仓库:

```bash
$ git pull --rebase <name> <branch>
# 等同于以下两条命令
$ git fetch <name> <branch>
$ git rebase <name>/<branch>
```

#### commit 信息提交

commit 信息请遵循[commit消息约定](./CONTRIBUTING_COMMIT.md),以便可以自动生成 `CHANGELOG` 。具体格式请参考 commit 文档规范。



#### 开发调试代码

```bash
# Build code
$ npm run build

# Watch
$ npm run watch

# Run test cases
$ npm run test

# Useage
$ wepy build # Global wepy you installed by npm

$ wepy-dev build # Local wepy you compiled by your local repository

$ wepy-debug build # Debug local wepy using node --inspect
```


================================================
FILE: CONTRIBUTING_COMMIT.md
================================================
# Commit规范

在对项目作出更改后,我们需要生成 commit 来记录自己的更改。以下是参照 Angular 对 commit 格式的规范:

## (1) 格式

提交信息包括三个部分:`Header`,`Body` 和 `Footer`。

```
<Header>

<Body>

<Footer>
```

其中,Header 是必需的,Body 和 Footer 可以省略。

#### 1> Header

Header 部分只有一行,包括俩个字段:`type`(必需)和`subject`(必需)。

```
<type>: <subject>
```

**type**

type 用于说明 commit 的类别,可以使用如下类别:

- feat:新功能(feature)
- fix:修补bug
- doc:文档(documentation)
- style: 格式(不影响代码运行的变动)
- refactor:重构(即不是新增功能,也不是修改bug的代码变动)
- test:增加测试
- chore:构建过程或辅助工具的变动

**subject**

subject 是 commit 目的的简短描述。

- 以动词开头,使用第一人称现在时,比如改变,而不是改变了。
- 结尾不加句号(。)

#### 2> Body

Body 部分是对本次 commit 的详细描述,可以分成多行。下面是一个范例。

```
More detailed explanatory text, if necessary.  Wrap it to 
about 72 characters or so. 

Further paragraphs come after blank lines.

- Bullet points are okay, too
- Use a hanging indent
```

**注意:**应该说明代码变动的动机,以及与以前行为的对比。

#### 3> Footer

​	Footer 部分应该包含:(1)Breaking Changes;  (2)关闭 issue;

​	**Breaking Changes**:

​	如果当前代码与上一个版本不兼容,则 Footer 部分以`BREAKING CHANGE`开头,后面是对变动的描述、以及变动理由和迁移方法。这种使用较少,了解即可。

​	**Issue 部分:**

- 通过 commit 关联 issue:

  如果当前提交信息关联了某个 issue,那么可以在 Footer 部分关联这个 issue:

  ```
  issue #2
  ```

- 通过 commit 关闭 issue,当提交到**默认分支**时,提交信息里可以使用 `fix/fixes/fixed` , `close/closes/closed` 或者 `resolve/resolves/resolved`等关键词,后面再跟上 issue 号,这样就会关闭这个 issue:

```
Closes #1
```

​	注意,如果不是提交到默认分支,那么并不能关闭这个 issue,但是在这个 issue 下面会显示相关的信息表示曾经想要关闭这个 issue,当这个分支合并到默认分支时,就可以关闭这个 issue 了。

#### 4> 例子

下面是一个完整的例子:

```
feat: 添加了分享功能

给每篇文章添加了分享功能

- 添加分享到微信功能
- 添加分享到朋友圈功能

Issue #1, #2
Closes #1
```


================================================
FILE: LICENSE
================================================
Tencent is pleased to support the open source community by making WePY available.
Copyright (C) 2017 THL A29 Limited, a Tencent company.  All rights reserved.
If you have downloaded a copy of the WePY binary from Tencent, please note that the WePY binary is licensed under the MIT License.
If you have downloaded a copy of the WePY source code from Tencent, please note that WePY source code is licensed under the MIT License, except for the third-party components listed below which are subject to different license terms.  Your integration of WePY into your own projects may require compliance with the MIT License, as well as the other licenses applicable to the third-party components included within WePY.
A copy of the MIT License is included in this file.

Other dependencies and licenses:

Open Source Software Licensed Under the BSD 3-Clause License:
----------------------------------------------------------------------------------------
1. istanbul  0.4.5
Copyright 2012 Yahoo! Inc.
All rights reserved.


Terms of the BSD 3-Clause License:
--------------------------------------------------------------------

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of [copyright holder] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



Open Source Software Licensed Under the MIT License:
----------------------------------------------------------------------------------------
1. bable  6.5.2
Copyright (c) 2014-2016 Sebastian McKenzie <sebmck@gmail.com>

2. eslint  3.11.1
Copyright JS Foundation and other contributors, https://js.foundation

3. gulp  3.9.1
Copyright (c) 2013-2016 Fractal <contact@wearefractal.com>

4. lerna  2.0.0
Copyright (c) 2015-2016 Sebastian McKenzie <sebmck@gmail.com>

5. mocha  3.2.0
Copyright (c) 2016 JS Foundation and contributors, https://js.foundation

6. promise-polyfill  6.0.2
Copyright (c) 2014 Taylor Hakes
Copyright (c) 2014 Forbes Lindesay

7. postcss  5.2.16
Copyright 2013 Andrey Sitnik <andrey@sitnik.ru>

8. sass  4.0.0
Copyright (c) Natalie Weizenbaum <nweiz@google.com>

9. stylus  0.54.5
Copyright (c) Automattic <developer.wordpress.com>

10. imagemin  5.2.2
Copyright (c) imagemin (github.com/imagemin)

11. redux  2.0.0
Copyright (c) 2015 Dan Abramov

12. axios  0.16.1
Copyright (c) 2014 Matt Zabriskie

13. vue  1.0.28
Copyright (c) 2013-2016 Yuxi Evan You

14. xmldom  0.1.27
Copyright (c) jindw <jindw@xidea.org> (http://www.xidea.org)

15. pug  2.0.0-beta6
Copyright (c) 2009-2014 TJ Holowaychuk <tj@vision-media.ca>


Terms of the MIT License:
---------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: README.md
================================================
[English](./README_EN.md) | 简体中文

> **📦 项目已归档**
>
> 随着微信小程序生态的不断演进,本项目已不再活跃维护。WePY 早已完成了它的历史使命,现有代码已不再具有参考意义,我们建议新项目选用更现代的方案。
>
> 在开源的这些年里,由于个人精力问题,导致项目的维护和响应未能做好,在此真诚地向各位贡献者和使用者说一声抱歉。
>
> 再次感谢大家理解,继续前行 🤝

## WePY 2 (beta)

[![npm version](https://badge.fury.io/js/wepy.svg)](https://badge.fury.io/js/wepy)
[![travis-ci](https://travis-ci.org/Tencent/wepy.svg?branch=1.7.x)](https://travis-ci.org/Tencent/wepy)
![Github CI](https://github.com/Tencent/wepy/workflows/WePY%20CI%20Build/badge.svg?branch=2.0.x)
[![Coverage Status](https://coveralls.io/repos/github/Tencent/wepy/badge.svg?branch=1.7.x)](https://coveralls.io/github/Tencent/wepy?branch=1.7.x)
[![Dependency Status](https://david-dm.org/Tencent/wepy.svg)](https://david-dm.org/Tencent/wepy)

### 介绍

WePY 资源汇总:[awesome-wepy](https://github.com/aben1188/awesome-wepy)

WePY (发音: /'wepi/)是一款让小程序支持组件化开发的框架,通过预编译的手段让开发者可以选择自己喜欢的开发风格去开发小程序。框架的细节优化,Promise,Async Functions 的引入都是为了能让开发小程序项目变得更加简单,高效。

同时 WePY 也是一款成长中的框架,大量吸收借鉴了一些优化前端工具以及框架的设计理念和思想。如果 WePY 有不足地方,或者你有更好的想法,欢迎提交 ISSUE 或者 PR。


### 特性:

- 类 Vue 开发风格
- 支持自定义组件开发
- 支持引入 NPM 包
- 支持 [Promise](https://github.com/wepyjs/wepy/wiki/wepy%E9%A1%B9%E7%9B%AE%E4%B8%AD%E4%BD%BF%E7%94%A8Promise)
- 支持 ES2015+ 特性,如 [Async Functions](https://github.com/wepyjs/wepy/wiki/wepy%E9%A1%B9%E7%9B%AE%E4%B8%AD%E4%BD%BF%E7%94%A8async-await)
- 支持多种编译器,Less/Sass/Stylus/PostCSS、Babel/Typescript、Pug
- 支持多种插件处理,文件压缩,图片压缩,内容替换等
- 支持 Sourcemap,ESLint 等
- 小程序细节优化,如请求列队,事件优化等

### Demo

```html
<style lang="less">
@color: #4D926F;
  .num {
  color: @color;
  }
</style>
<template>
  <div class="container">
    <div class="num" @tap="num++">
      {{num}}
    </div>
    <custom-component></custom-component>
    <vendor-component></vendor-component>
    <div>{{text}}</div>
    <input v-model="text"/>
  </div>
</template>
<config>
{
  usingComponents: {
    customComponent: '@/components/customComponent',
    vendorComponent: 'module:vendorComponent'
  }
}
</config>

<script>
  import wepy from '@wepy/core';

  wepy.page({
    data: {
      num: 0,
      text: 'Hello World',
    },
  });
</script>
```

### 安装使用

#### 安装(更新) wepy 命令行工具。

```console
npm install @wepy/cli@next -g
```

#### 生成开发示例

```console
wepy init standard myproject
```

#### 安装依赖

```console
cd myproject
npm install
```

#### 开发实时编译

```console
wepy build --watch
```

#### 开发者工具导入项目

使用`微信开发者工具`新建项目,本地开发选择项目根目录,会自动导入项目配置。

### 哪些小程序是用 WePY 开发的

腾讯疫苗查询小程序、
腾讯翻译君小程序、
腾讯地图小程序、
玩转故宫小程序、
手机充值+、
手机余额查询、
手机流量充值优惠、
[友福图书馆](https://library.ufutx.com)[(开源)](https://github.com/glore/library)、
[素洁商城](https://github.com/dyq086/wxYuHanStore)[(开源)](https://github.com/dyq086/wxYuHanStore)、
[NewsLite](https://github.com/yshkk/shanbay-mina)[(开源)](https://github.com/yshkk/shanbay-mina)、
[西安找拼车](https://github.com/chenqingspring)[(开源)](https://github.com/chenqingspring)、
[深大的树洞](https://github.com/jas0ncn/szushudong)[(开源)](https://github.com/jas0ncn/szushudong)、
[求知微阅读](https://github.com/KingJeason/wepy-books)[(开源)](https://github.com/KingJeason/wepy-books)、
[给你的 iPhone X 换个发型](https://bangs.baran.wang/)、
[天天跟我买](http://www.xiaohongchun.com.cn/index)、
[坚橙](https://zhanart.com/wepy.html)、
群脱单、
米淘联盟、
帮助圈、
众安保险福利、
阅邻二手书、
趣店招聘、
[满熊阅读(开源:](https://github.com/Thunf/wepy-demo-bookmall) [微信小程序](https://github.com/Thunf/wepy-demo-bookmall)、[支付宝小程序)](https://github.com/Thunf/wepy-demo-bookmall/tree/alipay)、
育儿柚道、
平行进口报价内参、
GitHub 掘金版、
班级群管、
鲜花说小店、
逛人备忘、
英语助手君、
花花百科、
独角兽公司、
爱羽客羽毛球、
斑马小店、
小小羽球、
培恩医学、
农资优选、
公务员朝夕刷题、
七弦琴小助手、
七弦琴大数据、
爽到家小程序、
[应用全球排行](https://github.com/szpnygo/wepy_ios_top)[(开源)](https://github.com/szpnygo/wepy_ios_top)、
[we 川大](https://github.com/mohuishou/scuplus-wechat)[(开源)](https://github.com/mohuishou/scuplus-wechat)、
聊会儿、
[诗词墨客](https://github.com/huangjianke/weapp-poem)[(开源)](https://github.com/huangjianke/weapp-poem)、
[南京邮电大学](https://github.com/GreenPomelo/Undergraduate)[(开源)](https://github.com/GreenPomelo/Undergraduate)

...

### 交流群

WePY 交流群已满 500 人,请加 gcaufy_helper 好友或者扫码加好友,验证回复 `wepy` 按照指引进群。

![wepy_qr_code](https://user-images.githubusercontent.com/2182004/82732473-feb50c80-9d3f-11ea-9a5f-0efc6ce40f74.png)

### 参与贡献

如果你有好的意见或建议,欢迎给我们提 Issues 或 Pull Requests,为提升微信小程序开发体验贡献力量。<br>详见:[CONTRIBUTING.md](./CONTRIBUTING.md)

[腾讯开源激励计划](https://opensource.tencent.com/contribution) 鼓励开发者的参与和贡献,期待你的加入。

### Links

[Documentation](https://tencent.github.io/wepy/)

[Changelog](https://tencent.github.io/wepy/document.html#/changelog)

[Contributing](./CONTRIBUTING.md)

[License MIT](./LICENSE)


================================================
FILE: README_EN.md
================================================
English | [简体中文](./README.md)

> **📦 This project has been archived**
>
> As the WeChat Mini Program ecosystem continues to evolve, this project is no longer actively maintained. WePY has long since fulfilled its historical mission. The existing code is no longer a recommended reference; we suggest adopting more modern solutions for new projects.
>
> Over the years of open source, due to limited personal bandwidth, the project was not maintained as well as it should have been. I sincerely apologize to all contributors and users for that.
>
> Thank you for your understanding, and keep moving forward 🤝

## WePY 2 (beta)

[![npm version](https://badge.fury.io/js/wepy.svg)](https://badge.fury.io/js/wepy)
[![travis-ci](https://travis-ci.org/Tencent/wepy.svg?branch=1.7.x)](https://travis-ci.org/Tencent/wepy)
![Github CI](https://github.com/Tencent/wepy/workflows/WePY%20CI%20Build/badge.svg?branch=2.0.x)
[![Coverage Status](https://coveralls.io/repos/github/Tencent/wepy/badge.svg?branch=1.7.x)](https://coveralls.io/github/Tencent/wepy?branch=1.7.x)
[![Dependency Status](https://david-dm.org/Tencent/wepy.svg)](https://david-dm.org/Tencent/wepy)

### Introduce

WePY resource summary:[awesome-wepy](https://github.com/aben1188/awesome-wepy)

WePY (pronounced: /'wepi/) is a framework that enables componentization of small programs by pre-compiling them so that developers can choose their own development style.Details optimization of the framework, the introduction of Promise and Async Functions are all aimed at making it easier and more efficient to develop applets.

At the same time, WePY is also a growing framework, drawing heavily on the design concepts and ideas of some front-end optimization tools and frameworks.If WePY has a problem, or if you have a better idea, feel free to submit an ISSUE or PR.


### Features:

- Class Vue development style
- Support for custom component development
- Support for introducing NPM packages
- support [Promise](https://github.com/wepyjs/wepy/wiki/wepy%E9%A1%B9%E7%9B%AE%E4%B8%AD%E4%BD%BF%E7%94%A8Promise)
- Support for ES2015+ features,如 [Async Functions](https://github.com/wepyjs/wepy/wiki/wepy%E9%A1%B9%E7%9B%AE%E4%B8%AD%E4%BD%BF%E7%94%A8async-await)
- Supports multiple compilers, Less/Sass/Stylus/PostCSS, Babel/Typescript, Pug
- Supports a variety of plug-in processing, file compression, image compression, content replacement, etc
- Supports Sourcemap, ESLint, etc
- Small program details optimization, such as request queuing, event optimization, etc

### Demo

```html
<style lang="less">
@color: #4D926F;
  .num {
  color: @color;
  }
</style>
<template>
  <div class="container">
    <div class="num" @tap="num++">
      {{num}}
    </div>
    <custom-component></custom-component>
    <vendor-component></vendor-component>
    <div>{{text}}</div>
    <input v-model="text"/>
  </div>
</template>
<config>
{
  usingComponents: {
    customComponent: '@/components/customComponent',
    vendorComponent: 'module:vendorComponent'
  }
}
</config>

<script>
  import wepy from '@wepy/core';

  wepy.page({
    data: {
      num: 0,
      text: 'Hello World',
    },
  });
</script>
```

### Usage

#### Install (upgrade) the WEPY command-line tool.

```bash
npm install @wepy/cli@next -g
```

#### Get start with an example

```console
wepy init standard myproject
```

#### Install dependencies

```console
cd myproject
npm install
```

#### Watch mode

```console
wepy build --watch
```

#### Import project

Create a new project using`WeChat developer tool`.If the local developer selects the project root directory, the project configuration will be automatically imported.

### Which applets are developed with WePY

腾讯疫苗查询小程序、
腾讯翻译君小程序、
腾讯地图小程序、
玩转故宫小程序、
手机充值+、
手机余额查询、
手机流量充值优惠、
[友福图书馆](https://library.ufutx.com)[(开源)](https://github.com/glore/library)、
[素洁商城](https://github.com/dyq086/wxYuHanStore)[(开源)](https://github.com/dyq086/wxYuHanStore)、
[NewsLite](https://github.com/yshkk/shanbay-mina)[(开源)](https://github.com/yshkk/shanbay-mina)、
[西安找拼车](https://github.com/chenqingspring)[(开源)](https://github.com/chenqingspring)、
[深大的树洞](https://github.com/jas0ncn/szushudong)[(开源)](https://github.com/jas0ncn/szushudong)、
[求知微阅读](https://github.com/KingJeason/wepy-books)[(开源)](https://github.com/KingJeason/wepy-books)、
[给你的 iPhone X 换个发型](https://bangs.baran.wang/)、
[天天跟我买](http://www.xiaohongchun.com.cn/index)、
[坚橙](https://zhanart.com/wepy.html)、
群脱单、
米淘联盟、
帮助圈、
众安保险福利、
阅邻二手书、
趣店招聘、
[满熊阅读(开源:](https://github.com/Thunf/wepy-demo-bookmall) [微信小程序](https://github.com/Thunf/wepy-demo-bookmall)、[支付宝小程序)](https://github.com/Thunf/wepy-demo-bookmall/tree/alipay)、
育儿柚道、
平行进口报价内参、
GitHub 掘金版、
班级群管、
鲜花说小店、
逛人备忘、
英语助手君、
花花百科、
独角兽公司、
爱羽客羽毛球、
斑马小店、
小小羽球、
培恩医学、
农资优选、
公务员朝夕刷题、
七弦琴小助手、
七弦琴大数据、
爽到家小程序、
[应用全球排行](https://github.com/szpnygo/wepy_ios_top)[(开源)](https://github.com/szpnygo/wepy_ios_top)、
[we 川大](https://github.com/mohuishou/scuplus-wechat)[(开源)](https://github.com/mohuishou/scuplus-wechat)、
聊会儿、
[诗词墨客](https://github.com/huangjianke/weapp-poem)[(开源)](https://github.com/huangjianke/weapp-poem)、
[南京邮电大学](https://github.com/GreenPomelo/Undergraduate)[(开源)](https://github.com/GreenPomelo/Undergraduate)

...

### Wechat group

WePY group has reached 500 members,Please add gcaufy_helper friends or scan the code to add friends, verify the reply 'wepy' according to the reference to enter the group.

![wepy_qr_code](https://user-images.githubusercontent.com/2182004/82732473-feb50c80-9d3f-11ea-9a5f-0efc6ce40f74.png)

### Contribution

If you have any comments or Suggestions, please feel free to contribute to improving the WeChat app-development experience by asking for Issues or Pull Requests.<br>see details:[CONTRIBUTING.md](./CONTRIBUTING.md)

[Tencent Open Source Incentive Plan](https://opensource.tencent.com/contribution) EncouraTencent Open Source Incentive Plange developers to participate and contribute. Look forward to your participation.

### Links

[Documentation](https://tencent.github.io/wepy/)

[Changelog](https://tencent.github.io/wepy/document.html#/changelog)

[Contributing](./CONTRIBUTING.md)

[License MIT](./LICENSE)


================================================
FILE: lerna.json
================================================
{
  "packages": [
    "packages/*"
  ],
  "version": "2.1.0",
  "message": "chore(release): publish",
  "command": {
    "publish": {
      "commitHooks": false,
      "conventionalCommits": true,
      "message": "chore(release): publish %s"
    }
  }
}


================================================
FILE: package.json
================================================
{
  "name": "wepy",
  "version": "0.0.0",
  "description": "",
  "main": "",
  "scripts": {
    "lint": "eslint ./ --ext .js",
    "dev": "chokidar '**/*.wpy' '**/*.js' -c 'npm run dev:all' -i '/dist/'",
    "build": "node ./scripts/build.js",
    "build:core": "rollup -w -c scripts/config.js --environment TARGET:core",
    "bootstrap": "./node_modules/.bin/lerna bootstrap --loglevel silly",
    "bootstrap:prod": "./node_modules/.bin/lerna bootstrap --loglevel -- --production --no-optional",
    "test": "npm run lint -- --fix && npm run test:cov",
    "test:unit": "node ./test/unit.js",
    "test:cov": "nyc npm run test:unit",
    "test:build": "./test/build.sh",
    "clean": "node ./scripts/clean.js",
    "view": "./node_modules/.bin/verpub view -l",
    "release": "./node_modules/.bin/verpub publish",
    "release:dry": "./node_modules/.bin/verpub publish --dry-run",
    "changelog": "lerna-changelog",
    "commit": "git cz"
  },
  "repository": {
    "type": "git",
    "url": "git@github.com:Tencent/wepy.git"
  },
  "author": "Gcaufy",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/Tencent/wepy/issues"
  },
  "homepage": "https://github.com/Tencent/wepy#readme",
  "devDependencies": {
    "babel": "^6.5.2",
    "babel-cli": "^6.18.0",
    "babel-eslint": "^7.1.1",
    "babel-preset-es2015": "^6.18.0",
    "babel-preset-stage-1": "^6.16.0",
    "chai": "^4.1.2",
    "chalk": "^1.1.3",
    "chokidar": "^3.4.0",
    "commitizen": "^3.1.1",
    "cz-conventional-changelog": "^2.1.0",
    "enquirer": "^2.3.0",
    "eslint": "^7.5.0",
    "eslint-config-prettier": "^6.10.0",
    "eslint-plugin-prettier": "^3.1.2",
    "esm": "^3.2.25",
    "event-stream": "3.3.4",
    "fs-extra": "^5.0.0",
    "husky": "^1.3.1",
    "istanbul": "^0.4.5",
    "jsonlint": "^1.6.2",
    "learn": "^0.1.5",
    "lerna": "^3.22.1",
    "lerna-changelog": "^1.0.1",
    "less": "^3.9.0",
    "mkpath": "^1.0.0",
    "mocha": "^6.2.3",
    "nyc": "^15.0.0",
    "prettier": "^1.18.2",
    "read-pkg": "^4.0.1",
    "rimraf": "^3.0.2",
    "rollup": "^0.56.5",
    "rollup-plugin-buble": "^0.19.2",
    "rollup-plugin-replace": "^2.0.0",
    "serve-static": "^1.11.1",
    "through2": "^2.0.3",
    "validate-commit-msg": "^2.14.0",
    "verpub": "^0.1.2"
  },
  "babel": {
    "comments": false,
    "presets": [
      [
        "es2015",
        {
          "loose": true
        }
      ],
      "stage-1"
    ],
    "plugins": [],
    "ignore": [
      "./packages/wepy-web/src/components/*.vue"
    ],
    "env": {
      "test": {
        "auxiliaryCommentBefore": "istanbul ignore next",
        "plugins": [
          "istanbul"
        ]
      }
    }
  },
  "engines": {
    "node": ">=8.9.4"
  },
  "husky": {
    "hooks": {
      "pre-commit": "npm run lint",
      "pre-push": "npm run test",
      "commit-msg": "npx validate-commit-msg"
    }
  },
  "changelog": {
    "labels": {
      "feat": ":rocket: New Feature",
      "bug": ":bug: Bug Fix",
      "doc": ":memo: Documentation",
      "internal": ":house: Internal",
      "breaking": ":boom: Breaking Change"
    }
  },
  "config": {
    "validate-commit-msg": {
      "helpMessage": "\nPlease fix your commit message (and consider using http://npm.im/commitizen)\n",
      "types": [
        "feat",
        "fix",
        "docs",
        "style",
        "refactor",
        "perf",
        "test",
        "chore",
        "revert",
        "build",
        "release",
        "custom"
      ],
      "warnOnFail": false,
      "autoFix": true
    },
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }
}


================================================
FILE: packages/babel-plugin-import-regenerator/CHANGELOG.md
================================================
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# 2.1.0 (2020-07-04)

**Note:** Version bump only for package @wepy/babel-plugin-import-regenerator





# 2.1.0-alpha.10 (2020-06-21)

**Note:** Version bump only for package @wepy/babel-plugin-import-regenerator





# 2.1.0-alpha.9 (2020-06-21)

**Note:** Version bump only for package @wepy/babel-plugin-import-regenerator





# 2.1.0-alpha.8 (2020-06-21)

**Note:** Version bump only for package @wepy/babel-plugin-import-regenerator





# 2.1.0-alpha.7 (2020-06-21)

**Note:** Version bump only for package @wepy/babel-plugin-import-regenerator





# 2.1.0-alpha.6 (2020-06-21)

**Note:** Version bump only for package @wepy/babel-plugin-import-regenerator





# 2.1.0-alpha.5 (2020-06-21)

**Note:** Version bump only for package @wepy/babel-plugin-import-regenerator





# [2.1.0-alpha.4](https://github.com/Tencent/wepy/compare/v2.1.0-alpha.2...v2.1.0-alpha.4) (2020-06-20)

**Note:** Version bump only for package @wepy/babel-plugin-import-regenerator


================================================
FILE: packages/babel-plugin-import-regenerator/README.md
================================================
[English](./README_EN.md) | [简体中文]

# @wepy/babel-plugin-import-regenerator

允许wepy使用 `Async Functions`.

## 安装

```
# Install regenerator-runtime dependence
$ npm install regenerator-runtime --save

# Install babel plugin 
$ npm install @wepy/babel-plugin-import-regenerator --save-dev
```

## 用法

在 wepy.config.js 中放入以下内容:


```js

{
  ....
    compilers: {
      babel: {
        presets: [
          '@babel/preset-env'
        ],
        plugins: [
          '@wepy/babel-plugin-import-regenerator'
        ]
      }
    }
}
```

## License

MIT


================================================
FILE: packages/babel-plugin-import-regenerator/README_EN.md
================================================
English | [简体中文](./README.md)

# @wepy/babel-plugin-import-regenerator

Allow wepy to use `Async Functions`.

## Installation

```
# Install regenerator-runtime dependence
$ npm install regenerator-runtime --save

# Install babel plugin 
$ npm install @wepy/babel-plugin-import-regenerator --save-dev
```

## Usage

Put something like this in your wepy.config.js:


```js

{
  ....
    compilers: {
      babel: {
        presets: [
          '@babel/preset-env'
        ],
        plugins: [
          '@wepy/babel-plugin-import-regenerator'
        ]
      }
    }
}
```

## License

MIT


================================================
FILE: packages/babel-plugin-import-regenerator/index.js
================================================
const helperModelImports = require('@babel/helper-module-imports');

let wm = new WeakMap();

exports = module.exports = ({ types: t }) => {
  return {
    visitor: {
      CallExpression(path) {
        let callee = path.get('callee');

        if (callee.node && callee.node.object && callee.node.property) {
          if (t.isIdentifier(callee.node.object, { name: 'regeneratorRuntime' })) {
            let programPath = path.scope.getProgramParent().path;
            let runtimeId;

            if (wm.has(programPath.node)) {
              runtimeId = t.identifier(wm.get(programPath.node));
            } else {
              runtimeId = helperModelImports.addDefault(programPath, 'regenerator-runtime', {
                nameHint: 'regeneratorRuntime',
                importedInterop: 'uncompiled',
                blockHoist: 3
              });
              wm.set(programPath.node, runtimeId.name);
            }
            callee.node.object.name = runtimeId.name;
          }
        }
      }
    }
  };
};


================================================
FILE: packages/babel-plugin-import-regenerator/package.json
================================================
{
  "name": "@wepy/babel-plugin-import-regenerator",
  "version": "2.1.0",
  "description": "A babel plugin to add a global generator import",
  "main": "index.js",
  "scripts": {
    "test": "mocha ./test/*.test.js"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/Tencent/wepy.git"
  },
  "keywords": [
    "regenerator-runtime"
  ],
  "author": {
    "name": "Gcaufy"
  },
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/Tencent/wepy/issues"
  },
  "homepage": "https://github.com/Tencent/wepy#readme",
  "dependencies": {
    "@babel/helper-module-imports": "^7.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.1.0",
    "babel-preset-env": "^1.7.0",
    "chai": "^4.1.2"
  },
  "readme": "ERROR: No README data found!",
  "_id": "@wepy/babel-plugin-import-regenerator@0.0.5",
  "_commitid": "ebdaf08",
  "gitHead": "5a25776457360bbbbc54a4d059f6bc7c032d5df3"
}


================================================
FILE: packages/babel-plugin-import-regenerator/test/fixtures/mutiple-async/actual.js
================================================
exports = module.exports = {
  foo () {
    return Promise.resolve(1);
  },
  async bar () {
    console.log(await foo());
  },
  async bar2 () {
    return await foo();
  },
  async bar3 () {
    let result = await bar2();
    console.log(result);
  }
}


================================================
FILE: packages/babel-plugin-import-regenerator/test/fixtures/mutiple-async/expected.js
================================================
"use strict";

var _regeneratorRuntime2 = require("regenerator-runtime");

var _regeneratorRuntime3 = _interopRequireDefault(_regeneratorRuntime2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }

function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }

exports = module.exports = {
  foo: function foo() {
    return Promise.resolve(1);
  },
  bar: function () {
    var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime3.default.mark(function _callee() {
      return _regeneratorRuntime3.default.wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              _context.t0 = console;
              _context.next = 3;
              return foo();

            case 3:
              _context.t1 = _context.sent;

              _context.t0.log.call(_context.t0, _context.t1);

            case 5:
            case "end":
              return _context.stop();
          }
        }
      }, _callee, this);
    }));

    function bar() {
      return _ref.apply(this, arguments);
    }

    return bar;
  }(),
  bar2: function () {
    var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime3.default.mark(function _callee2() {
      return _regeneratorRuntime3.default.wrap(function _callee2$(_context2) {
        while (1) {
          switch (_context2.prev = _context2.next) {
            case 0:
              _context2.next = 2;
              return foo();

            case 2:
              return _context2.abrupt("return", _context2.sent);

            case 3:
            case "end":
              return _context2.stop();
          }
        }
      }, _callee2, this);
    }));

    function bar2() {
      return _ref2.apply(this, arguments);
    }

    return bar2;
  }(),
  bar3: function () {
    var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime3.default.mark(function _callee3() {
      var result;
      return _regeneratorRuntime3.default.wrap(function _callee3$(_context3) {
        while (1) {
          switch (_context3.prev = _context3.next) {
            case 0:
              _context3.next = 2;
              return bar2();

            case 2:
              result = _context3.sent;
              console.log(result);

            case 4:
            case "end":
              return _context3.stop();
          }
        }
      }, _callee3, this);
    }));

    function bar3() {
      return _ref3.apply(this, arguments);
    }

    return bar3;
  }()
};


================================================
FILE: packages/babel-plugin-import-regenerator/test/fixtures/normal/actual.js
================================================
import wepy from '@wepy/core'

wepy.page({
  methods: {
    sleep (s) {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          resolve('promise resolved')
        }, s * 1000)
      })
    },
    async testAsync () {
      const result = await this.sleep(3)
      console.log(result)
    }
  }
})

================================================
FILE: packages/babel-plugin-import-regenerator/test/fixtures/normal/expected.js
================================================
"use strict";

var _regeneratorRuntime2 = require("regenerator-runtime");

var _regeneratorRuntime3 = _interopRequireDefault(_regeneratorRuntime2);

var _core = require("@wepy/core");

var _core2 = _interopRequireDefault(_core);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }

function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }

_core2.default.page({
  methods: {
    sleep: function sleep(s) {
      return new Promise(function (resolve, reject) {
        setTimeout(function () {
          resolve('promise resolved');
        }, s * 1000);
      });
    },
    testAsync: function () {
      var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime3.default.mark(function _callee() {
        var result;
        return _regeneratorRuntime3.default.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                _context.next = 2;
                return this.sleep(3);

              case 2:
                result = _context.sent;
                console.log(result);

              case 4:
              case "end":
                return _context.stop();
            }
          }
        }, _callee, this);
      }));

      function testAsync() {
        return _ref.apply(this, arguments);
      }

      return testAsync;
    }()
  }
});


================================================
FILE: packages/babel-plugin-import-regenerator/test/index.test.js
================================================
const { transform } = require('@babel/core');
const { readdirSync, readFileSync } = require('fs');
const { join } = require('path');
const plugin = require('../index');
const expect = require('chai').expect;

describe('babel-plugin-import-regenerator', () => {
  let fixturesDir = join(__dirname, 'fixtures');
  let fixtures = readdirSync(fixturesDir);

  fixtures.forEach(caseName => {
    const actualFile = join(fixturesDir, caseName, 'actual.js');
    const expectedFile = join(fixturesDir, caseName, 'expected.js');

    it(`should work with ${caseName.split('-').join(' ')}`, () => {
      const actual = transform(readFileSync(actualFile), {
        presets: ['env'],
        plugins: [plugin]
      }).code;

      const expected = readFileSync(expectedFile, 'utf-8');
      expect(actual.trim()).to.equal(expected.trim());
    });
  });
});


================================================
FILE: packages/cli/.gitignore
================================================
node_modules/
sftp-config.json
diff
log
npm-debug.log
lib/
demo/
.vscode

================================================
FILE: packages/cli/.npmignore
================================================
node_modules/
src/
coverage/
demo/
test/
ISSUE_TEMPLATE.md
appveyor.yml
README_zh-CN.md
*.map

================================================
FILE: packages/cli/CHANGELOG.md
================================================
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# 2.1.0 (2020-07-04)

**Note:** Version bump only for package @wepy/cli





# 2.1.0-alpha.10 (2020-06-21)

**Note:** Version bump only for package @wepy/cli





# 2.1.0-alpha.9 (2020-06-21)

**Note:** Version bump only for package @wepy/cli





# 2.1.0-alpha.8 (2020-06-21)

**Note:** Version bump only for package @wepy/cli





# 2.1.0-alpha.7 (2020-06-21)

**Note:** Version bump only for package @wepy/cli





# 2.1.0-alpha.6 (2020-06-21)

**Note:** Version bump only for package @wepy/cli





# 2.1.0-alpha.5 (2020-06-21)

**Note:** Version bump only for package @wepy/cli





# [2.1.0-alpha.4](https://github.com/wepyjs/wepy/compare/v2.1.0-alpha.2...v2.1.0-alpha.4) (2020-06-20)

**Note:** Version bump only for package @wepy/cli


================================================
FILE: packages/cli/README.md
================================================
# 小程序框架wepy命令行工具

参见:[小程序框架wepy](https://github.com/wepyjs/wepy)


### 安装
```bash
npm install wepy-cli -g
```

### Changelog
[查看CHANGELOG](https://github.com/wepyjs/wepy/blob/master/CHANGELOG.md)


================================================
FILE: packages/cli/bin/cli/ask.js
================================================
const async = require('async');
const inquirer = require('inquirer');
const evaluate = require('./eval');

// Support types from prompt-for which was used before
const promptMapping = {
  string: 'input',
  boolean: 'confirm'
};

/**
 * Ask questions, return results.
 *
 * @param {Object} prompts
 * @param {Object} data
 * @param {Function} done
 */

exports = module.exports = function ask(prompts, data, done) {
  async.eachSeries(
    Object.keys(prompts),
    (key, next) => {
      prompt(data, key, prompts[key], next);
    },
    done
  );
};

/**
 * Inquirer prompt wrapper.
 *
 * @param {Object} data
 * @param {String} key
 * @param {Object} prompt
 * @param {Function} done
 */

function prompt(data, key, prompt, done) {
  // skip prompts whose when condition is not met
  if (prompt.when && !evaluate(prompt.when, data)) {
    return done();
  }

  let promptDefault = prompt.default;
  if (typeof prompt.default === 'function') {
    promptDefault = function() {
      return prompt.default.bind(this)(data);
    };
  }

  inquirer
    .prompt([
      {
        type: promptMapping[prompt.type] || prompt.type,
        name: key,
        message: prompt.message || prompt.label || key,
        default: promptDefault,
        choices: prompt.choices || [],
        validate: prompt.validate || (() => true)
      }
    ])
    .then(answers => {
      if (Array.isArray(answers[key])) {
        data[key] = {};
        answers[key].forEach(multiChoiceAnswer => {
          data[key][multiChoiceAnswer] = true;
        });
      } else if (typeof answers[key] === 'string') {
        data[key] = answers[key].replace(/"/g, '\\"');
      } else {
        data[key] = answers[key];
      }
      done();
    })
    .catch(done);
}


================================================
FILE: packages/cli/bin/cli/check-version.js
================================================
const semver = require('semver');
const request = require('request');
const chalk = require('chalk');
const pkgConfig = require('../../package.json');

exports = module.exports = function checkVersion() {
  /**
   * 检测当前node版本是否符合要求
   */
  return new Promise((resolve, reject) => {
    if (!semver.satisfies(process.version, pkgConfig.engines.node)) {
      // eslint-disable-next-line no-console
      reject(new Error('  You must upgrade node to >=' + pkgConfig.engines.node + '.x to use @wepy/cli'));
      return;
    }
    request(
      {
        url: 'https://registry.npmjs.org/@wepy/cli',
        timeout: 1000
      },
      (err, res, body) => {
        if (!err && res.statusCode === 200) {
          const latestVersion = JSON.parse(body)['dist-tags'].latest;
          const localVersion = pkgConfig.version;
          if (semver.lt(localVersion, latestVersion)) {
            /* eslint-disable no-console */
            console.log(chalk.yellow('  A newer version of @wepy/cli is available.'));
            console.log();
            console.log('  latest:    ' + chalk.green(latestVersion));
            console.log('  installed: ' + chalk.red(localVersion));
            console.log();
            /* eslint-enable no-console */
          }
        }
        resolve(true);
      }
    );
  });
};


================================================
FILE: packages/cli/bin/cli/download.js
================================================
const download = require('download');
const downloadGitRepo = require('download-git-repo');

/**
 * download official template zip
 * @param {*} template template name
 */
exports = module.exports = {
  downloadOfficialZip(template, dist, options) {
    const templateName = template.split('#')[0];
    const branch = template.split('#')[1] || '2.0.x';
    if (branch === '2.0.x') {
      return this.downloadFromCos(templateName, dist, options).catch(() => {
        return this.downloadFromGitRaw(branch, templateName, dist, options);
      });
    } else {
      return this.downloadFromGitRaw(branch, templateName, dist, options);
    }
  },
  downloadFromGitRaw(template, dist, options, branch = '2.0.x') {
    const rawUrl = `https://raw.githubusercontent.com/wepyjs/wepy_templates/${branch}/zips/${template}.zip`;
    return download(rawUrl, dist, options).catch(e => {
      e.url = rawUrl;
      throw e;
    });
  },
  downloadFromCos(template, dist, options) {
    const cosUrl = `https://wepy-templates-1251238373.cos.ap-guangzhou.myqcloud.com/${template}.zip`;
    return download(cosUrl, dist, options).catch(e => {
      e.url = cosUrl;
      throw e;
    });
  },
  downloadRepo(template, dist, opt) {
    return new Promise((resolve, reject) => {
      downloadGitRepo(template, dist, opt, err => {
        if (err) {
          reject(err);
        } else {
          resolve(true);
        }
      });
    });
  }
};


================================================
FILE: packages/cli/bin/cli/eval.js
================================================
/**
 * Evaluate an expression in meta.json in the context of
 * prompt answers data.
 */
exports = module.exports = function evaluate(exp, data) {
  const fn = new Function('data', 'with (data) { return ' + exp + '}');
  try {
    return fn(data);
  } catch (e) {
    return null;
    //console.error(chalk.red('Error when evaluating filter condition: ' + exp));
  }
};


================================================
FILE: packages/cli/bin/cli/filter.js
================================================
const match = require('minimatch');
const evaluate = require('./eval');

exports = module.exports = function filter(files, filters, data, done) {
  if (!filters) {
    return done();
  }
  const fileNames = Object.keys(files);
  Object.keys(filters).forEach(glob => {
    fileNames.forEach(file => {
      if (match(file, glob, { dot: true })) {
        const condition = filters[glob];
        if (!evaluate(condition, data)) {
          delete files[file];
        }
      }
    });
  });
  done();
};


================================================
FILE: packages/cli/bin/cli/generate.js
================================================
const chalk = require('chalk');
const Metalsmith = require('metalsmith');
const Handlebars = require('handlebars');
const async = require('async');
const ncp = require('ncp');
const handlebars = require('consolidate').handlebars;
const path = require('path');
const multimatch = require('multimatch');
const getOptions = require('./options');
const ask = require('./ask');
const filter = require('./filter');
const logger = require('./logger');

// register handlebars helper
Handlebars.registerHelper('if_eq', function(a, b, opts) {
  return a === b ? opts.fn(this) : opts.inverse(this);
});

Handlebars.registerHelper('unless_eq', function(a, b, opts) {
  return a === b ? opts.inverse(this) : opts.fn(this);
});

/**
 * Generate a template given a `src` and `dest`.
 *
 * @param {String} name
 * @param {String} src
 * @param {String} dest
 * @param {Function} done
 */

exports = module.exports = function generate(name, src, dest, done) {
  const opts = getOptions(name, src);

  // This is a github project, and there is no meta.json or meta.js
  if (opts.status === false) {
    // Directly copy the project to dest.
    ncp.ncp(src, dest, function(err) {
      done(err);
    });
    return {};
  }
  const metalsmith = Metalsmith(path.join(src, 'template'));
  const data = Object.assign(metalsmith.metadata(), {
    destDirName: name,
    inPlace: dest === process.cwd(),
    noEscape: true
  });
  opts.helpers &&
    Object.keys(opts.helpers).map(key => {
      Handlebars.registerHelper(key, opts.helpers[key]);
    });

  const helpers = { chalk, logger };

  if (opts.metalsmith && typeof opts.metalsmith.before === 'function') {
    opts.metalsmith.before(metalsmith, opts, helpers);
  }

  metalsmith
    .use((process.argv.indexOf('--no-interactive') > -1 ? buildInlineArgs : askQuestions)(opts.prompts))
    .use(filterFiles(opts.filters))
    .use(renderTemplateFiles(opts.skipInterpolation));

  if (typeof opts.metalsmith === 'function') {
    opts.metalsmith(metalsmith, opts, helpers);
  } else if (opts.metalsmith && typeof opts.metalsmith.after === 'function') {
    opts.metalsmith.after(metalsmith, opts, helpers);
  }

  metalsmith
    .clean(false)
    .source('.') // start = require('emplate root instead of `./src` which is Metalsmith's default for `source);
    .destination(dest)
    .build((err, files) => {
      done(err);
      if (typeof opts.complete === 'function') {
        const helpers = { chalk, logger, files };
        opts.complete(data, helpers);
      } else {
        logMessage(opts.completeMessage, data);
      }
    });

  return data;
};

/**
 * Create a middleware for asking questions.
 *
 * @param {Object} prompts
 * @return {Function}
 */

function askQuestions(prompts) {
  return (files, metalsmith, done) => {
    ask(prompts, metalsmith.metadata(), done);
  };
}

/**
 * Get default value of a prompt item
 *
 * @param {String} value
 * @return {Function}
 */

function getDefault(item) {
  if (item.type === 'string') {
    return item.default || '';
  } else if (item.type === 'confirm') {
    return item.default || true;
  } else if (item.type === 'list') {
    return item.default || item.choices[0];
  } else {
    throw new Error('Unrecongnize type: ' + item.type + ' in ' + JSON.stringify(item));
  }
}

/**
 * Create a middleware using inline arguments.
 *
 * @param {Object} prompts
 * @return {Function}
 */

function buildInlineArgs(prompts) {
  const inlineArgs = {};
  for (const k in prompts) {
    const argIndex = process.argv.indexOf('--' + k);
    if (argIndex > -1) {
      inlineArgs[k] = process.argv[argIndex + 1];
    } else {
      inlineArgs[k] = getDefault(prompts[k]);
    }
    // eslint-disable-next-line no-console
    console.log([chalk.green('?'), chalk.bold(prompts[k].message), chalk.cyan(inlineArgs[k])].join(' '));
  }
  return (files, metalsmith, done) => {
    Object.assign(metalsmith.metadata(), inlineArgs);
    done();
  };
}

/**
 * Create a middleware for filtering files.
 *
 * @param {Object} filters
 * @return {Function}
 */

function filterFiles(filters) {
  return (files, metalsmith, done) => {
    filter(files, filters, metalsmith.metadata(), done);
  };
}

/**
 * Template in place plugin.
 *
 * @param {Object} files
 * @param {Metalsmith} metalsmith
 * @param {Function} done
 */

function renderTemplateFiles(skipInterpolation) {
  skipInterpolation = typeof skipInterpolation === 'string' ? [skipInterpolation] : skipInterpolation;
  return (files, metalsmith, done) => {
    const keys = Object.keys(files);
    const metalsmithMetadata = metalsmith.metadata();
    async.each(
      keys,
      (file, next) => {
        // skipping files with skipInterpolation option
        if (skipInterpolation && multimatch([file], skipInterpolation, { dot: true }).length) {
          return next();
        }
        const str = files[file].contents.toString();
        // do not attempt to render files that do not have mustaches
        if (!/{{([^{}]+)}}/g.test(str)) {
          return next();
        }
        handlebars.render(str, metalsmithMetadata, (err, res) => {
          if (err) {
            err.message = `[${file}] ${err.message}`;
            return next(err);
          }
          files[file].contents = Buffer.from(res);
          next();
        });
      },
      done
    );
  };
}

/**
 * Display template complete message.
 *
 * @param {String} message
 * @param {Object} data
 */

function logMessage(message, data) {
  if (!message) return;
  handlebars.render(message, data, (err, res) => {
    if (err) {
      // eslint-disable-next-line no-console
      console.error('\n   Error when rendering template complete message: ' + err.message.trim());
    } else {
      // eslint-disable-next-line no-console
      console.log(
        '\n' +
          res
            .split(/\r?\n/g)
            .map(line => '   ' + line)
            .join('\n')
      );
    }
  });
}


================================================
FILE: packages/cli/bin/cli/git-user.js
================================================
const execSync = require('child_process').execSync;

exports = module.exports = function getGitUser() {
  let name;
  let email;

  try {
    name = execSync('git config --get user.name');
    email = execSync('git config --get user.email');
  } catch (e) {}

  name = name && name.toString().trim();
  email = email && ' <' + email.toString().trim() + '>';
  return (name || '') + (email || '');
};


================================================
FILE: packages/cli/bin/cli/local-path.js
================================================
const path = require('path');

exports = module.exports = {
  isLocalPath(templatePath) {
    // templatePath example:
    // .wepy_templates
    // E:\workspace\wepy_templates\standard
    return /^[./]|(^[a-zA-Z]:)/.test(templatePath);
  },
  getTemplatePath(templatePath) {
    return path.isAbsolute(templatePath) ? templatePath : path.normalize(path.join(process.cwd(), templatePath));
  }
};


================================================
FILE: packages/cli/bin/cli/logger.js
================================================
const chalk = require('chalk');
const format = require('util').format;

/**
 * Prefix.
 */

const prefix = '   @wepy/cli';
const sep = chalk.gray('·');

/**
 * Log a `message` to the console.
 *
 * @param {String} message
 */

exports = module.exports = {
  log(...args) {
    const msg = format.apply(format, args);
    // eslint-disable-next-line no-console
    console.log(chalk.white(prefix), sep, msg);
  },

  /**
   * Log an error `message` to the console and exit.
   *
   * @param {String} message
   */

  fatal(...args) {
    if (args[0] instanceof Error) args[0] = args[0].message.trim();
    const msg = format.apply(format, args);
    // eslint-disable-next-line no-console
    console.error(chalk.red(prefix), sep, msg);
    process.exit(1);
  },

  /**
   * Log a success `message` to the console and exit.
   *
   * @param {String} message
   */

  success(...args) {
    const msg = format.apply(format, args);
    // eslint-disable-next-line no-console
    console.log(chalk.white(prefix), sep, msg);
  }
};


================================================
FILE: packages/cli/bin/cli/options.js
================================================
const path = require('path');
const metadata = require('read-metadata');
const fs = require('fs');
const getGitUser = require('./git-user');
const validateName = require('validate-npm-package-name');

/**
 * Read prompts metadata.
 *
 * @param {String} dir
 * @return {Object}
 */

exports = module.exports = function options(name, dir) {
  const opts = getMetadata(dir);

  setDefault(opts, 'name', name);
  setValidateName(opts);

  const author = getGitUser();
  if (author) {
    setDefault(opts, 'author', author);
  }

  return opts;
};

/**
 * Gets the metadata from either a meta.json or meta.js file.
 *
 * @param  {String} dir
 * @return {Object}
 */

function getMetadata(dir) {
  const json = path.join(dir, 'meta.json');
  const js = path.join(dir, 'meta.js');
  let opts = {};
  opts.status = true;

  if (fs.existsSync(json)) {
    opts = metadata.sync(json);
  } else if (fs.existsSync(js)) {
    const req = require(path.resolve(js));
    if (req !== Object(req)) {
      throw new Error('meta.js needs to expose an object');
    }
    opts = req;
  } else {
    opts.status = false;
  }

  return opts;
}

/**
 * Set the default value for a prompt question
 *
 * @param {Object} opts
 * @param {String} key
 * @param {String} val
 */

function setDefault(opts, key, val) {
  if (opts.schema) {
    opts.prompts = opts.schema;
    delete opts.schema;
  }
  const prompts = opts.prompts || (opts.prompts = {});
  if (!prompts[key] || typeof prompts[key] !== 'object') {
    prompts[key] = {
      type: 'string',
      default: val
    };
  } else {
    prompts[key]['default'] = val;
  }
}

function setValidateName(opts) {
  const name = opts.prompts.name;
  const customValidate = name.validate;
  name.validate = name => {
    const its = validateName(name);
    if (!its.validForNewPackages) {
      const errors = (its.errors || []).concat(its.warnings || []);
      return 'Sorry, ' + errors.join(' and ') + '.';
    }
    if (typeof customValidate === 'function') return customValidate(name);
    return true;
  };
}


================================================
FILE: packages/cli/bin/wepy-build.js
================================================
const compile = require('../core/compile');
const parseOptions = require('../core/parseOptions');
const logger = require('../core/util/logger');

exports = module.exports = program => {
  let options;
  try {
    options = parseOptions.convert(program);
  } catch (e) {
    const msg = e.message;
    if (msg.indexOf('plugins expect a Array') > -1) {
      logger.error(`Parse WePY config failed. Are you trying to use WePY 2 to build WePY 1 project?`);
    } else {
      logger.error(`Parse WePY config failed.`);
    }
    logger.error(e.message);
    process.exit();
  }
  const compilation = compile(options || {});
  compilation.run().catch(e => {
    compilation.logger.error('init', e.message);
  });
};


================================================
FILE: packages/cli/bin/wepy-init.js
================================================
const fs = require('fs');
const path = require('path');
const chalk = require('chalk');
const tildify = require('tildify');
const inquirer = require('inquirer');
const home = require('user-home');
const rm = require('rimraf').sync;
const download = require('./cli/download');
const localPath = require('./cli/local-path');
const checkVersion = require('./cli/check-version');
const generate = require('./cli/generate');
const logger = require('./../util/logger');

exports = module.exports = (template, rawName, program) => {
  function gen(templatePath) {
    logger.verbose('Start to generate project');
    // eslint-disable-next-line no-console
    console.log();
    return new Promise((resolve, reject) => {
      return generate(name, templatePath, to, err => {
        if (err) {
          reject(err);
        } else {
          resolve(true);
        }
      });
    })
      .catch(e => {
        logger.error('Generate project failed');
        logger.error(e);
        return false;
      })
      .then(conti => {
        if (conti) {
          // eslint-disable-next-line no-console
          console.log();
          logger.info(`Generated "${name}".`);
        }
      });
  }

  function run() {
    if (localPath.isLocalPath(template)) {
      logger.verbose('Use local path template');
      // use local/cache template
      // Example:
      // wepy init E:\workspace\wepy_templates\standard my-wepy-project
      // wepy init standard my-wepy-project --offline
      const templatePath = localPath.getTemplatePath(template);
      if (fs.existsSync(templatePath)) {
        gen(templatePath);
      } else {
        logger.error(`Local template "${template}" not found.`);
      }
    } else {
      logger.verbose(`Version check`);
      checkVersion().then(() => {
        downloadAndGenerate(template);
      });
    }
  }

  function downloadLog(msg, type = 'verbose') {
    logger[type](msg);
  }

  function downloadOfficialTemplate(templateName, dist, opt, branch) {
    downloadLog(`Download template "${templateName}" in branch "${branch}" from Github Raw`);
    return download
      .downloadFromGitRaw(templateName, dist, opt, branch)
      .catch(e => {
        if (branch === '2.0.x') {
          downloadLog(`Download URL is: ${e.url}`);
          downloadLog(`Download from Github raw failed, try Tencent COS download`, 'warn');
          downloadLog(e, 'warn');
          return download.downloadFromCos(templateName, tmp, opt);
        } else {
          throw e;
        }
      })
      .catch(e => {
        downloadLog(`Download URL is: ${e.url}`);
        throw e;
      });
  }

  function downloadAndGenerate(template) {
    if (fs.existsSync(tmp)) {
      rm(tmp);
    }
    if (!hasSlash) {
      let [templateName, branch] = template.split('#');
      downloadLog(`Donwnloading template "${templateName}"`);
      return downloadOfficialTemplate(templateName, tmp, { extract: true }, branch || '2.0.x')
        .then(() => {
          downloadLog('Download success, start generate template');
          return true;
        })
        .catch(e => {
          if (e.statusCode === 404) {
            logger.error(`Unrecongnized template: "${template}". Try "wepy list" to show all available templates `);
          } else {
            logger.error(`Download template failed`);
            logger.error(e);
          }
          return false;
        })
        .then(conti => {
          if (conti) {
            return gen(tmp);
          }
        });
    } else {
      // use third party template
      downloadLog('Donwnloading github repo "${template}"');
      return download
        .downloadRepo(template, tmp, { clone })
        .then(() => {
          downloadLog('Download repository success, start generate template');
          return true;
        })
        .catch(e => {
          logger.error('Failed to download repo ' + template);
          logger.error(e);
          return false;
        })
        .then(conti => {
          if (conti) {
            return gen(tmp);
          }
        });
    }
  }

  const hasSlash = template.indexOf('/') > -1;
  const inPlace = !rawName || rawName === '.';
  const name = inPlace ? path.relative('../', process.cwd()) : rawName;
  const to = path.resolve(rawName || '.');
  const clone = program.clone || false;
  const offline = program.offline || false;

  let tmp = path.join(home, '.wepy_templates', template.replace(/\//g, '-'));

  /**
   * use offline cache
   */
  if (offline) {
    // eslint-disable-next-line no-console
    logger.notice(`Use cached template at ${chalk.yellow(tildify(tmp))}`);
    template = tmp;
  }

  if (fs.existsSync(to)) {
    inquirer
      .prompt([
        {
          type: 'confirm',
          message: inPlace ? 'Generate project in current directory?' : 'Target directory exists. Continue?',
          name: 'ok'
        }
      ])
      .then(answers => {
        if (answers.ok) {
          run();
        }
      })
      .catch();
  } else {
    run();
  }
};


================================================
FILE: packages/cli/bin/wepy-list.js
================================================
#!/usr/bin/env node

const chalk = require('chalk');
const request = require('request');
const Table = require('tty-table');
const ta = require('time-ago');

exports = module.exports = program => {
  request(
    {
      url: 'https://raw.githubusercontent.com/wepyjs/wepy-templates/2.0.x/meta.json',
      headers: {
        'User-Agent': 'wepy-cli'
      }
    },
    (err, res, body) => {
      if (!body) {
        // eslint-disable-next-line no-console
        console.error('Something wrong with your network');
        return;
      }
      if (body.message) {
        // eslint-disable-next-line no-console
        console.error(body.messge);
        return;
      }
      let official, github;
      try {
        body = JSON.parse(body);
        official = body.official;
        github = body.github;
      } catch (e) {
        // eslint-disable-next-line no-console
        console.error('Something wrong with your network');
      }
      if (!program.github && Array.isArray(official)) {
        // eslint-disable-next-line no-console
        console.log('\n  Available official templates:\n');
        /*
            official.forEach(repo => {

              console.log(
            '  ' + chalk.yellow('♚') +
            '  ' + chalk.blue(repo.name) +
            ' - ' + repo.description);
            });
            */
        let tableHead = [
          {
            value: 'Name',
            width: 20,
            color: 'blue'
          },
          {
            value: 'Description',
            width: 60,
            align: 'left',
            paddingLeft: 2,
            key: 'description'
          }
        ];
        let rows = [];
        official.forEach(repo => {
          rows.push([repo.name, repo.description]);
        });

        let offical = Table(tableHead, rows, {
          borderStyle: 2
        });
        // eslint-disable-next-line no-console
        console.log(`     e.g., wepy init ${rows[0][0]} myproject`);
        // eslint-disable-next-line no-console
        console.log(offical.render());
      }
      if (Array.isArray(github)) {
        // eslint-disable-next-line no-console
        console.log('\n  Available github projects:\n');

        let tableHead = [
          {
            value: 'Repository',
            width: 30,
            color: 'blue',
            key: 'repo'
          },
          {
            value: 'Stars',
            width: 8,
            key: 'star'
          },
          {
            value: 'Description',
            width: 60,
            align: 'left',
            paddingLeft: 2,
            key: 'description'
          },
          {
            value: 'Last Updated',
            width: 25,
            key: 'last_update',
            formatter: function(v) {
              let date = new Date(v);
              if (date.toString() === 'Invalid Date') {
                return '----';
              } else {
                return ta.ago(v);
              }
            }
          }
        ];

        let map = tableHead.map(v => v.key);

        let showItems = [];
        let rows = [];
        let MAX_COUNT = program.github ? 0 : 5;
        if (MAX_COUNT && github.length > MAX_COUNT) {
          for (let i = 0, l = github.length; i < l; i++) {
            if (i >= MAX_COUNT) break;
            showItems.push(github[i]);
          }
        } else {
          showItems = github;
        }
        showItems.forEach(repo => {
          let row = [];
          map.forEach(title => {
            row.push(repo[title] || '');
          });
          rows.push(row);
        });
        if (MAX_COUNT && github.length > MAX_COUNT) {
          rows.push(['....', '..', '....', '....']);
        }

        let githubTable = Table(tableHead, rows, {
          borderStyle: 2
        });
        // eslint-disable-next-line no-console
        console.log(`     e.g., wepy init ${rows[0][0]} myproject`);
        // eslint-disable-next-line no-console
        console.log(githubTable.render());

        if (MAX_COUNT && github.length > MAX_COUNT) {
          // eslint-disable-next-line no-console
          console.log(chalk.gray(`  use 'wepy list --github' to see all github projects`));
        }
        if (program.github) {
          // eslint-disable-next-line no-console
          console.log(chalk.gray(`  You can registe your project from here: https://github.com/wepyjs/wepy_templates`));
        }
        // eslint-disable-next-line no-console
        console.log('\n');
      }
    }
  );
};


================================================
FILE: packages/cli/bin/wepy-new.js
================================================
#!/usr/bin/env node

const chalk = require('chalk');

exports = module.exports = proj => {
  if (typeof proj !== 'string') proj = 'myproject';
  // eslint-disable-next-line no-console
  console.log('');
  // eslint-disable-next-line no-console
  console.log(`deprecated command, please use ` + chalk.blue(`wepy init standard ${proj}`) + ` instead`);
  // eslint-disable-next-line no-console
  console.log('');
};


================================================
FILE: packages/cli/bin/wepy-upgrade.js
================================================
const exec = require('child_process').exec;
const util = require('../util');

function upgradeCLI(cb) {
  let cmd = 'npm install wepy-cli -g';
  util.log('升级中,可能需要几分钟, 请耐心等待...', '信息');
  util.log('执行命令: ' + cmd, '执行');
  let fcmd = exec(cmd, () => {
    util.log('完成安装最新版本wepy-cli', '完成');
    cb && cb();
  });
  fcmd.stdout.on('data', d => {
    // eslint-disable-next-line no-console
    console.log(d.substring(d, d.length - 1));
  });
}

function upgradeWepy(cb) {
  let cmd = 'npm install wepy --save';
  util.log('升级中,可能需要几分钟, 请耐心等待...', '信息');
  util.log('执行命令: ' + cmd, '执行');
  let fcmd = exec(cmd, () => {
    util.log('完成安装最新版本wepy', '完成');

    let cmd = 'wepy build --no-cache';
    util.log('执行命令: ' + cmd, '执行');

    let fcmd3 = exec(cmd, () => {
      util.log('完成升级', '完成');
      cb && cb();
    });
    fcmd3.stdout.on('data', d => {
      // eslint-disable-next-line no-console
      console.log(d.substring(d, d.length - 1));
    });
  });
  fcmd.stdout.on('data', d => {
    // eslint-disable-next-line no-console
    console.log(d.substring(d, d.length - 1));
  });
}

exports = module.exports = program => {
  if (program.cli) {
    upgradeCLI();
  } else {
    upgradeWepy();
  }
};


================================================
FILE: packages/cli/bin/wepy.js
================================================
#!/usr/bin/env node

const chalk = require('chalk');
const program = require('commander');
const logger = require('../core/util/logger');

program
  .version(require('../package.json').version, '-v, --version')
  .option('-l, --log <level>', 'change the log level')
  .usage('<command> [options]');

program
  .command('init <template-name> [project-name]')
  .allowUnknownOption()
  .description('generate a new project from a template')
  .action(require('./wepy-init'))
  .usage('<template-name> [project-name]')
  .option('-c --clone', 'use git clone')
  .option('--offline', 'use cached template')
  .option('--no-interactive', 'no interactive to use the options to create template')
  .on('--help', () => {
    /* eslint-disable no-console */
    console.log();
    console.log('  Example:');
    console.log();
    console.log(chalk.gray('   # create a new project with an official template'));
    console.log('  $ wepy init standard my-project');
    console.log();
    console.log(chalk.gray('   # create a new project straight from a github template'));
    console.log('  $ wepy init username/repo my-project');
    console.log();
    /* eslint-enable no-console */
  });

program
  .command('build')
  .description('build your project')
  .action(require('./wepy-build'))

  .option('-f, --file <file>', '待编译wpy文件')
  .option('-s, --source <source>', '源码目录')
  .option('-t, --target <target>', '生成代码目录')
  .option('-o, --output <type>', '编译类型:web,weapp。默认为weapp')
  .option('-p, --platform <type>', '编译平台:browser, wechat,qq。默认为browser')
  .option('-w, --watch', '监听文件改动')
  .option('--no-cache', '对于引用到的文件,即使无改动也会再次编译');

program
  .command('list')
  .description('list available official templates')
  .action(require('./wepy-list'))

  .option('-g, --github', 'list all registered github projects');

/*
program
  .command('upgrade')
  .description('upgrade to the latest version')
  .action(require('./wepy-upgrade'))
  .option('--cli', 'upgrade wepy-cli')
  .option('--wepy', 'upgrade wepy');
*/

program
  .command('new')
  .description('deprecated command, use "wepy init <template-name> <project-name>" instead')
  .action(require('./wepy-new'));

program.parse(process.argv);

if (program.log) {
  logger.level(program.log);
}


================================================
FILE: packages/cli/core/ast/index.js
================================================


================================================
FILE: packages/cli/core/ast/paramsDetect.js
================================================
const acorn = require('acorn');
const walk = require('acorn/dist/walk');

function isScope(node) {
  return (
    node.type === 'FunctionExpression' ||
    node.type === 'FunctionDeclaration' ||
    node.type === 'ArrowFunctionExpression' ||
    node.type === 'Program'
  );
}
function isBlockScope(node) {
  return node.type === 'BlockStatement' || isScope(node);
}

function declaresArguments(node) {
  return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration';
}

function declaresThis(node) {
  return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration';
}

function reallyParse(source, options) {
  var parseOptions = Object.assign({}, options, {
    allowReturnOutsideFunction: true,
    allowImportExportEverywhere: true,
    allowHashBang: true
  });
  return acorn.parse(source, parseOptions);
}
module.exports = findGlobals;
module.exports.parse = reallyParse;
function findGlobals(source, options) {
  options = options || {};
  let globals = [];
  let expressions = [];
  let callee;
  var ast;
  // istanbul ignore else
  if (typeof source === 'string') {
    ast = reallyParse(source, options);
  } else {
    ast = source;
  }
  // istanbul ignore if
  if (!(ast && typeof ast === 'object' && ast.type === 'Program')) {
    throw new TypeError('Source must be either a string of JavaScript or an acorn AST');
  }
  var declareFunction = function(node) {
    var fn = node;
    fn.locals = fn.locals || {};
    node.params.forEach(function(node) {
      declarePattern(node, fn);
    });
    if (node.id) {
      fn.locals[node.id.name] = true;
    }
  };
  var declarePattern = function(node, parent) {
    switch (node.type) {
      case 'Identifier':
        parent.locals[node.name] = true;
        break;
      case 'ObjectPattern':
        node.properties.forEach(function(node) {
          declarePattern(node.value, parent);
        });
        break;
      case 'ArrayPattern':
        node.elements.forEach(function(node) {
          if (node) declarePattern(node, parent);
        });
        break;
      case 'RestElement':
        declarePattern(node.argument, parent);
        break;
      case 'AssignmentPattern':
        declarePattern(node.left, parent);
        break;
      // istanbul ignore next
      default:
        throw new Error('Unrecognized pattern type: ' + node.type);
    }
  };
  var declareModuleSpecifier = function(node) {
    ast.locals = ast.locals || {};
    ast.locals[node.local.name] = true;
  };
  walk.ancestor(ast, {
    VariableDeclaration: function(node, parents) {
      var parent = null;
      for (var i = parents.length - 1; i >= 0 && parent === null; i--) {
        if (node.kind === 'var' ? isScope(parents[i]) : isBlockScope(parents[i])) {
          parent = parents[i];
        }
      }
      parent.locals = parent.locals || {};
      node.declarations.forEach(function(declaration) {
        declarePattern(declaration.id, parent);
      });
    },
    FunctionDeclaration: function(node, parents) {
      var parent = null;
      for (var i = parents.length - 2; i >= 0 && parent === null; i--) {
        if (isScope(parents[i])) {
          parent = parents[i];
        }
      }
      parent.locals = parent.locals || {};
      parent.locals[node.id.name] = true;
      declareFunction(node);
    },
    Function: declareFunction,
    ClassDeclaration: function(node, parents) {
      var parent = null;
      for (var i = parents.length - 2; i >= 0 && parent === null; i--) {
        if (isScope(parents[i])) {
          parent = parents[i];
        }
      }
      parent.locals = parent.locals || {};
      parent.locals[node.id.name] = true;
    },
    TryStatement: function(node) {
      if (node.handler === null) return;
      node.handler.locals = node.handler.locals || {};
      node.handler.locals[node.handler.param.name] = true;
    },
    ImportDefaultSpecifier: declareModuleSpecifier,
    ImportSpecifier: declareModuleSpecifier,
    ImportNamespaceSpecifier: declareModuleSpecifier
  });
  function identifier(node, parents) {
    var name = node.name;
    if (name === 'undefined') return;
    for (var i = 0; i < parents.length; i++) {
      if (name === 'arguments' && declaresArguments(parents[i])) {
        return;
      }
      if (parents[i].locals && name in parents[i].locals) {
        return;
      }
    }
    node.parents = parents;
    globals[name] = globals[name] || {};
    let callable = false;
    if (parents && parents.length > 2) {
      let parent = parents[parents.length - 2];
      callable = parent.type === 'CallExpression' && parent.callee === node;
    }
    globals[name].callable = globals[name].callable || callable;
    globals[name].nodes = globals[name].nodes || [];
    globals[name].nodes.push(node);
  }
  walk.ancestor(ast, {
    VariablePattern: identifier,
    Identifier: identifier,
    CallExpression: function(node) {
      callee = getNameForExpression(node.callee);
      expressions = node.arguments.map(arg => {
        let p = getNameForExpression(arg);
        p.node = arg;
        return p;
      });
    },
    ThisExpression: function(node, parents) {
      for (var i = 0; i < parents.length; i++) {
        if (declaresThis(parents[i])) {
          return;
        }
      }
      node.parents = parents;
      globals.push(node);
    }
  });
  return {
    identifiers: globals,
    callee,
    params: expressions
  };
}

function getNameForExpression(expression) {
  let expr = expression;
  const exprName = [];
  while (expr.type === 'MemberExpression' && expr.property.type === (expr.computed ? 'Literal' : 'Identifier')) {
    exprName.push(expr.computed ? expr.property.value : expr.property.name);
    expr = expr.object;
  }
  if (expr.type === 'Identifier') {
    exprName.push(expr.name);
  } else if (expr.type === 'Literal') {
    exprName.push(expr.value);
  }
  let name = exprName.pop();
  let t;
  while ((t = exprName.pop())) {
    name += typeof t === 'number' ? `[${t}]` : `.${t}`;
  }
  return {
    name,
    type: expr.type
  };
}


================================================
FILE: packages/cli/core/ast/parseClass.js
================================================
const walk = require('acorn/dist/walk');
const toAST = require('./toAST');

exports = module.exports = function parseClass(source) {
  source = '(' + source + ');';
  const ast = toAST(source);
  let result = [];
  walk.ancestor(ast, {
    ObjectExpression(node) {
      node.properties.forEach(p => {
        let value = p.key.type === 'Identifier' ? p.key.name : p.key.type === 'Literal' ? p.key.value : undefined;
        if (value) {
          if (p.value.type === 'Identifier') {
            result.push({
              [value]: p.value.name
            });
          } else {
            result.push({
              [value]: source.substring(p.value.start, p.value.end)
            });
          }
        }
      });
    },
    ArrayExpression(node) {
      node.elements.forEach(p => {
        if (p.type === 'Identifier') {
          result.push(p.name);
        }
      });
    },
    ConditionalExpression() {
      result.push(source);
    }
  });

  return result;
};


================================================
FILE: packages/cli/core/ast/toAST.js
================================================
const acorn = require('acorn-dynamic-import').default;

const ECMA_VERSION = 2017;

const POSSIBLE_AST_OPTIONS = [
  {
    ranges: true,
    locations: true,
    ecmaVersion: ECMA_VERSION,
    sourceType: 'module',
    plugins: {
      dynamicImport: true
    }
  },
  {
    ranges: true,
    locations: true,
    ecmaVersion: ECMA_VERSION,
    sourceType: 'script',
    plugins: {
      dynamicImport: true
    }
  }
];

exports = module.exports = function ast(source) {
  let ast;
  const comments = [];
  for (let i = 0, len = POSSIBLE_AST_OPTIONS.length; i < len; i++) {
    if (!ast) {
      try {
        comments.length = 0;
        POSSIBLE_AST_OPTIONS[i].onComment = comments;
        ast = acorn.parse(source, POSSIBLE_AST_OPTIONS[i]);
      } catch (e) {
        // ignore the error
      }
    }
  }

  if (!ast) {
    ast = acorn.parse(source, {
      ranges: true,
      locations: true,
      ecmaVersion: ECMA_VERSION,
      sourceType: 'module',
      plugins: {
        dynamicImport: true
      },
      onComment: comments
    });
  }

  if (!ast || typeof ast !== 'object') {
    throw new Error(`Source could't be parsed`);
  }
  return ast;
};


================================================
FILE: packages/cli/core/ast/walker.js
================================================
class AstWalker {
  constructor(compilation, ast, lang) {
    this.ast = ast;
    this.state = {};
    this.deps = [];
    this.replacements = [];
    this.compilation = compilation;
    this.lang = lang;
  }

  run() {
    this.scope = {
      inTry: false,
      definitions: [],
      instances: [],
      renames: {}
    };
    this.prewalkStatements(this.ast.body);
    this.walkStatements(this.ast.body);
  }
  // Walking iterates the statements and expressions and processes them
  walkStatements(statements) {
    for (let index = 0, len = statements.length; index < len; index++) {
      const statement = statements[index];
      this.walkStatement(statement);
    }
  }
  walkStatement(statement) {
    // if(this.applyPluginsBailResult1("statement", statement) !== undefined) return;
    const handler = this['walk' + statement.type];
    if (handler) handler.call(this, statement);
  }

  walkClass(classy) {
    if (classy.superClass) this.walkExpression(classy.superClass);
    if (classy.body && classy.body.type === 'ClassBody') {
      classy.body.body.forEach(methodDefinition => {
        if (methodDefinition.type === 'MethodDefinition') this.walkMethodDefinition(methodDefinition);
      });
    }
  }

  walkMethodDefinition(methodDefinition) {
    if (methodDefinition.computed && methodDefinition.key) this.walkExpression(methodDefinition.key);
    if (methodDefinition.value) this.walkExpression(methodDefinition.value);
  }

  // Prewalking iterates the scope for variable declarations
  prewalkStatements(statements) {
    for (let index = 0, len = statements.length; index < len; index++) {
      const statement = statements[index];
      this.prewalkStatement(statement);
    }
  }

  prewalkStatement(statement) {
    const handler = this['prewalk' + statement.type];
    if (handler) handler.call(this, statement);
  }

  // Real Statements
  prewalkBlockStatement(statement) {
    this.prewalkStatements(statement.body);
  }

  walkBlockStatement(statement) {
    this.walkStatements(statement.body);
  }

  walkExpressionStatement(statement) {
    this.walkExpression(statement.expression);
  }

  prewalkIfStatement(statement) {
    this.prewalkStatement(statement.consequent);
    if (statement.alternate) this.prewalkStatement(statement.alternate);
  }

  walkIfStatement(statement) {
    const result = undefined;
    // const result = this.applyPluginsBailResult1("statement if", statement);
    if (result === undefined) {
      this.walkExpression(statement.test);
      this.walkStatement(statement.consequent);
      if (statement.alternate) this.walkStatement(statement.alternate);
    } else {
      if (result) this.walkStatement(statement.consequent);
      else if (statement.alternate) this.walkStatement(statement.alternate);
    }
  }

  prewalkLabeledStatement(statement) {
    this.prewalkStatement(statement.body);
  }

  walkLabeledStatement(statement) {
    const result = undefined;
    // const result = this.applyPluginsBailResult1("label " + statement.label.name, statement);
    if (result !== true) this.walkStatement(statement.body);
  }

  prewalkWithStatement(statement) {
    this.prewalkStatement(statement.body);
  }

  walkWithStatement(statement) {
    this.walkExpression(statement.object);
    this.walkStatement(statement.body);
  }

  prewalkSwitchStatement(statement) {
    this.prewalkSwitchCases(statement.cases);
  }

  walkSwitchStatement(statement) {
    this.walkExpression(statement.discriminant);
    this.walkSwitchCases(statement.cases);
  }

  walkTerminatingStatement(statement) {
    if (statement.argument) this.walkExpression(statement.argument);
  }

  walkReturnStatement(statement) {
    this.walkTerminatingStatement(statement);
  }

  walkThrowStatement(statement) {
    this.walkTerminatingStatement(statement);
  }

  prewalkTryStatement(statement) {
    this.prewalkStatement(statement.block);
  }

  walkTryStatement(statement) {
    if (this.scope.inTry) {
      this.walkStatement(statement.block);
    } else {
      this.scope.inTry = true;
      this.walkStatement(statement.block);
      this.scope.inTry = false;
    }
    if (statement.handler) this.walkCatchClause(statement.handler);
    if (statement.finalizer) this.walkStatement(statement.finalizer);
  }

  prewalkWhileStatement(statement) {
    this.prewalkStatement(statement.body);
  }

  walkWhileStatement(statement) {
    this.walkExpression(statement.test);
    this.walkStatement(statement.body);
  }

  prewalkDoWhileStatement(statement) {
    this.prewalkStatement(statement.body);
  }

  walkDoWhileStatement(statement) {
    this.walkStatement(statement.body);
    this.walkExpression(statement.test);
  }

  prewalkForStatement(statement) {
    if (statement.init) {
      if (statement.init.type === 'VariableDeclaration') this.prewalkStatement(statement.init);
    }
    this.prewalkStatement(statement.body);
  }

  walkForStatement(statement) {
    if (statement.init) {
      if (statement.init.type === 'VariableDeclaration') this.walkStatement(statement.init);
      else this.walkExpression(statement.init);
    }
    if (statement.test) this.walkExpression(statement.test);
    if (statement.update) this.walkExpression(statement.update);
    this.walkStatement(statement.body);
  }

  prewalkForInStatement(statement) {
    if (statement.left.type === 'VariableDeclaration') this.prewalkStatement(statement.left);
    this.prewalkStatement(statement.body);
  }

  walkForInStatement(statement) {
    if (statement.left.type === 'VariableDeclaration') this.walkStatement(statement.left);
    else this.walkExpression(statement.left);
    this.walkExpression(statement.right);
    this.walkStatement(statement.body);
  }

  prewalkForOfStatement(statement) {
    if (statement.left.type === 'VariableDeclaration') this.prewalkStatement(statement.left);
    this.prewalkStatement(statement.body);
  }

  walkForOfStatement(statement) {
    if (statement.left.type === 'VariableDeclaration') this.walkStatement(statement.left);
    else this.walkExpression(statement.left);
    this.walkExpression(statement.right);
    this.walkStatement(statement.body);
  }

  // Declarations
  prewalkFunctionDeclaration(statement) {
    if (statement.id) {
      this.scope.renames['$' + statement.id.name] = undefined;
      this.scope.definitions.push(statement.id.name);
    }
  }

  walkFunctionDeclaration(statement) {
    statement.params.forEach(param => {
      this.walkPattern(param);
    });
    this.inScope(statement.params, () => {
      if (statement.body.type === 'BlockStatement') {
        this.prewalkStatement(statement.body);
        this.walkStatement(statement.body);
      } else {
        this.walkExpression(statement.body);
      }
    });
  }

  prewalkImportDeclaration(statement) {
    const source = statement.source.value;
    let dep = {
      statement: statement,
      expr: statement.source,
      module: source,
      loc: statement.source.loc
    };
    this.deps.push(dep);
    return;
    /*
    // this.applyPluginsBailResult("import", statement, source);
    statement.specifiers.forEach(function(specifier) {
      const name = specifier.local.name;
      this.scope.renames['$' + name] = undefined;
      this.scope.definitions.push(name);
      switch (specifier.type) {
        case 'ImportDefaultSpecifier':
          // this.applyPluginsBailResult("import specifier", statement, source, "default", name);
          break;
        case 'ImportSpecifier':
          // this.applyPluginsBailResult("import specifier", statement, source, specifier.imported.name, name);
          break;
        case 'ImportNamespaceSpecifier':
          // this.applyPluginsBailResult("import specifier", statement, source, null, name);
          break;
      }
    }, this);
    */
  }

  prewalkExportNamedDeclaration(statement) {
    /*
    let source;
    if (statement.source) {
      source = statement.source.value;
      // this.applyPluginsBailResult("export import", statement, source);
    } else {
      // this.applyPluginsBailResult1("export", statement);
    }*/
    if (statement.declaration) {
      if (/Expression$/.test(statement.declaration.type)) {
        throw new Error(`Doesn't occur?`);
      } else {
        this.prewalkStatement(statement.declaration);
        /*
        const pos = this.scope.definitions.length;
        const newDefs = this.scope.definitions.slice(pos);
        for (let index = newDefs.length - 1; index >= 0; index--) {
          const def = newDefs[index];
          // this.applyPluginsBailResult("export specifier", statement, def, def, index);
        }*/
      }
    }
    if (statement.specifiers) {
      for (let specifierIndex = 0; specifierIndex < statement.specifiers.length; specifierIndex++) {
        const specifier = statement.specifiers[specifierIndex];
        switch (specifier.type) {
          case 'ExportSpecifier': {
            //const name = specifier.exported.name;
            /*
              if(source)
                // this.applyPluginsBailResult("export import specifier", statement, source, specifier.local.name, name, specifierIndex);
              else
                // this.applyPluginsBailResult("export specifier", statement, specifier.local.name, name, specifierIndex);
              */
            break;
          }
        }
      }
    }
  }

  walkExportNamedDeclaration(statement) {
    if (statement.declaration) {
      this.walkStatement(statement.declaration);
    }
  }

  prewalkExportDefaultDeclaration(statement) {
    if (/Declaration$/.test(statement.declaration.type)) {
      this.prewalkStatement(statement.declaration);
      /*
      const pos = this.scope.definitions.length;
      const newDefs = this.scope.definitions.slice(pos);
      for (let index = 0, len = newDefs.length; index < len; index++) {
        const def = newDefs[index];
        // this.applyPluginsBailResult("export specifier", statement, def, "default");
      }*/
    }
  }

  walkExportDefaultDeclaration(statement) {
    // this.applyPluginsBailResult1("export", statement);
    if (/Declaration$/.test(statement.declaration.type)) {
    } else {
      this.walkExpression(statement.declaration);
    }
  }

  /*
  prewalkExportAllDeclaration(statement) {
    // const source = statement.source.value;
    // this.applyPluginsBailResult("export import", statement, source);
    // this.applyPluginsBailResult("export import specifier", statement, source, null, null, 0);
  }*/

  prewalkVariableDeclaration(statement) {
    if (statement.declarations) this.prewalkVariableDeclarators(statement.declarations);
  }

  walkVariableDeclaration(statement) {
    if (statement.declarations) this.walkVariableDeclarators(statement.declarations);
  }

  prewalkClassDeclaration(statement) {
    if (statement.id) {
      this.scope.renames['$' + statement.id.name] = undefined;
      this.scope.definitions.push(statement.id.name);
    }
  }

  walkClassDeclaration(statement) {
    this.walkClass(statement);
  }

  prewalkSwitchCases(switchCases) {
    for (let index = 0, len = switchCases.length; index < len; index++) {
      const switchCase = switchCases[index];
      this.prewalkStatements(switchCase.consequent);
    }
  }

  walkSwitchCases(switchCases) {
    for (let index = 0, len = switchCases.length; index < len; index++) {
      const switchCase = switchCases[index];

      if (switchCase.test) {
        this.walkExpression(switchCase.test);
      }
      this.walkStatements(switchCase.consequent);
    }
  }

  walkCatchClause(catchClause) {
    this.inScope([catchClause.param], () => {
      this.prewalkStatement(catchClause.body);
      this.walkStatement(catchClause.body);
    });
  }

  prewalkVariableDeclarators(declarators) {
    declarators.forEach(declarator => {
      switch (declarator.type) {
        case 'VariableDeclarator': {
          this.enterPattern(declarator.id, (name, decl) => {
            // For old version compiler-babel, we can remove it later
            if (this.compilation.hasHook('prewalk-' + declarator.type, this, declarator, name, decl)) {
              this.compilation.hook('prewalk-' + declarator.type, this, declarator, name, decl);
            } else {
              // Ignore child scope
              if (this.scope.instances && declarator.init && declarator.init.type === 'CallExpression') {
                if (declarator.init.callee.name === 'require') {
                  if (
                    declarator.init.arguments &&
                    declarator.init.arguments[0] &&
                    declarator.init.arguments[0].value === 'wepy'
                  ) {
                    this.scope.instances.push(name);
                  }
                } else if (declarator.init.callee.name === '_interopRequireDefault') {
                  this.scope.instances.push(name + '.default');
                }
              }
            }

            if (!this.applyMethods(`var${declarator.kind}${name}`, decl)) {
              if (!this.applyMethods(`var${name}`, decl)) {
                this.scope.renames['$' + name] = undefined;
                if (this.scope.definitions.indexOf(name) < 0) this.scope.definitions.push(name);
              }
            }
            /*
              if(true || !this.applyPluginsBailResult1("var-" + declarator.kind + " " + name, decl)) {
                if(true || !this.applyPluginsBailResult1("var " + name, decl)) {
                  this.scope.renames["$" + name] = undefined;
                  if(this.scope.definitions.indexOf(name) < 0)
                    this.scope.definitions.push(name);
                }
              }*/
          });
          break;
        }
      }
    });
  }

  walkVariableDeclarators(declarators) {
    declarators.forEach(declarator => {
      switch (declarator.type) {
        case 'VariableDeclarator': {
          const renameIdentifier = declarator.init && this.getRenameIdentifier(declarator.init);
          if (
            renameIdentifier &&
            declarator.id.type === 'Identifier' &&
            this.applyMethods('canrename' + renameIdentifier, declarator.init)
          ) {
            // if(renameIdentifier && declarator.id.type === "Identifier" && this.applyPluginsBailResult1("can-rename " + renameIdentifier, declarator.init)) {
            // renaming with "var a = b;"
            if (!this.applyMethods('rename' + renameIdentifier, declarator.init)) {
              // if(!this.applyPluginsBailResult1("rename " + renameIdentifier, declarator.init)) {
              this.scope.renames['$' + declarator.id.name] =
                this.scope.renames['$' + renameIdentifier] || renameIdentifier;
              const idx = this.scope.definitions.indexOf(declarator.id.name);
              if (idx >= 0) this.scope.definitions.splice(idx, 1);
            }
          } else {
            this.walkPattern(declarator.id);
            if (declarator.init) this.walkExpression(declarator.init);
          }
          break;
        }
      }
    });
  }

  walkPattern(pattern) {
    if (pattern.type === 'Identifier') return;
    if (this['walk' + pattern.type]) this['walk' + pattern.type](pattern);
  }

  walkAssignmentPattern(pattern) {
    this.walkExpression(pattern.right);
    this.walkPattern(pattern.left);
  }

  walkObjectPattern(pattern) {
    for (let i = 0, len = pattern.properties.length; i < len; i++) {
      const prop = pattern.properties[i];
      if (prop) {
        if (prop.computed) this.walkExpression(prop.key);
        if (prop.value) this.walkPattern(prop.value);
      }
    }
  }

  walkArrayPattern(pattern) {
    for (let i = 0, len = pattern.elements.length; i < len; i++) {
      const element = pattern.elements[i];
      if (element) this.walkPattern(element);
    }
  }

  walkRestElement(pattern) {
    this.walkPattern(pattern.argument);
  }

  walkExpressions(expressions) {
    for (let expressionsIndex = 0, len = expressions.length; expressionsIndex < len; expressionsIndex++) {
      const expression = expressions[expressionsIndex];
      if (expression) this.walkExpression(expression);
    }
  }

  walkExpression(expression) {
    if (this['walk' + expression.type]) return this['walk' + expression.type](expression);
  }

  walkAwaitExpression(expression) {
    const argument = expression.argument;
    if (this['walk' + argument.type]) return this['walk' + argument.type](argument);
  }

  walkArrayExpression(expression) {
    if (expression.elements) this.walkExpressions(expression.elements);
  }

  walkSpreadElement(expression) {
    if (expression.argument) this.walkExpression(expression.argument);
  }

  walkObjectExpression(expression) {
    for (let propIndex = 0, len = expression.properties.length; propIndex < len; propIndex++) {
      const prop = expression.properties[propIndex];
      if (prop.computed) this.walkExpression(prop.key);
      if (prop.shorthand) this.scope.inShorthand = true;
      this.walkExpression(prop.value);
      if (prop.shorthand) this.scope.inShorthand = false;
    }
  }

  walkFunctionExpression(expression) {
    expression.params.forEach(param => {
      this.walkPattern(param);
    });
    this.inScope(expression.params, () => {
      if (expression.body.type === 'BlockStatement') {
        this.prewalkStatement(expression.body);
        this.walkStatement(expression.body);
      } else {
        this.walkExpression(expression.body);
      }
    });
  }

  walkArrowFunctionExpression(expression) {
    expression.params.forEach(param => {
      this.walkPattern(param);
    });
    this.inScope(expression.params, () => {
      if (expression.body.type === 'BlockStatement') {
        this.prewalkStatement(expression.body);
        this.walkStatement(expression.body);
      } else {
        this.walkExpression(expression.body);
      }
    });
  }

  walkSequenceExpression(expression) {
    if (expression.expressions) this.walkExpressions(expression.expressions);
  }

  walkUpdateExpression(expression) {
    this.walkExpression(expression.argument);
  }

  walkUnaryExpression(expression) {
    if (expression.operator === 'typeof') {
      const exprName = this.getNameForExpression(expression.argument);
      if (exprName && exprName.free) {
        let hookName = 'walker-unary-expression-undefined';
        if (this.compilation.hasHook(hookName)) {
          this.compilation.hookSeq(hookName, this, expression, exprName);
        }
      }
    }
    this.walkExpression(expression.argument);
  }

  walkLeftRightExpression(expression) {
    this.walkExpression(expression.left);
    this.walkExpression(expression.right);
  }

  walkBinaryExpression(expression) {
    this.walkLeftRightExpression(expression);
  }

  walkLogicalExpression(expression) {
    this.walkLeftRightExpression(expression);
  }

  walkAssignmentExpression(expression) {
    const renameIdentifier = this.getRenameIdentifier(expression.right);
    if (
      expression.left.type === 'Identifier' &&
      renameIdentifier &&
      this.applyMethods('canrename' + renameIdentifier, expression.right)
    ) {
      // if(expression.left.type === "Identifier" && renameIdentifier && this.applyPluginsBailResult1("can-rename " + renameIdentifier, expression.right)) {
      // renaming "a = b;"
      if (!this.applyMethods('rename' + renameIdentifier, expression.right)) {
        // if(!this.applyPluginsBailResult1("rename " + renameIdentifier, expression.right)) {
        this.scope.renames['$' + expression.left.name] = renameIdentifier;
        const idx = this.scope.definitions.indexOf(expression.left.name);
        if (idx >= 0) this.scope.definitions.splice(idx, 1);
      }
    } else if (expression.left.type === 'Identifier') {
      if (!this.applyMethods('assigned' + expression.left.name, expression)) {
        // if(!this.applyPluginsBailResult1("assigned " + expression.left.name, expression)) {
        this.walkExpression(expression.right);
      }
      this.scope.renames['$' + expression.left.name] = undefined;
      if (!this.applyMethods('assign' + expression.left.name, expression)) {
        // if(!this.applyPluginsBailResult1("assign " + expression.left.name, expression)) {
        this.walkExpression(expression.left);
      }
    } else if (
      expression.left.type === 'MemberExpression' &&
      expression.left.object.name === '_this' &&
      expression.left.property.name === 'config' &&
      expression.right.type === 'ObjectExpression'
    ) {
      // _this.config = {}
      this.config = expression.right;
    } else if (
      expression.left.type === 'MemberExpression' &&
      expression.left.object.name === 'exports' &&
      (expression.left.property.name === 'default' || expression.left.property.value === 'default') &&
      expression.right.type === 'Identifier'
    ) {
      // _this.config = {}
      this.export = expression;
    } else if (
      expression.left.type === 'MemberExpression' &&
      expression.left.object.type === 'ThisExpression' &&
      expression.left.property.name === 'components' &&
      expression.right.type === 'ObjectExpression'
    ) {
      // this.components = {}
      this.components = expression;
    } else {
      this.walkExpression(expression.right);
      this.walkPattern(expression.left);
      this.enterPattern(expression.left, name => {
        this.scope.renames['$' + name] = undefined;
      });
    }
  }

  walkConditionalExpression(expression) {
    const result = undefined;

    // const result = this.applyPluginsBailResult1("expression ?:", expression);
    if (result === undefined) {
      this.walkExpression(expression.test);
      this.walkExpression(expression.consequent);
      if (expression.alternate) this.walkExpression(expression.alternate);
    } else {
      if (result) this.walkExpression(expression.consequent);
      else if (expression.alternate) this.walkExpression(expression.alternate);
    }
  }

  walkNewExpression(expression) {
    this.walkExpression(expression.callee);
    if (expression.arguments) this.walkExpressions(expression.arguments);
  }

  walkYieldExpression(expression) {
    if (expression.argument) this.walkExpression(expression.argument);
  }

  walkTemplateLiteral(expression) {
    if (expression.expressions) this.walkExpressions(expression.expressions);
  }

  walkTaggedTemplateExpression(expression) {
    if (expression.tag) this.walkExpression(expression.tag);
    if (expression.quasi && expression.quasi.expressions) this.walkExpressions(expression.quasi.expressions);
  }

  walkClassExpression(expression) {
    this.walkClass(expression);
  }

  walkCallExpression(expression) {
    let result;
    function walkIIFE(functionExpression, options, currentThis) {
      function renameArgOrThis(argOrThis) {
        const renameIdentifier = this.getRenameIdentifier(argOrThis);
        if (renameIdentifier && this.applyMethods('canrename' + renameIdentifier, argOrThis)) {
          // if(renameIdentifier && this.applyPluginsBailResult1("can-rename " + renameIdentifier, argOrThis)) {
          if (!this.applyMethods('rename' + renameIdentifier, argOrThis))
            // if(!this.applyPluginsBailResult1("rename " + renameIdentifier, argOrThis))
            return renameIdentifier;
        }
        this.walkExpression(argOrThis);
      }
      const params = functionExpression.params;
      const renameThis = currentThis ? renameArgOrThis.call(this, currentThis) : null;
      const args = options.map(renameArgOrThis, this);
      this.inScope(
        params.filter(function(identifier, idx) {
          return !args[idx];
        }),
        () => {
          if (renameThis) {
            this.scope.renames.$this = renameThis;
          }
          for (let i = 0; i < args.length; i++) {
            const param = args[i];
            if (!param) continue;
            if (!params[i] || params[i].type !== 'Identifier') continue;
            this.scope.renames['$' + params[i].name] = param;
          }
          if (functionExpression.body.type === 'BlockStatement') {
            this.prewalkStatement(functionExpression.body);
            this.walkStatement(functionExpression.body);
          } else this.walkExpression(functionExpression.body);
        }
      );
    }
    if (
      expression.callee.type === 'MemberExpression' &&
      expression.callee.object.type === 'FunctionExpression' &&
      !expression.callee.computed &&
      ['call', 'bind'].indexOf(expression.callee.property.name) >= 0 &&
      expression.arguments &&
      expression.arguments.length > 0
    ) {
      // (function(...) { }.call/bind(?, ...))
      walkIIFE.call(this, expression.callee.object, expression.arguments.slice(1), expression.arguments[0]);
    } else if (expression.callee.type === 'FunctionExpression' && expression.arguments) {
      // (function(...) { }(...))
      walkIIFE.call(this, expression.callee, expression.arguments);
    } else if (expression.callee.type === 'Import') {
      // result = this.applyPluginsBailResult1("import-call", expression);
      if (result === true) return;

      if (expression.arguments) this.walkExpressions(expression.arguments);
    } else {
      if (expression.callee.type === 'MemberExpression') {
        let exprName = this.getNameForExpression(expression.callee);
        // For old version compiler-babel, we can remove it later
        if (this.compilation.hasHook('walker-detect-entry')) {
          this.compilation.hook('walker-detect-entry', this, expression, exprName);
        } else {
          if (this.scope.instances && exprName && this.scope.instances.indexOf(exprName.instance) !== -1) {
            // calling wepy instance
            if (['app', 'page', 'component'].indexOf(exprName.callee) !== -1) {
              this.entry = expression;
            }
          }
        }
      }

      const callee = this.evaluateExpression(expression.callee);
      if (callee.identifier) {
        let fn = `call${callee.identifier}`;
        if (this[fn]) {
          result = this[fn](expression);
        }
        // result = this.applyPluginsBailResult1("call " + callee.identifier, expression);
        if (result === true) return;
        let identifier = callee.identifier.replace(/\.[^.]+$/, '.*');
        if (identifier !== callee.identifier) {
          let fn = `call${identifier}`;
          if (this[fn]) {
            result = this[fn](expression);
          }
          // result = this.applyPluginsBailResult1("call " + identifier, expression);
          if (result === true) return;
        }
      }

      if (expression.callee) this.walkExpression(expression.callee);
      if (expression.arguments) this.walkExpressions(expression.arguments);
    }
  }

  walkMemberExpression(expression) {
    const exprName = this.getNameForExpression(expression);
    if (exprName && exprName.free) {
      let hookName = 'walker-member-expression-undefined';
      if (this.compilation.hasHook(hookName)) {
        this.compilation.hookSeq(hookName, this, expression, exprName);
      }
    }
    this.walkExpression(expression.object);
    if (expression.computed === true) this.walkExpression(expression.property);
  }

  walkIdentifier(expression) {
    if (this.scope.definitions.indexOf(expression.name) === -1) {
      let hookName = 'walker-identifier-undefined';
      if (this.compilation.hasHook(hookName)) {
        this.compilation.hookSeq(hookName, this, expression);
      }
    }
  }

  inScope(params, fn) {
    const oldScope = this.scope;
    this.scope = {
      inTry: false,
      inShorthand: false,
      definitions: oldScope.definitions.slice(),
      renames: Object.create(oldScope.renames)
    };

    this.scope.renames.$this = undefined;

    for (let paramIndex = 0, len = params.length; paramIndex < len; paramIndex++) {
      const param = params[paramIndex];

      if (typeof param !== 'string') {
        this.enterPattern(param, param => {
          this.scope.renames['$' + param] = undefined;
          this.scope.definitions.push(param);
        });
      } else {
        this.scope.renames['$' + param] = undefined;
        this.scope.definitions.push(param);
      }
    }

    fn();
    this.scope = oldScope;
  }

  enterPattern(pattern, onIdent) {
    if (pattern && this['enter' + pattern.type]) this['enter' + pattern.type](pattern, onIdent);
  }

  enterIdentifier(pattern, onIdent) {
    onIdent(pattern.name, pattern);
  }

  enterObjectPattern(pattern, onIdent) {
    for (let propIndex = 0, len = pattern.properties.length; propIndex < len; propIndex++) {
      const prop = pattern.properties[propIndex];
      this.enterPattern(prop.value, onIdent);
    }
  }

  enterArrayPattern(pattern, onIdent) {
    for (let elementIndex = 0, len = pattern.elements.length; elementIndex < len; elementIndex++) {
      const element = pattern.elements[elementIndex];
      this.enterPattern(element, onIdent);
    }
  }

  enterRestElement(pattern, onIdent) {
    this.enterPattern(pattern.argument, onIdent);
  }

  enterAssignmentPattern(pattern, onIdent) {
    this.enterPattern(pattern.left, onIdent);
  }

  evaluateExpression(expression) {
    try {
      let result;
      let fn = `evaluate${expression.type}`;
      if (this[fn]) {
        result = this[fn](expression);
      }
      // const result = this.applyPluginsBailResult1("evaluate " + expression.type, expression);
      if (result !== undefined) return result;
    } catch (e) {
      // eslint-disable-next-line no-console
      console.warn(e);
      // ignore error
    }
    return expression.range;
    // return new BasicEvaluatedExpression().setRange(expression.range);
  }

  getRenameIdentifier(expr) {
    const result = this.evaluateExpression(expr);
    if (!result) return;
    if (result.identifier) return result.identifier;
    return;
  }

  parseString(expression) {
    switch (expression.type) {
      case 'BinaryExpression':
        if (expression.operator === '+') return this.parseString(expression.left) + this.parseString(expression.right);
        break;
      case 'Literal':
        return expression.value + '';
    }
    throw new Error(expression.type + ' is not supported as parameter for require');
  }

  parseCalculatedString(expression) {
    switch (expression.type) {
      case 'BinaryExpression':
        if (expression.operator === '+') {
          const left = this.parseCalculatedString(expression.left);
          const right = this.parseCalculatedString(expression.right);
          if (left.code) {
            return {
              range: left.range,
              value: left.value,
              code: true
            };
          } else if (right.code) {
            return {
              range: [left.range[0], right.range ? right.range[1] : left.range[1]],
              value: left.value + right.value,
              code: true
            };
          } else {
            return {
              range: [left.range[0], right.range[1]],
              value: left.value + right.value
            };
          }
        }
        break;
      case 'ConditionalExpression': {
        const consequent = this.parseCalculatedString(expression.consequent);
        const alternate = this.parseCalculatedString(expression.alternate);
        const items = [];
        if (consequent.conditional) Array.prototype.push.apply(items, consequent.conditional);
        else if (!consequent.code) items.push(consequent);
        else break;
        if (alternate.conditional) Array.prototype.push.apply(items, alternate.conditional);
        else if (!alternate.code) items.push(alternate);
        else break;
        return {
          value: '',
          code: true,
          conditional: items
        };
      }
      case 'Literal':
        return {
          range: expression.range,
          value: expression.value + ''
        };
    }
    return {
      value: '',
      code: true
    };
  }

  parseStringArray(expression) {
    if (expression.type !== 'ArrayExpression') {
      return [this.parseString(expression)];
    }

    const arr = [];
    if (expression.elements)
      expression.elements.forEach(function(expr) {
        arr.push(this.parseString(expr));
      }, this);
    return arr;
  }

  parseCalculatedStringArray(expression) {
    if (expression.type !== 'ArrayExpression') {
      return [this.parseCalculatedString(expression)];
    }

    const arr = [];
    if (expression.elements)
      expression.elements.forEach(function(expr) {
        arr.push(this.parseCalculatedString(expr));
      }, this);
    return arr;
  }

  /*
  parse(source, initialState) {
    let ast;
    const comments = [];
    for (let i = 0, len = POSSIBLE_AST_OPTIONS.length; i < len; i++) {
      if (!ast) {
        try {
          comments.length = 0;
          POSSIBLE_AST_OPTIONS[i].onComment = comments;
          ast = acorn.parse(source, POSSIBLE_AST_OPTIONS[i]);
        } catch (e) {
          // ignore the error
        }
      }
    }
    if (!ast) {
      // for the error
      ast = acorn.parse(source, {
        ranges: true,
        locations: true,
        ecmaVersion: ECMA_VERSION,
        sourceType: 'module',
        plugins: {
          dynamicImport: true
        },
        onComment: comments
      });
    }
    if (!ast || typeof ast !== 'object') throw new Error("Source couldn't be parsed");
    const oldScope = this.scope;
    const oldState = this.state;
    const oldComments = this.comments;
    this.scope = {
      inTry: false,
      definitions: [],
      renames: {}
    };
    const state = (this.state = initialState || {});
    this.comments = comments;
    if (this.applyPluginsBailResult('program', ast, comments) === undefined) {
      this.prewalkStatements(ast.body);
      this.walkStatements(ast.body);
    }
    this.scope = oldScope;
    this.state = oldState;
    this.comments = oldComments;
    return state;
  } */

  /*
  evaluate(source) {
    const ast = acorn.parse('(' + source + ')', {
      ranges: true,
      locations: true,
      ecmaVersion: ECMA_VERSION,
      sourceType: 'module',
      plugins: {
        dynamicImport: true
      }
    });
    if (!ast || typeof ast !== 'object' || ast.type !== 'Program')
      throw new Error("evaluate: Source couldn't be parsed");
    if (ast.body.length !== 1 || ast.body[0].type !== 'ExpressionStatement')
      throw new Error('evaluate: Source is not a expression');
    return this.evaluateExpression(ast.body[0].expression);
  }

  getComments(range) {
    return this.comments.filter(comment => comment.range[0] >= range[0] && comment.range[1] <= range[1]);
  }

  getCommentOptions(range) {
    const comments = this.getComments(range);
    if (comments.length === 0) return null;
    const options = comments.map(comment => {
      try {
        return json5.parse(`{${comment.value}}`);
      } catch (e) {
        return {};
      }
    });
    return options.reduce((o, i) => Object.assign(o, i), {});
  }
  */

  getNameForExpression(expression) {
    let expr = expression;
    const exprName = [];
    while (expr.type === 'MemberExpression' && expr.property.type === (expr.computed ? 'Literal' : 'Identifier')) {
      exprName.push(expr.computed ? expr.property.value : expr.property.name);
      expr = expr.object;
    }
    let free;
    if (expr.type === 'Identifier') {
      free = this.scope.definitions.indexOf(expr.name) === -1;
      exprName.push(this.scope.renames['$' + expr.name] || expr.name);
    } else if (expr.type === 'ThisExpression' && this.scope.renames.$this) {
      free = true;
      exprName.push(this.scope.renames.$this);
    } else if (expr.type === 'ThisExpression') {
      free = false;
      exprName.push('this');
    } else {
      return null;
    }
    let prefix = '';
    for (let i = exprName.length - 1; i >= 1; i--) prefix += exprName[i] + '.';
    const name = prefix + exprName[0];
    const nameGeneral = prefix + '*';
    return {
      name,
      nameGeneral,
      instance: prefix.substring(0, prefix.length - 1),
      callee: exprName[0],
      free
    };
  }

  // Plugins
  evaluateMemberExpression(expression) {
    let exprName = this.getNameForExpression(expression);
    if (exprName) {
      if (exprName.free) {
        let fn = `evaluateIdentifier${exprName.name}`;
        let rst;
        if (this[fn]) {
          rst = this[fn](expression);
        }
        return rst
          ? rst
          : {
              identifier: exprName.name,
              range: expression.range
            };
        // const result = this.applyPluginsBailResult1("evaluate Identifier " + exprName.name, expression);
        // if(result) return result;
        // return new BasicEvaluatedExpression().setIdentifier(exprName.name).setRange(expression.range);
      } else {
        let fn = `evaluatedefinedIdentifier${exprName.name}`;
        let rst;
        if (this[fn]) {
          rst = this[fn](expression);
        }
        return rst;
        // return this.applyPluginsBailResult1("evaluate defined Identifier " + exprName.name, expression);
      }
    }
  }

  evaluateIdentifier(expr) {
    const name = this.scope.renames['$' + expr.name] || expr.name;
    if (this.scope.definitions.indexOf(expr.name) === -1) {
      let fn = `evaluateIdentifier${name}`;
      let rst;
      if (this[fn]) {
        rst = this[fn](expr);
      }
      return rst
        ? rst
        : {
            identifier: name,
            range: expr.range
          };
      // const result = this.applyPluginsBailResult1("evaluate Identifier " + exprName.name, expr);
      // if(result) return result;
      // return new BasicEvaluatedexpr().setIdentifier(exprName.name).setRange(expr.range);
    } else {
      let fn = `evaluatedefinedIdentifier${name}`;
      let rst;
      if (this[fn]) {
        rst = this[fn](expr);
      }
      return rst;
      // return this.applyPluginsBailResult1("evaluate defined Identifier " + exprName.name, expression);
    }
  }
  applyMethods(method, expr) {
    let rst;
    if (this[method]) {
      rst = this[method](expr);
    }
    return rst;
  }
  /*
  callrequire (expr) {
    // support for browserify style require delegator: "require(o, !0)"
    if(expr.arguments.length !== 2) return;
    const second = this.evaluateExpression(expr.arguments[1]);
    if(!second.isBoolean()) return;
    if(second.asBool() !== true) return;
    // const dep = new ConstDependency("require", expr.callee.range);
    const demp = {
      expression: 'require',
      range: expr.callee.range
    };
    dep.loc = expr.loc;
    if(this.state.current.dependencies.length > 1) {
      const last = this.state.current.dependencies[this.state.current.dependencies.length - 1];
      if(last.critical && last.request === "." && last.userRequest === "." && last.recursive)
        this.state.current.dependencies.pop();
    }
    this.state.current.addDependency(dep);
    return true;
  }*/
  callrequire(expr) {
    let param;
    let dep;
    let result;

    const old = this.state.current;

    if (expr.arguments.length >= 1) {
      param = this.evaluateExpression(expr.arguments[0]);
      dep = {
        expr: expr,
        outerRange: param.range,
        arrayRange: expr.arguments.length > 1 ? expr.arguments[1].range : null,
        functionRange: expr.arguments.length > 2 ? expr.arguments[2].range : null,
        errorCallbackRange: this.state.module,
        module: expr.arguments[0].type === 'Literal' ? expr.arguments[0].value : '',
        loc: expr.loc
      };
      /*
      dep = new AMDRequireDependenciesBlock(
        expr,
        param.range,
        (expr.arguments.length > 1) ? expr.arguments[1].range : null,
        (expr.arguments.length > 2) ? expr.arguments[2].range : null,
        this.state.module,
        expr.loc
      );*/
      this.deps.push(dep);
      this.state.current = dep;
    }

    if (expr.arguments.length === 1) {
      this.inScope([], () => {
        let fn = `callrequireAmdArray`;
        result = this[fn] ? this[fn](expr, param) : undefined;
        // result = this.applyPluginsBailResult("call require:amd:array", expr, param);
      });
      this.state.current = old;
      if (!result) return;
      // this.state.current.addBlock(dep);
      return true;
    }

    if (expr.arguments.length === 2 || expr.arguments.length === 3) {
      try {
        this.inScope([], () => {
          let fn = `callrequireAmdArray`;
          result = this[fn] ? this[fn](expr, param) : undefined;
          // result = this.applyPluginsBailResult("call require:amd:array", expr, param);
        });
        /*
        if (!result) {
          dep = new UnsupportedDependency('unsupported', expr.range);
          old.addDependency(dep);
          if (this.state.module)
            this.state.module.errors.push(
              new UnsupportedFeatureWarning(
                this.state.module,
                'Cannot statically analyse \'require(..., ...)\' in line ' + expr.loc.start.line
              )
            );
          dep = null;
          return true;
        }
        dep.functionBindThis = this.processFunctionArgument(parser, expr.arguments[1]);
        if (expr.arguments.length === 3) {
          dep.errorCallbackBindThis = this.processFunctionArgument(parser, expr.arguments[2]);
        }*/
      } finally {
        this.state.current = old;
        if (dep) this.state.current.addBlock(dep);
      }
      return true;
    }
  }

  callrequireAmdArray(expr, param) {
    // if(param.isArray()) {
    if (param.items && param.items.forEach) {
      param.items.forEach(param => {
        let result;
        let fn = `callrequireAmdItem`;
        if (this[fn]) {
          result = this[fn](expr, param);
        }
        // const result = this.applyPluginsBailResult("call require:amd:item", expr, param);
        if (result === undefined) {
          let fn = `callrequireAmdContext`;
          if (this[fn]) {
            this[fn](expr, param);
          }
          // this.applyPluginsBailResult("call require:amd:context", expr, param);
        }
      });
      return true;
      // } else if(param.isConstArray()) {
    } else if (param.array && param.array.length) {
      const deps = [];
      param.array.forEach(request => {
        let dep /*, localModule*/;
        if (request === 'require') {
          dep = '__webpack_require__';
        } else if (['exports', 'module'].indexOf(request) >= 0) {
          dep = request;
        } /*else if ((localModule = LocalModulesHelpers.getLocalModule(this.state, request))) {
          // eslint-disable-line no-cond-assign
          dep = new LocalModuleDependency(localModule);
          dep.loc = expr.loc;
          this.state.current.addDependency(dep);
        } else {
          dep = new AMDRequireItemDependency(request);
          dep.loc = expr.loc;
          dep.optional = !!this.scope.inTry;
          this.state.current.addDependency(dep);
        }*/
        deps.push(dep);
      });
      // const dep = new AMDRequireArrayDependency(deps, param.range);
      const dep = {
        // depsArray: depsArray,
        range: param.range
      };
      dep.loc = expr.loc;
      dep.optional = !!this.scope.inTry;
      // this.state.current.addDependency(dep);
      return true;
    }
  }

  callrequireAmdItem(expr, param) {
    if (param.isConditional()) {
      param.options.forEach(param => {
        let fn = 'callrequireAmdItem';
        const result = this[fn] ? this[fn](expr, param) : undefined;
        // const result = this.applyPluginsBailResult("call require:amd:item", expr, param);
        if (result === undefined) {
          let fn = 'callrequireAmdContext';
          if (this[fn]) {
            this[fn](expr, param);
          }
          this.applyPluginsBailResult('call require:amd:context', expr, param);
        }
      });
      return true;
    } else if (param.isString()) {
      /*
      let dep, localModule;
      if (param.string === 'require') {
        dep = new ConstDependency('__webpack_require__', param.string);
      } else if (param.string === 'module') {
        dep = new ConstDependency(this.state.module.moduleArgument || 'module', param.range);
      } else if (param.string === 'exports') {
        dep = new ConstDependency(this.state.module.exportsArgument || 'exports', param.range);
      } else if ((localModule = LocalModulesHelpers.getLocalModule(this.state, param.string))) {
        // eslint-disable-line no-cond-assign
        dep = new LocalModuleDependency(localModule, param.range);
      } else {
        dep = new AMDRequireItemDependency(param.string, param.range);
      }
      dep.loc = expr.loc;
      dep.optional = !!this.scope.inTry;
      this.state.current.addDependency(dep);
      */
      return true;
    }
  }

  callrequireAmdContext(/*expr, param*/) {
    /*
    const dep = ContextDependencyHelpers.create(AMDRequireContextDependency, param.range, param, expr, options);
    if (!dep) return;
    dep.loc = expr.loc;
    dep.optional = !!this.scope.inTry;
    this.state.current.addDependency(dep);
    */
    return true;
  }
}

exports = module.exports = AstWalker;


================================================
FILE: packages/cli/core/ast/wxml.js
================================================
const htmlparser = require('htmlparser2');

const walk = function(ast, opt) {
  let { type, name, attr } = opt;
  ast.forEach(item => {
    if (type && typeof type[item.type] === 'function') {
      type[item.type].call(null, item);
    }
    if (name && typeof name[item.name] === 'function') {
      name[item.name].call(null, item);
    }
    if (attr && item.attribs) {
      for (let key in item.attribs) {
        if (attr[key] && typeof attr[key] === 'function') {
          attr[key].call(null, item, attr, item.attribs[key]);
        }
      }
    }
  });
};

const generate = function(ast) {
  let str = '';
  if (!Array.isArray(ast)) {
    ast = [ast];
  }

  ast.forEach(item => {
    if (item.type === 'text') {
      str += item.data;
    } else if (item.type === 'tag') {
      str += '<' + item.name;
      if (item.attribs) {
        Object.keys(item.attribs).forEach(attr => {
          if (item.attribs[attr] !== undefined)
            str += item.attribs[attr] === true ? ` ${attr}` : ` ${attr}="${item.attribs[attr]}"`;
        });
      }
      str += '>';
      if (item.children && item.children.length) {
        str += generate(item.children);
      }
      str += `</${item.name}>`;
    }
  });
  return str;
};

module.exports = function ast(html) {
  return new Promise((resolve, reject) => {
    const handler = new htmlparser.DomHandler(
      function(error, dom) {
        if (error) {
          reject(error);
        } else {
          resolve(dom);
        }
      },
      { withStartIndices: true, withEndIndices: true }
    );
    const parser = new htmlparser.Parser(handler, { xmlMode: true });
    parser.write(html);
    parser.end();
  });
};

module.exports.walk = walk;
module.exports.generate = generate;


================================================
FILE: packages/cli/core/compile.js
================================================
/**
 * Tencent is pleased to support the open source community by making WePY available.
 * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
 *
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 */
const fs = require('fs-extra');
const path = require('path');
const chokidar = require('chokidar');
const ResolverFactory = require('enhanced-resolve').ResolverFactory;
const node = require('enhanced-resolve/lib/node');
const NodeJsInputFileSystem = require('enhanced-resolve/lib/NodeJsInputFileSystem');
const CachedInputFileSystem = require('enhanced-resolve/lib/CachedInputFileSystem');
const parseOptions = require('./parseOptions');
const moduleSet = require('./moduleSet');
const fileDep = require('./fileDep');
const logger = require('./util/logger');
const VENDOR_DIR = require('./util/const').VENDOR_DIR;
const Hook = require('./hook');
const tag = require('./tag');
const { isArr } = require('./util/tools');
const { debounce } = require('throttle-debounce');

const initCompiler = require('./init/compiler');
const initParser = require('./init/parser');
const initPlugin = require('./init/plugin');

class Compile extends Hook {
  constructor(opt) {
    super();
    let self = this;

    this.version = require('../package.json').version;
    this.options = opt;

    if (!path.isAbsolute(opt.entry)) {
      this.options.entry = path.resolve(path.join(opt.src, opt.entry + opt.wpyExt));
    }

    this.resolvers = {};
    this.running = false;

    this.context = process.cwd();

    let appConfig = opt.appConfig || {};
    let userDefinedTags = appConfig.tags || {};

    this.tags = {
      htmlTags: tag.combineTag(tag.HTML_TAGS, userDefinedTags.htmlTags),
      wxmlTags: tag.combineTag(tag.WXML_TAGS, userDefinedTags.wxmlTags),
      selfCloseTags: tag.SELF_CLOSE_TAGS,
      html2wxmlMap: tag.combineTagMap(tag.HTML2WXML_MAP, userDefinedTags.html2wxmlMap)
    };

    this.logger = logger;

    this.inputFileSystem = new CachedInputFileSystem(new NodeJsInputFileSystem(), 60000);

    this.options.resolve.extensions = ['.js', '.ts', '.json', '.node', '.wxs', this.options.wpyExt];

    this.resolvers.normal = ResolverFactory.createResolver(
      Object.assign(
        {
          fileSystem: this.inputFileSystem
        },
        this.options.resolve
      )
    );

    this.resolvers.context = ResolverFactory.createResolver(
      Object.assign(
        {
          fileSystem: this.inputFileSystem,
          resolveToContext: true
        },
        this.options.resolve
      )
    );

    this.resolvers.normal.resolveSync = node.create.sync(
      Object.assign(
        {
          fileSystem: this.inputFileSystem
        },
        this.options.resolve
      )
    );

    this.resolvers.context.resolveSync = node.create.sync(
      Object.assign(
        {
          fileSystem: this.inputFileSystem,
          resolveToContext: true
        },
        this.options.resolve
      )
    );

    let fnNormalBak = this.resolvers.normal.resolve;
    this.resolvers.normal.resolve = function(...args) {
      return new Promise((resolve, reject) => {
        args.push(function(err, filepath, meta) {
          if (err) {
            reject(err);
          } else {
            resolve({ path: filepath, meta: meta });
          }
        });
        fnNormalBak.apply(self.resolvers.normal, args);
      });
    };
    let fnContextBak = this.resolvers.context.resolve;
    this.resolvers.context.resolve = function(...args) {
      return new Promise((resolve, reject) => {
        args.push(function(err, filepath, meta) {
          if (err) {
            reject(err);
          } else {
            resolve({ path: filepath, meta: meta });
          }
        });
        fnContextBak.apply(self.resolvers.context, args);
      });
    };
  }

  clear(type) {
    this.hook('process-clear', type);
    return this;
  }

  run() {
    return this.init().then(() => this.start());
  }

  init() {
    this.register('process-clear', () => {
      this.compiled = {};
      this.vendors = new moduleSet();
      this.assets = new moduleSet();
      this.fileDep = new fileDep();
    });

    ['output-app', 'output-pages', 'output-components'].forEach(k => {
      this.register(k, data => {
        if (!isArr(data)) data = [data];

        data.forEach(v => this.output('wpy', v));
      });
    });

    this.register('output-vendor', data => {
      this.output('vendor', data);
    });

    this.register('output-assets', list => {
      list.forEach(file => {
        this.output('assets', file);
      });
    });

    this.register('output-static', () => {
      let paths = this.options.static;
      let copy = p => {
        let relative = path.relative(path.join(this.context, this.options.src), path.join(this.context, p));
        const target = path.join(this.context, p);
        if (fs.existsSync(target)) {
          const dest = path.join(this.context, this.options.output, relative[0] === '.' ? p : relative);
          return fs.copy(target, dest);
        }
        return Promise.resolve(true);
      };
      if (typeof paths === 'string') return copy(paths);
      else if (isArr(paths)) return Promise.all(paths.map(p => copy(p)));
    });

    initParser(this);
    initPlugin(this);

    this.hook('process-clear', 'init');

    return initCompiler(this, this.options.compilers);
  }

  start() {
    if (this.running) {
      return;
    }

    this.running = true;
    this.logger.info('build app', 'start...');

    this.hookUnique('wepy-parser-wpy', { path: this.options.entry, type: 'app' })
      .then(app => {
        let sfc = app.sfc;
        let config = sfc.config;

        let appConfig = config.parsed.output;
        if (!appConfig.pages || appConfig.pages.length === 0) {
          appConfig.pages = [];
          this.hookUnique('error-handler', {
            type: 'warn',
            ctx: app,
            message: `Missing "pages" in App config`
          });
        }
        let pages = appConfig.pages.map(v => {
          return path.resolve(app.file, '..', v);
        });

        if (appConfig.subPackages || appConfig.subpackages) {
          (appConfig.subpackages || appConfig.subPackages).forEach(sub => {
            // Wepy don't support independent subPackages now
            if (sub.independent) {
              this.logger.warn(
                'Independent subpackages is found in app config. Currently, it is not supported in WePY.'
              );
              throw new Error('EXIT');
            }

            sub.pages.forEach(v => {
              pages.push(path.resolve(app.file, '../' + sub.root || '', v));
            });
          });
        }

        let pageTasks = pages.map(v => {
          let file;

          file = v + this.options.wpyExt;
          if (fs.existsSync(file)) {
            return this.hookUnique('wepy-parser-wpy', { path: file, type: 'page' });
          }
          file = v + '.js';
          if (fs.existsSync(file)) {
            return this.hookUnique('wepy-parser-component', { path: file, type: 'page', npm: false });
          }
          this.hookUnique('error-handler', {
            type: 'error',
            ctx: app,
            message: `Can not resolve page: ${v}`
          });
        });

        let components = [];
        if (appConfig.usingComponents) {
          for (let key in appConfig.usingComponents) {
            let v = appConfig.usingComponents[key];
            components.push(path.resolve(app.file, '../', v));
          }
        }

        let componentsTask = components.map(v => {
          let file;

          file = v + this.options.wpyExt;
          if (fs.existsSync(file)) {
            return this.hookUnique('wepy-parser-wpy', { path: file, type: 'wepy' });
          }
          file = v + '.js';
          if (fs.existsSync(file)) {
            return this.hookUnique('wepy-parser-component', { path: file, type: 'wepy', npm: false });
          }
          this.hookUnique('error-handler', {
            type: 'error',
            ctx: app,
            message: `Can not resolve page: ${v}`
          });
        });

        let tasks = [...pageTasks, ...componentsTask];
        if (appConfig.tabBar && appConfig.tabBar.custom) {
          let file = path.resolve(app.file, '..', 'custom-tab-bar/index' + this.options.wpyExt);
          if (fs.existsSync(file)) {
            tasks.push(this.hookUnique('wepy-parser-wpy', { path: file, type: 'wepy' }));
          }
        }

        this.hookSeq('build-app', app);
        this.hookUnique('output-app', app);
        return Promise.all(tasks);
      })
      .then(this.buildComps.bind(this))
      .catch(this.handleBuildErr.bind(this));
  }

  buildComps(comps) {
    let components = [];
    let originalComponents = [];

    function buildComponents(comps) {
      if (!comps) {
        return Promise.resolve();
      }
      this.hookSeq('build-components', comps);
      this.hookUnique('output-components', comps);

      let tasks = [];

      comps.forEach(comp => {
        let config = comp.sfc.config || {};
        let parsed = config.parsed || {};
        let parsedComponents = parsed.components || [];

        parsedComponents.forEach(com => {
          if (com.type === 'wepy' && !components.includes(com.path)) {
            // wepy 组件
            tasks.push(this.hookUnique('wepy-parser-wpy', com));
            components.push(com.path);
          } else if (com.type === 'weapp' && !originalComponents.includes(com.path)) {
            // 原生组件
            tasks.push(this.hookUnique('wepy-parser-component', com));
            originalComponents.push(com.path);
          }
        });
      });

      if (tasks.length) {
        return Promise.all(tasks).then(buildComponents.bind(this));
      } else {
        return Promise.resolve();
      }
    }

    return buildComponents
      .bind(this)(comps)
      .then(() => {
        let vendorData = this.hookSeq('build-vendor', {});
        this.hookUnique('output-vendor', vendorData);
      })
      .then(() => {
        let assetsData = this.hookSeq('build-assets');
        this.hookUnique('output-assets', assetsData);
      })
      .then(() => {
        return this.hookUnique('output-static');
      })
      .then(() => {
        this.hookSeq('process-done');
        this.running = false;
        this.logger.info('build', 'finished');
        if (this.options.watch) {
          this.logger.info('watching...');
          this.watch();
        }
      });
  }

  weappBuild(buildTask) {
    if (this.running) {
      return;
    }
    this.running = true;
    this.logger.info('build weapp files', 'start...');

    const tasks = buildTask.files.map(file => {
      const comp = this.compiled[file];

      return this.hookUnique('wepy-parser-component', comp);
    });

    Promise.all(tasks)
      .then(this.buildComps.bind(this))
      .catch(this.handleBuildErr.bind(this));
  }

  partialBuild(buildTask) {
    if (this.running) {
      return;
    }
    this.running = true;
    this.logger.info('build wpy files', 'start...');

    // just compile these files of wpyExt
    const tasks = buildTask.files.map(file => {
      if (fs.existsSync(file)) {
        let type = 'page';
        if (this.compiled[file]) {
          type = this.compiled[file].type;
        }
        return this.hookUnique('wepy-parser-wpy', { path: file, type });
      }
      this.hookUnique('error-handler', {
        type: 'error',
        ctx: {},
        message: `Can not resolve page: ${file}`
      });
    });

    Promise.all(tasks)
      .then(this.buildComps.bind(this))
      .catch(this.handleBuildErr.bind(this));
  }

  assetsBuild(buildTask) {
    if (this.running) {
      return;
    }
    this.running = true;
    this.logger.info('build ' + buildTask.assetExt + ' files', 'start...');

    const tasks = buildTask.files.map(file => {
      const ctx = this.compiled[file];
      return this.hookUnique('wepy-parser-file', {}, ctx);
    });

    // just compile, build and out assets
    Promise.all(tasks)
      .then(() => {
        return this.buildComps(undefined);
      })
      .catch(this.handleBuildErr.bind(this));
  }

  handleBuildErr(err) {
    this.running = false;
    if (err.message !== 'EXIT') {
      this.logger.error(err);
    }
    if (this.logger.level() !== 'trace') {
      this.logger.error('compile', 'Compile failed. Add "--log trace" to see more details');
    } else {
      this.logger.error('compile', 'Compile failed.');
    }
    if (this.options.watch) {
      this.logger.info('watching...');
      this.watch();
    }
  }

  watch() {
    if (this.watchInitialized) {
      return;
    }
    this.watchInitialized = true;
    let watchOption = Object.assign({ ignoreInitial: true, depth: 99 }, this.options.watchOption || {});
    // let target = path.resolve(this.context, this.options.target);

    if (watchOption.ignore) {
      let type = Object.prototype.toString.call(watchOption.ignore);
      if (type === '[object String]' || type === '[object RegExp]') {
        watchOption.ignored = [watchOption.ignored];
        watchOption.ignored.push(this.options.target);
      } else if (type === '[object Array]') {
        watchOption.ignored.push(this.options.target);
      }
    } else {
      watchOption.ignored = [this.options.target];
    }

    const pendingFiles = [];

    // debounce for watch files
    const onFileChanged = debounce(300, () => {
      const changedFiles = pendingFiles.splice(0, pendingFiles.length);
      if (changedFiles.length > 1) {
        // if more then one files changed, build the whole app.
        this.start();
      } else {
        let buildTask = {
          changed: changedFiles[0],
          partial: true,
          files: [],
          outputAssets: false
        };
        this.hookAsyncSeq('before-wepy-watch-file-changed', buildTask).then(task => {
          if (task.weapp && task.files.length > 0) {
            this.weappBuild(buildTask);
          } else if (task.outputAssets && task.files.length > 0) {
            this.assetsBuild(buildTask);
          } else if (task.partial && task.files.length > 0) {
            this.partialBuild(buildTask);
          } else {
            this.start();
          }
        });
      }
    });

    chokidar.watch([this.options.src], watchOption).on('all', (evt, filepath) => {
      if (evt === 'change') {
        const file = path.resolve(filepath);
        if (!pendingFiles.includes(file)) {
          pendingFiles.push(file);
        }
        onFileChanged();
      }
    });
  }

  applyCompiler(node, ctx) {
    ctx.id = this.assets.add(ctx.file);

    if (node.lang) {
      let hookKey = 'wepy-compiler-' + node.lang;

      if (!this.hasHook(hookKey)) {
        throw `Missing plugins ${hookKey}`;
      }

      let task;

      // If file is not changed, and compiled cache exsit.
      // Style may have dependences, maybe the dependences file changed. so ignore the cache for the style who have deps.
      if (ctx.useCache && node.compiled && (node.compiled.dep || []).length === 0) {
        task = Promise.resolve(node);
      } else {
        task = this.hookUnique(hookKey, node, ctx);
      }
      return task
        .then(node => {
          return this.hookAsyncSeq('before-wepy-parser-' + node.type, { node, ctx });
        })
        .then(({ node, ctx }) => {
          return this.hookUnique('wepy-parser-' + node.type, node, ctx);
        });
    }
  }

  getTarget(file, targetDir) {
    let relative = path.relative(path.join(this.context, this.options.src), file);
    let targetFile = path.join(this.context, targetDir || this.options.target, relative);
    return targetFile;
  }

  getModuleTarget(file, targetDir) {
    let relative = path.relative(this.context, file);
    let dirs = relative.split(path.sep);
    dirs.shift(); // shift node_modules
    relative = dirs.join(path.sep);
    let targetFile = path.join(this.context, targetDir || this.options.target, VENDOR_DIR, relative);
    return targetFile;
  }

  outputFile(filename, code, encoding) {
    this.hookAsyncSeq('output-file', { filename, code, encoding })
      .then(({ filename, code, encoding }) => {
        if (!code) {
          logger.silly('output', 'empty content: ' + filename);
        } else {
          logger.silly('output', 'write file: ' + filename);

          fs.outputFile(filename, code, encoding || 'utf-8', err => {
            if (err) {
              // eslint-disable-next-line no-console
              console.log(err);
            }
          });
        }
      })
      .catch(e => {
        if (e.handler) {
          this.hookUnique('error-handler', e.handler, e.error, e.pos);
        } else {
          // TODO
          throw e;
        }
      });
  }

  output(type, item) {
    let filename, code, encoding;

    if (type === 'wpy') {
      const sfc = item.sfc;
      const outputMap = {
        script: 'js',
        styles: 'wxss',
        config: 'json',
        template: 'wxml'
      };

      Object.keys(outputMap).forEach(k => {
        if (sfc[k] && sfc[k].outputCode) {
          filename = item.outputFile + '.' + outputMap[k];
          code = sfc[k].outputCode;

          this.outputFile(filename, code, encoding);
        }
      });
    } else {
      filename = item.targetFile;
      code = item.outputCode;
      encoding = item.encoding;

      this.outputFile(filename, code, encoding);
    }
  }
}

exports = module.exports = program => {
  const opt = parseOptions.parse(program);

  const compilation = new Compile(opt);

  return compilation;
};


================================================
FILE: packages/cli/core/fileDep.js
================================================
class FileDep {
  constructor() {
    this._depMap = {};
    this._depedMap = {};
  }

  cleanDeps(source) {
    const deps = this._depMap[source] || [];
    deps.forEach(dep => {
      const depeds = this._depedMap[dep] || [];
      if (depeds.length > 0) {
        this._depedMap[dep] = depeds.filter(deped => deped !== source);
        if (this._depedMap[dep].length === 0) {
          delete this._depedMap[dep];
        }
      }
    });
    delete this._depMap[source];
  }

  addDeps(source, deps = []) {
    if (!this._depMap[source]) {
      this._depMap[source] = [];
    }
    deps.forEach(dep => {
      if (!this._depMap[source].includes(dep)) {
        this._depMap[source].push(dep);
        if (!this._depedMap[dep]) {
          this._depedMap[dep] = [];
        }
        this._depedMap[dep].push(source);
      }
    });
  }

  getDeps(source) {
    return this._depMap[source] || [];
  }

  getSources(dep) {
    return this._depedMap[dep] || [];
  }

  isInvolved(file) {
    return this._depMap.hasOwnProperty(file) || this._depedMap.hasOwnProperty(file);
  }
}

exports = module.exports = FileDep;


================================================
FILE: packages/cli/core/hook.js
================================================
class Hook {
  constructor() {
    this._hooks = {};
  }

  register(key, fn) {
    if (!this._hooks[key]) {
      this._hooks[key] = [];
    }
    this._hooks[key].push(fn);

    return () => {
      this.unregister(key, fn);
    };
  }

  hasHook(key) {
    return (this._hooks[key] || []).length > 0;
  }

  hook(key, ...args) {
    let rst = [];
    let fns = this._hooks[key] || [];
    fns.forEach(fn => {
      typeof fn === 'function' && rst.push(fn.apply(this, args));
    });
    return rst;
  }

  hookSeq(key, ...args) {
    let rst = args;
    let fns = this._hooks[key] || [];
    let hasHook = false;

    fns.forEach((fn, i) => {
      if (typeof fn === 'function') {
        hasHook = true;
        if (fn.length > 1) {
          rst = fn.apply(this, rst);
        } else {
          rst = fn.call(this, i === 0 ? rst[0] : rst);
        }
      }
    });

    return hasHook ? rst : rst.length <= 1 ? rst[0] : rst;
  }

  hookUnique(key, ...args) {
    let fns = this._hooks[key] || [];
    let lastFn = fns[fns.length - 1];

    if (typeof lastFn === 'function') {
      return lastFn.apply(this, args);
    }
  }

  hookUniqueReturnArg(key, ...args) {
    let rst = this.hookUnique(key, ...args);
    if (typeof rst === 'undefined') {
      rst = args.length <= 1 ? args[0] : args;
    }
    return rst;
  }

  hookAsyncSeq(key, ...args) {
    // if hook registered, return last rst, else return args
    let rst = args;
    let fns = this._hooks[key] || [];
    let lastRst = rst;
    let argLength = args.length;

    if (fns.length === 0) {
      return Promise.resolve(argLength === 1 ? args[0] : args);
    }

    const iterateFunc = (pfn, cfn) => {
      return pfn.then(v => {
        if (!Array.isArray(v)) {
          v = [v];
        }
        lastRst = v;
        return cfn.apply(this, lastRst);
      });
    };

    fns = fns.concat((...lastRst) => Promise.resolve(argLength === 1 ? lastRst[0] : lastRst));

    return fns.reduce(iterateFunc, Promise.resolve(args));
  }

  hookReturnOrigin(key, ...args) {
    let fns = this._hooks[key] || [];
    fns.forEach(fn => {
      typeof fn === 'function' && fn.apply(this, args);
    });
    return args.length <= 1 ? args[0] : args;
  }

  unregister(key, fn) {
    let fns = this._hooks[key];
    if (fns && typeof fn === 'function') {
      fns = fns.filter(f => f !== fn);
      if (fns.length > 0) {
        this._hooks[key] = fns;
      } else {
        delete this._hooks[key];
      }
    }
  }

  unregisterAll(key) {
    delete this._hooks[key];
  }
}

exports = module.exports = Hook;


================================================
FILE: packages/cli/core/init/compiler.js
================================================
exports = module.exports = function initCompiler(ins, compilers = {}) {
  let init = Object.keys(compilers).map(c => {
    let module;
    let moduleName = `@wepy/compiler-${c}`;
    return ins.resolvers.context
      .resolve({}, ins.context, moduleName, {})
      .then(rst => {
        try {
          module = require(rst.path);
        } catch (e) {
          ins.logger.error('init', `Failed to load model "${moduleName}"`);
          ins.logger.error('init', e);
        }
        module && module(compilers[c]).call(ins);
        return module;
      })
      .catch(e => {
        ins.logger.error(
          'init',
          `Make sure module "${moduleName}" is installed. If not please try "npm install ${moduleName} --save-dev".`
        );
        ins.logger.error('init', e);
      });
  });
  return Promise.all(init).then(compilers => {
    if (compilers.some(c => !c)) {
      throw new Error('Initialize failed');
    }
    return true;
  });
};


================================================
FILE: packages/cli/core/init/parser.js
================================================
exports = module.exports = function initParser(ins) {
  ['wpy', 'script', 'style', 'template', 'config', 'component', 'wxs', 'file'].forEach(k => {
    require('../plugins/parser/' + k).call(ins);
  });
};


================================================
FILE: packages/cli/core/init/plugin.js
================================================
const { isArr, isFunc } = require('../util/tools');

function checkPlugins(ins, plugins) {
  if (!isArr(plugins)) {
    plugins = [plugins];
  }
  plugins.forEach(plg => {
    // ensure plugin is a function
    // or process would be exit
    if (!isFunc(plg)) {
      ins.logger.error(
        'init',
        'Plugins init error, plugin must be a function.\n' + 'Please check your plugin in wepy.config.js file'
      );
      throw new Error('EXIT');
    }
  });

  return plugins;
}

exports = module.exports = function(ins) {
  // system plugins
  [
    './../plugins/scriptDepFix',
    './../plugins/scriptInjection',
    './../plugins/build/app',
    './../plugins/build/pages',
    './../plugins/build/components',
    './../plugins/build/vendor',
    './../plugins/build/assets',

    './../plugins/template/parse',

    './../plugins/template/attrs',
    './../plugins/template/directives',

    './../plugins/helper/supportSrc',
    './../plugins/helper/sfcCustomBlock',
    './../plugins/helper/generateCodeFrame',
    './../plugins/helper/errorHandler',

    './../plugins/compiler/index'
  ].map(v => require(v).call(ins));
  // check custom plugins
  const customPluginFns = checkPlugins(ins, ins.options.plugins);

  customPluginFns.map(fn => fn.call(ins));
};


================================================
FILE: packages/cli/core/loader.js
================================================
/**
 * Tencent is pleased to support the open source community by making WePY available.
 * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
 *
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 */

const Module = require('module');
const path = require('path');
const logger = require('./util/logger');

let relativeModules = {};
let requiredModules = {};

let loadedPlugins = [];

class PluginHelper {
  constructor(plugins, op) {
    this.applyPlugin(0, op);
    return true;
  }
  applyPlugin(index, op) {
    let plg = loadedPlugins[index];

    if (!plg) {
      op.done && op.done(op);
    } else {
      op.next = () => {
        this.applyPlugin(index + 1, op);
      };
      op.catch = () => {
        op.error && op.error(op);
      };
      if (plg) plg.apply(op);
    }
  }
}

exports = module.exports = {
  attach(resolve) {
    this.resolve = resolve;
  },
  loadCompiler(lang) {
    if (['wxml', 'xml', 'css', 'js'].indexOf(lang) > -1) {
      return c => {
        return Promise.resolve(c);
      };
    }

    let name = 'wepy-compiler-' + lang;
    let compiler = this.load(name);

    if (!compiler) {
      this.missingNPM = name;
      logger.warn('loader', `Missing compiler: ${name}.`);
    }
    return compiler;
  },

  getNodeModulePath(loc, relative) {
    relative = relative || process.cwd();
    if (typeof Module === 'object') return null;

    let relativeMod = relativeModules[relative];
    let paths = [];

    if (!relativeMod) {
      relativeMod = new Module();

      let filename = path.join(relative, './');
      relativeMod.id = filename;
      relativeMod.filename = filename;
      relativeMod.paths = [].concat(this.resolve.modulePaths);

      paths = Module._nodeModulePaths(relative);
      relativeModules[relative] = relativeMod;
    }
    paths.forEach(v => {
      if (relativeMod.paths.indexOf(v) === -1) {
        relativeMod.paths.push(v);
      }
    });
    try {
      return Module._resolveFilename(loc, relativeMod);
    } catch (err) {
      return null;
    }
  },
  load(loc, relative) {
    if (requiredModules[loc]) return requiredModules[loc];

    let modulePath = this.getNodeModulePath(loc, relative);
    let m = null;
    try {
      m = require(modulePath);
    } catch (e) {
      // eslint-disable-next-line no-console
      if (e.message !== 'missing path') console.log(e);
    }
    if (m) {
      m = m.default ? m.default : m;
      requiredModules[loc] = m;
    }
    return m;
  },

  loadPlugin(plugins) {
    let plg, plgkey, setting;
    for (plgkey in plugins) {
      let name = 'wepy-plugin-' + plgkey;
      setting = plugins[plgkey];
      plg = this.load(name);

      if (!plg) {
        this.missingNPM = name;
        logger.warn('loader', `Missing plugin: ${name}`);
        return false;
      }
      loadedPlugins.push(new plg(setting));
    }
    return true;
  },
  PluginHelper: PluginHelper
};


================================================
FILE: packages/cli/core/moduleSet.js
================================================
/**
 * Tencent is pleased to support the open source community by making WePY available.
 * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
 *
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 */

class ModuleSet {
  constructor() {
    this._index = -1;
    this._map = {};
    this._set = {};
    this._array = {};
    this._type = {};
  }

  add(file, type) {
    let id = this.get(file);

    if (id === undefined) {
      this._index++;
      this.length = this._index + 1;
      id = this._index;
      this._map[file] = id;
      this._array[id] = file;
      this._type[file] = type;
    }

    return id;
  }

  get(file) {
    return this._map[file];
  }

  pending(file) {
    return this.get(file) !== undefined && this._set[file] === undefined;
  }

  update(file, data, type) {
    if (!this.get(file)) {
      this.add(file, type);
    }
    this._set[file] = data;
    this._type[file] = type;
  }

  data(v) {
    if (typeof v === 'number') {
      return this._set[this._array[v]];
    } else {
      return this._set[v];
    }
  }

  array(type) {
    if (!type) {
      this._array.length = this.length;
      return Array.prototype.slice.apply(this._array);
    } else {
      return this.array().filter(file => this._type[file] === type);
    }
  }

  type(v) {
    if (typeof v === 'number') {
      return this._type[this._array[v]];
    } else {
      return this._type[v];
    }
  }
}

exports = module.exports = ModuleSet;


================================================
FILE: packages/cli/core/parseOptions.js
================================================
const path = require('path');
const fs = require('fs');

const DEFAULT_OPTIONS = {
  entry: { type: String, default: 'app' },
  src: { type: String, default: 'src' },
  target: { type: String, default: 'weapp' },
  static: { type: [String, Array], default: 'static' },
  output: { type: String, default: 'weapp' },
  platform: { type: String },
  wpyExt: { type: String, default: '.wpy' },
  eslint: { type: Boolean, default: true },
  cliLogs: { type: Boolean, default: false },
  watch: { type: Boolean, default: false },
  watchOption: { type: Object },
  noCache: { type: Boolean, default: false },
  'build.web': { type: Object },
  'build.web.htmlTemplate': { type: String },
  'build.web.htmlOutput': { type: String },
  'build.web.jsOutput': { type: String },
  'build.web.resolve': { type: Object, link: 'resolve' },
  resolve: { type: Object, default: {} },
  compilers: { type: Object },
  plugins: { type: Array, default: [] },
  appConfig: { type: Object },
  'appConfig.noPromiseAPI': { type: Array, default: [] }
};

const DEFAULT_CONFIG = path.resolve('wepy.config.js');

function setValue(obj, key, val) {
  let arr = key.split('.');
  let left = obj;
  for (let i = 0, l = arr.length; i < l; i++) {
    if (i === l - 1) {
      left[arr[i]] = val;
    } else {
      if (typeof left[arr[i]] !== 'object') {
        left[arr[i]] = {};
      }
      left = left[arr[i]];
    }
  }
  return obj;
}

function getValue(obj, key) {
  let arr = key.split('.');
  let left = obj;
  let rst;
  for (let i = 0, l = arr.length; i < l; i++) {
    if (i === l - 1) {
      rst = left[arr[i]];
    } else {
      if (typeof left[arr[i]] === 'undefined') {
        break;
      }
      left = left[arr[i]];
    }
  }
  return rst;
}

function check(t, val) {
  if (Array.isArray(t)) {
    return t.some(type => check(type, val));
  }
  switch (t) {
    case String:
      return typeof val === 'string';
    case Number:
      return typeof val === 'number';
    case Boolean:
      return typeof val === 'boolean';
    case Function:
      return typeof val === 'function';
    case Object:
      return typeof val === 'object';
    case Array:
      return toString.call(val) === '[object Array]';
    default:
      return val instanceof t;
  }
}

function parse(opt = {}, baseOpt = DEFAULT_OPTIONS, fromCommandLine) {
  let ret = {};

  for (let k in baseOpt) {
    let defaultItem = baseOpt[k];
    let val = getValue(opt, k);

    if (val === undefined) {
      if (defaultItem.default !== undefined && !fromCommandLine) {
        setValue(ret, k, defaultItem.default);
      }
    } else {
      if (!check(defaultItem.type, val)) {
        throw new Error(`Unexpected type: ${k} expect a ${defaultItem.type.name}`);
      }
      setValue(ret, k, val);
    }
  }
  return ret;
}

function convert(args) {
  if (!fs.existsSync(DEFAULT_CONFIG)) {
    throw new Error(`No configuration file found in the current directory.`);
  }

  let opt = require(DEFAULT_CONFIG);
  let argOpt = parse(args, DEFAULT_OPTIONS, true);

  return Object.assign({}, parse(opt), argOpt);
}

exports = module.exports = {
  setValue: setValue,
  getValue: getValue,
  parse: parse,
  convert: convert
};


================================================
FILE: packages/cli/core/plugins/build/app.js
================================================
const path = require('path');

exports = module.exports = function() {
  this.register('build-app', function buildApp(app) {
    this.logger.info('app', 'building App');

    let { script, styles, config } = app.sfc;

    let targetFile = path.join(this.context, this.options.target, 'app');

    config.outputCode = JSON.stringify(config.parsed.output, null, 4);

    this.hook('script-dep-fix', script.parsed);
    this.hook('script-injection', script.parsed, this.options.appConfig);
    script.outputCode = script.parsed.source.source();

    let styleCode = '';

    styles.forEach(v => {
      styleCode += v.parsed.code + '\n';
    });

    styles.outputCode = styleCode;

    app.outputFile = targetFile;

    return app;
  });
};


================================================
FILE: packages/cli/core/plugins/build/assets.js
================================================
const path = require('path');

exports = module.exports = function() {
  this.register('build-assets', function buildAssets() {
    this.logger.info('assets', 'building assets');

    let result = [];

    this.assets.array().forEach(file => {
      let t = this.assets.type(file);
      let d = this.assets.data(file);

      if (t.npm) {
        if (t.type === 'weapp') {
          if (!t.wxs && t.component) {
            // it's a npm weapp component, like vant-weapp.
            // output-components will generate the code for vant-weapp himself
            return;
          } else {
            // it's in weapp component, maybe they require a lib in the component
            // this will goes to build asserts.
          }
        } else if (!t.wxs && t.dep && !t.component) {
          // it's a vendor, will go to vendor build
          return;
        }
      } else {
        // it's a component and it's not a dependences
        if (!t.wxs && t.component && !t.dep) {
          return;
        }
      }
      ///////////////////
      // asserts build
      //////////////////
      if (!t.wxs && !t.url) {
        this.hook('script-dep-fix', d);
      }

      let filePath = file;
      let fileObj = path.parse(file);

      // For typescript, it should output .js
      if (d.outputFileName && d.outputFileName !== fileObj.base) {
        filePath = path.join(fileObj.dir, d.outputFileName);
      }

      let targetFile = t.npm ? this.getModuleTarget(filePath) : this.getTarget(filePath);
      result.push({
        src: file,
        targetFile: targetFile,
        outputCode: d.source.source(),
        encoding: d.encoding
      });
    });

    return result;
  });
};


================================================
FILE: packages/cli/core/plugins/build/components.js
================================================
const path = require('path');

exports = module.exports = function() {
  this.register('build-components', function buildComponents(comps) {
    this.logger.info('component', 'building components');

    comps.forEach(comp => {
      let { script, styles, config, template, wxs } = comp.sfc;

      let styleCode = '';
      styles.forEach(v => {
        styleCode += v.parsed.code + '\n';
      });
      config.parsed.output.component = true;
      const { usingComponents, ...other } = config.parsed.output;
      let output = {
        ...other,
        usingComponents: usingComponents
      };
      config.outputCode = JSON.stringify(output, null, 4);
      this.hook('script-dep-fix', script.parsed);
      if (!script.empty && !(comp.component && comp.type === 'weapp')) {
        this.hook('script-injection', script.parsed, template.parsed.rel);
      }
      script.outputCode = script.parsed.source.source();
      styles.outputCode = styleCode;
      template.outputCode = template.parsed.code;

      if (wxs && wxs.length) {
        let wxsCode = '';
        wxs.forEach(item => {
          wxsCode += item.parsed.output + '\n';
        });
        template.outputCode =
          '<!----------   wxs start ----------->\n' +
          wxsCode +
          '<!----------   wxs end   ----------->\n' +
          template.outputCode;
      }
      let targetFile = comp.npm ? this.getModuleTarget(comp.file) : this.getTarget(comp.file);
      let target = path.parse(targetFile);
      comp.outputFile = path.join(target.dir, target.name);
    });

    return comps;
  });
};


================================================
FILE: packages/cli/core/plugins/build/pages.js
================================================
const path = require('path');

exports = module.exports = function() {
  this.register('build-pages', function buildPages(pages) {
    this.logger.info('page', 'building pages');

    pages.forEach(page => {
      let { script, styles, config, template } = page.sfc;

      let styleCode = '';
      styles.forEach(v => {
        styleCode += v.parsed.code + '\n';
      });

      config.outputCode = JSON.stringify(config.parsed.output, null, 4);

      this.hook('script-dep-fix', script.parsed);
      this.hook('script-injection', script.parsed, template.parsed.rel);

      script.outputCode = script.parsed.source.source();

      styles.outputCode = styleCode;
      template.outputCode = template.parsed.code;

      let targetFile = this.getTarget(page.file);
      let target = path.parse(targetFile);
      page.outputFile = path.join(target.dir, target.name);
    });

    return pages;
  });
};


================================================
FILE: packages/cli/core/plugins/build/vendor.js
================================================
const path = require('path');

const VENDOR_INJECTION = [
  `
var window = { Number: Number, Array: Array, Date: Date, Error: Error, Math: Math, Object: Object, Function: Function, RegExp: RegExp, String: String, TypeError: TypeError, parseInt: parseInt, parseFloat: parseFloat, isNaN: isNaN };
var global = window;
var process = { env: {} };
(function(modules) {
   // The module cache
   var installedModules = {};
   // The require function
   function __wepy_require(moduleId) {
       // Check if module is in cache
       if(installedModules[moduleId])
           return installedModules[moduleId].exports;
       // Create a new module (and put it into the cache)
       var module = installedModules[moduleId] = {
           exports: {},
           id: moduleId,
           loaded: false
       };
       // Execute the module function
       modules[moduleId].call(module.exports, module, module.exports, __wepy_require);
       // Flag the module as loaded
       module.loaded = true;
       // Return the exports of the module
       return module.exports;
   }
   // expose the modules object (__webpack_modules__)
   __wepy_require.m = modules;
   // expose the module cache
   __wepy_require.c = installedModules;
   // __webpack_public_path__
   __wepy_require.p = "/";
   // Load entry module and return exports
   module.exports = __wepy_require;
   return __wepy_require;
})([
`,
  '',
  ']);'
];

exports = module.exports = function() {
  this.register('build-vendor', function buildPages(vendor) {
    this.logger.info('vendor', 'building vendor');

    let vendorList = this.vendors.array();
    let code = '';

    vendorList.forEach((item, i) => {
      let data = this.vendors.data(item);

      this.hook('script-dep-fix', data, true);

      code += '/***** module ' + i + ' start *****/\n';
      code += '/***** ' + data.file + ' *****/\n';
      code += 'function(module, exports, __wepy_require) {';
      code += data.source.source() + '\n';
      code += '}';
      if (i !== vendorList.length - 1) {
        code += ',';
      }
      code += '/***** module ' + i + ' end *****/\n\n\n';
    });

    let template = VENDOR_INJECTION.concat([]);
    template[1] = code;

    vendor.outputCode = template.join('');
    vendor.targetFile = path.join(this.context, this.options.target, 'vendor.js');

    return vendor;
  });
};


================================================
FILE: packages/cli/core/plugins/compiler/before.js
================================================
const path = require('path');
const CONST = require('../../util/const');

exports = module.exports = function() {
  const styleHooker = (content, options) => {
    options.supportObject = true;
  };

  this.register('before-compiler-less', styleHooker);
  this.register('before-compiler-sass', styleHooker);
  this.register('before-compiler-stylus', styleHooker);

  // When file changed in --watch model
  this.register('before-wepy-watch-file-changed', function beforeWatchFileChanged(buildTask) {
    const changedFile = buildTask.changed;
    const parsedPath = path.parse(changedFile);
    const weappCacheKey = path.join(parsedPath.dir, parsedPath.name) + CONST.WEAPP_EXT;

    const isInvolved = this.fileDep.isInvolved(changedFile);
    const isWeappInvolved = this.fileDep.isInvolved(weappCacheKey);

    this.fileDep.getSources(changedFile).forEach(depedFile => {
      if (path.isAbsolute(depedFile)) {
        // clear the file hash, to remove the file cache
        this.compiled[depedFile].hash = '';
      }
    });

    if (isInvolved) {
      this.logger.silly('watch', `Watcher triggered by file changes: ${changedFile}`);
      const isEntry = changedFile === this.options.entry;
      let ext = path.extname(changedFile);
      const isWPY = ext === this.options.wpyExt;
      ext = ext.substring(1);

      if (isEntry) {
        buildTask.partial = false;
      } else if (isWPY) {
        buildTask.partial = true;
        buildTask.files.push(changedFile);
      } else {
        buildTask = this.hookSeq('wepy-watch-file-changed-' + ext, buildTask);
      }
    }

    if (isWeappInvolved) {
      this.logger.silly('watch', `Watcher triggered by file changes: ${changedFile}`);
      buildTask.changed = weappCacheKey;
      buildTask = this.hookSeq('wepy-watch-file-changed-weapp', buildTask);
    }

    return Promise.resolve(buildTask);
  });

  this.register('wepy-watch-file-changed-weapp', function(buildTask) {
    buildTask.weapp = true;
    buildTask.files.push(buildTask.changed);

    return buildTask;
  });

  // when .wxs file changed
  this.register('wepy-watch-file-changed-wxs', function(buildTask) {
    let queue = [];
    const wpyExtFiles = [];

    // find wpyExtFiles of deped
    queue = queue.concat(this.fileDep.getSources(buildTask.changed));
    while (queue.length > 0) {
      const depedFile = queue.shift();
      if (path.extname(depedFile) === this.options.wpyExt) {
        wpyExtFiles.push(depedFile);
      } else {
        queue = queue.concat(this.fileDep.getSources(depedFile));
      }
    }

    buildTask.files = wpyExtFiles;
    if (buildTask.files.includes(this.options.entry)) {
      buildTask.partial = false;
    }

    return buildTask;
  });

  // when .js, .ts file changed
  ['js', 'ts'].forEach(ext => {
    this.register('wepy-watch-file-changed-' + ext, function(buildTask) {
      buildTask.outputAssets = true;
      buildTask.files.push(buildTask.changed);
      buildTask.assetExt = ext;

      return buildTask;
    });
  });
};


================================================
FILE: packages/cli/core/plugins/compiler/common.js
================================================
exports = module.exports = function() {
  ['js', 'json', 'css', 'wxml'].forEach(lang => {
    this.register('wepy-compiler-' + lang, function(node) {
      node.compiled = {
        code: node.content
      };
      return Promise.resolve(node);
    });
  });
};


================================================
FILE: packages/cli/core/plugins/compiler/index.js
================================================
exports = module.exports = function() {
  require('./common').call(this);
  require('./wxss').call(this);
  require('./before').call(this);
};


================================================
FILE: packages/cli/core/plugins/compiler/wxss.js
================================================
const css = require('css');
const path = require('path');
const fs = require('fs');
const RawSource = require('webpack-sources').RawSource;

exports = module.exports = function() {
  this.register('wepy-compiler-wxss', function(node, ctx) {
    let code = node.content;

    let ast = css.parse(code);

    ast.stylesheet.rules.forEach(rule => {
      if (rule.type === 'import') {
        let importfile = rule.import;
        // eslint-disable-next-line
        if (importfile.startsWith('"') || importfile.startsWith("'")) {
          importfile = importfile.substring(1, importfile.length - 1);
        }
        importfile = path.resolve(ctx.file, '..', importfile);

        let encoding = 'utf-8';

        if (this.assets.get(importfile) === undefined) {
          let importCode;

          try {
            importCode = fs.readFileSync(importfile, encoding);
          } catch (e) {
            this.logger.warn('compiler', `Can not open file ${importfile} in ${ctx.file}`);
          }

          if (importCode) {
            // add assets dependencies
            this.assets.update(
              importfile,
              {
                encoding: encoding,
                source: new RawSource(importCode)
              },
              { url: true, npm: ctx.npm }
            );

            this.hookUnique(
              'wepy-compiler-wxss',
              {
                content: importCode
              },
              Object.assign({}, ctx, { dep: true })
            );
          }
        }
      }
    });
    node.compiled = {
      code: node.content
    };
    return Promise.resolve(node);
  });
};


================================================
FILE: packages/cli/core/plugins/helper/errorHandler.js
================================================
exports = module.exports = function() {
  this.register('error-handler', function(handler, errInfo, extra) {
    if (arguments.length === 1) {
      if (typeof handler === 'object') {
        errInfo = handler;
        let { ctx, message, type, snapshot, file, title } = errInfo;
        let output = 'Message:\n  ' + message;
        if (ctx && ctx.file) {
          file = ctx.file;
        }
        if (file) {
          output += '\n' + 'File:\n  ' + file;
        }
        if (snapshot) {
          output += '\n' + 'Snapshot:\n' + snapshot;
        }
        this.logger[type](title, output);
      }
    } else {
      return this.hookUnique('error-handler-' + handler, errInfo, extra);
    }
  });

  this.register('error-handler-script', function(errInfo, extra) {
    let { ctx, message, type, title, code, filename } = errInfo;
    let codeFrame = '';

    if (ctx && ctx.file) {
      filename = filename || ctx.file;
    }
    if (ctx && ctx.sfc && ctx.script && ctx.script.content) {
      code = ctx.sfc.script.content;
    }

    if (extra) {
      extra.type = 'script';
      codeFrame = 'Snapshot:\n' + this.hookUnique('gen-code-frame', code, extra, message);
    }

    let output = 'Message:\n  ' + message;
    output += '\n' + 'File:\n  ' + filename;
    output += '\n' + codeFrame;
    this.logger[type](title, output);
  });

  this.register('error-handler-template', function(errInfo, extra) {
    let { ctx, message, type, title } = errInfo;

    let codeFrame = '';

    if (extra) {
      extra.type = 'template';
      codeFrame = 'Snapshot:\n' + this.hookUnique('gen-code-frame', ctx.sfc.template.content, extra, message);
    }
    let output = 'Message:\n  ' + message;
    output += '\n' + 'File:\n  ' + ctx.file;
    output += '\n' + codeFrame;
    this.logger[type](title, output);
  });
};


================================================
FILE: packages/cli/core/plugins/helper/generateCodeFrame.js
================================================
const codeFrameColumns = require('@babel/code-frame').codeFrameColumns;
const SourceMap = require('source-map');

function indexToLineColumns(code, index) {
  let line = 1;
  let column = 1;
  let i = 0;
  let l = code.length;
  while (i < l) {
    if (i === index) {
      break;
    }
    if (code[i] === '\n') {
      line++;
      column = 1;
    } else {
      column++;
    }
    i++;
  }
  return { line, column };
}

exports = module.exports = function() {
  this.register('gen-code-frame', function(code, pos, msg, options) {
    if (pos.type === 'template') {
      if (pos.item) {
        return this.hookUnique('gen-code-frame-html', code, pos.item, pos.attr, pos.expr, msg, options);
      }
    }

    options = Object.assign(
      {},
      {
        highlightCode: true,
        message: msg || ''
      },
      options || {}
    );

    if (!pos.start) {
      let newpos = {};
      if (pos.startIndex) {
        newpos.start = indexToLineColumns(code, pos.startIndex);
      }
      if (pos.endIndex) {
        newpos.end = indexToLineColumns(code, pos.endIndex);
      }
      pos = newpos;
    } else if (pos.sourcemap) {
      let consumer = SourceMap.SourceMapConsumer(pos.sourcemap);
      if (pos.start) {
        pos.start = consumer.originalPositionFor(pos.start);
      }
      if (pos.end) {
        pos.end = consumer.originalPositionFor(pos.end);
      }
    }

    return codeFrameColumns(code, pos, options);
  });

  this.register('gen-code-frame-html', function(code, item, attr, expr, msg, options) {
    let node = code.substring(item.startIndex, item.endIndex);
    let i = 0,
      l = node.length,
      quotes = [];
    let word = '';
    let inQuoteString = '';
    let startIndex = 0;
    let endIndex = 0;

    while (i < l) {
      let c = node[i++];
      // eslint-disable-next-line
      if (c === '"' || c === "'") {
        if (quotes[quotes.length - 1] === c) {
          quotes.pop();
        } else {
          quotes.push(c);
        }
        continue;
      }
      if (quotes.length === 0) {
        inQuoteString = '';
        if (c === ' ') {
          word = '';
        } else {
          word += c;
        }
      } else {
        inQuoteString += c;
      }

      if (word === attr) {
        startIndex = i - word.length;
      }
      if (inQuoteString === expr) {
        endIndex = i;
      }
    }
    return this.hookUnique(
      'gen-code-frame',
      code,
      { startIndex: item.startIndex + startIndex, endIndex: item.startIndex + endIndex + 1 },
      msg,
      options
    );
  });
};


================================================
FILE: packages/cli/core/plugins/helper/sfcCustomBlock.js
================================================
exports = module.exports = function() {
  this.register('sfc-custom-block', function(sfc) {
    if (!sfc.customBlocks || sfc.customBlocks.length === 0) return sfc;

    sfc.customBlocks = sfc.customBlocks.filter(block => {
      if (block.attrs && block.attrs.src) {
        block.src = block.attrs.src;
      }
      let hookKey = 'sfc-custom-block-' + block.type;
      let has = this.hasHook(hookKey);
      if (has) {
        ({ sfc, block } = this.hookSeq(hookKey, { sfc, block }));
      }
      return !has;
    });

    return sfc;
  });

  this.register('sfc-custom-block-config', function({ sfc, block }) {
    if (!sfc.config) {
      sfc.config = block;
      sfc.config.lang = block.attrs.lang || 'json';
      sfc.config.type = 'config';
    } else {
      this.logger.warn('config', 'mutiple config is defined');
    }
    return { sfc, block };
  });

  this.register('sfc-custom-block-wxs', function({ sfc, block }) {
    if (!sfc.wxs) sfc.wxs = [];
    block.lang = block.attrs.lang || 'js';
    block.type = 'wxs';
    sfc.wxs.push(block);
    return { sfc, block };
  });
};


================================================
FILE: packages/cli/core/plugins/helper/supportSrc.js
================================================
const path = require('path');
const fs = require('fs');
const loaderUtils = require('loader-utils');

const trailingSlash = /[/\\]$/;

exports = module.exports = function() {
  this.register('pre-check-sfc', function(ctx) {
    let node = ctx.node;
    let file = ctx.file;
    let dir = path.parse(file).dir;

    if (node && node.src) {
      let src = node.src;
      const request = loaderUtils.urlToRequest(src, src.charAt(0) === '/' ? '' : null);
      dir = dir.replace(trailingSlash, '');
      return this.resolvers.normal.resolve({}, dir, request, {}).then(rst => {
        node.content = fs.readFileSync(rst.path, 'utf-8');
        node.dirty = true;
        return {
          node: node,
          file: file
        };
      });
    } else {
      return Promise.resolve({
        node: node,
        file: file
      });
    }
  });
};


================================================
FILE: packages/cli/core/plugins/parser/component.js
================================================
/**
 * Tencent is pleased to support the open source community by making WePY available.
 * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
 *
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 */
const fs = require('fs');
const path = require('path');
const CONST = require('../../util/const');

const wxmlAst = require('../../ast/wxml');

const readFile = (file, defaultValue = '') => {
  if (fs.existsSync(file)) {
    return fs.readFileSync(file, 'utf-8');
  }
  return defaultValue;
};

exports = module.exports = function() {
  this.register('wepy-parser-component', function(comp) {
    let parsedPath = path.parse(comp.path);
    let file = path.join(parsedPath.dir, parsedPath.name);
    let sfc = {
      styles: [],
      script: {},
      template: {}
    };
    let context = {
      sfc: sfc,
      file: file,
      npm: comp.npm,
      component: true,
      type: 'weapp' // This is a weapp original component
    };
    let weappCacheKey = file + CONST.WEAPP_EXT;

    if (!this.compiled[weappCacheKey]) {
      this.compiled[weappCacheKey] = comp;
    }

    this.fileDep.addDeps(weappCacheKey);

    sfc.styles[0] = {
      content: readFile(file + '.wxss'),
      type: 'style',
      lang: 'wxss'
    };

    sfc.template = {
      content: readFile(file + '.wxml'),
      type: 'template',
      lang: 'wxml'
    };

    // JS file should be there.
    sfc.script = {
      content: readFile(file + '.js', 'Page({})'),
      type: 'script',
      lang: 'babel'
    };

    sfc.config = {
      content: readFile(file + '.json', '{}'),
      type: 'config',
      lang: 'json'
    };

    let flow = Promise.resolve(true);
    let templateContent = sfc.template.content;

    if (templateContent.indexOf('<wxs ') > -1) {
      // wxs tag inside
      let templateAst = wxmlAst(sfc.template.content);

      sfc.wxs = [];

      flow = templateAst.then(ast => {
        let checkSrc = false;
        wxmlAst.walk(ast, {
          name: {
            wxs(item) {
              if (item.type === 'tag' && item.name === 'wxs') {
                if (item.attribs.src) {
                  checkSrc = true;
                }
                sfc.wxs.push({
                  attrs: item.attribs,
                  src: checkSrc ? item.attribs.src : '',
                  lang: 'js',
                  type: 'wxs',
                  content: wxmlAst.generate(item.children)
                });
                // Remove node;
                item.data = '';
                item.children = [];
                item.type = 'text';
              }
            }
          }
        });
        if (checkSrc) {
          // has wxs with src, reset wxml
          sfc.template.content = wxmlAst.generate(ast);
        }
        return checkSrc ? this.hookAsyncSeq('parse-sfc-src', context) : true;
      });
    }

    return flow
      .then(() => {
        if (sfc.wxs) {
          return Promise.all(
            sfc.wxs.map(wxs => {
              return this.applyCompiler(wxs, context);
            })
          );
        }
      })
      .then(() => {
        return this.applyCompiler(sfc.config, context);
      })
      .then(() => {
        return this.applyCompiler(sfc.template, context);
      })
      .then(() => {
        return this.applyCompiler(sfc.script, context);
      })
      .then(parsed => {
        sfc.script.parsed = parsed;
        return this.applyCompiler(sfc.styles[0], context);
      })
      .then(() => context);
  });
};


================================================
FILE: packages/cli/core/plugins/parser/config.js
================================================
const path = require('path');
const loaderUtils = require('loader-utils');
const slash = require('slash');

let appUsingComponents = null;

exports = module.exports = function() {
  this.register('wepy-parser-config', function(rst, ctx) {
    // If file is not changed, then use cache.
    if (ctx.useCache && ctx.sfc.config.parsed) {
      return Promise.resolve(true);
    }

    if (!rst) {
      if (!appUsingComponents) {
        return Promise.resolve(true);
      } else {
        rst.content = JSON.stringify({});
      }
    }

    let configString = rst.content.replace(/^\n*/, '').replace(/\n*$/, '');
    configString = (configString || '{}').trim();
    let config = null;
    try {
      let fn = new Function('return ' + configString);
      config = fn();
    } catch (e) {
      // TODO: added error handler code
      return Promise.reject(`invalid json: ${configString}`);
    }
    if (ctx.type !== 'app') {
      // app.json does not need it
      config.component = true;
    }
    if (!config.usingComponents) {
      config.usingComponents = {};
    }

    let userDefineComponents = config.usingComponents || {};
    let componentKeys = Object.keys(config.usingComponents);

    if (!appUsingComponents && componentKeys.length === 0) {
      ctx.sfc.config.parsed = {
        output: config
      };
      return Promise.resolve(true);
    }

    // page Components will inherit app using components
    if (appUsingComponents && ctx.type === 'page') {
      appUsingComponents.forEach(comp => {
        // Existing in page components, then ignore
        // Resolve path for page components
        if (!userDefineComponents[comp.name]) {
          let targetPath = comp.resolved.path;
          if (comp.prefix === 'module') {
            targetPath = comp.target;
          }
        }
      });
    }

    let resolvedUsingComponents = {};
    let parseComponents = [];
    let plist = componentKeys.map(name => {
      const url = userDefineComponents[name];

      let prefix = 'path';
      // e.g.
      // plugins://appid/xxxdfdf
      // module:some-3rd-party-component
      let matchs = url.match(/([^:]+):(.+)/);
      let request = url;

      if (matchs) {
        prefix = matchs[1];
        request = matchs[2];
      }

      let target = request;
      let source = request;

      let hookPrefix = 'wepy-parser-config-component-';
      let hookName = prefix;

      if (!this.hasHook(hookPrefix + hookName)) {
        hookName = 'raw';
      }

      return this.hookUnique(hookPrefix + hookName, name, prefix, source, target, ctx).then(
        ({ name, prefix, resolved, target, npm }) => {
          if (hookName === 'raw') {
            if (request.indexOf("weui-miniprogram") === 0) {
              resolvedUsingComponents[name] = request;
            }else{
              resolvedUsingComponents[name] = url;
            }
            parseComponents.push({
              name,
              prefix,
              url
            });
          } else {
            let relativePath = path.relative(path.dirname(ctx.file), target);
            let parsedPath = path.parse(relativePath);
            // Windows may got windows path, covert to use posix path
            resolvedUsingComponents[name] = './' + slash(path.join(parsedPath.dir, parsedPath.name));
            parseComponents.push({
              name,
              prefix,
              resolved,
              path: resolved.path,
              target,
              npm,
              request: relativePath,
              type: parsedPath.ext === this.options.wpyExt ? 'wepy' : 'weapp'
            });
          }
        }
      );
    });

    return Promise.all(plist).then(() => {
      if (ctx.type === 'app') {
        appUsingComponents = parseComponents;
      } else {
        config.usingComponents = Object.assign({}, resolvedUsingComponents);
      }

      ctx.sfc.config.parsed = {
        output: config,
        components: parseComponents
      };
      return true;
    });
  });

  // raw and plugin do nothing
  // eslint-disable-next-line
  this.register('wepy-parser-config-component-raw', function(name, prefix, source, target, ctx) {
    return Promise.resolve({
      name,
      prefix
    });
  });

  this.register('wepy-parser-config-component-module', function(name, prefix, source, target, ctx) {
    let contextDir = path.dirname(ctx.file);
    return this.resolvers.normal.resolve({}, contextDir, source, {}).then(resolved => {
      return {
        name: name,
        prefix: prefix,
        resolved: resolved,
        target: this.getModuleTarget(resolved.path, this.option
Download .txt
gitextract_swnsaggd/

├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .github/
│   ├── ISSUE_TEMPLATE.md
│   ├── PULL_REQUEST_TEMPLATE.md
│   ├── stale.yml
│   └── workflows/
│       ├── ci.yml
│       └── release.yml
├── .gitignore
├── .npmignore
├── .nycrc
├── .prettierrc.yml
├── .travis.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── CONTRIBUTING_COMMIT.md
├── LICENSE
├── README.md
├── README_EN.md
├── lerna.json
├── package.json
├── packages/
│   ├── babel-plugin-import-regenerator/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── README_EN.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── mutiple-async/
│   │       │   │   ├── actual.js
│   │       │   │   └── expected.js
│   │       │   └── normal/
│   │       │       ├── actual.js
│   │       │       └── expected.js
│   │       └── index.test.js
│   ├── cli/
│   │   ├── .gitignore
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── bin/
│   │   │   ├── cli/
│   │   │   │   ├── ask.js
│   │   │   │   ├── check-version.js
│   │   │   │   ├── download.js
│   │   │   │   ├── eval.js
│   │   │   │   ├── filter.js
│   │   │   │   ├── generate.js
│   │   │   │   ├── git-user.js
│   │   │   │   ├── local-path.js
│   │   │   │   ├── logger.js
│   │   │   │   └── options.js
│   │   │   ├── wepy-build.js
│   │   │   ├── wepy-init.js
│   │   │   ├── wepy-list.js
│   │   │   ├── wepy-new.js
│   │   │   ├── wepy-upgrade.js
│   │   │   └── wepy.js
│   │   ├── core/
│   │   │   ├── ast/
│   │   │   │   ├── index.js
│   │   │   │   ├── paramsDetect.js
│   │   │   │   ├── parseClass.js
│   │   │   │   ├── toAST.js
│   │   │   │   ├── walker.js
│   │   │   │   └── wxml.js
│   │   │   ├── compile.js
│   │   │   ├── fileDep.js
│   │   │   ├── hook.js
│   │   │   ├── init/
│   │   │   │   ├── compiler.js
│   │   │   │   ├── parser.js
│   │   │   │   └── plugin.js
│   │   │   ├── loader.js
│   │   │   ├── moduleSet.js
│   │   │   ├── parseOptions.js
│   │   │   ├── plugins/
│   │   │   │   ├── build/
│   │   │   │   │   ├── app.js
│   │   │   │   │   ├── assets.js
│   │   │   │   │   ├── components.js
│   │   │   │   │   ├── pages.js
│   │   │   │   │   └── vendor.js
│   │   │   │   ├── compiler/
│   │   │   │   │   ├── before.js
│   │   │   │   │   ├── common.js
│   │   │   │   │   ├── index.js
│   │   │   │   │   └── wxss.js
│   │   │   │   ├── helper/
│   │   │   │   │   ├── errorHandler.js
│   │   │   │   │   ├── generateCodeFrame.js
│   │   │   │   │   ├── sfcCustomBlock.js
│   │   │   │   │   └── supportSrc.js
│   │   │   │   ├── parser/
│   │   │   │   │   ├── component.js
│   │   │   │   │   ├── config.js
│   │   │   │   │   ├── file.js
│   │   │   │   │   ├── script.js
│   │   │   │   │   ├── style.js
│   │   │   │   │   ├── template.js
│   │   │   │   │   ├── wpy.js
│   │   │   │   │   └── wxs.js
│   │   │   │   ├── scriptDepFix.js
│   │   │   │   ├── scriptInjection.js
│   │   │   │   └── template/
│   │   │   │       ├── attrs/
│   │   │   │       │   ├── bindClass.js
│   │   │   │       │   ├── bindStyle.js
│   │   │   │       │   ├── index.js
│   │   │   │       │   ├── ref.js
│   │   │   │       │   └── src.js
│   │   │   │       ├── directives/
│   │   │   │       │   ├── bind.js
│   │   │   │       │   ├── condition.js
│   │   │   │       │   ├── for.js
│   │   │   │       │   ├── index.js
│   │   │   │       │   ├── model.js
│   │   │   │       │   ├── other.js
│   │   │   │       │   └── v-on.js
│   │   │   │       ├── parse.js
│   │   │   │       └── util/
│   │   │   │           └── check.js
│   │   │   ├── tag.js
│   │   │   └── util/
│   │   │       ├── ast.js
│   │   │       ├── const.js
│   │   │       ├── error.js
│   │   │       ├── exprParser.js
│   │   │       ├── hash.js
│   │   │       ├── logger.js
│   │   │       ├── tools.js
│   │   │       └── xmllint.js
│   │   ├── index.js
│   │   ├── package.json
│   │   ├── test/
│   │   │   ├── config.js
│   │   │   └── core/
│   │   │       ├── fileDep.test.js
│   │   │       ├── fixtures/
│   │   │       │   └── template/
│   │   │       │       ├── assert/
│   │   │       │       │   ├── attrWithoutValue.wxml
│   │   │       │       │   ├── bindClass.wxml
│   │   │       │       │   ├── bindStyle.wxml
│   │   │       │       │   ├── joinStyle.wxml
│   │   │       │       │   ├── ref.wxml
│   │   │       │       │   ├── reference.wxml
│   │   │       │       │   ├── v-for.wxml
│   │   │       │       │   ├── v-if.wxml
│   │   │       │       │   ├── v-on/
│   │   │       │       │   │   ├── 0-0.tap.js
│   │   │       │       │   │   ├── 0-1.tap.js
│   │   │       │       │   │   ├── 0-10.tap.js
│   │   │       │       │   │   ├── 0-11.tap.js
│   │   │       │       │   │   ├── 0-12.tap.js
│   │   │       │       │   │   ├── 0-13.tap.js
│   │   │       │       │   │   ├── 0-14.tap.js
│   │   │       │       │   │   ├── 0-15.tap.js
│   │   │       │       │   │   ├── 0-2.tap.js
│   │   │       │       │   │   ├── 0-3.tap.js
│   │   │       │       │   │   ├── 0-4.tap.js
│   │   │       │       │   │   ├── 0-5.tap.js
│   │   │       │       │   │   ├── 0-6.tap.js
│   │   │       │       │   │   ├── 0-7.tap.js
│   │   │       │       │   │   ├── 0-8.tap.js
│   │   │       │       │   │   └── 0-9.click-right.js
│   │   │       │       │   ├── v-on.wxml
│   │   │       │       │   ├── v-on.wxs.wxml
│   │   │       │       │   └── v-show.wxml
│   │   │       │       └── original/
│   │   │       │           ├── attrWithoutValue.html
│   │   │       │           ├── bindClass.html
│   │   │       │           ├── bindStyle.html
│   │   │       │           ├── joinStyle.html
│   │   │       │           ├── ref.html
│   │   │       │           ├── reference.html
│   │   │       │           ├── v-for.html
│   │   │       │           ├── v-if.html
│   │   │       │           ├── v-on.html
│   │   │       │           ├── v-on.wxs.html
│   │   │       │           └── v-show.html
│   │   │       ├── hook.test.js
│   │   │       ├── init/
│   │   │       │   └── plugin.test.js
│   │   │       ├── parseOption.test.js
│   │   │       ├── plugins/
│   │   │       │   ├── helper/
│   │   │       │   │   └── sfcCustomBlock.test.js
│   │   │       │   └── template/
│   │   │       │       └── parse.test.js
│   │   │       └── tag.test.js
│   │   └── util/
│   │       └── logger.js
│   ├── compiler-babel/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   └── app.js
│   │       ├── helper/
│   │       │   ├── ast.js
│   │       │   └── index.js
│   │       └── index.test.js
│   ├── compiler-less/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── createPlugin.js
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── css/
│   │       │   │   ├── alias.css
│   │       │   │   ├── basic.css
│   │       │   │   ├── extend.css
│   │       │   │   ├── function.css
│   │       │   │   ├── guards.css
│   │       │   │   ├── import.css
│   │       │   │   ├── lazy.css
│   │       │   │   ├── list-each.css
│   │       │   │   ├── list.css
│   │       │   │   ├── selector.css
│   │       │   │   └── uri.css
│   │       │   └── less/
│   │       │       ├── alias.less
│   │       │       ├── basic.less
│   │       │       ├── extend.less
│   │       │       ├── fail-missing-file.less
│   │       │       ├── fail-uri-alias.less
│   │       │       ├── guards.less
│   │       │       ├── import.less
│   │       │       ├── lazy.less
│   │       │       ├── list-each.less
│   │       │       ├── list.less
│   │       │       ├── selector.less
│   │       │       ├── uri.less
│   │       │       └── vars/
│   │       │           ├── colors.less
│   │       │           └── modules.less
│   │       ├── helpers/
│   │       │   ├── lessc.js
│   │       │   └── specs.js
│   │       └── index.test.js
│   ├── compiler-postcss/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── css/
│   │       │   │   ├── basic.css
│   │       │   │   └── map.css
│   │       │   └── postcss/
│   │       │       ├── basic.postcss
│   │       │       └── map.postcss
│   │       ├── helpers/
│   │       │   ├── postcssc.js
│   │       │   └── specs.js
│   │       └── index.test.js
│   ├── compiler-sass/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── importsToResolve.js
│   │   ├── index.js
│   │   ├── package.json
│   │   ├── resolveImporter.js
│   │   ├── src/
│   │   │   └── index.js
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── css/
│   │       │   │   ├── alias.scss.css
│   │       │   │   ├── basic.sass.css
│   │       │   │   ├── basic.scss.css
│   │       │   │   ├── import.sass.css
│   │       │   │   └── import.scss.css
│   │       │   └── sass/
│   │       │       ├── alias.scss
│   │       │       ├── basic.sass
│   │       │       ├── basic.scss
│   │       │       ├── import.sass
│   │       │       ├── import.scss
│   │       │       └── vars/
│   │       │           └── colors.scss
│   │       ├── helpers/
│   │       │   ├── generate.js
│   │       │   └── specs.js
│   │       └── index.test.js
│   ├── compiler-stylus/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── createPlugin.js
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── css/
│   │       │   │   ├── alias.css
│   │       │   │   ├── basic.css
│   │       │   │   ├── extend.css
│   │       │   │   ├── function.css
│   │       │   │   ├── guards.css
│   │       │   │   ├── import.css
│   │       │   │   ├── list-each.css
│   │       │   │   ├── list.css
│   │       │   │   ├── selector.css
│   │       │   │   └── uri.css
│   │       │   └── stylus/
│   │       │       ├── alias.styl
│   │       │       ├── basic.styl
│   │       │       ├── extend.styl
│   │       │       ├── fail-missing-file.styl
│   │       │       ├── fail-uri-alias.styl
│   │       │       ├── guards.styl
│   │       │       ├── import.styl
│   │       │       ├── list-each.styl
│   │       │       ├── list.styl
│   │       │       ├── selector.styl
│   │       │       ├── uri.styl
│   │       │       └── vars/
│   │       │           ├── colors.styl
│   │       │           └── modules.styl
│   │       ├── helpers/
│   │       │   ├── specs.js
│   │       │   └── stylus.js
│   │       └── index.test.js
│   ├── compiler-typescript/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── index.js
│   │   └── package.json
│   ├── core/
│   │   ├── .nycrc
│   │   ├── CHANGELOG.md
│   │   ├── ant/
│   │   │   ├── apis/
│   │   │   │   └── index.js
│   │   │   ├── class/
│   │   │   │   ├── WepyComponent.js
│   │   │   │   └── WepyPage.js
│   │   │   ├── init/
│   │   │   │   ├── events.js
│   │   │   │   ├── index.js
│   │   │   │   ├── lifecycle.js
│   │   │   │   ├── methods.js
│   │   │   │   └── props.js
│   │   │   ├── native/
│   │   │   │   ├── app.js
│   │   │   │   ├── component.js
│   │   │   │   ├── index.js
│   │   │   │   └── page.js
│   │   │   └── wepy.js
│   │   ├── dist/
│   │   │   ├── wepy.ant.js
│   │   │   └── wepy.js
│   │   ├── index.ant.js
│   │   ├── index.js
│   │   ├── package.json
│   │   ├── shared/
│   │   │   ├── constants.js
│   │   │   ├── env.js
│   │   │   ├── extend.js
│   │   │   ├── index.js
│   │   │   └── util.js
│   │   ├── src/
│   │   │   ├── bar.js
│   │   │   ├── foo.js
│   │   │   └── index.js
│   │   ├── test/
│   │   │   ├── .istanbul.yml
│   │   │   ├── bar.spec.js
│   │   │   ├── foo.spec.js
│   │   │   ├── index.test.js
│   │   │   ├── mock/
│   │   │   │   ├── api/
│   │   │   │   │   └── createSelectorQuery.js
│   │   │   │   └── wxapi.js
│   │   │   └── weapp/
│   │   │       ├── class/
│   │   │       │   └── Dirty.js
│   │   │       ├── dispatcher/
│   │   │       │   └── index.test.js
│   │   │       ├── helper/
│   │   │       │   ├── index.js
│   │   │       │   └── libs/
│   │   │       │       ├── App.js
│   │   │       │       ├── Component.js
│   │   │       │       └── Page.js
│   │   │       ├── init/
│   │   │       │   ├── data.js
│   │   │       │   └── lifecycle.test.js
│   │   │       ├── observer/
│   │   │       │   ├── index.test.js
│   │   │       │   └── observerPath.test.js
│   │   │       └── util/
│   │   │           ├── debug.test.js
│   │   │           ├── error.test.js
│   │   │           ├── index.test.js
│   │   │           ├── model.test.js
│   │   │           └── next-tick.test.js
│   │   ├── types/
│   │   │   ├── index.d.ts
│   │   │   ├── options.d.ts
│   │   │   ├── plugin.d.ts
│   │   │   ├── test/
│   │   │   │   ├── tsconfig.json
│   │   │   │   ├── wepy.app.test.ts
│   │   │   │   ├── wepy.component.test.ts
│   │   │   │   ├── wepy.page.test.ts
│   │   │   │   └── wepy.test.ts
│   │   │   ├── tsconfig.json
│   │   │   ├── typings.json
│   │   │   ├── wepy.d.ts
│   │   │   └── wx/
│   │   │       ├── index.d.ts
│   │   │       ├── lib.wx.api.d.ts
│   │   │       ├── lib.wx.app.d.ts
│   │   │       ├── lib.wx.behavior.d.ts
│   │   │       ├── lib.wx.cloud.d.ts
│   │   │       ├── lib.wx.component.d.ts
│   │   │       └── lib.wx.page.d.ts
│   │   └── weapp/
│   │       ├── apis/
│   │       │   ├── index.js
│   │       │   ├── mixin.js
│   │       │   └── use.js
│   │       ├── class/
│   │       │   ├── Base.js
│   │       │   ├── Dirty.js
│   │       │   ├── Event.js
│   │       │   ├── WepyApp.js
│   │       │   ├── WepyComponent.js
│   │       │   ├── WepyConstructor.js
│   │       │   └── WepyPage.js
│   │       ├── config.js
│   │       ├── dispatcher/
│   │       │   └── index.js
│   │       ├── global.js
│   │       ├── init/
│   │       │   ├── computed.js
│   │       │   ├── data.js
│   │       │   ├── hooks.js
│   │       │   ├── index.js
│   │       │   ├── lifecycle.js
│   │       │   ├── methods.js
│   │       │   ├── mixins.js
│   │       │   ├── props.js
│   │       │   ├── relations.js
│   │       │   ├── render.js
│   │       │   └── watch.js
│   │       ├── native/
│   │       │   ├── app.js
│   │       │   ├── component.js
│   │       │   ├── index.js
│   │       │   └── page.js
│   │       ├── observer/
│   │       │   ├── array.js
│   │       │   ├── dep.js
│   │       │   ├── index.js
│   │       │   ├── observerPath.js
│   │       │   ├── scheduler.js
│   │       │   ├── traverse.js
│   │       │   └── watcher.js
│   │       ├── util/
│   │       │   ├── config.js
│   │       │   ├── debug.js
│   │       │   ├── error.js
│   │       │   ├── index.js
│   │       │   ├── model.js
│   │       │   └── next-tick.js
│   │       └── wepy.js
│   ├── plugin-define/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── README_EN.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       ├── fixtures/
│   │       │   ├── expected/
│   │       │   │   └── app.js
│   │       │   ├── src/
│   │       │   │   └── app.wpy
│   │       │   ├── weapp/
│   │       │   │   └── .gitignore
│   │       │   └── wepy.config.js
│   │       ├── index.integration.js
│   │       └── index.test.js
│   ├── plugin-eslint/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       └── index.test.js
│   ├── plugin-uglifyjs/
│   │   ├── .npmignore
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── index.js
│   │   ├── package.json
│   │   └── test/
│   │       └── index.test.js
│   ├── redux/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── README_EN.md
│   │   ├── dist/
│   │   │   └── index.js
│   │   ├── helper.js
│   │   ├── index.js
│   │   ├── install.js
│   │   └── package.json
│   ├── router/
│   │   ├── README.md
│   │   ├── core/
│   │   │   ├── config.js
│   │   │   ├── createRouter.js
│   │   │   ├── guard/
│   │   │   │   ├── createComponentGuard.js
│   │   │   │   ├── createRouterGuard.js
│   │   │   │   ├── globalGuard.js
│   │   │   │   ├── guardManager.js
│   │   │   │   └── index.js
│   │   │   ├── index.js
│   │   │   ├── routeManager.js
│   │   │   ├── routerApi.js
│   │   │   └── utils/
│   │   │       ├── getRealPageInfo.js
│   │   │       ├── queue.js
│   │   │       └── urlParse.js
│   │   ├── doc/
│   │   │   ├── config.md
│   │   │   ├── guard.md
│   │   │   ├── instance.md
│   │   │   ├── router.md
│   │   │   └── usage.md
│   │   ├── index.js
│   │   ├── install.js
│   │   └── package.json
│   ├── use-intercept/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── README_EN.md
│   │   ├── dist/
│   │   │   └── index.js
│   │   ├── index.js
│   │   ├── install.js
│   │   ├── package.json
│   │   └── test/
│   │       └── index.test.js
│   ├── use-promisify/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── README_EN.md
│   │   ├── dist/
│   │   │   └── index.js
│   │   ├── index.js
│   │   ├── install.js
│   │   ├── package.json
│   │   └── test/
│   │       └── index.test.js
│   └── x/
│       ├── CHANGELOG.md
│       ├── README.md
│       ├── README_EN.md
│       ├── dist/
│       │   └── index.js
│       ├── index.js
│       └── package.json
├── scripts/
│   ├── bootstrap.sh
│   ├── build.js
│   ├── build.sh
│   ├── ci-release.js
│   ├── clean.js
│   ├── config.js
│   ├── install_dev.sh
│   ├── npm-ci-release.js
│   ├── npm-tags.js
│   ├── npm_publish/
│   │   ├── index.js
│   │   └── lib/
│   │       ├── auto.js
│   │       ├── check_repo_clean.js
│   │       ├── interact.js
│   │       └── log.js
│   ├── release.js
│   ├── test-build.sh
│   └── unittest.js
├── test/
│   ├── build-cases/
│   │   ├── empty.sh
│   │   └── standard.sh
│   ├── build.sh
│   ├── scripts/
│   │   └── ci-release.test.js
│   └── unit.js
└── verpub.config.js
Download .txt
SYMBOL INDEX (858 symbols across 176 files)

FILE: packages/babel-plugin-import-regenerator/index.js
  method CallExpression (line 8) | CallExpression(path) {

FILE: packages/babel-plugin-import-regenerator/test/fixtures/mutiple-async/actual.js
  method foo (line 2) | foo () {
  method bar (line 5) | async bar () {
  method bar2 (line 8) | async bar2 () {
  method bar3 (line 11) | async bar3 () {

FILE: packages/babel-plugin-import-regenerator/test/fixtures/mutiple-async/expected.js
  function _interopRequireDefault (line 7) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function asyncGeneratorStep (line 9) | function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, ar...
  function _asyncToGenerator (line 11) | function _asyncToGenerator(fn) { return function () { var self = this, a...
  function bar (line 40) | function bar() {
  function bar2 (line 66) | function bar2() {
  function bar3 (line 94) | function bar3() {

FILE: packages/babel-plugin-import-regenerator/test/fixtures/normal/actual.js
  method sleep (line 5) | sleep (s) {
  method testAsync (line 12) | async testAsync () {

FILE: packages/babel-plugin-import-regenerator/test/fixtures/normal/expected.js
  function _interopRequireDefault (line 11) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function asyncGeneratorStep (line 13) | function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, ar...
  function _asyncToGenerator (line 15) | function _asyncToGenerator(fn) { return function () { var self = this, a...
  function testAsync (line 48) | function testAsync() {

FILE: packages/cli/bin/cli/ask.js
  function prompt (line 38) | function prompt(data, key, prompt, done) {

FILE: packages/cli/bin/cli/download.js
  method downloadOfficialZip (line 9) | downloadOfficialZip(template, dist, options) {
  method downloadFromGitRaw (line 20) | downloadFromGitRaw(template, dist, options, branch = '2.0.x') {
  method downloadFromCos (line 27) | downloadFromCos(template, dist, options) {
  method downloadRepo (line 34) | downloadRepo(template, dist, opt) {

FILE: packages/cli/bin/cli/generate.js
  function askQuestions (line 95) | function askQuestions(prompts) {
  function getDefault (line 108) | function getDefault(item) {
  function buildInlineArgs (line 127) | function buildInlineArgs(prompts) {
  function filterFiles (line 152) | function filterFiles(filters) {
  function renderTemplateFiles (line 166) | function renderTemplateFiles(skipInterpolation) {
  function logMessage (line 204) | function logMessage(message, data) {

FILE: packages/cli/bin/cli/local-path.js
  method isLocalPath (line 4) | isLocalPath(templatePath) {
  method getTemplatePath (line 10) | getTemplatePath(templatePath) {

FILE: packages/cli/bin/cli/logger.js
  method log (line 18) | log(...args) {
  method fatal (line 30) | fatal(...args) {
  method success (line 44) | success(...args) {

FILE: packages/cli/bin/cli/options.js
  function getMetadata (line 35) | function getMetadata(dir) {
  function setDefault (line 64) | function setDefault(opts, key, val) {
  function setValidateName (line 80) | function setValidateName(opts) {

FILE: packages/cli/bin/wepy-init.js
  function gen (line 15) | function gen(templatePath) {
  function run (line 42) | function run() {
  function downloadLog (line 63) | function downloadLog(msg, type = 'verbose') {
  function downloadOfficialTemplate (line 67) | function downloadOfficialTemplate(templateName, dist, opt, branch) {
  function downloadAndGenerate (line 87) | function downloadAndGenerate(template) {

FILE: packages/cli/bin/wepy-upgrade.js
  function upgradeCLI (line 4) | function upgradeCLI(cb) {
  function upgradeWepy (line 18) | function upgradeWepy(cb) {

FILE: packages/cli/core/ast/paramsDetect.js
  function isScope (line 4) | function isScope(node) {
  function isBlockScope (line 12) | function isBlockScope(node) {
  function declaresArguments (line 16) | function declaresArguments(node) {
  function declaresThis (line 20) | function declaresThis(node) {
  function reallyParse (line 24) | function reallyParse(source, options) {
  function findGlobals (line 34) | function findGlobals(source, options) {
  function getNameForExpression (line 184) | function getNameForExpression(expression) {

FILE: packages/cli/core/ast/parseClass.js
  method ObjectExpression (line 9) | ObjectExpression(node) {
  method ArrayExpression (line 25) | ArrayExpression(node) {
  method ConditionalExpression (line 32) | ConditionalExpression() {

FILE: packages/cli/core/ast/toAST.js
  constant ECMA_VERSION (line 3) | const ECMA_VERSION = 2017;
  constant POSSIBLE_AST_OPTIONS (line 5) | const POSSIBLE_AST_OPTIONS = [

FILE: packages/cli/core/ast/walker.js
  class AstWalker (line 1) | class AstWalker {
    method constructor (line 2) | constructor(compilation, ast, lang) {
    method run (line 11) | run() {
    method walkStatements (line 22) | walkStatements(statements) {
    method walkStatement (line 28) | walkStatement(statement) {
    method walkClass (line 34) | walkClass(classy) {
    method walkMethodDefinition (line 43) | walkMethodDefinition(methodDefinition) {
    method prewalkStatements (line 49) | prewalkStatements(statements) {
    method prewalkStatement (line 56) | prewalkStatement(statement) {
    method prewalkBlockStatement (line 62) | prewalkBlockStatement(statement) {
    method walkBlockStatement (line 66) | walkBlockStatement(statement) {
    method walkExpressionStatement (line 70) | walkExpressionStatement(statement) {
    method prewalkIfStatement (line 74) | prewalkIfStatement(statement) {
    method walkIfStatement (line 79) | walkIfStatement(statement) {
    method prewalkLabeledStatement (line 92) | prewalkLabeledStatement(statement) {
    method walkLabeledStatement (line 96) | walkLabeledStatement(statement) {
    method prewalkWithStatement (line 102) | prewalkWithStatement(statement) {
    method walkWithStatement (line 106) | walkWithStatement(statement) {
    method prewalkSwitchStatement (line 111) | prewalkSwitchStatement(statement) {
    method walkSwitchStatement (line 115) | walkSwitchStatement(statement) {
    method walkTerminatingStatement (line 120) | walkTerminatingStatement(statement) {
    method walkReturnStatement (line 124) | walkReturnStatement(statement) {
    method walkThrowStatement (line 128) | walkThrowStatement(statement) {
    method prewalkTryStatement (line 132) | prewalkTryStatement(statement) {
    method walkTryStatement (line 136) | walkTryStatement(statement) {
    method prewalkWhileStatement (line 148) | prewalkWhileStatement(statement) {
    method walkWhileStatement (line 152) | walkWhileStatement(statement) {
    method prewalkDoWhileStatement (line 157) | prewalkDoWhileStatement(statement) {
    method walkDoWhileStatement (line 161) | walkDoWhileStatement(statement) {
    method prewalkForStatement (line 166) | prewalkForStatement(statement) {
    method walkForStatement (line 173) | walkForStatement(statement) {
    method prewalkForInStatement (line 183) | prewalkForInStatement(statement) {
    method walkForInStatement (line 188) | walkForInStatement(statement) {
    method prewalkForOfStatement (line 195) | prewalkForOfStatement(statement) {
    method walkForOfStatement (line 200) | walkForOfStatement(statement) {
    method prewalkFunctionDeclaration (line 208) | prewalkFunctionDeclaration(statement) {
    method walkFunctionDeclaration (line 215) | walkFunctionDeclaration(statement) {
    method prewalkImportDeclaration (line 229) | prewalkImportDeclaration(statement) {
    method prewalkExportNamedDeclaration (line 260) | prewalkExportNamedDeclaration(statement) {
    method walkExportNamedDeclaration (line 302) | walkExportNamedDeclaration(statement) {
    method prewalkExportDefaultDeclaration (line 308) | prewalkExportDefaultDeclaration(statement) {
    method walkExportDefaultDeclaration (line 321) | walkExportDefaultDeclaration(statement) {
    method prewalkVariableDeclaration (line 336) | prewalkVariableDeclaration(statement) {
    method walkVariableDeclaration (line 340) | walkVariableDeclaration(statement) {
    method prewalkClassDeclaration (line 344) | prewalkClassDeclaration(statement) {
    method walkClassDeclaration (line 351) | walkClassDeclaration(statement) {
    method prewalkSwitchCases (line 355) | prewalkSwitchCases(switchCases) {
    method walkSwitchCases (line 362) | walkSwitchCases(switchCases) {
    method walkCatchClause (line 373) | walkCatchClause(catchClause) {
    method prewalkVariableDeclarators (line 380) | prewalkVariableDeclarators(declarators) {
    method walkVariableDeclarators (line 426) | walkVariableDeclarators(declarators) {
    method walkPattern (line 455) | walkPattern(pattern) {
    method walkAssignmentPattern (line 460) | walkAssignmentPattern(pattern) {
    method walkObjectPattern (line 465) | walkObjectPattern(pattern) {
    method walkArrayPattern (line 475) | walkArrayPattern(pattern) {
    method walkRestElement (line 482) | walkRestElement(pattern) {
    method walkExpressions (line 486) | walkExpressions(expressions) {
    method walkExpression (line 493) | walkExpression(expression) {
    method walkAwaitExpression (line 497) | walkAwaitExpression(expression) {
    method walkArrayExpression (line 502) | walkArrayExpression(expression) {
    method walkSpreadElement (line 506) | walkSpreadElement(expression) {
    method walkObjectExpression (line 510) | walkObjectExpression(expression) {
    method walkFunctionExpression (line 520) | walkFunctionExpression(expression) {
    method walkArrowFunctionExpression (line 534) | walkArrowFunctionExpression(expression) {
    method walkSequenceExpression (line 548) | walkSequenceExpression(expression) {
    method walkUpdateExpression (line 552) | walkUpdateExpression(expression) {
    method walkUnaryExpression (line 556) | walkUnaryExpression(expression) {
    method walkLeftRightExpression (line 569) | walkLeftRightExpression(expression) {
    method walkBinaryExpression (line 574) | walkBinaryExpression(expression) {
    method walkLogicalExpression (line 578) | walkLogicalExpression(expression) {
    method walkAssignmentExpression (line 582) | walkAssignmentExpression(expression) {
    method walkConditionalExpression (line 640) | walkConditionalExpression(expression) {
    method walkNewExpression (line 654) | walkNewExpression(expression) {
    method walkYieldExpression (line 659) | walkYieldExpression(expression) {
    method walkTemplateLiteral (line 663) | walkTemplateLiteral(expression) {
    method walkTaggedTemplateExpression (line 667) | walkTaggedTemplateExpression(expression) {
    method walkClassExpression (line 672) | walkClassExpression(expression) {
    method walkCallExpression (line 676) | walkCallExpression(expression) {
    method walkMemberExpression (line 771) | walkMemberExpression(expression) {
    method walkIdentifier (line 783) | walkIdentifier(expression) {
    method inScope (line 792) | inScope(params, fn) {
    method enterPattern (line 821) | enterPattern(pattern, onIdent) {
    method enterIdentifier (line 825) | enterIdentifier(pattern, onIdent) {
    method enterObjectPattern (line 829) | enterObjectPattern(pattern, onIdent) {
    method enterArrayPattern (line 836) | enterArrayPattern(pattern, onIdent) {
    method enterRestElement (line 843) | enterRestElement(pattern, onIdent) {
    method enterAssignmentPattern (line 847) | enterAssignmentPattern(pattern, onIdent) {
    method evaluateExpression (line 851) | evaluateExpression(expression) {
    method getRenameIdentifier (line 869) | getRenameIdentifier(expr) {
    method parseString (line 876) | parseString(expression) {
    method parseCalculatedString (line 887) | parseCalculatedString(expression) {
    method parseStringArray (line 941) | parseStringArray(expression) {
    method parseCalculatedStringArray (line 954) | parseCalculatedStringArray(expression) {
    method getNameForExpression (line 1052) | getNameForExpression(expression) {
    method evaluateMemberExpression (line 1086) | evaluateMemberExpression(expression) {
    method evaluateIdentifier (line 1116) | evaluateIdentifier(expr) {
    method applyMethods (line 1143) | applyMethods(method, expr) {
    method callrequire (line 1171) | callrequire(expr) {
    method callrequireAmdArray (line 1247) | callrequireAmdArray(expr, param) {
    method callrequireAmdItem (line 1300) | callrequireAmdItem(expr, param) {
    method callrequireAmdContext (line 1338) | callrequireAmdContext(/*expr, param*/) {

FILE: packages/cli/core/compile.js
  constant VENDOR_DIR (line 20) | const VENDOR_DIR = require('./util/const').VENDOR_DIR;
  class Compile (line 30) | class Compile extends Hook {
    method constructor (line 31) | constructor(opt) {
    method clear (line 129) | clear(type) {
    method run (line 134) | run() {
    method init (line 138) | init() {
    method start (line 187) | start() {
    method buildComps (line 289) | buildComps(comps) {
    method weappBuild (line 351) | weappBuild(buildTask) {
    method partialBuild (line 369) | partialBuild(buildTask) {
    method assetsBuild (line 397) | assetsBuild(buildTask) {
    method handleBuildErr (line 417) | handleBuildErr(err) {
    method watch (line 433) | watch() {
    method applyCompiler (line 493) | applyCompiler(node, ctx) {
    method getTarget (line 522) | getTarget(file, targetDir) {
    method getModuleTarget (line 528) | getModuleTarget(file, targetDir) {
    method outputFile (line 537) | outputFile(filename, code, encoding) {
    method output (line 563) | output(type, item) {

FILE: packages/cli/core/fileDep.js
  class FileDep (line 1) | class FileDep {
    method constructor (line 2) | constructor() {
    method cleanDeps (line 7) | cleanDeps(source) {
    method addDeps (line 21) | addDeps(source, deps = []) {
    method getDeps (line 36) | getDeps(source) {
    method getSources (line 40) | getSources(dep) {
    method isInvolved (line 44) | isInvolved(file) {

FILE: packages/cli/core/hook.js
  class Hook (line 1) | class Hook {
    method constructor (line 2) | constructor() {
    method register (line 6) | register(key, fn) {
    method hasHook (line 17) | hasHook(key) {
    method hook (line 21) | hook(key, ...args) {
    method hookSeq (line 30) | hookSeq(key, ...args) {
    method hookUnique (line 49) | hookUnique(key, ...args) {
    method hookUniqueReturnArg (line 58) | hookUniqueReturnArg(key, ...args) {
    method hookAsyncSeq (line 66) | hookAsyncSeq(key, ...args) {
    method hookReturnOrigin (line 92) | hookReturnOrigin(key, ...args) {
    method unregister (line 100) | unregister(key, fn) {
    method unregisterAll (line 112) | unregisterAll(key) {

FILE: packages/cli/core/init/plugin.js
  function checkPlugins (line 3) | function checkPlugins(ins, plugins) {

FILE: packages/cli/core/loader.js
  class PluginHelper (line 19) | class PluginHelper {
    method constructor (line 20) | constructor(plugins, op) {
    method applyPlugin (line 24) | applyPlugin(index, op) {
  method attach (line 42) | attach(resolve) {
  method loadCompiler (line 45) | loadCompiler(lang) {
  method getNodeModulePath (line 62) | getNodeModulePath(loc, relative) {
  method load (line 91) | load(loc, relative) {
  method loadPlugin (line 109) | loadPlugin(plugins) {

FILE: packages/cli/core/moduleSet.js
  class ModuleSet (line 10) | class ModuleSet {
    method constructor (line 11) | constructor() {
    method add (line 19) | add(file, type) {
    method get (line 34) | get(file) {
    method pending (line 38) | pending(file) {
    method update (line 42) | update(file, data, type) {
    method data (line 50) | data(v) {
    method array (line 58) | array(type) {
    method type (line 67) | type(v) {

FILE: packages/cli/core/parseOptions.js
  constant DEFAULT_OPTIONS (line 4) | const DEFAULT_OPTIONS = {
  constant DEFAULT_CONFIG (line 29) | const DEFAULT_CONFIG = path.resolve('wepy.config.js');
  function setValue (line 31) | function setValue(obj, key, val) {
  function getValue (line 47) | function getValue(obj, key) {
  function check (line 64) | function check(t, val) {
  function parse (line 86) | function parse(opt = {}, baseOpt = DEFAULT_OPTIONS, fromCommandLine) {
  function convert (line 107) | function convert(args) {

FILE: packages/cli/core/plugins/build/vendor.js
  constant VENDOR_INJECTION (line 3) | const VENDOR_INJECTION = [

FILE: packages/cli/core/plugins/compiler/before.js
  constant CONST (line 2) | const CONST = require('../../util/const');

FILE: packages/cli/core/plugins/helper/generateCodeFrame.js
  function indexToLineColumns (line 4) | function indexToLineColumns(code, index) {

FILE: packages/cli/core/plugins/parser/component.js
  constant CONST (line 11) | const CONST = require('../../util/const');
  method wxs (line 84) | wxs(item) {

FILE: packages/cli/core/plugins/template/attrs/ref.js
  function getParseRefFunc (line 4) | function getParseRefFunc(hasBindAttrRef = false) {

FILE: packages/cli/core/plugins/template/directives/condition.js
  constant ADDITIONS_DIRECTIVES_HANDLES (line 1) | const ADDITIONS_DIRECTIVES_HANDLES = {

FILE: packages/cli/core/plugins/template/directives/model.js
  constant CONST (line 1) | const CONST = require('../../../util/const');
  constant MODEL_MAP (line 4) | const MODEL_MAP = {
  function parseModel (line 46) | function parseModel(str) {
  function generateModelFunction (line 119) | function generateModelFunction(expr) {
  function generateModelFunctionInScope (line 142) | function generateModelFunctionInScope(scope, iterators, expr) {

FILE: packages/cli/core/plugins/template/directives/v-on.js
  constant CONST (line 3) | const CONST = require('./../../../util/const');

FILE: packages/cli/core/plugins/template/parse.js
  function decodeAttr (line 44) | function decodeAttr(value) {

FILE: packages/cli/core/tag.js
  constant HTML_TAGS (line 4) | const HTML_TAGS = [
  constant WXML_TAGS (line 40) | const WXML_TAGS = [
  constant HTML2WXML_MAP (line 65) | const HTML2WXML_MAP = {
  constant SELF_CLOSE_TAGS (line 79) | const SELF_CLOSE_TAGS = [

FILE: packages/cli/core/util/ast.js
  constant ECMA_VERSION (line 3) | const ECMA_VERSION = 2017;
  constant POSSIBLE_AST_OPTIONS (line 5) | const POSSIBLE_AST_OPTIONS = [

FILE: packages/cli/core/util/error.js
  method warn (line 5) | warn(msg, file, codeFrame, location) {
  method error (line 14) | error(msg, file, codeFrame, location) {

FILE: packages/cli/core/util/hash.js
  method hash (line 5) | hash(s) {
  method hashFile (line 10) | hashFile(path) {

FILE: packages/cli/core/util/xmllint.js
  constant DEFAULT_RULES (line 3) | const DEFAULT_RULES = {
  method verify (line 34) | verify(html, rules) {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-0.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-1.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-10.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-11.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-12.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-13.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-14.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-15.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-2.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-3.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-4.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-5.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-6.tap.js
  function proxy (line 1) | function proxy (item) {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-7.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-8.tap.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/fixtures/template/assert/v-on/0-9.click-right.js
  function proxy (line 1) | function proxy () {

FILE: packages/cli/test/core/init/plugin.test.js
  method error (line 39) | error() {}

FILE: packages/cli/test/core/plugins/helper/sfcCustomBlock.test.js
  function createCompile (line 8) | function createCompile() {

FILE: packages/cli/test/core/plugins/template/parse.test.js
  function cached (line 10) | function cached(fn) {
  function createLogger (line 66) | function createLogger(type) {
  function createCompiler (line 79) | function createCompiler(options = {}) {
  function assetHanlder (line 103) | function assetHanlder(handlers) {
  function assertCodegen (line 125) | function assertCodegen(originalRaw, assertRaw, options = {}, ctx, done) {

FILE: packages/compiler-babel/test/fixtures/app.js
  method onLaunch (line 4) | onLaunch() {

FILE: packages/compiler-babel/test/helper/ast.js
  constant ECMA_VERSION (line 3) | const ECMA_VERSION = 2017;
  constant POSSIBLE_AST_OPTIONS (line 5) | const POSSIBLE_AST_OPTIONS = [

FILE: packages/compiler-babel/test/helper/index.js
  method getNameForExpression (line 2) | getNameForExpression(expression) {

FILE: packages/compiler-babel/test/index.test.js
  class Hook (line 9) | class Hook {
    method constructor (line 10) | constructor() {
    method register (line 14) | register(key, fn) {
    method hook (line 20) | hook(key, ...args) {
    method hookUnique (line 23) | hookUnique(key, ...args) {
    method clear (line 31) | clear() {
  function createWalker (line 36) | function createWalker() {
  function createCompile (line 47) | function createCompile(opt) {
  function testFixture (line 67) | function testFixture(file) {

FILE: packages/compiler-less/createPlugin.js
  function createPlugin (line 9) | function createPlugin(compliation) {

FILE: packages/compiler-less/test/helpers/specs.js
  function compareArrayGe (line 44) | function compareArrayGe(arr1, arr2) {
  function versionFilter (line 50) | function versionFilter(name) {
  method getIds (line 74) | getIds() {
  method getId (line 84) | getId(id) {
  method getOpt (line 87) | getOpt(id) {
  method getResolveOpt (line 90) | getResolveOpt(id) {
  method getLesscOpt (line 93) | getLesscOpt(id) {
  method getReplacements (line 96) | getReplacements(id) {

FILE: packages/compiler-less/test/index.test.js
  class Hook (line 10) | class Hook {
    method constructor (line 11) | constructor() {
    method register (line 16) | register(key, fn) {
    method hook (line 20) | hook(key, ...args) {
    method clear (line 23) | clear() {
  function createCompile (line 28) | function createCompile(lessOpt, resolveOpt) {
  function readSpec (line 68) | function readSpec(id, isFailSpec) {
  function compare (line 81) | function compare(id, done) {
  function compileFail (line 97) | function compileFail(id, done) {

FILE: packages/compiler-postcss/test/helpers/specs.js
  method getIds (line 28) | getIds() {
  method getId (line 38) | getId(id) {
  method getOpt (line 41) | getOpt(id) {
  method getResolveOpt (line 44) | getResolveOpt(id) {
  method getReplacements (line 47) | getReplacements(id) {

FILE: packages/compiler-postcss/test/index.test.js
  class Hook (line 10) | class Hook {
    method register (line 11) | register(key, fn) {
    method hook (line 15) | hook(key, ...args) {
    method clear (line 18) | clear() {
  function createCompile (line 23) | function createCompile(postcssOpt, resolveOpt) {
  function readSpec (line 54) | function readSpec(id) {
  function compare (line 67) | function compare(id, done) {

FILE: packages/compiler-sass/importsToResolve.js
  function importsToResolve (line 16) | function importsToResolve(url) {

FILE: packages/compiler-sass/index.js
  function createSassPlugin (line 15) | function createSassPlugin(compilation, type, options) {

FILE: packages/compiler-sass/resolveImporter.js
  function resolveImporter (line 6) | function resolveImporter(compilation, file) {

FILE: packages/compiler-sass/test/helpers/specs.js
  method getIds (line 25) | getIds() {
  method getId (line 35) | getId(id) {
  method getOpt (line 38) | getOpt(id) {
  method getResolveOpt (line 41) | getResolveOpt(id) {
  method getReplacements (line 44) | getReplacements(id) {

FILE: packages/compiler-sass/test/index.test.js
  class Hook (line 10) | class Hook {
    method register (line 11) | register(key, fn) {
    method hook (line 15) | hook(key, ...args) {
    method clear (line 18) | clear() {
  function createCompile (line 23) | function createCompile(sassOpt, resolveOpt) {
  function readSpec (line 54) | function readSpec(id) {
  function compare (line 67) | function compare(id, done) {

FILE: packages/compiler-stylus/createPlugin.js
  function createPlugin (line 6) | function createPlugin(compliation) {

FILE: packages/compiler-stylus/test/helpers/specs.js
  method getIds (line 44) | getIds() {
  method getId (line 54) | getId(id) {
  method getOpt (line 57) | getOpt(id) {
  method getResolveOpt (line 60) | getResolveOpt(id) {
  method getStyluscOpt (line 63) | getStyluscOpt(id) {
  method getReplacements (line 66) | getReplacements(id) {

FILE: packages/compiler-stylus/test/index.test.js
  class Hook (line 10) | class Hook {
    method constructor (line 11) | constructor() {}
    method register (line 13) | register(key, fn) {
    method hook (line 17) | hook(key, ...args) {
    method clear (line 20) | clear() {
  function createCompile (line 25) | function createCompile(stylusOpt, resolveOpt) {
  function readSpec (line 65) | function readSpec(id, isFailSpec) {
  function compare (line 78) | function compare(id, done) {
  function compileFail (line 94) | function compileFail(id, done) {

FILE: packages/core/ant/apis/index.js
  function initGlobalAPI (line 7) | function initGlobalAPI(wepy) {

FILE: packages/core/ant/class/WepyComponent.js
  class WepyComponent (line 6) | class WepyComponent extends Base {
    method $watch (line 7) | $watch(expOrFn, cb, options) {
    method $forceUpdate (line 33) | $forceUpdate() {

FILE: packages/core/ant/class/WepyPage.js
  class WepyPage (line 6) | class WepyPage extends WepyComponent {
    method $launch (line 7) | $launch(url, params) {
    method $navigate (line 10) | $navigate(url, params) {
    method $redirect (line 14) | $redirect(url, params) {
    method $back (line 18) | $back(p = {}) {
    method $route (line 26) | $route(type, url, params = {}) {

FILE: packages/core/ant/init/events.js
  function initEvents (line 4) | function initEvents(vm) {

FILE: packages/core/ant/init/lifecycle.js
  function patchAppLifecycle (line 57) | function patchAppLifecycle(appConfig, options, rel = {}) {
  function patchLifecycle (line 87) | function patchLifecycle(output, options, rel, isComponent) {

FILE: packages/core/ant/init/methods.js
  function initMethods (line 7) | function initMethods(vm, methods) {
  function patchMethods (line 18) | function patchMethods(output, methods, isComponent) {

FILE: packages/core/ant/init/props.js
  function patchProps (line 23) | function patchProps(output, props) {
  function initProps (line 55) | function initProps(vm, properties) {

FILE: packages/core/ant/native/app.js
  function app (line 3) | function app(option, rel) {

FILE: packages/core/ant/native/component.js
  function component (line 3) | function component(opt = {}, rel) {

FILE: packages/core/ant/native/page.js
  function page (line 3) | function page(opt = {}, rel) {

FILE: packages/core/dist/wepy.ant.js
  function getHasProto (line 4) | function getHasProto() {
  function Set (line 23) | function Set() {
  function isNative (line 41) | function isNative(Ctor) {
  function isObject (line 70) | function isObject(obj) {
  function isPlainObject (line 80) | function isPlainObject(obj) {
  function hasOwn (line 88) | function hasOwn(obj, key) {
  function noop (line 98) | function noop(a, b, c) {}
  function isValidArrayIndex (line 103) | function isValidArrayIndex(val) {
  function toArray (line 111) | function toArray(list, start) {
  function extend (line 145) | function extend() {
  function clone (line 222) | function clone(sth, deep) {
  function handleError (line 278) | function handleError(err, vm, info) {
  function globalHandleError (line 298) | function globalHandleError(err, vm, info) {
  function logError (line 309) | function logError(err, vm, info) {
  function flushCallbacks (line 325) | function flushCallbacks() {
  function nextTick (line 394) | function nextTick(cb, ctx) {
  function renderFlushCallbacks (line 425) | function renderFlushCallbacks() {
  function renderNextTick (line 433) | function renderNextTick(cb, ctx) {
  function remove (line 472) | function remove(arr, item) {
  function def (line 484) | function def(obj, key, val, enumerable) {
  function parsePath (line 497) | function parsePath(path) {
  function pushTarget (line 552) | function pushTarget(_target) {
  function popTarget (line 557) | function popTarget() {
  function addPaths (line 651) | function addPaths(newKey, op, parentOp) {
  function cleanPaths (line 668) | function cleanPaths(oldKey, op, parentOp) {
  function getPathMap (line 681) | function getPathMap(key, pathKeys, pathMap) {
  function delInvalidPaths (line 764) | function delInvalidPaths(key, value, parent) {
  function protoAugment (line 886) | function protoAugment(target, src) {
  function copyAugment (line 897) | function copyAugment(target, src, keys) {
  function observe (line 909) | function observe(ref) {
  function defineReactive (line 941) | function defineReactive(ref) {
  function set (line 1024) | function set(vm, target, key, val) {
  function del (line 1069) | function del(target, key) {
  function dependArray (line 1099) | function dependArray(value) {
  function traverse (line 1207) | function traverse(val) {
  function _traverse (line 1212) | function _traverse(val, seen) {
  function resetSchedulerState (line 1250) | function resetSchedulerState() {
  function flushSchedulerQueue (line 1262) | function flushSchedulerQueue(times) {
  function queueWatcher (line 1357) | function queueWatcher(watcher) {
  function WepyComponent (line 1591) | function WepyComponent () {
  function proxy (line 1664) | function proxy(target, sourceKey, key) {
  function patchData (line 1677) | function patchData(output, data) {
  function initData (line 1687) | function initData(vm, data) {
  function initWatch (line 1712) | function initWatch(vm, watch) {
  function createComputedGetter (line 1720) | function createComputedGetter(key) {
  function initComputed (line 1739) | function initComputed(vm, computed) {
  function WepyConstructor (line 1779) | function WepyConstructor(opt) {
  function use (line 1804) | function use(plugin) {
  function mixin (line 1821) | function mixin(options) {
  function WepyApp (line 1828) | function WepyApp() {
  function WepyComponent (line 1840) | function WepyComponent () {
  function WepyPage (line 1890) | function WepyPage () {
  function callUserHook (line 1947) | function callUserHook(vm, hookName, arg) {
  function initHooks (line 1972) | function initHooks(vm, hooks) {
  function patchProps (line 1996) | function patchProps(output, props) {
  function initProps (line 2028) | function initProps(vm, properties) {
  function initRender (line 2048) | function initRender(vm, keys, computedKeys) {
  function transformParams (line 2116) | function transformParams(dataset, type, hasModel) {
  function initMethods (line 2201) | function initMethods(vm, methods) {
  function patchMethods (line 2212) | function patchMethods(output, methods, isComponent) {
  function initEvents (line 2256) | function initEvents(vm) {
  function patchAppLifecycle (line 2383) | function patchAppLifecycle(appConfig, options, rel) {
  function patchLifecycle (line 2421) | function patchLifecycle(output, options, rel, isComponent) {
  function getStrategy (line 2613) | function getStrategy(key) {
  function defaultStrat (line 2623) | function defaultStrat(output, option, key, data) {
  function simpleMerge (line 2629) | function simpleMerge(parentVal, childVal) {
  function initStrats (line 2633) | function initStrats() {
  function patchMixins (line 2660) | function patchMixins(output, option, mixins) {
  function patchRelations (line 2687) | function patchRelations(output, relations) {
  function app$1 (line 2694) | function app$1(option, rel) {
  function component (line 2703) | function component(opt, rel) {
  function page (line 2738) | function page(opt, rel) {
  function initGlobalAPI (line 2769) | function initGlobalAPI(wepy) {

FILE: packages/core/dist/wepy.js
  function getHasProto (line 4) | function getHasProto() {
  function Set (line 23) | function Set() {
  function isNative (line 41) | function isNative(Ctor) {
  function isObject (line 70) | function isObject(obj) {
  function isPlainObject (line 80) | function isPlainObject(obj) {
  function hasOwn (line 88) | function hasOwn(obj, key) {
  function noop (line 98) | function noop(a, b, c) {}
  function isValidArrayIndex (line 103) | function isValidArrayIndex(val) {
  function toArray (line 111) | function toArray(list, start) {
  function extend (line 145) | function extend() {
  function clone (line 222) | function clone(sth, deep) {
  function handleError (line 278) | function handleError(err, vm, info) {
  function globalHandleError (line 298) | function globalHandleError(err, vm, info) {
  function logError (line 309) | function logError(err, vm, info) {
  function flushCallbacks (line 325) | function flushCallbacks() {
  function nextTick (line 394) | function nextTick(cb, ctx) {
  function renderFlushCallbacks (line 425) | function renderFlushCallbacks() {
  function renderNextTick (line 433) | function renderNextTick(cb, ctx) {
  function remove (line 472) | function remove(arr, item) {
  function def (line 484) | function def(obj, key, val, enumerable) {
  function parsePath (line 497) | function parsePath(path) {
  function pushTarget (line 552) | function pushTarget(_target) {
  function popTarget (line 557) | function popTarget() {
  function addPaths (line 651) | function addPaths(newKey, op, parentOp) {
  function cleanPaths (line 668) | function cleanPaths(oldKey, op, parentOp) {
  function getPathMap (line 681) | function getPathMap(key, pathKeys, pathMap) {
  function delInvalidPaths (line 764) | function delInvalidPaths(key, value, parent) {
  function protoAugment (line 886) | function protoAugment(target, src) {
  function copyAugment (line 897) | function copyAugment(target, src, keys) {
  function observe (line 909) | function observe(ref) {
  function defineReactive (line 941) | function defineReactive(ref) {
  function set (line 1024) | function set(vm, target, key, val) {
  function del (line 1069) | function del(target, key) {
  function dependArray (line 1099) | function dependArray(value) {
  function traverse (line 1207) | function traverse(val) {
  function _traverse (line 1212) | function _traverse(val, seen) {
  function resetSchedulerState (line 1250) | function resetSchedulerState() {
  function flushSchedulerQueue (line 1262) | function flushSchedulerQueue(times) {
  function queueWatcher (line 1357) | function queueWatcher(watcher) {
  function WepyComponent (line 1591) | function WepyComponent () {
  function proxy (line 1664) | function proxy(target, sourceKey, key) {
  function patchData (line 1677) | function patchData(output, data) {
  function initData (line 1687) | function initData(vm, data) {
  function initWatch (line 1712) | function initWatch(vm, watch) {
  function createComputedGetter (line 1720) | function createComputedGetter(key) {
  function initComputed (line 1739) | function initComputed(vm, computed) {
  function WepyConstructor (line 1779) | function WepyConstructor(opt) {
  function use (line 1804) | function use(plugin) {
  function mixin (line 1821) | function mixin(options) {
  function WepyApp (line 1828) | function WepyApp() {
  function WepyPage (line 1840) | function WepyPage () {
  function callUserHook (line 1897) | function callUserHook(vm, hookName, arg) {
  function initHooks (line 1922) | function initHooks(vm, hooks) {
  function patchProps (line 1948) | function patchProps(output, props) {
  function initProps (line 2009) | function initProps(vm, properties) {
  function initRender (line 2029) | function initRender(vm, keys, computedKeys) {
  function transformParams (line 2097) | function transformParams(dataset, type, hasModel) {
  function initMethods (line 2182) | function initMethods(vm, methods) {
  function patchMethods (line 2193) | function patchMethods(output, methods) {
  function patchAppLifecycle (line 2336) | function patchAppLifecycle(appConfig, options, rel) {
  function patchLifecycle (line 2374) | function patchLifecycle(output, options, rel, isComponent) {
  function getStrategy (line 2594) | function getStrategy(key) {
  function defaultStrat (line 2604) | function defaultStrat(output, option, key, data) {
  function simpleMerge (line 2610) | function simpleMerge(parentVal, childVal) {
  function initStrats (line 2614) | function initStrats() {
  function patchMixins (line 2641) | function patchMixins(output, option, mixins) {
  function patchRelations (line 2668) | function patchRelations(output, relations) {
  function app$1 (line 2675) | function app$1(option, rel) {
  function component (line 2684) | function component(opt, rel) {
  function page (line 2717) | function page(opt, rel) {
  function initGlobalAPI (line 2748) | function initGlobalAPI(wepy) {

FILE: packages/core/shared/constants.js
  constant WEAPP_APP_LIFECYCLE (line 1) | const WEAPP_APP_LIFECYCLE = [
  constant WEAPP_PAGE_LIFECYCLE (line 11) | const WEAPP_PAGE_LIFECYCLE = [
  constant WEAPP_COMPONENT_LIFECYCLE (line 27) | const WEAPP_COMPONENT_LIFECYCLE = ['beforeCreate', 'created', 'attached'...
  constant WEAPP_COMPONENT_PAGE_LIFECYCLE (line 29) | const WEAPP_COMPONENT_PAGE_LIFECYCLE = ['show', 'hide', 'resize'];
  constant WEAPP_LIFECYCLE (line 31) | const WEAPP_LIFECYCLE = []

FILE: packages/core/shared/env.js
  function getHasProto (line 2) | function getHasProto() {
  method constructor (line 21) | constructor() {
  method has (line 24) | has(key) {
  method add (line 27) | add(key) {
  method clear (line 30) | clear() {
  function isNative (line 39) | function isNative(Ctor) {

FILE: packages/core/shared/extend.js
  function extend (line 10) | function extend() {
  function clone (line 85) | function clone(sth, deep = true) {

FILE: packages/core/shared/util.js
  function isObject (line 26) | function isObject(obj) {
  function isPlainObject (line 36) | function isPlainObject(obj) {
  function hasOwn (line 44) | function hasOwn(obj, key) {
  function noop (line 54) | function noop(a, b, c) {}
  function isValidArrayIndex (line 59) | function isValidArrayIndex(val) {
  function toArray (line 67) | function toArray(list, start = 0) {

FILE: packages/core/test/mock/api/createSelectorQuery.js
  method query (line 3) | query(selector) {

FILE: packages/core/test/mock/wxapi.js
  class MockWxAPI (line 4) | class MockWxAPI {
    method constructor (line 5) | constructor() {
    method init (line 10) | init() {
    method mock (line 19) | mock(api, fn) {
    method unmock (line 27) | unmock(api) {

FILE: packages/core/test/weapp/helper/index.js
  function createApp (line 5) | function createApp(opt = {}) {
  function createPage (line 10) | function createPage(opt = {}) {
  function createOriginalApp (line 19) | function createOriginalApp(opt) {
  function createOriginalPage (line 26) | function createOriginalPage(opt) {
  function simulateOriginalEvent (line 34) | function simulateOriginalEvent(type, opt) {
  function simulateOriginalWePYEvent (line 50) | function simulateOriginalWePYEvent(type, evtid, params) {
  function addEventListener (line 62) | function addEventListener(comp, type, handler) {

FILE: packages/core/test/weapp/helper/libs/App.js
  class App (line 1) | class App {}

FILE: packages/core/test/weapp/helper/libs/Component.js
  class Page (line 1) | class Page {
    method setData (line 2) | setData() {}

FILE: packages/core/test/weapp/helper/libs/Page.js
  class Page (line 1) | class Page {
    method setData (line 2) | setData() {}

FILE: packages/core/test/weapp/init/lifecycle.test.js
  method onShow (line 66) | onShow() {
  method ready (line 103) | ready() {
  method routed (line 133) | routed(oldRoute, newRoute) {
  method routed (line 163) | routed(oldRoute, newRoute) {

FILE: packages/core/types/options.d.ts
  type Constructor (line 4) | type Constructor = {
  type Accessors (line 14) | type Accessors<T> = {
  type DataDef (line 18) | type DataDef<Data, Props, V> = Data | ((this: Readonly<Props> & V) => Data)
  type ThisTypedComponentOptionsWithArrayProps (line 22) | type ThisTypedComponentOptionsWithArrayProps<V extends WepyInstace, Data...
  type ThisTypedComponentOptionsWithRecordProps (line 30) | type ThisTypedComponentOptionsWithRecordProps<V extends WepyInstace, Dat...
  type DefaultData (line 35) | type DefaultData<V> =  object | ((this: V) => object);
  type DefaultProps (line 36) | type DefaultProps = Record<string, any>;
  type DefaultMethods (line 37) | type DefaultMethods<V> =  { [key: string]: (this: V, ...args: any[]) => ...
  type DefaultHooks (line 38) | type DefaultHooks<V> =  { [key: string]: (this: V, ...args: any[]) => an...
  type DefaultComputed (line 39) | type DefaultComputed = { [key: string]: any };
  type AppOptions (line 43) | interface AppOptions<
  type ComponentOptions (line 49) | interface ComponentOptions<
  type RenderContext (line 79) | interface RenderContext<Props=DefaultProps> {
  type Prop (line 86) | type Prop<T> = { (): T } | { new(...args: any[]): T & object }
  type PropType (line 88) | type PropType<T> = Prop<T> | Prop<T>[];
  type PropValidator (line 90) | type PropValidator<T> = PropOptions<T> | PropType<T>;
  type PropOptions (line 92) | interface PropOptions<T=any> {
  type RecordPropsDefinition (line 99) | type RecordPropsDefinition<T> = {
  type ArrayPropsDefinition (line 102) | type ArrayPropsDefinition<T> = (keyof T)[];
  type PropsDefinition (line 103) | type PropsDefinition<T> = ArrayPropsDefinition<T> | RecordPropsDefinitio...
  type ComputedOptions (line 105) | interface ComputedOptions<T> {
  type WatchHandler (line 111) | type WatchHandler<T> = (val: T, oldVal: T) => void;
  type WatchOptions (line 113) | interface WatchOptions {
  type WatchOptionsWithHandler (line 118) | interface WatchOptionsWithHandler<T> extends WatchOptions {
  type InjectKey (line 121) | type InjectKey = string | symbol;
  type InjectOptions (line 123) | type InjectOptions = {

FILE: packages/core/types/plugin.d.ts
  type PluginFunction (line 3) | type PluginFunction<T> = (wepy: typeof _wepy, options?: T) => void;
  type PluginObject (line 5) | interface PluginObject<T> {

FILE: packages/core/types/test/wepy.app.test.ts
  method onLaunch (line 10) | onLaunch(option) {
  method onError (line 14) | onError(e) {

FILE: packages/core/types/test/wepy.component.test.ts
  method created (line 21) | created() {
  method onLoad (line 29) | onLoad (option) {
  method onShow (line 33) | onShow() {
  method bindtap (line 38) | bindtap () {
  method initData (line 41) | initData () {

FILE: packages/core/types/test/wepy.page.test.ts
  method created (line 15) | created() {
  method onLoad (line 23) | onLoad (option) {
  method onShow (line 28) | onShow() {
  method onPageScroll (line 32) | onPageScroll () {
  method onReachBottom (line 36) | onReachBottom () {
  method onPullDownRefresh (line 40) | onPullDownRefresh () {
  method onShareAppMessage (line 43) | onShareAppMessage (): Page.ICustomShareContent {
  method onShareTimeline (line 50) | onShareTimeline (): Page.IAddToFavoritesContent {
  method onAddToFavorites (line 57) | onAddToFavorites (): Page.IAddToFavoritesContent {
  method bindtap (line 66) | bindtap () {
  method sleep (line 69) | sleep (s: number) {
  method testAsync (line 78) | async testAsync () {

FILE: packages/core/types/test/wepy.test.ts
  method useDefinedMethod (line 21) | useDefinedMethod (): string {
  method commonFunc (line 31) | commonFunc () {

FILE: packages/core/types/wepy.d.ts
  type Base (line 13) | interface Base {
  type WepyApp (line 23) | interface WepyApp extends Base {
  type WepyComponent (line 26) | interface WepyComponent extends Base {
  type WepyPage (line 39) | interface WepyPage extends WepyComponent {
  type WepyInstace (line 47) | type WepyInstace = WepyPage | WepyComponent;
  type Vue (line 49) | interface Vue {
  type CombineWepyInstance (line 89) | type CombineWepyInstance<Instance extends WepyInstace, Data, Methods, Ho...
  type WepyConfiguration (line 91) | interface WepyConfiguration {
  type WepyConstructor (line 95) | interface WepyConstructor<V extends WepyInstace = WepyInstace, P extends...

FILE: packages/core/types/wx/lib.wx.app.d.ts
  type AppInstance (line 18) | interface AppInstance<T extends WechatMiniprogram.IAnyObject = {}> {
  type AppConstructor (line 30) | interface AppConstructor {

FILE: packages/core/types/wx/lib.wx.page.d.ts
  type PageInstanceBaseProps (line 18) | interface PageInstanceBaseProps<D extends WechatMiniprogram.IAnyObject =...
  type PageInstance (line 55) | interface PageInstance<D extends WechatMiniprogram.IAnyObject = any, T e...
  type PageConstructor (line 81) | interface PageConstructor {
  type GetCurrentPages (line 87) | interface GetCurrentPages {

FILE: packages/core/weapp/apis/index.js
  function initGlobalAPI (line 7) | function initGlobalAPI(wepy) {

FILE: packages/core/weapp/apis/mixin.js
  function mixin (line 3) | function mixin(options = {}) {

FILE: packages/core/weapp/apis/use.js
  function use (line 3) | function use(plugin, ...args) {

FILE: packages/core/weapp/class/Base.js
  class Base (line 4) | class Base {
    method constructor (line 5) | constructor() {
    method $set (line 10) | $set(target, key, val) {
    method $delete (line 14) | $delete(target, key) {
    method $on (line 18) | $on(event, fn) {
    method $once (line 33) | $once() {}
    method $off (line 35) | $off(event, fn) {
    method $emit (line 72) | $emit(event) {

FILE: packages/core/weapp/class/Dirty.js
  class Dirty (line 3) | class Dirty {
    method constructor (line 4) | constructor(type) {
    method push (line 11) | push(key, path, keyValue, pathValue) {
    method pop (line 20) | pop() {
    method get (line 31) | get(type) {
    method set (line 38) | set(op, key, value) {
    method reset (line 59) | reset() {
    method length (line 66) | length() {

FILE: packages/core/weapp/class/Event.js
  class Event (line 1) | class Event {
    method constructor (line 2) | constructor(e) {

FILE: packages/core/weapp/class/WepyApp.js
  class WepyApp (line 3) | class WepyApp extends Base {
    method constructor (line 4) | constructor() {

FILE: packages/core/weapp/class/WepyComponent.js
  class WepyComponent (line 7) | class WepyComponent extends Base {
    method $watch (line 8) | $watch(expOrFn, cb, options) {
    method $forceUpdate (line 34) | $forceUpdate() {
    method $emit (line 40) | $emit(event, ...args) {
    method $trigger (line 52) | $trigger(event, data, option) {

FILE: packages/core/weapp/class/WepyConstructor.js
  class WepyConstructor (line 6) | class WepyConstructor extends WepyComponent {
    method constructor (line 7) | constructor(opt = {}) {

FILE: packages/core/weapp/class/WepyPage.js
  class WepyPage (line 4) | class WepyPage extends WepyComponent {
    method $launch (line 5) | $launch(url, params) {
    method $navigate (line 8) | $navigate(url, params) {
    method $redirect (line 12) | $redirect(url, params) {
    method $back (line 16) | $back(p = {}) {
    method $route (line 24) | $route(type, url, params = {}) {

FILE: packages/core/weapp/dispatcher/index.js
  function transformParams (line 8) | function transformParams(dataset, type, hasModel = false) {

FILE: packages/core/weapp/init/computed.js
  function createComputedGetter (line 5) | function createComputedGetter(key) {
  function initComputed (line 24) | function initComputed(vm, computed) {

FILE: packages/core/weapp/init/data.js
  function proxy (line 11) | function proxy(target, sourceKey, key) {
  function patchData (line 24) | function patchData(output, data) {
  function initData (line 34) | function initData(vm, data) {

FILE: packages/core/weapp/init/hooks.js
  function callUserHook (line 3) | function callUserHook(vm, hookName, arg) {
  function initHooks (line 28) | function initHooks(vm, hooks = {}) {

FILE: packages/core/weapp/init/lifecycle.js
  function patchAppLifecycle (line 64) | function patchAppLifecycle(appConfig, options, rel = {}) {
  function patchLifecycle (line 94) | function patchLifecycle(output, options, rel, isComponent) {
  function patchComponentLifecycle (line 177) | function patchComponentLifecycle(output, options, rel) {
  function patchPageLifecycle (line 214) | function patchPageLifecycle(output, options, rel) {
  function patchRouted (line 294) | function patchRouted(output) {

FILE: packages/core/weapp/init/methods.js
  function initMethods (line 7) | function initMethods(vm, methods) {
  function patchMethods (line 18) | function patchMethods(output, methods) {

FILE: packages/core/weapp/init/mixins.js
  function getStrategy (line 36) | function getStrategy(key) {
  function defaultStrat (line 46) | function defaultStrat(output, option, key, data) {
  function simpleMerge (line 52) | function simpleMerge(parentVal, childVal) {
  function initStrats (line 56) | function initStrats() {
  function patchMixins (line 83) | function patchMixins(output, option, mixins) {

FILE: packages/core/weapp/init/props.js
  function patchProps (line 25) | function patchProps(output, props) {
  function initProps (line 91) | function initProps(vm, properties) {

FILE: packages/core/weapp/init/relations.js
  function patchRelations (line 1) | function patchRelations(output, relations) {

FILE: packages/core/weapp/init/render.js
  function resetDirty (line 6) | function resetDirty(vm) {
  function initRender (line 11) | function initRender(vm, keys, computedKeys) {

FILE: packages/core/weapp/init/watch.js
  function initWatch (line 1) | function initWatch(vm, watch) {

FILE: packages/core/weapp/native/app.js
  function app (line 3) | function app(option, rel) {

FILE: packages/core/weapp/native/component.js
  function component (line 3) | function component(opt = {}, rel) {

FILE: packages/core/weapp/native/page.js
  function page (line 3) | function page(opt = {}, rel) {

FILE: packages/core/weapp/observer/array.js
  function delInvalidPaths (line 63) | function delInvalidPaths(key, value, parent) {

FILE: packages/core/weapp/observer/dep.js
  class Dep (line 10) | class Dep {
    method constructor (line 11) | constructor() {
    method addSub (line 16) | addSub(sub) {
    method removeSub (line 20) | removeSub(sub) {
    method depend (line 24) | depend() {
    method notify (line 30) | notify() {
  function pushTarget (line 45) | function pushTarget(_target) {
  function popTarget (line 50) | function popTarget() {

FILE: packages/core/weapp/observer/index.js
  class Observer (line 24) | class Observer {
    method constructor (line 25) | constructor({ vm, key, value, parent }) {
    method walk (line 47) | walk(key, obj) {
    method observeArray (line 58) | observeArray(key, items) {
    method hasPath (line 67) | hasPath(path) {
    method isPathEq (line 89) | isPathEq(path, value) {
  function protoAugment (line 118) | function protoAugment(target, src) {
  function copyAugment (line 129) | function copyAugment(target, src, keys) {
  function observe (line 141) | function observe({ vm, key, value, parent, root }) {
  function defineReactive (line 167) | function defineReactive({ vm, obj, key, value, parent, customSetter, sha...
  function set (line 242) | function set(vm, target, key, val) {
  function del (line 287) | function del(target, key) {
  function dependArray (line 317) | function dependArray(value) {

FILE: packages/core/weapp/observer/observerPath.js
  class ObserverPath (line 27) | class ObserverPath {
    method constructor (line 28) | constructor(key, ob, parentOp) {
    method traverseOp (line 41) | traverseOp(key, pathKeys, pathMap, handler) {
    method addPath (line 76) | addPath(pathObj) {
    method delPath (line 81) | delPath(path) {
  function addPaths (line 90) | function addPaths(newKey, op, parentOp) {
  function cleanPaths (line 107) | function cleanPaths(oldKey, op, parentOp) {
  function getPathMap (line 120) | function getPathMap(key, pathKeys, pathMap) {

FILE: packages/core/weapp/observer/scheduler.js
  constant MAX_UPDATE_COUNT (line 5) | const MAX_UPDATE_COUNT = 100;
  function resetSchedulerState (line 18) | function resetSchedulerState() {
  function flushSchedulerQueue (line 30) | function flushSchedulerQueue(times = 0) {
  function queueActivatedComponent (line 125) | function queueActivatedComponent(vm) {
  function queueWatcher (line 146) | function queueWatcher(watcher) {

FILE: packages/core/weapp/observer/traverse.js
  function traverse (line 10) | function traverse(val) {
  function _traverse (line 15) | function _traverse(val, seen) {

FILE: packages/core/weapp/observer/watcher.js
  class Watcher (line 16) | class Watcher {
    method constructor (line 17) | constructor(vm, expOrFn, cb, options, isRenderWatcher) {
    method get (line 64) | get() {
    method addDep (line 91) | addDep(dep) {
    method cleanupDeps (line 105) | cleanupDeps() {
    method update (line 127) | update() {
    method run (line 142) | run() {
    method evaluate (line 173) | evaluate() {
    method depend (line 189) | depend() {
    method teardown (line 201) | teardown() {

FILE: packages/core/weapp/util/error.js
  function handleError (line 4) | function handleError(err, vm, info) {
  function globalHandleError (line 24) | function globalHandleError(err, vm, info) {
  function logError (line 35) | function logError(err, vm, info) {

FILE: packages/core/weapp/util/index.js
  function remove (line 11) | function remove(arr, item) {
  function isReserved (line 23) | function isReserved(str) {
  function def (line 31) | function def(obj, key, val, enumerable) {
  function parsePath (line 44) | function parsePath(path) {

FILE: packages/core/weapp/util/model.js
  function parseModel (line 15) | function parseModel(str) {

FILE: packages/core/weapp/util/next-tick.js
  function flushCallbacks (line 10) | function flushCallbacks() {
  function withMacroTask (line 83) | function withMacroTask(fn) {
  function nextTick (line 95) | function nextTick(cb, ctx) {
  function renderFlushCallbacks (line 126) | function renderFlushCallbacks() {
  function renderNextTick (line 134) | function renderNextTick(cb, ctx) {

FILE: packages/plugin-define/test/index.test.js
  function createCompile (line 5) | function createCompile(pluginOpt) {

FILE: packages/plugin-eslint/index.js
  function lint (line 15) | function lint(engine, file) {
  function printLinterOutput (line 19) | function printLinterOutput(res, options) {

FILE: packages/plugin-uglifyjs/index.js
  function formatSizeUnits (line 16) | function formatSizeUnits(bytes) {

FILE: packages/redux/dist/index.js
  function normalizeMap (line 5) | function normalizeMap(map) {
  function wepyInstall (line 69) | function wepyInstall(wepy) {
  function checkReduxComputed (line 131) | function checkReduxComputed(options) {

FILE: packages/redux/helper.js
  function normalizeMap (line 1) | function normalizeMap(map) {

FILE: packages/redux/install.js
  function wepyInstall (line 1) | function wepyInstall(wepy) {
  function checkReduxComputed (line 59) | function checkReduxComputed(options) {

FILE: packages/router/core/config.js
  function setConfig (line 12) | function setConfig(obj) {

FILE: packages/router/core/createRouter.js
  function createRouter (line 16) | function createRouter(config) {

FILE: packages/router/core/guard/createComponentGuard.js
  function createComponentGuard (line 4) | function createComponentGuard(name) {

FILE: packages/router/core/guard/createRouterGuard.js
  function createRouterGuard (line 4) | function createRouterGuard(name) {

FILE: packages/router/core/guard/globalGuard.js
  method beforeEachGuards (line 9) | get beforeEachGuards() {
  method beforeResolveGuards (line 12) | get beforeResolveGuards() {
  method afterEachGuards (line 15) | get afterEachGuards() {
  method beforeEach (line 18) | beforeEach(cb) {
  method beforeResolve (line 21) | beforeResolve(cb) {
  method afterEach (line 24) | afterEach(cb) {

FILE: packages/router/core/guard/guardManager.js
  function createGuardManager (line 2) | function createGuardManager() {

FILE: packages/router/core/guard/index.js
  method globalGuard (line 19) | get globalGuard() {
  method routerGuardMap (line 22) | get routerGuardMap() {
  method componentGuardMap (line 25) | get componentGuardMap() {
  method updateRouterGuardMap (line 28) | updateRouterGuardMap(routerGuard) {
  method updateComponentGuardMap (line 31) | updateComponentGuardMap(componentGuard) {
  method hasInRouterGuardMap (line 34) | hasInRouterGuardMap(name) {
  method hasInComponentGuardMap (line 37) | hasInComponentGuardMap(name) {

FILE: packages/router/core/routeManager.js
  method currentVm (line 10) | get currentVm() {
  method next (line 13) | get next() {
  method routes (line 16) | get routes() {
  method route (line 19) | get route() {
  method referrerRoute (line 22) | get referrerRoute() {
  method lastRoute (line 30) | get lastRoute() {
  method setCurrentVm (line 34) | setCurrentVm(vm) {
  method setNext (line 37) | setNext(next) {
  method clearNext (line 40) | clearNext() {
  method createRoute (line 43) | createRoute(params) {
  method setCurrentRoute (line 61) | setCurrentRoute(route) {
  method updateCurrentRoute (line 64) | updateCurrentRoute(params) {
  method pushRoute (line 67) | pushRoute(route) {
  method popRoute (line 72) | popRoute() {
  method clearRoutes (line 75) | clearRoutes() {
  method pushShowRoute (line 78) | pushShowRoute(route) {
  method clearShowRoutes (line 91) | clearShowRoutes() {
  function last (line 98) | function last(list, index = 1) {
  function nthRoute (line 102) | function nthRoute(routes, index) {

FILE: packages/router/core/routerApi.js
  function runGuard (line 53) | async function runGuard({ name, query = {}, delta, jumpMethodName = 'nav...
  function getRoute (line 176) | function getRoute({ pageMethod, pageDelta, realPage, pageData, pageMeta,...
  function handleNavigator (line 188) | function handleNavigator(method, params, { success, fail, complete }) {
  function getRealMethod (line 206) | function getRealMethod({ pageMethod, realPage }) {
  function getNavigatorParams (line 215) | function getNavigatorParams({ pageMethod, pageDelta, realPage, pageData,...
  function type (line 230) | function type(val) {

FILE: packages/router/core/utils/getRealPageInfo.js
  function getRealPageInfo (line 8) | function getRealPageInfo({ name, query, meta }, pages = []) {
  function mergeRight (line 33) | function mergeRight(dataA, dataB) {

FILE: packages/router/core/utils/queue.js
  function runQueue (line 7) | async function runQueue(queue, wrapperFn) {

FILE: packages/router/core/utils/urlParse.js
  function encodeParams (line 14) | function encodeParams(obj, encode = false) {
  function encodeUrl (line 33) | function encodeUrl({ name, query = {} }, { encode = false, isAbsolutePat...
  function decodeParams (line 46) | function decodeParams(fullPath, decode = true) {
  function decodePage (line 62) | function decodePage(fullPath) {
  function decodeUrl (line 74) | function decodeUrl(fullPath, decode = true) {

FILE: packages/router/install.js
  method install (line 18) | install(wepy, router) {
  function handleGuards (line 201) | function handleGuards() {
  function last (line 218) | function last(list, index = 1) {
  function handleTmpRoute (line 223) | function handleTmpRoute() {
  function updateIsExternalJump (line 230) | function updateIsExternalJump(val) {
  function updateIsCallAppShow (line 234) | function updateIsCallAppShow(val) {
  function updateExternalQuery (line 238) | function updateExternalQuery(query) {

FILE: packages/use-intercept/install.js
  function isPromise (line 83) | function isPromise(obj) {
  function install (line 105) | function install(wepy) {

FILE: packages/use-intercept/test/index.test.js
  function ensureAllTaskDone (line 4) | function ensureAllTaskDone(taskList, done) {
  method config (line 80) | config(p) {
  method success (line 86) | success(res) {
  method complete (line 90) | complete(res) {
  method success (line 104) | success(res) {
  method fail (line 108) | fail() {
  method complete (line 111) | complete(res) {
  method config (line 126) | config(p) {
  method success (line 136) | success(res) {
  method complete (line 140) | complete(res) {
  method success (line 154) | success(res) {
  method fail (line 158) | fail() {
  method complete (line 161) | complete(res) {
  method config (line 176) | config(p) {
  method fail (line 186) | fail(e) {
  method success (line 189) | success(res) {
  method complete (line 193) | complete(res) {
  method success (line 207) | success() {
  method fail (line 210) | fail(e) {
  method complete (line 214) | complete() {
  method config (line 228) | config(params) {
  method fail (line 234) | fail(e) {
  method complete (line 238) | complete(res) {
  method success (line 247) | success() {
  method fail (line 250) | fail(e) {
  method complete (line 254) | complete(res) {

FILE: packages/use-promisify/dist/index.js
  function install (line 168) | function install(wepy, removeFromPromisify) {

FILE: packages/use-promisify/install.js
  method success (line 16) | success(res) {
  method fail (line 19) | fail(err) {
  function install (line 165) | function install(wepy, removeFromPromisify) {

FILE: packages/use-promisify/test/index.test.js
  function ensureAllTaskDone (line 4) | function ensureAllTaskDone(taskList, done) {

FILE: packages/x/dist/index.js
  function wepyInstall (line 9) | function wepyInstall(wepy) {

FILE: packages/x/index.js
  function wepyInstall (line 5) | function wepyInstall(wepy) {

FILE: scripts/build.js
  function build (line 7) | function build(config) {
  function write (line 22) | function write(dest, code, zip) {
  function getSize (line 45) | function getSize(code) {
  function blue (line 49) | function blue(str) {

FILE: scripts/ci-release.js
  constant ALLOW_VERSION (line 5) | const ALLOW_VERSION = ['major', 'minor', 'patch', 'premajor', 'preminor'...
  constant ALLOW_TAG (line 6) | const ALLOW_TAG = ['alpha', 'beta', 'next'];
  function parseMsg (line 12) | function parseMsg(msg) {
  function release (line 34) | function release(version, tag) {

FILE: scripts/config.js
  function getConfig (line 70) | function getConfig(name) {

FILE: scripts/npm-tags.js
  function updateAllTag (line 13) | function updateAllTag(oldTag, newTag) {
  function updateOneTag (line 19) | function updateOneTag(pkg, oldTag, newTag) {

FILE: scripts/npm_publish/lib/interact.js
  constant PACKAGES_DIR (line 10) | const PACKAGES_DIR = './packages/';

FILE: scripts/npm_publish/lib/log.js
  method info (line 4) | info(msg) {
  method success (line 8) | success(msg) {
  method error (line 12) | error(e) {

FILE: scripts/release.js
  function interactPublish (line 8) | function interactPublish() {

FILE: scripts/unittest.js
  function testAll (line 21) | function testAll(pkgs) {
  function testOne (line 30) | function testOne(name) {

FILE: test/unit.js
  function testAll (line 22) | function testAll(pkgs) {
  function testOne (line 31) | function testOne(name) {
Condensed preview — 482 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (849K chars).
[
  {
    "path": ".editorconfig",
    "chars": 147,
    "preview": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_"
  },
  {
    "path": ".eslintignore",
    "chars": 188,
    "preview": "/lib\ncoverage/\npackages/*/node_modules\npackages/*/lib\npackages/*/dist\npackages/*/test/fixtures\npackages/*/coverage\npacka"
  },
  {
    "path": ".eslintrc",
    "chars": 502,
    "preview": "{\n  \"parser\": \"babel-eslint\",\n  \"env\": {\n    \"es6\": true,\n    \"node\": true,\n    \"mocha\": true\n  },\n  \"rules\": {\n    \"str"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "chars": 1379,
    "preview": "提交ISSUE前请确保已认真阅读以下内容\n\n*Please read the following information carefully before you open an issue.*\n\n\n在提交issue之前必须确认以下问题:\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "chars": 438,
    "preview": "<!--\nThank you for your pull request. Please provide a description above and review\nthe requirements below.\n\nBug fixes a"
  },
  {
    "path": ".github/stale.yml",
    "chars": 781,
    "preview": "# Number of days of inactivity before an issue becomes stale\ndaysUntilStale: 3600\n# Number of days of inactivity before "
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 1566,
    "preview": "name: WePY CI Build\n\non: [push, pull_request]\n\njobs:\n  build:\n    runs-on: ubuntu-18.04\n    strategy:\n      matrix:\n    "
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 1261,
    "preview": "# This is a basic workflow to help you get started with Actions\n\nname: Release\n\n# Controls when the action will run. Tri"
  },
  {
    "path": ".gitignore",
    "chars": 149,
    "preview": "node_modules/\nsftp-config.json\ndiff\nlog\nnpm-debug.log\ndemo/\n.nyc_output/\n.vscode\ncoverage\nlerna-debug.log\n/packages/*/li"
  },
  {
    "path": ".npmignore",
    "chars": 102,
    "preview": "node_modules/\ncoverage/\ndemo/\ntest/\nISSUE_TEMPLATE.md\nappveyor.yml\nREADME_zh-CN.md\n*.map\nsrc/\ncoverage"
  },
  {
    "path": ".nycrc",
    "chars": 45,
    "preview": "{\n    \"reporter\": [\"lcov\", \"text-summary\"]\n}\n"
  },
  {
    "path": ".prettierrc.yml",
    "chars": 930,
    "preview": "# 一行最多 120 字符\nprintWidth: 120\n# 使用 2 个空格缩进\ntabWidth: 2\n# 不使用缩进符,而使用空格\nuseTabs: false\n# 行尾不需要分号\nsemi: true\n# 使用单引号\nsingle"
  },
  {
    "path": ".travis.yml",
    "chars": 913,
    "preview": "language: node_js\n\nnode_js:\n  - '10'\n\nmatrix:\n  include:\n    - os: linux\n    - os: osx\n\nsudo: false\n\nbefore_install:\n  -"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 1035,
    "preview": "# Change Log\n\n## 2.1.0 (2020-07-04) (beta)\n\n#### :rocket: New Feature\n* `core`\n  * [#2634](https://github.com/Tencent/we"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1927,
    "preview": "# Contributing\n\n我们提倡您通过提 issue 和 pull request 方式来促进 WePY 的发展。\n\n\n## Acknowledgements\n\n非常感谢以下几位贡献者对于 WePY 的做出的贡献:\n\n- dlhan"
  },
  {
    "path": "CONTRIBUTING_COMMIT.md",
    "chars": 1529,
    "preview": "# Commit规范\n\n在对项目作出更改后,我们需要生成 commit 来记录自己的更改。以下是参照 Angular 对 commit 格式的规范:\n\n## (1) 格式\n\n提交信息包括三个部分:`Header`,`Body` 和 `Foo"
  },
  {
    "path": "LICENSE",
    "chars": 4885,
    "preview": "Tencent is pleased to support the open source community by making WePY available.\nCopyright (C) 2017 THL A29 Limited, a "
  },
  {
    "path": "README.md",
    "chars": 4499,
    "preview": "[English](./README_EN.md) | 简体中文\n\n> **📦 项目已归档**\n>\n> 随着微信小程序生态的不断演进,本项目已不再活跃维护。WePY 早已完成了它的历史使命,现有代码已不再具有参考意义,我们建议新项目选用更现"
  },
  {
    "path": "README_EN.md",
    "chars": 6136,
    "preview": "English | [简体中文](./README.md)\n\n> **📦 This project has been archived**\n>\n> As the WeChat Mini Program ecosystem continues"
  },
  {
    "path": "lerna.json",
    "chars": 255,
    "preview": "{\n  \"packages\": [\n    \"packages/*\"\n  ],\n  \"version\": \"2.1.0\",\n  \"message\": \"chore(release): publish\",\n  \"command\": {\n   "
  },
  {
    "path": "package.json",
    "chars": 3633,
    "preview": "{\n  \"name\": \"wepy\",\n  \"version\": \"0.0.0\",\n  \"description\": \"\",\n  \"main\": \"\",\n  \"scripts\": {\n    \"lint\": \"eslint ./ --ext"
  },
  {
    "path": "packages/babel-plugin-import-regenerator/CHANGELOG.md",
    "chars": 1134,
    "preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
  },
  {
    "path": "packages/babel-plugin-import-regenerator/README.md",
    "chars": 551,
    "preview": "[English](./README_EN.md) | [简体中文]\n\n# @wepy/babel-plugin-import-regenerator\n\n允许wepy使用 `Async Functions`.\n\n## 安装\n\n```\n# I"
  },
  {
    "path": "packages/babel-plugin-import-regenerator/README_EN.md",
    "chars": 590,
    "preview": "English | [简体中文](./README.md)\n\n# @wepy/babel-plugin-import-regenerator\n\nAllow wepy to use `Async Functions`.\n\n## Install"
  },
  {
    "path": "packages/babel-plugin-import-regenerator/index.js",
    "chars": 1025,
    "preview": "const helperModelImports = require('@babel/helper-module-imports');\n\nlet wm = new WeakMap();\n\nexports = module.exports ="
  },
  {
    "path": "packages/babel-plugin-import-regenerator/package.json",
    "chars": 915,
    "preview": "{\n  \"name\": \"@wepy/babel-plugin-import-regenerator\",\n  \"version\": \"2.1.0\",\n  \"description\": \"A babel plugin to add a glo"
  },
  {
    "path": "packages/babel-plugin-import-regenerator/test/fixtures/mutiple-async/actual.js",
    "chars": 255,
    "preview": "exports = module.exports = {\n  foo () {\n    return Promise.resolve(1);\n  },\n  async bar () {\n    console.log(await foo()"
  },
  {
    "path": "packages/babel-plugin-import-regenerator/test/fixtures/mutiple-async/expected.js",
    "chars": 3140,
    "preview": "\"use strict\";\n\nvar _regeneratorRuntime2 = require(\"regenerator-runtime\");\n\nvar _regeneratorRuntime3 = _interopRequireDef"
  },
  {
    "path": "packages/babel-plugin-import-regenerator/test/fixtures/normal/actual.js",
    "chars": 326,
    "preview": "import wepy from '@wepy/core'\n\nwepy.page({\n  methods: {\n    sleep (s) {\n      return new Promise((resolve, reject) => {\n"
  },
  {
    "path": "packages/babel-plugin-import-regenerator/test/fixtures/normal/expected.js",
    "chars": 1994,
    "preview": "\"use strict\";\n\nvar _regeneratorRuntime2 = require(\"regenerator-runtime\");\n\nvar _regeneratorRuntime3 = _interopRequireDef"
  },
  {
    "path": "packages/babel-plugin-import-regenerator/test/index.test.js",
    "chars": 850,
    "preview": "const { transform } = require('@babel/core');\nconst { readdirSync, readFileSync } = require('fs');\nconst { join } = requ"
  },
  {
    "path": "packages/cli/.gitignore",
    "chars": 72,
    "preview": "node_modules/\nsftp-config.json\ndiff\nlog\nnpm-debug.log\nlib/\ndemo/\n.vscode"
  },
  {
    "path": "packages/cli/.npmignore",
    "chars": 93,
    "preview": "node_modules/\nsrc/\ncoverage/\ndemo/\ntest/\nISSUE_TEMPLATE.md\nappveyor.yml\nREADME_zh-CN.md\n*.map"
  },
  {
    "path": "packages/cli/CHANGELOG.md",
    "chars": 909,
    "preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
  },
  {
    "path": "packages/cli/README.md",
    "chars": 196,
    "preview": "# 小程序框架wepy命令行工具\n\n参见:[小程序框架wepy](https://github.com/wepyjs/wepy)\n\n\n### 安装\n```bash\nnpm install wepy-cli -g\n```\n\n### Chang"
  },
  {
    "path": "packages/cli/bin/cli/ask.js",
    "chars": 1743,
    "preview": "const async = require('async');\nconst inquirer = require('inquirer');\nconst evaluate = require('./eval');\n\n// Support ty"
  },
  {
    "path": "packages/cli/bin/cli/check-version.js",
    "chars": 1316,
    "preview": "const semver = require('semver');\nconst request = require('request');\nconst chalk = require('chalk');\nconst pkgConfig = "
  },
  {
    "path": "packages/cli/bin/cli/download.js",
    "chars": 1435,
    "preview": "const download = require('download');\nconst downloadGitRepo = require('download-git-repo');\n\n/**\n * download official te"
  },
  {
    "path": "packages/cli/bin/cli/eval.js",
    "chars": 370,
    "preview": "/**\n * Evaluate an expression in meta.json in the context of\n * prompt answers data.\n */\nexports = module.exports = func"
  },
  {
    "path": "packages/cli/bin/cli/filter.js",
    "chars": 504,
    "preview": "const match = require('minimatch');\nconst evaluate = require('./eval');\n\nexports = module.exports = function filter(file"
  },
  {
    "path": "packages/cli/bin/cli/generate.js",
    "chars": 5920,
    "preview": "const chalk = require('chalk');\nconst Metalsmith = require('metalsmith');\nconst Handlebars = require('handlebars');\ncons"
  },
  {
    "path": "packages/cli/bin/cli/git-user.js",
    "chars": 400,
    "preview": "const execSync = require('child_process').execSync;\n\nexports = module.exports = function getGitUser() {\n  let name;\n  le"
  },
  {
    "path": "packages/cli/bin/cli/local-path.js",
    "chars": 398,
    "preview": "const path = require('path');\n\nexports = module.exports = {\n  isLocalPath(templatePath) {\n    // templatePath example:\n "
  },
  {
    "path": "packages/cli/bin/cli/logger.js",
    "chars": 1027,
    "preview": "const chalk = require('chalk');\nconst format = require('util').format;\n\n/**\n * Prefix.\n */\n\nconst prefix = '   @wepy/cli"
  },
  {
    "path": "packages/cli/bin/cli/options.js",
    "chars": 2041,
    "preview": "const path = require('path');\nconst metadata = require('read-metadata');\nconst fs = require('fs');\nconst getGitUser = re"
  },
  {
    "path": "packages/cli/bin/wepy-build.js",
    "chars": 712,
    "preview": "const compile = require('../core/compile');\nconst parseOptions = require('../core/parseOptions');\nconst logger = require"
  },
  {
    "path": "packages/cli/bin/wepy-init.js",
    "chars": 5020,
    "preview": "const fs = require('fs');\nconst path = require('path');\nconst chalk = require('chalk');\nconst tildify = require('tildify"
  },
  {
    "path": "packages/cli/bin/wepy-list.js",
    "chars": 4517,
    "preview": "#!/usr/bin/env node\n\nconst chalk = require('chalk');\nconst request = require('request');\nconst Table = require('tty-tabl"
  },
  {
    "path": "packages/cli/bin/wepy-new.js",
    "chars": 413,
    "preview": "#!/usr/bin/env node\n\nconst chalk = require('chalk');\n\nexports = module.exports = proj => {\n  if (typeof proj !== 'string"
  },
  {
    "path": "packages/cli/bin/wepy-upgrade.js",
    "chars": 1211,
    "preview": "const exec = require('child_process').exec;\nconst util = require('../util');\n\nfunction upgradeCLI(cb) {\n  let cmd = 'npm"
  },
  {
    "path": "packages/cli/bin/wepy.js",
    "chars": 2248,
    "preview": "#!/usr/bin/env node\n\nconst chalk = require('chalk');\nconst program = require('commander');\nconst logger = require('../co"
  },
  {
    "path": "packages/cli/core/ast/index.js",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "packages/cli/core/ast/paramsDetect.js",
    "chars": 6055,
    "preview": "const acorn = require('acorn');\nconst walk = require('acorn/dist/walk');\n\nfunction isScope(node) {\n  return (\n    node.t"
  },
  {
    "path": "packages/cli/core/ast/parseClass.js",
    "chars": 981,
    "preview": "const walk = require('acorn/dist/walk');\nconst toAST = require('./toAST');\n\nexports = module.exports = function parseCla"
  },
  {
    "path": "packages/cli/core/ast/toAST.js",
    "chars": 1167,
    "preview": "const acorn = require('acorn-dynamic-import').default;\n\nconst ECMA_VERSION = 2017;\n\nconst POSSIBLE_AST_OPTIONS = [\n  {\n "
  },
  {
    "path": "packages/cli/core/ast/walker.js",
    "chars": 45126,
    "preview": "class AstWalker {\n  constructor(compilation, ast, lang) {\n    this.ast = ast;\n    this.state = {};\n    this.deps = [];\n "
  },
  {
    "path": "packages/cli/core/ast/wxml.js",
    "chars": 1752,
    "preview": "const htmlparser = require('htmlparser2');\n\nconst walk = function(ast, opt) {\n  let { type, name, attr } = opt;\n  ast.fo"
  },
  {
    "path": "packages/cli/core/compile.js",
    "chars": 18080,
    "preview": "/**\n * Tencent is pleased to support the open source community by making WePY available.\n * Copyright (C) 2017 THL A29 L"
  },
  {
    "path": "packages/cli/core/fileDep.js",
    "chars": 1120,
    "preview": "class FileDep {\n  constructor() {\n    this._depMap = {};\n    this._depedMap = {};\n  }\n\n  cleanDeps(source) {\n    const d"
  },
  {
    "path": "packages/cli/core/hook.js",
    "chars": 2574,
    "preview": "class Hook {\n  constructor() {\n    this._hooks = {};\n  }\n\n  register(key, fn) {\n    if (!this._hooks[key]) {\n      this."
  },
  {
    "path": "packages/cli/core/init/compiler.js",
    "chars": 965,
    "preview": "exports = module.exports = function initCompiler(ins, compilers = {}) {\n  let init = Object.keys(compilers).map(c => {\n "
  },
  {
    "path": "packages/cli/core/init/parser.js",
    "chars": 206,
    "preview": "exports = module.exports = function initParser(ins) {\n  ['wpy', 'script', 'style', 'template', 'config', 'component', 'w"
  },
  {
    "path": "packages/cli/core/init/plugin.js",
    "chars": 1277,
    "preview": "const { isArr, isFunc } = require('../util/tools');\n\nfunction checkPlugins(ins, plugins) {\n  if (!isArr(plugins)) {\n    "
  },
  {
    "path": "packages/cli/core/loader.js",
    "chars": 3378,
    "preview": "/**\n * Tencent is pleased to support the open source community by making WePY available.\n * Copyright (C) 2017 THL A29 L"
  },
  {
    "path": "packages/cli/core/moduleSet.js",
    "chars": 1932,
    "preview": "/**\n * Tencent is pleased to support the open source community by making WePY available.\n * Copyright (C) 2017 THL A29 L"
  },
  {
    "path": "packages/cli/core/parseOptions.js",
    "chars": 3190,
    "preview": "const path = require('path');\nconst fs = require('fs');\n\nconst DEFAULT_OPTIONS = {\n  entry: { type: String, default: 'ap"
  },
  {
    "path": "packages/cli/core/plugins/build/app.js",
    "chars": 739,
    "preview": "const path = require('path');\n\nexports = module.exports = function() {\n  this.register('build-app', function buildApp(ap"
  },
  {
    "path": "packages/cli/core/plugins/build/assets.js",
    "chars": 1698,
    "preview": "const path = require('path');\n\nexports = module.exports = function() {\n  this.register('build-assets', function buildAss"
  },
  {
    "path": "packages/cli/core/plugins/build/components.js",
    "chars": 1588,
    "preview": "const path = require('path');\n\nexports = module.exports = function() {\n  this.register('build-components', function buil"
  },
  {
    "path": "packages/cli/core/plugins/build/pages.js",
    "chars": 909,
    "preview": "const path = require('path');\n\nexports = module.exports = function() {\n  this.register('build-pages', function buildPage"
  },
  {
    "path": "packages/cli/core/plugins/build/vendor.js",
    "chars": 2358,
    "preview": "const path = require('path');\n\nconst VENDOR_INJECTION = [\n  `\nvar window = { Number: Number, Array: Array, Date: Date, E"
  },
  {
    "path": "packages/cli/core/plugins/compiler/before.js",
    "chars": 3017,
    "preview": "const path = require('path');\nconst CONST = require('../../util/const');\n\nexports = module.exports = function() {\n  cons"
  },
  {
    "path": "packages/cli/core/plugins/compiler/common.js",
    "chars": 263,
    "preview": "exports = module.exports = function() {\n  ['js', 'json', 'css', 'wxml'].forEach(lang => {\n    this.register('wepy-compil"
  },
  {
    "path": "packages/cli/core/plugins/compiler/index.js",
    "chars": 143,
    "preview": "exports = module.exports = function() {\n  require('./common').call(this);\n  require('./wxss').call(this);\n  require('./b"
  },
  {
    "path": "packages/cli/core/plugins/compiler/wxss.js",
    "chars": 1637,
    "preview": "const css = require('css');\nconst path = require('path');\nconst fs = require('fs');\nconst RawSource = require('webpack-s"
  },
  {
    "path": "packages/cli/core/plugins/helper/errorHandler.js",
    "chars": 1829,
    "preview": "exports = module.exports = function() {\n  this.register('error-handler', function(handler, errInfo, extra) {\n    if (arg"
  },
  {
    "path": "packages/cli/core/plugins/helper/generateCodeFrame.js",
    "chars": 2569,
    "preview": "const codeFrameColumns = require('@babel/code-frame').codeFrameColumns;\nconst SourceMap = require('source-map');\n\nfuncti"
  },
  {
    "path": "packages/cli/core/plugins/helper/sfcCustomBlock.js",
    "chars": 1095,
    "preview": "exports = module.exports = function() {\n  this.register('sfc-custom-block', function(sfc) {\n    if (!sfc.customBlocks ||"
  },
  {
    "path": "packages/cli/core/plugins/helper/supportSrc.js",
    "chars": 851,
    "preview": "const path = require('path');\nconst fs = require('fs');\nconst loaderUtils = require('loader-utils');\n\nconst trailingSlas"
  },
  {
    "path": "packages/cli/core/plugins/parser/component.js",
    "chars": 3951,
    "preview": "/**\n * Tencent is pleased to support the open source community by making WePY available.\n * Copyright (C) 2017 THL A29 L"
  },
  {
    "path": "packages/cli/core/plugins/parser/config.js",
    "chars": 5270,
    "preview": "const path = require('path');\nconst loaderUtils = require('loader-utils');\nconst slash = require('slash');\n\nlet appUsing"
  },
  {
    "path": "packages/cli/core/plugins/parser/file.js",
    "chars": 3883,
    "preview": "/**\n * Tencent is pleased to support the open source community by making WePY available.\n * Copyright (C) 2017 THL A29 L"
  },
  {
    "path": "packages/cli/core/plugins/parser/script.js",
    "chars": 5179,
    "preview": "/**\n * Tencent is pleased to support the open source community by making WePY available.\n * Copyright (C) 2017 THL A29 L"
  },
  {
    "path": "packages/cli/core/plugins/parser/style.js",
    "chars": 361,
    "preview": "exports = module.exports = function() {\n  this.register('wepy-parser-style', function(node, ctx) {\n    // If this file h"
  },
  {
    "path": "packages/cli/core/plugins/parser/template.js",
    "chars": 1502,
    "preview": "const xmllint = require('../../util/xmllint');\n\nexports = module.exports = function() {\n  this.register('wepy-parser-tem"
  },
  {
    "path": "packages/cli/core/plugins/parser/wpy.js",
    "chars": 4437,
    "preview": "/**\n * Tencent is pleased to support the open source community by making WePY available.\n * Copyright (C) 2017 THL A29 L"
  },
  {
    "path": "packages/cli/core/plugins/parser/wxs.js",
    "chars": 2045,
    "preview": "const path = require('path');\nconst hashUtil = require('../../util/hash');\n\nexports = module.exports = function() {\n  th"
  },
  {
    "path": "packages/cli/core/plugins/scriptDepFix.js",
    "chars": 3765,
    "preview": "const path = require('path');\nconst slash = require('slash');\n\nexports = module.exports = function() {\n  /*\n   * S1: __w"
  },
  {
    "path": "packages/cli/core/plugins/scriptInjection.js",
    "chars": 2221,
    "preview": "const genRel = rel => {\n  if (typeof rel === 'string') return rel;\n\n  let handlerStr = '{';\n  for (let h in rel.handlers"
  },
  {
    "path": "packages/cli/core/plugins/template/attrs/bindClass.js",
    "chars": 1139,
    "preview": "const parseClass = require('../../../ast/parseClass');\n\nexports = module.exports = function() {\n  this.register('templat"
  },
  {
    "path": "packages/cli/core/plugins/template/attrs/bindStyle.js",
    "chars": 798,
    "preview": "const exprParser = require('../../../util/exprParser');\n\nexports = module.exports = function() {\n  this.register('templa"
  },
  {
    "path": "packages/cli/core/plugins/template/attrs/index.js",
    "chars": 138,
    "preview": "exports = module.exports = function parseAttrs() {\n  ['./bindClass', './bindStyle', './src', './ref'].map(v => require(v"
  },
  {
    "path": "packages/cli/core/plugins/template/attrs/ref.js",
    "chars": 1580,
    "preview": "exports = module.exports = function() {\n  let totalRefCache = {};\n\n  function getParseRefFunc(hasBindAttrRef = false) {\n"
  },
  {
    "path": "packages/cli/core/plugins/template/attrs/src.js",
    "chars": 1909,
    "preview": "const fs = require('fs-extra');\nconst path = require('path');\nconst ReplaceSource = require('webpack-sources').ReplaceSo"
  },
  {
    "path": "packages/cli/core/plugins/template/directives/bind.js",
    "chars": 478,
    "preview": "const bindRE = /^:|^v-bind:/;\n\nexports = module.exports = function() {\n  // eslint-disable-next-line no-unused-vars\n  th"
  },
  {
    "path": "packages/cli/core/plugins/template/directives/condition.js",
    "chars": 656,
    "preview": "const ADDITIONS_DIRECTIVES_HANDLES = {\n  /* eslint-disable no-unused-vars */\n  'v-show': ({ item, name, expr }) => ({ at"
  },
  {
    "path": "packages/cli/core/plugins/template/directives/for.js",
    "chars": 2782,
    "preview": "const forAliasRE = /([^]*?)\\s+(?:in|of)\\s+([^]*)/;\nconst forIteratorRE = /,([^,}\\]]*)(?:,([^,}\\]]*))?$/;\nconst stripPare"
  },
  {
    "path": "packages/cli/core/plugins/template/directives/index.js",
    "chars": 161,
    "preview": "exports = module.exports = function parseDirectives() {\n  ['./condition', './bind', './for', './model', './other', './v-"
  },
  {
    "path": "packages/cli/core/plugins/template/directives/model.js",
    "chars": 7554,
    "preview": "const CONST = require('../../../util/const');\nconst vueWithTransform = require('vue-template-es2015-compiler');\n\nconst M"
  },
  {
    "path": "packages/cli/core/plugins/template/directives/other.js",
    "chars": 1797,
    "preview": "const onRE = /^@|^v-on:/;\nconst bindRE = /^:|^v-bind:/;\nconst nativeBindRE = /^bind:?|^catch:?|^capture-bind:?|^capture-"
  },
  {
    "path": "packages/cli/core/plugins/template/directives/v-on.js",
    "chars": 8588,
    "preview": "const vueWithTransform = require('vue-template-es2015-compiler');\nconst paramsDetect = require('./../../../ast/paramsDet"
  },
  {
    "path": "packages/cli/core/plugins/template/parse.js",
    "chars": 7789,
    "preview": "const htmlparser = require('htmlparser2');\nconst tools = require('../../util/tools');\nconst modifierRE = /\\.[^.]+/g;\n\nco"
  },
  {
    "path": "packages/cli/core/plugins/template/util/check.js",
    "chars": 1109,
    "preview": "// strip strings in expressions\nconst stripStringRE = /'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`"
  },
  {
    "path": "packages/cli/core/tag.js",
    "chars": 3605,
    "preview": "const { isArr } = require('./util/tools');\n\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element\nconst HTML_TAGS"
  },
  {
    "path": "packages/cli/core/util/ast.js",
    "chars": 1167,
    "preview": "const acorn = require('acorn-dynamic-import').default;\n\nconst ECMA_VERSION = 2017;\n\nconst POSSIBLE_AST_OPTIONS = [\n  {\n "
  },
  {
    "path": "packages/cli/core/util/const.js",
    "chars": 116,
    "preview": "exports = module.exports = {\n  EVENT_DISPATCHER: '__dispatcher',\n  VENDOR_DIR: '$vendor',\n  WEAPP_EXT: '.$weapp'\n};\n"
  },
  {
    "path": "packages/cli/core/util/error.js",
    "chars": 631,
    "preview": "const codeFrameColumns = require('@babel/code-frame').codeFrameColumns;\nconst logger = require('./logger');\n\nexports = m"
  },
  {
    "path": "packages/cli/core/util/exprParser.js",
    "chars": 2849,
    "preview": "const camelizeRE = /-(\\w)/g;\nconst hyphenateRE = /([^-])([A-Z])/g;\n\nconst cached = fn => {\n  let cache = {};\n  return st"
  },
  {
    "path": "packages/cli/core/util/hash.js",
    "chars": 282,
    "preview": "const crypto = require('crypto');\nconst fs = require('fs');\n\nexports = module.exports = {\n  hash(s) {\n    let md5 = cryp"
  },
  {
    "path": "packages/cli/core/util/logger.js",
    "chars": 1130,
    "preview": "const log = require('npmlog');\n\nconst mylog = {};\n\nconst datetime = (date = new Date(), format = 'HH:mm:ss') => {\n  let "
  },
  {
    "path": "packages/cli/core/util/tools.js",
    "chars": 1513,
    "preview": "/**\n * String type check\n */\nexports.isStr = v => typeof v === 'string';\n/**\n * Number type check\n */\nexports.isNum = v "
  },
  {
    "path": "packages/cli/core/util/xmllint.js",
    "chars": 1057,
    "preview": "const HTMLHint = require('htmlhint').default;\n\nconst DEFAULT_RULES = {\n  // Component can be uppercase\n  'tagname-lowerc"
  },
  {
    "path": "packages/cli/index.js",
    "chars": 57,
    "preview": "exports = module.exports = require('./core/compile.js');\n"
  },
  {
    "path": "packages/cli/package.json",
    "chars": 2151,
    "preview": "{\n  \"name\": \"@wepy/cli\",\n  \"version\": \"2.1.0\",\n  \"main\": \"index.js\",\n  \"bin\": {\n    \"wepy\": \"bin/wepy.js\"\n  },\n  \"script"
  },
  {
    "path": "packages/cli/test/config.js",
    "chars": 257,
    "preview": "const path = require('path');\n\nconst resolve = dir => path.join(__dirname, '..', dir);\n\nexports.alias = {\n  core: resolv"
  },
  {
    "path": "packages/cli/test/core/fileDep.test.js",
    "chars": 2582,
    "preview": "const expect = require('chai').expect;\nconst FileDep = require('../../core/fileDep');\n\ndescribe('FileDep', function() {\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/attrWithoutValue.wxml",
    "chars": 58,
    "preview": "<view hidden></view>\n<scroll-view scroll-x></scroll-view>\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/bindClass.wxml",
    "chars": 336,
    "preview": "<view class=\"default {{ [ express - 1 === 0 ? 'test' : '',has ? 'has' : '' ] }}\"></view>\n<view class=\" {{ [ test ? 'test"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/bindStyle.wxml",
    "chars": 97,
    "preview": "<view style=\" {{ 'background:' + (current === idx ? activeColor : normalColor) + ';' }}\"></view>\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/joinStyle.wxml",
    "chars": 156,
    "preview": "<view style=\"width: 100rpx; {{ 'background:' + (bgColor) + ';' }}\"></view>\n<view style=\"height: 200rpx; {{ 'font-size:' "
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/ref.wxml",
    "chars": 297,
    "preview": "<view id=\"ref-0-0\"></view>\n<view id=\"ref-0-1\"></view>\n<view id=\"hello\"></view>\n<view id=\"{{ hello }}\"></view>\n<custom-co"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/reference.wxml",
    "chars": 156,
    "preview": "<import src=\"item.wxml\" />\n<template is=\"item\" data=\"{{text: 'foobar'}}\" />\n<include src=\"header.wxml\" />\n<view> body </"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-for.wxml",
    "chars": 270,
    "preview": "<view wx:for=\"{{ items }}\" wx:for-index=\"index\" wx:for-item=\"item\" wx:key=\"index\"></view>\n<view wx:for=\"{{ items }}\" wx:"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-if.wxml",
    "chars": 128,
    "preview": "<view wx:if=\"{{ case01 }}\"></view>\n<view wx:elif=\"{{ case02 }}\"></view>\n<view wx:else></view>\n<view wx:if=\"{{ a < 1 }}\">"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-0.tap.js",
    "chars": 328,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var $event = ($wx.detail && $wx.detail.arguments)"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-1.tap.js",
    "chars": 332,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var $event = ($wx.detail && $wx.detail.arguments)"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-10.tap.js",
    "chars": 198,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var $args = $wx.detail && $wx.detail.arguments;\n "
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-11.tap.js",
    "chars": 262,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var $event = ($wx.detail && $wx.detail.arguments)"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-12.tap.js",
    "chars": 146,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var _vm = this;\n  return (function () {\n    _vm.m"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-13.tap.js",
    "chars": 324,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var $event = ($wx.detail && $wx.detail.arguments)"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-14.tap.js",
    "chars": 91,
    "preview": "function proxy () {\n  var _vm = this;\n  return (function () {\n    _vm.myclick();\n  })();\n}\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-15.tap.js",
    "chars": 92,
    "preview": "function proxy () {\n  var _vm = this;\n  return (function () {\n    _vm.myclick(1);\n  })();\n}\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-2.tap.js",
    "chars": 335,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var $event = ($wx.detail && $wx.detail.arguments)"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-3.tap.js",
    "chars": 339,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var $event = ($wx.detail && $wx.detail.arguments)"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-4.tap.js",
    "chars": 131,
    "preview": "function proxy () {\n  var _vm = this;\n  return (function () {\n    _vm.myClickCaptureStopWithParams(1, { a: 1 }, [1, 2]);"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-5.tap.js",
    "chars": 259,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var $event = ($wx.detail && $wx.detail.arguments)"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-6.tap.js",
    "chars": 104,
    "preview": "function proxy (item) {\n  var _vm = this;\n  return (function () {\n    _vm.myClickInFor(item);\n  })();\n}\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-7.tap.js",
    "chars": 344,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var $event = ($wx.detail && $wx.detail.arguments)"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-8.tap.js",
    "chars": 345,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var $event = ($wx.detail && $wx.detail.arguments)"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on/0-9.click-right.js",
    "chars": 335,
    "preview": "function proxy () {\n  var $wx = arguments[arguments.length - 1].$wx;\n  var $event = ($wx.detail && $wx.detail.arguments)"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on.wxml",
    "chars": 1098,
    "preview": "<view data-wpy-evt=\"0-0\" bind:tap=\"__dispatcher\"></view>\n<view data-wpy-evt=\"0-1\" catch:tap=\"__dispatcher\"></view>\n<view"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-on.wxs.wxml",
    "chars": 100,
    "preview": "<view bind:tap=\"{{ m.touchmove }}\"></view>\n<view data-wpy-evt=\"0-0\" bind:tap=\"__dispatcher\"></view>\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/assert/v-show.wxml",
    "chars": 86,
    "preview": "<view hidden=\"{{ !(show) }}\"></view>\n<view hidden=\"{{ !(case01 && case02) }}\"></view>\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/original/attrWithoutValue.html",
    "chars": 56,
    "preview": "<div hidden></div>\n<scroll-view scroll-x></scroll-view>\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/original/bindClass.html",
    "chars": 290,
    "preview": "<div class=\"default\" :class=\"{'test': express - 1 === 0, 'has': has}\"></div>\n<div :class=\"[ something, { 'test': test, '"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/original/bindStyle.html",
    "chars": 83,
    "preview": "<div :style=\"{ 'background': current === idx ? activeColor : normalColor }\"></div>\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/original/joinStyle.html",
    "chars": 145,
    "preview": "<div style=\"width: 100rpx\" :style=\"{ 'background': bgColor }\"></div>\n<div style=\"height: 200rpx;\" :style=\"{ 'font-size':"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/original/ref.html",
    "chars": 248,
    "preview": "<div :ref=\"value01\"></div>\n<div :ref=\"value02\"></div>\n<div id=\"hello\" :ref=\"value03\"></div>\n<div :id=\"hello\" :ref=\"value"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/original/reference.html",
    "chars": 156,
    "preview": "<import src=\"item.wxml\" />\n<template is=\"item\" data=\"{{text: 'foobar'}}\" />\n<include src=\"header.wxml\" />\n<view> body </"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/original/v-for.html",
    "chars": 125,
    "preview": "<view v-for=\"items\"></view>\n<view v-for=\"(item, index) in items\"></view>\n<view v-for=\"(value, key, index) in object\"></v"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/original/v-if.html",
    "chars": 112,
    "preview": "<view v-if=\"case01\"></view>\n<view v-else-if=\"case02\"></view>\n<view v-else></view>\n<view v-if=\"a &lt; 1\"></view>\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/original/v-on.html",
    "chars": 737,
    "preview": "<div @tap=\"myclick\"></div>\n<div @tap.stop=\"myclickStop\"></div>\n<div @tap.capture=\"myclickCapture\"></div>\n<div @tap.stop."
  },
  {
    "path": "packages/cli/test/core/fixtures/template/original/v-on.wxs.html",
    "chars": 63,
    "preview": "<div @tap=\"m.touchmove\"></div>\n<div @tap=\"m1.touchmove\"></div>\n"
  },
  {
    "path": "packages/cli/test/core/fixtures/template/original/v-show.html",
    "chars": 68,
    "preview": "<view v-show=\"show\"></view>\n<view v-show=\"case01 && case02\"></view>\n"
  },
  {
    "path": "packages/cli/test/core/hook.test.js",
    "chars": 7477,
    "preview": "const expect = require('chai').expect;\nconst Hook = require('../../core/hook');\n\ndescribe('Hook', function() {\n  it('sho"
  },
  {
    "path": "packages/cli/test/core/init/plugin.test.js",
    "chars": 1161,
    "preview": "const { alias } = require('../../config');\nconst expect = require('chai').expect;\nconst initPlugin = require(`${alias.in"
  },
  {
    "path": "packages/cli/test/core/parseOption.test.js",
    "chars": 1246,
    "preview": "const expect = require('chai').expect;\nconst po = require('../../core/parseOptions');\n\ndescribe('parseOptions', function"
  },
  {
    "path": "packages/cli/test/core/plugins/helper/sfcCustomBlock.test.js",
    "chars": 1480,
    "preview": "const { alias } = require('../../../config');\nconst sfcCompiler = require('vue-template-compiler');\nconst Hook = require"
  },
  {
    "path": "packages/cli/test/core/plugins/template/parse.test.js",
    "chars": 4363,
    "preview": "const { alias } = require('../../../config');\nconst expect = require('chai').expect;\nconst path = require('path');\nconst"
  },
  {
    "path": "packages/cli/test/core/tag.test.js",
    "chars": 1189,
    "preview": "const expect = require('chai').expect;\nconst tag = require('../../core/tag');\n\ndescribe('tag', function() {\n  it('should"
  },
  {
    "path": "packages/cli/util/logger.js",
    "chars": 1130,
    "preview": "const log = require('npmlog');\n\nconst mylog = {};\n\nconst datetime = (date = new Date(), format = 'HH:mm:ss') => {\n  let "
  },
  {
    "path": "packages/compiler-babel/.npmignore",
    "chars": 21,
    "preview": "src\ntest\nnode_modules"
  },
  {
    "path": "packages/compiler-babel/CHANGELOG.md",
    "chars": 998,
    "preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
  },
  {
    "path": "packages/compiler-babel/README.md",
    "chars": 490,
    "preview": "# wepy babel 编译器\n\n## 安装\n\n```\nnpm install @wepy/compiler-babel --save-dev\n```\n\n## 配置`wepy.config.js`\n\n```\nmodule.exports "
  },
  {
    "path": "packages/compiler-babel/index.js",
    "chars": 3611,
    "preview": "/**\n * Tencent is pleased to support the open source community by making WePY available.\n * Copyright (C) 2017 THL A29 L"
  },
  {
    "path": "packages/compiler-babel/package.json",
    "chars": 639,
    "preview": "{\n  \"name\": \"@wepy/compiler-babel\",\n  \"version\": \"2.1.0\",\n  \"description\": \"wepy compile babel\",\n  \"main\": \"index.js\",\n "
  },
  {
    "path": "packages/compiler-babel/test/fixtures/app.js",
    "chars": 95,
    "preview": "import wepy from '@wepy/core'\n\nwepy.app({\n  onLaunch() {\n    console.log('on launch')\n  }\n});\n\n"
  },
  {
    "path": "packages/compiler-babel/test/helper/ast.js",
    "chars": 1167,
    "preview": "const acorn = require('acorn-dynamic-import').default;\n\nconst ECMA_VERSION = 2017;\n\nconst POSSIBLE_AST_OPTIONS = [\n  {\n "
  },
  {
    "path": "packages/compiler-babel/test/helper/index.js",
    "chars": 1140,
    "preview": "exports = module.exports = {\n  getNameForExpression(expression) {\n    let expr = expression;\n    const exprName = [];\n  "
  },
  {
    "path": "packages/compiler-babel/test/index.test.js",
    "chars": 2599,
    "preview": "const fs = require('fs');\nconst path = require('path');\nconst expect = require('chai').expect;\nconst compileBabel = requ"
  },
  {
    "path": "packages/compiler-less/.npmignore",
    "chars": 13,
    "preview": "node_modules\n"
  },
  {
    "path": "packages/compiler-less/CHANGELOG.md",
    "chars": 990,
    "preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
  },
  {
    "path": "packages/compiler-less/README.md",
    "chars": 265,
    "preview": "# wepy less 编译器\n\n## 安装\n\n```\nnpm install @wepy/compiler-less less --save-dev\n```\n\n\n## 配置`wepy.config.js`\n\n```\nmodule.expo"
  },
  {
    "path": "packages/compiler-less/createPlugin.js",
    "chars": 1543,
    "preview": "const fs = require('fs');\nconst less = require('less');\nconst loaderUtils = require('loader-utils');\n\nconst matchMalform"
  },
  {
    "path": "packages/compiler-less/index.js",
    "chars": 1690,
    "preview": "/**\n * Tencent is pleased to support the open source community by making WePY available.\n * Copyright (C) 2017 THL A29 L"
  },
  {
    "path": "packages/compiler-less/package.json",
    "chars": 711,
    "preview": "{\n  \"name\": \"@wepy/compiler-less\",\n  \"version\": \"2.1.0\",\n  \"description\": \"wepy compile less\",\n  \"main\": \"index.js\",\n  \""
  },
  {
    "path": "packages/compiler-less/test/fixtures/css/alias.css",
    "chars": 27,
    "preview": "body {\n  color: #ff0101;\n}\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/css/basic.css",
    "chars": 96,
    "preview": ".no-math {\n  width: calc(50% + (25vh - 20px));\n  foo: 3 calc(3 + 4) 11;\n  bar: calc(1 + 20%);\n}\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/css/extend.css",
    "chars": 238,
    "preview": ".some-module,\n#it-works,\n#it-works-all {\n  color: red;\n  transform: scale(2);\n}\n.some-module .sub-module,\n#it-works-all "
  },
  {
    "path": "packages/compiler-less/test/fixtures/css/function.css",
    "chars": 98,
    "preview": ".image-width {\n  width: 1px;\n}\n.image-height {\n  height: 1px;\n}\n.image-size {\n  width: 1px 1px;\n}\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/css/guards.css",
    "chars": 21,
    "preview": "button {\n  foo: 1;\n}\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/css/import.css",
    "chars": 27,
    "preview": "body {\n  color: #ff0101;\n}\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/css/lazy.css",
    "chars": 28,
    "preview": ".lazy-eval {\n  width: 9%;\n}\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/css/list-each.css",
    "chars": 66,
    "preview": ".sel-blue {\n  a: b;\n}\n.sel-green {\n  a: b;\n}\n.sel-red {\n  a: b;\n}\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/css/list.css",
    "chars": 98,
    "preview": ".image-width {\n  width: 1px;\n}\n.image-height {\n  height: 1px;\n}\n.image-size {\n  width: 1px 1px;\n}\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/css/selector.css",
    "chars": 310,
    "preview": ".button-ok {\n  foo: 1;\n}\n.button-cancel {\n  foo: 1;\n}\n.button-custom {\n  foo: 1;\n}\n.grand .parent > .grand .parent {\n  f"
  },
  {
    "path": "packages/compiler-less/test/fixtures/css/uri.css",
    "chars": 371,
    "preview": ".img {\n  background: url(\"imgs/vacant.gif\");\n  background: url(\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAA"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/alias.less",
    "chars": 51,
    "preview": "@import '~@/colors.less';\n\nbody {\n  color: @red;\n}\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/basic.less",
    "chars": 149,
    "preview": ".no-math {\n  @var: 50vh/2;\n  width: calc(50% + (@var - 20px));\n  foo: 1 + 2 calc(3 + 4) 5 + 6;\n  @floor: floor(1 + .1);\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/extend.less",
    "chars": 168,
    "preview": "@import \"~@/modules\";\r\n\r\n#it-works:extend(.some-module) {\r\n  margin: 0;\r\n  transform+_: rotate(15deg);\r\n}\r\n\r\n#it-works-a"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/fail-missing-file.less",
    "chars": 51,
    "preview": "@import 'missingfile.less';\r\n\r\nbody {color: red;}\r\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/fail-uri-alias.less",
    "chars": 96,
    "preview": ".img-alias {\r\n  background: url(\"~@/vacant.gif\");\r\n  background: data-uri(\"~@/vacant.gif\");\r\n}\r\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/guards.less",
    "chars": 70,
    "preview": "@my-option: true;\r\n\r\nbutton when (@my-option = true) {\r\n  foo: 1;\r\n}\r\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/import.less",
    "chars": 54,
    "preview": "@import './vars/colors.less';\nbody {\n  color: @red;\n}\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/lazy.less",
    "chars": 68,
    "preview": ".lazy-eval {\r\n  width: @var;\r\n  @a: 9%;\r\n}\r\n\r\n@var: @a;\r\n@a: 100%;\r\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/list-each.less",
    "chars": 86,
    "preview": "@selectors: blue, green, red;\n\neach(@selectors, {\n  .sel-@{value} {\n    a: b;\n  }\n});\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/list.less",
    "chars": 187,
    "preview": "@imagePath: 'imgs/vacant.gif';\n.image-width {\n  width: image-width(@imagePath);\n}\n\n.image-height {\n  height: image-heigh"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/selector.less",
    "chars": 321,
    "preview": ".button {\r\n  &-ok {\r\n    foo: 1;\r\n  }\r\n  &-cancel {\r\n    foo: 1;\r\n  }\r\n\r\n  &-custom {\r\n    foo: 1;\r\n  }\r\n}\r\n\r\n.grand {\r\n"
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/uri.less",
    "chars": 290,
    "preview": "@base64: \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";\r\n\r\n.img {\r\n  background: url("
  },
  {
    "path": "packages/compiler-less/test/fixtures/less/vars/colors.less",
    "chars": 15,
    "preview": "@red: #ff0101;\n"
  }
]

// ... and 282 more files (download for full content)

About this extraction

This page contains the full source code of the Tencent/wepy GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 482 files (762.9 KB), approximately 225.1k tokens, and a symbol index with 858 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!