Skip to content

Commit

Permalink
chore: change build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
1ncounter committed Mar 27, 2024
1 parent 8e2e22d commit 0014b6a
Show file tree
Hide file tree
Showing 46 changed files with 133 additions and 221 deletions.
4 changes: 2 additions & 2 deletions packages/designer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"package.json"
],
"scripts": {
"build": "vite build",
"build-dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"build:target": "vite build",
"build:dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"test": "vitest",
"test:cov": ""
},
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"package.json"
],
"scripts": {
"build": "vite build",
"build-dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"build:target": "vite build",
"build:dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"test": "vitest",
"test:cov": ""
},
Expand Down
13 changes: 7 additions & 6 deletions packages/editor-skeleton/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "2.0.0-beta.0",
"description": "alibaba lowcode editor skeleton",
"type": "module",
"main": "dist/designer.cjs",
"module": "dist/designer.js",
"main": "dist/editorSkeleton.cjs",
"module": "dist/editorSkeleton.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/designer.js",
"require": "./dist/designer.cjs",
"import": "./dist/editorSkeleton.js",
"require": "./dist/editorSkeleton.cjs",
"types": "./dist/index.d.ts"
}
},
Expand All @@ -22,8 +22,9 @@
"package.json"
],
"scripts": {
"build": "vite build",
"build-dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"build": "pnpm run --stream \"/^build:.*/\"",
"build:target": "vite build",
"build:dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"test": "vitest"
},
"keywords": [
Expand Down
47 changes: 21 additions & 26 deletions packages/engine/package.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,45 @@
{
"name": "@alilc/lowcode-engine",
"version": "1.3.2",
"version": "2.0.0-beta.0",
"description": "An enterprise-class low-code technology stack with scale-out design / 一套面向扩展设计的企业级低代码技术体系",
"main": "lib/engine-core.js",
"module": "es/engine-core.js",
"main": "dist/engine-core.js",
"module": "dist/engine-core.js",
"files": [
"dist",
"es",
"lib"
],
"scripts": {
"start": "build-scripts start",
"version:update": "node ./scripts/version.js",
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build",
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json",
"test": "build-scripts test --config build.test.json --jest-passWithNoTests"
"test": "vitest"
},
"license": "MIT",
"dependencies": {
"@alifd/next": "^1.19.12",
"@alilc/lowcode-designer": "1.3.2",
"@alilc/lowcode-editor-core": "1.3.2",
"@alilc/lowcode-editor-skeleton": "1.3.2",
"@alifd/next": "^1.27.8",
"@alilc/lowcode-designer": "workspace:*",
"@alilc/lowcode-editor-core": "workspace:*",
"@alilc/lowcode-editor-skeleton": "workspace:*",
"@alilc/lowcode-engine-ext": "^1.0.0",
"@alilc/lowcode-plugin-command": "1.3.2",
"@alilc/lowcode-plugin-designer": "1.3.2",
"@alilc/lowcode-plugin-outline-pane": "1.3.2",
"@alilc/lowcode-shell": "1.3.2",
"@alilc/lowcode-utils": "1.3.2",
"@alilc/lowcode-workspace": "1.3.2",
"@alilc/lowcode-plugin-command": "workspace:*",
"@alilc/lowcode-plugin-designer": "workspace:*",
"@alilc/lowcode-plugin-outline-pane": "workspace:*",
"@alilc/lowcode-shell": "workspace:*",
"@alilc/lowcode-utils": "workspace:*",
"@alilc/lowcode-workspace": "workspace:*",
"prop-types": "^15.7.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.18",
"@alifd/theme-lowcode-dark": "^0.2.0",
"@alifd/theme-lowcode-light": "^0.2.0",
"@types/domready": "^1.0.0",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"build-plugin-fusion": "0.1.17-beta.0",
"build-plugin-moment-locales": "^0.1.0",
"build-plugin-react-app": "^1.8.0",
"fs-extra": "^10.0.0",
"prop-types": "^15.7.2",
"tsconfig-paths-webpack-plugin": "^3.2.0"
"@types/react-dom": "^18.2.0"
},
"peerDependencies": {
"@alifd/next": "^1.27.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"publishConfig": {
"access": "public",
Expand Down
6 changes: 2 additions & 4 deletions packages/engine/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "lib"
"outDir": "dist"
},
"include": [
"./src/"
]
"include": ["src"]
}
4 changes: 2 additions & 2 deletions packages/plugin-command/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"*.css"
],
"scripts": {
"build": "vite build",
"build-dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"build:target": "vite build",
"build:dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"test": "vitest"
},
"bugs": {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-designer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"package.json"
],
"scripts": {
"build": "vite build",
"build-dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"build:target": "vite build",
"build:dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"test": "vitest"
},
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-outline-pane/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"package.json"
],
"scripts": {
"build": "vite build",
"build-dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"build:target": "vite build",
"build:dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"test": "vitest"
},
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/react-simulator-renderer/babel.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/react-simulator-renderer/build.json

