@oidoid/void 0.1.0-6 → 0.1.0-8
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/package.json +10 -11
- package/dist/public/favicon/favicon16.webp +0 -0
- package/dist/public/favicon/favicon192.webp +0 -0
- package/dist/public/favicon/favicon32.webp +0 -0
- package/dist/public/favicon/favicon48.webp +0 -0
- package/dist/public/favicon/favicon64.webp +0 -0
- package/dist/public/index.js +12 -3758
- package/dist/public/index.js.map +4 -4
- package/dist/public/preload-atlas.webp +0 -0
- package/dist/public/void-v0.1.0-8+20251022.b364155.html +111 -0
- package/dist/schema/config-file.v0.json +1 -1
- package/dist/src/demo/assets/manifest.json +10 -15
- package/dist/src/demo/ents/clock-ent.d.ts +2 -1
- package/dist/src/demo/ents/clock-ent.js.map +1 -1
- package/dist/src/demo/ents/render-toggle-ent.d.ts +3 -1
- package/dist/src/demo/ents/render-toggle-ent.js +3 -0
- package/dist/src/demo/ents/render-toggle-ent.js.map +1 -1
- package/dist/src/demo/ents/work-counter-ent.d.ts +2 -2
- package/dist/src/demo/ents/work-counter-ent.js +1 -5
- package/dist/src/demo/ents/work-counter-ent.js.map +1 -1
- package/dist/src/demo/game.d.ts +1 -2
- package/dist/src/demo/game.js +14 -34
- package/dist/src/demo/game.js.map +1 -1
- package/dist/src/demo/void.json +1 -1
- package/dist/src/ents/button-ent.d.ts +2 -1
- package/dist/src/ents/button-ent.js +7 -3
- package/dist/src/ents/button-ent.js.map +1 -1
- package/dist/src/ents/cursor-ent.d.ts +2 -2
- package/dist/src/ents/cursor-ent.js +7 -2
- package/dist/src/ents/cursor-ent.js.map +1 -1
- package/dist/src/ents/ent.d.ts +3 -3
- package/dist/src/ents/follow-cam-ent.d.ts +1 -1
- package/dist/src/ents/nine-patch-ent.d.ts +1 -1
- package/dist/src/ents/text-ent.d.ts +1 -1
- package/dist/src/ents/zoo.d.ts +4 -3
- package/dist/src/ents/zoo.js +11 -4
- package/dist/src/ents/zoo.js.map +1 -1
- package/dist/src/graphics/cam.js +10 -1
- package/dist/src/graphics/cam.js.map +1 -1
- package/dist/src/graphics/renderer.d.ts +18 -4
- package/dist/src/graphics/renderer.js +20 -8
- package/dist/src/graphics/renderer.js.map +1 -1
- package/dist/src/graphics/sprite.d.ts +1 -1
- package/dist/src/graphics/sprite.js +4 -4
- package/dist/src/graphics/sprite.js.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/looper.d.ts +5 -3
- package/dist/src/looper.js +7 -4
- package/dist/src/looper.js.map +1 -1
- package/dist/src/types/void-version.d.ts +0 -2
- package/dist/src/types/void-version.js.map +1 -1
- package/dist/src/utils/canvas-util.js +2 -2
- package/dist/src/utils/canvas-util.js.map +1 -1
- package/dist/src/utils/debug.d.ts +4 -2
- package/dist/src/utils/debug.js +4 -3
- package/dist/src/utils/debug.js.map +1 -1
- package/dist/src/utils/delay-interval.d.ts +7 -0
- package/dist/src/utils/delay-interval.js +29 -0
- package/dist/src/utils/delay-interval.js.map +1 -0
- package/dist/src/utils/dom-util.d.ts +2 -2
- package/dist/src/utils/dom-util.js +15 -15
- package/dist/src/utils/dom-util.js.map +1 -1
- package/dist/src/void.d.ts +8 -3
- package/dist/src/void.js +22 -15
- package/dist/src/void.js.map +1 -1
- package/dist/tools/atlas-pack/atlas-pack.d.ts +1 -1
- package/dist/tools/atlas-pack/atlas-pack.js +10 -5
- package/dist/tools/atlas-pack/atlas-pack.js.map +1 -1
- package/dist/tools/bundle/bundle.js +4 -4
- package/dist/tools/bundle/bundle.js.map +1 -1
- package/dist/tools/bundle/html-plugin.js +6 -4
- package/dist/tools/bundle/html-plugin.js.map +1 -1
- package/dist/tools/tsconfig-base.json +4 -1
- package/dist/tools/tsconfig.json +1 -3
- package/dist/tools/types/config.d.ts +8 -1
- package/dist/tools/types/config.js +17 -8
- package/dist/tools/types/config.js.map +1 -1
- package/dist/tools/types/package-json.d.ts +4 -0
- package/dist/tools/types/package-json.js +2 -0
- package/dist/tools/types/package-json.js.map +1 -0
- package/dist/tools/void.d.ts +1 -3
- package/dist/tools/void.js +8 -7
- package/dist/tools/void.js.map +1 -1
- package/package.json +10 -11
- package/dist/meta.json +0 -1
- package/dist/public/favicon/favicon16.png +0 -0
- package/dist/public/favicon/favicon192.png +0 -0
- package/dist/public/favicon/favicon32.png +0 -0
- package/dist/public/favicon/favicon48.png +0 -0
- package/dist/public/favicon/favicon512.png +0 -0
- package/dist/public/favicon/favicon64.png +0 -0
- package/dist/public/index.html +0 -23
- package/dist/public/manifest.json +0 -1
- package/dist/public/preload-atlas.png +0 -0
- package/dist/public/void-v0.1.0-4.html +0 -111
- package/dist/public/void-v0.1.0-5.html +0 -111
- package/dist/public/void-v0.1.0-6.html +0 -111
- package/dist/src/pixel-ratio-observer.d.ts +0 -10
- package/dist/src/pixel-ratio-observer.js +0 -26
- package/dist/src/pixel-ratio-observer.js.map +0 -1
- package/schema/config-file.test.ts +0 -55
- package/schema/config-file.ts +0 -69
- package/schema/config-file.v0.json +0 -68
- package/tools/atlas-pack/aseprite.ts +0 -60
- package/tools/atlas-pack/atlas-json-parser.test.ts +0 -780
- package/tools/atlas-pack/atlas-json-parser.ts +0 -159
- package/tools/atlas-pack/atlas-pack.ts +0 -38
- package/tools/bundle/bundle.ts +0 -65
- package/tools/bundle/html-plugin.ts +0 -135
- package/tools/types/config.ts +0 -43
- package/tools/utils/argv.test.ts +0 -41
- package/tools/utils/argv.ts +0 -29
- package/tools/utils/exec.ts +0 -22
- package/tools/utils/file-util.ts +0 -11
- package/tools/utils/html-parser.ts +0 -9
- package/tools/void.ts +0 -54
package/schema/config-file.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import {readFile} from 'node:fs/promises'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import schema from './config-file.v0.json' with {type: 'json'}
|
|
4
|
-
|
|
5
|
-
export type AtlasConfig = {dir: string; image: string; json: string}
|
|
6
|
-
|
|
7
|
-
export type ConfigFile = {
|
|
8
|
-
$schema: string
|
|
9
|
-
entry: string
|
|
10
|
-
meta: string | undefined
|
|
11
|
-
out: {dir: string; name: string | undefined}
|
|
12
|
-
preloadAtlas: AtlasConfig | undefined
|
|
13
|
-
|
|
14
|
-
/** config directory name. */
|
|
15
|
-
dirname: string
|
|
16
|
-
/** config filename. */
|
|
17
|
-
filename: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type ConfigFileSchema = {
|
|
21
|
-
$schema?: string | undefined
|
|
22
|
-
entry?: string | undefined
|
|
23
|
-
meta?: string | undefined
|
|
24
|
-
out?: {dir?: string | undefined; name?: string | undefined} | undefined
|
|
25
|
-
preloadAtlas?: AtlasConfig | undefined
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export async function parseConfigFile(filename: string): Promise<ConfigFile> {
|
|
29
|
-
let str
|
|
30
|
-
try {
|
|
31
|
-
str = await readFile(filename, 'utf8')
|
|
32
|
-
} catch (err) {
|
|
33
|
-
throw Error(`config ${filename} unreadable`, {cause: err})
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return parse(filename, str)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** @internal */
|
|
40
|
-
export function parse(filename: string, str: string): ConfigFile {
|
|
41
|
-
const dirname = path.dirname(filename)
|
|
42
|
-
let json: ConfigFileSchema
|
|
43
|
-
try {
|
|
44
|
-
json = JSON.parse(str)
|
|
45
|
-
} catch (err) {
|
|
46
|
-
throw Error(`config ${filename} unparsable`, {cause: err})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
$schema: json.$schema ?? schema.properties.$schema.default,
|
|
51
|
-
entry: path.join(dirname, json.entry ?? schema.properties.entry.default),
|
|
52
|
-
meta: path.join(dirname, json.meta ?? schema.properties.meta.default),
|
|
53
|
-
out: {
|
|
54
|
-
dir: path.join(
|
|
55
|
-
dirname,
|
|
56
|
-
json.out?.dir ?? schema.properties.out.properties.dir.default
|
|
57
|
-
),
|
|
58
|
-
name: json.out?.name
|
|
59
|
-
},
|
|
60
|
-
preloadAtlas: json.preloadAtlas && {
|
|
61
|
-
dir: path.join(dirname, json.preloadAtlas.dir),
|
|
62
|
-
image: path.join(dirname, json.preloadAtlas.image),
|
|
63
|
-
json: path.join(dirname, json.preloadAtlas.json)
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
dirname,
|
|
67
|
-
filename
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://raw.githubusercontent.com/oidoid/void/refs/heads/main/schema/config-file.v0.json",
|
|
4
|
-
"title": "void Config File Schema",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"description": "a JSON representation of a void config file.",
|
|
7
|
-
"$defs": {
|
|
8
|
-
"Atlas": {
|
|
9
|
-
"type": "object",
|
|
10
|
-
"description": "sprite sheet config.",
|
|
11
|
-
"additionalProperties": false,
|
|
12
|
-
"required": ["dir", "image", "json"],
|
|
13
|
-
"properties": {
|
|
14
|
-
"dir": {
|
|
15
|
-
"type": "string",
|
|
16
|
-
"description": "Aseprite asset root directory. all `**.aseprite` files are input.",
|
|
17
|
-
"examples": ["src/assets/atlas/", "./"]
|
|
18
|
-
},
|
|
19
|
-
"image": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"description": "sprite sheet image output.",
|
|
22
|
-
"examples": ["dist/public/atlas.png", "atlas.png"]
|
|
23
|
-
},
|
|
24
|
-
"json": {
|
|
25
|
-
"type": "string",
|
|
26
|
-
"description": "sprite sheet JSON output.",
|
|
27
|
-
"examples": ["src/assets/atlas.json", "atlas.json"]
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"additionalProperties": false,
|
|
33
|
-
"properties": {
|
|
34
|
-
"$schema": {
|
|
35
|
-
"type": "string",
|
|
36
|
-
"description": "the configuration schema URI.",
|
|
37
|
-
"default": "https://raw.githubusercontent.com/oidoid/void/refs/heads/main/schema/config-file.v0.json"
|
|
38
|
-
},
|
|
39
|
-
"entry": {
|
|
40
|
-
"type": "string",
|
|
41
|
-
"default": "src/assets/index.html",
|
|
42
|
-
"description": "HTML entrypoint input. the file should include a script tag sourcing the TypeScript / JavaScript entrypoint."
|
|
43
|
-
},
|
|
44
|
-
"meta": {
|
|
45
|
-
"type": "string",
|
|
46
|
-
"default": "dist/meta.json",
|
|
47
|
-
"description": "esbuild bundle metadata file output."
|
|
48
|
-
},
|
|
49
|
-
"out": {
|
|
50
|
-
"type": "object",
|
|
51
|
-
"description": "output config.",
|
|
52
|
-
"additionalProperties": false,
|
|
53
|
-
"properties": {
|
|
54
|
-
"dir": {
|
|
55
|
-
"type": "string",
|
|
56
|
-
"description": "HTML and JavaScript output directory.",
|
|
57
|
-
"default": "dist/public/"
|
|
58
|
-
},
|
|
59
|
-
"name": {
|
|
60
|
-
"type": "string",
|
|
61
|
-
"description": "HTML output file stem when watch is disabled. defaults to entry.",
|
|
62
|
-
"examples": ["index", "super-patience"]
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
"preloadAtlas": {"$ref": "#/$defs/Atlas"}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type {TagFormat} from '../../src/graphics/atlas.ts'
|
|
2
|
-
import type {Box, WH} from '../../src/types/geo.ts'
|
|
3
|
-
|
|
4
|
-
/** https://github.com/aseprite/aseprite/blob/master/docs/ase-file-specs.md */
|
|
5
|
-
export type Aseprite = {meta: AsepriteMeta; frames: AsepriteFrameMap}
|
|
6
|
-
|
|
7
|
-
export type AsepriteFrameMap = {[tag: AsepriteFrameTag]: AsepriteFrame}
|
|
8
|
-
|
|
9
|
-
export type AsepriteMeta = {
|
|
10
|
-
/** `--list-tags`. */
|
|
11
|
-
frameTags: AsepriteTagSpan[]
|
|
12
|
-
size: WH
|
|
13
|
-
/** `--list-slices`. */
|
|
14
|
-
slices: AsepriteSlice[]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** `--filename-format='{title}--{tag}--{frame}'`. */
|
|
18
|
-
export type AsepriteFrameTag = `${TagFormat}--${bigint}`
|
|
19
|
-
|
|
20
|
-
export type AsepriteFrame = {
|
|
21
|
-
/** positive animation length in milliseconds. */
|
|
22
|
-
duration: number
|
|
23
|
-
/** bounds including padding. */
|
|
24
|
-
frame: Box
|
|
25
|
-
/** WH without padding. */
|
|
26
|
-
sourceSize: WH
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type AsepriteTagSpan = {
|
|
30
|
-
direction: AsepriteDirection | string
|
|
31
|
-
name: TagFormat | string
|
|
32
|
-
from: number
|
|
33
|
-
/** inclusive ending index, possibly equal to from. */
|
|
34
|
-
to: number
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type AsepriteSlice = {
|
|
38
|
-
/** '#ff0000ff' is hitbox, '#00ff00ff' is hurtbox, '#0000ffff is both. */
|
|
39
|
-
color: string
|
|
40
|
-
name: TagFormat | string
|
|
41
|
-
keys: {bounds: Box}[]
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export type AsepriteDirection =
|
|
45
|
-
(typeof AsepriteDirection)[keyof typeof AsepriteDirection]
|
|
46
|
-
export const AsepriteDirection = {
|
|
47
|
-
/** animate from start to end; when looping, return to start. */
|
|
48
|
-
Forward: 'forward',
|
|
49
|
-
/** animate from end to start; when looping, return to end. */
|
|
50
|
-
Reverse: 'reverse',
|
|
51
|
-
/**
|
|
52
|
-
* animate from start to end - 1 or start, whichever is greater; when
|
|
53
|
-
* looping, change direction (initially, end to start + 1 or end, whichever
|
|
54
|
-
* is lesser. a traversal from start to end - 1 then end to start + 1 is
|
|
55
|
-
* considered a complete loop.
|
|
56
|
-
*/
|
|
57
|
-
PingPong: 'pingpong',
|
|
58
|
-
/** like pingpong but start from end - 1 or start, whichever is greater. */
|
|
59
|
-
PingPongReverse: 'pingpong_reverse'
|
|
60
|
-
} as const
|