miniprogram-ci 1.9.15 → 1.9.17
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 +3 -0
- package/README.md +2 -0
- package/dist/@types/config.d.ts +1 -1
- package/dist/@types/utils/common.d.ts +2 -0
- package/dist/@types/utils/tools.d.ts +1 -0
- package/dist/config.js +1 -1
- package/dist/manifest.json +2 -2
- package/dist/summer/plugins/less.js +1 -1
- package/dist/summer/plugins/sass.js +1 -1
- package/dist/utils/common.js +1 -1
- package/dist/utils/tools.js +1 -1
- package/package.json +103 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -7,6 +7,8 @@ miniprogram-ci 是从[微信开发者工具](https://developers.weixin.qq.com/mi
|
|
|
7
7
|
miniprogram-ci 从 1.0.28 开始支持第三方平台开发的上传和预览,调用方式与普通开发模式无异。[查看详情](#第三方平台开发)
|
|
8
8
|
|
|
9
9
|
## 最近变更
|
|
10
|
+
#### 1.9.17
|
|
11
|
+
- `fix` 修复 babel 导致的 path.requeueComputedKeyAndDecorators 问题
|
|
10
12
|
#### 1.9.15
|
|
11
13
|
- `fix` 修复 app.json 的 app-bar 配置未生效的 bug。
|
|
12
14
|
#### 1.9.14
|
package/dist/@types/config.d.ts
CHANGED
|
@@ -25,3 +25,5 @@ export declare function checkPath(options: {
|
|
|
25
25
|
checkPathType?: string;
|
|
26
26
|
}): void;
|
|
27
27
|
export declare function getAllTargetTypeFilesWithOtherTypeFilesOfSameName(project: IProject, targetType: string, otherTypes: string[], filter: string): string[];
|
|
28
|
+
export declare function getMiniprogramRoot(projectPath: string): Promise<string>;
|
|
29
|
+
export declare function getRawProjectConfigJson(projectPath: string): Promise<any>;
|
|
@@ -22,3 +22,4 @@ export declare function generateMD5(buffer: Buffer | string): string;
|
|
|
22
22
|
export declare const formatNumber: (n: number) => string;
|
|
23
23
|
export declare const formatTime: (date: Date) => string;
|
|
24
24
|
export declare const getWorkersPath: (workers: Exclude<AppJSON.IAppJSON['workers'], undefined>) => string;
|
|
25
|
+
export declare const pathRelative: (left: string, right: string) => 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.
|
|
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.26",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,MaxCustomTabbarCount:10,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)
|
package/dist/manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importWxssCssReg=exports.importWxssReg=void 0;const tslib_1=require("tslib"),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),path_1=tslib_1.__importDefault(require("path")),error_1=require("../error"),less=()=>require("less");function default_1(s
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importWxssCssReg=exports.importWxssReg=void 0;const tslib_1=require("tslib"),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),path_1=tslib_1.__importDefault(require("path")),error_1=require("../error"),common_1=require("../../utils/common"),tools_1=require("../../utils/tools"),less=()=>require("less");function default_1(e,s){return{name:"summer-less",resolveExt:{wxss:"less"},async load(t,r){var o;if(r.endsWith(".less")){let t=await fs_extra_1.default.readFile(r,"utf-8");if(this.rootPath){const e=(0,tools_1.normalizePath)(await(0,common_1.getMiniprogramRoot)(this.rootPath)),s=path_1.default.posix.join(e,"app.less");if(r!==s&&fs_extra_1.default.existsSync(s)){const s=(0,tools_1.pathRelative)(e,path_1.default.dirname(r))||".";t=`@import (optional, reference) '${"."===s?".":(0,tools_1.pathRelative)(s,"./")}/app.less';\n${t}`}}const a=[];t=t.replace(exports.importWxssReg,(e,s,t)=>(a.push(t),e.replace(t,t+"?css")));try{const i=await require("less").render(t,{sourceMap:{outputSourceFiles:!0},paths:this.rootPath?[this.rootPath]:[],filename:r,globalVars:null!==(o=null==s?void 0:s.globalVars)&&void 0!==o?o:{}}),l=i.css.replace(exports.importWxssCssReg,(e,s,t)=>{const r=t.slice(0,-4);return a.includes(r)?e.replace(t,r):e});if(i.imports.length)for(const e of i.imports)this.addWatchFile(e);let p=void 0;return i.map&&(p=JSON.parse(i.map),p.sources=p.sources.map(s=>path_1.default.posix.relative(e,s))),{sourceCode:l,inputMap:p}}catch(e){throw(0,error_1.makeSummerError)(e,error_1.SummerErrors.SUMMER_PLUGIN_CODE_ERR)}}}}}exports.importWxssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.wxss)\1(?:\s*);/g,exports.importWxssCssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.wxss\?css)\1(?:\s*);/g,exports.default=default_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.random=void 0;const tslib_1=require("tslib"),tools_1=require("../../utils/tools"),error_1=require("../error"),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),path_1=tslib_1.__importDefault(require("path")),sass=()=>require("sass");function random(){return(0,tools_1.generateMD5)(`${Math.random()}${Date.now()}`)}exports.random=random;const importWxssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.wxss)\1(?:\s*);/g,importCssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.css)\1(?:\s*);/g;function default_1(s){return{name:"summer-sass",resolveExt:{wxss:["sass","scss"]},async load(e
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.random=void 0;const tslib_1=require("tslib"),tools_1=require("../../utils/tools"),error_1=require("../error"),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),path_1=tslib_1.__importDefault(require("path")),common_1=require("../../utils/common"),sass=()=>require("sass");function random(){return(0,tools_1.generateMD5)(`${Math.random()}${Date.now()}`)}exports.random=random;const importWxssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.wxss)\1(?:\s*);/g,importCssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.css)\1(?:\s*);/g;function default_1(s){return{name:"summer-sass",resolveExt:{wxss:["sass","scss"]},async load(t,e){if(e.endsWith(".scss")||e.endsWith(".sass")){let t=await fs_extra_1.default.readFile(e,"utf-8");if(this.rootPath){const s=(0,tools_1.normalizePath)(await(0,common_1.getMiniprogramRoot)(this.rootPath)),o=path_1.default.posix.join(s,"global");if(e!==o+".scss"&&e!==o+".sass"){let o=path_1.default.extname(e);const r=(0,tools_1.pathRelative)(s,path_1.default.dirname(e))||".";fs_extra_1.default.existsSync(path_1.default.posix.join(s,"global"+o))||(o=".sass"===o?".scss":".sass"),fs_extra_1.default.existsSync(path_1.default.posix.join(s,"global"+o))&&(t=".sass"===o?`@use '${"."===r?".":(0,tools_1.pathRelative)(r,"./")}/global${o}'\n${t}`:`@use '${"."===r?".":(0,tools_1.pathRelative)(r,"./")}/global${o}';\n${t}`)}}const o=[];t=t.replace(importWxssReg,(s,t,e)=>(o.push(e),s.replace(e,e.slice(0,-4)+"css")));const r=path_1.default.posix.dirname((0,tools_1.pathRelative)(s,e));return new Promise((s,a)=>{require("sass").render({file:e,data:t,sourceMap:!0,sourceMapContents:!0,omitSourceMapUrl:!0,outFile:e.slice(0,-5)+".wxss",includePaths:this.rootPath?[this.rootPath]:[]},(t,i)=>{if(t){const s=(0,error_1.makeSummerError)(t,error_1.SummerErrors.SUMMER_PLUGIN_CODE_ERR);return void a(s)}if(!i)return void a(new Error("no result"));const l=i.css.toString("utf-8").replace(importCssReg,(s,t,e)=>{const r=e.slice(0,-3)+"wxss";return o.includes(r)?s.replace(e,r):s});if(i.stats.includedFiles.length>0)for(const s of i.stats.includedFiles)s!==e&&this.addWatchFile(s);const n=i.map?JSON.parse(i.map.toString("utf-8")):void 0;n&&(n.sourceRoot=r),s({sourceCode:l,inputMap:n})})})}}}}exports.default=default_1;
|
package/dist/utils/common.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAllTargetTypeFilesWithOtherTypeFilesOfSameName=exports.checkPath=exports.ECheckPathType=exports.checkUTF8=exports.throwError=exports.getAllPagesInfo=exports.getAllPages=void 0;const tslib_1=require("tslib"),tools_1=require("./tools"),config_1=require("../config"),path_1=tslib_1.__importDefault(require("path")),locales_1=tslib_1.__importDefault(require("./locales/locales")),getAllPages=e=>{const t=[...e.pages];if(e.subPackages)for(const o of e.subPackages)for(const e of o.pages)t.push((0,tools_1.normalizePath)(path_1.default.posix.join(o.root,e)));return t};exports.getAllPages=getAllPages;const getAllPagesInfo=e=>{const t=e.pages.map(e=>({path:e,root:config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT,name:config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT}));if(e.subPackages)for(const o of e.subPackages)for(const e of o.pages)t.push({path:(0,tools_1.normalizePath)(path_1.default.posix.join(o.root,e)),root:o.root,name:o.name||""});return t};function throwError(e){const{msg:t,code:o=config_1.JSON_CONTENT_ERR,filePath:r}=e,a=new Error(`${r}: ${t}`);throw a.code=o,a.path=r,a}function checkUTF8(e,t){let o="";try{o=(0,tools_1.bufferToUtf8String)(e)}catch(e){o=""}return void 0===o&&throwError({msg:locales_1.default.config.FILE_NOT_UTF8.format(t),code:config_1.FILE_NOT_UTF8,filePath:t}),o}var ECheckPathType;function checkPath(e){const{value:t,tips:o,filePath:r="app.json",code:a=config_1.JSON_CONTENT_ERR,checkPathType:s=e.checkPathType||ECheckPathType.NORMAL}=e;"string"!==(0,tools_1.getType)(t)&&throwError({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([o,"string"]),code:a,filePath:r}),""===t&&throwError({msg:locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format([o,"''"]),code:a,filePath:r}),t.includes("\\")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"\\"]),code:a,filePath:r}),t.includes("//")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"//"]),code:a,filePath:r}),s===ECheckPathType.NORMAL&&t.startsWith(".")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o,"."]),code:a,filePath:r}),s===ECheckPathType.NORMAL&&t.startsWith("/")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o,"/"]),code:a,filePath:r}),t.startsWith(" ")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o," "]),code:a,filePath:r}),(t.includes("../")||t.endsWith("/.."))&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"../"]),code:a,filePath:r})}function getAllTargetTypeFilesWithOtherTypeFilesOfSameName(e,t,o,r){if(!t)return[];const a=e.getFileList(r,t);if(!o||0===o.length)return a;const s=o.map(t=>new Set(e.getFileList(r,t).map(e=>e.slice(0,-t.length))));return a.map(e=>e.slice(0,-t.length)).filter(e=>s.every(t=>t.has(e))).map(e=>`${e}${t}`)}exports.getAllPagesInfo=getAllPagesInfo,exports.throwError=throwError,exports.checkUTF8=checkUTF8,function(e){e.NORMAL="NORMAL",e.TAB_BAR_ICON="TAB_BAR_ICON"}(ECheckPathType=exports.ECheckPathType||(exports.ECheckPathType={})),exports.checkPath=checkPath,exports.getAllTargetTypeFilesWithOtherTypeFilesOfSameName=getAllTargetTypeFilesWithOtherTypeFilesOfSameName;
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getRawProjectConfigJson=exports.getMiniprogramRoot=exports.getAllTargetTypeFilesWithOtherTypeFilesOfSameName=exports.checkPath=exports.ECheckPathType=exports.checkUTF8=exports.throwError=exports.getAllPagesInfo=exports.getAllPages=void 0;const tslib_1=require("tslib"),tools_1=require("./tools"),config_1=require("../config"),path_1=tslib_1.__importDefault(require("path")),fs=tslib_1.__importStar(require("fs-extra")),locales_1=tslib_1.__importDefault(require("./locales/locales")),jsonParse_1=require("./jsonParse"),lodash_1=require("lodash"),getAllPages=e=>{const t=[...e.pages];if(e.subPackages)for(const o of e.subPackages)for(const e of o.pages)t.push((0,tools_1.normalizePath)(path_1.default.posix.join(o.root,e)));return t};exports.getAllPages=getAllPages;const getAllPagesInfo=e=>{const t=e.pages.map(e=>({path:e,root:config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT,name:config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT}));if(e.subPackages)for(const o of e.subPackages)for(const e of o.pages)t.push({path:(0,tools_1.normalizePath)(path_1.default.posix.join(o.root,e)),root:o.root,name:o.name||""});return t};function throwError(e){const{msg:t,code:o=config_1.JSON_CONTENT_ERR,filePath:r}=e,a=new Error(`${r}: ${t}`);throw a.code=o,a.path=r,a}function checkUTF8(e,t){let o="";try{o=(0,tools_1.bufferToUtf8String)(e)}catch(e){o=""}return void 0===o&&throwError({msg:locales_1.default.config.FILE_NOT_UTF8.format(t),code:config_1.FILE_NOT_UTF8,filePath:t}),o}var ECheckPathType;function checkPath(e){const{value:t,tips:o,filePath:r="app.json",code:a=config_1.JSON_CONTENT_ERR,checkPathType:s=e.checkPathType||ECheckPathType.NORMAL}=e;"string"!==(0,tools_1.getType)(t)&&throwError({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([o,"string"]),code:a,filePath:r}),""===t&&throwError({msg:locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format([o,"''"]),code:a,filePath:r}),t.includes("\\")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"\\"]),code:a,filePath:r}),t.includes("//")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"//"]),code:a,filePath:r}),s===ECheckPathType.NORMAL&&t.startsWith(".")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o,"."]),code:a,filePath:r}),s===ECheckPathType.NORMAL&&t.startsWith("/")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o,"/"]),code:a,filePath:r}),t.startsWith(" ")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o," "]),code:a,filePath:r}),(t.includes("../")||t.endsWith("/.."))&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"../"]),code:a,filePath:r})}function getAllTargetTypeFilesWithOtherTypeFilesOfSameName(e,t,o,r){if(!t)return[];const a=e.getFileList(r,t);if(!o||0===o.length)return a;const s=o.map(t=>new Set(e.getFileList(r,t).map(e=>e.slice(0,-t.length))));return a.map(e=>e.slice(0,-t.length)).filter(e=>s.every(t=>t.has(e))).map(e=>`${e}${t}`)}async function getMiniprogramRoot(e){const t=await getRawProjectConfigJson(e);if((0,lodash_1.isEmpty)(t))return e;{const o=t.miniprogramRoot;return"string"==typeof o&&o.length>0?path_1.default.join(e,o):e}}async function getRawProjectConfigJson(e){const t=path_1.default.join(e,"project.config.json");try{const e=await fs.readFile(t,"utf8");return(0,jsonParse_1.jsonParse)(e)}catch(e){return{}}}exports.getAllPagesInfo=getAllPagesInfo,exports.throwError=throwError,exports.checkUTF8=checkUTF8,function(e){e.NORMAL="NORMAL",e.TAB_BAR_ICON="TAB_BAR_ICON"}(ECheckPathType=exports.ECheckPathType||(exports.ECheckPathType={})),exports.checkPath=checkPath,exports.getAllTargetTypeFilesWithOtherTypeFilesOfSameName=getAllTargetTypeFilesWithOtherTypeFilesOfSameName,exports.getMiniprogramRoot=getMiniprogramRoot,exports.getRawProjectConfigJson=getRawProjectConfigJson;
|
|
3
3
|
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/tools.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getWorkersPath=exports.formatTime=exports.formatNumber=exports.generateMD5=exports.formatSourceMap=exports.isFileIncluded=exports.isFileIgnored=exports.leading=exports.trailing=exports.escapeQuot=exports.mkdirSync=exports.rmSync=exports.isHexColor=exports.formatJSONParseErr=exports.bufferToUtf8String=exports.getType=exports.normalizePath=void 0;const tslib_1=require("tslib"),fs_1=tslib_1.__importDefault(require("fs")),path_1=tslib_1.__importDefault(require("path")),babel_code_frame_1=tslib_1.__importDefault(require("babel-code-frame")),minimatch_1=tslib_1.__importDefault(require("minimatch")),crypto_1=tslib_1.__importDefault(require("crypto")),jsonlint=require("./jsonlint");function normalizePath(e=""){const t=path_1.default.posix.normalize(e.replace(/\\/g,"/"));return!e.startsWith("//")&&!e.startsWith("\\\\")||t.startsWith("//")?t:"/"+t}function getType(e){return Object.prototype.toString.call(e).toLowerCase().split(" ")[1].replace("]","")}exports.normalizePath=normalizePath,exports.getType=getType;const bufferToUtf8String=e=>{const t=e.toString();if(0===Buffer.compare(Buffer.from(t,"utf8"),e))return t};function getErrLine(e,t,r,
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pathRelative=exports.getWorkersPath=exports.formatTime=exports.formatNumber=exports.generateMD5=exports.formatSourceMap=exports.isFileIncluded=exports.isFileIgnored=exports.leading=exports.trailing=exports.escapeQuot=exports.mkdirSync=exports.rmSync=exports.isHexColor=exports.formatJSONParseErr=exports.bufferToUtf8String=exports.getType=exports.normalizePath=void 0;const tslib_1=require("tslib"),fs_1=tslib_1.__importDefault(require("fs")),path_1=tslib_1.__importDefault(require("path")),babel_code_frame_1=tslib_1.__importDefault(require("babel-code-frame")),minimatch_1=tslib_1.__importDefault(require("minimatch")),crypto_1=tslib_1.__importDefault(require("crypto")),jsonlint=require("./jsonlint");function normalizePath(e=""){const t=path_1.default.posix.normalize(e.replace(/\\/g,"/"));return!e.startsWith("//")&&!e.startsWith("\\\\")||t.startsWith("//")?t:"/"+t}function getType(e){return Object.prototype.toString.call(e).toLowerCase().split(" ")[1].replace("]","")}exports.normalizePath=normalizePath,exports.getType=getType;const bufferToUtf8String=e=>{const t=e.toString();if(0===Buffer.compare(Buffer.from(t,"utf8"),e))return t};function getErrLine(e,t,r,a){r=r>0?r:1;return`${a}\n${(0,babel_code_frame_1.default)(e,t,r)}`}exports.bufferToUtf8String=bufferToUtf8String;const formatJSONParseErr=e=>{const t=e.data||"";try{jsonlint.parser.parse(t)}catch(r){try{const a=`Expecting ${r.expected}, got ${r.token}`,i=getErrLine(t,r.line,r.loc.first_column,a);return`${e.filePath}\n${i}`}catch(e){}}return`${e.filePath}\n${e.error}`};exports.formatJSONParseErr=formatJSONParseErr;const isHexColor=e=>/^#[a-f\d]{3}$/i.test(e)||/^#[a-f\d]{4}$/i.test(e)||/^#[a-f\d]{6}$/i.test(e)||/^#[a-f\d]{8}$/i.test(e);function rmSync(e){try{if(e=path_1.default.resolve(e),!fs_1.default.existsSync(e))return;if(fs_1.default.lstatSync(e).isDirectory()){const t=fs_1.default.readdirSync(e);if(t.length>0)for(let r=0,a=t.length;r<a;r++)rmSync(path_1.default.posix.join(e,t[r]));fs_1.default.rmdirSync(e)}else fs_1.default.unlinkSync(e)}catch(e){}}function mkdirSync(e){if(e=path_1.default.resolve(e),fs_1.default.existsSync(e)){if(fs_1.default.lstatSync(e).isDirectory())return;fs_1.default.unlinkSync(e)}mkdirSync(path_1.default.dirname(e)),fs_1.default.mkdirSync(e)}function escapeQuot(e,t="`"){return e?"`"===t?e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$"):'"'===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/"/g,'\\"'):"'"===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/'/g,"\\'"):e:e}function trailing(e,t,r=!1){return r?e.endsWith(t)?e.slice(0,e.length-1):e:e.endsWith(t)?e:e+t}function leading(e,t,r=!1){return r?e.startsWith(t)?e.slice(1):e:e.startsWith(t)?e:t+e}exports.isHexColor=isHexColor,exports.rmSync=rmSync,exports.mkdirSync=mkdirSync,exports.escapeQuot=escapeQuot,exports.trailing=trailing,exports.leading=leading;const FFSPRGRulesFactory=function(e){let t=null,r=Object.create(null);return function(e,a){if(a.length<1)return!1;if(t===a){if(void 0!==r[e])return r[e]}else t=a,r=Object.create(null);const i=e.replace(/\\/g,"/").toLowerCase();if(!i)return!1;const o=i.slice(i.lastIndexOf("/")+1);let n=!1;for(const e of a){if(!e)continue;const t=e.value.toLowerCase();if("prefix"===e.type)n=o.startsWith(t);else if("suffix"===e.type)n=o.endsWith(t);else if("folder"===e.type)n=leading(i,"/").startsWith(trailing(leading(t,"/"),"/"));else if("file"===e.type)n=leading(i,"/")===leading(t,"/");else if("glob"===e.type)try{n=(0,minimatch_1.default)(i,t)||(0,minimatch_1.default)(leading(i,"/"),t)}catch(e){n=!1}else if("regexp"===e.type)try{n=new RegExp(t,"igm").test(i)||new RegExp(t,"igm").test(leading(i,"/"))}catch(e){n=!1}if(n)break}return r[e]=n,n}};function formatSourceMap(e){if(e){if("string"===getType(e))return e;try{return JSON.stringify(e)}catch(e){}}}function generateMD5(e){const t=crypto_1.default.createHash("md5");return t.update(e),t.digest("hex")}exports.isFileIgnored=FFSPRGRulesFactory(),exports.isFileIncluded=FFSPRGRulesFactory(),exports.formatSourceMap=formatSourceMap,exports.generateMD5=generateMD5;const formatNumber=e=>e>9?""+e:"0"+e;exports.formatNumber=formatNumber;const formatTime=e=>{const t=e.getFullYear(),r=e.getMonth()+1,a=e.getDate(),i=e.getHours(),o=e.getMinutes(),n=e.getSeconds();return`${[t,r,a].map(exports.formatNumber).join("/")} ${[i,o,n].map(exports.formatNumber).join(":")}`};exports.formatTime=formatTime;const getWorkersPath=e=>"string"==typeof e?e:e.path;exports.getWorkersPath=getWorkersPath;const pathRelative=(e,t)=>(e=path_1.default.posix.normalize(e.replace(/\\/g,"/")),t=path_1.default.posix.normalize(t.replace(/\\/g,"/")),path_1.default.posix.relative(e,t));exports.pathRelative=pathRelative;
|
|
3
3
|
}(require("licia/lazyImport")(require), require)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miniprogram-ci",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.17",
|
|
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",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@tencent/eslint-config-tencent": "^1.0.4",
|
|
44
|
-
"@types/babel__core": "
|
|
44
|
+
"@types/babel__core": "7.1.17",
|
|
45
45
|
"@types/babel-code-frame": "^6.20.2",
|
|
46
|
-
"@types/babel-core": "
|
|
46
|
+
"@types/babel-core": "6.25.6",
|
|
47
47
|
"@types/cssnano": "^4.0.1",
|
|
48
48
|
"@types/estree": "0.0.47",
|
|
49
49
|
"@types/fs-extra": "^8.0.0",
|
|
@@ -76,27 +76,127 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@babel/core": "7.21.4",
|
|
79
|
+
"@babel/code-frame": "7.22.10",
|
|
80
|
+
"@babel/compat-data": "7.22.9",
|
|
81
|
+
"@babel/eslint-parser": "7.22.10",
|
|
79
82
|
"@babel/generator": "7.21.4",
|
|
83
|
+
"@babel/helper-annotate-as-pure": "7.22.5",
|
|
84
|
+
"@babel/helper-builder-binary-assignment-operator-visitor": "7.22.10",
|
|
85
|
+
"@babel/helper-compilation-targets": "7.22.10",
|
|
86
|
+
"@babel/helper-create-class-features-plugin": "7.22.10",
|
|
87
|
+
"@babel/helper-create-regexp-features-plugin": "7.22.9",
|
|
88
|
+
"@babel/helper-define-polyfill-provider": "0.3.3",
|
|
89
|
+
"@babel/helper-environment-visitor": "7.22.5",
|
|
90
|
+
"@babel/helper-function-name": "7.22.5",
|
|
91
|
+
"@babel/helper-hoist-variables": "7.22.5",
|
|
92
|
+
"@babel/helper-member-expression-to-functions": "7.22.5",
|
|
80
93
|
"@babel/helper-module-imports": "7.21.4",
|
|
94
|
+
"@babel/helper-module-transforms": "7.22.9",
|
|
95
|
+
"@babel/helper-optimise-call-expression": "7.22.5",
|
|
96
|
+
"@babel/helper-plugin-utils": "7.24.6",
|
|
97
|
+
"@babel/helper-remap-async-to-generator": "7.22.9",
|
|
98
|
+
"@babel/helper-replace-supers": "7.22.9",
|
|
99
|
+
"@babel/helper-simple-access": "7.22.5",
|
|
100
|
+
"@babel/helper-skip-transparent-expression-wrappers": "7.24.6",
|
|
101
|
+
"@babel/helper-split-export-declaration": "7.22.6",
|
|
102
|
+
"@babel/helper-string-parser": "7.24.6",
|
|
103
|
+
"@babel/helper-validator-identifier": "7.24.6",
|
|
104
|
+
"@babel/helper-validator-option": "7.22.5",
|
|
105
|
+
"@babel/helper-wrap-function": "7.22.10",
|
|
81
106
|
"@babel/helpers": "7.21.0",
|
|
107
|
+
"@babel/highlight": "7.22.10",
|
|
82
108
|
"@babel/parser": "7.21.4",
|
|
109
|
+
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "7.24.6",
|
|
110
|
+
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "7.24.6",
|
|
111
|
+
"@babel/plugin-proposal-async-generator-functions": "7.20.7",
|
|
83
112
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
113
|
+
"@babel/plugin-proposal-class-static-block": "7.21.0",
|
|
84
114
|
"@babel/plugin-proposal-decorators": "7.21.0",
|
|
85
115
|
"@babel/plugin-proposal-do-expressions": "7.18.6",
|
|
116
|
+
"@babel/plugin-proposal-dynamic-import": "7.18.6",
|
|
86
117
|
"@babel/plugin-proposal-export-default-from": "7.18.10",
|
|
118
|
+
"@babel/plugin-proposal-export-namespace-from": "7.18.9",
|
|
87
119
|
"@babel/plugin-proposal-function-bind": "7.18.9",
|
|
88
120
|
"@babel/plugin-proposal-function-sent": "7.18.6",
|
|
121
|
+
"@babel/plugin-proposal-json-strings": "7.18.6",
|
|
122
|
+
"@babel/plugin-proposal-logical-assignment-operators": "7.20.7",
|
|
123
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
|
|
124
|
+
"@babel/plugin-proposal-numeric-separator": "7.18.6",
|
|
125
|
+
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
|
|
126
|
+
"@babel/plugin-proposal-optional-catch-binding": "7.18.6",
|
|
127
|
+
"@babel/plugin-proposal-optional-chaining": "7.21.0",
|
|
89
128
|
"@babel/plugin-proposal-pipeline-operator": "7.18.9",
|
|
90
129
|
"@babel/plugin-proposal-private-methods": "7.18.6",
|
|
91
130
|
"@babel/plugin-proposal-private-property-in-object": "7.21.0",
|
|
92
131
|
"@babel/plugin-proposal-throw-expressions": "7.18.6",
|
|
132
|
+
"@babel/plugin-proposal-unicode-property-regex": "7.18.6",
|
|
133
|
+
"@babel/plugin-syntax-async-generators": "7.8.4",
|
|
134
|
+
"@babel/plugin-syntax-bigint": "7.8.3",
|
|
135
|
+
"@babel/plugin-syntax-class-properties": "7.12.13",
|
|
136
|
+
"@babel/plugin-syntax-class-static-block": "7.14.5",
|
|
137
|
+
"@babel/plugin-syntax-decorators": "7.22.10",
|
|
138
|
+
"@babel/plugin-syntax-do-expressions": "7.22.5",
|
|
139
|
+
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
|
140
|
+
"@babel/plugin-syntax-export-default-from": "7.22.5",
|
|
141
|
+
"@babel/plugin-syntax-export-namespace-from": "7.8.3",
|
|
142
|
+
"@babel/plugin-syntax-function-bind": "7.22.5",
|
|
143
|
+
"@babel/plugin-syntax-function-sent": "7.22.5",
|
|
144
|
+
"@babel/plugin-syntax-import-assertions": "7.24.6",
|
|
145
|
+
"@babel/plugin-syntax-import-meta": "7.10.4",
|
|
146
|
+
"@babel/plugin-syntax-json-strings": "7.8.3",
|
|
147
|
+
"@babel/plugin-syntax-logical-assignment-operators": "7.10.4",
|
|
148
|
+
"@babel/plugin-syntax-nullish-coalescing-operator": "7.8.3",
|
|
149
|
+
"@babel/plugin-syntax-numeric-separator": "7.10.4",
|
|
150
|
+
"@babel/plugin-syntax-object-rest-spread": "7.8.3",
|
|
151
|
+
"@babel/plugin-syntax-optional-catch-binding": "7.8.3",
|
|
152
|
+
"@babel/plugin-syntax-optional-chaining": "7.8.3",
|
|
153
|
+
"@babel/plugin-syntax-pipeline-operator": "7.22.5",
|
|
154
|
+
"@babel/plugin-syntax-private-property-in-object": "7.14.5",
|
|
155
|
+
"@babel/plugin-syntax-throw-expressions": "7.22.5",
|
|
156
|
+
"@babel/plugin-syntax-top-level-await": "7.14.5",
|
|
157
|
+
"@babel/plugin-syntax-typescript": "7.22.5",
|
|
158
|
+
"@babel/plugin-transform-arrow-functions": "7.22.5",
|
|
159
|
+
"@babel/plugin-transform-async-to-generator": "7.22.5",
|
|
160
|
+
"@babel/plugin-transform-block-scoped-functions": "7.22.5",
|
|
161
|
+
"@babel/plugin-transform-block-scoping": "7.22.10",
|
|
162
|
+
"@babel/plugin-transform-classes": "7.22.6",
|
|
163
|
+
"@babel/plugin-transform-computed-properties": "7.22.5",
|
|
164
|
+
"@babel/plugin-transform-destructuring": "7.22.10",
|
|
165
|
+
"@babel/plugin-transform-dotall-regex": "7.22.5",
|
|
166
|
+
"@babel/plugin-transform-duplicate-keys": "7.22.5",
|
|
167
|
+
"@babel/plugin-transform-exponentiation-operator": "7.22.5",
|
|
168
|
+
"@babel/plugin-transform-for-of": "7.22.5",
|
|
169
|
+
"@babel/plugin-transform-function-name": "7.22.5",
|
|
170
|
+
"@babel/plugin-transform-literals": "7.22.5",
|
|
171
|
+
"@babel/plugin-transform-member-expression-literals": "7.22.5",
|
|
172
|
+
"@babel/plugin-transform-modules-amd": "7.22.5",
|
|
93
173
|
"@babel/plugin-transform-modules-commonjs": "7.21.2",
|
|
174
|
+
"@babel/plugin-transform-modules-systemjs": "7.22.5",
|
|
175
|
+
"@babel/plugin-transform-modules-umd": "7.22.5",
|
|
176
|
+
"@babel/plugin-transform-named-capturing-groups-regex": "7.22.5",
|
|
177
|
+
"@babel/plugin-transform-new-target": "7.22.5",
|
|
178
|
+
"@babel/plugin-transform-object-super": "7.22.5",
|
|
179
|
+
"@babel/plugin-transform-optional-chaining": "7.24.6",
|
|
180
|
+
"@babel/plugin-transform-parameters": "7.22.5",
|
|
181
|
+
"@babel/plugin-transform-property-literals": "7.22.5",
|
|
182
|
+
"@babel/plugin-transform-regenerator": "7.22.10",
|
|
183
|
+
"@babel/plugin-transform-reserved-words": "7.22.5",
|
|
94
184
|
"@babel/plugin-transform-runtime": "7.21.4",
|
|
185
|
+
"@babel/plugin-transform-shorthand-properties": "7.22.5",
|
|
186
|
+
"@babel/plugin-transform-spread": "7.22.5",
|
|
187
|
+
"@babel/plugin-transform-sticky-regex": "7.22.5",
|
|
188
|
+
"@babel/plugin-transform-template-literals": "7.22.5",
|
|
189
|
+
"@babel/plugin-transform-typeof-symbol": "7.22.5",
|
|
95
190
|
"@babel/plugin-transform-typescript": "7.21.3",
|
|
191
|
+
"@babel/plugin-transform-unicode-escapes": "7.22.10",
|
|
192
|
+
"@babel/plugin-transform-unicode-regex": "7.22.5",
|
|
96
193
|
"@babel/preset-env": "7.21.4",
|
|
194
|
+
"@babel/preset-modules": "0.1.6",
|
|
195
|
+
"@babel/regjsgen": "0.8.0",
|
|
97
196
|
"@babel/runtime": "7.21.0",
|
|
98
197
|
"@babel/template": "7.20.7",
|
|
99
198
|
"@babel/traverse": "7.21.4",
|
|
199
|
+
"@babel/types": "7.24.6",
|
|
100
200
|
"@vue/reactivity": "3.0.5",
|
|
101
201
|
"acorn": "^6.1.1",
|
|
102
202
|
"autoprefixer": "^10.4.0",
|