@vyckr/tachyon 1.1.10 → 1.2.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.
Files changed (49) hide show
  1. package/.env.example +7 -4
  2. package/LICENSE +21 -0
  3. package/README.md +210 -90
  4. package/package.json +50 -33
  5. package/src/cli/bundle.ts +37 -0
  6. package/src/cli/serve.ts +100 -0
  7. package/src/{client/template.js → compiler/render-template.js} +10 -17
  8. package/src/compiler/template-compiler.ts +419 -0
  9. package/src/runtime/hot-reload-client.ts +15 -0
  10. package/src/{client/dev.html → runtime/shells/development.html} +2 -2
  11. package/src/runtime/shells/not-found.html +73 -0
  12. package/src/{client/prod.html → runtime/shells/production.html} +1 -1
  13. package/src/runtime/spa-renderer.ts +439 -0
  14. package/src/server/console-logger.ts +39 -0
  15. package/src/server/process-executor.ts +287 -0
  16. package/src/server/process-pool.ts +80 -0
  17. package/src/server/route-handler.ts +229 -0
  18. package/src/server/schema-validator.ts +161 -0
  19. package/bun.lock +0 -127
  20. package/components/clicker.html +0 -30
  21. package/deno.lock +0 -19
  22. package/go.mod +0 -3
  23. package/lib/gson-2.3.jar +0 -0
  24. package/main.js +0 -13
  25. package/routes/DELETE +0 -18
  26. package/routes/GET +0 -17
  27. package/routes/HTML +0 -131
  28. package/routes/POST +0 -32
  29. package/routes/SOCKET +0 -26
  30. package/routes/api/:version/DELETE +0 -10
  31. package/routes/api/:version/GET +0 -29
  32. package/routes/api/:version/PATCH +0 -24
  33. package/routes/api/GET +0 -29
  34. package/routes/api/POST +0 -16
  35. package/routes/api/PUT +0 -21
  36. package/src/client/404.html +0 -7
  37. package/src/client/dist.ts +0 -20
  38. package/src/client/hmr.ts +0 -12
  39. package/src/client/render.ts +0 -417
  40. package/src/client/routes.json +0 -1
  41. package/src/client/yon.ts +0 -360
  42. package/src/router.ts +0 -186
  43. package/src/serve.ts +0 -147
  44. package/src/server/logger.ts +0 -31
  45. package/src/server/tach.ts +0 -238
  46. package/tests/index.test.ts +0 -110
  47. package/tests/stream.ts +0 -24
  48. package/tests/worker.ts +0 -7
  49. package/tsconfig.json +0 -17
