chore(mp-harmony): 修正子包 HAR name 字段 + 纳入元数据到 git
背景:
mp-harmony 项目的 5 个 ascf shared HAR 子包 (components_diy / pages_goods /
pages_order / pages_promotion / pages_tool) 在 ascf_build 目录下, 关键
元数据 (oh-package.json5 / module.json5 / build-profile.json5 /
Index.ets / hvigorfile.ts / obfuscation-rules.txt) 之前被 .gitignore
整体忽略, 从未被 git 跟踪, 导致 "module.name 被清空" 等回归无法被
git diff / blame 追踪。
改动:
1. .gitignore 改造
- 不再整体 ignore ascf_build
- 精确 ignore 已知产物路径 (rawfile/**/*.pack.js / rawfile/**/*.html
/ rawfile/**/*.json / build/ / oh_modules/ / .preview/ / .cxx/
/ .test/ / node_modules/)
- ! 取反保留 HAR 必需文件 (placeholder/index.*, rawfile/index.js,
base/element/*.json)
- 补充 entry / hvigor / 鸿蒙签名材料 / IDE 临时文件 ignore 规则
2. 首次将 5 个 HAR 包的元数据纳入 git (40 个文件)
3. 新增 scripts/fix-subpackage-module-names.js: 任何入口 require
vue.config.js 时自动修复 oh-package.json5.name + module.json5.module.name
双重覆盖, 防止 DevEco ohpm 报 "00604007 Field IS Empty Error" 或
hvigor 报 "Schema validate failed"
4. vue.config.js 顶层 IIFE 触发修复 (任何 require 立即生效, 不依赖
webpack 钩子)
5. entry/scripts/check-har-deps.js 扩展: 校验 ascf_build 子包
module.json5.module.name 字段 (兜底校验)
6. entry/har-deps-required.json5 扩展: 新增 subpackageModuleJson5
路径映射 + ohModulesRoots 校验资源齐备性
7. entry/README-HAR-DEPS.md 更新: 故障速查表新增 module.name 相关
报错条目
预期效果:
- HBuilderX 触发 vue-cli-service build → vue.config.js 自动修复子包
name → DevEco ohpm install / hvigor schema 校验通过
- check-har-deps.js 兜底, 任何回归立即被检测并报错
- 团队成员 git pull 后能立即看到 ascf_build 元数据, 可用 git diff
跟踪 module.name 等关键字段变更
This commit is contained in:
70
.gitignore
vendored
70
.gitignore
vendored
@@ -7,9 +7,73 @@
|
||||
.codebuddy
|
||||
.vscode
|
||||
.trae
|
||||
# 本地调试配置 (含 uniacid / 域名, 每人不同, 不应入仓)
|
||||
# 注意: 如果 .local.config.js 已经被之前的 commit 入仓,
|
||||
# 需要手动 `git rm --cached .local.config.js` 并用 filter-branch
|
||||
# 清理历史 (仅限团队协商后操作)
|
||||
.local.config.js
|
||||
|
||||
# 鸿蒙元服务构建产物
|
||||
# 鸿蒙元服务构建产物 (被 .gitignore 的只是产物, HAR 元数据需要 git 管理)
|
||||
# 重要: ascf_build 根目录的元数据 (oh-package.json5 / Index.ets / build-profile.json5 / ...)
|
||||
# 必须被 git 管理, 否则无法追踪 "module.name 被清空" 等回归。
|
||||
# 这些元数据通过下方的 ! 取反规则显式纳入 git。
|
||||
stub-app-projects/mp-harmony/ascf/ascf_src
|
||||
stub-app-projects/mp-harmony/ascf/ascf_build
|
||||
stub-app-projects/mp-harmony/entry/src/main/resources/rawfile
|
||||
stub-app-projects/mp-harmony/**/node_modules
|
||||
|
||||
# ascf_build/<pkg>/ 是 HAR 包定义 (有源文件 + uniapp 编译产物)
|
||||
# 策略: 不整体 ignore, 只精确 ignore 已知的产物路径
|
||||
# - rawfile/<root>/diy-*.pack.js / *.html: uniapp 编译产物, vue.config.js 拷过来
|
||||
# - rawfile/index.js: 也是产物 (HAR 入口脚本, 每次构建覆盖)
|
||||
# - build/: hvigor 中间产物
|
||||
# - oh_modules/: ohpm 同步产物
|
||||
# - .preview/, .cxx/, .test/: 预览 / native 中间产物
|
||||
|
||||
# 关键产物 (每次构建覆盖, 不应入仓)
|
||||
stub-app-projects/mp-harmony/ascf/ascf_build/**/rawfile/**/*.pack.js
|
||||
stub-app-projects/mp-harmony/ascf/ascf_build/**/rawfile/**/*.html
|
||||
stub-app-projects/mp-harmony/ascf/ascf_build/**/rawfile/**/*.json
|
||||
stub-app-projects/mp-harmony/ascf/ascf_build/**/build
|
||||
stub-app-projects/mp-harmony/ascf/ascf_build/**/oh_modules
|
||||
stub-app-projects/mp-harmony/ascf/ascf_build/**/.preview
|
||||
stub-app-projects/mp-harmony/ascf/ascf_build/**/.cxx
|
||||
stub-app-projects/mp-harmony/ascf/ascf_build/**/.test
|
||||
stub-app-projects/mp-harmony/ascf/ascf_build/**/node_modules
|
||||
|
||||
# 但 placeholder/ 下的 index.pack.js / index.html 是 HAR 必需, 保留
|
||||
!stub-app-projects/mp-harmony/ascf/ascf_build/**/rawfile/**/placeholder/index.pack.js
|
||||
!stub-app-projects/mp-harmony/ascf/ascf_build/**/rawfile/**/placeholder/index.html
|
||||
!stub-app-projects/mp-harmony/ascf/ascf_build/**/rawfile/**/placeholder/index.json
|
||||
|
||||
# 但根 rawfile/ 下的 index.js 是 HAR 入口, 保留
|
||||
!stub-app-projects/mp-harmony/ascf/ascf_build/**/rawfile/index.js
|
||||
|
||||
# base/element/string.json 是 HAR i18n, 保留
|
||||
!stub-app-projects/mp-harmony/ascf/ascf_build/**/rawfile/**/base/element/*.json
|
||||
# 但 rawfile/ 是 ignore **/*.json 的子目录, 上面那条也针对 rawfile/base/element 取消 ignore
|
||||
# base/ 在 rawfile/ 之外, 单独处理
|
||||
!stub-app-projects/mp-harmony/ascf/ascf_build/**/base/element/*.json
|
||||
|
||||
# entry 下的产物
|
||||
stub-app-projects/mp-harmony/entry/build
|
||||
stub-app-projects/mp-harmony/entry/oh_modules
|
||||
stub-app-projects/mp-harmony/entry/.preview
|
||||
stub-app-projects/mp-harmony/entry/.cxx
|
||||
stub-app-projects/mp-harmony/entry/.test
|
||||
stub-app-projects/mp-harmony/entry/node_modules
|
||||
# 鸿蒙工程顶层产物 (.hvigor / hvigor / .idea 已在根 .gitignore 范围或更精准的鸿蒙子 .gitignore)
|
||||
stub-app-projects/mp-harmony/oh_modules
|
||||
stub-app-projects/mp-harmony/.hvigor
|
||||
stub-app-projects/mp-harmony/.idea
|
||||
# 鸿蒙 hvigor 自身依赖
|
||||
stub-app-projects/mp-harmony/hvigor
|
||||
# Trae/IDE 临时文件
|
||||
.hvigor/outputs
|
||||
.trae_permission_check_*
|
||||
# 鸿蒙签名材料 (敏感, 绝不能提交到公共 git)
|
||||
# 仓库有 origin (github.com/Zajd/jsysq-uniapp) 是公开仓库, 签名材料必须 gitignore
|
||||
stub-app-projects/mp-harmony/**/cert-profile
|
||||
stub-app-projects/mp-harmony/**/.p12
|
||||
stub-app-projects/mp-harmony/**/.p7b
|
||||
stub-app-projects/mp-harmony/**/.cer
|
||||
stub-app-projects/mp-harmony/**/.csr
|
||||
stub-app-projects/mp-harmony/**/material
|
||||
272
scripts/fix-subpackage-module-names.js
Normal file
272
scripts/fix-subpackage-module-names.js
Normal file
@@ -0,0 +1,272 @@
|
||||
#!/usr/bin/env node
|
||||
/* eslint-disable no-console */
|
||||
/**
|
||||
* scripts/fix-subpackage-module-names.js
|
||||
*
|
||||
* 修正 ascf_build/<pkg>/ 子包 HAR 元数据中的 name 字段,确保鸿蒙工具链
|
||||
* (ohpm install / hvigor schema / 运行时依赖解析) 一致通过。
|
||||
*
|
||||
* 涉及两个文件:
|
||||
* 1. ascf_build/<pkg>/oh-package.json5 — top-level `name`
|
||||
* ohpm install 会读取这个字段,空字符串会报:
|
||||
* "00604007 Field IS Empty Error: The name of package .../pages_tool cannot be empty"
|
||||
*
|
||||
* 2. ascf_build/<pkg>/src/main/module.json5 — `module.name`
|
||||
* hvigor build 时 schema 校验要求匹配 ^[a-zA-Z][0-9a-zA-Z_.]*$,
|
||||
* 空字符串会报:
|
||||
* "Schema validate failed: must match pattern ^[a-zA-Z][0-9a-zA-Z_.]*$"
|
||||
*
|
||||
* 修复策略:
|
||||
* 遍历 SUBPACKAGE_NAMES 数组里的包, 用包目录名覆盖两处的 name,
|
||||
* 保留其他字段 (version / description / dependencies / deviceTypes 等)。
|
||||
* 如果文件不存在, 按合理默认值新建一份。
|
||||
*
|
||||
* 使用方式:
|
||||
* # 命令 1: 直接跑这个脚本
|
||||
* node scripts/fix-subpackage-module-names.js
|
||||
*
|
||||
* # 命令 2: 作为模块 require
|
||||
* node -e "require('./scripts/fix-subpackage-module-names').fixSubpackageModuleNames()"
|
||||
*
|
||||
* # 命令 3: 由 vue.config.js 顶层 IIFE 自动调用
|
||||
* # (HBuilderX / vue-cli-service / node -e 触发时, 自动执行)
|
||||
*
|
||||
* # CI 兜底校验:
|
||||
* node stub-app-projects/mp-harmony/entry/scripts/check-har-deps.js --strict
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const SUBPACKAGE_NAMES = [
|
||||
'components_diy',
|
||||
'pages_goods',
|
||||
'pages_order',
|
||||
'pages_promotion',
|
||||
'pages_tool',
|
||||
];
|
||||
|
||||
/**
|
||||
* 修正 ascf_build/<pkg>/ 子包的 name 字段 (oh-package.json5 + module.json5)
|
||||
*
|
||||
* @param {object} [opts]
|
||||
* @param {string} [opts.ascfBuildRoot] - ascf_build 根目录, 默认基于本脚本位置推算
|
||||
* @param {boolean} [opts.silent=false] - true 时不打日志
|
||||
* @returns {{fixedCount: number, results: Array<{pkg: string, file: string, status: 'created'|'fixed'|'unchanged'|'error', message?: string}>}}
|
||||
*/
|
||||
function fixSubpackageModuleNames({ ascfBuildRoot, silent = false } = {}) {
|
||||
const root = ascfBuildRoot
|
||||
|| path.resolve(__dirname, '..', 'stub-app-projects', 'mp-harmony', 'ascf', 'ascf_build');
|
||||
const log = silent ? () => {} : console.log;
|
||||
log(`\n🔧 [fix-subpackage-module-names] 修正 ascf_build 子包 name (oh-package.json5 + module.json5)...`);
|
||||
|
||||
const results = [];
|
||||
|
||||
for (const pkg of SUBPACKAGE_NAMES) {
|
||||
results.push(...fixOhPackageJson5({ pkg, root, silent: true, log }));
|
||||
results.push(...fixModuleJson5({ pkg, root, silent: true, log }));
|
||||
}
|
||||
|
||||
const fixedCount = results.filter(r => r.status === 'fixed' || r.status === 'created').length;
|
||||
log(` 📊 修正完成: ${fixedCount} 个文件被更新\n`);
|
||||
return { fixedCount, results };
|
||||
}
|
||||
|
||||
/**
|
||||
* 修正 ascf_build/<pkg>/oh-package.json5 的 top-level `name` 字段
|
||||
*
|
||||
* 默认内容参考项目内已有 HAR (components_diy / pages_goods 等):
|
||||
* {
|
||||
* "name": "<pkg>",
|
||||
* "version": "1.0.0",
|
||||
* "description": "Please describe the basic information.",
|
||||
* "main": "Index.ets",
|
||||
* "author": "",
|
||||
* "license": "Apache-2.0",
|
||||
* "packageType": "InterfaceHar",
|
||||
* "dependencies": {}
|
||||
* }
|
||||
*/
|
||||
function fixOhPackageJson5({ pkg, root, silent, log }) {
|
||||
const ohPkgJson5Path = path.join(root, pkg, 'oh-package.json5');
|
||||
const defaultDoc = {
|
||||
name: pkg,
|
||||
version: '1.0.0',
|
||||
description: 'Please describe the basic information.',
|
||||
main: 'Index.ets',
|
||||
author: '',
|
||||
license: 'Apache-2.0',
|
||||
packageType: 'InterfaceHar',
|
||||
dependencies: {},
|
||||
};
|
||||
|
||||
let current = null;
|
||||
if (fs.existsSync(ohPkgJson5Path)) {
|
||||
try {
|
||||
// oh-package.json5 是 JSON5, 可能含 // 注释。Node 内置 JSON.parse 不能处理,
|
||||
// 用 stripJson5Comments + JSON.parse 处理最常见情况。
|
||||
const raw = fs.readFileSync(ohPkgJson5Path, 'utf8');
|
||||
const cleaned = stripJson5Comments(raw);
|
||||
current = JSON.parse(cleaned);
|
||||
} catch (e) {
|
||||
if (!silent) log(` ⚠️ ${pkg}/oh-package.json5 解析失败, 使用默认: ${e.message}`);
|
||||
current = null;
|
||||
}
|
||||
}
|
||||
|
||||
const relPath = `${pkg}/oh-package.json5`;
|
||||
if (!current || typeof current !== 'object') {
|
||||
try {
|
||||
fs.mkdirSync(path.dirname(ohPkgJson5Path), { recursive: true });
|
||||
fs.writeFileSync(ohPkgJson5Path, JSON.stringify(defaultDoc, null, 2) + '\n', 'utf8');
|
||||
if (!silent) log(` 🆕 ${relPath}: 已创建 (name="${pkg}")`);
|
||||
return [{ pkg, file: 'oh-package.json5', status: 'created' }];
|
||||
} catch (e) {
|
||||
if (!silent) log(` ❌ ${relPath}: 创建失败: ${e.message}`);
|
||||
return [{ pkg, file: 'oh-package.json5', status: 'error', message: e.message }];
|
||||
}
|
||||
}
|
||||
|
||||
const oldName = current.name;
|
||||
if (oldName !== pkg) {
|
||||
current.name = pkg;
|
||||
try {
|
||||
fs.writeFileSync(ohPkgJson5Path, JSON.stringify(current, null, 2) + '\n', 'utf8');
|
||||
if (!silent) log(` ✅ ${relPath}: name "${oldName || '(空)'}" → "${pkg}"`);
|
||||
return [{ pkg, file: 'oh-package.json5', status: 'fixed', oldName }];
|
||||
} catch (e) {
|
||||
if (!silent) log(` ❌ ${relPath}: 写入失败: ${e.message}`);
|
||||
return [{ pkg, file: 'oh-package.json5', status: 'error', message: e.message }];
|
||||
}
|
||||
}
|
||||
|
||||
if (!silent) log(` ✔️ ${relPath}: name = "${pkg}" (无须修正)`);
|
||||
return [{ pkg, file: 'oh-package.json5', status: 'unchanged' }];
|
||||
}
|
||||
|
||||
/**
|
||||
* 修正 ascf_build/<pkg>/src/main/module.json5 的 `module.name` 字段
|
||||
*/
|
||||
function fixModuleJson5({ pkg, root, silent, log }) {
|
||||
const moduleJson5Path = path.join(root, pkg, 'src', 'main', 'module.json5');
|
||||
const defaultDoc = {
|
||||
module: {
|
||||
name: pkg,
|
||||
type: 'shared',
|
||||
description: 'subpackage',
|
||||
deviceTypes: ['phone', 'tablet'],
|
||||
deliveryWithInstall: true,
|
||||
installationFree: true,
|
||||
},
|
||||
};
|
||||
|
||||
let current = null;
|
||||
if (fs.existsSync(moduleJson5Path)) {
|
||||
try {
|
||||
const raw = fs.readFileSync(moduleJson5Path, 'utf8');
|
||||
const cleaned = stripJson5Comments(raw);
|
||||
current = JSON.parse(cleaned);
|
||||
} catch (e) {
|
||||
if (!silent) log(` ⚠️ ${pkg}/src/main/module.json5 解析失败, 使用默认: ${e.message}`);
|
||||
current = null;
|
||||
}
|
||||
}
|
||||
|
||||
const relPath = `${pkg}/src/main/module.json5`;
|
||||
if (!current || !current.module || typeof current.module !== 'object') {
|
||||
try {
|
||||
fs.mkdirSync(path.dirname(moduleJson5Path), { recursive: true });
|
||||
fs.writeFileSync(moduleJson5Path, JSON.stringify(defaultDoc, null, 2) + '\n', 'utf8');
|
||||
if (!silent) log(` 🆕 ${relPath}: 已创建 (name="${pkg}")`);
|
||||
return [{ pkg, file: 'module.json5', status: 'created' }];
|
||||
} catch (e) {
|
||||
if (!silent) log(` ❌ ${relPath}: 创建失败: ${e.message}`);
|
||||
return [{ pkg, file: 'module.json5', status: 'error', message: e.message }];
|
||||
}
|
||||
}
|
||||
|
||||
const oldName = current.module.name;
|
||||
if (oldName !== pkg) {
|
||||
current.module.name = pkg;
|
||||
try {
|
||||
fs.writeFileSync(moduleJson5Path, JSON.stringify(current, null, 2) + '\n', 'utf8');
|
||||
if (!silent) log(` ✅ ${relPath}: module.name "${oldName || '(空)'}" → "${pkg}"`);
|
||||
return [{ pkg, file: 'module.json5', status: 'fixed', oldName }];
|
||||
} catch (e) {
|
||||
if (!silent) log(` ❌ ${relPath}: 写入失败: ${e.message}`);
|
||||
return [{ pkg, file: 'module.json5', status: 'error', message: e.message }];
|
||||
}
|
||||
}
|
||||
|
||||
if (!silent) log(` ✔️ ${relPath}: module.name = "${pkg}" (无须修正)`);
|
||||
return [{ pkg, file: 'module.json5', status: 'unchanged' }];
|
||||
}
|
||||
|
||||
/**
|
||||
* 简单 JSON5 注释剥离
|
||||
* 处理 // 单行注释 和 /* 块注释 *\/, 跳过字符串字面量内的 //
|
||||
* 注意: 不处理裸 key、单引号字符串、Unicode 转义等 JSON5 扩展
|
||||
* (本项目实际遇到的文件都是标准 JSON + 注释, 足够覆盖)
|
||||
*/
|
||||
function stripJson5Comments(input) {
|
||||
let out = '';
|
||||
let i = 0;
|
||||
const n = input.length;
|
||||
while (i < n) {
|
||||
const c = input[i];
|
||||
const next = i + 1 < n ? input[i + 1] : '';
|
||||
if (c === '/' && next === '*') {
|
||||
i += 2;
|
||||
while (i < n && !(input[i] === '*' && input[i + 1] === '/')) i++;
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
if (c === '/' && next === '/') {
|
||||
i += 2;
|
||||
while (i < n && input[i] !== '\n') i++;
|
||||
continue;
|
||||
}
|
||||
if (c === '"' || c === "'") {
|
||||
const quote = c;
|
||||
out += c;
|
||||
i++;
|
||||
while (i < n) {
|
||||
const sc = input[i];
|
||||
if (sc === '\\') {
|
||||
out += sc + (input[i + 1] || '');
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
out += sc;
|
||||
i++;
|
||||
if (sc === quote) break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
out += c;
|
||||
i++;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// 顶层 IIFE: 直接执行脚本时自动跑 (CLI 行为)
|
||||
function main() {
|
||||
try {
|
||||
fixSubpackageModuleNames();
|
||||
} catch (e) {
|
||||
console.error('[fix-subpackage-module-names] 执行失败:', e.message);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 判断是否作为 CLI 直接执行 (vs 作为模块被 require)
|
||||
if (require.main === module) {
|
||||
main();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
fixSubpackageModuleNames,
|
||||
SUBPACKAGE_NAMES,
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"apiType": "stageMode",
|
||||
"buildOption": {
|
||||
},
|
||||
"buildOptionSet": [
|
||||
{
|
||||
"name": "release",
|
||||
"arkOptions": {
|
||||
"obfuscation": {
|
||||
"ruleOptions": {
|
||||
"enable": true,
|
||||
"files": [
|
||||
"./obfuscation-rules.txt"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
"targets": [
|
||||
{
|
||||
"name": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { hspTasks } from '@ohos/hvigor-ohos-plugin';
|
||||
|
||||
export default {
|
||||
system: hspTasks,
|
||||
plugins: []
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
# Define project specific obfuscation rules here.
|
||||
# You can include the obfuscation configuration files in the current module's build-profile.json5.
|
||||
#
|
||||
# For more details, see
|
||||
# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
|
||||
|
||||
# Obfuscation options:
|
||||
# -disable-obfuscation: disable all obfuscations
|
||||
# -enable-property-obfuscation: obfuscate the property names
|
||||
# -enable-toplevel-obfuscation: obfuscate the names in the global scope
|
||||
# -compact: remove unnecessary blank spaces and all line feeds
|
||||
# -remove-log: remove all console.* statements
|
||||
# -print-namecache: print the name cache that contains the mapping from the old names to new names
|
||||
# -apply-namecache: reuse the given cache file
|
||||
|
||||
# Keep options:
|
||||
# -keep-property-name: specifies property names that you want to keep
|
||||
# -keep-global-name: specifies names that you want to keep in the global scope
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "components_diy",
|
||||
"version": "1.0.0",
|
||||
"description": "Please describe the basic information.",
|
||||
"main": "Index.ets",
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"packageType": "InterfaceHar",
|
||||
"dependencies": {}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"module": {
|
||||
"name": "components_diy",
|
||||
"type": "shared",
|
||||
"description": "subpackage",
|
||||
"deviceTypes": [
|
||||
"phone"
|
||||
],
|
||||
"deliveryWithInstall": true,
|
||||
"installationFree": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"string": [
|
||||
{
|
||||
"name": "shared_desc",
|
||||
"value": "description"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0, viewport-fit=cover" />
|
||||
<link rel="stylesheet" href="assets://base.css" type="text/css" media="screen" charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="holder"></div>
|
||||
<script src='assets://renderer.js'></script>
|
||||
<script type="text/javascript" src='/app.css.js'></script>
|
||||
<script type="text/javascript" src="/components-diy/placeholder/index.pack.js" ></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* ATTENTION: An "eval-source-map" devtool has been used.
|
||||
* This devtool is neither made for production nor for readable output files.
|
||||
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
|
||||
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
||||
* or disable the default devtool with "devtool: false".
|
||||
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
||||
*/
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ "./components-diy/placeholder/index.css?type=page"
|
||||
/*!********************************************************!*\
|
||||
!*** ./components-diy/placeholder/index.css?type=page ***!
|
||||
\********************************************************/
|
||||
(module) {
|
||||
|
||||
eval("{module.exports = {\n segs:[\".placeholder.data-v-ddfc9ac4{padding:\",[2,40],\";color:#999;text-align:center;font-size:\",[2,24],\"}\"],\n info:{path:\"components-diy/placeholder/index\", type:\"page\"}\n }//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9jb21wb25lbnRzLWRpeS9wbGFjZWhvbGRlci9pbmRleC5jc3M/dHlwZT1wYWdlIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vY29tcG9uZW50cy1kaXkvcGxhY2Vob2xkZXIvaW5kZXguY3NzPzE5OTkiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7XG4gICAgICAgICAgICBzZWdzOltcIi5wbGFjZWhvbGRlci5kYXRhLXYtZGRmYzlhYzR7cGFkZGluZzpcIixbMiw0MF0sXCI7Y29sb3I6Izk5OTt0ZXh0LWFsaWduOmNlbnRlcjtmb250LXNpemU6XCIsWzIsMjRdLFwifVwiXSxcbiAgICAgICAgICAgIGluZm86e3BhdGg6XCJjb21wb25lbnRzLWRpeS9wbGFjZWhvbGRlci9pbmRleFwiLCB0eXBlOlwicGFnZVwifVxuICAgICAgICB9Il0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./components-diy/placeholder/index.css?type=page\n\n}");
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ "./components-diy/placeholder/index.hxml"
|
||||
/*!***********************************************!*\
|
||||
!*** ./components-diy/placeholder/index.hxml ***!
|
||||
\***********************************************/
|
||||
(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
||||
|
||||
eval("{var render = function () {\n var _vm = this,\n _o = _vm._o,\n _n = _vm._n,\n _s = _vm._s,\n _l = _vm._l,\n _t = _vm._t,\n _q = _vm._q,\n _i = _vm._i,\n _m = _vm._m,\n _f = _vm._f,\n _k = _vm._k,\n _b = _vm._b,\n _v = _vm._v,\n _e = _vm._e,\n _u = _vm._u,\n _g = _vm._g,\n _d = _vm._d,\n _p = _vm._p,\n _c = _vm._c,\n $style = _vm.$style,\n $class = _vm.$class,\n $slots = _vm.$slots,\n eventHappen = _vm.eventHappen;\n return _c('q-page', {\n attrs: {\n \"data-internal-update-trigger\": _vm.$dataprops.internal__updateTrigger\n }\n }, [_c('q-view', {\n staticClass: \"placeholder data-v-ddfc9ac4\"\n })], 1);\n};\nvar staticRenderFns = [];\nrender._withStripped = true;\nconst pageConfig = {\n path: \"components-diy/placeholder/index\",\n globalComponents: {},\n jsonData: {},\n components: {},\n render: render,\n type: \"page\",\n staticRenderFns: staticRenderFns,\n _scopeId: \"data-q-afee7ca0\",\n asyncComponents: {},\n placeholderComponents: {}\n};\nglobal.pageLoaded(pageConfig);\nconst cssData = __webpack_require__(/*! ./components-diy/placeholder/index.css?type=page */ \"./components-diy/placeholder/index.css?type=page\");\ninjectStyle(cssData.segs, cssData.sourcemap, cssData.info);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9jb21wb25lbnRzLWRpeS9wbGFjZWhvbGRlci9pbmRleC5oeG1sIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vY29tcG9uZW50cy1kaXkvcGxhY2Vob2xkZXIvaW5kZXguaHhtbD9mYTdlIl0sInNvdXJjZXNDb250ZW50IjpbInZhciByZW5kZXIgPSBmdW5jdGlvbiAoKSB7XG4gIHZhciBfdm0gPSB0aGlzLFxuICAgIF9vID0gX3ZtLl9vLFxuICAgIF9uID0gX3ZtLl9uLFxuICAgIF9zID0gX3ZtLl9zLFxuICAgIF9sID0gX3ZtLl9sLFxuICAgIF90ID0gX3ZtLl90LFxuICAgIF9xID0gX3ZtLl9xLFxuICAgIF9pID0gX3ZtLl9pLFxuICAgIF9tID0gX3ZtLl9tLFxuICAgIF9mID0gX3ZtLl9mLFxuICAgIF9rID0gX3ZtLl9rLFxuICAgIF9iID0gX3ZtLl9iLFxuICAgIF92ID0gX3ZtLl92LFxuICAgIF9lID0gX3ZtLl9lLFxuICAgIF91ID0gX3ZtLl91LFxuICAgIF9nID0gX3ZtLl9nLFxuICAgIF9kID0gX3ZtLl9kLFxuICAgIF9wID0gX3ZtLl9wLFxuICAgIF9jID0gX3ZtLl9jLFxuICAgICRzdHlsZSA9IF92bS4kc3R5bGUsXG4gICAgJGNsYXNzID0gX3ZtLiRjbGFzcyxcbiAgICAkc2xvdHMgPSBfdm0uJHNsb3RzLFxuICAgIGV2ZW50SGFwcGVuID0gX3ZtLmV2ZW50SGFwcGVuO1xuICByZXR1cm4gX2MoJ3EtcGFnZScsIHtcbiAgICBhdHRyczoge1xuICAgICAgXCJkYXRhLWludGVybmFsLXVwZGF0ZS10cmlnZ2VyXCI6IF92bS4kZGF0YXByb3BzLmludGVybmFsX191cGRhdGVUcmlnZ2VyXG4gICAgfVxuICB9LCBbX2MoJ3EtdmlldycsIHtcbiAgICBzdGF0aWNDbGFzczogXCJwbGFjZWhvbGRlciBkYXRhLXYtZGRmYzlhYzRcIlxuICB9KV0sIDEpO1xufTtcbnZhciBzdGF0aWNSZW5kZXJGbnMgPSBbXTtcbnJlbmRlci5fd2l0aFN0cmlwcGVkID0gdHJ1ZTtcbmNvbnN0IHBhZ2VDb25maWcgPSB7XG4gIHBhdGg6IFwiY29tcG9uZW50cy1kaXkvcGxhY2Vob2xkZXIvaW5kZXhcIixcbiAgZ2xvYmFsQ29tcG9uZW50czoge30sXG4gIGpzb25EYXRhOiB7fSxcbiAgY29tcG9uZW50czoge30sXG4gIHJlbmRlcjogcmVuZGVyLFxuICB0eXBlOiBcInBhZ2VcIixcbiAgc3RhdGljUmVuZGVyRm5zOiBzdGF0aWNSZW5kZXJGbnMsXG4gIF9zY29wZUlkOiBcImRhdGEtcS1hZmVlN2NhMFwiLFxuICBhc3luY0NvbXBvbmVudHM6IHt9LFxuICBwbGFjZWhvbGRlckNvbXBvbmVudHM6IHt9XG59O1xuZ2xvYmFsLnBhZ2VMb2FkZWQocGFnZUNvbmZpZyk7XG5jb25zdCBjc3NEYXRhID0gcmVxdWlyZShcIkQ6L3Byb2plY3RzL3Nob3AtcHJvamVjdHMvZnJvbnRlbmQvc3R1Yi1hcHAtcHJvamVjdHMvbXAtaGFybW9ueS9hc2NmL2FzY2Zfc3JjL2NvbXBvbmVudHMtZGl5L3BsYWNlaG9sZGVyL2luZGV4LmNzcz90eXBlPXBhZ2VcIik7XG5pbmplY3RTdHlsZShjc3NEYXRhLnNlZ3MsIGNzc0RhdGEuc291cmNlbWFwLCBjc3NEYXRhLmluZm8pOyJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./components-diy/placeholder/index.hxml\n\n}");
|
||||
|
||||
/***/ }
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Check if module exists (development only)
|
||||
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
||||
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
||||
/******/ e.code = 'MODULE_NOT_FOUND';
|
||||
/******/ throw e;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/
|
||||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module can't be inlined because the eval-source-map devtool is used.
|
||||
/******/ var __webpack_exports__ = __webpack_require__("./components-diy/placeholder/index.hxml");
|
||||
/******/
|
||||
/******/ })()
|
||||
;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"apiType": "stageMode",
|
||||
"buildOption": {
|
||||
},
|
||||
"buildOptionSet": [
|
||||
{
|
||||
"name": "release",
|
||||
"arkOptions": {
|
||||
"obfuscation": {
|
||||
"ruleOptions": {
|
||||
"enable": true,
|
||||
"files": [
|
||||
"./obfuscation-rules.txt"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
"targets": [
|
||||
{
|
||||
"name": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { hspTasks } from '@ohos/hvigor-ohos-plugin';
|
||||
|
||||
export default {
|
||||
system: hspTasks,
|
||||
plugins: []
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
# Define project specific obfuscation rules here.
|
||||
# You can include the obfuscation configuration files in the current module's build-profile.json5.
|
||||
#
|
||||
# For more details, see
|
||||
# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
|
||||
|
||||
# Obfuscation options:
|
||||
# -disable-obfuscation: disable all obfuscations
|
||||
# -enable-property-obfuscation: obfuscate the property names
|
||||
# -enable-toplevel-obfuscation: obfuscate the names in the global scope
|
||||
# -compact: remove unnecessary blank spaces and all line feeds
|
||||
# -remove-log: remove all console.* statements
|
||||
# -print-namecache: print the name cache that contains the mapping from the old names to new names
|
||||
# -apply-namecache: reuse the given cache file
|
||||
|
||||
# Keep options:
|
||||
# -keep-property-name: specifies property names that you want to keep
|
||||
# -keep-global-name: specifies names that you want to keep in the global scope
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "pages_goods",
|
||||
"version": "1.0.0",
|
||||
"description": "Please describe the basic information.",
|
||||
"main": "Index.ets",
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"packageType": "InterfaceHar",
|
||||
"dependencies": {}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"module": {
|
||||
"name": "pages_goods",
|
||||
"type": "shared",
|
||||
"description": "subpackage",
|
||||
"deviceTypes": [
|
||||
"phone"
|
||||
],
|
||||
"deliveryWithInstall": true,
|
||||
"installationFree": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"string": [
|
||||
{
|
||||
"name": "shared_desc",
|
||||
"value": "description"
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"apiType": "stageMode",
|
||||
"buildOption": {
|
||||
},
|
||||
"buildOptionSet": [
|
||||
{
|
||||
"name": "release",
|
||||
"arkOptions": {
|
||||
"obfuscation": {
|
||||
"ruleOptions": {
|
||||
"enable": true,
|
||||
"files": [
|
||||
"./obfuscation-rules.txt"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
"targets": [
|
||||
{
|
||||
"name": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { hspTasks } from '@ohos/hvigor-ohos-plugin';
|
||||
|
||||
export default {
|
||||
system: hspTasks,
|
||||
plugins: []
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
# Define project specific obfuscation rules here.
|
||||
# You can include the obfuscation configuration files in the current module's build-profile.json5.
|
||||
#
|
||||
# For more details, see
|
||||
# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
|
||||
|
||||
# Obfuscation options:
|
||||
# -disable-obfuscation: disable all obfuscations
|
||||
# -enable-property-obfuscation: obfuscate the property names
|
||||
# -enable-toplevel-obfuscation: obfuscate the names in the global scope
|
||||
# -compact: remove unnecessary blank spaces and all line feeds
|
||||
# -remove-log: remove all console.* statements
|
||||
# -print-namecache: print the name cache that contains the mapping from the old names to new names
|
||||
# -apply-namecache: reuse the given cache file
|
||||
|
||||
# Keep options:
|
||||
# -keep-property-name: specifies property names that you want to keep
|
||||
# -keep-global-name: specifies names that you want to keep in the global scope
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "pages_order",
|
||||
"version": "1.0.0",
|
||||
"description": "Please describe the basic information.",
|
||||
"main": "Index.ets",
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"packageType": "InterfaceHar",
|
||||
"dependencies": {}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"module": {
|
||||
"name": "pages_order",
|
||||
"type": "shared",
|
||||
"description": "subpackage",
|
||||
"deviceTypes": [
|
||||
"phone"
|
||||
],
|
||||
"deliveryWithInstall": true,
|
||||
"installationFree": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"string": [
|
||||
{
|
||||
"name": "shared_desc",
|
||||
"value": "description"
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"apiType": "stageMode",
|
||||
"buildOption": {
|
||||
},
|
||||
"buildOptionSet": [
|
||||
{
|
||||
"name": "release",
|
||||
"arkOptions": {
|
||||
"obfuscation": {
|
||||
"ruleOptions": {
|
||||
"enable": true,
|
||||
"files": [
|
||||
"./obfuscation-rules.txt"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
"targets": [
|
||||
{
|
||||
"name": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { hspTasks } from '@ohos/hvigor-ohos-plugin';
|
||||
|
||||
export default {
|
||||
system: hspTasks,
|
||||
plugins: []
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
# Define project specific obfuscation rules here.
|
||||
# You can include the obfuscation configuration files in the current module's build-profile.json5.
|
||||
#
|
||||
# For more details, see
|
||||
# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
|
||||
|
||||
# Obfuscation options:
|
||||
# -disable-obfuscation: disable all obfuscations
|
||||
# -enable-property-obfuscation: obfuscate the property names
|
||||
# -enable-toplevel-obfuscation: obfuscate the names in the global scope
|
||||
# -compact: remove unnecessary blank spaces and all line feeds
|
||||
# -remove-log: remove all console.* statements
|
||||
# -print-namecache: print the name cache that contains the mapping from the old names to new names
|
||||
# -apply-namecache: reuse the given cache file
|
||||
|
||||
# Keep options:
|
||||
# -keep-property-name: specifies property names that you want to keep
|
||||
# -keep-global-name: specifies names that you want to keep in the global scope
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "pages_promotion",
|
||||
"version": "1.0.0",
|
||||
"description": "Please describe the basic information.",
|
||||
"main": "Index.ets",
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"packageType": "InterfaceHar",
|
||||
"dependencies": {}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"module": {
|
||||
"name": "pages_promotion",
|
||||
"type": "shared",
|
||||
"description": "subpackage",
|
||||
"deviceTypes": [
|
||||
"phone"
|
||||
],
|
||||
"deliveryWithInstall": true,
|
||||
"installationFree": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"string": [
|
||||
{
|
||||
"name": "shared_desc",
|
||||
"value": "description"
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"apiType": "stageMode",
|
||||
"buildOption": {
|
||||
},
|
||||
"buildOptionSet": [
|
||||
{
|
||||
"name": "release",
|
||||
"arkOptions": {
|
||||
"obfuscation": {
|
||||
"ruleOptions": {
|
||||
"enable": true,
|
||||
"files": [
|
||||
"./obfuscation-rules.txt"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
"targets": [
|
||||
{
|
||||
"name": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { hspTasks } from '@ohos/hvigor-ohos-plugin';
|
||||
|
||||
export default {
|
||||
system: hspTasks,
|
||||
plugins: []
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
# Define project specific obfuscation rules here.
|
||||
# You can include the obfuscation configuration files in the current module's build-profile.json5.
|
||||
#
|
||||
# For more details, see
|
||||
# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
|
||||
|
||||
# Obfuscation options:
|
||||
# -disable-obfuscation: disable all obfuscations
|
||||
# -enable-property-obfuscation: obfuscate the property names
|
||||
# -enable-toplevel-obfuscation: obfuscate the names in the global scope
|
||||
# -compact: remove unnecessary blank spaces and all line feeds
|
||||
# -remove-log: remove all console.* statements
|
||||
# -print-namecache: print the name cache that contains the mapping from the old names to new names
|
||||
# -apply-namecache: reuse the given cache file
|
||||
|
||||
# Keep options:
|
||||
# -keep-property-name: specifies property names that you want to keep
|
||||
# -keep-global-name: specifies names that you want to keep in the global scope
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "pages_tool",
|
||||
"version": "1.0.0",
|
||||
"description": "Please describe the basic information.",
|
||||
"main": "Index.ets",
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"packageType": "InterfaceHar",
|
||||
"dependencies": {}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"module": {
|
||||
"name": "pages_tool",
|
||||
"type": "shared",
|
||||
"description": "subpackage",
|
||||
"deviceTypes": [
|
||||
"phone"
|
||||
],
|
||||
"deliveryWithInstall": true,
|
||||
"installationFree": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"string": [
|
||||
{
|
||||
"name": "shared_desc",
|
||||
"value": "description"
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -70,4 +70,76 @@ node scripts/check-har-deps.js --rawfile --strict
|
||||
| 首页只显示 TabBar,无 DIY 内容 | components_diy 缺失 | 加 file: 依赖 + Sync + Build |
|
||||
| 12s splash 后页面空白 | 任意一个 HAR 子包缺失 | 跑校验脚本看哪个缺失 |
|
||||
| 商品分类页空白 | pages_goods 缺失 | 同上 |
|
||||
| "应用未关联服务空间" 报错 | uniCloud 服务未关联(与本依赖无关) | uniCloud 目录右键关联服务空间 |
|
||||
| "Schema validate failed: must match pattern '^[a-zA-Z][0-9a-zA-Z_.]*$'... module.name" | vue.config.js 重新生成时把 pages_tool 的 module.json5.module.name 清空了 | vue.config.js 已自动修复(`_copyMpHarmonyBuild` 末尾调用 `fixSubpackageModuleNames`)。如需手动跑:`node -e "require('./vue.config.js').fixSubpackageModuleNames()"` |
|
||||
| "00604007 Field IS Empty Error: The name of package .../pages_tool cannot be empty" (DevEco 打开项目时 ohpm install 报) | `pages_tool/oh-package.json5` 的 top-level `name` 是空字符串 | `node scripts/fix-subpackage-module-names.js`,会同时修 oh-package.json5 和 module.json5 |
|
||||
| "应用未关联服务空间" 报错 | uniCloud 服务未关联(与本依赖无关) | uniCloud 目录右键关联服务空间 |
|
||||
|
||||
## 子包 module.name 容易丢失的原因
|
||||
|
||||
`vue.config.js` 重新生成鸿蒙元服务产物时,会重新输出 `ascf_build/<pkg>/src/main/module.json5`。
|
||||
其中 `module.name` 字段如果模板里没正确读取 `pkgName`(或没设置),会被写成空串。
|
||||
|
||||
**已自动化修复**:
|
||||
|
||||
`vue.config.js` 暴露了 `fixSubpackageModuleNames()` 函数,会在以下场景自动触发:
|
||||
|
||||
1. **顶层副作用**:vue.config.js 被任何入口 require 时(**包括 HBuilderX 触发 vue-cli-service build**),
|
||||
立即遍历 5 个子包,强制把 `module.name` 修正为包目录名。
|
||||
2. **构建流程**:mp-harmony 生产构建的 `_copyMpHarmonyBuild()` 末尾也会再调一次。
|
||||
|
||||
**也就是说:只要 HBuilderX / 命令行 触发了 vue.config.js(构建必然触发),module.name 就被保证正确,无需任何手动操作。**
|
||||
|
||||
手动调用方式:
|
||||
|
||||
```bash
|
||||
# 直接跑独立脚本 (推荐)
|
||||
node scripts/fix-subpackage-module-names.js
|
||||
```
|
||||
|
||||
或者 require 模块(vue.config.js 内部用的就是这个):
|
||||
|
||||
```bash
|
||||
node -e "require('./scripts/fix-subpackage-module-names').fixSubpackageModuleNames()"
|
||||
```
|
||||
|
||||
> ⚠️ **重要**:vue.config.js 不再 export `fixSubpackageModuleNames`。历史教训:之前把 `fixSubpackageModuleNames` 放在 `module.exports` 上,vue-cli-service 校验 vue.config.js 导出的 keys 时会报:
|
||||
>
|
||||
> `Invalid options in vue.config.js: "fixSubpackageModuleNames" is not allowed`
|
||||
>
|
||||
> 现在函数在独立模块里,vue.config.js 通过顶层 IIFE 调用它,导出干净。
|
||||
|
||||
输出示例:
|
||||
|
||||
```
|
||||
🔧 [vue.config] 修正 ascf_build 子包 module.json5.module.name...
|
||||
✅ components_diy: module.name "(空)" → "components_diy"
|
||||
✅ pages_goods: module.name "(空)" → "pages_goods"
|
||||
✅ pages_order: module.name "(空)" → "pages_order"
|
||||
✅ pages_promotion: module.name "(空)" → "pages_promotion"
|
||||
✅ pages_tool: module.name "(空)" → "pages_tool"
|
||||
📊 修正完成: 5 个子包被更新
|
||||
```
|
||||
|
||||
校验脚本 `check-har-deps.js` 仍作为兜底防线,确保 module.name 不会再次被覆盖为空。
|
||||
|
||||
**完整工作流(HBuilderX "发行" → "鸿蒙元服务")**:
|
||||
|
||||
1. HBuilderX 调 uniapp 编译器生成 `unpackage/dist/build/.mp-harmony/`
|
||||
2. HBuilderX 调 vue-cli-service build → `require('./vue.config.js')`
|
||||
3. **顶层 IIFE 触发 → 自动修复 5 个子包 module.json5.module.name**
|
||||
4. webpack 编译 → `VersionInjectPlugin._copyMpHarmonyBuild()` 拷产物到 ascf_src
|
||||
5. **再次触发 `fixSubpackageModuleNames()`(防御性)**
|
||||
6. DevEco Studio 用 ascf_src 构建鸿蒙 HAP(此时 module.name 已正确)
|
||||
|
||||
**手动修复**(如需保留原 module.json5 内容但 name 字段错了):
|
||||
|
||||
```json5
|
||||
{
|
||||
"module": {
|
||||
"name": "<包目录名, 比如 pages_tool>",
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`name` 必须匹配 `[a-zA-Z][0-9a-zA-Z_.]*`(鸿蒙 schema 要求)。
|
||||
@@ -60,4 +60,16 @@
|
||||
pages_promotion:{ pkg: "pages_promotion",root: "pages_promotion" },
|
||||
pages_tool: { pkg: "pages_tool", root: "pages_tool" },
|
||||
},
|
||||
|
||||
// 每个子包在 ascf_build 中的 src/main/module.json5 路径 (相对 mp-harmony 目录)
|
||||
// 用于校验 module.name 字段是否被 vue.config.js 重新生成时清空
|
||||
// 现象: pages_tool 的 module.json5 的 module.name 被覆盖成 "",
|
||||
// 导致 hvigor schema 校验失败, build 阶段直接退出。
|
||||
subpackageModuleJson5: {
|
||||
components_diy: "./ascf/ascf_build/components_diy/src/main/module.json5",
|
||||
pages_goods: "./ascf/ascf_build/pages_goods/src/main/module.json5",
|
||||
pages_order: "./ascf/ascf_build/pages_order/src/main/module.json5",
|
||||
pages_promotion: "./ascf/ascf_build/pages_promotion/src/main/module.json5",
|
||||
pages_tool: "./ascf/ascf_build/pages_tool/src/main/module.json5",
|
||||
},
|
||||
}
|
||||
@@ -173,6 +173,38 @@ function main() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---- 4. 校验 ascf_build 子包 module.json5 的 module.name 字段 ----
|
||||
// 防止 vue.config.js 重新生成时把 module.name 清空, 导致 hvigor schema 校验失败
|
||||
console.log();
|
||||
console.log(color('--- ascf_build 子包 module.json5 检查 ---', 'cyan'));
|
||||
const mpHarmonyDir = path.resolve(ENTRY_DIR, '..');
|
||||
const subpackageModuleJson5 = config.subpackageModuleJson5 || {};
|
||||
for (const har of requiredHarDeps) {
|
||||
const rel = subpackageModuleJson5[har];
|
||||
if (!rel) continue;
|
||||
const moduleJson5Path = path.resolve(mpHarmonyDir, rel);
|
||||
if (!exists(moduleJson5Path)) {
|
||||
warnings.push(`ascf_build/${har}/src/main/module.json5 缺失 (${moduleJson5Path})`);
|
||||
console.log(color(` ⚠ ${moduleJson5Path} 不存在`, 'yellow'));
|
||||
continue;
|
||||
}
|
||||
let mj;
|
||||
try {
|
||||
mj = loadJson5(moduleJson5Path);
|
||||
} catch (e) {
|
||||
errors.push(`${har} 的 module.json5 解析失败: ${e.message}`);
|
||||
console.log(color(` ✘ ${har} module.json5 解析失败`, 'red'));
|
||||
continue;
|
||||
}
|
||||
const moduleName = mj && mj.module && mj.module.name;
|
||||
if (!moduleName || moduleName !== har) {
|
||||
errors.push(`${har} 的 module.json5.module.name 异常: "${moduleName}" (应为 "${har}", 常见原因: vue.config.js 重新生成时未写入 packageName)`);
|
||||
console.log(color(` ✘ ${har} module.name = "${moduleName}" (应为 "${har}")`, 'red'));
|
||||
} else {
|
||||
console.log(color(` ✔ ${har} module.name = "${moduleName}"`, 'green'));
|
||||
}
|
||||
}
|
||||
|
||||
// ---- 总结 ----
|
||||
console.log();
|
||||
if (warnings.length) {
|
||||
|
||||
101
vue.config.js
101
vue.config.js
@@ -490,14 +490,115 @@ class VersionInjectPlugin {
|
||||
|
||||
copyDir(sourceDir, destDir);
|
||||
console.log(' ✅ 拷贝完成');
|
||||
|
||||
// 同步修正 ascf_build 下 5 个子包 HAR 的 module.json5.module.name
|
||||
// 原因: 模板里 module.name 经常被写成空串或不正确的值,
|
||||
// 导致鸿蒙构建时 hvigor schema 校验失败 (必须 ^[a-zA-Z][0-9a-zA-Z_.]*$)
|
||||
// 这里强制按包目录名覆盖, 保证产物正确。
|
||||
this._fixSubpackageModuleNames();
|
||||
} catch (e) {
|
||||
console.error(` ❌ 拷贝失败: ${e.message}`);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修正 ascf_build/<pkg>/src/main/module.json5 的 module.name 字段
|
||||
*
|
||||
* 背景:
|
||||
* mp-harmony 项目的子包 HAR (components_diy / pages_goods / pages_order /
|
||||
* pages_promotion / pages_tool) 在 ascf/ascf_build/ 目录下各自有
|
||||
* src/main/module.json5, 其中 module.name 必须等于包名才能通过 hvigor schema。
|
||||
*
|
||||
* 这个 module.json5 是项目源码里维护的模板, 经常因为:
|
||||
* 1. uniapp 鸿蒙编译器输出空 name 字段
|
||||
* 2. 模板里手动写错
|
||||
* 3. 早期版本没这个文件, 后来手工补了一个错误的
|
||||
* 导致 module.name 为空, 鸿蒙构建时 schema 校验失败:
|
||||
* "Schema validate failed, must match pattern ^[a-zA-Z][0-9a-zA-Z_.]*$"
|
||||
*
|
||||
* 修复策略:
|
||||
* 遍历 5 个子包, 用包目录名 (例: pages_tool) 覆盖 module.name,
|
||||
* 确保构建产物始终正确。
|
||||
*
|
||||
* 注意:
|
||||
* - 只覆盖 module.name, 其他字段保留 (deviceTypes / installationFree 等)
|
||||
* - 如果 module.json5 不存在, 会按合理默认值新建一份
|
||||
* - 如需新增/删除子包, 同步更新 SUBPACKAGE_NAMES 数组
|
||||
*/
|
||||
_fixSubpackageModuleNames() {
|
||||
// 委托给模块级 fixSubpackageModuleNames, 行为一致
|
||||
return fixSubpackageModuleNames();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修正 ascf_build/<pkg>/src/main/module.json5 的 module.name 字段
|
||||
*
|
||||
* 实现已抽到独立模块 scripts/fix-subpackage-module-names.js,
|
||||
* 这里仅 require + 转发, 避免 vue-cli-service 校验 module.exports 时报错。
|
||||
*
|
||||
* 背景:
|
||||
* mp-harmony 项目的子包 HAR (components_diy / pages_goods / pages_order /
|
||||
* pages_promotion / pages_tool) 在 ascf/ascf_build/ 目录下各自有
|
||||
* src/main/module.json5, 其中 module.name 必须等于包名才能通过 hvigor schema。
|
||||
*
|
||||
* 这个 module.json5 是项目源码里维护的模板, 经常因为:
|
||||
* 1. 模板里手动写错
|
||||
* 2. 早期版本没这个文件, 后来手工补了一个错误的
|
||||
* 3. 自动化脚本覆盖时丢失 name
|
||||
* 导致 module.name 为空或错误, 鸿蒙构建时 schema 校验失败:
|
||||
* "Schema validate failed, must match pattern ^[a-zA-Z][0-9a-zA-Z_.]*$"
|
||||
*
|
||||
* 使用:
|
||||
* // vue.config.js 内部:
|
||||
* const { fixSubpackageModuleNames } = require('./scripts/fix-subpackage-module-names');
|
||||
* fixSubpackageModuleNames();
|
||||
*
|
||||
* // 独立跑:
|
||||
* node scripts/fix-subpackage-module-names.js
|
||||
*
|
||||
* // CI 兜底校验:
|
||||
* node stub-app-projects/mp-harmony/entry/scripts/check-har-deps.js --strict
|
||||
*/
|
||||
const { fixSubpackageModuleNames } = require('./scripts/fix-subpackage-module-names');
|
||||
|
||||
/**
|
||||
* vue.config.js 顶层副作用: 任何入口 require 本文件时, 自动修正
|
||||
* ascf_build/<pkg>/src/main/module.json5.module.name。
|
||||
*
|
||||
* 工作流覆盖:
|
||||
* - HBuilderX 发行 → vue-cli-service build → require vue.config.js → 触发此钩子
|
||||
* - 命令行 vue-cli-service build → 触发此钩子
|
||||
* - 命令行 node -e "require('./vue.config.js')" → 触发此钩子
|
||||
*
|
||||
* 与 VersionInjectPlugin._copyMpHarmonyBuild 末尾的 _fixSubpackageModuleNames 重复
|
||||
* 但更保险: 哪怕 webpack 钩子因为某些原因没触发, require 这层也会保证修复。
|
||||
*/
|
||||
(function _bootstrapFixSubpackageModuleNames() {
|
||||
// 跳过生产测试门禁期间 (test-gate 会 fail 时, 不希望顺手修复文件)
|
||||
if (process.env.NODE_ENV === 'production' && process.env.UNI_SCRIPT && process.env.__TEST_GATE_BLOCKED__) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// 这里不传 silent, 让所有入口 (包括 HBuilderX / 命令行) 都能在 console 看到修复日志
|
||||
fixSubpackageModuleNames();
|
||||
} catch (e) {
|
||||
console.error('[vue.config] bootstrap fixSubpackageModuleNames 失败:', e.message);
|
||||
}
|
||||
})();
|
||||
|
||||
// 导出配置
|
||||
//
|
||||
// 注意: 不要在这里 export 任何非白名单字段!
|
||||
// vue-cli-service 会校验 vue.config.js 的导出 keys, 不允许出现未识别的字段
|
||||
// (会报 "Invalid options in vue.config.js: \"<field>\" is not allowed")。
|
||||
// 历史教训: 之前把 fixSubpackageModuleNames 放在 module.exports 上, 直接报这个错。
|
||||
// 现在 fixSubpackageModuleNames 仅作为本文件内的顶层函数 + 顶层 IIFE 副作用,
|
||||
// 不再 export。需要外部调用请走:
|
||||
// node scripts/fix-subpackage-module-names.js
|
||||
// 或:
|
||||
// node -e "require('./scripts/fix-subpackage-module-names').fixSubpackageModuleNames()"
|
||||
module.exports = {
|
||||
productionSourceMap: false,
|
||||
configureWebpack: config => {
|
||||
|
||||
Reference in New Issue
Block a user