pxt-core 8.5.53 → 8.5.55

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/cli.js CHANGED
@@ -1567,7 +1567,7 @@ function getGalleryUrl(props) {
1567
1567
  return typeof props === "string" ? props : props.url;
1568
1568
  }
1569
1569
  function saveThemeJson(cfg, localDir, packaged) {
1570
- var _a, _b, _c, _d, _e, _f, _g, _h;
1570
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1571
1571
  cfg.appTheme.id = cfg.id;
1572
1572
  cfg.appTheme.title = cfg.title;
1573
1573
  cfg.appTheme.name = cfg.name;
@@ -1702,15 +1702,22 @@ ${gcards.map(gcard => `[${gcard.name}](${gcard.url})`).join(',\n')}
1702
1702
  if (game.subtitle)
1703
1703
  targetStrings[`{id:game-subtitle}${game.subtitle}`] = game.subtitle;
1704
1704
  }
1705
- const approvedRepoLib = (_e = targetConfig === null || targetConfig === void 0 ? void 0 : targetConfig.packages) === null || _e === void 0 ? void 0 : _e.approvedRepoLib;
1705
+ const kioskGames = (_e = targetConfig === null || targetConfig === void 0 ? void 0 : targetConfig.kiosk) === null || _e === void 0 ? void 0 : _e.games;
1706
+ for (const game of (kioskGames !== null && kioskGames !== void 0 ? kioskGames : [])) {
1707
+ if (game.name)
1708
+ targetStrings[`{id:game-name}${game.name}`] = game.name;
1709
+ if (game.description)
1710
+ targetStrings[`{id:game-description}${game.description}`] = game.description;
1711
+ }
1712
+ const approvedRepoLib = (_f = targetConfig === null || targetConfig === void 0 ? void 0 : targetConfig.packages) === null || _f === void 0 ? void 0 : _f.approvedRepoLib;
1706
1713
  for (const [extension, repoData] of Object.entries(approvedRepoLib !== null && approvedRepoLib !== void 0 ? approvedRepoLib : {})) {
1707
- for (const tag of ((_f = repoData.tags) !== null && _f !== void 0 ? _f : [])) {
1714
+ for (const tag of ((_g = repoData.tags) !== null && _g !== void 0 ? _g : [])) {
1708
1715
  targetStrings[`{id:extension-tag}${tag}`] = tag;
1709
1716
  }
1710
1717
  }
1711
- const builtinExtensionLib = (_g = targetConfig === null || targetConfig === void 0 ? void 0 : targetConfig.packages) === null || _g === void 0 ? void 0 : _g.builtinExtensionsLib;
1718
+ const builtinExtensionLib = (_h = targetConfig === null || targetConfig === void 0 ? void 0 : targetConfig.packages) === null || _h === void 0 ? void 0 : _h.builtinExtensionsLib;
1712
1719
  for (const [extension, repoData] of Object.entries(builtinExtensionLib !== null && builtinExtensionLib !== void 0 ? builtinExtensionLib : {})) {
1713
- for (const tag of ((_h = repoData.tags) !== null && _h !== void 0 ? _h : [])) {
1720
+ for (const tag of ((_j = repoData.tags) !== null && _j !== void 0 ? _j : [])) {
1714
1721
  targetStrings[`{id:extension-tag}${tag}`] = tag;
1715
1722
  }
1716
1723
  }
@@ -1856,10 +1863,8 @@ async function buildSemanticUIAsync(parsed) {
1856
1863
  // This is just to support the local skillmap/cra-app serve for development
1857
1864
  nodeutil.cp("built/web/react-common-skillmap.css", "node_modules/pxt-core/skillmap/public/blb");
1858
1865
  nodeutil.cp("built/web/react-common-authcode.css", "node_modules/pxt-core/authcode/public/blb");
1859
- nodeutil.cp("built/web/react-common-multiplayer.css", "node_modules/pxt-core/multiplayer/public/blb");
1860
1866
  nodeutil.cp("built/web/semantic.css", "node_modules/pxt-core/skillmap/public/blb");
1861
1867
  nodeutil.cp("built/web/semantic.css", "node_modules/pxt-core/authcode/public/blb");
1862
- nodeutil.cp("built/web/semantic.css", "node_modules/pxt-core/multiplayer/public/blb");
1863
1868
  }
1864
1869
  }
1865
1870
  async function linkFontAsync(font, semCss, sourceDir = "node_modules/semantic-ui-less/themes/default/assets/fonts/", refDir = "fonts\\/") {
@@ -1931,13 +1936,6 @@ function buildSkillMapAsync(parsed) {
1931
1936
  function buildAuthcodeAsync(parsed) {
1932
1937
  return buildReactAppAsync("authcode", parsed, { copyAssets: false });
1933
1938
  }
1934
- function buildMultiplayerAsync(parsed) {
1935
- return buildReactAppAsync("multiplayer", parsed, {
1936
- copyAssets: false,
1937
- includePxtSim: true,
1938
- expandedPxtTarget: true
1939
- });
1940
- }
1941
1939
  function updateDefaultProjects(cfg) {
1942
1940
  let defaultProjects = [
1943
1941
  pxt.BLOCKS_PROJECT_NAME,
@@ -2524,7 +2522,8 @@ function serveAsync(parsed) {
2524
2522
  wsPort: parsed.flags["wsport"] || 0,
2525
2523
  hostname: parsed.flags["hostname"] || "",
2526
2524
  browser: parsed.flags["browser"],
2527
- serial: !parsed.flags["noSerial"] && !exports.globalConfig.noSerial
2525
+ serial: !parsed.flags["noSerial"] && !exports.globalConfig.noSerial,
2526
+ noauth: parsed.flags["noauth"] || false,
2528
2527
  }));
2529
2528
  }
2530
2529
  exports.serveAsync = serveAsync;
@@ -6199,6 +6198,10 @@ ${pxt.crowdin.KEY_VARIABLE} - crowdin key
6199
6198
  aliases: ["w"],
6200
6199
  type: "number",
6201
6200
  argument: "wsport"
6201
+ },
6202
+ noauth: {
6203
+ description: "disable localtoken-based authentication",
6204
+ aliases: ["na"],
6202
6205
  }
6203
6206
  }