@@ -0,0 +1,161 @@
1
+ import Router from "./route-handler.js"
2
+
3
+ export default class Validate {
4
+
5
+ /**
6
+ * Strips modifier characters (`?`, `$`, `^`) from a schema key and wraps
7
+ * keys containing special characters in quotes for safe property access.
8
+ */
9
+ static sanitizePropertyName(key: string): string {
10
+ const cleanKey = key.replace('?', '').replace('$', '').replace('^', '')
11
+ return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(cleanKey) ? cleanKey : `"${cleanKey}"`
12
+ }
13
+
14
+ /**
15
+ * Recursively validates a data object against a schema definition.
16
+ * Mutates `data` in place when applying nullable default values.
17
+ */
18
+ static validateObject(
19
+ data: Record<string, unknown>,
20
+ subSchema: Record<string, unknown>,
21
+ route: string,
22
+ parentRoute: string,
23
+ path?: string,
24
+ ): Record<string, unknown> {
25
+
26
+ for (const dataKey in data) {
27
+ if (!(dataKey in subSchema) && !(`^${dataKey}$` in subSchema) && !(`${dataKey}?` in subSchema)) {
28
+ throw new Error(`Property '${dataKey}' does not exist in the '${route}' route schema`)
29
+ }
30
+ }
31
+
32
+ for (let schemaKey in subSchema) {
33
+
34
+ const schemaValue = subSchema[schemaKey]
35
+ const sanitizedKey = Validate.sanitizePropertyName(schemaKey)
36
+ const dataValue = data[sanitizedKey]
37
+ const valueIsDefined = dataValue !== null && dataValue !== undefined
38
+ const fullPath = path ? `${path}.${sanitizedKey}` : sanitizedKey
39
+ const isNullable = schemaKey.endsWith('?')
40
+
41
+ schemaKey = isNullable ? schemaKey.replace('?', '') : schemaKey
42
+
43
+ const expectedType = typeof schemaValue
44
+ const actualType = typeof dataValue
45
+ const hasRegex = schemaKey.startsWith('^') && schemaKey.endsWith('$') && expectedType === "string"
46
+
47
+ let regEx: RegExp | undefined
48
+
49
+ try {
50
+ if (hasRegex) regEx = new RegExp(schemaValue as string)
51
+ } catch {
52
+ throw new Error(`Invalid RegEx pattern for '${fullPath}' in '${parentRoute}' route`)
53
+ }
54
+
55
+ schemaKey = hasRegex ? schemaKey.replace('^', '').replace('$', '') : schemaKey
56
+
57
+ const hasDefaultValue = (schemaValue !== "" || !Object.is(schemaValue, -0) || Array.isArray(schemaValue)) && !hasRegex
58
+
59
+ if (actualType !== expectedType && !isNullable) {
60
+ throw new Error(
61
+ `Type mismatch for '${fullPath}' in '${parentRoute}' route: ` +
62
+ `expected '${expectedType}' but got '${actualType}'`
63
+ )
64
+ }
65
+
66
+ if (!valueIsDefined && !isNullable) {
67
+ throw new Error(`Property '${fullPath}' cannot be null or undefined in '${parentRoute}' route`)
68
+ }
69
+
70
+ if (valueIsDefined && hasRegex && !regEx!.test(dataValue as string)) {
71
+ throw new Error(`RegEx pattern fails for property '${fullPath}' in '${parentRoute}' route`)
72
+ }
73
+
74
+ if (!valueIsDefined && isNullable && hasDefaultValue) {
75
+ data[schemaKey] = schemaValue
76
+ }
77
+
78
+ if (valueIsDefined && expectedType === "object" && !Array.isArray(dataValue)) {
79
+ const entries = Object.entries(schemaValue as Record<string, unknown>)
80
+ const isEmpty = entries.some(([key]) => key === "")
81
+
82
+ if (!isEmpty) {
83
+ data[schemaKey] = Validate.validateObject(
84
+ dataValue as Record<string, unknown>,
85
+ schemaValue as Record<string, unknown>,
86
+ route, parentRoute, fullPath,
87
+ )
88
+ } else {
89
+ const [, value] = entries[0]
90
+ for (const [k, v] of Object.entries(dataValue as Record<string, unknown>)) {
91
+ if (typeof v !== typeof value) {
92
+ throw new Error(
93
+ `Type mismatch for '${fullPath}.${k}' in '${parentRoute}' route: ` +
94
+ `expected '${typeof value}' but got '${typeof v}'`
95
+ )
96
+ }
97
+ }
98
+ }
99
+ }
100
+
101
+ if (valueIsDefined && expectedType === "object" && Array.isArray(dataValue) && Array.isArray(schemaValue)) {
102
+ const dataTypes = Array.from(new Set((dataValue as unknown[]).map(v => typeof v)))
103
+ const schemaTypes = Array.from(new Set((schemaValue as unknown[]).map(v => typeof v)))
104
+
105
+ for (const dataType of dataTypes) {
106
+ if (!schemaTypes.includes(dataType)) {
107
+ throw new Error(
108
+ `Type mismatch for '${fullPath}' in '${parentRoute}' route: ` +
109
+ `'${dataType}' is not included in [${schemaTypes.join(',')}]`
110
+ )
111
+ }
112
+ }
113
+ }
114
+ }
115
+
116
+ return data
117
+ }
118
+
119
+ /**
120
+ * Validates `data` against the schema loaded at startup for `route`.
121
+ * Uses {@link Router.routeConfigs} — the single source of truth already
122
+ * populated during `validateRoutes()` — instead of re-reading OPTIONS
123
+ * files from disk.
124
+ */
125
+ static async validateData(
126
+ route: string,
127
+ io: 'req' | 'err' | 'res',
128
+ data: Record<string, unknown> | string,
129
+ ) {
130
+ const parts = route.split('/')
131
+ const method = parts.pop()!
132
+ const absoluteDir = parts.join('/')
133
+ const relativeRoute = absoluteDir.replace(Router.routesPath, '') || '/'
134
+
135
+ const schema = Router.routeConfigs[relativeRoute] as unknown as Record<string, unknown>
136
+
137
+ if (!schema) {
138
+ throw new Error(`No validation schema found for route '${relativeRoute}'`)
139
+ }
140
+
141
+ const applyValidation = (target: Record<string, unknown>) => {
142
+ const methodSchema = (schema as Record<string, Record<string, Record<string, unknown>>>)[method]
143
+ if (methodSchema?.[io]) {
144
+ Validate.validateObject(target, methodSchema[io], route, relativeRoute)
145
+ }
146
+ }
147
+
148
+ if (typeof data === "string") {
149
+ let parsed: unknown
150
+
151
+ try { parsed = JSON.parse(data) }
152
+ catch { parsed = data }
153
+
154
+ if (typeof parsed === "object" && parsed !== null) {
155
+ applyValidation(parsed as Record<string, unknown>)
156
+ }
157
+ } else {
158
+ applyValidation(data)
159
+ }
160
+ }
161
+ }
package/bun.lock DELETED
@@ -1,127 +0,0 @@
1
- {
2
- "lockfileVersion": 1,
3
- "workspaces": {
4
- "": {
5
- "name": "@vyckr/tachyon",
6
- "dependencies": {
7
- "dayjs": "^1.11.13",
8
- "jsdom": "^26.0.0",
9
- },
10
- "devDependencies": {
11
- "@types/bun": "~1.2.8",
12
- "@types/deno": "^2.0.0",
13
- "@types/jsdom": "^21.1.7",
14
- "@types/node": "^20.4.2",
15
- },
16
- },
17
- },
18
- "packages": {
19
- "@asamuzakjp/css-color": ["@asamuzakjp/css-color@2.8.3", "", { "dependencies": { "@csstools/css-calc": "^2.1.1", "@csstools/css-color-parser": "^3.0.7", "@csstools/css-parser-algorithms": "^3.0.4", "@csstools/css-tokenizer": "^3.0.3", "lru-cache": "^10.4.3" } }, "sha512-GIc76d9UI1hCvOATjZPyHFmE5qhRccp3/zGfMPapK3jBi+yocEzp6BBB0UnfRYP9NP4FANqUZYb0hnfs3TM3hw=="],
20
-
21
- "@csstools/color-helpers": ["@csstools/color-helpers@5.0.1", "", {}, "sha512-MKtmkA0BX87PKaO1NFRTFH+UnkgnmySQOvNxJubsadusqPEC2aJ9MOQiMceZJJ6oitUl/i0L6u0M1IrmAOmgBA=="],
22
-
23
- "@csstools/css-calc": ["@csstools/css-calc@2.1.1", "", { "peerDependencies": { "@csstools/css-parser-algorithms": "^3.0.4", "@csstools/css-tokenizer": "^3.0.3" } }, "sha512-rL7kaUnTkL9K+Cvo2pnCieqNpTKgQzy5f+N+5Iuko9HAoasP+xgprVh7KN/MaJVvVL1l0EzQq2MoqBHKSrDrag=="],
24
-
25
- "@csstools/css-color-parser": ["@csstools/css-color-parser@3.0.7", "", { "dependencies": { "@csstools/color-helpers": "^5.0.1", "@csstools/css-calc": "^2.1.1" }, "peerDependencies": { "@csstools/css-parser-algorithms": "^3.0.4", "@csstools/css-tokenizer": "^3.0.3" } }, "sha512-nkMp2mTICw32uE5NN+EsJ4f5N+IGFeCFu4bGpiKgb2Pq/7J/MpyLBeQ5ry4KKtRFZaYs6sTmcMYrSRIyj5DFKA=="],
26
-
27
- "@csstools/css-parser-algorithms": ["@csstools/css-parser-algorithms@3.0.4", "", { "peerDependencies": { "@csstools/css-tokenizer": "^3.0.3" } }, "sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A=="],
28
-
29
- "@csstools/css-tokenizer": ["@csstools/css-tokenizer@3.0.3", "", {}, "sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw=="],
30
-
31
- "@types/bun": ["@types/bun@1.2.8", "", { "dependencies": { "bun-types": "1.2.7" } }, "sha512-t8L1RvJVUghW5V+M/fL3Thbxcs0HwNsXsnTEBEfEVqGteiJToOlZ/fyOEaR1kZsNqnu+3XA4RI/qmnX4w6+S+w=="],
32
-
33
- "@types/deno": ["@types/deno@2.0.0", "", {}, "sha512-O9/jRVlq93kqfkl4sYR5N7+Pz4ukzXVIbMnE/VgvpauNHsvjQ9iBVnJ3X0gAvMa2khcoFD8DSO7mQVCuiuDMPg=="],
34
-
35
- "@types/jsdom": ["@types/jsdom@21.1.7", "", { "dependencies": { "@types/node": "*", "@types/tough-cookie": "*", "parse5": "^7.0.0" } }, "sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA=="],
36
-
37
- "@types/node": ["@types/node@20.17.17", "", { "dependencies": { "undici-types": "~6.19.2" } }, "sha512-/WndGO4kIfMicEQLTi/mDANUu/iVUhT7KboZPdEqqHQ4aTS+3qT3U5gIqWDFV+XouorjfgGqvKILJeHhuQgFYg=="],
38
-
39
- "@types/tough-cookie": ["@types/tough-cookie@4.0.5", "", {}, "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA=="],
40
-
41
- "@types/ws": ["@types/ws@8.5.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw=="],
42
-
43
- "agent-base": ["agent-base@7.1.3", "", {}, "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw=="],
44
-
45
- "asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="],
46
-
47
- "bun-types": ["bun-types@1.2.7", "", { "dependencies": { "@types/node": "*", "@types/ws": "*" } }, "sha512-P4hHhk7kjF99acXqKvltyuMQ2kf/rzIw3ylEDpCxDS9Xa0X0Yp/gJu/vDCucmWpiur5qJ0lwB2bWzOXa2GlHqA=="],
48
-
49
- "combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="],
50
-
51
- "cssstyle": ["cssstyle@4.2.1", "", { "dependencies": { "@asamuzakjp/css-color": "^2.8.2", "rrweb-cssom": "^0.8.0" } }, "sha512-9+vem03dMXG7gDmZ62uqmRiMRNtinIZ9ZyuF6BdxzfOD+FdN5hretzynkn0ReS2DO2GSw76RWHs0UmJPI2zUjw=="],
52
-
53
- "data-urls": ["data-urls@5.0.0", "", { "dependencies": { "whatwg-mimetype": "^4.0.0", "whatwg-url": "^14.0.0" } }, "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg=="],
54
-
55
- "dayjs": ["dayjs@1.11.13", "", {}, "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="],
56
-
57
- "debug": ["debug@4.4.0", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA=="],
58
-
59
- "decimal.js": ["decimal.js@10.5.0", "", {}, "sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw=="],
60
-
61
- "delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="],
62
-
63
- "entities": ["entities@4.5.0", "", {}, "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="],
64
-
65
- "form-data": ["form-data@4.0.1", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw=="],
66
-
67
- "html-encoding-sniffer": ["html-encoding-sniffer@4.0.0", "", { "dependencies": { "whatwg-encoding": "^3.1.1" } }, "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ=="],
68
-
69
- "http-proxy-agent": ["http-proxy-agent@7.0.2", "", { "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" } }, "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig=="],
70
-
71
- "https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="],
72
-
73
- "iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="],
74
-
75
- "is-potential-custom-element-name": ["is-potential-custom-element-name@1.0.1", "", {}, "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ=="],
76
-
77
- "jsdom": ["jsdom@26.0.0", "", { "dependencies": { "cssstyle": "^4.2.1", "data-urls": "^5.0.0", "decimal.js": "^10.4.3", "form-data": "^4.0.1", "html-encoding-sniffer": "^4.0.0", "http-proxy-agent": "^7.0.2", "https-proxy-agent": "^7.0.6", "is-potential-custom-element-name": "^1.0.1", "nwsapi": "^2.2.16", "parse5": "^7.2.1", "rrweb-cssom": "^0.8.0", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", "tough-cookie": "^5.0.0", "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", "whatwg-encoding": "^3.1.1", "whatwg-mimetype": "^4.0.0", "whatwg-url": "^14.1.0", "ws": "^8.18.0", "xml-name-validator": "^5.0.0" }, "peerDependencies": { "canvas": "^3.0.0" }, "optionalPeers": ["canvas"] }, "sha512-BZYDGVAIriBWTpIxYzrXjv3E/4u8+/pSG5bQdIYCbNCGOvsPkDQfTVLAIXAf9ETdCpduCVTkDe2NNZ8NIwUVzw=="],
78
-
79
- "lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="],
80
-
81
- "mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],
82
-
83
- "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
84
-
85
- "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
86
-
87
- "nwsapi": ["nwsapi@2.2.16", "", {}, "sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ=="],
88
-
89
- "parse5": ["parse5@7.2.1", "", { "dependencies": { "entities": "^4.5.0" } }, "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ=="],
90
-
91
- "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="],
92
-
93
- "rrweb-cssom": ["rrweb-cssom@0.8.0", "", {}, "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw=="],
94
-
95
- "safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
96
-
97
- "saxes": ["saxes@6.0.0", "", { "dependencies": { "xmlchars": "^2.2.0" } }, "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA=="],
98
-
99
- "symbol-tree": ["symbol-tree@3.2.4", "", {}, "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="],
100
-
101
- "tldts": ["tldts@6.1.77", "", { "dependencies": { "tldts-core": "^6.1.77" }, "bin": { "tldts": "bin/cli.js" } }, "sha512-lBpoWgy+kYmuXWQ83+R7LlJCnsd9YW8DGpZSHhrMl4b8Ly/1vzOie3OdtmUJDkKxcgRGOehDu5btKkty+JEe+g=="],
102
-
103
- "tldts-core": ["tldts-core@6.1.77", "", {}, "sha512-bCaqm24FPk8OgBkM0u/SrEWJgHnhBWYqeBo6yUmcZJDCHt/IfyWBb+14CXdGi4RInMv4v7eUAin15W0DoA+Ytg=="],
104
-
105
- "tough-cookie": ["tough-cookie@5.1.1", "", { "dependencies": { "tldts": "^6.1.32" } }, "sha512-Ek7HndSVkp10hmHP9V4qZO1u+pn1RU5sI0Fw+jCU3lyvuMZcgqsNgc6CmJJZyByK4Vm/qotGRJlfgAX8q+4JiA=="],
106
-
107
- "tr46": ["tr46@5.0.0", "", { "dependencies": { "punycode": "^2.3.1" } }, "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g=="],
108
-
109
- "undici-types": ["undici-types@6.19.8", "", {}, "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="],
110
-
111
- "w3c-xmlserializer": ["w3c-xmlserializer@5.0.0", "", { "dependencies": { "xml-name-validator": "^5.0.0" } }, "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA=="],
112
-
113
- "webidl-conversions": ["webidl-conversions@7.0.0", "", {}, "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g=="],
114
-
115
- "whatwg-encoding": ["whatwg-encoding@3.1.1", "", { "dependencies": { "iconv-lite": "0.6.3" } }, "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ=="],
116
-
117
- "whatwg-mimetype": ["whatwg-mimetype@4.0.0", "", {}, "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg=="],
118
-
119
- "whatwg-url": ["whatwg-url@14.1.1", "", { "dependencies": { "tr46": "^5.0.0", "webidl-conversions": "^7.0.0" } }, "sha512-mDGf9diDad/giZ/Sm9Xi2YcyzaFpbdLpJPr+E9fSkyQ7KpQD4SdFcugkRQYzhmfI4KeV4Qpnn2sKPdo+kmsgRQ=="],
120
-
121
- "ws": ["ws@8.18.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw=="],
122
-
123
- "xml-name-validator": ["xml-name-validator@5.0.0", "", {}, "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg=="],
124
-
125
- "xmlchars": ["xmlchars@2.2.0", "", {}, "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw=="],
126
- }
127
- }
@@ -1,30 +0,0 @@
1
- <script>
2
- let title = "Default Title"
3
- let description = "Default description for this component"
4
- let clicks = 0
5
- </script>
6
-
7
- <div class="card component-card">
8
- <h3 class="component-title">{title}</h3>
9
- <p>{description}</p>
10
- <button @click="clicks++">Clicked {clicks} times</button>
11
- </div>
12
-
13
- <style>
14
- .component-card {
15
- border-left: 4px solid #2563eb;
16
- background-color: #f0f7ff;
17
- }
18
- .component-title {
19
- color: #2563eb;
20
- margin-top: 0;
21
- }
22
-
23
- .card {
24
- background-color: white;
25
- border-radius: 8px;
26
- padding: 1.5rem;
27
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
28
- margin-bottom: 1rem;
29
- }
30
- </style>
package/deno.lock DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "version": "3",
3
- "redirects": {
4
- "https://deno.land/x/sleep/mod.ts": "https://deno.land/x/sleep@v1.3.0/mod.ts"
5
- },
6
- "remote": {
7
- "https://deno.land/x/sleep@v1.3.0/mod.ts": "e9955ecd3228a000e29d46726cd6ab14b65cf83904e9b365f3a8d64ec61c1af3",
8
- "https://deno.land/x/sleep@v1.3.0/sleep.ts": "b6abaca093b094b0c2bba94f287b19a60946a8d15764d168f83fcf555f5bb59e"
9
- },
10
- "workspace": {
11
- "packageJson": {
12
- "dependencies": [
13
- "npm:@types/bun@^1.1.14",
14
- "npm:@types/deno@^2.0.0",
15
- "npm:@types/node@^20.4.2"
16
- ]
17
- }
18
- }
19
- }
package/go.mod DELETED
@@ -1,3 +0,0 @@
1
- module TACHYON
2
-
3
- go 1.23.3
package/lib/gson-2.3.jar DELETED
Binary file
package/main.js DELETED
@@ -1,13 +0,0 @@
1
- const link = document.createElement("link")
2
- link.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
3
- link.href = "stylesheet"
4
- document.head.appendChild(link)
5
-
6
- const script = document.createElement('script')
7
- script.type = "module"
8
- script.src = "https://esm.run/@material/web/all.js"
9
- document.head.appendChild(script)
10
-
11
- import("https://esm.run/@material/web/typography/md-typescale-styles.js").then(module => {
12
- document.adoptedStyleSheets.push(module.styles.styleSheet)
13
- })
package/routes/DELETE DELETED
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env dart
2
- import 'dart:convert';
3
- import 'dart:io';
4
-
5
- void main() async {
6
-
7
- print('Executing Dart...');
8
-
9
- await for (final line in stdin.transform(utf8.decoder).transform(const LineSplitter())) {
10
-
11
- var ctx = jsonDecode(line);
12
-
13
- ctx["message"] = "Hello from Dart!";
14
-
15
- await File('/tmp/$pid').writeAsString(jsonEncode(ctx));
16
- }
17
- }
18
-
package/routes/GET DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env bun
2
- for await(const chunk of Bun.stdin.stream()) {
3
-
4
- console.log("Executing Bun....");
5
-
6
- const data = new TextDecoder().decode(chunk)
7
-
8
- const ctx = JSON.parse(data)
9
-
10
- ctx.message = "Hello from Bun!"
11
-
12
- const response = JSON.stringify(ctx)
13
-
14
- await Bun.write(`/tmp/${process.pid}`, response)
15
- }
16
-
17
- export {}
package/routes/HTML DELETED
@@ -1,131 +0,0 @@
1
- <script>
2
- document.title = "Home"
3
-
4
- let count = 0
5
- let showInfo = false
6
- let newTodo = ''
7
- let todos = [
8
- { text: "Learn Yon framework", completed: false },
9
- { text: "Build an application", completed: false }
10
- ]
11
-
12
- let componentTitle = "Component Test"
13
- let componentDesc = "This tests custom components in Yon"
14
-
15
- function addTodo() {
16
- if (newTodo) {
17
- todos = [...todos, { text: newTodo, completed: false }]
18
- newTodo = ''
19
- }
20
- }
21
-
22
- function toggleTodo(index) {
23
- todos = todos.map((todo, i) =>
24
- i === index ? { ...todo, completed: !todo.completed } : todo
25
- )
26
- }
27
-
28
- function removeTodo(index) {
29
- todos = todos.filter((_, i) => i !== index)
30
- }
31
- </script>
32
-
33
- <h1>Yon Framework Test</h1>
34
-
35
- <ty-clicker :clicks="count"/>
36
-
37
- <div class="card">
38
- <h2>Counter Example</h2>
39
- <p>Count: <span>{count}</span></p>
40
- <button @click="count++">Increment</button>
41
- <button @click="count--">Decrement</button>
42
- </div>
43
-
44
- <h2>Todo List</h2>
45
- <input type="text" placeholder="Add new todo" :value="newTodo" />
46
- <button @click="addTodo()">Add</button>
47
-
48
- <ty-loop :for="let i = 0; i < todos.length; i++">
49
- <div class="todo-item">
50
- <input type="checkbox" :checked="todos[i].completed" @change="toggleTodo(i)" />
51
- <span :class="todos[i].completed ? 'completed' : ''">{todos[i].text}</span>
52
- <button @click="removeTodo(i)" style="margin-left: auto; background-color: #ef4444;">Remove</button>
53
- </div>
54
- </ty-loop>
55
-
56
- <ty-logic :if="showInfo">
57
- <div class="card">
58
- <h2>Framework Info</h2>
59
- <p>This is testing the conditional rendering feature of the Yon framework.</p>
60
- <button @click="showInfo = false">Hide Info</button>
61
- </div>
62
- </ty-logic>
63
- <ty-logic :else>
64
- <div class="card">
65
- <button @click="showInfo = true">Show Info</button>
66
- </div>
67
- </ty-logic>
68
-
69
- <ty-clicker :clicks="count"/>
70
-
71
- <style>
72
- body {
73
- font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
74
- line-height: 1.5;
75
- max-width: 800px;
76
- margin: 0 auto;
77
- padding: 1rem;
78
- color: #333;
79
- background-color: #f5f5f5;
80
- }
81
-
82
- .card {
83
- background-color: white;
84
- border-radius: 8px;
85
- padding: 1.5rem;
86
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
87
- margin-bottom: 1rem;
88
- }
89
-
90
- h1 {
91
- color: #2563eb;
92
- }
93
-
94
- button {
95
- background-color: #2563eb;
96
- color: white;
97
- border: none;
98
- border-radius: 4px;
99
- padding: 0.5rem 1rem;
100
- cursor: pointer;
101
- font-size: 1rem;
102
- }
103
-
104
- button:hover {
105
- background-color: #1d4ed8;
106
- }
107
-
108
- input {
109
- padding: 0.5rem;
110
- border: 1px solid #ccc;
111
- border-radius: 4px;
112
- margin-right: 0.5rem;
113
- font-size: 1rem;
114
- }
115
-
116
- .todo-item {
117
- display: flex;
118
- align-items: center;
119
- padding: 0.5rem;
120
- border-bottom: 1px solid #eee;
121
- }
122
-
123
- .todo-item:last-child {
124
- border-bottom: none;
125
- }
126
-
127
- .completed {
128
- text-decoration: line-through;
129
- opacity: 0.7;
130
- }
131
- </style>
package/routes/POST DELETED
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env -S java --source 22 --class-path /Users/iyor/Library/CloudStorage/Dropbox/myProjects/TACHYON/lib/gson-2.3.jar
2
-
3
- import java.io.*;
4
- import com.google.gson.JsonParser;
5
-
6
- public class POST {
7
- public static void main(String[] args) {
8
-
9
- System.out.println("Executing Java...");
10
-
11
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
12
-
13
- try {
14
-
15
- var ctx = new JsonParser().parse(br.readLine()).getAsJsonObject();
16
-
17
- ctx.addProperty("message", "Hello from Java!");
18
-
19
- long pid = ProcessHandle.current().pid();
20
-
21
- try (FileWriter file = new FileWriter("/tmp/" + pid)) {
22
- file.write(ctx.toString());
23
- file.flush();
24
- }
25
-
26
- } catch (IOException e) {
27
- System.err.println("Error writing to file: " + e.getMessage());
28
- } catch (Exception e) {
29
- System.err.println("Error processing JSON: " + e.getMessage());
30
- }
31
- }
32
- }
package/routes/SOCKET DELETED
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env -S deno run --allow-env --allow-write
2
- import { pid } from 'node:process';
3
- import { sleep } from "https://deno.land/x/sleep/mod.ts"
4
-
5
- console.log("Executing Deno Socket....");
6
-
7
- const ctx = JSON.parse("{}")
8
-
9
- ctx.message = "Hello from Deno!"
10
-
11
- const response = JSON.stringify(ctx)
12
-
13
- const max = 2
14
-
15
- let start = 0
16
-
17
- while(start < max) {
18
-
19
- await Deno.writeTextFile(`/tmp/${pid}`, response)
20
-
21
- await sleep(0.1)
22
-
23
- start++
24
- }
25
-
26
- export {}
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'json'
3
-
4
- puts "Executing Ruby...."
5
-
6
- ctx = JSON.parse(ARGF.read)
7
-
8
- ctx["message"] = "Hello from Ruby!"
9
-
10
- File.write("/tmp/#{Process.pid}", JSON.unparse(ctx))
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env rust-script
2
- //! ```cargo
3
- //! [dependencies]
4
- //! serde_json = "1.0.135"
5
- //! ```
6
- use serde_json::{Value};
7
- use std::process;
8
- use std::collections::HashMap;
9
- use std::fs;
10
- use std::io::{self, BufRead};
11
-
12
- fn main() {
13
-
14
- println!("Executing Rust....");
15
-
16
- let stdin = io::stdin();
17
-
18
- for line in stdin.lock().lines() {
19
-
20
- let mut ctx: HashMap<String, Value> = serde_json::from_str(&line.unwrap()).unwrap();
21
-
22
- ctx.insert("message".to_string(), "Hello from Rust!".into());
23
-
24
- // Output the JSON result
25
- let data = serde_json::to_string(&ctx).expect("Failed to serialize JSON");
26
-
27
- fs::write("/tmp/".to_owned() + &process::id().to_string(), data).expect("Unable to write file");
28
- }
29
- }
@@ -1,24 +0,0 @@
1
- #!/usr/bin/perl
2
- use strict;
3
- use warnings;
4
- use JSON;
5
- use Data::Dumper;
6
-
7
- print "Executing Perl...\n";
8
-
9
- # Create JSON decoder object
10
- my $json = JSON->new;
11
-
12
- # Decode the JSON argument
13
- my $ctx = $json->decode(<STDIN>);
14
-
15
- $ctx->{message} = "Hello from Perl!";
16
-
17
- # Open file for writing
18
- open(my $file, '>', "/tmp/$$") or die "Cannot open file: $!";
19
-
20
- # Write JSON encoded response to file
21
- print $file $json->encode($ctx);
22
-
23
- # Close file
24
- close($file);