@robotical/martyblocksjr 3.5.28 → 3.5.30
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.
|
@@ -517,8 +517,8 @@
|
|
|
517
517
|
"BLOCK_DESC_MOVE_MARTY_DANCE": "Dance",
|
|
518
518
|
"BLOCK_DESC_MOVE_MARTY_FORWARD": "Move Forward",
|
|
519
519
|
"BLOCK_DESC_MOVE_MARTY_BACK": "Move Back",
|
|
520
|
-
"BLOCK_DESC_MOVE_MARTY_RIGHT": "Move
|
|
521
|
-
"BLOCK_DESC_MOVE_MARTY_LEFT": "Move
|
|
520
|
+
"BLOCK_DESC_MOVE_MARTY_RIGHT": "Move Right",
|
|
521
|
+
"BLOCK_DESC_MOVE_MARTY_LEFT": "Move Left",
|
|
522
522
|
"BLOCK_DESC_MOVE_MARTY_UP": "Move Up",
|
|
523
523
|
"BLOCK_DESC_MOVE_MARTY_DOWN": "Move Down",
|
|
524
524
|
"BLOCK_DESC_GO_MARTY_HOME": "Go Home",
|
|
@@ -1122,4 +1122,4 @@
|
|
|
1122
1122
|
"MARTY_JRBLOCKS5_STEP_22_TEXT": "Almost done! Finally, add another green flag block to the soccer net code",
|
|
1123
1123
|
"MARTY_JRBLOCKS5_STEP_23_TEXT": "Finish this off with a <b/>start/stop counter</b> block, so your score resets every time you start a new game.",
|
|
1124
1124
|
"MARTY_JRBLOCKS5_END": "You did it! Press the green flag and play Marty's goal shooter!"
|
|
1125
|
-
}
|
|
1125
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robotical/martyblocksjr",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.30",
|
|
4
4
|
"description": "ScratchJr",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"homepage": "https://github.com/llk/scratchjr",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/polyfill": "^7.10.4",
|
|
30
|
+
"@babel/preset-env": "^7.25.4",
|
|
30
31
|
"babel-core": "^6.4.0",
|
|
31
32
|
"babel-eslint": "^4.1.6",
|
|
32
33
|
"babel-loader": "^8.2.5",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"esformatter-semicolons": "^1.1.2",
|
|
41
42
|
"eslint": "^1.10.3",
|
|
42
43
|
"expose-loader": "^3.0.0",
|
|
44
|
+
"puppeteer": "^2.1.1",
|
|
43
45
|
"strip-sourcemap-loader": "0.0.1",
|
|
44
46
|
"vitest": "^4.0.14",
|
|
45
47
|
"webpack": "^5.73.0",
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
2
|
+
import puppeteer from "puppeteer";
|
|
3
|
+
import { spawn } from "child_process";
|
|
4
|
+
import http from "http";
|
|
5
|
+
|
|
6
|
+
const PORT = 3011;
|
|
7
|
+
const HOST = `http://localhost:${PORT}`;
|
|
8
|
+
|
|
9
|
+
let server;
|
|
10
|
+
|
|
11
|
+
async function waitForServer(maxAttempts = 20) {
|
|
12
|
+
for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
|
|
13
|
+
const ok = await new Promise((resolve) => {
|
|
14
|
+
const req = http.get(`${HOST}/`, (res) => {
|
|
15
|
+
res.destroy();
|
|
16
|
+
resolve(true);
|
|
17
|
+
});
|
|
18
|
+
req.on("error", () => resolve(false));
|
|
19
|
+
});
|
|
20
|
+
if (ok) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
24
|
+
}
|
|
25
|
+
throw new Error("Local server did not start in time");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
beforeAll(async () => {
|
|
29
|
+
server = spawn("python3", ["-m", "http.server", `${PORT}`, "--directory", "editions/free/src"], {
|
|
30
|
+
stdio: "ignore",
|
|
31
|
+
});
|
|
32
|
+
await waitForServer();
|
|
33
|
+
}, 30_000);
|
|
34
|
+
|
|
35
|
+
afterAll(() => {
|
|
36
|
+
if (server) {
|
|
37
|
+
server.kill();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe("Chromium 79 smoke test", () => {
|
|
42
|
+
it(
|
|
43
|
+
"loads home page without console errors",
|
|
44
|
+
async () => {
|
|
45
|
+
const browser = await puppeteer.launch({
|
|
46
|
+
headless: true,
|
|
47
|
+
args: ["--no-sandbox"],
|
|
48
|
+
});
|
|
49
|
+
const page = await browser.newPage();
|
|
50
|
+
const errors = [];
|
|
51
|
+
|
|
52
|
+
page.on("pageerror", (err) => errors.push(err.message || String(err)));
|
|
53
|
+
page.on("console", (msg) => {
|
|
54
|
+
if (msg.type() === "error") {
|
|
55
|
+
errors.push(msg.text());
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
await page.goto(`${HOST}/home.html`, { waitUntil: "networkidle2", timeout: 30_000 });
|
|
60
|
+
const title = await page.title();
|
|
61
|
+
|
|
62
|
+
await browser.close();
|
|
63
|
+
|
|
64
|
+
expect(title.toLowerCase()).toContain("scratch");
|
|
65
|
+
expect(errors).toEqual([]);
|
|
66
|
+
},
|
|
67
|
+
60_000
|
|
68
|
+
);
|
|
69
|
+
});
|
package/webpack.config.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
var WebpackNotifierPlugin = require("webpack-notifier");
|
|
2
|
+
const path = require("path");
|
|
2
3
|
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
3
4
|
|
|
4
5
|
const mode = process.argv.find(arg => arg.startsWith('--mode=')).split('=')[1];
|
|
5
6
|
const isProduction = mode === 'production';
|
|
7
|
+
const sqlJsPath = path.dirname(require.resolve("sql.js/package.json"));
|
|
8
|
+
|
|
9
|
+
const babelLoaderOptions = {
|
|
10
|
+
presets: [
|
|
11
|
+
["@babel/preset-env", {
|
|
12
|
+
targets: {
|
|
13
|
+
chrome: "60",
|
|
14
|
+
firefox: "60",
|
|
15
|
+
safari: "11"
|
|
16
|
+
},
|
|
17
|
+
bugfixes: true,
|
|
18
|
+
}]
|
|
19
|
+
]
|
|
20
|
+
};
|
|
6
21
|
|
|
7
22
|
module.exports = {
|
|
8
23
|
resolve: {
|
|
@@ -44,16 +59,20 @@ module.exports = {
|
|
|
44
59
|
// },
|
|
45
60
|
},
|
|
46
61
|
{
|
|
47
|
-
loader: "babel-loader",
|
|
48
|
-
exclude: /node_modules/,
|
|
49
62
|
test: /\.jsx?$/,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
exclude: /node_modules/,
|
|
64
|
+
use: {
|
|
65
|
+
loader: "babel-loader",
|
|
66
|
+
options: babelLoaderOptions,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
test: /\.js$/,
|
|
71
|
+
include: [sqlJsPath],
|
|
72
|
+
use: {
|
|
73
|
+
loader: "babel-loader",
|
|
74
|
+
options: babelLoaderOptions,
|
|
75
|
+
},
|
|
57
76
|
},
|
|
58
77
|
],
|
|
59
78
|
},
|