6204
6207
  }, serveAsync);
@@ -6361,22 +6364,6 @@ ${pxt.crowdin.KEY_VARIABLE} - crowdin key
6361
6364
  }
6362
6365
  }
6363
6366
  }, buildAuthcodeAsync);
6364
- p.defineCommand({
6365
- name: "buildmultiplayer",
6366
- aliases: ["multiplayer", "mp"],
6367
- advanced: true,
6368
- help: "Serves the multiplayer webapp",
6369
- flags: {
6370
- serve: {
6371
- description: "Serve the multiplayer app locally after building (npm start)"
6372
- },
6373
- docs: {
6374
- description: "Path to local docs folder to copy into multiplayer",
6375
- type: "string",
6376
- argument: "docs"
6377
- }
6378
- }
6379
- }, buildMultiplayerAsync);
6380
6367
  advancedCommand("augmentdocs", "test markdown docs replacements", augmnetDocsAsync, "<temlate.md> <doc.md>");
6381
6368
  advancedCommand("crowdin", "upload, download, clean, stats files to/from crowdin", pc => crowdin.execCrowdinAsync.apply(undefined, pc.args), "<cmd> <path> [output]");
6382
6369
  advancedCommand("hidlist", "list HID devices", hid.listAsync);
package/built/pxt.js CHANGED
@@ -102312,7 +102312,7 @@ var pxt;
102312
102312
  var _a;
102313
102313
  try {
102314
102314
  return typeof window !== "undefined"
102315
- && /^http:\/\/(localhost|127\.0\.0\.1):\d+\//.test(window.location.href)
102315
+ && /^http:\/\/(localhost|127\.0\.0\.1|192\.168\.\d+\.\d+):\d+\//.test(window.location.href)
102316
102316
  && (ignoreFlags || !/nolocalhost=1/.test(window.location.href))
102317
102317
  && !((_a = pxt === null || pxt === void 0 ? void 0 : pxt.webConfig) === null || _a === void 0 ? void 0 : _a.isStatic);
102318
102318
  }
@@ -161940,7 +161940,7 @@ function getGalleryUrl(props) {
161940
161940
  return typeof props === "string" ? props : props.url;
161941
161941
  }
161942
161942
  function saveThemeJson(cfg, localDir, packaged) {
161943
- var _a, _b, _c, _d, _e, _f, _g, _h;
161943
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
161944
161944
  cfg.appTheme.id = cfg.id;
161945
161945
  cfg.appTheme.title = cfg.title;
161946
161946
  cfg.appTheme.name = cfg.name;
@@ -162075,15 +162075,22 @@ ${gcards.map(gcard => `[${gcard.name}](${gcard.url})`).join(',\n')}
162075
162075
  if (game.subtitle)
162076
162076
  targetStrings[`{id:game-subtitle}${game.subtitle}`] = game.subtitle;
162077
162077
  }
