@kumikijs/compiler 0.1.0

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/node.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ //#region src/node.d.ts
2
+ /**
3
+ * Reads the prebuilt @kumikijs/runtime bundle from disk. Pass as
4
+ * `compile(source, { bundle: true, readRuntimeBundle: nodeRuntimeBundleReader })`.
5
+ */
6
+ declare function nodeRuntimeBundleReader(): string;
7
+ //#endregion
8
+ export { nodeRuntimeBundleReader };
package/dist/node.js ADDED
@@ -0,0 +1,12 @@
1
+ import { createRequire } from "node:module";
2
+ import { readFileSync } from "node:fs";
3
+ //#region src/node.ts
4
+ /**
5
+ * Reads the prebuilt @kumikijs/runtime bundle from disk. Pass as
6
+ * `compile(source, { bundle: true, readRuntimeBundle: nodeRuntimeBundleReader })`.
7
+ */
8
+ function nodeRuntimeBundleReader() {
9
+ return readFileSync(createRequire(import.meta.url).resolve("@kumikijs/runtime/bundle"), "utf8");
10
+ }
11
+ //#endregion
12
+ export { nodeRuntimeBundleReader };
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@kumikijs/compiler",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Kumiki compiler — lexer, parser, typechecker, and code generator.",
6
+ "license": "Apache-2.0",
7
+ "author": "kage1020",
8
+ "homepage": "https://github.com/kage1020/Kumiki/tree/main/packages/compiler#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/kage1020/Kumiki.git",
12
+ "directory": "packages/compiler"
13
+ },
14
+ "bugs": "https://github.com/kage1020/Kumiki/issues",
15
+ "keywords": [
16
+ "kumiki",
17
+ "ai-first",
18
+ "compiler",
19
+ "dsl",
20
+ "codegen",
21
+ "language"
22
+ ],
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "default": "./src/index.ts"
30
+ },
31
+ "./node": {
32
+ "types": "./dist/node.d.ts",
33
+ "default": "./src/node.ts"
34
+ }
35
+ },
36
+ "files": [
37
+ "dist"
38
+ ],
39
+ "publishConfig": {
40
+ "access": "public",
41
+ "provenance": true,
42
+ "exports": {
43
+ ".": {
44
+ "types": "./dist/index.d.ts",
45
+ "import": "./dist/index.js"
46
+ },
47
+ "./node": {
48
+ "types": "./dist/node.d.ts",
49
+ "import": "./dist/node.js"
50
+ }
51
+ }
52
+ },
53
+ "scripts": {
54
+ "build": "tsdown",
55
+ "typecheck": "tsc -p tsconfig.json --noEmit",
56
+ "test": "vitest run",
57
+ "lint": "biome check src test"
58
+ },
59
+ "dependencies": {
60
+ "@kumikijs/runtime": "workspace:*"
61
+ },
62
+ "devDependencies": {
63
+ "@types/node": "catalog:",
64
+ "typescript": "catalog:",
65
+ "vitest": "catalog:"
66
+ }
67
+ }