Files
Hippy/scripts/build.js
T
+12 c1e30f3f75 feat(webrenderer): merge webrenderer repo to hippy repo (#2609)
* feat(webrenderer): re init hippy-web-renderer

* test(test): change test logic

* style(eslint): fix lint warn

* refactor(copyright): add copyright info

* refactor(copyright): add copyright info

* revert(lockfile): revert package-lock.json

* refactor(conflict): fix type conflict

* feat(vue): support to merge styles on root element of child component

* refactor(ios): make project build with library

* fix(ios): need to callback when url loading error

* fix(android): fix setTextColor not working

* ci(workflows): add github actions for project calc code of lines

* refactor(webrenderer): version 0.0.4 publish

* ci(workflows): android build tests will run all build types

* fix(workflows): fix CodeQL languages detection bug on PR request

* ci(workflows): replaced obsolete workflow command

replaced obsolete workflow output command `set-output`
with `GITHUB_OUTPUT` environment file.

* fix(vue-css-loader): update loader-utils to safe version

* ci(workflows): CodeQL analyses will check all Android projects

* feat(workflows): add project code line exclude files support

* fix(workflow): fix CodeQL exception when default run

* fix(iOS): refresh header not rebound automatically

xxx

* fix(iOS): delete tmp log

* ci(workflows): add ios artifact release

* ci(workflow): add minimum V8 version test into android build tests

* feat(ci): implement iOS project artifact compare

* feat(workflows): iOS build tests add different configurations

* refactor(ios): use work space to manager projects

* refactor(ios): use work space to manager projects

* feat(workflows): remove unnecessary `Cocoapods` installation step

* feat(workflows): `XCode` project adaptation

* feat(core): adapt to different v8 versions

* refactor(ios): modify project configurations

rename scheme from 'hippy' to 'HippyLibrary',rename target name from 'hippy' to 'HippyLibrary'

keep static library product name unchanged

* feat(workflows): change `XCode` project scheme name

* fix(android): waterfall banner not affected by parent honrizon padding;

* feat(android,ios,js): add getBoundingClientRect method (#2651)

* feat(android): add `getBoundingClientRect` api [WIP]

* feat(vue,react): add getBoundingClientRect api

* feat(android): add `getBoundingClientRect` api

* feat(ios): add getBoundingClientRect method

* docs(homepage): add getBoundingClientRect doc

* fix(demo): rm redundant file (#4)

* docs(homepage): add getBoundingClientRect doc

* fix(demo): rm redundant file

* fix(demo): rm redundant file

* refactor(vue-next-demo): rm unused code

* feat(android): add `getBoundingClientRect` api

Co-authored-by: iPel <pel20121221@gmail.com>
Co-authored-by: zoomchan-cxj <zoom_chan@163.com>
Co-authored-by: siguangli <siguangli@qq.com>

* fix(react,vue): fix getBoundingClientRect errMsg syntax

* fix(ios): correct hittest when view has animation

* fix(ios): subviews of animated view cannot be clicked

* fix(android): edit `getBoundingClientRect` callback format

* fix(ios): edit `getBoundingClientRect` callback format

* fix(react,vue): change measureInAppWindow error return value

* fix(ios): need to extern as C if cpp is defined

* fix(workflows): fix backtrace parsing incorrect problem in crash report

* chore(deps): bump loader-utils in /packages/hippy-vue-css-loader

Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* feat(vue): add whitespace handler config

* fix(android): horizontal scroll view smoothScrollToPage crash

* feat(v8): heap limit increases considering the old generation capacity

* feat(core): add performance api for new x5 v8

* fix(v8): fix `V8` OOM crash when inspector enable the js debugger

* feat(ios,android,vue): add load result param for webView's onLoadEnd api (#2667)

* feat(ios,vue): add load result param for webView's onLoadEnd api

* feat(android): add load result param for webView's onLoadEnd api

* feat(vue, doc): fix onLoadEnd params and update docs

* feat(vue, doc): resolve pr problem

* feat(vue, doc): resolve pr problem

Co-authored-by: wwwcg <isarraypro@gmail.com>

* perf(vue): ignore to append existed node to improve router performance

* refactor(vue-next): remove Date.now in trace log

* chore(docs): add homepage and README some docs

* refactor(ios): set xcode project compatility vertion to xcode 10.0

* feat(vue): add beforeRenderToNative hook to support computed style

* fix(android): fix JSI cause JNI local reference table overflow

* fix(core): fix the problem of multi-threading at startup time

* ci(workflows): adjust the labeling rules

* chore(ios): set cpp version to c++17

* feat(workflows): add auto-merge labeler in PR

* feat(workflows): change stale label name

* feat(workflows): change license check configuration file path

* ci(workflows): add js release workflow

* feat(workflows): add PR review notification

* ci(codeowner): change demo path

* fix(core): fix reload bug for inspector

* ci(workflows): fix js release issue

* feat(android): add `nestedScrollPriority` for `ListView` and `ScrollView` (#2744)

* fix(android): nested scroll conflict

* fix(android): nested scroll conflicts with pull refresh

* feat(android): add `nestedScrollPriority` for ListView and ScrollView

* feat(android): squash branch scroll_conflict (#6)

* fix(android): nested scroll feature

  - edit priority api
  - scrollview prevent nested scroll when enabled paging
  - fix viewpager vertical issue
  - viewpager nested scroll
  - translate comments

* fix(android): Eltonqin/netscroll bugfix (#3)

* fix(android):HorizonScrollView may throw exception when handle onInterceptTouchEvent

* fix(android):post task still run after remove

* fix(android):post task still run after remove,modify format

Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): nested scroll feature

  - viewpager nested scroll issue

* feat(docs): update docs

Co-authored-by: HOHOHOTangoDown <iystina7@gmail.com>
Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): nested scroll conflicts with pull refresh

* feat(docs, demo): update docs and demos

Co-authored-by: HOHOHOTangoDown <iystina7@gmail.com>
Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): update scrollview consumed value

* refactor(js): perf nestedScrollPriority demo & docs (#9)

* refactor(js): perf nestedScrollPriority demo & docs

* refactor(js): add nested scroll more pager item

Co-authored-by: HOHOHOTangoDown <iystina7@gmail.com>
Co-authored-by: eltonqin <eltonqin@tencent.com>
Co-authored-by: Zoom Chan <zoom_chan@163.com>

* Revert "feat(android): add `nestedScrollPriority` for `ListView` and `ScrollView` (#2744)"

This reverts commit 2644658376.

* fix(android): nested scroll conflict

* fix(android): nested scroll conflicts with pull refresh

* feat(android): add `nestedScrollPriority` for ListView and ScrollView

* feat(android): squash branch scroll_conflict (#6)

* fix(android): nested scroll feature

  - edit priority api
  - scrollview prevent nested scroll when enabled paging
  - fix viewpager vertical issue
  - viewpager nested scroll
  - translate comments

* fix(android): Eltonqin/netscroll bugfix (#3)

* fix(android):HorizonScrollView may throw exception when handle onInterceptTouchEvent

* fix(android):post task still run after remove

* fix(android):post task still run after remove,modify format

Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): nested scroll feature

  - viewpager nested scroll issue

* feat(docs): update docs

Co-authored-by: HOHOHOTangoDown <iystina7@gmail.com>
Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): nested scroll conflicts with pull refresh

* feat(docs, demo): update docs and demos

Co-authored-by: HOHOHOTangoDown <iystina7@gmail.com>
Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): update scrollview consumed value

* refactor(js): perf nestedScrollPriority demo & docs (#9)

* refactor(js): perf nestedScrollPriority demo & docs

* refactor(js): add nested scroll more pager item

* ci(workflows): setup node to npm registry

* fix(ios): animated image is not released when the view is removed

* feat(workflows): workflow add `squash-merge` action

* feat(workflows): use `Hippy Action Bot` as action executor

* ci(labeler): add new labels (#2762)

* ci(codeowner): change codeowner classificatioin (#2761)

* Revert "fix(ios): animated image is not released when the view is removed"

This reverts commit 6af195837d.

* fix(devtools): fix try catch exception when update context

* feat(workflows): optimizing pull request greeting message (#2765)

Co-authored-by: Zoom Chan <zoom_chan@163.com>

* fix(workflows): change workflows bot app key and id (#2768)

* fix(workflows): fix triage outputs incorrect problem in crash report (#2767)

* feat(workflows): integrate `squash-merge` and `rebase-merge` action (#2772)

* fix(workflows): change `pull_request_help_needed` label name

* fix(ios): avoid animated image multi thread operation crash

* fix(devtools): callback fail when debug ws disconnect

* feat(workflows): add pull request merge guard and update it's action

* refactor(workflows): refactor pull requests checks approval process

* ci(codeowner): change CODEOWNERS classification (#2799)

* fix(workflows): change mentioned user in the PR review notification (#2801)

* chore(commitlint): adjust rules for length of commit message check (#2807)

* feat(workflows): users cannot perform merge action on their own PRs (#2809)

* fix(workflows): update Github bot app key and id configuration (#2810)

* refactor(ios): perfect copyright notice (#2821)

* feat(vue-next): add beforeRenderToNative hook (#2775)

* chore(docs,demo): update WebRenderer docs & demo (#2566)

* chore(hippy-react-demo): remove hippy:dev from web:dev

* chore(hippy-react-demo): fix image path error in web-renderer dev mode

* docs(web): Update integration.md and package.json

Co-authored-by: questguo <questguo@tencent.com>
Co-authored-by: Zoom Chan <zoom_chan@163.com>

* fix(ios): fix ConsoleModule.log not working (#2812)

Co-authored-by: Zoom Chan <zoom_chan@163.com>

* feat(core): dynamic loading support custom protocols (#2827)

* feat(core): allow all schemas to dynamic load (#2829)

* chore(deps): bump json5 and loader-utils (#2830)

Removes [json5](https://github.com/json5/json5). It's no longer used after updating ancestor dependency [loader-utils](https://github.com/webpack/loader-utils). These dependencies need to be updated together.

Updates `loader-utils` from 1.4.2 to 3.2.1
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.2...v3.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(bump): update loader-utils to 1.4.2

* feat(workflows): add regular requested reviewers notification

* chore(bump): update loader-utils to 2.0.4 to fix json5 issue (#2833)

* feat(workflows): PR review notification add mention user (#2834)

* feat(core): support android dimensions to extend customized parameters

* chore(example): rebuild examples to update code

* feat(ios): add method to create custom scrollview (#2839)

* fix(android): remove web url judge in fetchResourceWithUri (#2840)

* chore(deps): bump json5 from 1.0.1 to 1.0.2

Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(android): text with negative letterSpacing wraps at wrong position (#2843)

Co-authored-by: Zoom Chan <zoom_chan@163.com>

* chore(codeowner): change settings.gradle codeowner

* feat(workflows): PR review notification filter draft PR (#2854)

* feat(workflows): add pull requests auto updater (#2855)

* feat(android): enable Safe ICF to optimize binary size (#2857)

* fix(core): add handle_scope for v8 exception (#2860)

* feat(workflows): only uses non-merge commits as valid commits (#2862)

Co-authored-by: Zoom Chan <zoom_chan@163.com>

* feat(workflows): add pull requests auto merger

* fix(workflows): fix rebase-merge label name

* feat(workflows): change review notification schedule

* fix(workflows): change auto_merger comment message

* fix(devtools): remove regular expression injection (#2865)

Co-authored-by: Zoom Chan <zoom_chan@163.com>

* fix(webrenderer): fix animation valid logic error

* style(lint): fix lint errors

* feat(workflows): add self-hosted runners monitor

* chore(deps): bump ua-parser-js in /packages/hippy-react-web

Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.31 to 0.7.33.
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md)
- [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.31...0.7.33)

---
updated-dependencies:
- dependency-name: ua-parser-js
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* feat(workflows): skip privilege escalation when conditions are met

skip privilege escalation when
invoked by a user with admin role
or contains only one normal commit.

* chore(codeowner): add C++ codeowner

* refactor(workflows): refactor CodeQL analyses script to save resources

* feat(workflows): use variables that only exist in pull requests event

* fix(workflows): fix the workflow exception caused by cancel status

* perf(workflows): use ubuntu replace macos in order to improve efficiency

* feat(workflows): optimize self-hosted runner alarm strategy

* revert(lockfile): revert package-lock.json

* refactor(ios): make project build with library

* ci(workflows): add github actions for project calc code of lines

* refactor(webrenderer): version 0.0.4 publish

* ci(workflows): android build tests will run all build types

* fix(workflows): fix CodeQL languages detection bug on PR request

* ci(workflows): replaced obsolete workflow command

replaced obsolete workflow output command `set-output`
with `GITHUB_OUTPUT` environment file.

* fix(vue-css-loader): update loader-utils to safe version

* ci(workflows): CodeQL analyses will check all Android projects

* feat(workflows): add project code line exclude files support

* fix(workflow): fix CodeQL exception when default run

* fix(iOS): refresh header not rebound automatically

xxx

* fix(iOS): delete tmp log

* ci(workflows): add ios artifact release

* ci(workflow): add minimum V8 version test into android build tests

* feat(ci): implement iOS project artifact compare

* feat(workflows): iOS build tests add different configurations

* refactor(ios): use work space to manager projects

* refactor(ios): use work space to manager projects

* feat(workflows): remove unnecessary `Cocoapods` installation step

* feat(workflows): `XCode` project adaptation

* refactor(ios): modify project configurations

rename scheme from 'hippy' to 'HippyLibrary',rename target name from 'hippy' to 'HippyLibrary'

keep static library product name unchanged

* feat(workflows): change `XCode` project scheme name

* feat(android,ios,js): add getBoundingClientRect method (#2651)

* feat(android): add `getBoundingClientRect` api [WIP]

* feat(vue,react): add getBoundingClientRect api

* feat(android): add `getBoundingClientRect` api

* feat(ios): add getBoundingClientRect method

* docs(homepage): add getBoundingClientRect doc

* fix(demo): rm redundant file (#4)

* docs(homepage): add getBoundingClientRect doc

* fix(demo): rm redundant file

* fix(demo): rm redundant file

* refactor(vue-next-demo): rm unused code

* feat(android): add `getBoundingClientRect` api

Co-authored-by: iPel <pel20121221@gmail.com>
Co-authored-by: zoomchan-cxj <zoom_chan@163.com>
Co-authored-by: siguangli <siguangli@qq.com>

* fix(react,vue): fix getBoundingClientRect errMsg syntax

* fix(ios): correct hittest when view has animation

* fix(ios): subviews of animated view cannot be clicked

* fix(android): edit `getBoundingClientRect` callback format

* fix(ios): edit `getBoundingClientRect` callback format

* fix(react,vue): change measureInAppWindow error return value

* fix(workflows): fix backtrace parsing incorrect problem in crash report

* chore(deps): bump loader-utils in /packages/hippy-vue-css-loader

Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* feat(vue): add whitespace handler config

* feat(v8): heap limit increases considering the old generation capacity

* fix(v8): fix `V8` OOM crash when inspector enable the js debugger

* chore(docs): add homepage and README some docs

* refactor(ios): set xcode project compatility vertion to xcode 10.0

* feat(vue): add beforeRenderToNative hook to support computed style

* fix(core): fix the problem of multi-threading at startup time

* ci(workflows): adjust the labeling rules

* chore(ios): set cpp version to c++17

* feat(workflows): add auto-merge labeler in PR

* ci(workflows): add js release workflow

* feat(workflows): add PR review notification

* ci(codeowner): change demo path

* fix(core): fix reload bug for inspector

* ci(workflows): fix js release issue

* feat(android): add `nestedScrollPriority` for `ListView` and `ScrollView` (#2744)

* fix(android): nested scroll conflict

* fix(android): nested scroll conflicts with pull refresh

* feat(android): add `nestedScrollPriority` for ListView and ScrollView

* feat(android): squash branch scroll_conflict (#6)

* fix(android): nested scroll feature

  - edit priority api
  - scrollview prevent nested scroll when enabled paging
  - fix viewpager vertical issue
  - viewpager nested scroll
  - translate comments

* fix(android): Eltonqin/netscroll bugfix (#3)

* fix(android):HorizonScrollView may throw exception when handle onInterceptTouchEvent

* fix(android):post task still run after remove

* fix(android):post task still run after remove,modify format

Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): nested scroll feature

  - viewpager nested scroll issue

* feat(docs): update docs

Co-authored-by: HOHOHOTangoDown <iystina7@gmail.com>
Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): nested scroll conflicts with pull refresh

* feat(docs, demo): update docs and demos

Co-authored-by: HOHOHOTangoDown <iystina7@gmail.com>
Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): update scrollview consumed value

* refactor(js): perf nestedScrollPriority demo & docs (#9)

* refactor(js): perf nestedScrollPriority demo & docs

* refactor(js): add nested scroll more pager item

Co-authored-by: HOHOHOTangoDown <iystina7@gmail.com>
Co-authored-by: eltonqin <eltonqin@tencent.com>
Co-authored-by: Zoom Chan <zoom_chan@163.com>

* Revert "feat(android): add `nestedScrollPriority` for `ListView` and `ScrollView` (#2744)"

This reverts commit 2644658376.

* fix(android): nested scroll conflict

* fix(android): nested scroll conflicts with pull refresh

* feat(android): add `nestedScrollPriority` for ListView and ScrollView

* feat(android): squash branch scroll_conflict (#6)

* fix(android): nested scroll feature

  - edit priority api
  - scrollview prevent nested scroll when enabled paging
  - fix viewpager vertical issue
  - viewpager nested scroll
  - translate comments

* fix(android): Eltonqin/netscroll bugfix (#3)

* fix(android):HorizonScrollView may throw exception when handle onInterceptTouchEvent

* fix(android):post task still run after remove

* fix(android):post task still run after remove,modify format

Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): nested scroll feature

  - viewpager nested scroll issue

* feat(docs): update docs

Co-authored-by: HOHOHOTangoDown <iystina7@gmail.com>
Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): nested scroll conflicts with pull refresh

* feat(docs, demo): update docs and demos

Co-authored-by: HOHOHOTangoDown <iystina7@gmail.com>
Co-authored-by: eltonqin <eltonqin@tencent.com>

* fix(android): update scrollview consumed value

* refactor(js): perf nestedScrollPriority demo & docs (#9)

* refactor(js): perf nestedScrollPriority demo & docs

* refactor(js): add nested scroll more pager item

* ci(workflows): setup node to npm registry

* fix(ios): animated image is not released when the view is removed

* feat(workflows): workflow add `squash-merge` action

* feat(workflows): use `Hippy Action Bot` as action executor

* ci(labeler): add new labels (#2762)

* ci(codeowner): change codeowner classificatioin (#2761)

* Revert "fix(ios): animated image is not released when the view is removed"

This reverts commit 6af195837d.

* feat(workflows): optimizing pull request greeting message (#2765)

Co-authored-by: Zoom Chan <zoom_chan@163.com>

* fix(workflows): change workflows bot app key and id (#2768)

* fix(workflows): fix triage outputs incorrect problem in crash report (#2767)

* feat(workflows): integrate `squash-merge` and `rebase-merge` action (#2772)

* fix(workflows): change `pull_request_help_needed` label name

* fix(ios): avoid animated image multi thread operation crash

* feat(workflows): add pull request merge guard and update it's action

* refactor(workflows): refactor pull requests checks approval process

* ci(codeowner): change CODEOWNERS classification (#2799)

* fix(workflows): change mentioned user in the PR review notification (#2801)

* feat(workflows): users cannot perform merge action on their own PRs (#2809)

* fix(workflows): update Github bot app key and id configuration (#2810)

* refactor(ios): perfect copyright notice (#2821)

* feat(vue-next): add beforeRenderToNative hook (#2775)

* chore(deps): bump json5 and loader-utils (#2830)

Removes [json5](https://github.com/json5/json5). It's no longer used after updating ancestor dependency [loader-utils](https://github.com/webpack/loader-utils). These dependencies need to be updated together.

Updates `loader-utils` from 1.4.2 to 3.2.1
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.2...v3.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(bump): update loader-utils to 1.4.2

* feat(workflows): add regular requested reviewers notification

* chore(bump): update loader-utils to 2.0.4 to fix json5 issue (#2833)

* feat(workflows): PR review notification add mention user (#2834)

* chore(example): rebuild examples to update code

* chore(deps): bump json5 from 1.0.1 to 1.0.2

Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(codeowner): change settings.gradle codeowner

* feat(workflows): PR review notification filter draft PR (#2854)

* fix(core): add handle_scope for v8 exception (#2860)

* feat(workflows): only uses non-merge commits as valid commits (#2862)

Co-authored-by: Zoom Chan <zoom_chan@163.com>

* feat(workflows): add pull requests auto merger

* fix(workflows): fix rebase-merge label name

* feat(workflows): change review notification schedule

* fix(workflows): change auto_merger comment message

* style(lint): fix lint errors

* feat(workflows): use classic PAT instead of Github App Token

* feat(workflows): add self-hosted runners monitor

* feat(workflows): skip privilege escalation when conditions are met

skip privilege escalation when
invoked by a user with admin role
or contains only one normal commit.

* chore(codeowner): add C++ codeowner

* refactor(workflows): refactor CodeQL analyses script to save resources

* feat(workflows): use variables that only exist in pull requests event

* fix(workflows): fix the workflow exception caused by cancel status

* perf(workflows): use ubuntu replace macos in order to improve efficiency

* feat(workflows): optimize self-hosted runner alarm strategy

* refactor(webrenderer): fix eslint warnings && add build

* chore(webrenderer): fix webrenderer build error

* chore(webrenderer): update build logic and pack.json

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: zoomchan-cxj <zoom_chan@163.com>
Co-authored-by: luomy <ozonelmy@163.com>
Co-authored-by: iPel <pel20121221@gmail.com>
Co-authored-by: superzheng <superzheng@tencent.com>
Co-authored-by: luoyibu <luoyibu@users.noreply.github.com>
Co-authored-by: pollyzhang <pollyzhang@tencent.com>
Co-authored-by: FE-xiaoJiang <3401384168@qq.com>
Co-authored-by: Ray <isarraypro@gmail.com>
Co-authored-by: siguangli <siguangli@qq.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: maxli <maxli@tencent.com>
Co-authored-by: chestershen <chestershen@tencent.com>
Co-authored-by: Super Zheng <medns@126.com>
Co-authored-by: HOHOHOTangoDown <iystina7@gmail.com>
Co-authored-by: eltonqin <eltonqin@tencent.com>
Co-authored-by: xpyue <xpyue@tencent.com>
Co-authored-by: xpyue <1055978080@qq.com>
Co-authored-by: ivanfanwu <ivanfanwu@tencent.com>
Co-authored-by: DMX <34561818+crazyming9528@users.noreply.github.com>
Co-authored-by: questguo <questguo@tencent.com>
Co-authored-by: churchill-zhang <long.dragon.zhang@gmail.com>
2023-02-06 17:01:06 +08:00

109 lines
3.2 KiB
JavaScript

/*
* Tencent is pleased to support the open source community by making
* Hippy available.
*
* Copyright (C) 2017-2022 THL A29 Limited, a Tencent company.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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 path = require('path');
const fs = require('fs');
const { rollup } = require('rollup');
const reactBuilds = require('./react-configs').getAllBuilds();
const vueBuilds = require('./vue-configs').getAllBuilds();
const vueNextBuilds = require('./vue-next-configs').getAllBuilds();
const webRendererBuilds = require('./web-renderer-configs').getAllBuilds();
let builds = [...reactBuilds, ...vueBuilds, ...vueNextBuilds, ...webRendererBuilds];
// filter builds via command line arg
if (process.argv[2]) {
const filters = process.argv[2].split(',');
builds = builds.filter(b => filters.some(f => b.output.file.indexOf(f) > -1 || b.output.name.indexOf(f) > -1));
}
function blue(str) {
return `\x1b[1m\x1b[34m${str}\x1b[39m\x1b[22m`;
}
function getSize(code) {
return `${(code.length / 1024).toFixed(2)}kb`;
}
function logError(e) {
console.error('build js packages error', e);
process.exit(1);
}
/**
* remove typescript declaration files that generated by rollup plugin.
*
* 1. auto generate typescript declaration files by rollup-plugin-typescript2
* 2. declaration files rollup to index.d.ts by api-extractor
* 3. remove auto generated declaration files
*
* @param filePath
*/
function cleanTypescriptDeclarationFiles(filePath) {
if (filePath) {
let isDir = fs.statSync(filePath);
const dir = isDir.isDirectory() ? filePath : path.dirname(filePath);
const subDirs = fs.readdirSync(dir);
if (subDirs.length) {
for (let i = 0; i <= subDirs.length; i++) {
if (subDirs[i]) {
const dirPath = `${dir}/${subDirs[i]}`;
isDir = fs.statSync(dirPath);
if (isDir?.isDirectory() && subDirs[i].startsWith('hippy-')) {
fs.rmSync(dirPath, {
force: true,
recursive: true,
});
}
}
}
}
}
}
async function buildEntry(config) {
const { output } = config;
const { file = '', dir = '' } = output;
const bundle = await rollup(config);
await bundle.generate(output);
const { output: [{ code }] } = await bundle.write(output);
console.log(`${blue(path.relative(process.cwd(), file ? file : `${dir}/index.js`))} ${getSize(code)}`);
cleanTypescriptDeclarationFiles(file || dir);
}
function build(buildSets) {
let built = 0;
const total = builds.length;
const next = () => {
buildEntry(buildSets[built])
.then(() => {
built += 1;
if (built < total) {
next();
}
})
.catch(logError);
};
next();
}
build(builds);