Skip to content

Commit

Permalink
build: change runtime build tools
Browse files Browse the repository at this point in the history
  • Loading branch information
1ncounter committed Mar 25, 2024
1 parent 62c535b commit ea96be3
Show file tree
Hide file tree
Showing 44 changed files with 542 additions and 292 deletions.
1 change: 1 addition & 0 deletions TODOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
2. develop
3. debug
4. build
target module mode: ESM/UMD
5. test
6. publish
7. github workflows
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@changesets/cli": "^2.27.1",
"@types/node": "^20.11.30",
"@types/react-router": "5.1.18",
"@vitejs/plugin-react": "^4.2.1",
"babel-jest": "^26.5.2",
"del": "^6.1.1",
"execa": "^8.0.1",
Expand All @@ -47,7 +48,8 @@
"rimraf": "^5.0.2",
"rollup": "^4.13.0",
"vite": "^5.1.6",
"vitest": "^1.3.1"
"vitest": "^1.3.1",
"vite-plugin-dts": "^3.7.3"
},
"engines": {
"node": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion packages/designer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-designer",
"version": "1.3.2",
"version": "2.0.0-beta.0",
"description": "Designer for Ali LowCode Engine",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
7 changes: 0 additions & 7 deletions packages/editor-core/build.json

This file was deleted.

11 changes: 0 additions & 11 deletions packages/editor-core/build.plugin.js

This file was deleted.

9 changes: 0 additions & 9 deletions packages/editor-core/build.test.json

This file was deleted.

26 changes: 0 additions & 26 deletions packages/editor-core/jest.config.js

This file was deleted.

53 changes: 27 additions & 26 deletions packages/editor-core/package.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
{
"name": "@alilc/lowcode-editor-core",
"version": "1.3.2",
"version": "2.0.0-beta.0",
"description": "Core Api for Ali lowCode engine",
"license": "MIT",
"main": "lib/index.js",
"module": "es/index.js",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"files": [
"lib",
"es"
],
"scripts": {
"build": "build-scripts build",
"build": "tsc",
"test": "build-scripts test --config build.test.json",
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
},
"dependencies": {
"@alifd/next": "^1.19.16",
"@alilc/lowcode-types": "1.3.2",
"@alilc/lowcode-utils": "1.3.2",
"classnames": "^2.2.6",
"debug": "^4.1.1",
"intl-messageformat": "^9.3.1",
"lodash.get": "^4.4.2",
"mobx": "^6.3.0",
"mobx-react": "^7.2.0",
"power-di": "^2.2.4",
"react": "^16",
"react-dom": "^16.7.0",
"store": "^2.0.12"
"@alifd/next": "^1.27.8",
"@alilc/lowcode-types": "workspace:*",
"@alilc/lowcode-utils": "workspace:*",
"classnames": "^2.5.1",
"intl-messageformat": "^10.5.1",
"lodash-es": "^4.17.21",
"mobx": "^6.12.0",
"mobx-react": "^9.1.0",
"power-di": "^2.4.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"store": "^2.0.12",
"strict-event-emitter-types": "^2.0.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.18",
"@alilc/lowcode-datasource-types": "^1.0.1",
"@types/classnames": "^2.2.7",
"@types/lodash.get": "^4.4.6",
"@types/node": "^13.7.1",
"@types/react": "^16",
"@types/react-dom": "^16",
"@types/store": "^2.0.2",
"build-plugin-fusion": "^0.1.0",
"build-plugin-moment-locales": "^0.1.0"
"@types/lodash-es": "^4.17.12",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@types/store": "^2.0.2"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"publishConfig": {
"access": "public",
Expand Down
35 changes: 22 additions & 13 deletions packages/editor-core/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { get as lodashGet } from 'lodash';
import { get as lodashGet } from 'lodash-es';
import { isPlainObject } from '@alilc/lowcode-utils';
import {
IPublicTypeEngineOptions,
Expand Down Expand Up @@ -55,7 +55,8 @@ const VALID_ENGINE_OPTIONS = {
enableStrictPluginMode: {
type: 'boolean',
default: STRICT_PLUGIN_MODE_DEFAULT,
description: '开启严格插件模式,默认值:STRICT_PLUGIN_MODE_DEFAULT , 严格模式下,插件将无法通过 engineOptions 传递自定义配置项',
description:
'开启严格插件模式,默认值:STRICT_PLUGIN_MODE_DEFAULT , 严格模式下,插件将无法通过 engineOptions 传递自定义配置项',
},
enableReactiveContainer: {
type: 'boolean',
Expand All @@ -75,7 +76,8 @@ const VALID_ENGINE_OPTIONS = {
customizeIgnoreSelectors: {
type: 'function',
default: undefined,
description: '定制画布中点击被忽略的 selectors, eg. (defaultIgnoreSelectors: string[], e: MouseEvent) => string[]',
description:
'定制画布中点击被忽略的 selectors, eg. (defaultIgnoreSelectors: string[], e: MouseEvent) => string[]',
},
disableDefaultSettingPanel: {
type: 'boolean',
Expand Down Expand Up @@ -171,19 +173,23 @@ const VALID_ENGINE_OPTIONS = {
},
};

const getStrictModeValue = (engineOptions: IPublicTypeEngineOptions, defaultValue: boolean): boolean => {
const getStrictModeValue = (
engineOptions: IPublicTypeEngineOptions,
defaultValue: boolean,
): boolean => {
if (!engineOptions || !isPlainObject(engineOptions)) {
return defaultValue;
}
if (engineOptions.enableStrictPluginMode === undefined
|| engineOptions.enableStrictPluginMode === null) {
if (
engineOptions.enableStrictPluginMode === undefined ||
engineOptions.enableStrictPluginMode === null
) {
return defaultValue;
}
return engineOptions.enableStrictPluginMode;
};

export interface IEngineConfig extends IPublicModelEngineConfig {

/**
* if engineOptions.strictPluginMode === true, only accept propertied predefined in EngineOptions.
*
Expand All @@ -202,11 +208,11 @@ export class EngineConfig implements IEngineConfig {
private config: { [key: string]: any } = {};

private waits = new Map<
string,
Array<{
once?: boolean;
resolve: (data: any) => void;
}>
string,
Array<{
once?: boolean;
resolve: (data: any) => void;
}>
>();

/**
Expand Down Expand Up @@ -278,7 +284,10 @@ export class EngineConfig implements IEngineConfig {
if (isValidKey(key)) {
this.set(key, (engineOptions as any)[key]);
} else {
logger.warn(`failed to config ${key} to engineConfig, only predefined options can be set under strict mode, predefined options: `, VALID_ENGINE_OPTIONS);
logger.warn(
`failed to config ${key} to engineConfig, only predefined options can be set under strict mode, predefined options: `,
VALID_ENGINE_OPTIONS,
);
}
});
} else {
Expand Down
Loading

0 comments on commit ea96be3

Please sign in to comment.