ticbuild 1.0.2 → 1.0.3
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/backend/codeBanking.test.js +100 -0
- package/dist/backend/importers/LuaCodeImporter.test.js +42 -0
- package/dist/backend/luaPreprocessor.test.js +64 -0
- package/dist/backend/manifestLoader.test.js +149 -0
- package/dist/buildInfo.d.ts +4 -5
- package/dist/buildInfo.d.ts.map +1 -1
- package/dist/buildInfo.js +4 -5
- package/dist/buildInfo.js.map +1 -1
- package/dist/frontend/codeBankWarnings.test.js +93 -0
- package/dist/obj/build.log +5 -0
- package/dist/utils/algorithms.test.js +38 -0
- package/dist/utils/lua/lua_processor.test.js +85 -0
- package/dist/utils/math.test.js +32 -0
- package/dist/utils/tic80/bankSupport.test.js +33 -0
- package/dist/utils/tic80/tic80.d.ts +5 -5
- package/dist/utils/versionString.d.ts +1 -2
- package/dist/utils/versionString.d.ts.map +1 -1
- package/dist/utils/versionString.js +4 -8
- package/dist/utils/versionString.js.map +1 -1
- package/package.json +9 -1
- package/templates/example/project.ticbuild.jsonc +43 -0
- package/templates/example/src/main.lua +4 -0
- package/templates/minimal/src/main.lua +4 -0
- package/.env.example +0 -3
- package/.prettierignore +0 -10
- package/debug/obj/resolvedManifest.ticbuild.jsonc +0 -108
- package/example.ticbuild.jsonc +0 -94
- package/ticbuild-1.0.1.tgz +0 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const fs = __importStar(require("node:fs"));
|
|
37
|
+
const os = __importStar(require("node:os"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const project_1 = require("./project");
|
|
40
|
+
const tic80_1 = require("../utils/tic80/tic80");
|
|
41
|
+
function writeFile(filePath, content) {
|
|
42
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
43
|
+
fs.writeFileSync(filePath, content, "utf-8");
|
|
44
|
+
}
|
|
45
|
+
function createTempProject(code, assemblyBlock) {
|
|
46
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "ticbuild-codebank-"));
|
|
47
|
+
const codePath = path.join(dir, "main.lua");
|
|
48
|
+
writeFile(codePath, code);
|
|
49
|
+
const manifest = {
|
|
50
|
+
project: {
|
|
51
|
+
name: "test",
|
|
52
|
+
binDir: "./bin",
|
|
53
|
+
objDir: "./obj",
|
|
54
|
+
outputCartName: "out.tic",
|
|
55
|
+
},
|
|
56
|
+
imports: [
|
|
57
|
+
{
|
|
58
|
+
name: "maincode",
|
|
59
|
+
path: "main.lua",
|
|
60
|
+
kind: "LuaCode",
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
assembly: {
|
|
64
|
+
lua: {
|
|
65
|
+
minify: false,
|
|
66
|
+
},
|
|
67
|
+
blocks: [assemblyBlock],
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
const manifestPath = path.join(dir, "project.ticbuild.jsonc");
|
|
71
|
+
writeFile(manifestPath, JSON.stringify(manifest, null, 2));
|
|
72
|
+
return { dir, manifestPath };
|
|
73
|
+
}
|
|
74
|
+
describe("Code chunk banking", () => {
|
|
75
|
+
it("should split CODE across multiple banks when oversized", async () => {
|
|
76
|
+
const maxChunkSize = tic80_1.kTic80CartChunkTypes.byKey.CODE.sizePerBank;
|
|
77
|
+
const payloadLength = maxChunkSize + 10;
|
|
78
|
+
const code = `local s = "${"a".repeat(payloadLength)}"`;
|
|
79
|
+
const { dir, manifestPath } = createTempProject(code, {
|
|
80
|
+
chunks: ["CODE"],
|
|
81
|
+
asset: "maincode",
|
|
82
|
+
});
|
|
83
|
+
try {
|
|
84
|
+
const project = project_1.TicbuildProject.loadFromManifest({ manifestPath });
|
|
85
|
+
await project.loadImports();
|
|
86
|
+
const output = await project.assembleOutput();
|
|
87
|
+
const codeChunks = output.chunks.filter((chunk) => chunk.chunkType === "CODE");
|
|
88
|
+
expect(codeChunks).toHaveLength(2);
|
|
89
|
+
expect(codeChunks[0].bank).toBe(0);
|
|
90
|
+
expect(codeChunks[1].bank).toBe(1);
|
|
91
|
+
expect(codeChunks[0].data.length).toBe(maxChunkSize);
|
|
92
|
+
const totalLength = new TextEncoder().encode(code).length;
|
|
93
|
+
expect(codeChunks[1].data.length).toBe(totalLength - maxChunkSize);
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
//# sourceMappingURL=codeBanking.test.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const LuaCodeImporter_1 = require("./LuaCodeImporter");
|
|
4
|
+
const projectCore_1 = require("../projectCore");
|
|
5
|
+
function makeProject(manifest) {
|
|
6
|
+
return new projectCore_1.TicbuildProjectCore({
|
|
7
|
+
manifest,
|
|
8
|
+
manifestPath: "C:/test/manifest.ticbuild.jsonc",
|
|
9
|
+
projectDir: "C:/test",
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
describe("LuaCodeResourceView emitGlobals", () => {
|
|
13
|
+
it("should respect code.emitGlobals=false", () => {
|
|
14
|
+
const manifest = {
|
|
15
|
+
project: {
|
|
16
|
+
name: "test",
|
|
17
|
+
binDir: "./bin",
|
|
18
|
+
objDir: "./obj",
|
|
19
|
+
outputCartName: "test.tic",
|
|
20
|
+
},
|
|
21
|
+
variables: {},
|
|
22
|
+
imports: [],
|
|
23
|
+
assembly: {
|
|
24
|
+
lua: {
|
|
25
|
+
minify: false,
|
|
26
|
+
globals: {
|
|
27
|
+
PROJECT_NAME: "Demo",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
blocks: [],
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const project = makeProject(manifest);
|
|
34
|
+
const view = new LuaCodeImporter_1.LuaCodeResourceView("print('hello')", "print('hello')");
|
|
35
|
+
const withGlobals = new TextDecoder().decode(view.getDataForChunk(project, "CODE"));
|
|
36
|
+
expect(withGlobals).toContain('local PROJECT_NAME = "Demo"');
|
|
37
|
+
const withoutGlobals = new TextDecoder().decode(view.getDataForChunk(project, "CODE", { emitGlobals: false }));
|
|
38
|
+
expect(withoutGlobals).not.toContain('local PROJECT_NAME = "Demo"');
|
|
39
|
+
expect(withoutGlobals).toContain("print('hello')");
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=LuaCodeImporter.test.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const luaPreprocessor_1 = require("./luaPreprocessor");
|
|
4
|
+
const projectCore_1 = require("./projectCore");
|
|
5
|
+
function makeProject(manifest) {
|
|
6
|
+
return new projectCore_1.TicbuildProjectCore({
|
|
7
|
+
manifest,
|
|
8
|
+
manifestPath: "C:/test/manifest.ticbuild.jsonc",
|
|
9
|
+
projectDir: "C:/test",
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
describe("Lua preprocessor __ENCODE", () => {
|
|
13
|
+
it("should encode hex to hex literal", async () => {
|
|
14
|
+
const manifest = {
|
|
15
|
+
project: {
|
|
16
|
+
name: "test",
|
|
17
|
+
binDir: "./bin",
|
|
18
|
+
objDir: "./obj",
|
|
19
|
+
outputCartName: "test.tic",
|
|
20
|
+
},
|
|
21
|
+
variables: {},
|
|
22
|
+
imports: [],
|
|
23
|
+
assembly: {
|
|
24
|
+
blocks: [],
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
// for reference,
|
|
28
|
+
// {25,44,93,255,127,128}
|
|
29
|
+
// hex: "192c5dff7f80"
|
|
30
|
+
// b85+1: "#)(](nIt.M!"
|
|
31
|
+
// lz85+1: "!!!X;l?2oD)"
|
|
32
|
+
{
|
|
33
|
+
const project = makeProject(manifest);
|
|
34
|
+
const source = 'local value = __ENCODE("hex", "hex", "1f 00")';
|
|
35
|
+
const result = await (0, luaPreprocessor_1.preprocessLuaCode)(project, source, "C:/test/source.lua");
|
|
36
|
+
expect(result.code).toContain('local value = "1f00"');
|
|
37
|
+
}
|
|
38
|
+
{
|
|
39
|
+
const project = makeProject(manifest);
|
|
40
|
+
const source = 'local value = __ENCODE("b85+1", "hex", "#)(](nIt.M!")';
|
|
41
|
+
const result = await (0, luaPreprocessor_1.preprocessLuaCode)(project, source, "C:/test/source.lua");
|
|
42
|
+
expect(result.code).toContain('local value = "192c5dff7f80"');
|
|
43
|
+
}
|
|
44
|
+
{
|
|
45
|
+
const project = makeProject(manifest);
|
|
46
|
+
const source = 'local value = __ENCODE("lz85+1", "hex", "!!!X;l?2oD)")';
|
|
47
|
+
const result = await (0, luaPreprocessor_1.preprocessLuaCode)(project, source, "C:/test/source.lua");
|
|
48
|
+
expect(result.code).toContain('local value = "192c5dff7f80"');
|
|
49
|
+
}
|
|
50
|
+
{
|
|
51
|
+
const project = makeProject(manifest);
|
|
52
|
+
const source = 'local value = __ENCODE("lz85+1", "b85+1", "!!!X;l?2oD)")';
|
|
53
|
+
const result = await (0, luaPreprocessor_1.preprocessLuaCode)(project, source, "C:/test/source.lua");
|
|
54
|
+
expect(result.code).toContain('local value = "#)(](nIt.M!"');
|
|
55
|
+
}
|
|
56
|
+
{
|
|
57
|
+
const project = makeProject(manifest);
|
|
58
|
+
const source = 'local value = __ENCODE("lz85+1", "u8", "!!!X;l?2oD)")';
|
|
59
|
+
const result = await (0, luaPreprocessor_1.preprocessLuaCode)(project, source, "C:/test/source.lua");
|
|
60
|
+
expect(result.code).toContain("local value = {25,44,93,255,127,128}");
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=luaPreprocessor.test.js.map
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const fs = __importStar(require("fs"));
|
|
37
|
+
const manifestLoader_1 = require("./manifestLoader");
|
|
38
|
+
// Mock fs module
|
|
39
|
+
jest.mock("fs");
|
|
40
|
+
const mockFs = fs;
|
|
41
|
+
describe("Manifest Loader", () => {
|
|
42
|
+
const validManifest = {
|
|
43
|
+
project: {
|
|
44
|
+
name: "test-project",
|
|
45
|
+
binDir: "./bin",
|
|
46
|
+
objDir: "./obj",
|
|
47
|
+
outputCartName: "output.tic",
|
|
48
|
+
},
|
|
49
|
+
imports: [
|
|
50
|
+
{
|
|
51
|
+
name: "maincode",
|
|
52
|
+
path: "main.lua",
|
|
53
|
+
kind: "LuaCode",
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
assembly: {
|
|
57
|
+
blocks: [
|
|
58
|
+
{
|
|
59
|
+
asset: "maincode",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
beforeEach(() => {
|
|
65
|
+
jest.clearAllMocks();
|
|
66
|
+
});
|
|
67
|
+
describe("findManifestInDirectory", () => {
|
|
68
|
+
it("should find .ticbuild.jsonc file", () => {
|
|
69
|
+
mockFs.readdirSync.mockReturnValue(["test.ticbuild.jsonc", "other.txt"]);
|
|
70
|
+
const result = (0, manifestLoader_1.findManifestInDirectory)("/test/dir");
|
|
71
|
+
expect(result).toContain("test.ticbuild.jsonc");
|
|
72
|
+
expect(result).toContain("test");
|
|
73
|
+
expect(result).toContain("dir");
|
|
74
|
+
});
|
|
75
|
+
it("should find .ticbuild.json file", () => {
|
|
76
|
+
mockFs.readdirSync.mockReturnValue(["test.ticbuild.json", "other.txt"]);
|
|
77
|
+
const result = (0, manifestLoader_1.findManifestInDirectory)("/test/dir");
|
|
78
|
+
expect(result).toContain("test.ticbuild.json");
|
|
79
|
+
});
|
|
80
|
+
it("should return undefined if no manifest found", () => {
|
|
81
|
+
mockFs.readdirSync.mockReturnValue(["other.txt", "config.json"]);
|
|
82
|
+
const result = (0, manifestLoader_1.findManifestInDirectory)("/test/dir");
|
|
83
|
+
expect(result).toBeUndefined();
|
|
84
|
+
});
|
|
85
|
+
it("should throw ManifestLoadError if directory cannot be read", () => {
|
|
86
|
+
mockFs.readdirSync.mockImplementation(() => {
|
|
87
|
+
throw new Error("Permission denied");
|
|
88
|
+
});
|
|
89
|
+
expect(() => (0, manifestLoader_1.findManifestInDirectory)("/test/dir")).toThrow(manifestLoader_1.ManifestLoadError);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
describe("loadManifest", () => {
|
|
93
|
+
it("should load and validate a valid manifest", () => {
|
|
94
|
+
const manifestContent = JSON.stringify(validManifest);
|
|
95
|
+
mockFs.existsSync.mockReturnValue(true);
|
|
96
|
+
mockFs.readFileSync.mockReturnValue(manifestContent);
|
|
97
|
+
const result = (0, manifestLoader_1.loadManifest)("/test/manifest.ticbuild.jsonc");
|
|
98
|
+
expect(result.manifest).toMatchObject(validManifest);
|
|
99
|
+
expect(result.filePath).toContain("manifest.ticbuild.jsonc");
|
|
100
|
+
expect(result.projectDir).toBeDefined();
|
|
101
|
+
});
|
|
102
|
+
it("should handle JSONC with comments", () => {
|
|
103
|
+
const manifestContent = `{
|
|
104
|
+
// This is a comment
|
|
105
|
+
"project": {
|
|
106
|
+
"name": "test-project",
|
|
107
|
+
"binDir": "./bin",
|
|
108
|
+
"objDir": "./obj",
|
|
109
|
+
"outputCartName": "output.tic"
|
|
110
|
+
},
|
|
111
|
+
"imports": [
|
|
112
|
+
{
|
|
113
|
+
"name": "maincode",
|
|
114
|
+
"path": "main.lua",
|
|
115
|
+
"kind": "LuaCode"
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"assembly": {
|
|
119
|
+
"blocks": [
|
|
120
|
+
{
|
|
121
|
+
"asset": "maincode"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}`;
|
|
126
|
+
mockFs.existsSync.mockReturnValue(true);
|
|
127
|
+
mockFs.readFileSync.mockReturnValue(manifestContent);
|
|
128
|
+
const result = (0, manifestLoader_1.loadManifest)("/test/manifest.ticbuild.jsonc");
|
|
129
|
+
expect(result.manifest.project.name).toBe("test-project");
|
|
130
|
+
});
|
|
131
|
+
it("should throw ManifestValidationError for invalid manifest", () => {
|
|
132
|
+
const invalidManifest = {
|
|
133
|
+
project: {
|
|
134
|
+
name: "test",
|
|
135
|
+
// missing required fields
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
mockFs.existsSync.mockReturnValue(true);
|
|
139
|
+
mockFs.readFileSync.mockReturnValue(JSON.stringify(invalidManifest));
|
|
140
|
+
expect(() => (0, manifestLoader_1.loadManifest)("/test/invalid.ticbuild.jsonc")).toThrow(manifestLoader_1.ManifestValidationError);
|
|
141
|
+
});
|
|
142
|
+
it("should throw ManifestLoadError for invalid JSON", () => {
|
|
143
|
+
mockFs.existsSync.mockReturnValue(true);
|
|
144
|
+
mockFs.readFileSync.mockReturnValue("{ invalid json }");
|
|
145
|
+
expect(() => (0, manifestLoader_1.loadManifest)("/test/bad.ticbuild.jsonc")).toThrow();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
//# sourceMappingURL=manifestLoader.test.js.map
|
package/dist/buildInfo.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export declare const buildInfo: {
|
|
2
|
-
readonly
|
|
3
|
-
readonly commitsSinceTag: 6;
|
|
2
|
+
readonly version: "1.0.3";
|
|
4
3
|
readonly dirty: false;
|
|
5
|
-
readonly buildDate: "2026-01-
|
|
6
|
-
readonly lastCommitDate: "2026-01-
|
|
7
|
-
readonly commitHash: "
|
|
4
|
+
readonly buildDate: "2026-01-26T20:24:43.365Z";
|
|
5
|
+
readonly lastCommitDate: "2026-01-26T21:24:36+01:00";
|
|
6
|
+
readonly commitHash: "3b6f257";
|
|
8
7
|
};
|
|
9
8
|
//# sourceMappingURL=buildInfo.d.ts.map
|
package/dist/buildInfo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildInfo.d.ts","sourceRoot":"","sources":["../src/buildInfo.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"buildInfo.d.ts","sourceRoot":"","sources":["../src/buildInfo.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,SAAS;;;;;;CAMZ,CAAC"}
|
package/dist/buildInfo.js
CHANGED
|
@@ -3,11 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.buildInfo = void 0;
|
|
4
4
|
// Auto-generated by scripts/gen-build-info.js. Do not edit.
|
|
5
5
|
exports.buildInfo = {
|
|
6
|
-
"
|
|
7
|
-
"commitsSinceTag": 6,
|
|
6
|
+
"version": "1.0.3",
|
|
8
7
|
"dirty": false,
|
|
9
|
-
"buildDate": "2026-01-
|
|
10
|
-
"lastCommitDate": "2026-01-
|
|
11
|
-
"commitHash": "
|
|
8
|
+
"buildDate": "2026-01-26T20:24:43.365Z",
|
|
9
|
+
"lastCommitDate": "2026-01-26T21:24:36+01:00",
|
|
10
|
+
"commitHash": "3b6f257"
|
|
12
11
|
};
|
|
13
12
|
//# sourceMappingURL=buildInfo.js.map
|
package/dist/buildInfo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildInfo.js","sourceRoot":"","sources":["../src/buildInfo.ts"],"names":[],"mappings":";;;AAAA,4DAA4D;AAC/C,QAAA,SAAS,GAAG;IACvB,
|
|
1
|
+
{"version":3,"file":"buildInfo.js","sourceRoot":"","sources":["../src/buildInfo.ts"],"names":[],"mappings":";;;AAAA,4DAA4D;AAC/C,QAAA,SAAS,GAAG;IACvB,SAAS,EAAE,OAAO;IAClB,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,0BAA0B;IACvC,gBAAgB,EAAE,2BAA2B;IAC7C,YAAY,EAAE,SAAS;CACf,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const fs = __importStar(require("node:fs"));
|
|
37
|
+
const os = __importStar(require("node:os"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const core_1 = require("./core");
|
|
40
|
+
const cons = __importStar(require("../utils/console"));
|
|
41
|
+
function writeFile(filePath, content) {
|
|
42
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
43
|
+
fs.writeFileSync(filePath, content, "utf-8");
|
|
44
|
+
}
|
|
45
|
+
function createTempProject(code, assemblyBlock) {
|
|
46
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "ticbuild-codewarn-"));
|
|
47
|
+
const codePath = path.join(dir, "main.lua");
|
|
48
|
+
writeFile(codePath, code);
|
|
49
|
+
const manifest = {
|
|
50
|
+
project: {
|
|
51
|
+
name: "test",
|
|
52
|
+
binDir: "./bin",
|
|
53
|
+
objDir: "./obj",
|
|
54
|
+
outputCartName: "out.tic",
|
|
55
|
+
},
|
|
56
|
+
imports: [
|
|
57
|
+
{
|
|
58
|
+
name: "maincode",
|
|
59
|
+
path: "main.lua",
|
|
60
|
+
kind: "LuaCode",
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
assembly: {
|
|
64
|
+
lua: {
|
|
65
|
+
minify: false,
|
|
66
|
+
},
|
|
67
|
+
blocks: [assemblyBlock],
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
const manifestPath = path.join(dir, "project.ticbuild.jsonc");
|
|
71
|
+
writeFile(manifestPath, JSON.stringify(manifest, null, 2));
|
|
72
|
+
return { dir, manifestPath };
|
|
73
|
+
}
|
|
74
|
+
describe("Code chunk bank warnings", () => {
|
|
75
|
+
it("should warn when CODE block specifies explicit bank", async () => {
|
|
76
|
+
const { dir, manifestPath } = createTempProject("print('ok')", {
|
|
77
|
+
chunks: ["CODE"],
|
|
78
|
+
bank: 1,
|
|
79
|
+
asset: "maincode",
|
|
80
|
+
});
|
|
81
|
+
// so we can test warnings emitted.
|
|
82
|
+
const warnSpy = jest.spyOn(cons, "warning").mockImplementation(() => undefined);
|
|
83
|
+
try {
|
|
84
|
+
await (0, core_1.buildCore)(manifestPath);
|
|
85
|
+
expect(warnSpy).toHaveBeenCalledWith("Explicit bank specified for CODE chunk: CODE#1");
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
warnSpy.mockRestore();
|
|
89
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=codeBankWarnings.test.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
[2026-01-26T15:39:22.442Z] [INFO] Project loaded from:
|
|
2
|
+
[2026-01-26T15:39:22.442Z] [INFO] C:\root\git\thenfour\tic80effects\ticbuild\example.ticbuild.jsonc
|
|
3
|
+
[2026-01-26T15:39:22.444Z] [INFO] Outputting resolved manifest to
|
|
4
|
+
[2026-01-26T15:39:22.444Z] [INFO] C:\root\git\thenfour\tic80effects\ticbuild\dist\obj\resolvedManifest.ticbuild.jsonc
|
|
5
|
+
[2026-01-26T15:39:22.445Z] [INFO] Loading imported resources...
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const algorithms_1 = require("./algorithms");
|
|
4
|
+
describe("Algorithm utilities", () => {
|
|
5
|
+
describe("debounce", () => {
|
|
6
|
+
jest.useFakeTimers();
|
|
7
|
+
it("should debounce function calls", () => {
|
|
8
|
+
const mockFn = jest.fn();
|
|
9
|
+
const debouncedFn = (0, algorithms_1.debounce)(mockFn, 100);
|
|
10
|
+
// Call multiple times rapidly
|
|
11
|
+
debouncedFn("test1");
|
|
12
|
+
debouncedFn("test2");
|
|
13
|
+
debouncedFn("test3");
|
|
14
|
+
// Function should not be called yet
|
|
15
|
+
expect(mockFn).not.toHaveBeenCalled();
|
|
16
|
+
// Fast-forward time
|
|
17
|
+
jest.advanceTimersByTime(100);
|
|
18
|
+
// Function should be called once with the last arguments
|
|
19
|
+
expect(mockFn).toHaveBeenCalledTimes(1);
|
|
20
|
+
expect(mockFn).toHaveBeenCalledWith("test3");
|
|
21
|
+
});
|
|
22
|
+
it("should reset timer on subsequent calls", () => {
|
|
23
|
+
const mockFn = jest.fn();
|
|
24
|
+
const debouncedFn = (0, algorithms_1.debounce)(mockFn, 100);
|
|
25
|
+
debouncedFn("first");
|
|
26
|
+
jest.advanceTimersByTime(50);
|
|
27
|
+
debouncedFn("second");
|
|
28
|
+
jest.advanceTimersByTime(50);
|
|
29
|
+
// Should not be called yet (timer was reset)
|
|
30
|
+
expect(mockFn).not.toHaveBeenCalled();
|
|
31
|
+
jest.advanceTimersByTime(50);
|
|
32
|
+
// Now it should be called with the last value
|
|
33
|
+
expect(mockFn).toHaveBeenCalledTimes(1);
|
|
34
|
+
expect(mockFn).toHaveBeenCalledWith("second");
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=algorithms.test.js.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lua_processor_1 = require("./lua_processor");
|
|
4
|
+
describe("Lua printer numeric literal formatting", () => {
|
|
5
|
+
it("should keep leading zero after string concatenation", () => {
|
|
6
|
+
const options = {
|
|
7
|
+
stripComments: true,
|
|
8
|
+
maxIndentLevel: 1,
|
|
9
|
+
lineBehavior: "tight",
|
|
10
|
+
maxLineLength: 180,
|
|
11
|
+
renameLocalVariables: false,
|
|
12
|
+
aliasRepeatedExpressions: false,
|
|
13
|
+
aliasLiterals: false,
|
|
14
|
+
packLocalDeclarations: false,
|
|
15
|
+
simplifyExpressions: true,
|
|
16
|
+
removeUnusedLocals: false,
|
|
17
|
+
removeUnusedFunctions: false,
|
|
18
|
+
functionNamesToKeep: [],
|
|
19
|
+
renameTableFields: false,
|
|
20
|
+
tableEntryKeysToRename: [],
|
|
21
|
+
};
|
|
22
|
+
{
|
|
23
|
+
const input = 'local s="str"..(1/4)';
|
|
24
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
25
|
+
expect(output).toContain('"str"..0.25');
|
|
26
|
+
}
|
|
27
|
+
{
|
|
28
|
+
// integers don't need leading zero
|
|
29
|
+
const input = 'local s="str"..10';
|
|
30
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
31
|
+
expect(output).toContain('"str"..10');
|
|
32
|
+
}
|
|
33
|
+
{
|
|
34
|
+
const input = `print("x="..(.25))`;
|
|
35
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
36
|
+
expect(output).toContain('"x="..0.25');
|
|
37
|
+
}
|
|
38
|
+
{
|
|
39
|
+
const input = `local t = 0.25 print("t=" .. t)`;
|
|
40
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
41
|
+
// i see:
|
|
42
|
+
// local t=.25 print(\"t=\"...25..\"\")
|
|
43
|
+
expect(output).toContain('t="..0.25');
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
it("should use parenthesis when a numeric literal precedes a string concatenation operator", () => {
|
|
47
|
+
const options = {
|
|
48
|
+
stripComments: true,
|
|
49
|
+
maxIndentLevel: 1,
|
|
50
|
+
lineBehavior: "tight",
|
|
51
|
+
maxLineLength: 180,
|
|
52
|
+
renameLocalVariables: false,
|
|
53
|
+
aliasRepeatedExpressions: false,
|
|
54
|
+
aliasLiterals: false,
|
|
55
|
+
packLocalDeclarations: false,
|
|
56
|
+
simplifyExpressions: true,
|
|
57
|
+
removeUnusedLocals: false,
|
|
58
|
+
removeUnusedFunctions: false,
|
|
59
|
+
functionNamesToKeep: [],
|
|
60
|
+
renameTableFields: false,
|
|
61
|
+
tableEntryKeysToRename: [],
|
|
62
|
+
};
|
|
63
|
+
{
|
|
64
|
+
// the following produces a syntax error in parenthesis-less form:
|
|
65
|
+
// 4.."hello" is a syntax error; Lua treats the .. as a decimal point.
|
|
66
|
+
// so as we print lua make sure we don't produce this case.
|
|
67
|
+
const input = "print((4) .. y)";
|
|
68
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
69
|
+
expect(output).toContain("(4)..y");
|
|
70
|
+
}
|
|
71
|
+
{
|
|
72
|
+
const input = `local y = 4 print(y.."")`;
|
|
73
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
74
|
+
expect(output).toContain(`(4)..""`);
|
|
75
|
+
}
|
|
76
|
+
{
|
|
77
|
+
// having a decimal point doesn't change anything here. Lua parser still
|
|
78
|
+
// cannot handle it so parenthesis are needed.
|
|
79
|
+
const input = `local y = 4.2 print(y.."")`;
|
|
80
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
81
|
+
expect(output).toContain(`(4.2)..""`);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=lua_processor.test.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const math_1 = require("./math");
|
|
4
|
+
describe('Math utilities', () => {
|
|
5
|
+
describe('clamp', () => {
|
|
6
|
+
it('should return the value when within range', () => {
|
|
7
|
+
expect((0, math_1.clamp)(5, 0, 10)).toBe(5);
|
|
8
|
+
expect((0, math_1.clamp)(0, 0, 10)).toBe(0);
|
|
9
|
+
expect((0, math_1.clamp)(10, 0, 10)).toBe(10);
|
|
10
|
+
});
|
|
11
|
+
it('should clamp to minimum when value is too low', () => {
|
|
12
|
+
expect((0, math_1.clamp)(-5, 0, 10)).toBe(0);
|
|
13
|
+
expect((0, math_1.clamp)(-100, 0, 10)).toBe(0);
|
|
14
|
+
expect((0, math_1.clamp)(1, 1, 10)).toBe(1);
|
|
15
|
+
expect((0, math_1.clamp)(1.001, 1, 10)).toBe(1.001);
|
|
16
|
+
expect((0, math_1.clamp)(0.9999, 1, 10)).toBe(1);
|
|
17
|
+
});
|
|
18
|
+
it('should clamp to maximum when value is too high', () => {
|
|
19
|
+
expect((0, math_1.clamp)(15, 0, 10)).toBe(10);
|
|
20
|
+
expect((0, math_1.clamp)(100, 0, 10)).toBe(10);
|
|
21
|
+
expect((0, math_1.clamp)(10, 0, 10)).toBe(10);
|
|
22
|
+
expect((0, math_1.clamp)(9.999, 0, 10)).toBe(9.999);
|
|
23
|
+
expect((0, math_1.clamp)(10.001, 0, 10)).toBe(10);
|
|
24
|
+
});
|
|
25
|
+
it('should work with negative ranges', () => {
|
|
26
|
+
expect((0, math_1.clamp)(-5, -10, -1)).toBe(-5);
|
|
27
|
+
expect((0, math_1.clamp)(-15, -10, -1)).toBe(-10);
|
|
28
|
+
expect((0, math_1.clamp)(0, -10, -1)).toBe(-1);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=math.test.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cartWriter_1 = require("./cartWriter");
|
|
4
|
+
const cartLoader_1 = require("./cartLoader");
|
|
5
|
+
describe("TIC-80 cart bank support", () => {
|
|
6
|
+
it("should round-trip banked chunks", async () => {
|
|
7
|
+
const chunks = [
|
|
8
|
+
{ chunkType: "CODE", bank: 0, data: new Uint8Array([1, 2, 3]) },
|
|
9
|
+
{ chunkType: "CODE", bank: 1, data: new Uint8Array([4, 5]) },
|
|
10
|
+
];
|
|
11
|
+
const output = await (0, cartWriter_1.AssembleTic80Cart)({ chunks });
|
|
12
|
+
const parsed = (0, cartLoader_1.parseTic80Cart)(output);
|
|
13
|
+
expect(parsed.chunks).toHaveLength(2);
|
|
14
|
+
expect(parsed.chunks[0].chunkType).toBe("CODE");
|
|
15
|
+
expect(parsed.chunks[0].bank).toBe(0);
|
|
16
|
+
expect(Array.from(parsed.chunks[0].data)).toEqual([1, 2, 3]);
|
|
17
|
+
expect(parsed.chunks[1].chunkType).toBe("CODE");
|
|
18
|
+
expect(parsed.chunks[1].bank).toBe(1);
|
|
19
|
+
expect(Array.from(parsed.chunks[1].data)).toEqual([4, 5]);
|
|
20
|
+
});
|
|
21
|
+
it("should reject duplicate chunk type in same bank", async () => {
|
|
22
|
+
const chunks = [
|
|
23
|
+
{ chunkType: "CODE", bank: 0, data: new Uint8Array([1]) },
|
|
24
|
+
{ chunkType: "CODE", bank: 0, data: new Uint8Array([2]) },
|
|
25
|
+
];
|
|
26
|
+
await expect((0, cartWriter_1.AssembleTic80Cart)({ chunks })).rejects.toThrow("Duplicate chunk type in TIC-80 cart: CODE bank 0");
|
|
27
|
+
});
|
|
28
|
+
it("should validate bank index against chunk capabilities", async () => {
|
|
29
|
+
const chunks = [{ chunkType: "CODE_COMPRESSED", bank: 1, data: new Uint8Array([1]) }];
|
|
30
|
+
await expect((0, cartWriter_1.AssembleTic80Cart)({ chunks })).rejects.toThrow("Bank index 1 out of range for chunk CODE_COMPRESSED (0..0)");
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=bankSupport.test.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const kTic80CartChunkTypes: {
|
|
2
2
|
readonly $key: "TILES" | "SPRITES" | "MAP" | "CODE" | "FLAGS" | "SFX" | "WAVEFORMS" | "PALETTE" | "MUSIC_TRACKS" | "MUSIC_PATTERNS" | "CODE_COMPRESSED" | "DEFAULT" | "SCREEN" | "CODE_WASM";
|
|
3
|
-
readonly $value:
|
|
3
|
+
readonly $value: 1 | 2 | 4 | 5 | 6 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | 19;
|
|
4
4
|
readonly $info: ({
|
|
5
5
|
key: "TILES";
|
|
6
6
|
} & {
|
|
@@ -332,7 +332,7 @@ export declare const kTic80CartChunkTypes: {
|
|
|
332
332
|
readonly deprecated: false;
|
|
333
333
|
};
|
|
334
334
|
};
|
|
335
|
-
readonly infoByValue: Map<
|
|
335
|
+
readonly infoByValue: Map<1 | 2 | 4 | 5 | 6 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | 19, ({
|
|
336
336
|
key: "TILES";
|
|
337
337
|
} & {
|
|
338
338
|
readonly value: 1;
|
|
@@ -431,9 +431,9 @@ export declare const kTic80CartChunkTypes: {
|
|
|
431
431
|
readonly sizePerBank: 0;
|
|
432
432
|
readonly deprecated: false;
|
|
433
433
|
})>;
|
|
434
|
-
readonly keyByValue: Map<
|
|
434
|
+
readonly keyByValue: Map<1 | 2 | 4 | 5 | 6 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | 19, "TILES" | "SPRITES" | "MAP" | "CODE" | "FLAGS" | "SFX" | "WAVEFORMS" | "PALETTE" | "MUSIC_TRACKS" | "MUSIC_PATTERNS" | "CODE_COMPRESSED" | "DEFAULT" | "SCREEN" | "CODE_WASM">;
|
|
435
435
|
readonly keys: ["TILES" | "SPRITES" | "MAP" | "CODE" | "FLAGS" | "SFX" | "WAVEFORMS" | "PALETTE" | "MUSIC_TRACKS" | "MUSIC_PATTERNS" | "CODE_COMPRESSED" | "DEFAULT" | "SCREEN" | "CODE_WASM", ...("TILES" | "SPRITES" | "MAP" | "CODE" | "FLAGS" | "SFX" | "WAVEFORMS" | "PALETTE" | "MUSIC_TRACKS" | "MUSIC_PATTERNS" | "CODE_COMPRESSED" | "DEFAULT" | "SCREEN" | "CODE_WASM")[]];
|
|
436
|
-
readonly values: (
|
|
436
|
+
readonly values: (1 | 2 | 4 | 5 | 6 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | 19)[];
|
|
437
437
|
readonly infos: (({
|
|
438
438
|
key: "TILES";
|
|
439
439
|
} & {
|
|
@@ -533,7 +533,7 @@ export declare const kTic80CartChunkTypes: {
|
|
|
533
533
|
readonly sizePerBank: 0;
|
|
534
534
|
readonly deprecated: false;
|
|
535
535
|
}))[];
|
|
536
|
-
readonly valuesSet: Set<
|
|
536
|
+
readonly valuesSet: Set<1 | 2 | 4 | 5 | 6 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | 19>;
|
|
537
537
|
readonly keysSet: Set<"TILES" | "SPRITES" | "MAP" | "CODE" | "FLAGS" | "SFX" | "WAVEFORMS" | "PALETTE" | "MUSIC_TRACKS" | "MUSIC_PATTERNS" | "CODE_COMPRESSED" | "DEFAULT" | "SCREEN" | "CODE_WASM">;
|
|
538
538
|
readonly isValidKey: (k: any) => k is "TILES" | "SPRITES" | "MAP" | "CODE" | "FLAGS" | "SFX" | "WAVEFORMS" | "PALETTE" | "MUSIC_TRACKS" | "MUSIC_PATTERNS" | "CODE_COMPRESSED" | "DEFAULT" | "SCREEN" | "CODE_WASM";
|
|
539
539
|
readonly coerceByKey: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionString.d.ts","sourceRoot":"","sources":["../../src/utils/versionString.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"versionString.d.ts","sourceRoot":"","sources":["../../src/utils/versionString.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAMF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAQ9D;AAID,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAGD,wBAAgB,4BAA4B,IAAI,MAAM,CAErD"}
|
|
@@ -5,17 +5,13 @@ exports.getAppVersionString = getAppVersionString;
|
|
|
5
5
|
exports.getAppVersionAndCommitString = getAppVersionAndCommitString;
|
|
6
6
|
const buildInfo_1 = require("../buildInfo");
|
|
7
7
|
// Version tag is like:
|
|
8
|
-
// - v1
|
|
9
|
-
// - v1
|
|
10
|
-
// - v1+290(!)
|
|
8
|
+
// - v1.0.2
|
|
9
|
+
// - v1.0.2(!)
|
|
11
10
|
// - unknown
|
|
12
11
|
function getBuildVersionTag(info) {
|
|
13
|
-
if (!info.
|
|
12
|
+
if (!info.version)
|
|
14
13
|
return "unknown";
|
|
15
|
-
let str =
|
|
16
|
-
if (info.commitsSinceTag && info.commitsSinceTag > 0) {
|
|
17
|
-
str += `+${info.commitsSinceTag}`;
|
|
18
|
-
}
|
|
14
|
+
let str = `v${info.version}`;
|
|
19
15
|
if (info.dirty) {
|
|
20
16
|
str += "(!)";
|
|
21
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionString.js","sourceRoot":"","sources":["../../src/utils/versionString.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"versionString.js","sourceRoot":"","sources":["../../src/utils/versionString.ts"],"names":[],"mappings":";;AA2BA,gDAQC;AAID,kDAEC;AAGD,oEAEC;AA9CD,4CAAyC;AAuBzC,uBAAuB;AACvB,WAAW;AACX,cAAc;AACd,YAAY;AACZ,SAAgB,kBAAkB,CAAC,IAAmB;IACpD,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAEpC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;IAC7B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,GAAG,IAAI,KAAK,CAAC;IACf,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,+BAA+B;AAC/B,gCAAgC;AAChC,SAAgB,mBAAmB;IACjC,OAAO,YAAY,kBAAkB,CAAC,qBAAS,CAAC,EAAE,CAAC;AACrD,CAAC;AAED,6CAA6C;AAC7C,SAAgB,4BAA4B;IAC1C,OAAO,YAAY,kBAAkB,CAAC,qBAAS,CAAC,KAAK,qBAAS,CAAC,UAAU,IAAI,SAAS,GAAG,CAAC;AAC5F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ticbuild",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A build & watch system for TIC-80",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -28,6 +28,14 @@
|
|
|
28
28
|
"url": "https://github.com/thenfour/ticbuild"
|
|
29
29
|
},
|
|
30
30
|
"license": "ISC",
|
|
31
|
+
"files": [
|
|
32
|
+
".attachments/",
|
|
33
|
+
"dist/",
|
|
34
|
+
"templates/",
|
|
35
|
+
"README.md",
|
|
36
|
+
"LICENSE",
|
|
37
|
+
"ticbuild.schema.json"
|
|
38
|
+
],
|
|
31
39
|
"devDependencies": {
|
|
32
40
|
"@types/jest": "^29.0.0",
|
|
33
41
|
"@types/node": "^20.0.0",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// paths are always relative to the manifest file's dir (which defines the project root dir)
|
|
2
|
+
{
|
|
3
|
+
"$schema": "./ticbuild.schema.json",
|
|
4
|
+
"project": {
|
|
5
|
+
"name": "{{PROJECT_NAME}}",
|
|
6
|
+
"includeDirs": [
|
|
7
|
+
"./src"
|
|
8
|
+
],
|
|
9
|
+
"importDirs": [
|
|
10
|
+
"./assets"
|
|
11
|
+
],
|
|
12
|
+
"binDir": "./dist/bin",
|
|
13
|
+
"objDir": "./dist/obj",
|
|
14
|
+
"outputCartName": "$(project.name).tic",
|
|
15
|
+
},
|
|
16
|
+
"variables": {},
|
|
17
|
+
"imports": [
|
|
18
|
+
{
|
|
19
|
+
"name": "maincode",
|
|
20
|
+
"path": "src/main.lua",
|
|
21
|
+
"kind": "LuaCode",
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
"assembly": {
|
|
25
|
+
"lua": {
|
|
26
|
+
"minify": true,
|
|
27
|
+
"globals": {
|
|
28
|
+
"PROJECT_NAME": "$(project.name)",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
"blocks": [
|
|
32
|
+
{
|
|
33
|
+
"chunks": [
|
|
34
|
+
"CODE"
|
|
35
|
+
],
|
|
36
|
+
"asset": "maincode",
|
|
37
|
+
"code": {
|
|
38
|
+
"emitGlobals": true,
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
}
|
package/.env.example
DELETED
package/.prettierignore
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./ticbuild.schema.json",
|
|
3
|
-
"project": {
|
|
4
|
-
"name": "example-game",
|
|
5
|
-
"includeDirs": [
|
|
6
|
-
"./src",
|
|
7
|
-
"./include"
|
|
8
|
-
],
|
|
9
|
-
"binDir": "./debug/bin",
|
|
10
|
-
"objDir": "./debug/obj",
|
|
11
|
-
"outputCartName": "example-game.tic"
|
|
12
|
-
},
|
|
13
|
-
"variables": {
|
|
14
|
-
"version": "3.0.0",
|
|
15
|
-
"author": "Example Developer",
|
|
16
|
-
"$schema": "./ticbuild.schema.json",
|
|
17
|
-
"project.name": "example-game",
|
|
18
|
-
"project.binDir": "./debug/bin",
|
|
19
|
-
"project.objDir": "./debug/obj",
|
|
20
|
-
"project.outputCartName": "example-game.tic",
|
|
21
|
-
"variables.version": "3.0.0",
|
|
22
|
-
"variables.author": "Example Developer",
|
|
23
|
-
"assembly.lua.minify": "false",
|
|
24
|
-
"buildConfigurations.debug.project.binDir": "./debug/bin",
|
|
25
|
-
"buildConfigurations.debug.project.objDir": "./debug/obj",
|
|
26
|
-
"buildConfigurations.debug.variables.version": "3.0.0",
|
|
27
|
-
"buildConfigurations.debug.assembly.lua.minify": "false"
|
|
28
|
-
},
|
|
29
|
-
"imports": [
|
|
30
|
-
{
|
|
31
|
-
"name": "maincode",
|
|
32
|
-
"path": "main.lua",
|
|
33
|
-
"kind": "LuaCode"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"name": "graphics",
|
|
37
|
-
"path": "./assets/sprites.tic",
|
|
38
|
-
"kind": "Tic80Cartridge",
|
|
39
|
-
"chunks": [
|
|
40
|
-
"TILES",
|
|
41
|
-
"SPRITES"
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"name": "music",
|
|
46
|
-
"path": "./assets/song.tic",
|
|
47
|
-
"kind": "Tic80Cartridge",
|
|
48
|
-
"chunks": [
|
|
49
|
-
"MUSIC_WAVEFORMS",
|
|
50
|
-
"MUSIC_PATTERNS",
|
|
51
|
-
"MUSIC_SFX",
|
|
52
|
-
"MUSIC_SONG"
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
"assembly": {
|
|
57
|
-
"lua": {
|
|
58
|
-
"minify": false
|
|
59
|
-
},
|
|
60
|
-
"blocks": [
|
|
61
|
-
{
|
|
62
|
-
"chunks": [
|
|
63
|
-
"CODE"
|
|
64
|
-
],
|
|
65
|
-
"asset": {
|
|
66
|
-
"import": "maincode"
|
|
67
|
-
},
|
|
68
|
-
"assembler": "LuaCode"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"asset": {
|
|
72
|
-
"import": "graphics",
|
|
73
|
-
"chunks": [
|
|
74
|
-
"TILES",
|
|
75
|
-
"SPRITES"
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"asset": {
|
|
81
|
-
"import": "music",
|
|
82
|
-
"chunks": [
|
|
83
|
-
"MUSIC_WAVEFORMS",
|
|
84
|
-
"MUSIC_PATTERNS",
|
|
85
|
-
"MUSIC_SFX",
|
|
86
|
-
"MUSIC_SONG"
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
},
|
|
92
|
-
"buildConfigurations": {
|
|
93
|
-
"debug": {
|
|
94
|
-
"project": {
|
|
95
|
-
"binDir": "./debug/bin",
|
|
96
|
-
"objDir": "./debug/obj"
|
|
97
|
-
},
|
|
98
|
-
"variables": {
|
|
99
|
-
"version": "3.0.0"
|
|
100
|
-
},
|
|
101
|
-
"assembly": {
|
|
102
|
-
"lua": {
|
|
103
|
-
"minify": false
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
package/example.ticbuild.jsonc
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./ticbuild.schema.json",
|
|
3
|
-
// Example manifest for a TIC-80 project
|
|
4
|
-
"project": {
|
|
5
|
-
"name": "example",
|
|
6
|
-
"includeDirs": [
|
|
7
|
-
"./src",
|
|
8
|
-
"./include"
|
|
9
|
-
],
|
|
10
|
-
"binDir": "./dist/bin",
|
|
11
|
-
"objDir": "./dist/obj",
|
|
12
|
-
"outputCartName": "example.tic",
|
|
13
|
-
},
|
|
14
|
-
"variables": {
|
|
15
|
-
"version": "1.0.0",
|
|
16
|
-
"author": "Example Developer",
|
|
17
|
-
},
|
|
18
|
-
"imports": [
|
|
19
|
-
{
|
|
20
|
-
"name": "maincode",
|
|
21
|
-
"path": "main.lua",
|
|
22
|
-
"kind": "LuaCode",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"name": "graphics",
|
|
26
|
-
"path": "./assets/sprites.tic",
|
|
27
|
-
"kind": "Tic80Cartridge",
|
|
28
|
-
"chunks": [
|
|
29
|
-
"TILES",
|
|
30
|
-
"SFX"
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "music",
|
|
35
|
-
"path": "./assets/song.tic",
|
|
36
|
-
"kind": "Tic80Cartridge",
|
|
37
|
-
"chunks": [
|
|
38
|
-
"WAVEFORMS",
|
|
39
|
-
"MUSIC_PATTERNS",
|
|
40
|
-
"SFX",
|
|
41
|
-
"MUSIC_TRACKS"
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
"assembly": {
|
|
46
|
-
"lua": {
|
|
47
|
-
"minify": true,
|
|
48
|
-
},
|
|
49
|
-
"blocks": [
|
|
50
|
-
{
|
|
51
|
-
"chunks": [
|
|
52
|
-
"CODE"
|
|
53
|
-
],
|
|
54
|
-
"asset": "maincode",
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"asset": {
|
|
58
|
-
"import": "graphics",
|
|
59
|
-
"chunks": [
|
|
60
|
-
"TILES",
|
|
61
|
-
"SPRITES"
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"asset": {
|
|
67
|
-
"import": "music",
|
|
68
|
-
"chunks": [
|
|
69
|
-
"WAVEFORMS",
|
|
70
|
-
"MUSIC_PATTERNS",
|
|
71
|
-
"SFX",
|
|
72
|
-
"MUSIC_TRACKS"
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
"buildConfigurations": {
|
|
79
|
-
"debug": {
|
|
80
|
-
"project": {
|
|
81
|
-
"binDir": "./debug/bin",
|
|
82
|
-
"objDir": "./debug/obj",
|
|
83
|
-
},
|
|
84
|
-
"variables": {
|
|
85
|
-
"version": "1.0.0-debug",
|
|
86
|
-
},
|
|
87
|
-
"assembly": {
|
|
88
|
-
"lua": {
|
|
89
|
-
"minify": false,
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
}
|
package/ticbuild-1.0.1.tgz
DELETED
|
Binary file
|