Skip to content

Commit

Permalink
use target lite in asset editor
Browse files Browse the repository at this point in the history
  • Loading branch information
riknoll committed Mar 6, 2025
1 parent 6f8fab8 commit 520b4e7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2579,6 +2579,7 @@ async function buildTargetCoreAsync(options: BuildTargetOptions = {}) {
delete targetlight.compile.compilerExtension;
const targetlightjson = nodeutil.stringify(targetlight);
nodeutil.writeFileSync("built/targetlight.json", targetlightjson)
nodeutil.writeFileSync("built/targetlight.js", targetJsPrefix + targetlightjson)
nodeutil.writeFileSync("built/sim.webmanifest", nodeutil.stringify(webmanifest))

console.log("target.json built.");
Expand Down
16 changes: 9 additions & 7 deletions pxtlib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,15 @@ namespace pxt {
appTarget = replaceCdnUrlsInJsonBlob(appTarget);

// patch icons in bundled packages
Object.keys(appTarget.bundledpkgs).forEach(pkgid => {
const res = appTarget.bundledpkgs[pkgid];
// path config before storing
const config = JSON.parse(res[pxt.CONFIG_NAME]) as pxt.PackageConfig;
if (config.icon) config.icon = pxt.BrowserUtils.patchCdn(config.icon);
res[pxt.CONFIG_NAME] = pxt.Package.stringifyConfig(config);
})
if (appTarget.bundledpkgs) {
Object.keys(appTarget.bundledpkgs).forEach(pkgid => {
const res = appTarget.bundledpkgs[pkgid];
// path config before storing
const config = JSON.parse(res[pxt.CONFIG_NAME]) as pxt.PackageConfig;
if (config.icon) config.icon = pxt.BrowserUtils.patchCdn(config.icon);
res[pxt.CONFIG_NAME] = pxt.Package.stringifyConfig(config);
});
}

// patch any pre-configured query url appTheme overrides
if (typeof window !== 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion webapp/public/asseteditor.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// This line gets patched up by the cloud
var pxtConfig = null;
</script>
<script type="text/javascript" src="/blb/target.js"></script>
<script type="text/javascript" src="/blb/targetlight.js"></script>
<!-- <script type="text/javascript" src="https://cdn.makecode.com/blob/ec765d3ba50a09c8c8819ec80390b6ffa72e945a/target.js"></script> -->
<script type="text/javascript" src="/blb/pxtapp.js"></script>
<script>
Expand Down

0 comments on commit 520b4e7

Please sign in to comment.