mirror of
https://github.com/idrawjs/idraw
synced 2026-05-23 09:38:22 +00:00
test: improve e2e test
This commit is contained in:
parent
eb87fc2dff
commit
b94ac6db5a
12 changed files with 430 additions and 26 deletions
|
|
@ -1,20 +1,20 @@
|
|||
import opts from "./lib/opts.js";
|
||||
import { drawData } from "./lib/draw.js";
|
||||
import { doScale } from "./lib/scale.js";
|
||||
import { doScroll } from "./lib/scroll.js";
|
||||
import { initEvent } from "./lib/event.js";
|
||||
import { doCursor } from "./lib/action.js";
|
||||
import opts from './lib/opts.js';
|
||||
import { drawData } from './lib/draw.js';
|
||||
import { doScale } from './lib/scale.js';
|
||||
import { doScroll } from './lib/scroll.js';
|
||||
import { initEvent } from './lib/event.js';
|
||||
import { doCursor } from './lib/action.js';
|
||||
|
||||
const { Board } = window.iDrawBoard;
|
||||
const Board = window.iDrawBoard;
|
||||
|
||||
const mount = document.querySelector("#mount");
|
||||
const mount = document.querySelector('#mount');
|
||||
const board = new Board(mount, opts);
|
||||
|
||||
const conf = {
|
||||
scale: 1,
|
||||
scale: 1
|
||||
// scrollX: 100,
|
||||
// scrollY: 200,
|
||||
}
|
||||
};
|
||||
|
||||
// const conf = {
|
||||
// scale: 2,
|
||||
|
|
@ -29,9 +29,15 @@ doScale(board, conf.scale);
|
|||
doScroll(board, conf);
|
||||
doCursor(board);
|
||||
|
||||
console.log('pointScreenToContext = ', board.pointScreenToContext({ x: 400, y: 300 }));
|
||||
console.log(
|
||||
'pointScreenToContext = ',
|
||||
board.pointScreenToContext({ x: 400, y: 300 })
|
||||
);
|
||||
|
||||
console.log('pointContextToScreen = ', board.pointContextToScreen({ x: 300, y: 200 }));
|
||||
console.log(
|
||||
'pointContextToScreen = ',
|
||||
board.pointContextToScreen({ x: 300, y: 200 })
|
||||
);
|
||||
|
||||
// board.scale(2);
|
||||
// board.draw();
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@
|
|||
<script type="module">
|
||||
import event from './../../../scripts/browser/event.js';
|
||||
(async function() {
|
||||
const { Board } = window.iDrawBoard;
|
||||
const Board = window.iDrawBoard;
|
||||
const mount1 = document.querySelector('#mount-1');
|
||||
const mount2 = document.querySelector('#mount-2');
|
||||
const board = new Board(mount1, opts);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@
|
|||
|
||||
<script>
|
||||
(function () {
|
||||
const { Board } = window.iDrawBoard;
|
||||
const Board = window.iDrawBoard;
|
||||
const mount = document.querySelector('#mount-1');
|
||||
const board = new Board(mount, {
|
||||
width: 300,
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
|
||||
<script>
|
||||
(function() {
|
||||
const { Board } = window.iDrawBoard;
|
||||
const Board = window.iDrawBoard;
|
||||
const mount = document.querySelector('#mount-2');
|
||||
const opts = {
|
||||
width: 300,
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
|
||||
<script>
|
||||
(function () {
|
||||
const { Board } = window.iDrawBoard;
|
||||
const Board = window.iDrawBoard;
|
||||
const mount = document.querySelector('#mount-1');
|
||||
const board = new Board(mount, {
|
||||
width: 300,
|
||||
|
|
@ -105,7 +105,7 @@
|
|||
</script>
|
||||
<script>
|
||||
(function() {
|
||||
const { Board } = window.iDrawBoard;
|
||||
const Board = window.iDrawBoard;
|
||||
const mount = document.querySelector('#mount-2');
|
||||
const board = new Board(mount, {
|
||||
width: 300,
|
||||
|
|
@ -126,7 +126,7 @@
|
|||
|
||||
<script>
|
||||
(function() {
|
||||
const { Board } = window.iDrawBoard;
|
||||
const Board = window.iDrawBoard;
|
||||
const mount = document.querySelector('#mount-3');
|
||||
const board = new Board(mount, {
|
||||
width: 300,
|
||||
|
|
@ -148,7 +148,7 @@
|
|||
|
||||
<script>
|
||||
(function() {
|
||||
const { Board } = window.iDrawBoard;
|
||||
const Board = window.iDrawBoard;
|
||||
const mount = document.querySelector('#mount-4');
|
||||
const board = new Board(mount, {
|
||||
width: 300,
|
||||
|
|
@ -167,7 +167,7 @@
|
|||
|
||||
<script>
|
||||
(function() {
|
||||
const { Board } = window.iDrawBoard;
|
||||
const Board = window.iDrawBoard;
|
||||
const mount = document.querySelector('#mount-5');
|
||||
const opts = {
|
||||
width: 300,
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@
|
|||
</script>
|
||||
<script>
|
||||
(function() {
|
||||
const { Board } = window.iDrawBoard;
|
||||
const Board = window.iDrawBoard;
|
||||
const mount = document.querySelector('#mount-1');
|
||||
const board = new Board(mount, opts);
|
||||
// board.on('wheelX', (deltaX) => {
|
||||
|
|
@ -128,7 +128,7 @@
|
|||
<script type="module">
|
||||
import event from '../../../scripts/browser/event.js';
|
||||
(function() {
|
||||
const { Board } = window.iDrawBoard;
|
||||
const Board = window.iDrawBoard;
|
||||
const mount = document.querySelector('#mount-2');
|
||||
const board = new Board(mount, opts);
|
||||
drawBoard(board)
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@
|
|||
window.getData = getData;
|
||||
</script>
|
||||
<script>
|
||||
const { Core } = window.iDrawCore;
|
||||
const Core = window.iDrawCore;
|
||||
var opts = {
|
||||
width: 300,
|
||||
height: 200,
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@
|
|||
window.getData = getData;
|
||||
</script>
|
||||
<script>
|
||||
const { Core } = window.iDrawCore;
|
||||
const Core = window.iDrawCore;
|
||||
var opts = {
|
||||
width: 300,
|
||||
height: 200,
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
<script src="../../../packages/core/dist/index.global.js"></script>
|
||||
<script>
|
||||
const { Core } = window.iDrawCore;
|
||||
const Core = window.iDrawCore;
|
||||
var opts = {
|
||||
width: 300,
|
||||
height: 200,
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
<script src="../../../packages/core/dist/index.global.js"></script>
|
||||
<script>
|
||||
const { Core } = window.iDrawCore;
|
||||
const Core = window.iDrawCore;
|
||||
var opts = {
|
||||
width: 300,
|
||||
height: 200,
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
"@babel/core": "^7.20.12",
|
||||
"@babel/preset-env": "^7.20.2",
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"@rollup/plugin-json": "^6.0.0",
|
||||
"@types/glob": "^8.0.1",
|
||||
"@types/jest": "^29.4.0",
|
||||
"@types/koa-compose": "^3.2.5",
|
||||
|
|
@ -42,6 +43,7 @@
|
|||
"canvas": "^2.11.0",
|
||||
"chalk": "^5.2.0",
|
||||
"enquirer": "^2.3.6",
|
||||
"esbuild": "^0.17.7",
|
||||
"eslint": "^8.34.0",
|
||||
"execa": "^7.0.0",
|
||||
"fs-extra": "^11.1.0",
|
||||
|
|
@ -58,6 +60,9 @@
|
|||
"pixelmatch": "^5.3.0",
|
||||
"pngjs": "^6.0.0",
|
||||
"puppeteer": "^19.6.3",
|
||||
"rollup": "^3.15.0",
|
||||
"rollup-plugin-dts": "^5.1.1",
|
||||
"rollup-plugin-esbuild": "^5.0.0",
|
||||
"serve-handler": "^6.1.5",
|
||||
"terser": "^5.16.3",
|
||||
"ts-node": "^10.9.1",
|
||||
|
|
|
|||
322
pnpm-lock.yaml
322
pnpm-lock.yaml
|
|
@ -7,6 +7,7 @@ importers:
|
|||
'@babel/core': ^7.20.12
|
||||
'@babel/preset-env': ^7.20.2
|
||||
'@babel/preset-typescript': ^7.18.6
|
||||
'@rollup/plugin-json': ^6.0.0
|
||||
'@types/glob': ^8.0.1
|
||||
'@types/jest': ^29.4.0
|
||||
'@types/koa-compose': ^3.2.5
|
||||
|
|
@ -18,6 +19,7 @@ importers:
|
|||
canvas: ^2.11.0
|
||||
chalk: ^5.2.0
|
||||
enquirer: ^2.3.6
|
||||
esbuild: ^0.17.7
|
||||
eslint: ^8.34.0
|
||||
execa: ^7.0.0
|
||||
fs-extra: ^11.1.0
|
||||
|
|
@ -34,6 +36,9 @@ importers:
|
|||
pixelmatch: ^5.3.0
|
||||
pngjs: ^6.0.0
|
||||
puppeteer: ^19.6.3
|
||||
rollup: ^3.15.0
|
||||
rollup-plugin-dts: ^5.1.1
|
||||
rollup-plugin-esbuild: ^5.0.0
|
||||
serve-handler: ^6.1.5
|
||||
terser: ^5.16.3
|
||||
ts-node: ^10.9.1
|
||||
|
|
@ -45,6 +50,7 @@ importers:
|
|||
'@babel/core': 7.20.12
|
||||
'@babel/preset-env': 7.20.2_@babel+core@7.20.12
|
||||
'@babel/preset-typescript': 7.18.6_@babel+core@7.20.12
|
||||
'@rollup/plugin-json': 6.0.0_rollup@3.15.0
|
||||
'@types/glob': 8.0.1
|
||||
'@types/jest': 29.4.0
|
||||
'@types/koa-compose': 3.2.5
|
||||
|
|
@ -56,6 +62,7 @@ importers:
|
|||
canvas: 2.11.0
|
||||
chalk: 5.2.0
|
||||
enquirer: 2.3.6
|
||||
esbuild: 0.17.7
|
||||
eslint: 8.34.0
|
||||
execa: 7.0.0
|
||||
fs-extra: 11.1.0
|
||||
|
|
@ -72,6 +79,9 @@ importers:
|
|||
pixelmatch: 5.3.0
|
||||
pngjs: 6.0.0
|
||||
puppeteer: 19.6.3
|
||||
rollup: 3.15.0
|
||||
rollup-plugin-dts: 5.1.1_xswiuafr57fmdlvfpvse52fe3e
|
||||
rollup-plugin-esbuild: 5.0.0_ng6qpltu576sqj6vki5d4vzknu
|
||||
serve-handler: 6.1.5
|
||||
terser: 5.16.3
|
||||
ts-node: 10.9.1_4bewfcp2iebiwuold25d6rgcsy
|
||||
|
|
@ -1375,6 +1385,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-arm/0.17.7:
|
||||
resolution: {integrity: sha512-Np6Lg8VUiuzHP5XvHU7zfSVPN4ILdiOhxA1GQ1uvCK2T2l3nI8igQV0c9FJx4hTkq8WGqhGEvn5UuRH8jMkExg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-arm64/0.16.17:
|
||||
resolution: {integrity: sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1384,6 +1403,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-arm64/0.17.7:
|
||||
resolution: {integrity: sha512-fOUBZvcbtbQJIj2K/LMKcjULGfXLV9R4qjXFsi3UuqFhIRJHz0Fp6kFjsMFI6vLuPrfC5G9Dmh+3RZOrSKY2Lg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-x64/0.16.17:
|
||||
resolution: {integrity: sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1393,6 +1421,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-x64/0.17.7:
|
||||
resolution: {integrity: sha512-6YILpPvop1rPAvaO/n2iWQL45RyTVTR/1SK7P6Xi2fyu+hpEeX22fE2U2oJd1sfpovUJOWTRdugjddX6QCup3A==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/darwin-arm64/0.16.17:
|
||||
resolution: {integrity: sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1402,6 +1439,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/darwin-arm64/0.17.7:
|
||||
resolution: {integrity: sha512-7i0gfFsDt1BBiurZz5oZIpzfxqy5QkJmhXdtrf2Hma/gI9vL2AqxHhRBoI1NeWc9IhN1qOzWZrslhiXZweMSFg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/darwin-x64/0.16.17:
|
||||
resolution: {integrity: sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1411,6 +1457,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/darwin-x64/0.17.7:
|
||||
resolution: {integrity: sha512-hRvIu3vuVIcv4SJXEKOHVsNssM5tLE2xWdb9ZyJqsgYp+onRa5El3VJ4+WjTbkf/A2FD5wuMIbO2FCTV39LE0w==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/freebsd-arm64/0.16.17:
|
||||
resolution: {integrity: sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1420,6 +1475,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/freebsd-arm64/0.17.7:
|
||||
resolution: {integrity: sha512-2NJjeQ9kiabJkVXLM3sHkySqkL1KY8BeyLams3ITyiLW10IwDL0msU5Lq1cULCn9zNxt1Seh1I6QrqyHUvOtQw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/freebsd-x64/0.16.17:
|
||||
resolution: {integrity: sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1429,6 +1493,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/freebsd-x64/0.17.7:
|
||||
resolution: {integrity: sha512-8kSxlbjuLYMoIgvRxPybirHJeW45dflyIgHVs+jzMYJf87QOay1ZUTzKjNL3vqHQjmkSn8p6KDfHVrztn7Rprw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-arm/0.16.17:
|
||||
resolution: {integrity: sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1438,6 +1511,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-arm/0.17.7:
|
||||
resolution: {integrity: sha512-07RsAAzznWqdfJC+h3L2UVWwnUHepsFw5GmzySnUspHHb7glJ1+47rvlcH0SeUtoVOs8hF4/THgZbtJRyALaJA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-arm64/0.16.17:
|
||||
resolution: {integrity: sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1447,6 +1529,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-arm64/0.17.7:
|
||||
resolution: {integrity: sha512-43Bbhq3Ia/mGFTCRA4NlY8VRH3dLQltJ4cqzhSfq+cdvdm9nKJXVh4NUkJvdZgEZIkf/ufeMmJ0/22v9btXTcw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-ia32/0.16.17:
|
||||
resolution: {integrity: sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1456,6 +1547,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-ia32/0.17.7:
|
||||
resolution: {integrity: sha512-ViYkfcfnbwOoTS7xE4DvYFv7QOlW8kPBuccc4erJ0jx2mXDPR7e0lYOH9JelotS9qe8uJ0s2i3UjUvjunEp53A==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-loong64/0.16.17:
|
||||
resolution: {integrity: sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1465,6 +1565,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-loong64/0.17.7:
|
||||
resolution: {integrity: sha512-H1g+AwwcqYQ/Hl/sMcopRcNLY/fysIb/ksDfCa3/kOaHQNhBrLeDYw+88VAFV5U6oJL9GqnmUj72m9Nv3th3hA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-mips64el/0.16.17:
|
||||
resolution: {integrity: sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1474,6 +1583,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-mips64el/0.17.7:
|
||||
resolution: {integrity: sha512-MDLGrVbTGYtmldlbcxfeDPdhxttUmWoX3ovk9u6jc8iM+ueBAFlaXKuUMCoyP/zfOJb+KElB61eSdBPSvNcCEg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [mips64el]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-ppc64/0.16.17:
|
||||
resolution: {integrity: sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1483,6 +1601,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-ppc64/0.17.7:
|
||||
resolution: {integrity: sha512-UWtLhRPKzI+v2bKk4j9rBpGyXbLAXLCOeqt1tLVAt1mfagHpFjUzzIHCpPiUfY3x1xY5e45/+BWzGpqqvSglNw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-riscv64/0.16.17:
|
||||
resolution: {integrity: sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1492,6 +1619,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-riscv64/0.17.7:
|
||||
resolution: {integrity: sha512-3C/RTKqZauUwBYtIQAv7ELTJd+H2dNKPyzwE2ZTbz2RNrNhNHRoeKnG5C++eM6nSZWUCLyyaWfq1v1YRwBS/+A==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-s390x/0.16.17:
|
||||
resolution: {integrity: sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1501,6 +1637,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-s390x/0.17.7:
|
||||
resolution: {integrity: sha512-x7cuRSCm998KFZqGEtSo8rI5hXLxWji4znZkBhg2FPF8A8lxLLCsSXe2P5utf0RBQflb3K97dkEH/BJwTqrbDw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-x64/0.16.17:
|
||||
resolution: {integrity: sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1510,6 +1655,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-x64/0.17.7:
|
||||
resolution: {integrity: sha512-1Z2BtWgM0Wc92WWiZR5kZ5eC+IetI++X+nf9NMbUvVymt74fnQqwgM5btlTW7P5uCHfq03u5MWHjIZa4o+TnXQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/netbsd-x64/0.16.17:
|
||||
resolution: {integrity: sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1519,6 +1673,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/netbsd-x64/0.17.7:
|
||||
resolution: {integrity: sha512-//VShPN4hgbmkDjYNCZermIhj8ORqoPNmAnwSPqPtBB0xOpHrXMlJhsqLNsgoBm0zi/5tmy//WyL6g81Uq2c6Q==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/openbsd-x64/0.16.17:
|
||||
resolution: {integrity: sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1528,6 +1691,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/openbsd-x64/0.17.7:
|
||||
resolution: {integrity: sha512-IQ8BliXHiOsbQEOHzc7mVLIw2UYPpbOXJQ9cK1nClNYQjZthvfiA6rWZMz4BZpVzHZJ+/H2H23cZwRJ1NPYOGg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [openbsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/sunos-x64/0.16.17:
|
||||
resolution: {integrity: sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1537,6 +1709,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/sunos-x64/0.17.7:
|
||||
resolution: {integrity: sha512-phO5HvU3SyURmcW6dfQXX4UEkFREUwaoiTgi1xH+CAFKPGsrcG6oDp1U70yQf5lxRKujoSCEIoBr0uFykJzN2g==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-arm64/0.16.17:
|
||||
resolution: {integrity: sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1546,6 +1727,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-arm64/0.17.7:
|
||||
resolution: {integrity: sha512-G/cRKlYrwp1B0uvzEdnFPJ3A6zSWjnsRrWivsEW0IEHZk+czv0Bmiwa51RncruHLjQ4fGsvlYPmCmwzmutPzHA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-ia32/0.16.17:
|
||||
resolution: {integrity: sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1555,6 +1745,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-ia32/0.17.7:
|
||||
resolution: {integrity: sha512-/yMNVlMew07NrOflJdRAZcMdUoYTOCPbCHx0eHtg55l87wXeuhvYOPBQy5HLX31Ku+W2XsBD5HnjUjEUsTXJug==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-x64/0.16.17:
|
||||
resolution: {integrity: sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -1564,6 +1763,15 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-x64/0.17.7:
|
||||
resolution: {integrity: sha512-K9/YybM6WZO71x73Iyab6mwieHtHjm9hrPR/a9FBPZmFO3w+fJaM2uu2rt3JYf/rZR24MFwTliI8VSoKKOtYtg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@eslint/eslintrc/1.4.1:
|
||||
resolution: {integrity: sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
|
|
@ -3341,6 +3549,34 @@ packages:
|
|||
typescript: 4.9.5
|
||||
dev: true
|
||||
|
||||
/@rollup/plugin-json/6.0.0_rollup@3.15.0:
|
||||
resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
peerDependencies:
|
||||
rollup: ^1.20.0||^2.0.0||^3.0.0
|
||||
peerDependenciesMeta:
|
||||
rollup:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@rollup/pluginutils': 5.0.2_rollup@3.15.0
|
||||
rollup: 3.15.0
|
||||
dev: true
|
||||
|
||||
/@rollup/pluginutils/5.0.2_rollup@3.15.0:
|
||||
resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
peerDependencies:
|
||||
rollup: ^1.20.0||^2.0.0||^3.0.0
|
||||
peerDependenciesMeta:
|
||||
rollup:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@types/estree': 1.0.0
|
||||
estree-walker: 2.0.2
|
||||
picomatch: 2.3.1
|
||||
rollup: 3.15.0
|
||||
dev: true
|
||||
|
||||
/@sinclair/typebox/0.24.51:
|
||||
resolution: {integrity: sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==}
|
||||
dev: true
|
||||
|
|
@ -3447,6 +3683,10 @@ packages:
|
|||
'@types/node': 18.13.0
|
||||
dev: true
|
||||
|
||||
/@types/estree/1.0.0:
|
||||
resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==}
|
||||
dev: true
|
||||
|
||||
/@types/express-serve-static-core/4.17.33:
|
||||
resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==}
|
||||
dependencies:
|
||||
|
|
@ -5027,6 +5267,10 @@ packages:
|
|||
is-arrayish: 0.2.1
|
||||
dev: true
|
||||
|
||||
/es-module-lexer/1.1.1:
|
||||
resolution: {integrity: sha512-n3ruqU8Te7I5prBd6d0darM8ajFuVNhLWvgo04hN7goWSaSrxe7ENOZitac7akN0A2o+8fMomBDsNPvW/eE3CQ==}
|
||||
dev: true
|
||||
|
||||
/esbuild/0.16.17:
|
||||
resolution: {integrity: sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -5057,6 +5301,36 @@ packages:
|
|||
'@esbuild/win32-x64': 0.16.17
|
||||
dev: true
|
||||
|
||||
/esbuild/0.17.7:
|
||||
resolution: {integrity: sha512-+5hHlrK108fT6C6/40juy0w4DYKtyZ5NjfBlTccBdsFutR7WBxpIY633JzZJewdsCy8xWA/u2z0MSniIJwufYg==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
optionalDependencies:
|
||||
'@esbuild/android-arm': 0.17.7
|
||||
'@esbuild/android-arm64': 0.17.7
|
||||
'@esbuild/android-x64': 0.17.7
|
||||
'@esbuild/darwin-arm64': 0.17.7
|
||||
'@esbuild/darwin-x64': 0.17.7
|
||||
'@esbuild/freebsd-arm64': 0.17.7
|
||||
'@esbuild/freebsd-x64': 0.17.7
|
||||
'@esbuild/linux-arm': 0.17.7
|
||||
'@esbuild/linux-arm64': 0.17.7
|
||||
'@esbuild/linux-ia32': 0.17.7
|
||||
'@esbuild/linux-loong64': 0.17.7
|
||||
'@esbuild/linux-mips64el': 0.17.7
|
||||
'@esbuild/linux-ppc64': 0.17.7
|
||||
'@esbuild/linux-riscv64': 0.17.7
|
||||
'@esbuild/linux-s390x': 0.17.7
|
||||
'@esbuild/linux-x64': 0.17.7
|
||||
'@esbuild/netbsd-x64': 0.17.7
|
||||
'@esbuild/openbsd-x64': 0.17.7
|
||||
'@esbuild/sunos-x64': 0.17.7
|
||||
'@esbuild/win32-arm64': 0.17.7
|
||||
'@esbuild/win32-ia32': 0.17.7
|
||||
'@esbuild/win32-x64': 0.17.7
|
||||
dev: true
|
||||
|
||||
/escalade/3.1.1:
|
||||
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
|
||||
engines: {node: '>=6'}
|
||||
|
|
@ -5213,6 +5487,10 @@ packages:
|
|||
engines: {node: '>=4.0'}
|
||||
dev: true
|
||||
|
||||
/estree-walker/2.0.2:
|
||||
resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
|
||||
dev: true
|
||||
|
||||
/esutils/2.0.3:
|
||||
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
|
@ -6761,6 +7039,11 @@ packages:
|
|||
- encoding
|
||||
dev: true
|
||||
|
||||
/joycon/3.1.1:
|
||||
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
/jpeg-js/0.4.4:
|
||||
resolution: {integrity: sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==}
|
||||
dev: true
|
||||
|
|
@ -7105,6 +7388,13 @@ packages:
|
|||
engines: {node: '>=12'}
|
||||
dev: true
|
||||
|
||||
/magic-string/0.27.0:
|
||||
resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==}
|
||||
engines: {node: '>=12'}
|
||||
dependencies:
|
||||
'@jridgewell/sourcemap-codec': 1.4.14
|
||||
dev: true
|
||||
|
||||
/make-dir/2.1.0:
|
||||
resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==}
|
||||
engines: {node: '>=6'}
|
||||
|
|
@ -8650,6 +8940,38 @@ packages:
|
|||
glob: 7.2.3
|
||||
dev: true
|
||||
|
||||
/rollup-plugin-dts/5.1.1_xswiuafr57fmdlvfpvse52fe3e:
|
||||
resolution: {integrity: sha512-zpgo52XmnLg8w4k3MScinFHZK1+ro6r7uVe34fJ0Ee8AM45FvgvTuvfWWaRgIpA4pQ1BHJuu2ospncZhkcJVeA==}
|
||||
engines: {node: '>=v14'}
|
||||
peerDependencies:
|
||||
rollup: ^3.0.0
|
||||
typescript: ^4.1
|
||||
dependencies:
|
||||
magic-string: 0.27.0
|
||||
rollup: 3.15.0
|
||||
typescript: 4.9.5
|
||||
optionalDependencies:
|
||||
'@babel/code-frame': 7.18.6
|
||||
dev: true
|
||||
|
||||
/rollup-plugin-esbuild/5.0.0_ng6qpltu576sqj6vki5d4vzknu:
|
||||
resolution: {integrity: sha512-1cRIOHAPh8WQgdQQyyvFdeOdxuiyk+zB5zJ5+YOwrZP4cJ0MT3Fs48pQxrZeyZHcn+klFherytILVfE4aYrneg==}
|
||||
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
|
||||
peerDependencies:
|
||||
esbuild: '>=0.10.1'
|
||||
rollup: ^1.20.0 || ^2.0.0 || ^3.0.0
|
||||
dependencies:
|
||||
'@rollup/pluginutils': 5.0.2_rollup@3.15.0
|
||||
debug: 4.3.4
|
||||
es-module-lexer: 1.1.1
|
||||
esbuild: 0.17.7
|
||||
joycon: 3.1.1
|
||||
jsonc-parser: 3.2.0
|
||||
rollup: 3.15.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/rollup/3.15.0:
|
||||
resolution: {integrity: sha512-F9hrCAhnp5/zx/7HYmftvsNBkMfLfk/dXUh73hPSM2E3CRgap65orDNJbLetoiUFwSAk6iHPLvBrZ5iHYvzqsg==}
|
||||
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
|
||||
|
|
|
|||
71
scripts/rollup.config.js
Normal file
71
scripts/rollup.config.js
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
import { fileURLToPath } from 'node:url';
|
||||
import path from 'node:path';
|
||||
import esbuild from 'rollup-plugin-esbuild';
|
||||
import json from '@rollup/plugin-json';
|
||||
import dts from 'rollup-plugin-dts';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const rootDir = path.join(__dirname, '..');
|
||||
|
||||
const packages = [
|
||||
{
|
||||
dirName: 'util',
|
||||
globalName: 'iDrawUtil'
|
||||
},
|
||||
{
|
||||
dirName: 'board',
|
||||
globalName: 'iDrawBoard'
|
||||
},
|
||||
{
|
||||
dirName: 'renderer',
|
||||
globalName: 'iDrawRenderer'
|
||||
},
|
||||
{
|
||||
dirName: 'core',
|
||||
globalName: 'iDrawCore'
|
||||
},
|
||||
{
|
||||
dirName: 'idraw',
|
||||
globalName: 'iDraw'
|
||||
}
|
||||
];
|
||||
|
||||
const getPath = (...args) => {
|
||||
return path.join(rootDir, ...args);
|
||||
};
|
||||
|
||||
export default [
|
||||
...packages.map((pkg) => {
|
||||
return {
|
||||
input: getPath('packages', pkg.dirName, 'src', 'index.ts'),
|
||||
output: {
|
||||
format: 'iife',
|
||||
name: pkg.globalName,
|
||||
file: getPath('packages', pkg.dirName, 'dist', 'index.global.js'),
|
||||
exports: 'named'
|
||||
},
|
||||
plugins: [
|
||||
esbuild({
|
||||
target: 'es2015'
|
||||
}),
|
||||
json()
|
||||
],
|
||||
external: [],
|
||||
treeshake: false
|
||||
};
|
||||
}),
|
||||
...packages.map((pkg) => {
|
||||
return {
|
||||
input: getPath('packages', pkg.dirName, 'src', 'index.ts'),
|
||||
output: {
|
||||
file: getPath('packages', pkg.dirName, 'dist', 'index.global.d.js'),
|
||||
format: 'es'
|
||||
},
|
||||
plugins: [dts()],
|
||||
external: [],
|
||||
treeshake: false
|
||||
};
|
||||
})
|
||||
];
|
||||
Loading…
Reference in a new issue