Skip to content

Improve file watching to process only changed content - #239

Merged
jeparlefrancais merged 9 commits into
mainfrom
process-work-tree
Dec 23, 2024
Merged

jeparlefrancais merged 9 commits into
mainfrom
process-work-tree

Conversation

@jeparlefrancais

@jeparlefrancais jeparlefrancais commented Dec 11, 2024 •

Copy link
Copy Markdown
Contributor

Related #228

Major improvements to the file watching system (darklua process --watch).

Darklua is now able to restart processing on specific files when it detects that the source file changed. When converting requires, it also detects when the sourcemap changes and re-process the files.

  • add entry to the changelog

@github-actions

Copy link
Copy Markdown

Coverage after merging process-work-tree into main will be

84.77%

Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines
src/cli
   minify.rs66.67%100%33.33%74.07%13, 15, 39–40
   process.rs44.83%100%33.33%46.94%16, 18, 28, 41–44, 46–50, 52, 59–60, 76–79, 90–92, 94
src/cli/utils
   file_watcher.rs0%100%0%0%102–109, 111–114, 119–124, 126, 128–133, 136–137, 139–146, 149–150, 152–160, 163–165, 169, 172–181, 187–194, 203–204, 206–209, 211–213, 216–217, 219–223, 226–227, 229–241, 243–247, 249–250, 252, 255, 257, 259–281, 283–285, 287–288, 290, 292–295, 297–303, 305–308, 310, 314–318, 320–325, 327–347, 349–371, 374–382, 384–387, 389–402, 404–407, 41, 412–419, 42, 420–423, 43, 430–433, 438–439, 44, 441, 443–444, 446–449, 45, 450–455, 46–55, 57–60, 62–69, 71–73, 75–76, 78–80, 82–84, 86–92, 94–99
   mod.rs82%100%100%80%40–43, 45, 48–50, 52
src/frontend
   configuration.rs89.54%100%88.46%89.72%136–153, 184–188, 57–59, 68–71
   error.rs71.92%100%68.75%72.28%107–112, 118–120, 122–124, 163, 171, 177, 184, 211–215, 225–228, 230, 234–239, 252–257, 261–266, 270–275, 279–284, 296–297, 310–311, 313–314, 331, 340, 373, 375, 380–381, 399–403, 406–411
   mod.rs100%100%100%100%
   resources.rs77.08%100%73.17%77.73%112–118, 120, 128–131, 153, 155–160, 164–167, 180–183, 190–193, 257–259, 269–271, 273–278, 57–58, 77
   work_cache.rs33.33%100%37.50%32.69%20–26, 30–35, 59–63, 65–69, 71, 73–79, 81, 83
   work_item.rs90.65%100%90.91%90.59%112–114, 155, 160–163
   worker.rs70.38%100%72.22%70.27%102, 106–107, 110–113, 137, 149–150, 158, 163–165, 167, 176, 195–199, 201, 225–228, 233–238, 240–247, 267–269, 284–286, 294–296, 304–306, 308–309, 320, 357, 375–377, 392–393, 45–52, 79–80, 92–99
   worker_tree.rs49.71%100%43.33%50.31%105–106, 116, 144, 155–156, 159, 163–164, 170–171, 173, 177, 187–189, 192, 239, 248, 254–258, 260–265, 267–268, 270–279, 281–283, 286–287, 289–294, 296–299, 301–302, 304–313, 315–318, 320–325, 327, 329, 331–337, 34, 341–342, 344–347, 349, 35, 350–352, 354–359, 36–37, 378–379, 381–391, 393, 395, 45–48, 60–65, 87–91, 93–97
src/generator
   token_based.rs91.98%100%94.68%91.74%1016–1017, 1031–1033, 1056–1057, 1066–1068, 1087–1088, 1097–1099, 1150–1154, 130, 1309, 131, 1379, 1416–1424, 147–148, 1500–1509, 1534–1536, 1568–1577, 160–161, 1621, 1679, 182–183, 203–205, 2076, 2135–2136, 2162–2166, 2195–2199, 2419, 2423, 2436, 245, 297–301, 371–372, 378, 390, 450–451, 473–474, 490–491, 533, 621–622, 655–656, 724–725, 766–767, 80, 808–812, 830–831, 853–855, 919–920, 929–930, 937, 952, 957–961, 980–981, 994–995
src/process
   expression_serializer.rs84.83%100%86.21%84.59%114, 133–138, 141–143, 161–166, 169–171, 216–218, 28, 281–286, 29, 294–296, 30–33, 35–40, 44–46, 50–52, 54, 56
src/process/processors
   find_identifier.rs96.30%100%100%95.45%68
   find_usage.rs100%100%100%100%
src/rules
   mod.rs89.22%100%83.78%89.90%119–121, 136–138, 149, 169–171, 173, 204–206, 304, 344–346, 373, 380–383, 397, 446–448
   remove_comments.rs39.15%100%29.05%42.53%159–161, 165–170, 172, 174, 176–178, 180–182, 184–186, 188–190, 192–194, 196–198, 200–202, 204–206, 208–210, 212–214, 216–218, 220–222, 224–226, 228–230, 258–262, 264–266, 268–270, 276–278, 280–282, 284–286, 288–293, 295–296, 299, 301–303, 305–307, 309–311, 313–315, 317–319, 321–323, 325–333, 348, 350, 352–354, 356–358, 360–362, 364–366, 368–370, 372–374, 376–378, 380–382, 384–386, 388–390, 392–394, 396–401, 403–405, 407, 409–414, 416, 418, 420–422, 424–426, 428–430, 432–434, 436–438, 440–442, 444–446, 448–450, 452–454, 456–458, 460–462, 464–466, 468–470, 472–474, 77–79
   replace_referenced_tokens.rs96.21%100%96.43%96.15%167–169, 178, 254–257
src/rules/bundle/path_require_mode
   mod.rs85.92%100%94.44%85.34%101–103, 120–122, 126–128, 130, 180, 206–208, 223–225, 235–237, 259, 295–298, 326–327, 333–339, 349–350, 359–361
   module_definitions.rs78.64%100%75.51%79.05%105–109, 114, 133, 281–282, 300–301, 321, 325, 331–332, 340, 344–348, 350, 353–355, 357, 360–377, 380–382, 384, 427–429, 47–50, 53–56, 72, 78–79
src/rules/convert_require
   mod.rs91.46%100%90.91%91.55%104–106, 129, 139–140, 40, 51, 61–62
   

@jeparlefrancais
jeparlefrancais merged commit 329fb82 into main Dec 23, 2024
@jeparlefrancais
jeparlefrancais deleted the process-work-tree branch December 23, 2024 04:38
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.

1 participant