@vyckr/tachyon 1.3.3 → 1.3.5
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/package.json
CHANGED
|
@@ -240,10 +240,11 @@ export default class Yon {
|
|
|
240
240
|
|
|
241
241
|
let code = await Bun.file(TEMPLATE_PATH).text();
|
|
242
242
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
243
|
+
// Use split/join instead of replaceAll to avoid $ being interpreted
|
|
244
|
+
// as special replacement patterns (e.g. $` inserts pre-match string)
|
|
245
|
+
code = code.split('// imports').join(statics.join('\n'));
|
|
246
|
+
code = code.split('// script').join(scriptContent ?? '');
|
|
247
|
+
code = code.split('// inners').join(body.join('\n'));
|
|
247
248
|
|
|
248
249
|
// Transform control flow tags to JS
|
|
249
250
|
code = code
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { existsSync } from 'fs'
|
|
1
2
|
import Router from "./route-handler.js"
|
|
2
3
|
|
|
3
4
|
/** A Bun subprocess with all three stdio channels opened as pipes. */
|
|
@@ -43,7 +44,8 @@ export default class Pool {
|
|
|
43
44
|
for (const [route, methods] of Router.allRoutes) {
|
|
44
45
|
for (const method of methods) {
|
|
45
46
|
if (method === 'HTML' || method === 'OPTIONS') continue
|
|
46
|
-
|
|
47
|
+
const handler = `${Router.routesPath}${route === '/' ? '' : route}/${method}`
|
|
48
|
+
if (existsSync(handler)) Pool.prewarmHandler(handler)
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
}
|