@plugin-light/shared 0.0.14 → 0.0.19
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/lib/config-project.d.ts +6 -6
- package/lib/config.d.ts +18 -1
- package/lib/css.d.ts +3 -0
- package/lib/helper.d.ts +0 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +49 -28
- package/lib/platform.d.ts +1 -0
- package/package.json +3 -3
package/lib/config-project.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const DEFAULT_TRANSPILE_DEPENDENCIES: string[];
|
|
2
2
|
export declare const DEFAULT_ADAPTER_DIRS: string[];
|
|
3
|
-
export declare const AEGIS_EXTERNAL_SCRIPT_LINK
|
|
4
|
-
export declare const UNI_SIMPLE_ROUTER_SCRIPT_LINK
|
|
3
|
+
export declare const AEGIS_EXTERNAL_SCRIPT_LINK: "https://image-1251917893.file.myqcloud.com/igame/npm/aegis-web/aegis.min.js";
|
|
4
|
+
export declare const UNI_SIMPLE_ROUTER_SCRIPT_LINK: "https://image-1251917893.file.myqcloud.com/igame/npm/uni-simple-router/uni-simple-router-2.0.8-beta-4.js";
|
|
5
5
|
export declare const EXTERNAL_LINK_MAP: {
|
|
6
|
-
AXIOS:
|
|
7
|
-
VUE_LAZY_LOAD:
|
|
8
|
-
AEGIS_WEB:
|
|
9
|
-
UNI_SIMPLE_ROUTER:
|
|
6
|
+
AXIOS: "https://image-1251917893.file.myqcloud.com/igame/npm/axios@0.18.0/dist/axios.min.js";
|
|
7
|
+
VUE_LAZY_LOAD: "https://image-1251917893.file.myqcloud.com/igame/npm/vue-lazyload@1.3.3/vue-lazyload.js";
|
|
8
|
+
AEGIS_WEB: "https://image-1251917893.file.myqcloud.com/igame/npm/aegis-web/aegis.min.js";
|
|
9
|
+
UNI_SIMPLE_ROUTER: "https://image-1251917893.file.myqcloud.com/igame/npm/uni-simple-router/uni-simple-router-2.0.8-beta-4.js";
|
|
10
10
|
};
|
package/lib/config.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare const PLATFORM_MAP: {
|
|
|
2
2
|
readonly MP_WX: "mp-weixin";
|
|
3
3
|
readonly MP_QQ: "mp-qq";
|
|
4
4
|
readonly MP_ALIPAY: "mp-alipay";
|
|
5
|
+
readonly MP_JD: "mp-jd";
|
|
5
6
|
readonly H5: "h5";
|
|
6
7
|
};
|
|
7
8
|
export declare const ALL_PLATFORM = "ALL";
|
|
@@ -21,5 +22,21 @@ export declare const CSS_MAP: {
|
|
|
21
22
|
};
|
|
22
23
|
export declare const CSS_POSTFIX_MAP: any;
|
|
23
24
|
export declare const CDN_MAP: {
|
|
24
|
-
|
|
25
|
+
readonly UNI_SIMPLE_ROUTER_BETA4: "https://image-1251917893.file.myqcloud.com/igame/npm/uni-simple-router/uni-simple-router-2.0.8-beta-4.js";
|
|
26
|
+
readonly UNI_SIMPLE_ROUTER: "https://image-1251917893.file.myqcloud.com/igame/npm/uni-simple-router/uni-simple-router%402.0.8-beta.4-1.js";
|
|
27
|
+
readonly AEGIS_WEB: "https://image-1251917893.file.myqcloud.com/igame/npm/aegis-web/aegis.min.js";
|
|
28
|
+
readonly AEGIS_WEB_V2: "https://image-1251917893.file.myqcloud.com/igame/npm/aegis-web/v2.min.2.3.41.js";
|
|
29
|
+
readonly AXIOS: "https://image-1251917893.file.myqcloud.com/igame/npm/axios@0.18.0/dist/axios.min.js";
|
|
30
|
+
readonly VUE_LAZY_LOAD: "https://image-1251917893.file.myqcloud.com/igame/npm/vue-lazyload@1.3.3/vue-lazyload.js";
|
|
31
|
+
readonly VUE_V2: "https://image-1251917893.file.myqcloud.com/igame/npm/vue%402.6.10/dist/vue.runtime.min.js";
|
|
32
|
+
readonly VUE_V3: "https://image-1251917893.file.myqcloud.com/igame/npm/vue@3.3.6/vue.runtime.global.prod.js";
|
|
33
|
+
readonly VUE_DEMI: "https://image-1251917893.file.myqcloud.com/igame/npm/vue-demi@0.14.6/index.iife.min.js";
|
|
34
|
+
readonly VUE_ROUTER_V3: "https://image-1251917893.file.myqcloud.com/igame/npm/vue-router@3.5.2/dist/vue-router.min.js";
|
|
35
|
+
readonly VUE_ROUTER_V4: "https://image-1251917893.file.myqcloud.com/igame/npm/vue-router@4.2.5/vue-router.global.prod.js";
|
|
36
|
+
readonly VUEX_V3: "https://image-1251917893.file.myqcloud.com/igame/npm/vuex@3.0.1/dist/vuex.min.js";
|
|
37
|
+
readonly VUEX_V4: "https://image-1251917893.cos.ap-guangzhou.myqcloud.com/igame/npm/vuex%404.1.0/vuex.global.prod.js";
|
|
38
|
+
readonly PINIA: "https://image-1251917893.file.myqcloud.com/igame/npm/pinia@2.1.7/pinia.iife.min.js";
|
|
39
|
+
readonly ELEMENT_PLUS: "https://image-1251917893.file.myqcloud.com/igame/npm/element-plus/element-plus%402.7.8.js";
|
|
40
|
+
readonly ELEMENT_PLUS_CSS: "https://image-1251917893.file.myqcloud.com/igame/npm/element-plus/element-plus%402.7.8.css";
|
|
41
|
+
readonly E_MONITOR: "https://image-1251917893.file.myqcloud.com/igame/common/js/emonitor_custom_46f41566.js";
|
|
25
42
|
};
|
package/lib/css.d.ts
ADDED
package/lib/helper.d.ts
CHANGED
|
@@ -6,4 +6,3 @@ export declare function updateAssetSource(assets: Record<string, any>, key: stri
|
|
|
6
6
|
export declare function removeFirstSlash(key: string): string;
|
|
7
7
|
export declare function parseSetDeps(deps: Record<string, any>): Record<string, any>;
|
|
8
8
|
export declare function getRelativePath(filePath: string): string;
|
|
9
|
-
export declare function getUniCliCache(key?: string): any;
|
package/lib/index.d.ts
CHANGED
|
@@ -3,13 +3,15 @@ export { isInBlackList, } from './black-list';
|
|
|
3
3
|
export { checkBundleAnalyze, checkDebugMode, } from './bundle-analyze';
|
|
4
4
|
export { PLATFORM_MAP, ALL_PLATFORM, PLATFORMS_ALL, PLATFORMS_MP, HTML_MAP, CSS_MAP, CSS_POSTFIX_MAP, CDN_MAP, } from './config';
|
|
5
5
|
export { DEFAULT_TRANSPILE_DEPENDENCIES, DEFAULT_ADAPTER_DIRS, AEGIS_EXTERNAL_SCRIPT_LINK, UNI_SIMPLE_ROUTER_SCRIPT_LINK, EXTERNAL_LINK_MAP, } from './config-project';
|
|
6
|
-
export { ROOT_NAME, saveJsonToLog, createLogDir, normalizePath, updateAssetSource, removeFirstSlash, parseSetDeps, getRelativePath,
|
|
6
|
+
export { ROOT_NAME, saveJsonToLog, createLogDir, normalizePath, updateAssetSource, removeFirstSlash, parseSetDeps, getRelativePath, } from './helper';
|
|
7
7
|
export { DEFAULT_CONTEXT_OBJECT, } from './context';
|
|
8
|
+
export { scssLogger, } from './css';
|
|
8
9
|
export { getDeps, } from './deps';
|
|
9
10
|
export { findDependencies, } from './find-dependencies';
|
|
10
11
|
export { checkH5, } from './h5';
|
|
11
12
|
export { getLoaderFile, getLoaderProdFile, } from './loader-file';
|
|
12
13
|
export { saveLoaderLog, recordLoaderLog, } from './loader-log';
|
|
14
|
+
export { getWxmlAndWxssPostfix, } from './platform';
|
|
13
15
|
export { getProjectName, getSubProjectName, } from './project-name';
|
|
14
16
|
export { updateManifest, revertManifest, } from './replace-manifest';
|
|
15
17
|
export { getRootDir, } from './root';
|
package/lib/index.js
CHANGED
|
@@ -164,7 +164,7 @@ function getCommitCode(versionName) {
|
|
|
164
164
|
if (versionName) {
|
|
165
165
|
code = `
|
|
166
166
|
window.${versionName} = {
|
|
167
|
-
message: '${commitInfo.message}',
|
|
167
|
+
message: '${parseQuote(commitInfo.message)}',
|
|
168
168
|
author: '${commitInfo.author}',
|
|
169
169
|
date: '${commitInfo.date}',
|
|
170
170
|
hash: '${commitInfo.hash}',
|
|
@@ -394,6 +394,7 @@ const PLATFORM_MAP = {
|
|
|
394
394
|
MP_WX: 'mp-weixin',
|
|
395
395
|
MP_QQ: 'mp-qq',
|
|
396
396
|
MP_ALIPAY: 'mp-alipay',
|
|
397
|
+
MP_JD: 'mp-jd',
|
|
397
398
|
H5: 'h5',
|
|
398
399
|
};
|
|
399
400
|
const ALL_PLATFORM = 'ALL';
|
|
@@ -424,7 +425,23 @@ const CSS_POSTFIX_MAP = Object.keys(CSS_MAP)
|
|
|
424
425
|
return acc;
|
|
425
426
|
}, {});
|
|
426
427
|
const CDN_MAP = {
|
|
427
|
-
|
|
428
|
+
UNI_SIMPLE_ROUTER_BETA4: 'https://image-1251917893.file.myqcloud.com/igame/npm/uni-simple-router/uni-simple-router-2.0.8-beta-4.js',
|
|
429
|
+
UNI_SIMPLE_ROUTER: 'https://image-1251917893.file.myqcloud.com/igame/npm/uni-simple-router/uni-simple-router%402.0.8-beta.4-1.js',
|
|
430
|
+
AEGIS_WEB: 'https://image-1251917893.file.myqcloud.com/igame/npm/aegis-web/aegis.min.js',
|
|
431
|
+
AEGIS_WEB_V2: 'https://image-1251917893.file.myqcloud.com/igame/npm/aegis-web/v2.min.2.3.41.js',
|
|
432
|
+
AXIOS: 'https://image-1251917893.file.myqcloud.com/igame/npm/axios@0.18.0/dist/axios.min.js',
|
|
433
|
+
VUE_LAZY_LOAD: 'https://image-1251917893.file.myqcloud.com/igame/npm/vue-lazyload@1.3.3/vue-lazyload.js',
|
|
434
|
+
VUE_V2: 'https://image-1251917893.file.myqcloud.com/igame/npm/vue%402.6.10/dist/vue.runtime.min.js',
|
|
435
|
+
VUE_V3: 'https://image-1251917893.file.myqcloud.com/igame/npm/vue@3.3.6/vue.runtime.global.prod.js',
|
|
436
|
+
VUE_DEMI: 'https://image-1251917893.file.myqcloud.com/igame/npm/vue-demi@0.14.6/index.iife.min.js',
|
|
437
|
+
VUE_ROUTER_V3: 'https://image-1251917893.file.myqcloud.com/igame/npm/vue-router@3.5.2/dist/vue-router.min.js',
|
|
438
|
+
VUE_ROUTER_V4: 'https://image-1251917893.file.myqcloud.com/igame/npm/vue-router@4.2.5/vue-router.global.prod.js',
|
|
439
|
+
VUEX_V3: 'https://image-1251917893.file.myqcloud.com/igame/npm/vuex@3.0.1/dist/vuex.min.js',
|
|
440
|
+
VUEX_V4: 'https://image-1251917893.cos.ap-guangzhou.myqcloud.com/igame/npm/vuex%404.1.0/vuex.global.prod.js',
|
|
441
|
+
PINIA: 'https://image-1251917893.file.myqcloud.com/igame/npm/pinia@2.1.7/pinia.iife.min.js',
|
|
442
|
+
ELEMENT_PLUS: 'https://image-1251917893.file.myqcloud.com/igame/npm/element-plus/element-plus%402.7.8.js',
|
|
443
|
+
ELEMENT_PLUS_CSS: 'https://image-1251917893.file.myqcloud.com/igame/npm/element-plus/element-plus%402.7.8.css',
|
|
444
|
+
E_MONITOR: 'https://image-1251917893.file.myqcloud.com/igame/common/js/emonitor_custom_46f41566.js',
|
|
428
445
|
};
|
|
429
446
|
|
|
430
447
|
const DEFAULT_TRANSPILE_DEPENDENCIES = [
|
|
@@ -447,20 +464,6 @@ const DEFAULT_TRANSPILE_DEPENDENCIES = [
|
|
|
447
464
|
'pmd-business',
|
|
448
465
|
'pmd-api',
|
|
449
466
|
'@zebra-ui/swiper',
|
|
450
|
-
// /[@\\]tencent[/\\]press-ui/,
|
|
451
|
-
// /[@\\]tencent[/\\]press-plus/,
|
|
452
|
-
// /[@\\]tencent[/\\]pmd-aegis/,
|
|
453
|
-
// /[@\\]tencent[/\\]pmd-app-info/,
|
|
454
|
-
// /[@\\]tencent[/\\]pmd-config/,
|
|
455
|
-
// /[@\\]tencent[/\\]pmd-location/,
|
|
456
|
-
// /[@\\]tencent[/\\]pmd-login/,
|
|
457
|
-
// /[@\\]tencent[/\\]pmd-network/,
|
|
458
|
-
// /[@\\]tencent[/\\]pmd-report/,
|
|
459
|
-
// /[@\\]tencent[/\\]pmd-tools/,
|
|
460
|
-
// /[@\\]tencent[/\\]pmd-widget/,
|
|
461
|
-
// /[@\\]tencent[/\\]pmd-vue/,
|
|
462
|
-
// /[@\\]tencent[/\\]pmd-jsapi/,
|
|
463
|
-
// /[@\\]zebra-ui[/\\]swiper/,
|
|
464
467
|
];
|
|
465
468
|
const DEFAULT_ADAPTER_DIRS = [
|
|
466
469
|
'comm',
|
|
@@ -475,12 +478,12 @@ const DEFAULT_ADAPTER_DIRS = [
|
|
|
475
478
|
'static',
|
|
476
479
|
'node-modules',
|
|
477
480
|
];
|
|
478
|
-
const AEGIS_EXTERNAL_SCRIPT_LINK =
|
|
479
|
-
const UNI_SIMPLE_ROUTER_SCRIPT_LINK =
|
|
481
|
+
const AEGIS_EXTERNAL_SCRIPT_LINK = CDN_MAP.AEGIS_WEB;
|
|
482
|
+
const UNI_SIMPLE_ROUTER_SCRIPT_LINK = CDN_MAP.UNI_SIMPLE_ROUTER_BETA4;
|
|
480
483
|
const EXTERNAL_LINK_MAP = {
|
|
481
|
-
AXIOS:
|
|
482
|
-
VUE_LAZY_LOAD:
|
|
483
|
-
AEGIS_WEB:
|
|
484
|
+
AXIOS: CDN_MAP.AXIOS,
|
|
485
|
+
VUE_LAZY_LOAD: CDN_MAP.VUE_LAZY_LOAD,
|
|
486
|
+
AEGIS_WEB: CDN_MAP.AEGIS_WEB,
|
|
484
487
|
UNI_SIMPLE_ROUTER: UNI_SIMPLE_ROUTER_SCRIPT_LINK,
|
|
485
488
|
};
|
|
486
489
|
|
|
@@ -558,12 +561,6 @@ function parseSetDeps(deps) {
|
|
|
558
561
|
function getRelativePath(filePath) {
|
|
559
562
|
return path__namespace.relative(process.cwd(), path__namespace.resolve(filePath));
|
|
560
563
|
}
|
|
561
|
-
function getUniCliCache(key) {
|
|
562
|
-
const cache = require('@dcloudio/uni-cli-shared/lib/cache');
|
|
563
|
-
if (!key)
|
|
564
|
-
return cache;
|
|
565
|
-
return cache[key];
|
|
566
|
-
}
|
|
567
564
|
|
|
568
565
|
const DEFAULT_KEYS = [
|
|
569
566
|
'UNI_APP_X',
|
|
@@ -600,6 +597,17 @@ const DEFAULT_CONTEXT_OBJECT = DEFAULT_KEYS.reduce((acc, key) => ({
|
|
|
600
597
|
[key]: false,
|
|
601
598
|
}), {});
|
|
602
599
|
|
|
600
|
+
const scssLogger = {
|
|
601
|
+
warn(message, options) {
|
|
602
|
+
// Mute "Mixed Declarations" warning
|
|
603
|
+
if (options.deprecation && message.includes('mixed-decls')) {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
// List all other warnings
|
|
607
|
+
console.warn(`▲ [WARNING]: ${message}`);
|
|
608
|
+
},
|
|
609
|
+
};
|
|
610
|
+
|
|
603
611
|
function getDeps(dir) {
|
|
604
612
|
const data = tComm.readFileSync(path__default["default"].resolve(dir, 'package.json'), true);
|
|
605
613
|
return Object.keys({
|
|
@@ -682,6 +690,18 @@ function recordLoaderLog(file, content) {
|
|
|
682
690
|
global[LOG_KEY][file].push(content);
|
|
683
691
|
}
|
|
684
692
|
|
|
693
|
+
function getWxmlAndWxssPostfix() {
|
|
694
|
+
const map = Object.keys(PLATFORM_MAP).reduce((acc, item) => {
|
|
695
|
+
acc[PLATFORM_MAP[item]] = item;
|
|
696
|
+
return acc;
|
|
697
|
+
}, {});
|
|
698
|
+
const key = map[process.env.UNI_PLATFORM || ''];
|
|
699
|
+
return [
|
|
700
|
+
HTML_MAP[key],
|
|
701
|
+
CSS_MAP[key],
|
|
702
|
+
];
|
|
703
|
+
}
|
|
704
|
+
|
|
685
705
|
function getProjectName() {
|
|
686
706
|
let result = '';
|
|
687
707
|
try {
|
|
@@ -811,10 +831,10 @@ exports.getStyleList = getStyleList;
|
|
|
811
831
|
exports.getSubProjectConfig = getSubProjectConfig;
|
|
812
832
|
exports.getSubProjectName = getSubProjectName;
|
|
813
833
|
exports.getSubProjectRoot = getSubProjectRoot;
|
|
814
|
-
exports.getUniCliCache = getUniCliCache;
|
|
815
834
|
exports.getUtsPlatform = getUtsPlatform;
|
|
816
835
|
exports.getVersionCode = getVersionCode;
|
|
817
836
|
exports.getWebInsertCode = getWebInsertCode;
|
|
837
|
+
exports.getWxmlAndWxssPostfix = getWxmlAndWxssPostfix;
|
|
818
838
|
exports.isApp = isApp;
|
|
819
839
|
exports.isAppAndroid = isAppAndroid;
|
|
820
840
|
exports.isAppIOS = isAppIOS;
|
|
@@ -838,6 +858,7 @@ exports.replaceDirective = replaceDirective;
|
|
|
838
858
|
exports.revertManifest = revertManifest;
|
|
839
859
|
exports.saveJsonToLog = saveJsonToLog;
|
|
840
860
|
exports.saveLoaderLog = saveLoaderLog;
|
|
861
|
+
exports.scssLogger = scssLogger;
|
|
841
862
|
exports.updateAssetSource = updateAssetSource;
|
|
842
863
|
exports.updateManifest = updateManifest;
|
|
843
864
|
exports.vLazyCore = vLazyCore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getWxmlAndWxssPostfix(): (".wxml" | ".qml" | ".axml" | ".jxml" | ".wxss" | ".qss" | ".acss" | ".jxss")[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plugin-light/shared",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"main": "./lib/index",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib/"
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
"url": "https://github.com/novlan1/plugin-light"
|
|
11
11
|
},
|
|
12
12
|
"author": "guowangyang",
|
|
13
|
-
"homepage": "https://novlan1.github.io/plugin-light
|
|
13
|
+
"homepage": "https://novlan1.github.io/plugin-light/",
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/novlan1/plugin-light/issues"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"t-comm": "^1.3.
|
|
18
|
+
"t-comm": "^1.3.139"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "rm -rf lib && rollup -c",
|