pxt-core 9.2.8 → 9.2.10
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 +56 -45
- package/built/crowdin.d.ts +2 -1
- package/built/crowdin.js +218 -213
- package/built/crowdinApi.d.ts +10 -0
- package/built/crowdinApi.js +374 -0
- package/built/pxt.js +75 -296
- package/built/pxtblockly.js +8 -6
- package/built/pxtblocks.d.ts +4 -0
- package/built/pxtblocks.js +8 -6
- package/built/pxtlib.d.ts +3 -37
- package/built/pxtlib.js +19 -251
- package/built/target.js +1 -1
- package/built/web/ai.2.min.js +2 -2
- package/built/web/main.js +1 -1
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxtasseteditor.js +1 -1
- package/built/web/pxtblockly.js +1 -1
- package/built/web/pxtblocks.js +1 -1
- package/built/web/pxtembed.js +2 -2
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/localtypings/pxtarget.d.ts +1 -0
- package/package.json +5 -1
package/built/cli.js
CHANGED
|
@@ -334,7 +334,7 @@ function checkIfTaggedCommitAsync() {
|
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
336
|
let readJson = nodeutil.readJson;
|
|
337
|
-
function ciAsync() {
|
|
337
|
+
async function ciAsync() {
|
|
338
338
|
forceCloudBuild = true;
|
|
339
339
|
const buildInfo = ciBuildInfo();
|
|
340
340
|
pxt.log(`ci build using ${buildInfo.ci}`);
|
|
@@ -380,55 +380,54 @@ function ciAsync() {
|
|
|
380
380
|
let pkg = readJson("package.json");
|
|
381
381
|
if (pkg["name"] == "pxt-core") {
|
|
382
382
|
pxt.log("pxt-core build");
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
if (
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
p = p.then(() => crowdin.execCrowdinAsync("upload", "built/strings.json"));
|
|
398
|
-
if (uploadDocs || uploadApiStrings)
|
|
399
|
-
p = p.then(() => crowdin.internalUploadTargetTranslationsAsync(uploadApiStrings, uploadDocs));
|
|
383
|
+
const isTaggedCommit = await checkIfTaggedCommitAsync();
|
|
384
|
+
pxt.log(`is tagged commit: ${isTaggedCommit}`);
|
|
385
|
+
await npmPublishAsync();
|
|
386
|
+
if (branch === "master" && isTaggedCommit) {
|
|
387
|
+
if (uploadDocs) {
|
|
388
|
+
await buildWebStringsAsync();
|
|
389
|
+
await crowdin.uploadBuiltStringsAsync("built/webstrings.json");
|
|
390
|
+
await crowdin.uploadBuiltStringsAsync(`built/skillmap-strings.json`);
|
|
391
|
+
await crowdin.uploadBuiltStringsAsync(`built/authcode-strings.json`);
|
|
392
|
+
await crowdin.uploadBuiltStringsAsync(`built/multiplayer-strings.json`);
|
|
393
|
+
await crowdin.uploadBuiltStringsAsync(`built/kiosk-strings.json`);
|
|
394
|
+
}
|
|
395
|
+
if (uploadApiStrings) {
|
|
396
|
+
await crowdin.uploadBuiltStringsAsync("built/strings.json");
|
|
400
397
|
}
|
|
401
|
-
|
|
402
|
-
|
|
398
|
+
if (uploadDocs || uploadApiStrings) {
|
|
399
|
+
await crowdin.internalUploadTargetTranslationsAsync(uploadApiStrings, uploadDocs);
|
|
400
|
+
pxt.log("translations uploaded");
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
pxt.log("skipping translations upload");
|
|
404
|
+
}
|
|
405
|
+
}
|
|
403
406
|
}
|
|
404
407
|
else {
|
|
405
408
|
pxt.log("target build");
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}
|
|
409
|
+
await internalBuildTargetAsync();
|
|
410
|
+
await internalCheckDocsAsync(true);
|
|
411
|
+
await blockTestsAsync();
|
|
412
|
+
await npmPublishAsync();
|
|
413
|
+
if (!process.env["PXT_ACCESS_TOKEN"]) {
|
|
414
|
+
// pull request, don't try to upload target
|
|
415
|
+
pxt.log('no token, skipping upload');
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
416
418
|
const trg = readLocalPxTarget();
|
|
417
419
|
const label = `${trg.id}/${tag || latest}`;
|
|
418
420
|
pxt.log(`uploading target with label ${label}...`);
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
return Promise.resolve();
|
|
430
|
-
}
|
|
431
|
-
});
|
|
421
|
+
await uploadTargetAsync(label);
|
|
422
|
+
}
|
|
423
|
+
pxt.log("target uploaded");
|
|
424
|
+
if (uploadDocs || uploadApiStrings) {
|
|
425
|
+
await crowdin.internalUploadTargetTranslationsAsync(uploadApiStrings, uploadDocs);
|
|
426
|
+
pxt.log("translations uploaded");
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
pxt.log("skipping translations upload");
|
|
430
|
+
}
|
|
432
431
|
}
|
|
433
432
|
}
|
|
434
433
|
function lintJSONInDirectory(dir) {
|
|
@@ -6299,7 +6298,7 @@ ${pxt.crowdin.KEY_VARIABLE} - crowdin key
|
|
|
6299
6298
|
advanced: true,
|
|
6300
6299
|
}, pc => uploadTargetRefsAsync(pc.args[0]));
|
|
6301
6300
|
advancedCommand("uploadtt", "upload tagged release", uploadTaggedTargetAsync, "");
|
|
6302
|
-
advancedCommand("downloadtrgtranslations", "download translations from bundled projects", crowdin.downloadTargetTranslationsAsync, "
|
|
6301
|
+
advancedCommand("downloadtrgtranslations", "download translations from bundled projects", crowdin.downloadTargetTranslationsAsync, "[package]");
|
|
6303
6302
|
p.defineCommand({
|
|
6304
6303
|
name: "checkdocs",
|
|
6305
6304
|
onlineHelp: true,
|
|
@@ -6377,7 +6376,19 @@ ${pxt.crowdin.KEY_VARIABLE} - crowdin key
|
|
|
6377
6376
|
}
|
|
6378
6377
|
}, buildAuthcodeAsync);
|
|
6379
6378
|
advancedCommand("augmentdocs", "test markdown docs replacements", augmnetDocsAsync, "<temlate.md> <doc.md>");
|
|
6380
|
-
|
|
6379
|
+
p.defineCommand({
|
|
6380
|
+
name: "crowdin",
|
|
6381
|
+
advanced: true,
|
|
6382
|
+
argString: "<cmd> <path> [output]",
|
|
6383
|
+
help: "upload, download, clean, stats files to/from crowdin",
|
|
6384
|
+
flags: {
|
|
6385
|
+
test: { description: "test run, do not upload files to crowdin" }
|
|
6386
|
+
}
|
|
6387
|
+
}, pc => {
|
|
6388
|
+
if (pc.flags.test)
|
|
6389
|
+
pxt.crowdin.setTestMode();
|
|
6390
|
+
return crowdin.execCrowdinAsync.apply(undefined, pc.args);
|
|
6391
|
+
});
|
|
6381
6392
|
advancedCommand("hidlist", "list HID devices", hid.listAsync);
|
|
6382
6393
|
advancedCommand("hidserial", "run HID serial forwarding", hid.serialAsync, undefined, true);
|
|
6383
6394
|
advancedCommand("hiddmesg", "fetch DMESG buffer over HID and print it", hid.dmesgAsync, undefined, true);
|
package/built/crowdin.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import Map = pxt.Map;
|
|
|
2
2
|
import * as commandParser from './commandparser';
|
|
3
3
|
export declare function uploadTargetTranslationsAsync(parsed?: commandParser.ParsedCommand): Promise<void>;
|
|
4
4
|
export declare function internalUploadTargetTranslationsAsync(uploadApiStrings: boolean, uploadDocs: boolean): Promise<void>;
|
|
5
|
+
export declare function uploadBuiltStringsAsync(filename: string, crowdinDir?: string): Promise<void>;
|
|
5
6
|
export declare function downloadTargetTranslationsAsync(parsed?: commandParser.ParsedCommand): Promise<void>;
|
|
6
|
-
export declare function buildAllTranslationsAsync(
|
|
7
|
+
export declare function buildAllTranslationsAsync(fetchFileTranslationAsync: (fileName: string) => Promise<Map<Map<string>>>, singleDir?: string): Promise<void>;
|
|
7
8
|
export declare function execCrowdinAsync(cmd: string, ...args: string[]): Promise<void>;
|