@ttsc/wasm 0.29.0 → 0.30.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.
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "schema": 1,
3
- "identity": "a346550bfddf6dc4527a793046fc996941d7a57d42ab51e99ecc46f3e8a6a715",
3
+ "identity": "87bc56f6a780b1eaadf2409ca26d7279a03617173596681f32ec72de2dafd937",
4
4
  "artifacts": [
5
5
  {
6
6
  "path": "/home/runner/work/ttsc/ttsc/packages/wasm/dist/ttsc.wasm",
7
7
  "type": "file",
8
- "sha256": "eb01849ff5c7f2d265f537de65332c05d757c7b9ccd682b9e4d13f28f20b37f7"
8
+ "sha256": "67ef62ead0f529557e53f4db49256ebbe068723ebb67bbd063c3b1e6cda70a30"
9
9
  },
10
10
  {
11
11
  "path": "/home/runner/work/ttsc/ttsc/packages/wasm/dist/wasm_exec.js",
@@ -151,7 +151,7 @@
151
151
  },
152
152
  {
153
153
  "path": "compiler/resolution.go",
154
- "sha256": "8bb3b7e3e16d31286fd16212a9adf100501df1d250ecd0064521b38df01e62e8"
154
+ "sha256": "82fca0a4e98189d51171871550a671bb7e771da10ac7308b487e840e30067df1"
155
155
  },
156
156
  {
157
157
  "path": "compiler/shim.go",
package/dist/ttsc.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttsc/wasm",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "description": "Build in-browser ttsc playgrounds. Compose ttsc + typescript-go with your own plugins via the Go host helper.",
5
5
  "main": "lib/src/index.js",
6
6
  "types": "lib/src/index.d.ts",
@@ -61,6 +61,22 @@ func ProgramResolutionTasks(program *Program) []ProgramResolutionTask {
61
61
  if source := program.GetSourceFileByPath(filePath); source != nil {
62
62
  sourceFile = source.FileName()
63
63
  redirectedReference, containingFile = programResolutionContext(program, source)
64
+ } else if kind == ProgramResolutionKindTypeReference && strings.HasSuffix(containingFile, module.InferredTypesContainingFile) {
65
+ // filePath is a cache key, lowercased on case-insensitive filesystems,
66
+ // not the lexical filename used by the resolver. Automatic types have
67
+ // no SourceFile to recover that spelling from. Mirror upstream
68
+ // fileLoader.addAutomaticTypeDirectiveTasks: the semantic config owns
69
+ // their containing directory, falling back to cwd for configless hosts.
70
+ // Secondary lookup (package subpaths and relative types) preserves this
71
+ // spelling in resolvedFileName or a symlink's originalPath. Replaying a
72
+ // lowercased key falsely rejected unchanged programs in #1353. Restore
73
+ // the input context here; keep the strict result comparison below so
74
+ // actual target, package and link changes still invalidate the program.
75
+ containingDirectory := program.GetCurrentDirectory()
76
+ if configFile := program.Options().ConfigFilePath; configFile != "" {
77
+ containingDirectory = tspath.GetDirectoryPath(configFile)
78
+ }
79
+ containingFile = tspath.CombinePaths(containingDirectory, module.InferredTypesContainingFile)
64
80
  }
65
81
  if target := program.GetSourceFileForResolvedModule(expected.resolvedFileName); target != nil {
66
82
  targetFile = target.FileName()