UNPKG

@morjs/utils

Version:
184 lines (183 loc) 5.27 kB
import { ObjectValues } from 'takin'; export declare const CLI_NAME = "mor"; /** * 初始化 mor 实例 */ export declare const mor: import("takin").Takin; /** * 命令执行超时时间: 30 分钟 */ export declare const COMMAND_TIMEOUT = 1800000; /** * 额外重试次数 */ export declare const RETRY_TIMES = 1; /** * 源码类型, 目前仅支持 微信或支付宝 */ export declare const SourceTypes: import("takin").ConstObject<["wechat", "alipay"]>; /** * TS 编译类型, 属于 ModuleKind 的子集 * 由于小程序的特殊性, 删除了不兼容的部分 */ export declare const CompileModuleKind: import("takin").ConstObject<["CommonJS", "ES2015", "ES2020", "ESNext"]>; export declare type CompileModuleKindType = ObjectValues<typeof CompileModuleKind>; /** * TS 编译输出目标, 属于 ScriptTarget 的子集 * 由于小程序的特殊性, 删除了不兼容的部分 */ export declare const CompileScriptTarget: import("takin").ConstObject<["ES5", "ES2015", "ES2016", "ES2017", "ES2018", "ES2019", "ES2020", "ES2021", "ESNext", "Latest"]>; export declare type CompileScriptTargetType = ObjectValues<typeof CompileScriptTarget>; /** * 编译类型 * - miniprogram: 以小程序的方式编译或集成 * - plugin: 以插件的方式编译或集成 * - subpackage: 以插件的方式编译或集成 * - component: 以组件的方式编译 */ export declare const CompileTypes: import("takin").ConstObject<["miniprogram", "plugin", "subpackage", "component"]>; /** * Entry 文件类型 */ export declare enum EntryFileType { /** * 脚本文件类型 js/ts 等 */ script = "script", /** * 模版文件类型 *xml */ template = "template", /** * 样式文件类型 */ style = "style", /** * 配置文件类型 json */ config = "config", /** * wxs 或 sjs */ sjs = "sjs" } /** * Entry 分类 */ export declare enum EntryType { /** * 小程序全局文件类型 代表 app.x */ app = "app", /** * 插件全局文件类型 代表 plugin.main 和 plugin.json */ plugin = "plugin", /** * 分包全局文件类型 代表 subpackage.json */ subpackage = "subpackage", /** * 页面类型 */ page = "page", /** * 组件类型 */ component = "component", /** * npm 组件类型 */ npmComponent = "npmComponent", /** * 插件 组件类型 */ pluginComponent = "pluginComponent", /** * 项目 配置文件, 如 project.config.json */ project = "project", /** * sitemap 配置文件 */ sitemap = "sitemap", /** * theme 配置文件 */ theme = "theme", /** * preload 配置文件 */ preload = "preload", /** * ext 配置文件(第三方代开发的配置文件: ext.json) */ ext = "ext", /** * 自定义类型,通过 customEntries 配置传入 */ custom = "custom", /** * 未知类型, 非以上类型的 entry, 均视为 unknown */ unknown = "unknown" } /** * Entry 文件优先级: * - 配置了自定义入口文件 customEntries 的值为 1000 * - 条件编译文件 20, 基础值为 20, 配置多个条件编译后缀时, 位置越靠前的后缀优先级越高, 步进为 5 * - native 文件 15 * - 微信 DSL 文件 10, 如 wxss 或 wxml 或 wxs 文件 * - 支付宝 DSL 文件 5, 如 acss 或 axml 或 sjs 文件 * - 普通文件 0, 如 js 或 ts 或 json 文件 */ export declare enum EntryPriority { CustomEntry = 1000, Conditional = 20, Native = 15, Wechat = 10, Alipay = 5, Normal = 0 } /** * 全局文件 name.g */ export declare const MOR_GLOBAL_FILE: (surfix?: string) => string; /** * 运行时文件 name.r */ export declare const MOR_RUNTIME_FILE: (surfix?: string) => string; /** * 初始化文件 name.i */ export declare const MOR_INIT_FILE: (surfix?: string) => string; /** * vendors 文件 name.v, 用于存放 node_modules 代码 */ export declare const MOR_VENDOR_FILE: (surfix?: string) => string; /** * 通用脚本文件 name.c 用于存放 公共 js 代码 */ export declare const MOR_COMMON_FILE: (surfix?: string) => string; /** * 模拟入口文件 name.a 用于存放 插件或分包的模拟 app 入口代码 */ export declare const MOR_APP_FILE: (surfix?: string) => string; /** * 辅助文件 name.h 用于存放一些辅助方法, 如 mor.h.sjs */ export declare const MOR_HELPER_FILE: (surfix?: string) => string; /** * 共享文件 name.s 用于存放一些共享 node_modules 引用, 如 mor.s.js */ export declare const MOR_SHARED_FILE: (surfix?: string) => string; /** * app.json 的 js 文件, 主要用于集成研发场景下对 app.json 的引用做替换 * 不需要支持 surfix,原因:全局只有一个 app.json 配置文件,也只需要一个 mor.p.js 文件, * 用于确保集成时各个分包更新的 mor.p.js 始终是同一个文件 */ export declare const MOR_COMPOSED_APP_FILE: () => string; /** * Web 转端运行时 js 文件,主要用于默认的转 web 内置运行时 bundle 文件名称 */ export declare const MOR_RUNTIME_WEB_FILE: (surfix?: string) => string;