miniprogram-ci 1.9.9 → 1.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ #### 1.9.10
2
+ - `new` 新增 支持 compileWorklet 编译选项。
3
+ #### 1.9.9
4
+ - `new` 更新 worklet 函数的编译逻辑。
5
+
1
6
  ## 1.9.8
2
7
  - `fix` 修复 TypeError: _regeneratorRuntime3 is not a function 报错问题
3
8
  ## 1.9.7
package/README.md CHANGED
@@ -7,6 +7,10 @@ miniprogram-ci 是从[微信开发者工具](https://developers.weixin.qq.com/mi
7
7
  miniprogram-ci 从 1.0.28 开始支持第三方平台开发的上传和预览,调用方式与普通开发模式无异。[查看详情](#第三方平台开发)
8
8
 
9
9
  ## 最近变更
10
+ #### 1.9.10
11
+ - `new` 新增 支持 compileWorklet 编译选项。
12
+ #### 1.9.9
13
+ - `new` 更新 worklet 函数的编译逻辑。
10
14
  #### 1.9.8
11
15
  - `fix` 修复 TypeError: _regeneratorRuntime3 is not a function 报错问题
12
16
  #### 1.9.7
@@ -813,6 +817,7 @@ miniprogram-ci \
813
817
  | minify | boolean | 上传时压缩所有代码,对应于微信开发者工具的 "上传时压缩代码" |
814
818
  | codeProtect | boolean | 对应于微信开发者工具的 "上传时进行代码保护" |
815
819
  | autoPrefixWXSS | boolean | 对应于微信开发者工具的 "上传时样式自动补全" |
820
+ | compileWorklet | boolean | 对应于微信开发者工具的 编译 worklet 代码 |
816
821
 
817
822
  ## 第三方平台开发
818
823
 
@@ -1,4 +1,4 @@
1
- export declare const CI_VERSION = "1.9.9";
1
+ export declare const CI_VERSION = "1.9.10";
2
2
  export declare const PARAM_ERROR = 10000;
3
3
  export declare const WXML_NOT_FOUND = 10007;
4
4
  export declare const JS_NOT_FOUND = 10008;
@@ -0,0 +1,22 @@
1
+ interface IOptions {
2
+ babelRoot: string;
3
+ code: string;
4
+ filePath: string;
5
+ disableUseStrict?: boolean;
6
+ inputSourceMap?: import('source-map').RawSourceMap;
7
+ }
8
+ declare const workletCompile: (options: IOptions) => {
9
+ error: {
10
+ message: string;
11
+ code: number;
12
+ };
13
+ code?: undefined;
14
+ map?: undefined;
15
+ helpers?: undefined;
16
+ } | {
17
+ code: string;
18
+ map: import("source-map").RawSourceMap;
19
+ helpers: never[];
20
+ error?: undefined;
21
+ };
22
+ export = workletCompile;
@@ -0,0 +1,4 @@
1
+ import { SummerPlugin } from '../types';
2
+ export default function (projectPath: string, options: {
3
+ disableUseStrict: boolean;
4
+ }): SummerPlugin;
@@ -57,6 +57,7 @@ export declare namespace MiniProgramCI {
57
57
  minifyWXSS?: boolean;
58
58
  autoPrefixWXSS?: boolean;
59
59
  disableUseStrict?: boolean;
60
+ compileWorklet?: boolean;
60
61
  }
61
62
  interface ITaskStatus {
62
63
  id: string;
package/dist/config.js CHANGED
@@ -1,3 +1,3 @@
1
1
  !function(require, directRequire){
2
- "use strict";var COMPILE_TYPE;Object.defineProperty(exports,"__esModule",{value:!0}),exports.extendedLibMap=exports.jsonVariablePropertyWhiteList=exports.DefaultProjectAttr=exports.TABBAR_ICON_WHITE_LIST=exports.COMPILE_TYPE=exports.APP_TYPE=exports.MINI_GAME_WORKERS_PACKAGE_ROOT=exports.MINI_GAME_MAIN_PACKAGE_ROOT=exports.MINI_PROGRAM_MAIN_PACKAGE_ROOT=exports.PROJECT_TYPE_ERROR=exports.GET_LATEST_VERSION_CGI_ERR=exports.UPLOAD_JS_SERVER_CGI_ERR=exports.CODE_PROTECT_TRANSLATE_FILENAME=exports.UPLOAD_CGI_ERR=exports.GENERATE_LOCAL_SIGNATURE_ERR=exports.GET_SIGNATURE_RAND_STRING_ERR=exports.APP_JSON_NOT_FOUND=exports.JSON_CONTENT_ERR=exports.FILE_NOT_UTF8=exports.JSON_PARSE_ERR=exports.FILE_NOT_FOUND=exports.PLUGIN_JSON_PARSE_ERR=exports.PLUGIN_JSON_CONTENT_ERR=exports.PLUGIN_JSON_FILE_NOT_FOUND=exports.GAME_PLUGIN_LIB_MD5_NOT_MATCH=exports.SUMMER_PLUGIN_CODE_ERR=exports.SUMMER_PLUGIN_ERR=exports.MINIFY_WXML_ERR=exports.POST_WXSS_ERR=exports.FILE_FLAT_ERR=exports.JS_ES6_ERR=exports.BABILI_JS_ERR=exports.UGLIFY_JS_ERR=exports.BABEL_TRANS_JS_ERR=exports.JS_NOT_FOUND=exports.WXML_NOT_FOUND=exports.PARAM_ERROR=exports.CI_VERSION=void 0,exports.CI_VERSION="1.9.9",exports.PARAM_ERROR=1e4,exports.WXML_NOT_FOUND=10007,exports.JS_NOT_FOUND=10008,exports.BABEL_TRANS_JS_ERR=10032,exports.UGLIFY_JS_ERR=10033,exports.BABILI_JS_ERR=10034,exports.JS_ES6_ERR=10035,exports.FILE_FLAT_ERR=10036,exports.POST_WXSS_ERR=10037,exports.MINIFY_WXML_ERR=10038,exports.SUMMER_PLUGIN_ERR=10045,exports.SUMMER_PLUGIN_CODE_ERR=10046,exports.GAME_PLUGIN_LIB_MD5_NOT_MATCH=10081,exports.PLUGIN_JSON_FILE_NOT_FOUND=10091,exports.PLUGIN_JSON_CONTENT_ERR=10092,exports.PLUGIN_JSON_PARSE_ERR=10093,exports.FILE_NOT_FOUND=10005,exports.JSON_PARSE_ERR=10006,exports.FILE_NOT_UTF8=10031,exports.JSON_CONTENT_ERR=10009,exports.APP_JSON_NOT_FOUND=2e4,exports.GET_SIGNATURE_RAND_STRING_ERR=20001,exports.GENERATE_LOCAL_SIGNATURE_ERR=20002,exports.UPLOAD_CGI_ERR=20003,exports.CODE_PROTECT_TRANSLATE_FILENAME=20004,exports.UPLOAD_JS_SERVER_CGI_ERR=20005,exports.GET_LATEST_VERSION_CGI_ERR=20006,exports.PROJECT_TYPE_ERROR=3e4,exports.MINI_PROGRAM_MAIN_PACKAGE_ROOT="__APP__",exports.MINI_GAME_MAIN_PACKAGE_ROOT="__GAME__",exports.MINI_GAME_WORKERS_PACKAGE_ROOT="workers.js",exports.APP_TYPE={NORMAL:0,PLUGIN:1,SHOP:2,MINISHOP:3,GAME:4,CARD:5,NATIVE:7},function(_){_.miniProgram="miniProgram",_.miniProgramPlugin="miniProgramPlugin",_.miniGame="miniGame",_.miniGamePlugin="miniGamePlugin"}(COMPILE_TYPE=exports.COMPILE_TYPE||(exports.COMPILE_TYPE={})),exports.TABBAR_ICON_WHITE_LIST=[".png",".jpg",".jpeg"],exports.DefaultProjectAttr={platform:!1,appType:0,isSandbox:!1,released:!1,setting:{MaxCodeSize:2,MaxSubpackageSubCodeSize:2,MaxSubpackageFullCodeSize:12,NavigateMiniprogramLimit:10,MaxSubPackageLimit:100,MinTabbarCount:2,MaxTabbarCount:5,MaxTabbarIconSize:40}},exports.jsonVariablePropertyWhiteList={windowPropertWhiteList:["navigationBarBackgroundColor","navigationBarTextStyle","backgroundColor","backgroundTextStyle","backgroundColorTop","backgroundColorBottom","backgroundColorContent"],tabBarPropertyWhiteList:["color","selectedColor","backgroundColor","borderStyle"],tabbarListItemPropertyWhiteList:["iconPath","selectedIconPath"]},exports.extendedLibMap={kbone:{packages:["miniprogram-element","miniprogram-render"]},weui:{packages:["weui-miniprogram"]}};
2
+ "use strict";var COMPILE_TYPE;Object.defineProperty(exports,"__esModule",{value:!0}),exports.extendedLibMap=exports.jsonVariablePropertyWhiteList=exports.DefaultProjectAttr=exports.TABBAR_ICON_WHITE_LIST=exports.COMPILE_TYPE=exports.APP_TYPE=exports.MINI_GAME_WORKERS_PACKAGE_ROOT=exports.MINI_GAME_MAIN_PACKAGE_ROOT=exports.MINI_PROGRAM_MAIN_PACKAGE_ROOT=exports.PROJECT_TYPE_ERROR=exports.GET_LATEST_VERSION_CGI_ERR=exports.UPLOAD_JS_SERVER_CGI_ERR=exports.CODE_PROTECT_TRANSLATE_FILENAME=exports.UPLOAD_CGI_ERR=exports.GENERATE_LOCAL_SIGNATURE_ERR=exports.GET_SIGNATURE_RAND_STRING_ERR=exports.APP_JSON_NOT_FOUND=exports.JSON_CONTENT_ERR=exports.FILE_NOT_UTF8=exports.JSON_PARSE_ERR=exports.FILE_NOT_FOUND=exports.PLUGIN_JSON_PARSE_ERR=exports.PLUGIN_JSON_CONTENT_ERR=exports.PLUGIN_JSON_FILE_NOT_FOUND=exports.GAME_PLUGIN_LIB_MD5_NOT_MATCH=exports.SUMMER_PLUGIN_CODE_ERR=exports.SUMMER_PLUGIN_ERR=exports.MINIFY_WXML_ERR=exports.POST_WXSS_ERR=exports.FILE_FLAT_ERR=exports.JS_ES6_ERR=exports.BABILI_JS_ERR=exports.UGLIFY_JS_ERR=exports.BABEL_TRANS_JS_ERR=exports.JS_NOT_FOUND=exports.WXML_NOT_FOUND=exports.PARAM_ERROR=exports.CI_VERSION=void 0,exports.CI_VERSION="1.9.10",exports.PARAM_ERROR=1e4,exports.WXML_NOT_FOUND=10007,exports.JS_NOT_FOUND=10008,exports.BABEL_TRANS_JS_ERR=10032,exports.UGLIFY_JS_ERR=10033,exports.BABILI_JS_ERR=10034,exports.JS_ES6_ERR=10035,exports.FILE_FLAT_ERR=10036,exports.POST_WXSS_ERR=10037,exports.MINIFY_WXML_ERR=10038,exports.SUMMER_PLUGIN_ERR=10045,exports.SUMMER_PLUGIN_CODE_ERR=10046,exports.GAME_PLUGIN_LIB_MD5_NOT_MATCH=10081,exports.PLUGIN_JSON_FILE_NOT_FOUND=10091,exports.PLUGIN_JSON_CONTENT_ERR=10092,exports.PLUGIN_JSON_PARSE_ERR=10093,exports.FILE_NOT_FOUND=10005,exports.JSON_PARSE_ERR=10006,exports.FILE_NOT_UTF8=10031,exports.JSON_CONTENT_ERR=10009,exports.APP_JSON_NOT_FOUND=2e4,exports.GET_SIGNATURE_RAND_STRING_ERR=20001,exports.GENERATE_LOCAL_SIGNATURE_ERR=20002,exports.UPLOAD_CGI_ERR=20003,exports.CODE_PROTECT_TRANSLATE_FILENAME=20004,exports.UPLOAD_JS_SERVER_CGI_ERR=20005,exports.GET_LATEST_VERSION_CGI_ERR=20006,exports.PROJECT_TYPE_ERROR=3e4,exports.MINI_PROGRAM_MAIN_PACKAGE_ROOT="__APP__",exports.MINI_GAME_MAIN_PACKAGE_ROOT="__GAME__",exports.MINI_GAME_WORKERS_PACKAGE_ROOT="workers.js",exports.APP_TYPE={NORMAL:0,PLUGIN:1,SHOP:2,MINISHOP:3,GAME:4,CARD:5,NATIVE:7},function(_){_.miniProgram="miniProgram",_.miniProgramPlugin="miniProgramPlugin",_.miniGame="miniGame",_.miniGamePlugin="miniGamePlugin"}(COMPILE_TYPE=exports.COMPILE_TYPE||(exports.COMPILE_TYPE={})),exports.TABBAR_ICON_WHITE_LIST=[".png",".jpg",".jpeg"],exports.DefaultProjectAttr={platform:!1,appType:0,isSandbox:!1,released:!1,setting:{MaxCodeSize:2,MaxSubpackageSubCodeSize:2,MaxSubpackageFullCodeSize:12,NavigateMiniprogramLimit:10,MaxSubPackageLimit:100,MinTabbarCount:2,MaxTabbarCount:5,MaxTabbarIconSize:40}},exports.jsonVariablePropertyWhiteList={windowPropertWhiteList:["navigationBarBackgroundColor","navigationBarTextStyle","backgroundColor","backgroundTextStyle","backgroundColorTop","backgroundColorBottom","backgroundColorContent"],tabBarPropertyWhiteList:["color","selectedColor","backgroundColor","borderStyle"],tabbarListItemPropertyWhiteList:["iconPath","selectedIconPath"]},exports.extendedLibMap={kbone:{packages:["miniprogram-element","miniprogram-render"]},weui:{packages:["weui-miniprogram"]}};
3
3
  }(require("licia/lazyImport")(require), require)
@@ -0,0 +1 @@
1
+ "use strict";const config_1=require("../../config"),_pluginTransformWorklet=()=>require("../../utils/babel_plugin_worklet"),babel7=()=>require("@babel/core"),workletCompile=e=>{const{code:r,filePath:l,inputSourceMap:i}=e,o=e.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(r);let t=null;try{t=require("@babel/core").transform(r,{babelrc:!1,plugins:[require("../../utils/babel_plugin_worklet")],sourceFileName:l,inputSourceMap:i,sourceMaps:!0,configFile:!1})}catch(e){return{error:{message:`file: ${l}\n ${e.message}`,code:config_1.BABEL_TRANS_JS_ERR}}}let s=(null==t?void 0:t.code)||r;const u=(null==t?void 0:t.map)||i;return o&&(s=s.replace(/^"use strict";/,"")),{code:s,map:u,helpers:[]}};module.exports=workletCompile;
@@ -1 +1 @@
1
- "use strict";const tslib_1=require("tslib"),fs_1=tslib_1.__importDefault(require("fs")),path_1=tslib_1.__importDefault(require("path")),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),tools_1=require("../../../utils/tools"),config_1=require("../../../config"),call_func_1=require("./call_func"),log_1=tslib_1.__importDefault(require("../../../utils/log")),babel_helper_1=require("../../../utils/babel_helper"),jsonParse_1=require("../../../utils/jsonParse"),sourcemap=()=>require("source-map"),enhanceCompile=()=>require("../../js/enhance"),es6Compile=()=>require("../../js/es6_transform"),minifyJS=()=>require("../../js/minifyjs"),minifyJSAfterWrap=()=>require("../../js/minifyjs_after_wrap"),generateMap=()=>require("../../js/generateMap"),MAX_CODE_LENGTH=512e3;async function tryGetInputSourceMap(e,r){try{const t=/\/\/[#|@] sourceMappingURL=[\s]*(\S*)[\s]*$/m.exec(e),s=path_1.default.posix.dirname(r),o=path_1.default.posix.basename(r);let i;if(null==t?void 0:t[1])if(/\.js\.map$/.test(t[1]))i=await(0,call_func_1.call)("readFileAsync",path_1.default.posix.join(s,t[1]),"utf-8");else{const e=t[1].split("base64,")[1];i=Buffer.from(e,"base64").toString()}else{const e=path_1.default.posix.join(s,o+".map");fs_1.default.existsSync(e)&&(i=await(0,call_func_1.call)("readFileAsync",e,"utf-8"))}if(i){const e=(0,jsonParse_1.jsonParse)(i);new(require("source-map").SourceMapConsumer)(e);return await insertSourcesContent(e,r),e}}catch(e){log_1.default.log(`try to get input sourcemap of ${r} catch error ${e}`)}}const insertSourcesContent=async(e,r)=>{if(Array.isArray(e.sources)&&!Array.isArray(e.sourcesContent)){const t=e.sourcesContent;try{const t=path_1.default.posix.dirname(r),s=[],o=e.sources;for(const e of o){const r=await(0,call_func_1.call)("readFileAsync",path_1.default.posix.join(t,e),"utf-8");s.push(r)}e.sourcesContent=s}catch(r){e.sourcesContent=t}}};async function compileJS(e){const{code:r,filePath:t,projectPath:s,setting:o,babelRoot:i="@babel/runtime",root:a="",babelIgnore:n=[]}=e,{es7:c,es6:l,disableUseStrict:u}=o,f="string"==typeof r?r:(0,tools_1.bufferToUtf8String)(Buffer.from(r)),p=path_1.default.posix.join(a,t),_=o.minify||o.minifyJS;if(void 0===f)return{error:{code:config_1.FILE_NOT_UTF8,path:p,message:locales_1.default.config.FILE_NOT_UTF8.format(p)}};const m=f.length>=512e3;let g=!1;c&&(g=(0,babel_helper_1.isIgnore)(n,t));const b=await tryGetInputSourceMap(f,path_1.default.posix.join(s,a,t));if(m||g)return{error:null,isLargeFile:m,isBabelIgnore:g,map:"object"==typeof b?JSON.stringify(b):b,code:f,helpers:[]};let h=f,d=b,j=[];if(c){const e=await require("../../js/enhance")({code:f,babelRoot:i,filePath:t,disableUseStrict:u,inputSourceMap:b});if(e.error)return{error:Object.assign(Object.assign({},e.error),{path:p})};h=e.code||"",d=e.map,j=e.helpers||[]}else if(l){const e=require("../../js/es6_transform")({code:f,filePath:t,inputSourceMap:b});if(e.error)return{error:Object.assign(Object.assign({},e.error),{path:p})};h=e.code||"",d=e.map}if(_){if(!l&&!c){const e=require("../../js/minifyjs_after_wrap")({filePath:t,code:h,inputSourceMap:d});if(e.error)return{error:Object.assign(Object.assign({},e.error),{path:p})};h=e.code,d=e.map}else{const e=require("../../js/minifyjs")({filePath:t,code:h,useTerser:!!c,inputSourceMap:d});if(e.error)return{error:Object.assign(Object.assign({},e.error),{path:p})};h=e.code,d=e.map}}if("string"!=typeof d)try{(null==d?void 0:d.sourcesContent)&&(d.sourcesContent=d.sourcesContent.map(e=>e.replace(/\r\n/g,"\n"))),d=JSON.stringify(d)}catch(e){d=""}else d=d.replace(/\\r\\n/g,"\\n");return{error:null,isLargeFile:m,isBabelIgnore:g,map:d,code:h.replace(/\r\n/g,"\n"),helpers:j||[]}}module.exports=compileJS;
1
+ "use strict";const tslib_1=require("tslib"),fs_1=tslib_1.__importDefault(require("fs")),path_1=tslib_1.__importDefault(require("path")),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),tools_1=require("../../../utils/tools"),config_1=require("../../../config"),call_func_1=require("./call_func"),log_1=tslib_1.__importDefault(require("../../../utils/log")),babel_helper_1=require("../../../utils/babel_helper"),jsonParse_1=require("../../../utils/jsonParse"),sourcemap=()=>require("source-map"),enhanceCompile=()=>require("../../js/enhance"),workletCompile=()=>require("../../js/workletCompile"),es6Compile=()=>require("../../js/es6_transform"),minifyJS=()=>require("../../js/minifyjs"),minifyJSAfterWrap=()=>require("../../js/minifyjs_after_wrap"),MAX_CODE_LENGTH=512e3;async function tryGetInputSourceMap(e,r){try{const t=/\/\/[#|@] sourceMappingURL=[\s]*(\S*)[\s]*$/m.exec(e),s=path_1.default.posix.dirname(r),o=path_1.default.posix.basename(r);let i;if(null==t?void 0:t[1])if(/\.js\.map$/.test(t[1]))i=await(0,call_func_1.call)("readFileAsync",path_1.default.posix.join(s,t[1]),"utf-8");else{const e=t[1].split("base64,")[1];i=Buffer.from(e,"base64").toString()}else{const e=path_1.default.posix.join(s,o+".map");fs_1.default.existsSync(e)&&(i=await(0,call_func_1.call)("readFileAsync",e,"utf-8"))}if(i){const e=(0,jsonParse_1.jsonParse)(i);new(require("source-map").SourceMapConsumer)(e);return await insertSourcesContent(e,r),e}}catch(e){log_1.default.log(`try to get input sourcemap of ${r} catch error ${e}`)}}const insertSourcesContent=async(e,r)=>{if(Array.isArray(e.sources)&&!Array.isArray(e.sourcesContent)){const t=e.sourcesContent;try{const t=path_1.default.posix.dirname(r),s=[],o=e.sources;for(const e of o){const r=await(0,call_func_1.call)("readFileAsync",path_1.default.posix.join(t,e),"utf-8");s.push(r)}e.sourcesContent=s}catch(r){e.sourcesContent=t}}};async function compileJS(e){const{code:r,filePath:t,projectPath:s,setting:o,babelRoot:i="@babel/runtime",root:a="",babelIgnore:n=[]}=e,{es7:l,es6:c,disableUseStrict:u,compileWorklet:p}=o,f="string"==typeof r?r:(0,tools_1.bufferToUtf8String)(Buffer.from(r)),_=path_1.default.posix.join(a,t),m=o.minify||o.minifyJS;if(void 0===f)return{error:{code:config_1.FILE_NOT_UTF8,path:_,message:locales_1.default.config.FILE_NOT_UTF8.format(_)}};const b=f.length>=512e3;let d=!1;l&&(d=(0,babel_helper_1.isIgnore)(n,t));const h=await tryGetInputSourceMap(f,path_1.default.posix.join(s,a,t));if(b||d)return{error:null,isLargeFile:b,isBabelIgnore:d,map:"object"==typeof h?JSON.stringify(h):h,code:f,helpers:[]};let g=f,j=h,y=[];if(l){const e=await require("../../js/enhance")({code:f,babelRoot:i,filePath:t,disableUseStrict:u,inputSourceMap:h});if(e.error)return{error:Object.assign(Object.assign({},e.error),{path:_})};g=e.code||"",j=e.map,y=e.helpers||[]}else if(c){const e=require("../../js/es6_transform")({code:f,filePath:t,inputSourceMap:h});if(e.error)return{error:Object.assign(Object.assign({},e.error),{path:_})};g=e.code||"",j=e.map}else if(p){if(f.includes('"worklet"')||f.includes("'worklet'")){const e=await require("../../js/workletCompile")({code:f,babelRoot:i,filePath:t,disableUseStrict:u,inputSourceMap:h});if(e.error)return{error:Object.assign(Object.assign({},e.error),{path:_})};g=e.code||"",j=e.map,y=e.helpers||[]}}if(m){if(!c&&!l){const e=require("../../js/minifyjs_after_wrap")({filePath:t,code:g,inputSourceMap:j});if(e.error)return{error:Object.assign(Object.assign({},e.error),{path:_})};g=e.code,j=e.map}else{const e=require("../../js/minifyjs")({filePath:t,code:g,useTerser:!!l,inputSourceMap:j});if(e.error)return{error:Object.assign(Object.assign({},e.error),{path:_})};g=e.code,j=e.map}}if("string"!=typeof j)try{(null==j?void 0:j.sourcesContent)&&(j.sourcesContent=j.sourcesContent.map(e=>e.replace(/\r\n/g,"\n"))),j=JSON.stringify(j)}catch(e){j=""}else j=j.replace(/\\r\\n/g,"\\n");return{error:null,isLargeFile:b,isBabelIgnore:d,map:j,code:g.replace(/\r\n/g,"\n"),helpers:y||[]}}module.exports=compileJS;
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "1.9.9",
3
- "buildTime": 1695211009942
2
+ "version": "1.9.10",
3
+ "buildTime": 1695609153452
4
4
  }
package/dist/summer/ci.js CHANGED
@@ -1,3 +1,3 @@
1
1
  !function(require, directRequire){
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=void 0;const tools_1=require("../utils/tools"),common_1=require("../core/compile/common"),project_1=require("./project"),recorder_1=require("./recorder"),summer_1=require("./summer");function getSummerOptions(e,r){const i=new Set;return i.add("javascript"),e&&(i.add(["es6module",{disableUseStrict:e.disableUseStrict}]),(e.es7||e.es6)&&i.add(["enhance",{disableUseStrict:e.disableUseStrict}]),(e.minifyWXSS||e.autoPrefixWXSS)&&i.add("wxss"),e.minifyWXML&&i.add("minifywxml"),e.minify&&(i.add("terser"),i.add("wxss"))),r&&r.forEach(e=>{if("string"==typeof e)i.add(e);else{if(!Array.isArray(e))throw new Error("invalid useSummerCompiler options: "+JSON.stringify(e));if("string"!=typeof e[0]||void 0===e[1])throw new Error("invalid useSummerCompiler options: "+JSON.stringify(e));i.add(e)}}),Array.from(i)}async function compile(e,r,i,o){var t;const s={appid:e.appid,attr:await e.attr(),compileType:e.type,miniprogramRoot:e.miniprogramRoot,pluginRoot:e.pluginRoot,summerPlugins:getSummerOptions(i.setting,o),babelSetting:null===(t=null==r?void 0:r.setting)||void 0===t?void 0:t.babelSetting},n=e.getFilesAndDirs();n.files=n.files.filter(common_1.isNotIgnoredByProjectConfig.bind(null,r,e.miniprogramRoot));const m=new project_1.Project((0,tools_1.normalizePath)(e.projectPath),n.files,n.dirs,s),a=new summer_1.SummerCompiler(m,"",s),l=new recorder_1.Recorder((e,r,o)=>{var t;null===(t=i.onProgressUpdate)||void 0===t||t.call(i,{id:e.toString(),message:o,status:r})});return await a.compile({},l)}exports.compile=compile;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=void 0;const tools_1=require("../utils/tools"),common_1=require("../core/compile/common"),project_1=require("./project"),recorder_1=require("./recorder"),summer_1=require("./summer");function getSummerOptions(e,r){const i=new Set;return i.add("javascript"),e&&(i.add(["es6module",{disableUseStrict:e.disableUseStrict}]),e.es7||e.es6?i.add(["enhance",{disableUseStrict:e.disableUseStrict}]):e.compileWorklet&&i.add("worklet"),(e.minifyWXSS||e.autoPrefixWXSS)&&i.add("wxss"),e.minifyWXML&&i.add("minifywxml"),e.minify&&(i.add("terser"),i.add("wxss"))),r&&r.forEach(e=>{if("string"==typeof e)i.add(e);else{if(!Array.isArray(e))throw new Error("invalid useSummerCompiler options: "+JSON.stringify(e));if("string"!=typeof e[0]||void 0===e[1])throw new Error("invalid useSummerCompiler options: "+JSON.stringify(e));i.add(e)}}),Array.from(i)}async function compile(e,r,i,o){var t;const s={appid:e.appid,attr:await e.attr(),compileType:e.type,miniprogramRoot:e.miniprogramRoot,pluginRoot:e.pluginRoot,summerPlugins:getSummerOptions(i.setting,o),babelSetting:null===(t=null==r?void 0:r.setting)||void 0===t?void 0:t.babelSetting},n=e.getFilesAndDirs();n.files=n.files.filter(common_1.isNotIgnoredByProjectConfig.bind(null,r,e.miniprogramRoot));const m=new project_1.Project((0,tools_1.normalizePath)(e.projectPath),n.files,n.dirs,s),l=new summer_1.SummerCompiler(m,"",s),a=new recorder_1.Recorder((e,r,o)=>{var t;null===(t=i.onProgressUpdate)||void 0===t||t.call(i,{id:e.toString(),message:o,status:r})});return await l.compile({},a)}exports.compile=compile;
3
3
  }(require("licia/lazyImport")(require), require)
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const typescript=()=>require("./typescript"),sass=()=>require("./sass"),less=()=>require("./less"),enhance=()=>require("./enhance"),terser=()=>require("./terser"),javascript=()=>require("./base/javascript"),wxss=()=>require("./base/wxss"),es6module=()=>require("./base/es6module"),minifywxml=()=>require("./minifywxml"),plugins={typescript:typescript,less:less,sass:sass,enhance:enhance,javascript:javascript,terser:terser,wxss:wxss,es6module:es6module,minifywxml:minifywxml};exports.default={load:e=>e in plugins?plugins[e]().default:null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const typescript=()=>require("./typescript"),sass=()=>require("./sass"),less=()=>require("./less"),enhance=()=>require("./enhance"),terser=()=>require("./terser"),javascript=()=>require("./base/javascript"),wxss=()=>require("./base/wxss"),es6module=()=>require("./base/es6module"),minifywxml=()=>require("./minifywxml"),worklet=()=>require("./worklet"),plugins={typescript:typescript,less:less,sass:sass,enhance:enhance,javascript:javascript,terser:terser,wxss:wxss,es6module:es6module,minifywxml:minifywxml,worklet:worklet};exports.default={load:e=>e in plugins?plugins[e]().default:null};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const config_1=require("../../config"),types_1=require("../types"),_pluginTransformWorklet=()=>require("../../utils/babel_plugin_worklet"),babel7=()=>require("@babel/core"),worklet=(e,r)=>{const t=babel7();let o;try{const s={babelrc:!1,plugins:[require("../../utils/babel_plugin_worklet")],sourceFileName:r,inputSourceMap:!1,configFile:!1,code:!1,ast:!0,cloneInputAst:!1};if(e.astInfo){if(e.astInfo.type!==types_1.AstType.Babel)throw new Error("ast type is not babel");o=t.transformFromAstSync(e.astInfo.ast,e.sourceCode,s)}else{if(null===e.sourceCode)throw new Error("source.targetCode is null");o=babel7().transform(e.sourceCode,s)}}catch(e){const t=`file: ${r}\n ${e.message}`,o=new Error(t);throw o.code=config_1.BABEL_TRANS_JS_ERR,o}return{sourceCode:e.sourceCode,inputMap:e.inputMap,astInfo:{ast:o.ast,type:types_1.AstType.Babel}}};function default_1(e,r){return{name:"summer-worklet",workerMethods:{worklet:worklet},async transform(e,r,t,{isBabelIgnore:o}){if(r.endsWith(".js")&&!o){return e.sourceCode.includes('"worklet"')||e.sourceCode.includes("'worklet'")?await this.runWorkerMethod("worklet",e,t):e}return e}}}exports.default=default_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miniprogram-ci",
3
- "version": "1.9.9",
3
+ "version": "1.9.10",
4
4
  "description": "pre compilation module about the miniProgram / miniGame project extracted from WeChatDevtools.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/@types/index.d.ts",