File tree Expand file tree Collapse file tree 10 files changed +36
-29
lines changed Expand file tree Collapse file tree 10 files changed +36
-29
lines changed Original file line number Diff line number Diff line change 99import  type  UI  from  "../ui.mjs" ; 
1010import  {  updateVSCodeStaticConfigs  }  from  "../utils/vscodeConfigUtil.mjs" ; 
1111import  { 
12-   SDK_REPOSITORY_URL , 
1312  getCmakeReleases , 
1413  getNinjaReleases , 
1514  getSDKReleases , 
@@ -39,6 +38,7 @@ import { NINJA_AUTO_INSTALL_DISABLED } from "../webview/newProjectPanel.mjs";
3938import  Logger  from  "../logger.mjs" ; 
4039import  type  {  Progress  as  GotProgress  }  from  "got" ; 
4140import  {  SWITCH_SDK  }  from  "./cmdIds.mjs" ; 
41+ import  {  SDK_REPOSITORY_URL  }  from  "../utils/sharedConstants.mjs" ; 
4242
4343const  DEFAULT_PICOTOOL_VERSION  =  "2.2.0-a4" ; 
4444
Original file line number Diff line number Diff line change @@ -64,7 +64,6 @@ import {
6464  downloadAndInstallPicotool , 
6565  downloadAndInstallOpenOCD , 
6666}  from  "./utils/download.mjs" ; 
67- import  {  SDK_REPOSITORY_URL  }  from  "./utils/githubREST.mjs" ; 
6867import  {  getSupportedToolchains  }  from  "./utils/toolchainUtil.mjs" ; 
6968import  { 
7069  NewProjectPanel , 
@@ -103,6 +102,7 @@ import { NewRustProjectPanel } from "./webview/newRustProjectPanel.mjs";
103102import  { 
104103  CMAKELISTS_ZEPHYR_HEADER , 
105104  OPENOCD_VERSION , 
105+   SDK_REPOSITORY_URL , 
106106}  from  "./utils/sharedConstants.mjs" ; 
107107import  VersionBundlesLoader  from  "./utils/versionBundles.mjs" ; 
108108import  {  unknownErrorToString  }  from  "./utils/errorHelper.mjs" ; 
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import which from "which";
2323import  {  Uri ,  window ,  workspace  }  from  "vscode" ; 
2424import  { 
2525  type  GithubReleaseAssetData , 
26-   GithubRepository , 
2726  getGithubReleaseByTag , 
2827  getAuthorizationHeaders , 
2928  ownerOfRepository , 
@@ -40,6 +39,7 @@ import {
4039  EXT_USER_AGENT , 
4140  GITHUB_API_BASE_URL , 
4241  GITHUB_API_VERSION , 
42+   GithubRepository , 
4343  HTTP_STATUS_FORBIDDEN , 
4444  HTTP_STATUS_OK , 
4545  HTTP_STATUS_UNAUTHORIZED , 
Original file line number Diff line number Diff line change 11// TODO: put defaults into json file, to prevent need for these disables 
22import  type  {  ExtensionContext ,  Memento ,  Uri  }  from  "vscode" ; 
3- import  type  {  GithubReleaseResponse ,   GithubRepository  }  from  "./githubREST.mjs" ; 
3+ import  type  {  GithubReleaseResponse  }  from  "./githubREST.mjs" ; 
44import  Logger ,  {  LoggerSource  }  from  "../logger.mjs" ; 
55import  {  getDataRoot  }  from  "./downloadHelpers.mjs" ; 
66import  {  get  }  from  "https" ; 
77import  {  isInternetConnected  }  from  "./downloadHelpers.mjs" ; 
88import  {  join  as  joinPosix  }  from  "path/posix" ; 
99import  {  readFileSync  }  from  "fs" ; 
1010import  {  unknownErrorToString  }  from  "./errorHelper.mjs" ; 
11- import  {  CURRENT_DATA_VERSION  }  from  "./sharedConstants.mjs" ; 
11+ import  { 
12+   CURRENT_DATA_VERSION , 
13+   type  GithubRepository , 
14+ }  from  "./sharedConstants.mjs" ; 
1215
1316/** 
1417 * Tells if the stored data is a GithubReleaseResponse (data of a specific release) 
Original file line number Diff line number Diff line change @@ -10,23 +10,13 @@ import {
1010  EXT_USER_AGENT , 
1111  GITHUB_API_BASE_URL , 
1212  GITHUB_API_VERSION , 
13+   GithubRepository , 
1314  HTTP_STATUS_FORBIDDEN , 
1415  HTTP_STATUS_NOT_MODIFIED , 
1516  HTTP_STATUS_OK , 
1617  HTTP_STATUS_UNAUTHORIZED , 
1718}  from  "./sharedConstants.mjs" ; 
1819
19- /** 
20-  * Enum containing supported repositories on GitHub. 
21-  */ 
22- export  enum  GithubRepository  { 
23-   picoSDK  =  0 , 
24-   cmake  =  1 , 
25-   ninja  =  2 , 
26-   tools  =  3 , 
27-   picotool  =  4 , 
28- } 
29- 
3020/** 
3121 * Interface for a response from the GitHub REST API 
3222 * release endpoint. 
@@ -46,12 +36,6 @@ export type GithubReleaseAssetData = {
4636  id : number ; 
4737} ; 
4838
49- // NOTE: The primary rate limit for unauthenticated requests is 60 requests per hour. 
50- export  const  SDK_REPOSITORY_URL  =  "https://github.com/raspberrypi/pico-sdk.git" ; 
51- export  const  NINJA_REPOSITORY_URL  =  "https://github.com/ninja-build/ninja.git" ; 
52- export  const  CMAKE_REPOSITORY_URL  =  "https://github.com/Kitware/CMake.git" ; 
53- export  const  PYENV_REPOSITORY_URL  =  "https://github.com/pyenv/pyenv.git" ; 
54- 
5539/** 
5640 * Get the url friendly owner of a repository on GitHub. 
5741 * 
Original file line number Diff line number Diff line change 11import  {  homedir  }  from  "os" ; 
22import  {  cloneRepository  }  from  "./gitUtil.mjs" ; 
3- import  {  PYENV_REPOSITORY_URL  }  from  "./githubREST.mjs" ; 
43import  {  join  as  joinPosix  }  from  "path/posix" ; 
54import  {  exec  }  from  "child_process" ; 
65import  {  buildPython3Path  }  from  "./download.mjs" ; 
76import  {  HOME_VAR  }  from  "../settings.mjs" ; 
87import  {  existsSync ,  mkdirSync ,  symlinkSync  }  from  "fs" ; 
9- import  {  CURRENT_PYTHON_VERSION  }  from  "./sharedConstants.mjs" ; 
8+ import  { 
9+   CURRENT_PYTHON_VERSION , 
10+   PYENV_REPOSITORY_URL , 
11+ }  from  "./sharedConstants.mjs" ; 
1012
1113export  function  buildPyenvPath ( ) : string  { 
1214  // TODO: maybe replace . with _ 
Original file line number Diff line number Diff line change @@ -12,13 +12,12 @@ import {
1212  downloadAndInstallToolchain , 
1313}  from  "./download.mjs" ; 
1414import  {  getSupportedToolchains  }  from  "./toolchainUtil.mjs" ; 
15- import  {  SDK_REPOSITORY_URL  }  from  "./githubREST.mjs" ; 
1615import  findPython ,  {  showPythonNotFoundError  }  from  "./pythonHelper.mjs" ; 
1716import  VersionBundlesLoader  from  "./versionBundles.mjs" ; 
1817import  {  HOME_VAR  }  from  "../settings.mjs" ; 
1918import  {  homedir  }  from  "os" ; 
2019import  type  {  Progress  }  from  "got" ; 
21- import  {  OPENOCD_VERSION  }  from  "./sharedConstants.mjs" ; 
20+ import  {  OPENOCD_VERSION ,   SDK_REPOSITORY_URL  }  from  "./sharedConstants.mjs" ; 
2221
2322/*const STABLE_INDEX_DOWNLOAD_URL = 
2423  "https://static.rust-lang.org/dist/channel-rust-stable.toml";*/ 
Original file line number Diff line number Diff line change @@ -29,12 +29,12 @@ import {
2929  CURRENT_WGET_VERSION , 
3030  LICENSE_URL_7ZIP , 
3131  OPENOCD_VERSION , 
32+   SDK_REPOSITORY_URL , 
3233  WINDOWS_X86_7ZIP_DOWNLOAD_URL , 
3334  WINDOWS_X86_DTC_DOWNLOAD_URL , 
3435  WINDOWS_X86_GPERF_DOWNLOAD_URL , 
3536  WINDOWS_X86_WGET_DOWNLOAD_URL , 
3637}  from  "./sharedConstants.mjs" ; 
37- import  {  SDK_REPOSITORY_URL  }  from  "./githubREST.mjs" ; 
3838import  {  vsExists  }  from  "./vsHelpers.mjs" ; 
3939import  which  from  "which" ; 
4040import  {  stdoutToString ,  unknownErrorToString  }  from  "./errorHelper.mjs" ; 
Original file line number Diff line number Diff line change @@ -48,3 +48,20 @@ export const HTTP_STATUS_FORBIDDEN = 403;
4848export  const  EXT_USER_AGENT  =  "Raspberry Pi Pico VS Code Extension" ; 
4949export  const  GITHUB_API_BASE_URL  =  "https://api.github.com" ; 
5050export  const  GITHUB_API_VERSION  =  "2022-11-28" ; 
51+ 
52+ /** 
53+  * Enum containing supported repositories on GitHub. 
54+  */ 
55+ export  enum  GithubRepository  { 
56+   picoSDK  =  0 , 
57+   cmake  =  1 , 
58+   ninja  =  2 , 
59+   tools  =  3 , 
60+   picotool  =  4 , 
61+ } 
62+ 
63+ // NOTE: The primary rate limit for unauthenticated requests is 60 requests per hour. 
64+ export  const  SDK_REPOSITORY_URL  =  "https://github.com/raspberrypi/pico-sdk.git" ; 
65+ export  const  NINJA_REPOSITORY_URL  =  "https://github.com/ninja-build/ninja.git" ; 
66+ export  const  CMAKE_REPOSITORY_URL  =  "https://github.com/Kitware/CMake.git" ; 
67+ export  const  PYENV_REPOSITORY_URL  =  "https://github.com/pyenv/pyenv.git" ; 
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import {
2525  getSupportedToolchains , 
2626}  from  "../utils/toolchainUtil.mjs" ; 
2727import  { 
28-   SDK_REPOSITORY_URL , 
2928  getCmakeReleases , 
3029  getNinjaReleases , 
3130  getPicotoolReleases , 
@@ -60,7 +59,10 @@ import {
6059import  {  stdoutToString ,  unknownErrorToString  }  from  "../utils/errorHelper.mjs" ; 
6160import  type  {  Progress  as  GotProgress  }  from  "got" ; 
6261import  findPython ,  {  showPythonNotFoundError  }  from  "../utils/pythonHelper.mjs" ; 
63- import  {  OPENOCD_VERSION  }  from  "../utils/sharedConstants.mjs" ; 
62+ import  { 
63+   OPENOCD_VERSION , 
64+   SDK_REPOSITORY_URL , 
65+ }  from  "../utils/sharedConstants.mjs" ; 
6466import  {  BoardType  }  from  "./sharedEnums.mjs" ; 
6567import  {  getSystemNinjaVersion  }  from  "../utils/ninjaUtil.mjs" ; 
6668import  {  getSystemCmakeVersion  }  from  "../utils/cmakeUtil.mjs" ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments