canvasengine 2.0.0-beta.1 → 2.0.1-beta.2
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/README.md +8 -0
- package/compiler/dist/index.d.ts +9 -0
- package/{dist/compiler/vite.js → compiler/dist/index.js} +4 -4
- package/compiler/dist/index.js.map +1 -0
- package/{src/compiler/vite.ts → compiler/index.ts} +3 -3
- package/compiler/package-lock.json +1850 -0
- package/compiler/package.json +27 -0
- package/compiler/tsconfig.json +29 -0
- package/compiler/tsup.config.ts +14 -0
- package/dist/index.js +0 -8
- package/dist/index.js.map +1 -1
- package/index.d.ts +6 -0
- package/package.json +14 -22
- package/src/directives/Scheduler.ts +0 -11
- package/tsconfig.json +2 -7
- package/tsup.config.ts +11 -26
- package/.cursorrules +0 -0
- package/dist/compiler/vite.js.map +0 -1
- package/logo.png +0 -0
- package/starter/assets/logo.png +0 -0
- package/starter/components/app.ce +0 -18
- package/starter/components/hello.ce +0 -34
- package/starter/index.html +0 -21
- package/starter/main.ts +0 -4
- package/starter/package.json +0 -16
- package/starter/vite.config.ts +0 -12
- /package/{src/compiler → compiler}/grammar.pegjs +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@canvasengine/compiler",
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsup",
|
|
9
|
+
"watch": "tsup --watch"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [],
|
|
16
|
+
"author": "Samuel Ronce",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"acorn": "^8.14.0",
|
|
20
|
+
"peggy": "^4.2.0",
|
|
21
|
+
"vite": "^6.0.3"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"tsup": "^8.3.5",
|
|
25
|
+
"typescript": "^5.7.2"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ES2020",
|
|
5
|
+
"outDir": "./dist",
|
|
6
|
+
"rootDir": ".",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"sourceMap": true,
|
|
9
|
+
"strictNullChecks": true,
|
|
10
|
+
"strictPropertyInitialization": false,
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"removeComments": false,
|
|
14
|
+
"noUnusedParameters": false,
|
|
15
|
+
"noUnusedLocals": false,
|
|
16
|
+
"noImplicitThis": false,
|
|
17
|
+
"noImplicitAny": false,
|
|
18
|
+
"noImplicitReturns": false,
|
|
19
|
+
"declaration": true,
|
|
20
|
+
"experimentalDecorators": true,
|
|
21
|
+
"emitDecoratorMetadata": true,
|
|
22
|
+
"stripInternal": true,
|
|
23
|
+
"skipLibCheck": true,
|
|
24
|
+
"types": ["node"]
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"."
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
format: ['esm'],
|
|
5
|
+
target: 'node20',
|
|
6
|
+
splitting: true,
|
|
7
|
+
clean: true,
|
|
8
|
+
shims: false,
|
|
9
|
+
dts: true,
|
|
10
|
+
sourcemap: true,
|
|
11
|
+
entry: ['index.ts'],
|
|
12
|
+
outDir: 'dist',
|
|
13
|
+
external: ['vite', 'acorn', 'peggy', 'typescript'],
|
|
14
|
+
})
|
package/dist/index.js
CHANGED
|
@@ -841,7 +841,6 @@ var KeyboardControls = class extends Directive {
|
|
|
841
841
|
registerDirective("controls", KeyboardControls);
|
|
842
842
|
|
|
843
843
|
// src/directives/Scheduler.ts
|
|
844
|
-
import Stats from "stats.js";
|
|
845
844
|
var Scheduler = class extends Directive {
|
|
846
845
|
constructor() {
|
|
847
846
|
super(...arguments);
|
|
@@ -852,7 +851,6 @@ var Scheduler = class extends Directive {
|
|
|
852
851
|
this.requestedDelay = 0;
|
|
853
852
|
this.lastTimestamp = 0;
|
|
854
853
|
this._stop = false;
|
|
855
|
-
this.stats = new Stats();
|
|
856
854
|
}
|
|
857
855
|
onInit(element) {
|
|
858
856
|
this.tick = element.propObservables?.tick;
|
|
@@ -867,20 +865,15 @@ var Scheduler = class extends Directive {
|
|
|
867
865
|
this.lastTimestamp = this.lastTimestamp || this.timestamp;
|
|
868
866
|
this.deltaTime = preciseNow() - this.timestamp;
|
|
869
867
|
this.timestamp = timestamp;
|
|
870
|
-
this.stats.begin();
|
|
871
868
|
this.tick.set({
|
|
872
869
|
timestamp: this.timestamp,
|
|
873
870
|
deltaTime: this.deltaTime,
|
|
874
871
|
frame: this.frame,
|
|
875
872
|
deltaRatio: ~~this.deltaTime / ~~fps2ms(this.fps)
|
|
876
873
|
});
|
|
877
|
-
this.stats.end();
|
|
878
874
|
this.lastTimestamp = this.timestamp;
|
|
879
875
|
this.frame++;
|
|
880
876
|
}
|
|
881
|
-
showPanel() {
|
|
882
|
-
this.stats.showPanel(0);
|
|
883
|
-
}
|
|
884
877
|
/**
|
|
885
878
|
* start the schedule
|
|
886
879
|
* @return {Scheduler} returns this scheduler instance
|
|
@@ -889,7 +882,6 @@ var Scheduler = class extends Directive {
|
|
|
889
882
|
if (options.maxFps) this.maxFps = options.maxFps;
|
|
890
883
|
if (options.fps) this.fps = options.fps;
|
|
891
884
|
if (options.delay) this.requestedDelay = options.delay;
|
|
892
|
-
this.showPanel();
|
|
893
885
|
const requestAnimationFrame = (fn) => {
|
|
894
886
|
if (isBrowser()) {
|
|
895
887
|
window.requestAnimationFrame(fn.bind(this));
|