From 54dcfd8164c3da7d8b4e23f6e611e60f8a76eb5b Mon Sep 17 00:00:00 2001 From: Ryan <30853424+totally-not-frito-lays@users.noreply.github.com> Date: Mon, 2 Jun 2025 11:42:31 -0700 Subject: [PATCH 1/6] added generated label tags and updated package.json --- cli/cli.ts | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cli/cli.ts b/cli/cli.ts index 80b24c2a4..cdefdf29f 100644 --- a/cli/cli.ts +++ b/cli/cli.ts @@ -1930,7 +1930,8 @@ function saveThemeJson(cfg: pxt.TargetBundle, localDir?: boolean, packaged?: boo const docsRoot = nodeutil.targetDir; let gcards: pxt.CodeCard[] = []; let tocmd: string = - `# Projects + ` +# Projects `; Object.keys(targetConfig.galleries).forEach(k => { @@ -1965,7 +1966,8 @@ function saveThemeJson(cfg: pxt.TargetBundle, localDir?: boolean, packaged?: boo nodeutil.writeFileSync(path.join(docsRoot, "docs/projects/SUMMARY.md"), tocmd, { encoding: "utf8" }); nodeutil.writeFileSync(path.join(docsRoot, "docs/projects.md"), - `# Projects + ` +# Projects \`\`\`codecard ${JSON.stringify(gcards, null, 4)} diff --git a/package.json b/package.json index ac48f6dc1..64639f356 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pxt-core", - "version": "11.4.7", + "version": "11.4.8", "description": "Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors", "keywords": [ "TypeScript", From e9bdc842247ba4b6a9d6ef8313c4623f9c1cb322 Mon Sep 17 00:00:00 2001 From: Ryan <30853424+totally-not-frito-lays@users.noreply.github.com> Date: Mon, 2 Jun 2025 11:59:28 -0700 Subject: [PATCH 2/6] reformatted file declaration to be easier to read --- cli/cli.ts | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/cli/cli.ts b/cli/cli.ts index cdefdf29f..d4e11e742 100644 --- a/cli/cli.ts +++ b/cli/cli.ts @@ -1841,6 +1841,8 @@ function replaceStaticImagesInJsonBlob(cfg: any, staticAssetHandler: (fileLocati return pxt.replaceStringsInJsonBlob(cfg, /^\.?\/static\/.+\.(png|gif|jpeg|jpg|svg|mp4|ico)$/i, staticAssetHandler); } +const GENERATED_FILE_DECLARATION = `\n\n`; + function saveThemeJson(cfg: pxt.TargetBundle, localDir?: boolean, packaged?: boolean) { cfg.appTheme.id = cfg.id cfg.appTheme.title = cfg.title @@ -1929,11 +1931,7 @@ function saveThemeJson(cfg: pxt.TargetBundle, localDir?: boolean, packaged?: boo if (targetConfig?.galleries) { const docsRoot = nodeutil.targetDir; let gcards: pxt.CodeCard[] = []; - let tocmd: string = - ` -# Projects - -`; + let tocmd: string = GENERATED_FILE_DECLARATION + `# Projects\n`; Object.keys(targetConfig.galleries).forEach(k => { targetStrings[k] = k; const galleryUrl = getGalleryUrl(targetConfig.galleries[k]) @@ -1941,8 +1939,7 @@ function saveThemeJson(cfg: pxt.TargetBundle, localDir?: boolean, packaged?: boo const gallery = pxt.gallery.parseGalleryMardown(gallerymd); const gurl = `/${galleryUrl.replace(/^\//, '')}`; tocmd += - `* [${k}](${gurl}) -`; + `* [${k}](${gurl})\n`; const gcard: pxt.CodeCard = { name: k, url: gurl @@ -1965,19 +1962,21 @@ function saveThemeJson(cfg: pxt.TargetBundle, localDir?: boolean, packaged?: boo }); nodeutil.writeFileSync(path.join(docsRoot, "docs/projects/SUMMARY.md"), tocmd, { encoding: "utf8" }); - nodeutil.writeFileSync(path.join(docsRoot, "docs/projects.md"), - ` -# Projects - -\`\`\`codecard -${JSON.stringify(gcards, null, 4)} -\`\`\` - -## See Also - -${gcards.map(gcard => `[${gcard.name}](${gcard.url})`).join(',\n')} - -`, { encoding: "utf8" }); + const PROJECTS_MD_CONTENT = [ + GENERATED_FILE_DECLARATION, + '', + '# Projects', + '', + '```codecard', + JSON.stringify(gcards, null, 4), + '```', + '', + '## See Also', + '', + gcards.map(gcard => `[${gcard.name}](${gcard.url})`).join(',\n') + ].join('\n'); + + nodeutil.writeFileSync(path.join(docsRoot, "docs/projects.md"), PROJECTS_MD_CONTENT, { encoding: "utf8" }); } const multiplayerGames = targetConfig?.multiplayer?.games; for (const game of (multiplayerGames ?? [])) { From 1551e4f7237087959547219e682ca8cccc1d00f3 Mon Sep 17 00:00:00 2001 From: Ryan <30853424+totally-not-frito-lays@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:26:27 -0700 Subject: [PATCH 3/6] updated dompurify --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 64639f356..60f91f7c8 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "cssnano": "4.1.10", "dashjs": "^4.4.0", "diff-match-patch": "^1.0.5", - "dompurify": "2.0.17", + "dompurify": "3.2.6", "faye-websocket": "0.11.1", "karma": "6.4.4", "karma-chai": "0.1.0", From 72a39d5e09171d21498e8fc92694b1bdf320a0a6 Mon Sep 17 00:00:00 2001 From: Ryan <30853424+totally-not-frito-lays@users.noreply.github.com> Date: Mon, 9 Jun 2025 16:51:28 -0700 Subject: [PATCH 4/6] updated gulp --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 60f91f7c8..3b940edae 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-react": "^7.23.1", "fuse.js": "3.2.0", - "gulp": "4.0.0", + "gulp": "^5.0.1", "gulp-concat": "2.6.1", "gulp-header": "2.0.9", "gulp-replace": "1.0.0", From cf9c41c3b6cc4f627e3d4312c7800fd7a13740c6 Mon Sep 17 00:00:00 2001 From: Ryan <30853424+totally-not-frito-lays@users.noreply.github.com> Date: Mon, 9 Jun 2025 17:19:36 -0700 Subject: [PATCH 5/6] updated highlightjs --- package.json | 2 +- pxtlib/main.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3b940edae..419026dcf 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "gulp-header": "2.0.9", "gulp-replace": "1.0.0", "gulp-typescript": "5.0.1", - "highlight.js": "9.12.0", + "highlight.js": "^11.11.1", "jquery": "3.5.0", "merge-stream": "2.0.0", "monaco-editor": "0.24.0", diff --git a/pxtlib/main.ts b/pxtlib/main.ts index 78ce52070..5eff49ba2 100644 --- a/pxtlib/main.ts +++ b/pxtlib/main.ts @@ -178,7 +178,9 @@ namespace pxt { export function replaceStringsInJsonBlob(blobPart: any, matcher: RegExp, matchHandler: (matchingString: string) => string): any { - if (Array.isArray(blobPart)) { + if (blobPart == null) { + return blobPart; // Return null or undefined as is + } else if (Array.isArray(blobPart)) { return blobPart.map(el => replaceStringsInJsonBlob(el, matcher, matchHandler)); } else if (typeof blobPart === "object") { for (const key of Object.keys(blobPart)) { From 7beb69b25b8c88495ed60260319c6680595f051f Mon Sep 17 00:00:00 2001 From: Ryan <30853424+totally-not-frito-lays@users.noreply.github.com> Date: Mon, 9 Jun 2025 19:04:13 -0700 Subject: [PATCH 6/6] updated postcss, sanitize-html, terser, pouchdb, smoothie, uglifyify --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 419026dcf..2affad619 100644 --- a/package.json +++ b/package.json @@ -90,15 +90,15 @@ "marked": "0.3.19", "mocha": "8.4.0", "pngjs": "3.4.0", - "postcss": "6.0.21", + "postcss": "^8.5.4", "promise.prototype.finally": "^3.1.2", "puppeteer": "23.11.1", "request": "2.88.0", "rimraf": "2.5.4", "rtlcss": "2.2.1", - "sanitize-html": "2.3.2", + "sanitize-html": "^2.17.0", "semantic-ui-less": "2.4.1", - "terser": "5.6.0" + "terser": "^5.42.0" }, "lazyDependencies": { "node-hid": "^0.7.2", @@ -141,7 +141,7 @@ "jquery": "3.5.0", "merge-stream": "2.0.0", "monaco-editor": "0.24.0", - "pouchdb": "7.2.1", + "pouchdb": "^7.3.1", "pouchdb-adapter-memory": "7.2.1", "react": "17.0.2", "react-dom": "17.0.2", @@ -149,9 +149,9 @@ "react-redux": "7.2.9", "react-tooltip": "3.9.0", "redux": "4.2.0", - "smoothie": "1.35.0", + "smoothie": "^1.36.1", "typescript": "4.8.3", - "uglifyify": "5.0.2" + "uglifyify": "^5.0.0" }, "overrides": { "@blockly/field-colour": {