This file was deleted.

5 changes: 0 additions & 5 deletions packages/react-simulator-renderer/build.plugin.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/react-simulator-renderer/build.test.json

This file was deleted.

37 changes: 0 additions & 37 deletions packages/react-simulator-renderer/build.umd.json

This file was deleted.

33 changes: 0 additions & 33 deletions packages/react-simulator-renderer/jest.config.js

This file was deleted.

36 changes: 17 additions & 19 deletions packages/react-simulator-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
{
"name": "@alilc/lowcode-react-simulator-renderer",
"version": "1.3.2",
"version": "2.0.0-beta.0",
"description": "react simulator renderer for alibaba lowcode designer",
"type": "module",
"main": "lib/index.js",
"module": "es/index.js",
"types": "",
"license": "MIT",
"files": [
"es",
"lib",
"dist"
"dist",
"src",
"package.json"
],
"scripts": {
"test": "build-scripts test --config build.test.json",
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build",
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json",
"build:target": "vite build",
"build:dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"test": "vitest",
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
},
"dependencies": {
"@alilc/lowcode-designer": "1.3.2",
"@alilc/lowcode-react-renderer": "1.3.2",
"@alilc/lowcode-types": "1.3.2",
"@alilc/lowcode-utils": "1.3.2",
"classnames": "^2.2.6",
"mobx": "^6.3.0",
"mobx-react": "^7.2.0",
"@alilc/lowcode-designer": "workspace:*",
"@alilc/lowcode-react-renderer": "workspace:*",
"classnames": "^2.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.18",
"@types/classnames": "^2.2.7",
"@types/node": "^13.7.1",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@types/react-router": "5.1.18"
"@types/react-dom": "^18.2.0"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"publishConfig": {
"access": "public",
Expand Down
17 changes: 17 additions & 0 deletions packages/react-simulator-renderer/src.bak/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { runInAction } from 'mobx';
import renderer from './renderer';

if (typeof window !== 'undefined') {
(window as any).SimulatorRenderer = renderer;
}

window.addEventListener('beforeunload', () => {
runInAction(() => {
(window as any).LCSimulatorHost = null;
renderer.dispose?.();
(window as any).SimulatorRenderer = null;
(window as any).ReactDOM.unmountComponentAtNode(document.getElementById('app'));
});
});

export default renderer;
17 changes: 0 additions & 17 deletions packages/react-simulator-renderer/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +0,0 @@
import { runInAction } from 'mobx';
import renderer from './renderer';

if (typeof window !== 'undefined') {
(window as any).SimulatorRenderer = renderer;
}

window.addEventListener('beforeunload', () => {
runInAction(() => {
(window as any).LCSimulatorHost = null;
renderer.dispose?.();
(window as any).SimulatorRenderer = null;
(window as any).ReactDOM.unmountComponentAtNode(document.getElementById('app'));
});
});

export default renderer;
30 changes: 30 additions & 0 deletions packages/react-simulator-renderer/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { defineConfig } from 'vite';
import { resolve } from 'node:path';
import react from '@vitejs/plugin-react';
import { devDependencies, peerDependencies } from './package.json';

const externals = [...Object.keys(devDependencies), ...Object.keys(peerDependencies)];

export default defineConfig({
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(import.meta.dirname, 'src/index.ts'),
name: 'LowCodeSimulatorReactRenderer',
formats: ['es', 'cjs', 'iife'],
// the proper extensions will be added
fileName: 'SimulatorReactRenderer',
},
rollupOptions: {
external: externals,
output: {
// for UMD
globals: {
react: 'React',
'react-dom': 'ReactDOM',
},
},
},
},
plugins: [react()],
});
Empty file.
4 changes: 2 additions & 2 deletions packages/renderer-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"package.json"
],
"scripts": {
"build": "vite build",
"build-dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"build:target": "vite build",
"build:dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
"test": "vitest --run",
"test:watch": "vitest"
},
Expand Down
Loading

0 comments on commit 0014b6a

Please sign in to comment.