162078
- const approvedRepoLib = (_e = targetConfig === null || targetConfig === void 0 ? void 0 : targetConfig.packages) === null || _e === void 0 ? void 0 : _e.approvedRepoLib;
162078
+ const kioskGames = (_e = targetConfig === null || targetConfig === void 0 ? void 0 : targetConfig.kiosk) === null || _e === void 0 ? void 0 : _e.games;
162079
+ for (const game of (kioskGames !== null && kioskGames !== void 0 ? kioskGames : [])) {
162080
+ if (game.name)
162081
+ targetStrings[`{id:game-name}${game.name}`] = game.name;
162082
+ if (game.description)
162083
+ targetStrings[`{id:game-description}${game.description}`] = game.description;
162084
+ }
162085
+ const approvedRepoLib = (_f = targetConfig === null || targetConfig === void 0 ? void 0 : targetConfig.packages) === null || _f === void 0 ? void 0 : _f.approvedRepoLib;
162079
162086
  for (const [extension, repoData] of Object.entries(approvedRepoLib !== null && approvedRepoLib !== void 0 ? approvedRepoLib : {})) {
162080
- for (const tag of ((_f = repoData.tags) !== null && _f !== void 0 ? _f : [])) {
162087
+ for (const tag of ((_g = repoData.tags) !== null && _g !== void 0 ? _g : [])) {
162081
162088
  targetStrings[`{id:extension-tag}${tag}`] = tag;
162082
162089
  }
162083
162090
  }
162084
- const builtinExtensionLib = (_g = targetConfig === null || targetConfig === void 0 ? void 0 : targetConfig.packages) === null || _g === void 0 ? void 0 : _g.builtinExtensionsLib;
162091
+ const builtinExtensionLib = (_h = targetConfig === null || targetConfig === void 0 ? void 0 : targetConfig.packages) === null || _h === void 0 ? void 0 : _h.builtinExtensionsLib;
162085
162092
  for (const [extension, repoData] of Object.entries(builtinExtensionLib !== null && builtinExtensionLib !== void 0 ? builtinExtensionLib : {})) {
162086
- for (const tag of ((_h = repoData.tags) !== null && _h !== void 0 ? _h : [])) {
162093
+ for (const tag of ((_j = repoData.tags) !== null && _j !== void 0 ? _j : [])) {
162087
162094
  targetStrings[`{id:extension-tag}${tag}`] = tag;
162088
162095
  }
162089
162096
  }
@@ -162229,10 +162236,8 @@ async function buildSemanticUIAsync(parsed) {
162229
162236
  // This is just to support the local skillmap/cra-app serve for development
162230
162237
  nodeutil.cp("built/web/react-common-skillmap.css", "node_modules/pxt-core/skillmap/public/blb");
162231
162238
  nodeutil.cp("built/web/react-common-authcode.css", "node_modules/pxt-core/authcode/public/blb");
162232
- nodeutil.cp("built/web/react-common-multiplayer.css", "node_modules/pxt-core/multiplayer/public/blb");
162233
162239
  nodeutil.cp("built/web/semantic.css", "node_modules/pxt-core/skillmap/public/blb");
162234
162240
  nodeutil.cp("built/web/semantic.css", "node_modules/pxt-core/authcode/public/blb");
162235
- nodeutil.cp("built/web/semantic.css", "node_modules/pxt-core/multiplayer/public/blb");
162236
162241
  }
162237
162242
  }
162238
162243
  async function linkFontAsync(font, semCss, sourceDir = "node_modules/semantic-ui-less/themes/default/assets/fonts/", refDir = "fonts\\/") {
@@ -162304,13 +162309,6 @@ function buildSkillMapAsync(parsed) {
162304
162309
  function buildAuthcodeAsync(parsed) {
162305
162310
  return buildReactAppAsync("authcode", parsed, { copyAssets: false });
162306
162311
  }
162307
- function buildMultiplayerAsync(parsed) {
162308
- return buildReactAppAsync("multiplayer", parsed, {
162309
- copyAssets: false,
162310
- includePxtSim: true,
162311
- expandedPxtTarget: true
162312
- });
162313
- }
162314
162312
  function updateDefaultProjects(cfg) {
162315
162313
  let defaultProjects = [
162316
162314
  pxt.BLOCKS_PROJECT_NAME,
@@ -162897,7 +162895,8 @@ function serveAsync(parsed) {
162897
162895
  wsPort: parsed.flags["wsport"] || 0,
162898
162896
  hostname: parsed.flags["hostname"] || "",
162899
162897
  browser: parsed.flags["browser"],
162900
- serial: !parsed.flags["noSerial"] && !exports.globalConfig.noSerial
162898
+ serial: !parsed.flags["noSerial"] && !exports.globalConfig.noSerial,
162899
+ noauth: parsed.flags["noauth"] || false,
162901
162900
  }));
162902
162901
  }
162903
162902
  exports.serveAsync = serveAsync;
@@ -166572,6 +166571,10 @@ ${pxt.crowdin.KEY_VARIABLE} - crowdin key
166572
166571
  aliases: ["w"],
166573
166572
  type: "number",
166574
166573
  argument: "wsport"
166574
+ },
166575
+ noauth: {
166576
+ description: "disable localtoken-based authentication",
166577
+ aliases: ["na"],
166575
166578
  }
166576
166579
  }
