@kudzujs/core 0.8.22 → 0.8.24
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/GOAL_B.md +5 -3
- package/MIGRATION_ROADMAP.md +14 -0
- package/PERFORMANCE.md +134 -1
- package/README.md +2 -2
- package/RELEASES.md +71 -2
- package/docs/next-architecture/README.md +4 -4
- package/docs/next-architecture/compiler-current-architecture.md +13 -14
- package/docs/next-architecture/goal-a-compiler-foundation.md +5 -5
- package/docs/next-architecture/goal-b-optimization-benchmarks.md +18 -6
- package/docs/next-architecture/versioning.md +5 -3
- package/framework/README.md +2 -2
- package/framework/build.mjs +29 -3017
- package/framework/compiler/normalization-pipeline.mjs +3 -2
- package/framework/compiler/path-helpers.mjs +18 -0
- package/framework/compiler/source-compiler.mjs +2969 -0
- package/framework/compiler/source-graph.mjs +29 -0
- package/framework/compiler/worker-compiler.mjs +9 -2
- package/framework/dev-server.mjs +1 -8
- package/framework/list-runtime.js +2 -1
- package/package.json +3 -1
|
@@ -2,8 +2,9 @@ import ts from "typescript"
|
|
|
2
2
|
|
|
3
3
|
export function applyNormalizationPasses(sourceFile, passes) {
|
|
4
4
|
for (const pass of passes) {
|
|
5
|
-
|
|
6
|
-
ts.setParentRecursive(
|
|
5
|
+
const next = pass(sourceFile)
|
|
6
|
+
if (next !== sourceFile) ts.setParentRecursive(next, false)
|
|
7
|
+
sourceFile = next
|
|
7
8
|
}
|
|
8
9
|
return sourceFile
|
|
9
10
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { dirname, relative } from "node:path"
|
|
2
|
+
|
|
3
|
+
export function relativeModulePath(from, to) {
|
|
4
|
+
const path = relative(dirname(from), to).replaceAll("\\", "/")
|
|
5
|
+
return path.startsWith(".") ? path : `./${path}`
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function browserPath(path) {
|
|
9
|
+
return path ? new URL(path, "http://kudzu.local").pathname : ""
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function assetPath(base, path) {
|
|
13
|
+
return `${base}/${path}`
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function withBase(base, path) {
|
|
17
|
+
return base ? `${base}${path}` : path
|
|
18
|
+
}
|