@@ -3,6 +3,35 @@ import * as actions from "./actions";
33import { repoSlice } from "../store" ;
44import Stomp from "stompjs" ;
55
6+ function getReexports ( { id, pods } ) {
7+ // Get the reexports available for the deck id. Those are from this deck's subdecks
8+ let reexports = Object . assign (
9+ { } ,
10+ ...pods [ id ] . children
11+ . filter ( ( { id } ) => pods [ id ] . type === "DECK" && ! pods [ id ] . thundar )
12+ . map ( ( { id, type } ) => pods [ id ] )
13+ . map ( ( deck ) =>
14+ Object . assign (
15+ { } ,
16+ ...deck . children
17+ . filter ( ( { id } ) => pods [ id ] . type !== "DECK" )
18+ . map ( ( { id } ) => pods [ id ] )
19+ . map ( ( pod ) => pod . reexports )
20+ )
21+ )
22+ ) ;
23+
24+ // change reexport from name=>id to ns=>names
25+ let res = { } ;
26+ for ( let [ name , id ] of Object . entries ( reexports ) ) {
27+ if ( ! res [ pods [ id ] . ns ] ) {
28+ res [ pods [ id ] . ns ] = [ ] ;
29+ }
30+ res [ pods [ id ] . ns ] . push ( name ) ;
31+ }
32+ return res ;
33+ }
34+
635function powerRun_racket ( { id, storeAPI, socket } ) {
736 let pods = storeAPI . getState ( ) . repo . pods ;
837 let pod = pods [ id ] ;
@@ -90,35 +119,6 @@ ${struct_codes.join("\n")}
90119 ) ;
91120}
92121
93- function getReexports ( { id, pods } ) {
94- // Get the reexports available for the deck id. Those are from this deck's subdecks
95- let reexports = Object . assign (
96- { } ,
97- ...pods [ id ] . children
98- . filter ( ( { id } ) => pods [ id ] . type === "DECK" && ! pods [ id ] . thundar )
99- . map ( ( { id, type } ) => pods [ id ] )
100- . map ( ( deck ) =>
101- Object . assign (
102- { } ,
103- ...deck . children
104- . filter ( ( { id } ) => pods [ id ] . type !== "DECK" )
105- . map ( ( { id } ) => pods [ id ] )
106- . map ( ( pod ) => pod . reexports )
107- )
108- )
109- ) ;
110-
111- // change reexport from name=>id to ns=>names
112- let res = { } ;
113- for ( let [ name , id ] of Object . entries ( reexports ) ) {
114- if ( ! res [ pods [ id ] . ns ] ) {
115- res [ pods [ id ] . ns ] = [ ] ;
116- }
117- res [ pods [ id ] . ns ] . push ( name ) ;
118- }
119- return res ;
120- }
121-
122122function powerRun_julia ( { id, storeAPI, socket } ) {
123123 let pods = storeAPI . getState ( ) . repo . pods ;
124124 let pod = pods [ id ] ;
0 commit comments