Skip to content

Support bundling with Luau types#249

Merged
jeparlefrancais merged 5 commits intomainfrom
bundle-with-types
Jan 10, 2025
Merged

Support bundling with Luau types#249
jeparlefrancais merged 5 commits intomainfrom
bundle-with-types

Conversation

@jeparlefrancais
Copy link
Contributor

@jeparlefrancais jeparlefrancais commented Jan 3, 2025

Closes #144

Thank you to @CompeyDev for sponsoring this feature on my ko-fi 🎉

Darklua will now be able to correctly preserve types when bundling Luau.

Note that because of how Luau currently works, types that uses typeof (like type Example = typeof(variable)) can't be hoisted correctly if they include a local variable.

  • add entry to the changelog

@github-actions
Copy link

github-actions bot commented Jan 4, 2025

Coverage after merging bundle-with-types into main will be

86.69%

Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines
src/nodes
   arguments.rs87.93%100%91.30%87.10%111–112, 148–151, 153, 64–66, 85–86
   mod.rs100%100%100%100%108–109, 60–61, 98–99
   token.rs93.13%100%94.12%92.96%200–202, 21–26, 262, 68, 77, 90
src/nodes/expressions
   interpolated_string.rs88.29%100%90%87.88%143–146, 148, 176–178, 267–272, 48–50
   number.rs91.04%100%91.78%90.88%209–213, 215, 225–229, 231–232, 284–288, 290, 321, 324–329, 331, 384
   table.rs90.57%100%92.50%90.12%151–155, 191–195, 197, 281–283, 46–48
src/nodes/statements
   type_declaration.rs65.15%100%86.36%62.50%125–131, 133–141, 143–146, 149–150, 152–158, 160–168, 170–173, 176–177, 233–239, 241–249, 251–254, 257–258
src/nodes/types
   table.rs78.49%100%80.85%77.94%166–168, 186–190, 192, 194–198, 200, 218–222, 224, 252–260, 304–306, 318–322, 330–332, 92–94
src/process
   scope_visitor.rs91.88%100%94.44%91.57%110–112, 115, 119, 145–147, 150, 154, 184–186, 201, 205, 478–488, 493, 64–66, 79–81, 84, 88
src/rules
   append_text_comment.rs51.75%100%69.23%50.69%118–125, 141–154, 160–171, 177–186, 192–201, 207–223, 229–240, 246–253, 259–267, 282–300, 321–328, 331–333, 335–337, 347–348, 350–351, 360–362, 366–368, 37, 370–371, 379, 38, 380, 385–389, 39, 390–393, 40, 406–407, 41, 413–419, 42, 420, 43, 450–455, 482–498, 505–507, 54, 56–59, 72–73
   shift_token_line.rs95.80%100%96.23%95.68%167–169, 264–267, 91
src/rules/bundle
   mod.rs90.08%100%94.44%89.32%107–111, 35–39, 41
   rename_type_declaration.rs96.84%100%100%96.39%169–170, 92, 95–97
src/rules/bundle/path_require_mode
   module_definitions.rs91.67%100%100%91.30%101, 107–108, 134–138, 143, 164, 68–71, 74–77
src/utils
   lines.rs73.73%100%71.93%74.13%104, 108, 114–115, 123, 179–190, 192–193, 195–198, 203, 212–216, 218, 220–228, 230, 262–264, 64–65
   mod.rs96.55%100%96%96.67%53–54, 61
   scoped_hash_map.rs83.33%100%100%78.95%18–21

@jeparlefrancais jeparlefrancais merged commit a6a8f33 into main Jan 10, 2025
@jeparlefrancais jeparlefrancais deleted the bundle-with-types branch January 10, 2025 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Luau types when bundling

1 participant