166577
166580
  }, serveAsync);
@@ -166734,22 +166737,6 @@ ${pxt.crowdin.KEY_VARIABLE} - crowdin key
166734
166737
  }
166735
166738
  }
166736
166739
  }, buildAuthcodeAsync);
166737
- p.defineCommand({
166738
- name: "buildmultiplayer",
166739
- aliases: ["multiplayer", "mp"],
166740
- advanced: true,
166741
- help: "Serves the multiplayer webapp",
166742
- flags: {
166743
- serve: {
166744
- description: "Serve the multiplayer app locally after building (npm start)"
166745
- },
166746
- docs: {
166747
- description: "Path to local docs folder to copy into multiplayer",
166748
- type: "string",
166749
- argument: "docs"
166750
- }
166751
- }
166752
- }, buildMultiplayerAsync);
166753
166740
  advancedCommand("augmentdocs", "test markdown docs replacements", augmnetDocsAsync, "<temlate.md> <doc.md>");
166754
166741
  advancedCommand("crowdin", "upload, download, clean, stats files to/from crowdin", pc => crowdin.execCrowdinAsync.apply(undefined, pc.args), "<cmd> <path> [output]");
166755
166742
  advancedCommand("hidlist", "list HID devices", hid.listAsync);
package/built/pxtlib.js CHANGED
@@ -4626,7 +4626,7 @@ var pxt;
4626
4626
  var _a;
4627
4627
  try {
4628
4628
  return typeof window !== "undefined"
4629
- && /^http:\/\/(localhost|127\.0\.0\.1):\d+\//.test(window.location.href)
4629
+ && /^http:\/\/(localhost|127\.0\.0\.1|192\.168\.\d+\.\d+):\d+\//.test(window.location.href)
4630
4630
  && (ignoreFlags || !/nolocalhost=1/.test(window.location.href))
4631
4631
  && !((_a = pxt === null || pxt === void 0 ? void 0 : pxt.webConfig) === null || _a === void 0 ? void 0 : _a.isStatic);
4632
4632
  }
package/built/server.d.ts CHANGED
@@ -11,6 +11,7 @@ export interface ServeOptions {
11
11
  hostname?: string;
12
12
  wsPort?: number;
13
13
  serial?: boolean;
14
+ noauth?: boolean;
14
15
  }
15
16
  export declare function compileScriptAsync(id: string): Promise<string>;
16
17
  export declare function serveAsync(options: ServeOptions): Promise<void>;
package/built/server.js CHANGED
@@ -23,8 +23,9 @@ let packagedDir = "";
23
23
  let localHexCacheDir = path.join("built", "hexcache");
24
24
  let serveOptions;
25
25
  const webappNames = [
26
- "kiosk"
27
- // TODO: Add other webapp names here: "multiplayer", "skillmap", "authcode"
26
+ "kiosk",
27
+ "multiplayer"
28
+ // TODO: Add other webapp names here: "skillmap", "authcode"
28
29
  ];
29
30
  function setupDocfilesdirs() {
30
31
  docfilesdirs = [
@@ -1018,7 +1019,7 @@ function serveAsync(options) {
1018
1019
  console.log(err.stack);
1019
1020
  });
1020
1021
  }
1021
- if (!isAuthorizedLocalRequest(req)) {
1022
+ if (!options.noauth && !isAuthorizedLocalRequest(req)) {
1022
1023
  error(403);
1023
1024
  return null;
1024
1025
  }