goscript 0.0.29 → 0.0.30
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/compiler/compiler.go +8 -1
- package/package.json +1 -1
package/compiler/compiler.go
CHANGED
|
@@ -1015,7 +1015,7 @@ func (c *GoToTSCompiler) writeConstantValue(constObj *types.Const) {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
|
|
1017
1017
|
// copyEmbeddedPackage recursively copies files from an embedded FS path to a filesystem directory.
|
|
1018
|
-
// It handles both regular files and directories.
|
|
1018
|
+
// It handles both regular files and directories, but only copies .gs.ts and .ts files.
|
|
1019
1019
|
func (c *Compiler) copyEmbeddedPackage(embeddedPath string, outputPath string) error {
|
|
1020
1020
|
// Remove the output path if it exists
|
|
1021
1021
|
if err := os.RemoveAll(outputPath); err != nil {
|
|
@@ -1049,6 +1049,13 @@ func (c *Compiler) copyEmbeddedPackage(embeddedPath string, outputPath string) e
|
|
|
1049
1049
|
return err
|
|
1050
1050
|
}
|
|
1051
1051
|
} else {
|
|
1052
|
+
// Only copy .gs.ts and .ts files, skip .go files and others
|
|
1053
|
+
fileName := entry.Name()
|
|
1054
|
+
if !strings.HasSuffix(fileName, ".gs.ts") && !strings.HasSuffix(fileName, ".ts") {
|
|
1055
|
+
c.le.Debugf("Skipping non-TypeScript file: %s", fileName)
|
|
1056
|
+
continue
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1052
1059
|
// Read the file content from the embedded FS
|
|
1053
1060
|
content, err := gs.GsOverrides.ReadFile(entryPath)
|
|
1054
1061
|
if err != nil {
|