Skip to content
This repository has been archived by the owner on Mar 19, 2019. It is now read-only.

Fix TS relative imports by forcing all Rugs var to be exported #156 #160

Merged
merged 1 commit into from
Jan 12, 2017

Conversation

kipz
Copy link
Contributor

@kipz kipz commented Jan 11, 2017

Changed

  • TypeScript/JavaScript should now "export" instances of Rugs inline with CommonJS standard.
    Hopefully not a breaking change as there is limited support for automatically exporting legacy ones.

Fixed

@kipz kipz assigned kipz and unassigned kipz Jan 11, 2017
@kipz kipz requested review from ddgenome and cdupuis January 11, 2017 19:07
Copy link
Contributor

@ddgenome ddgenome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple minor comments. LGTM

val m = p.matcher(str)
if(m.find()){
val varName = m.group(1)
sb.append("\nexports.").append(varName).append(" = ").append(varName).append(";\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this be sb.append(s"\nexports.$varName = $varName;\n")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could - is that better?


import com.atomist.source.{ArtifactSource, FileArtifact}
import com.atomist.project.archive.{AtomistConfig, DefaultAtomistConfig}
import com.atomist.source.{ArtifactSource}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curly braces superfluous.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@cdupuis
Copy link
Contributor

cdupuis commented Jan 11, 2017

I'll verify this with the latest CLI and merge it I don't see any issues. Thanks @kipz.

@cdupuis
Copy link
Contributor

cdupuis commented Jan 11, 2017

I just ran the latest local build inside the CLI against the handlers project:

✘-1 ~/Development/atomisthqa/handlers [master|✚ 1] 
00:18 $ rug describe archive -l
Resolving dependencies for atomisthqa:handlers:0.11.18 ← local completed
Invoking TypeScript Compiler on ts script sources                                                                                                                                                           
  Created .atomist/executors/AssignIssue.js.map                                                                                                                                                             
  Created .atomist/executors/AssignIssue.js                                                                                                                                                                 
  Created .atomist/executors/CloseIssue.js.map                                                                                                                                                              
  Created .atomist/executors/CloseIssue.js                                                                                                                                                                  
  Created .atomist/executors/CommentIssue.js.map                                                                                                                                                            
  Created .atomist/executors/CommentIssue.js                                                                                                                                                                
  Created .atomist/executors/CreateIssue.js.map                                                                                                                                                             
  Created .atomist/executors/CreateIssue.js                                                                                                                                                                 
  Created .atomist/executors/CreateRelease.js.map                                                                                                                                                           
  Created .atomist/executors/CreateRelease.js                                                                                                                                                               
  Created .atomist/executors/LabelIssue.js.map                                                                                                                                                              
  Created .atomist/executors/LabelIssue.js                                                                                                                                                                  
  Created .atomist/executors/ListIssues.js.map                                                                                                                                                              
  Created .atomist/executors/ListIssues.js                                                                                                                                                                  
  Created .atomist/executors/MergePullRequest.js.map                                                                                                                                                        
  Created .atomist/executors/MergePullRequest.js                                                                                                                                                            
  Created .atomist/executors/Parameters.js.map                                                                                                                                                              
  Created .atomist/executors/Parameters.js                                                                                                                                                                  
  Created .atomist/executors/ReopenIssue.js.map                                                                                                                                                             
  Created .atomist/executors/ReopenIssue.js                                                                                                                                                                 
  Created .atomist/executors/RestartTravisBuild.js.map                                                                                                                                                      
  Created .atomist/executors/RestartTravisBuild.js                                                                                                                                                          
  Created .atomist/handlers/BuildHandler.js.map                                                                                                                                                             
  Created .atomist/handlers/BuildHandler.js                                                                                                                                                                 
  Created .atomist/handlers/IssueHandler.js.map                                                                                                                                                             
  Created .atomist/handlers/IssueHandler.js                                                                                                                                                                 
  Created .atomist/handlers/PullRequestHandler.js.map                                                                                                                                                       
  Created .atomist/handlers/PullRequestHandler.js                                                                                                                                                           
  Created .atomist/handlers/PushHandler.js.map                                                                                                                                                              
  Created .atomist/handlers/PushHandler.js                                                                                                                                                                  
  Created .atomist/handlers/TagHandler.js.map                                                                                                                                                               
  Created .atomist/handlers/TagHandler.js                                                                                                                                                                   
Processing script sources completed
Loading atomisthqa:handlers:0.11.18 ← local into runtime failed

ReferenceError: "atomist" is not defined in <eval> at line number 1

@ddgenome
Copy link
Contributor

ddgenome commented Jan 12, 2017 via email

@cdupuis cdupuis merged commit c297339 into master Jan 12, 2017
@cdupuis cdupuis deleted the common-js branch January 12, 2017 16:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants