mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 11:20:11 +00:00
Merge pull request #40 from alibaba/feat/umd-ify-react-renderer-2
Feat/umd ify react renderer 2
This commit is contained in:
commit
f8cfdbb2cb
2634
CHANGELOG.md
2634
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -38,7 +38,8 @@
|
|||||||
"f2elint": "^2.0.1",
|
"f2elint": "^2.0.1",
|
||||||
"husky": "^7.0.4",
|
"husky": "^7.0.4",
|
||||||
"lerna": "^4.0.0",
|
"lerna": "^4.0.0",
|
||||||
"typescript": "^4.5.5"
|
"typescript": "^4.5.5",
|
||||||
|
"yarn": "^1.22.17"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.17.0 <16"
|
"node": ">=14.17.0 <16"
|
||||||
|
|||||||
@ -5,83 +5,16 @@
|
|||||||
<meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1" />
|
<meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1" />
|
||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<title>LowCodeEngine Editor DEMO</title>
|
<title>LowCodeEngine Editor DEMO</title>
|
||||||
<link rel="shortcut icon" href="./favicon.png" />
|
|
||||||
<link rel="stylesheet" data-name="vs/editor/editor.main" href="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.21.0/min/vs/editor/editor.main.css"/>
|
|
||||||
<script src="https://g.alicdn.com/code/lib/react/16.9.0/umd/react.development.js"></script>
|
|
||||||
<script src="https://g.alicdn.com/code/lib/react-dom/16.9.0/umd/react-dom.development.js"></script>
|
|
||||||
<script src="https://g.alicdn.com/code/lib/prop-types/15.7.2/prop-types.js"></script>
|
|
||||||
<script>
|
|
||||||
React.PropTypes = PropTypes;
|
|
||||||
</script>
|
|
||||||
<script src="https://g.alicdn.com/platform/c/??react15-polyfill/0.0.1/dist/index.js,lodash/4.6.1/lodash.min.js,immutable/3.7.6/dist/immutable.min.js,natty-storage/2.0.2/dist/natty-storage.min.js,natty-fetch/2.6.0/dist/natty-fetch.pc.min.js,tinymce/4.2.5/tinymce-full.js"></script>
|
|
||||||
<script src="https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js"></script>
|
|
||||||
<link rel="stylesheet" href="https://unpkg.alibaba-inc.com/@alifd/next@1.20.25/dist/next.min.css" />
|
|
||||||
<script src="https://unpkg.alibaba-inc.com/@alifd/next@1.20.25/dist/next.min.js"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/rax@1.1.3/dist/rax.js"></script>
|
|
||||||
<!-- <script src="http://192.168.0.106:8000/lc-engine.js"></script> -->
|
|
||||||
<script>
|
|
||||||
var require = { paths: { vs: 'https://g.alicdn.com/code/lib/monaco-editor/0.21.2/min/vs' } };
|
|
||||||
</script>
|
|
||||||
<script src="https://g.alicdn.com/code/lib/monaco-editor/0.21.2/min/vs/loader.min.js"></script>
|
|
||||||
<script src="https://g.alicdn.com/code/lib/monaco-editor/0.21.2/min/vs/editor/editor.main.nls.js"></script>
|
|
||||||
<script src="https://g.alicdn.com/code/lib/monaco-editor/0.21.2/min/vs/editor/editor.main.js"></script>
|
|
||||||
<link rel="stylesheet" href="/css/editor-preset-vision.css" />
|
|
||||||
<script>
|
|
||||||
window.pageConfig = {
|
|
||||||
env: 'release',
|
|
||||||
locale: 'zh_CN',
|
|
||||||
pageType: 'single',
|
|
||||||
deviceType: 'web',
|
|
||||||
appName: '基础包管理后台',
|
|
||||||
appType: 'legao_base_packages',
|
|
||||||
templateType: '',
|
|
||||||
pageId: 'FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V',
|
|
||||||
slug: 'test',
|
|
||||||
appMode: 'back',
|
|
||||||
isAppAdmin: 'y',
|
|
||||||
isSuperAdmin: 'n',
|
|
||||||
isBetaDeveloper: 'n',
|
|
||||||
formType: 'display',
|
|
||||||
title: { en_US: '测试', type: 'i18n', zh_CN: '测试' },
|
|
||||||
urlPrefix: 'https://go.alibaba-inc.com',
|
|
||||||
APIUrlPrefix: 'https://go.alibaba-inc.com',
|
|
||||||
devVersion: '0.1.0', // 这个是子应用的变更 id
|
|
||||||
subAppType: '0.1.0',
|
|
||||||
appKey: 'legao_base_packages',
|
|
||||||
RE_VERSION: '7.1.1',
|
|
||||||
appSource: '',
|
|
||||||
isDomainDefault: 'n',
|
|
||||||
useReleaseBundle: 'n',
|
|
||||||
isDomainPkg: 'n',
|
|
||||||
medusaAppName: '',
|
|
||||||
domainCode: 'kS6SyH',
|
|
||||||
aecp: {
|
|
||||||
mdcDomain: '',
|
|
||||||
projectId: '',
|
|
||||||
appCode: '',
|
|
||||||
},
|
|
||||||
designerConfigs: {},
|
|
||||||
navConfig:
|
|
||||||
'{"appName":{"en_US":"基础包管理后台","key":"","type":"i18n","zh_CN":"基础包管理后台"},"bgColor":"white","data":[{"children":[],"hidden":false,"icon":"","inner":true,"navUuid":"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V","relateUuid":"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V","slug":"test","targetNew":false,"title":{"en_US":"测试","type":"i18n","zh_CN":"测试"}}],"isFixed":"y","isFold":"y","isFoldHorizontal":"n","languageChangeUrl":{"en_US":"/common/account/changeAccountLanguage.json","type":"i18n","zh_CN":"/common/account/changeAccountLanguage.json"},"layout":"auto","navStyle":"orange","navTheme":"light","openSubMode":false,"showAppTitle":true,"showCrumb":true,"showIcon":false,"showLanguageChange":true,"showNav":true,"showSearch":"n","singletons":{"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V":{"isFixed":"n","isFold":"n","isFoldHorizontal":"n","showAppTitle":false,"showCrumb":false,"showLanguageChange":false,"showNav":false,"showSearch":"n","singleton":false},"test":{"$ref":"$.singletons.FORM\\-3KYJN7RV\\-DIOD8LLK1WGQ89S7NHA92\\-QJVH497K\\-V"}},"type":"top_fold"}',
|
|
||||||
historyType: 'HASH',
|
|
||||||
isSinglePage: 'n',
|
|
||||||
rhino: 'n',
|
|
||||||
isMiniApp: '',
|
|
||||||
taskId: '',
|
|
||||||
appSchema: 'V5',
|
|
||||||
openSubMode: 'n',
|
|
||||||
};
|
|
||||||
window.g_config = {};
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<!-- lowcode engine globals -->
|
<h1>
|
||||||
<div id="lce-container"></div>
|
This project only provides engine resource files. For usage, go for
|
||||||
<!-- vision 测试使用
|
<a href="https://github.com/alibaba/lowcode-demo" target="_blank">Lowcode Demo</a>
|
||||||
|
</h1>
|
||||||
-->
|
<h2>
|
||||||
<script src="/js/editor-preset-vision.js"></script>
|
For local debugging of lowcode engine, please visit
|
||||||
<script src="https://dev.g.alicdn.com/vision/visualengine-utils/5.0.0/engine-utils.js"></script>
|
<a href="https://www.yuque.com/lce/doc/glz0fx#wi8rs" target="_blank">proxy documentation</a>
|
||||||
|
to get more information.
|
||||||
|
</h2>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
28
packages/react-renderer/build.umd.json
Normal file
28
packages/react-renderer/build.umd.json
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"entry": {
|
||||||
|
"react-renderer": "src/index"
|
||||||
|
},
|
||||||
|
"sourceMap": true,
|
||||||
|
"library": "AliLowCodeReactRenderer",
|
||||||
|
"libraryTarget": "umd",
|
||||||
|
"externals": {
|
||||||
|
"react": "var window.React",
|
||||||
|
"react-dom": "var window.ReactDOM",
|
||||||
|
"prop-types": "var window.PropTypes",
|
||||||
|
"@alifd/next": "var Next",
|
||||||
|
"moment": "var window.moment"
|
||||||
|
},
|
||||||
|
"polyfill": false,
|
||||||
|
"outputDir": "dist",
|
||||||
|
"vendor": false,
|
||||||
|
"ignoreHtmlTemplate": true,
|
||||||
|
"plugins": [
|
||||||
|
"build-plugin-react-app",
|
||||||
|
["build-plugin-fusion", {
|
||||||
|
"externalNext": "umd"
|
||||||
|
}],
|
||||||
|
["build-plugin-moment-locales", {
|
||||||
|
"locales": ["zh-cn"]
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -6,12 +6,14 @@
|
|||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
"lib",
|
"lib",
|
||||||
"es"
|
"es",
|
||||||
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "build-scripts test --config build.test.json",
|
"test": "build-scripts test --config build.test.json",
|
||||||
"start": "build-scripts start",
|
"start": "build-scripts start",
|
||||||
"build": "build-scripts build --skip-demo"
|
"build": "build-scripts build --skip-demo",
|
||||||
|
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"lowcode",
|
"lowcode",
|
||||||
|
|||||||
@ -1,71 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
const process = require('process');
|
|
||||||
const { execSync } = require('child_process');
|
|
||||||
|
|
||||||
// eslint-disable-next-line prefer-const
|
|
||||||
let [owner, pkg] = process.argv.slice(2);
|
|
||||||
|
|
||||||
const packages_dir = path.join(__dirname, '..', 'packages');
|
|
||||||
function getPackageNames() {
|
|
||||||
const ls = fs.readdirSync(packages_dir, 'utf-8');
|
|
||||||
const packageNames = [];
|
|
||||||
ls.forEach((item) => {
|
|
||||||
if (item.charAt(0) === '.') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const packageJsonFile = path.join(packages_dir, item, 'package.json');
|
|
||||||
|
|
||||||
if (fs.existsSync(packageJsonFile)) {
|
|
||||||
const json = require(packageJsonFile);
|
|
||||||
if (!json.private && json.name) {
|
|
||||||
packageNames.push(json.name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return packageNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
const owners_file = path.join(__dirname, './owners.json');
|
|
||||||
const owners = require(owners_file);
|
|
||||||
function addPackageOwners(packageName) {
|
|
||||||
owners.forEach(setOwner => addOwner(packageName, setOwner));
|
|
||||||
}
|
|
||||||
|
|
||||||
function addOwner(packageName, setOwner) {
|
|
||||||
console.info(`addowner "${setOwner}" for "${packageName}"`);
|
|
||||||
try {
|
|
||||||
execSync(`tnpm owner add ${setOwner} ${packageName}`, {
|
|
||||||
encoding: 'utf-8',
|
|
||||||
});
|
|
||||||
console.info('OK');
|
|
||||||
} catch (e) {
|
|
||||||
console.info(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pkg) {
|
|
||||||
const packageJsonFile = path.join(packages_dir, pkg, 'package.json');
|
|
||||||
|
|
||||||
if (fs.existsSync(packageJsonFile)) {
|
|
||||||
const json = require(packageJsonFile);
|
|
||||||
if (!json.private && json.name) {
|
|
||||||
pkg = json.name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (owner === '-') {
|
|
||||||
addPackageOwners(pkg);
|
|
||||||
} else {
|
|
||||||
addOwner(pkg, owner);
|
|
||||||
}
|
|
||||||
} else if (owner) {
|
|
||||||
getPackageNames().forEach(packageName => {
|
|
||||||
addOwner(packageName, owner);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
const pkgs = getPackageNames();
|
|
||||||
pkgs.forEach(packageName => {
|
|
||||||
addPackageOwners(packageName);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@ -21,4 +21,5 @@ lerna run build:umd \
|
|||||||
--scope @alilc/lowcode-engine \
|
--scope @alilc/lowcode-engine \
|
||||||
--scope @alilc/lowcode-rax-simulator-renderer \
|
--scope @alilc/lowcode-rax-simulator-renderer \
|
||||||
--scope @alilc/lowcode-react-simulator-renderer \
|
--scope @alilc/lowcode-react-simulator-renderer \
|
||||||
|
--scope @alilc/lowcode-react-renderer \
|
||||||
--stream
|
--stream
|
||||||
@ -1,39 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
WORK_DIR=$PWD
|
|
||||||
BUILD_DEST=$1
|
|
||||||
|
|
||||||
if [ ! -d "$BUILD_DEST" ]; then
|
|
||||||
mkdir -p "$BUILD_DEST"
|
|
||||||
fi
|
|
||||||
|
|
||||||
tnpm i -g n
|
|
||||||
# 使用官方源有较大概率会 block
|
|
||||||
export N_NODE_MIRROR=https://npm.taobao.org/mirrors/node
|
|
||||||
|
|
||||||
echo "Switch node version to 14"
|
|
||||||
n 14.17.0
|
|
||||||
echo "Node Version"
|
|
||||||
node -v
|
|
||||||
|
|
||||||
echo "Deploy ${WORK_DIR} -> ${BUILD_DEST} ..."
|
|
||||||
|
|
||||||
echo "Clean"
|
|
||||||
tnpm run clean
|
|
||||||
|
|
||||||
echo "Setup"
|
|
||||||
tnpm run setup
|
|
||||||
|
|
||||||
# set source
|
|
||||||
# yarn config set registry https://registry.npm.alibaba-inc.com
|
|
||||||
|
|
||||||
lerna run cloud-build --stream
|
|
||||||
|
|
||||||
mv ./packages/react-simulator-renderer/dist/js/* $BUILD_DEST
|
|
||||||
mv ./packages/react-simulator-renderer/dist/css/* $BUILD_DEST
|
|
||||||
mv ./packages/rax-simulator-renderer/dist/js/* $BUILD_DEST
|
|
||||||
mv ./packages/rax-simulator-renderer/dist/css/* $BUILD_DEST
|
|
||||||
mv ./packages/engine/dist/js/* $BUILD_DEST
|
|
||||||
mv ./packages/engine/dist/css/* $BUILD_DEST
|
|
||||||
|
|
||||||
echo "Complete"
|
|
||||||
@ -1,7 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
tnpm i -g lerna @ali/tyarn
|
|
||||||
|
|
||||||
rm -rf node_modules package-lock.json yarn.lock
|
rm -rf node_modules package-lock.json yarn.lock
|
||||||
lerna clean -y
|
lerna clean -y
|
||||||
find ./packages -type f -name "package-lock.json" -exec rm -f {} \;
|
find ./packages -type f -name "package-lock.json" -exec rm -f {} \;
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
tnpm i -g lerna @ali/tyarn
|
|
||||||
|
|
||||||
rm -rf node_modules package-lock.json yarn.lock
|
rm -rf node_modules package-lock.json yarn.lock
|
||||||
lerna clean -y
|
lerna clean -y
|
||||||
find ./packages -type f -name "package-lock.json" -exec rm -f {} \;
|
find ./packages -type f -name "package-lock.json" -exec rm -f {} \;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user