@team-monolith/pxt-core 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/built/pxt.js CHANGED
@@ -107679,6 +107679,10 @@ var pxt;
107679
107679
  var github;
107680
107680
  (function (github) {
107681
107681
  github.token = null;
107682
+ // [Monolith] GitHub API 요청은 원본 makecode 서버로 라우팅
107683
+ // 자체 서버(class rails)에는 GitHub 프록시가 없으므로 원본 서버 사용
107684
+ // CORS: makecode.com에서 허용됨
107685
+ const MAKECODE_API_ROOT = "https://www.makecode.com/api/";
107682
107686
  github.forceProxy = false;
107683
107687
  function hasProxy() {
107684
107688
  var _a, _b;
@@ -107736,9 +107740,11 @@ var pxt;
107736
107740
  return ghRequestAsync({ url, method: "GET" }).then(resp => resp.json);
107737
107741
  }
107738
107742
  function ghProxyWithCdnJsonAsync(path) {
107739
- return pxt.Cloud.apiRequestWithCdnAsync({
107740
- url: "gh/" + path,
107741
- forceLiveEndpoint: true
107743
+ // [Monolith] GitHub 프록시 요청은 원본 makecode 서버로 직접 전송
107744
+ // 자체 서버에는 /api/gh/* 엔드포인트가 없음
107745
+ return pxt.U.requestAsync({
107746
+ url: MAKECODE_API_ROOT + "gh/" + path,
107747
+ allowGzipPost: true
107742
107748
  }).then(r => r.json);
107743
107749
  }
107744
107750
  function ghProxyHandleException(e) {
@@ -108086,7 +108092,8 @@ var pxt;
108086
108092
  const fetch = !proxy ?
108087
108093
  ghGetJsonAsync(`https://api.github.com/repos/${parsed.slug}/git/refs/${namespace}/?per_page=100`) :
108088
108094
  // no CDN caching here, bust browser cace
108089
- pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${pxt.Cloud.apiRoot}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
108095
+ // [Monolith] refs 조회는 원본 makecode 서버로 전송
108096
+ pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${MAKECODE_API_ROOT}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
108090
108097
  .then(r => {
108091
108098
  let res = Object.keys(r.refs)
108092
108099
  .filter(k => pxt.U.startsWith(k, "refs/" + namespace + "/"))
@@ -108320,7 +108327,8 @@ var pxt;
108320
108327
  }
108321
108328
  github.repoIconUrl = repoIconUrl;
108322
108329
  function mkRepoIconUrl(repo) {
108323
- return pxt.Cloud.cdnApiUrl(`gh/${repo.fullName}/icon`);
108330
+ // [Monolith] 아이콘 URL은 원본 makecode 서버 사용
108331
+ return `${MAKECODE_API_ROOT}gh/${repo.fullName}/icon`;
108324
108332
  }
108325
108333
  github.mkRepoIconUrl = mkRepoIconUrl;
108326
108334
  function mkRepo(r, options) {
@@ -108450,7 +108458,8 @@ var pxt;
108450
108458
  return Promise.all(repos.map(id => repoAsync(id.fullName, config)))
108451
108459
  .then(rs => rs.filter(r => r && r.status != GitRepoStatus.Banned)); // allow deep links to github repos
108452
108460
  // todo fix search
108453
- const fetch = () => pxt.U.httpGetJsonAsync(`${pxt.Cloud.apiRoot}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
108461
+ // [Monolith] GitHub 검색은 원본 makecode 서버로 전송
108462
+ const fetch = () => pxt.U.httpGetJsonAsync(`${MAKECODE_API_ROOT}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
108454
108463
  return fetch()
108455
108464
  .then((rs) => rs.items.map(item => mkRepo(item, { config, fullName: item.full_name }))
108456
108465
  .filter(r => r.status == GitRepoStatus.Approved || (config.allowUnapproved && r.status == GitRepoStatus.Unknown))
package/built/pxtlib.js CHANGED
@@ -9993,6 +9993,10 @@ var pxt;
9993
9993
  var github;
9994
9994
  (function (github) {
9995
9995
  github.token = null;
9996
+ // [Monolith] GitHub API 요청은 원본 makecode 서버로 라우팅
9997
+ // 자체 서버(class rails)에는 GitHub 프록시가 없으므로 원본 서버 사용
9998
+ // CORS: makecode.com에서 허용됨
9999
+ const MAKECODE_API_ROOT = "https://www.makecode.com/api/";
9996
10000
  github.forceProxy = false;
9997
10001
  function hasProxy() {
9998
10002
  var _a, _b;
@@ -10050,9 +10054,11 @@ var pxt;
10050
10054
  return ghRequestAsync({ url, method: "GET" }).then(resp => resp.json);
10051
10055
  }
10052
10056
  function ghProxyWithCdnJsonAsync(path) {
10053
- return pxt.Cloud.apiRequestWithCdnAsync({
10054
- url: "gh/" + path,
10055
- forceLiveEndpoint: true
10057
+ // [Monolith] GitHub 프록시 요청은 원본 makecode 서버로 직접 전송
10058
+ // 자체 서버에는 /api/gh/* 엔드포인트가 없음
10059
+ return pxt.U.requestAsync({
10060
+ url: MAKECODE_API_ROOT + "gh/" + path,
10061
+ allowGzipPost: true
10056
10062
  }).then(r => r.json);
10057
10063
  }
10058
10064
  function ghProxyHandleException(e) {
@@ -10400,7 +10406,8 @@ var pxt;
10400
10406
  const fetch = !proxy ?
10401
10407
  ghGetJsonAsync(`https://api.github.com/repos/${parsed.slug}/git/refs/${namespace}/?per_page=100`) :
10402
10408
  // no CDN caching here, bust browser cace
10403
- pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${pxt.Cloud.apiRoot}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
10409
+ // [Monolith] refs 조회는 원본 makecode 서버로 전송
10410
+ pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${MAKECODE_API_ROOT}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
10404
10411
  .then(r => {
10405
10412
  let res = Object.keys(r.refs)
10406
10413
  .filter(k => pxt.U.startsWith(k, "refs/" + namespace + "/"))
@@ -10634,7 +10641,8 @@ var pxt;
10634
10641
  }
10635
10642
  github.repoIconUrl = repoIconUrl;
10636
10643
  function mkRepoIconUrl(repo) {
10637
- return pxt.Cloud.cdnApiUrl(`gh/${repo.fullName}/icon`);
10644
+ // [Monolith] 아이콘 URL은 원본 makecode 서버 사용
10645
+ return `${MAKECODE_API_ROOT}gh/${repo.fullName}/icon`;
10638
10646
  }
10639
10647
  github.mkRepoIconUrl = mkRepoIconUrl;
10640
10648
  function mkRepo(r, options) {
@@ -10764,7 +10772,8 @@ var pxt;
10764
10772
  return Promise.all(repos.map(id => repoAsync(id.fullName, config)))
10765
10773
  .then(rs => rs.filter(r => r && r.status != GitRepoStatus.Banned)); // allow deep links to github repos
10766
10774
  // todo fix search
10767
- const fetch = () => pxt.U.httpGetJsonAsync(`${pxt.Cloud.apiRoot}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
10775
+ // [Monolith] GitHub 검색은 원본 makecode 서버로 전송
10776
+ const fetch = () => pxt.U.httpGetJsonAsync(`${MAKECODE_API_ROOT}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
10768
10777
  return fetch()
10769
10778
  .then((rs) => rs.items.map(item => mkRepo(item, { config, fullName: item.full_name }))
10770
10779
  .filter(r => r.status == GitRepoStatus.Approved || (config.allowUnapproved && r.status == GitRepoStatus.Unknown))
package/built/target.js CHANGED
@@ -380,8 +380,8 @@ var pxtTargetBundle = {
380
380
  },
381
381
  "uploadDocs": false,
382
382
  "versions": {
383
- "target": "0.2.2",
384
- "pxt": "0.2.2"
383
+ "target": "0.2.3",
384
+ "pxt": "0.2.3"
385
385
  },
386
386
  "blocksprj": {
387
387
  "id": "blocksprj",
@@ -4302,7 +4302,7 @@ var pxtTargetBundle = {
4302
4302
  }
4303
4303
  }
4304
4304
  },
4305
- "sha": "90aabbcec6021ae043bfc5f1f3dff4e393154eeee0d1e9c3a0c8d4b78e7456c5"
4305
+ "sha": "44f9beb06f3f20cf8615fe46d400540a57241a0cfd2a65f3d3e98f447344514e"
4306
4306
  }
4307
4307
  }
4308
4308
  }