File tree Expand file tree Collapse file tree 5 files changed +35
-2
lines changed Expand file tree Collapse file tree 5 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 1+ --- 
2+ " wrangler "  : patch 
3+ --- 
4+ 
5+ fix: script should be accepted as a positional arg in the ` versions upload `  command
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ describe("versions --help", () => {
1818			COMMANDS 
1919			  wrangler versions view <version-id>         View the details of a specific version of your Worker 
2020			  wrangler versions list                      List the 10 most recent Versions of your Worker 
21- 			  wrangler versions upload                     Uploads your Worker code and config as a new Version 
21+ 			  wrangler versions upload [script]            Uploads your Worker code and config as a new Version 
2222			  wrangler versions deploy [version-specs..]  Safely roll out new Versions of your Worker by splitting traffic between multiple Versions 
2323			  wrangler versions secret                    Generate a secret that can be referenced in a Worker 
2424
@@ -50,7 +50,7 @@ describe("versions subhelp", () => {
5050			COMMANDS 
5151			  wrangler versions view <version-id>         View the details of a specific version of your Worker 
5252			  wrangler versions list                      List the 10 most recent Versions of your Worker 
53- 			  wrangler versions upload                     Uploads your Worker code and config as a new Version 
53+ 			  wrangler versions upload [script]            Uploads your Worker code and config as a new Version 
5454			  wrangler versions deploy [version-specs..]  Safely roll out new Versions of your Worker by splitting traffic between multiple Versions 
5555			  wrangler versions secret                    Generate a secret that can be referenced in a Worker 
5656
Original file line number Diff line number Diff line change @@ -122,6 +122,31 @@ describe("versions upload", () => {
122122		` ) ; 
123123	} ) ; 
124124
125+ 	test ( "should accept script as a positional arg" ,  async  ( )  =>  { 
126+ 		mockGetScript ( ) ; 
127+ 		mockUploadVersion ( false ) ; 
128+ 
129+ 		// Setup 
130+ 		writeWranglerConfig ( { 
131+ 			name : "test-name" , 
132+ 			// i.e. would error if the arg wasn't picked up 
133+ 			main : "./nope.js" , 
134+ 		} ) ; 
135+ 		writeWorkerSource ( ) ; 
136+ 		setIsTTY ( false ) ; 
137+ 
138+ 		const  result  =  runWrangler ( "versions upload index.js" ) ; 
139+ 
140+ 		await  expect ( result ) . resolves . toBeUndefined ( ) ; 
141+ 
142+ 		expect ( std . out ) . toMatchInlineSnapshot ( ` 
143+ 			"Total Upload: xx KiB / gzip: xx KiB 
144+ 			Worker Startup Time: 500 ms 
145+ 			Uploaded test-name (TIMINGS) 
146+ 			Worker Version ID: 51e4886e-2db7-4900-8d38-fbfecfeab993" 
147+ 		` ) ; 
148+ 	} ) ; 
149+ 
125150	test ( "should print preview url if version has preview" ,  async  ( )  =>  { 
126151		mockGetScript ( ) ; 
127152		mockUploadVersion ( true ) ; 
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ export interface ConfigBundle {
106106	containerBuildId : string  |  undefined ; 
107107	containerEngine : ContainerEngine  |  undefined ; 
108108	enableContainers : boolean ; 
109+ 	account_id : string  |  undefined ; 
109110} 
110111
111112export  class  WranglerLog  extends  Log  { 
@@ -522,6 +523,7 @@ export function buildMiniflareBindingOptions(
522523			] , 
523524			serviceBindings : { 
524525				FETCHER : getAIFetcher ( { 
526+ 					account_id : config . account_id , 
525527					compliance_region : config . complianceRegion , 
526528				} ) , 
527529			} , 
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ export const versionsUploadCommand = createCommand({
104104		owner : "Workers: Authoring and Testing" , 
105105		status : "stable" , 
106106	} , 
107+ 	positionalArgs : [ "script" ] , 
107108	args : { 
108109		script : { 
109110			describe : "The path to an entry point for your Worker" , 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments