2025/2/8第一次更新

This commit is contained in:
爱吃咸鱼小猫咪
2025-02-08 18:50:38 +08:00
commit d7af560866
26519 changed files with 5046029 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
export declare function initDefine(stringifyBoolean?: boolean): {
'process.env.NODE_ENV': string;
'process.env.UNI_DEBUG': string | boolean;
'process.env.UNI_APP_ID': string;
'process.env.UNI_APP_NAME': string;
'process.env.UNI_APP_VERSION_NAME': string;
'process.env.UNI_APP_VERSION_CODE': string;
'process.env.UNI_PLATFORM': string;
'process.env.UNI_SUB_PLATFORM': string;
'process.env.UNI_MP_PLUGIN': string;
'process.env.UNI_SUBPACKAGE': string;
'process.env.UNI_COMPILER_VERSION': string;
'process.env.RUN_BY_HBUILDERX': string | boolean;
'process.env.UNI_AUTOMATOR_WS_ENDPOINT': string;
'process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC': string;
'process.env.UNI_CLOUD_PROVIDER': string;
'process.env.UNICLOUD_DEBUG': string;
'process.env.VUE_APP_PLATFORM': string;
'process.env.VUE_APP_DARK_MODE': string;
};
+52
View File
@@ -0,0 +1,52 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initDefine = void 0;
const env_1 = require("../hbx/env");
const json_1 = require("../json");
function initDefine(stringifyBoolean = false) {
const manifestJson = (0, json_1.parseManifestJsonOnce)(process.env.UNI_INPUT_DIR);
const platformManifestJson = (0, json_1.getPlatformManifestJsonOnce)();
const isRunByHBuilderX = (0, env_1.runByHBuilderX)();
const isDebug = !!manifestJson.debug;
process.env['UNI_APP_ID'] = manifestJson.appid;
return {
...initCustomDefine(),
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
'process.env.UNI_DEBUG': stringifyBoolean
? JSON.stringify(isDebug)
: isDebug,
'process.env.UNI_APP_ID': JSON.stringify(manifestJson.appid || ''),
'process.env.UNI_APP_NAME': JSON.stringify(manifestJson.name || ''),
'process.env.UNI_APP_VERSION_NAME': JSON.stringify(manifestJson.versionName || ''),
'process.env.UNI_APP_VERSION_CODE': JSON.stringify(manifestJson.versionCode || ''),
'process.env.UNI_PLATFORM': JSON.stringify(process.env.UNI_PLATFORM),
'process.env.UNI_SUB_PLATFORM': JSON.stringify(process.env.UNI_SUB_PLATFORM || ''),
'process.env.UNI_MP_PLUGIN': JSON.stringify(process.env.UNI_MP_PLUGIN || ''),
'process.env.UNI_SUBPACKAGE': JSON.stringify(process.env.UNI_SUBPACKAGE || ''),
'process.env.UNI_COMPILER_VERSION': JSON.stringify(process.env.UNI_COMPILER_VERSION || ''),
'process.env.RUN_BY_HBUILDERX': stringifyBoolean
? JSON.stringify(isRunByHBuilderX)
: isRunByHBuilderX,
'process.env.UNI_AUTOMATOR_WS_ENDPOINT': JSON.stringify(process.env.UNI_AUTOMATOR_WS_ENDPOINT || ''),
'process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC': JSON.stringify(process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC || ''),
'process.env.UNI_CLOUD_PROVIDER': JSON.stringify(process.env.UNI_CLOUD_PROVIDER || ''),
'process.env.UNICLOUD_DEBUG': JSON.stringify(process.env.UNICLOUD_DEBUG || ''),
// 兼容旧版本
'process.env.VUE_APP_PLATFORM': JSON.stringify(process.env.UNI_PLATFORM || ''),
'process.env.VUE_APP_DARK_MODE': JSON.stringify(platformManifestJson.darkmode || false),
};
}
exports.initDefine = initDefine;
function initCustomDefine() {
let define = {};
if (process.env.UNI_CUSTOM_DEFINE) {
try {
define = JSON.parse(process.env.UNI_CUSTOM_DEFINE);
}
catch (e) { }
}
return Object.keys(define).reduce((res, name) => {
res['process.env.' + name] = JSON.stringify(define[name]);
return res;
}, {});
}
+2
View File
@@ -0,0 +1,2 @@
export { initDefine } from './define';
export { initAppProvide, initH5Provide } from './provide';
+8
View File
@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initH5Provide = exports.initAppProvide = exports.initDefine = void 0;
var define_1 = require("./define");
Object.defineProperty(exports, "initDefine", { enumerable: true, get: function () { return define_1.initDefine; } });
var provide_1 = require("./provide");
Object.defineProperty(exports, "initAppProvide", { enumerable: true, get: function () { return provide_1.initAppProvide; } });
Object.defineProperty(exports, "initH5Provide", { enumerable: true, get: function () { return provide_1.initH5Provide; } });
+11
View File
@@ -0,0 +1,11 @@
export declare function initAppProvide(): {
__f__: string[];
crypto: string[];
'window.crypto': string[];
'global.crypto': string[];
'uni.getCurrentSubNVue': string[];
'uni.requireNativePlugin': string[];
};
export declare function initH5Provide(): {
__f__: string[];
};
+26
View File
@@ -0,0 +1,26 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.initH5Provide = exports.initAppProvide = void 0;
const path_1 = __importDefault(require("path"));
const libDir = path_1.default.resolve(__dirname, '../../lib');
function initAppProvide() {
const cryptoDefine = [path_1.default.join(libDir, 'crypto.js'), 'default'];
return {
__f__: ['@dcloudio/uni-app', 'formatAppLog'],
crypto: cryptoDefine,
'window.crypto': cryptoDefine,
'global.crypto': cryptoDefine,
'uni.getCurrentSubNVue': ['@dcloudio/uni-app', 'getCurrentSubNVue'],
'uni.requireNativePlugin': ['@dcloudio/uni-app', 'requireNativePlugin'],
};
}
exports.initAppProvide = initAppProvide;
function initH5Provide() {
return {
__f__: ['@dcloudio/uni-app', 'formatH5Log'],
};
}
exports.initH5Provide = initH5Provide;