canvasengine 2.0.1-beta.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DebugRenderer-DkjTAc48.js +1384 -0
- package/dist/DebugRenderer-DkjTAc48.js.map +1 -0
- package/dist/components/Button.d.ts +185 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Canvas.d.ts +17 -0
- package/dist/components/Canvas.d.ts.map +1 -0
- package/dist/components/Container.d.ts +25 -0
- package/dist/components/Container.d.ts.map +1 -0
- package/dist/components/DOMContainer.d.ts +28 -0
- package/dist/components/DOMContainer.d.ts.map +1 -0
- package/dist/components/DOMElement.d.ts +54 -0
- package/dist/components/DOMElement.d.ts.map +1 -0
- package/dist/components/DOMSprite.d.ts +127 -0
- package/dist/components/DOMSprite.d.ts.map +1 -0
- package/dist/components/DisplayObject.d.ts +18 -0
- package/dist/components/DisplayObject.d.ts.map +1 -0
- package/dist/components/FocusContainer.d.ts +129 -0
- package/dist/components/FocusContainer.d.ts.map +1 -0
- package/dist/components/Graphic.d.ts +64 -0
- package/dist/components/Graphic.d.ts.map +1 -0
- package/dist/components/Joystick.d.ts +37 -0
- package/dist/components/Joystick.d.ts.map +1 -0
- package/dist/components/Mesh.d.ts +138 -0
- package/dist/components/Mesh.d.ts.map +1 -0
- package/dist/components/NineSliceSprite.d.ts +16 -0
- package/dist/components/NineSliceSprite.d.ts.map +1 -0
- package/dist/components/ParticleEmitter.d.ts +4 -0
- package/dist/components/ParticleEmitter.d.ts.map +1 -0
- package/dist/components/Scene.d.ts +2 -0
- package/dist/components/Scene.d.ts.map +1 -0
- package/dist/components/Sprite.d.ts +182 -0
- package/dist/components/Sprite.d.ts.map +1 -0
- package/dist/components/Text.d.ts +24 -0
- package/dist/components/Text.d.ts.map +1 -0
- package/dist/components/TilingSprite.d.ts +17 -0
- package/dist/components/TilingSprite.d.ts.map +1 -0
- package/dist/components/Video.d.ts +14 -0
- package/dist/components/Video.d.ts.map +1 -0
- package/dist/components/Viewport.d.ts +52 -0
- package/dist/components/Viewport.d.ts.map +1 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/types/DisplayObject.d.ts +127 -0
- package/dist/components/types/DisplayObject.d.ts.map +1 -0
- package/dist/components/types/MouseEvent.d.ts +4 -0
- package/dist/components/types/MouseEvent.d.ts.map +1 -0
- package/dist/components/types/Spritesheet.d.ts +248 -0
- package/dist/components/types/Spritesheet.d.ts.map +1 -0
- package/dist/components/types/index.d.ts +4 -0
- package/dist/components/types/index.d.ts.map +1 -0
- package/dist/directives/Controls.d.ts +112 -0
- package/dist/directives/Controls.d.ts.map +1 -0
- package/dist/directives/ControlsBase.d.ts +199 -0
- package/dist/directives/ControlsBase.d.ts.map +1 -0
- package/dist/directives/Drag.d.ts +69 -0
- package/dist/directives/Drag.d.ts.map +1 -0
- package/dist/directives/Flash.d.ts +116 -0
- package/dist/directives/Flash.d.ts.map +1 -0
- package/dist/directives/FocusNavigation.d.ts +52 -0
- package/dist/directives/FocusNavigation.d.ts.map +1 -0
- package/dist/directives/FogVisibility.d.ts +47 -0
- package/dist/directives/FogVisibility.d.ts.map +1 -0
- package/dist/directives/GamepadControls.d.ts +224 -0
- package/dist/directives/GamepadControls.d.ts.map +1 -0
- package/dist/directives/JoystickControls.d.ts +171 -0
- package/dist/directives/JoystickControls.d.ts.map +1 -0
- package/dist/directives/KeyboardControls.d.ts +219 -0
- package/dist/directives/KeyboardControls.d.ts.map +1 -0
- package/dist/directives/Scheduler.d.ts +36 -0
- package/dist/directives/Scheduler.d.ts.map +1 -0
- package/dist/directives/Shake.d.ts +98 -0
- package/dist/directives/Shake.d.ts.map +1 -0
- package/dist/directives/Sound.d.ts +25 -0
- package/dist/directives/Sound.d.ts.map +1 -0
- package/dist/directives/SpriteEffects.d.ts +70 -0
- package/dist/directives/SpriteEffects.d.ts.map +1 -0
- package/dist/directives/Transition.d.ts +10 -0
- package/dist/directives/Transition.d.ts.map +1 -0
- package/dist/directives/ViewportCull.d.ts +11 -0
- package/dist/directives/ViewportCull.d.ts.map +1 -0
- package/dist/directives/ViewportFollow.d.ts +18 -0
- package/dist/directives/ViewportFollow.d.ts.map +1 -0
- package/dist/directives/index.d.ts +15 -0
- package/dist/directives/index.d.ts.map +1 -0
- package/dist/dist-BOOc43Qm.js +778 -0
- package/dist/dist-BOOc43Qm.js.map +1 -0
- package/dist/engine/FocusManager.d.ts +174 -0
- package/dist/engine/FocusManager.d.ts.map +1 -0
- package/dist/engine/animation.d.ts +72 -0
- package/dist/engine/animation.d.ts.map +1 -0
- package/dist/engine/bootstrap.d.ts +52 -0
- package/dist/engine/bootstrap.d.ts.map +1 -0
- package/dist/engine/directive.d.ts +13 -0
- package/dist/engine/directive.d.ts.map +1 -0
- package/dist/engine/reactive.d.ts +139 -0
- package/dist/engine/reactive.d.ts.map +1 -0
- package/dist/engine/signal.d.ts +74 -0
- package/dist/engine/signal.d.ts.map +1 -0
- package/dist/engine/trigger.d.ts +54 -0
- package/dist/engine/trigger.d.ts.map +1 -0
- package/dist/engine/utils.d.ts +89 -0
- package/dist/engine/utils.d.ts.map +1 -0
- package/dist/hooks/addContext.d.ts +2 -0
- package/dist/hooks/addContext.d.ts.map +1 -0
- package/dist/hooks/useFocus.d.ts +60 -0
- package/dist/hooks/useFocus.d.ts.map +1 -0
- package/dist/hooks/useProps.d.ts +53 -0
- package/dist/hooks/useProps.d.ts.map +1 -0
- package/dist/hooks/useRef.d.ts +4 -0
- package/dist/hooks/useRef.d.ts.map +1 -0
- package/dist/index.d.ts +19 -844
- package/dist/index.d.ts.map +1 -0
- package/dist/index.global.js +189 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +15156 -3287
- package/dist/index.js.map +1 -1
- package/dist/utils/Ease.d.ts +17 -0
- package/dist/utils/Ease.d.ts.map +1 -0
- package/dist/utils/GlobalAssetLoader.d.ts +141 -0
- package/dist/utils/GlobalAssetLoader.d.ts.map +1 -0
- package/dist/utils/RadialGradient.d.ts +57 -0
- package/dist/utils/RadialGradient.d.ts.map +1 -0
- package/dist/utils/functions.d.ts +2 -0
- package/dist/utils/functions.d.ts.map +1 -0
- package/dist/utils/tabindex.d.ts +16 -0
- package/dist/utils/tabindex.d.ts.map +1 -0
- package/index.d.ts +1 -3
- package/package.json +19 -52
- package/src/components/Button.ts +406 -0
- package/src/components/Canvas.ts +82 -51
- package/src/components/Container.ts +31 -4
- package/src/components/DOMContainer.ts +387 -0
- package/src/components/DOMElement.ts +556 -0
- package/src/components/DOMSprite.ts +1044 -0
- package/src/components/DisplayObject.ts +423 -202
- package/src/components/FocusContainer.ts +368 -0
- package/src/components/Graphic.ts +255 -68
- package/src/components/Joystick.ts +269 -0
- package/src/components/Mesh.ts +239 -0
- package/src/components/NineSliceSprite.ts +4 -1
- package/src/components/ParticleEmitter.ts +12 -8
- package/src/components/Sprite.ts +441 -54
- package/src/components/Text.ts +270 -26
- package/src/components/Video.ts +110 -0
- package/src/components/Viewport.ts +122 -63
- package/src/components/index.ts +12 -5
- package/src/components/types/DisplayObject.ts +64 -5
- package/src/components/types/Spritesheet.ts +0 -118
- package/src/directives/Controls.ts +254 -0
- package/src/directives/ControlsBase.ts +267 -0
- package/src/directives/Drag.ts +357 -52
- package/src/directives/Flash.ts +419 -0
- package/src/directives/FocusNavigation.ts +113 -0
- package/src/directives/FogVisibility.ts +273 -0
- package/src/directives/GamepadControls.ts +537 -0
- package/src/directives/JoystickControls.ts +396 -0
- package/src/directives/KeyboardControls.ts +86 -431
- package/src/directives/Scheduler.ts +21 -16
- package/src/directives/Shake.ts +298 -0
- package/src/directives/Sound.ts +94 -31
- package/src/directives/SpriteEffects.ts +461 -0
- package/src/directives/ViewportFollow.ts +40 -9
- package/src/directives/index.ts +14 -6
- package/src/engine/FocusManager.ts +510 -0
- package/src/engine/animation.ts +175 -21
- package/src/engine/bootstrap.ts +140 -6
- package/src/engine/directive.ts +4 -4
- package/src/engine/reactive.ts +1266 -167
- package/src/engine/signal.ts +335 -47
- package/src/engine/trigger.ts +95 -12
- package/src/engine/utils.ts +101 -9
- package/src/hooks/useFocus.ts +91 -0
- package/src/hooks/useProps.ts +92 -7
- package/src/index.ts +13 -6
- package/src/types/pixi-cull.d.ts +7 -0
- package/src/utils/GlobalAssetLoader.ts +257 -0
- package/src/utils/RadialGradient.ts +29 -0
- package/src/utils/functions.ts +7 -0
- package/src/utils/tabindex.ts +70 -0
- package/testing/index.ts +42 -0
- package/tsconfig.json +15 -25
- package/vite.config.ts +39 -0
- package/.cursorrules +0 -0
- package/.github/workflows/ci.yml +0 -29
- package/README.md +0 -79
- package/dist/compiler/vite.js +0 -119
- package/dist/compiler/vite.js.map +0 -1
- package/logo.png +0 -0
- package/src/compiler/grammar.pegjs +0 -180
- package/src/compiler/vite.ts +0 -166
- package/src/components/DrawMap/index.ts +0 -65
- package/src/components/Tilemap/Tile.ts +0 -79
- package/src/components/Tilemap/TileGroup.ts +0 -207
- package/src/components/Tilemap/TileLayer.ts +0 -163
- package/src/components/Tilemap/TileSet.ts +0 -41
- package/src/components/Tilemap/index.ts +0 -80
- package/src/presets/Bar.ts +0 -89
- package/src/presets/Button.ts +0 -0
- package/src/presets/Joystick.ts +0 -286
- package/src/presets/NightAmbiant.ts +0 -122
- package/src/presets/Particle.ts +0 -53
- package/starter/assets/logo.png +0 -0
- package/starter/components/app.ce +0 -18
- package/starter/components/hello.ce +0 -35
- package/starter/index.html +0 -21
- package/starter/main.ts +0 -6
- package/starter/package.json +0 -20
- package/starter/tsconfig.json +0 -32
- package/starter/vite.config.ts +0 -12
- package/tsconfig.node.json +0 -10
- package/tsup.config.ts +0 -28
- package/vitest.config.ts +0 -12
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { Container, Graphics } from "../components";
|
|
2
|
-
import { h, mount } from "../engine/signal";
|
|
3
|
-
import { animatedSignal } from "../engine/animation";
|
|
4
|
-
import { RadialGradient } from "../utils/RadialGradient";
|
|
5
|
-
import { effect, isSignal, signal } from "@signe/reactive";
|
|
6
|
-
import { useProps } from "../hooks/useProps";
|
|
7
|
-
import { isObservable } from "rxjs";
|
|
8
|
-
|
|
9
|
-
export function LightSpot(opts) {
|
|
10
|
-
const { radius } = useProps(opts);
|
|
11
|
-
const scale = animatedSignal(1);
|
|
12
|
-
|
|
13
|
-
const minScale = 1;
|
|
14
|
-
const maxScale = 2; // Reduced max scale for subtler effect
|
|
15
|
-
const scintillationSpeed = 0.001; // Significantly reduced for slower scintillation
|
|
16
|
-
|
|
17
|
-
const animate = () => {
|
|
18
|
-
// Use time-based animation for smoother, slower scintillation
|
|
19
|
-
const time = Date.now() * scintillationSpeed;
|
|
20
|
-
|
|
21
|
-
// Combine multiple sine waves for a more natural, less predictable effect
|
|
22
|
-
const scintillationFactor =
|
|
23
|
-
(Math.sin(time) + Math.sin(time * 1.3) + Math.sin(time * 0.7)) / 3;
|
|
24
|
-
|
|
25
|
-
// Map the scintillation factor to the scale range
|
|
26
|
-
const newScale =
|
|
27
|
-
minScale + (maxScale - minScale) * (scintillationFactor * 0.5 + 0.5);
|
|
28
|
-
|
|
29
|
-
scale.update(() => newScale);
|
|
30
|
-
|
|
31
|
-
requestAnimationFrame(animate);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
animate();
|
|
35
|
-
|
|
36
|
-
const draw = (g) => {
|
|
37
|
-
const size = radius() * 2;
|
|
38
|
-
const gradient = new RadialGradient(size, size, 0, size, size, 0);
|
|
39
|
-
gradient.addColorStop(0, "rgba(255, 255, 0, 1)");
|
|
40
|
-
gradient.addColorStop(0.5, "rgba(255, 255, 0, 0.3)");
|
|
41
|
-
gradient.addColorStop(0.8, "rgba(255, 255, 0, 0)");
|
|
42
|
-
|
|
43
|
-
const translate = size / 2;
|
|
44
|
-
|
|
45
|
-
g.rect(-translate, -translate, size, size).fill(
|
|
46
|
-
gradient.render({ translate: { x: translate, y: translate } })
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
return h(Graphics, {
|
|
51
|
-
draw,
|
|
52
|
-
...opts,
|
|
53
|
-
scale,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function NightAmbiant(props) {
|
|
58
|
-
const { children } = props;
|
|
59
|
-
let el
|
|
60
|
-
const width = signal(0);
|
|
61
|
-
const height = signal(0);
|
|
62
|
-
let subscription
|
|
63
|
-
const draw = (rectAndHole) => {
|
|
64
|
-
const margin = 80
|
|
65
|
-
rectAndHole.rect(-margin, -margin, width() + margin*2, height() + margin*2);
|
|
66
|
-
rectAndHole.fill(0x000000);
|
|
67
|
-
const applyChildren = (child) => {
|
|
68
|
-
const x = isSignal(child.propObservables.x)
|
|
69
|
-
? child.propObservables.x()
|
|
70
|
-
: child.props.x;
|
|
71
|
-
const y = isSignal(child.propObservables.y)
|
|
72
|
-
? child.propObservables.y()
|
|
73
|
-
: child.props.y;
|
|
74
|
-
const radius = isSignal(child.propObservables.radius)
|
|
75
|
-
? child.propObservables.radius()
|
|
76
|
-
: child.props.radius;
|
|
77
|
-
rectAndHole.circle(x, y, radius);
|
|
78
|
-
rectAndHole.cut();
|
|
79
|
-
}
|
|
80
|
-
for (let child of children) {
|
|
81
|
-
if (isObservable(child)) {
|
|
82
|
-
if (subscription) {
|
|
83
|
-
subscription.unsubscribe()
|
|
84
|
-
}
|
|
85
|
-
subscription = child.subscribe((event) => {
|
|
86
|
-
for (let child of event.fullElements) {
|
|
87
|
-
applyChildren(child)
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
return
|
|
91
|
-
}
|
|
92
|
-
applyChildren(child)
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
mount((el) => {
|
|
97
|
-
effect(() => {
|
|
98
|
-
const { displayWidth, displayHeight } = el.componentInstance
|
|
99
|
-
const w = +displayWidth()
|
|
100
|
-
const h = +displayHeight()
|
|
101
|
-
setTimeout(() => {
|
|
102
|
-
width.update(() => w)
|
|
103
|
-
height.update(() => h)
|
|
104
|
-
}, 0) // hack
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
return h(
|
|
109
|
-
Container,
|
|
110
|
-
{
|
|
111
|
-
width: "100%",
|
|
112
|
-
height: "100%",
|
|
113
|
-
...props,
|
|
114
|
-
},
|
|
115
|
-
h(Graphics, {
|
|
116
|
-
draw,
|
|
117
|
-
alpha: 0.8,
|
|
118
|
-
blur: 80,
|
|
119
|
-
}),
|
|
120
|
-
...children
|
|
121
|
-
);
|
|
122
|
-
}
|
package/src/presets/Particle.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as PIXI from "pixi.js";
|
|
2
|
-
import { FX } from "revolt-fx";
|
|
3
|
-
import { h, mount, tick } from "../engine/signal";
|
|
4
|
-
import { Container } from "../components";
|
|
5
|
-
import { on } from "../engine/trigger";
|
|
6
|
-
import { useProps } from "../hooks/useProps";
|
|
7
|
-
|
|
8
|
-
export function Particle(options) {
|
|
9
|
-
const { emit, settings = {} } = options;
|
|
10
|
-
const { name } = useProps(options);
|
|
11
|
-
const fx = new FX();
|
|
12
|
-
let element;
|
|
13
|
-
|
|
14
|
-
PIXI.Assets.add({ alias: "fx_settings", src: "/default-bundle.json" });
|
|
15
|
-
PIXI.Assets.add({
|
|
16
|
-
alias: "fx_spritesheet",
|
|
17
|
-
src: "/revoltfx-spritesheet.json",
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
tick(({deltaRatio}) => {
|
|
21
|
-
fx.update(deltaRatio);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
mount(async (_element) => {
|
|
25
|
-
element = _element;
|
|
26
|
-
|
|
27
|
-
const data = await PIXI.Assets.load(["fx_settings", "fx_spritesheet"]);
|
|
28
|
-
let fxSettings = {...data.fx_settings};
|
|
29
|
-
|
|
30
|
-
if (settings.emitters) {
|
|
31
|
-
const lastId = 10000;
|
|
32
|
-
const emittersWithIds = settings.emitters.map((emitter, index) => ({
|
|
33
|
-
...emitter,
|
|
34
|
-
id: lastId + index
|
|
35
|
-
}));
|
|
36
|
-
|
|
37
|
-
fxSettings.emitters = [
|
|
38
|
-
...fxSettings.emitters,
|
|
39
|
-
...emittersWithIds,
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
fx.initBundle(fxSettings, true);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
on(emit, () => {
|
|
48
|
-
const emitter = fx.getParticleEmitter(name());
|
|
49
|
-
emitter.init(element.componentInstance);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
return h(Container);
|
|
53
|
-
}
|
package/starter/assets/logo.png
DELETED
|
Binary file
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<Canvas
|
|
2
|
-
backgroundColor="#fff"
|
|
3
|
-
width="100%"
|
|
4
|
-
height="100%"
|
|
5
|
-
antialias="true"
|
|
6
|
-
>
|
|
7
|
-
<Container
|
|
8
|
-
width="100%"
|
|
9
|
-
height="100%"
|
|
10
|
-
justifyContent="center"
|
|
11
|
-
alignItems="center">
|
|
12
|
-
<HelloWorld text="CanvasEngine" />
|
|
13
|
-
</Container>
|
|
14
|
-
</Canvas>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import HelloWorld from "./hello.ce";
|
|
18
|
-
</script>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<Container flexDirection="column" width="500px">
|
|
2
|
-
<Sprite
|
|
3
|
-
image={imgUrl}
|
|
4
|
-
anchor="0.5"
|
|
5
|
-
rotation
|
|
6
|
-
scale
|
|
7
|
-
@pointerenter={onEnter}
|
|
8
|
-
@pointerleave={onLeave}
|
|
9
|
-
/>
|
|
10
|
-
<Text text size="70" fontFamily="Helvetica" x="90" y="-30" />
|
|
11
|
-
</Container>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
import imgUrl from '../assets/logo.png'
|
|
15
|
-
import { signal, tick, animatedSignal, Easing } from "canvasengine";
|
|
16
|
-
|
|
17
|
-
const { text } = defineProps();
|
|
18
|
-
const rotation = signal(0);
|
|
19
|
-
const scale = animatedSignal(1, {
|
|
20
|
-
duration: 300,
|
|
21
|
-
ease: Easing.easeInOut,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
tick(() => {
|
|
25
|
-
rotation.update(rotation => rotation + 0.01);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const onEnter = () => {
|
|
29
|
-
scale.set(1.5);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const onLeave = () => {
|
|
33
|
-
scale.set(1);
|
|
34
|
-
};
|
|
35
|
-
</script>
|
package/starter/index.html
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Canvas Engine</title>
|
|
7
|
-
<style>
|
|
8
|
-
body, html, #root {
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: 0;
|
|
11
|
-
height: 100vh;
|
|
12
|
-
width: 100vw;
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
}
|
|
15
|
-
</style>
|
|
16
|
-
</head>
|
|
17
|
-
<body>
|
|
18
|
-
<div id="root"></div>
|
|
19
|
-
<script type="module" src="/main.ts"></script>
|
|
20
|
-
</body>
|
|
21
|
-
</html>
|
package/starter/main.ts
DELETED
package/starter/package.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "canvasengine-starter",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "vite build"
|
|
9
|
-
},
|
|
10
|
-
"keywords": [],
|
|
11
|
-
"author": "",
|
|
12
|
-
"license": "ISC",
|
|
13
|
-
"type": "module",
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"canvasengine": "2.0.1-beta.1"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"vite": "^6.0.3"
|
|
19
|
-
}
|
|
20
|
-
}
|
package/starter/tsconfig.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2020",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"outDir": "dist",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"sourceMap": true,
|
|
8
|
-
"strictNullChecks": true,
|
|
9
|
-
"strictPropertyInitialization": false,
|
|
10
|
-
"moduleResolution": "node",
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"removeComments": false,
|
|
13
|
-
"noUnusedParameters": false,
|
|
14
|
-
"noUnusedLocals": false,
|
|
15
|
-
"noImplicitThis": false,
|
|
16
|
-
"noImplicitAny": false,
|
|
17
|
-
"noImplicitReturns": false,
|
|
18
|
-
"declaration": false,
|
|
19
|
-
"experimentalDecorators": true,
|
|
20
|
-
"emitDecoratorMetadata": true,
|
|
21
|
-
"types": [
|
|
22
|
-
"node",
|
|
23
|
-
"vite/client"
|
|
24
|
-
],
|
|
25
|
-
"resolveJsonModule": true
|
|
26
|
-
},
|
|
27
|
-
"include": [
|
|
28
|
-
".",
|
|
29
|
-
"index.d.ts",
|
|
30
|
-
"node_modules/canvasengine/index.d.ts"
|
|
31
|
-
]
|
|
32
|
-
}
|
package/starter/vite.config.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import vitePluginCe from 'canvasengine/compiler'
|
|
3
|
-
|
|
4
|
-
// https://vitejs.dev/config/
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
plugins: [vitePluginCe()],
|
|
7
|
-
resolve: {
|
|
8
|
-
alias: {
|
|
9
|
-
path: 'rollup-plugin-node-polyfills/polyfills/path',
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
});
|
package/tsconfig.node.json
DELETED
package/tsup.config.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
2
|
-
|
|
3
|
-
export default [
|
|
4
|
-
defineConfig({
|
|
5
|
-
format: ['esm'],
|
|
6
|
-
target: 'es2020',
|
|
7
|
-
splitting: true,
|
|
8
|
-
clean: true,
|
|
9
|
-
shims: false,
|
|
10
|
-
dts: true,
|
|
11
|
-
sourcemap: true,
|
|
12
|
-
entry: ['src/index.ts'],
|
|
13
|
-
outDir: 'dist'
|
|
14
|
-
}),
|
|
15
|
-
|
|
16
|
-
defineConfig({
|
|
17
|
-
format: ['esm'],
|
|
18
|
-
target: 'node20',
|
|
19
|
-
splitting: true,
|
|
20
|
-
clean: false,
|
|
21
|
-
shims: false,
|
|
22
|
-
dts: true,
|
|
23
|
-
sourcemap: true,
|
|
24
|
-
entry: ['src/compiler/vite.ts'],
|
|
25
|
-
outDir: 'dist/compiler',
|
|
26
|
-
external: ['vite', 'acorn', 'peggy', 'typescript'],
|
|
27
|
-
})
|
|
28
|
-
]
|
package/vitest.config.ts
DELETED