pxt-core 9.0.17 → 9.0.19
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 +55 -44
- 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 +55 -284
- package/built/pxtlib.d.ts +0 -35
- package/built/pxtlib.js +0 -240
- package/built/target.js +1 -1
- package/built/web/main.js +1 -1
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxtasseteditor.js +1 -1
- package/built/web/pxtembed.js +1 -1
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtweb.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/docfiles/pxtweb/cookieCompliance.ts +15 -0
- package/localtypings/pxtarget.d.ts +1 -0
- package/package.json +5 -1
package/built/cli.js
CHANGED
|
@@ -333,7 +333,7 @@ function checkIfTaggedCommitAsync() {
|
|
|
333
333
|
});
|
|
334
334
|
}
|
|
335
335
|
let readJson = nodeutil.readJson;
|
|
336
|
-
function ciAsync() {
|
|
336
|
+
async function ciAsync() {
|
|
337
337
|
forceCloudBuild = true;
|
|
338
338
|
const buildInfo = ciBuildInfo();
|
|
339
339
|
pxt.log(`ci build using ${buildInfo.ci}`);
|
|
@@ -379,54 +379,53 @@ function ciAsync() {
|
|
|
379
379
|
let pkg = readJson("package.json");
|
|
380
380
|
if (pkg["name"] == "pxt-core") {
|
|
381
381
|
pxt.log("pxt-core build");
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
if (
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
p = p.then(() => crowdin.execCrowdinAsync("upload", "built/strings.json"));
|
|
396
|
-
if (uploadDocs || uploadApiStrings)
|
|
397
|
-
p = p.then(() => crowdin.internalUploadTargetTranslationsAsync(uploadApiStrings, uploadDocs));
|
|
382
|
+
const isTaggedCommit = await checkIfTaggedCommitAsync();
|
|
383
|
+
pxt.log(`is tagged commit: ${isTaggedCommit}`);
|
|
384
|
+
await npmPublishAsync();
|
|
385
|
+
if (branch === "master" && isTaggedCommit) {
|
|
386
|
+
if (uploadDocs) {
|
|
387
|
+
await buildWebStringsAsync();
|
|
388
|
+
await crowdin.uploadBuiltStringsAsync("built/webstrings.json");
|
|
389
|
+
await crowdin.uploadBuiltStringsAsync(`built/skillmap-strings.json`);
|
|
390
|
+
await crowdin.uploadBuiltStringsAsync(`built/authcode-strings.json`);
|
|
391
|
+
await crowdin.uploadBuiltStringsAsync(`built/multiplayer-strings.json`);
|
|
392
|
+
}
|
|
393
|
+
if (uploadApiStrings) {
|
|
394
|
+
await crowdin.uploadBuiltStringsAsync("built/strings.json");
|
|
398
395
|
}
|
|
399
|
-
|
|
400
|
-
|
|
396
|
+
if (uploadDocs || uploadApiStrings) {
|
|
397
|
+
await crowdin.internalUploadTargetTranslationsAsync(uploadApiStrings, uploadDocs);
|
|
398
|
+
pxt.log("translations uploaded");
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
pxt.log("skipping translations upload");
|
|
402
|
+
}
|
|
403
|
+
}
|
|
401
404
|
}
|
|
402
405
|
else {
|
|
403
406
|
pxt.log("target build");
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
}
|
|
407
|
+
await internalBuildTargetAsync();
|
|
408
|
+
await internalCheckDocsAsync(true);
|
|
409
|
+
await blockTestsAsync();
|
|
410
|
+
await npmPublishAsync();
|
|
411
|
+
if (!process.env["PXT_ACCESS_TOKEN"]) {
|
|
412
|
+
// pull request, don't try to upload target
|
|
413
|
+
pxt.log('no token, skipping upload');
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
414
416
|
const trg = readLocalPxTarget();
|
|
415
417
|
const label = `${trg.id}/${tag || latest}`;
|
|
416
418
|
pxt.log(`uploading target with label ${label}...`);
|
|
417
|
-
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
return Promise.resolve();
|
|
428
|
-
}
|
|
429
|
-
});
|
|
419
|
+
await uploadTargetAsync(label);
|
|
420
|
+
}
|
|
421
|
+
pxt.log("target uploaded");
|
|
422
|
+
if (uploadDocs || uploadApiStrings) {
|
|
423
|
+
await crowdin.internalUploadTargetTranslationsAsync(uploadApiStrings, uploadDocs);
|
|
424
|
+
pxt.log("translations uploaded");
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
pxt.log("skipping translations upload");
|
|
428
|
+
}
|
|
430
429
|
}
|
|
431
430
|
}
|
|
432
431
|
function lintJSONInDirectory(dir) {
|
|
@@ -6260,7 +6259,7 @@ ${pxt.crowdin.KEY_VARIABLE} - crowdin key
|
|
|
6260
6259
|
advanced: true,
|
|
6261
6260
|
}, pc => uploadTargetRefsAsync(pc.args[0]));
|
|
6262
6261
|
advancedCommand("uploadtt", "upload tagged release", uploadTaggedTargetAsync, "");
|
|
6263
|
-
advancedCommand("downloadtrgtranslations", "download translations from bundled projects", crowdin.downloadTargetTranslationsAsync, "
|
|
6262
|
+
advancedCommand("downloadtrgtranslations", "download translations from bundled projects", crowdin.downloadTargetTranslationsAsync, "[package]");
|
|
6264
6263
|
p.defineCommand({
|
|
6265
6264
|
name: "checkdocs",
|
|
6266
6265
|
onlineHelp: true,
|
|
@@ -6354,7 +6353,19 @@ ${pxt.crowdin.KEY_VARIABLE} - crowdin key
|
|
|
6354
6353
|
}
|
|
6355
6354
|
}, buildMultiplayerAsync);
|
|
6356
6355
|
advancedCommand("augmentdocs", "test markdown docs replacements", augmnetDocsAsync, "<temlate.md> <doc.md>");
|
|
6357
|
-
|
|
6356
|
+
p.defineCommand({
|
|
6357
|
+
name: "crowdin",
|
|
6358
|
+
advanced: true,
|
|
6359
|
+
argString: "<cmd> <path> [output]",
|
|
6360
|
+
help: "upload, download, clean, stats files to/from crowdin",
|
|
6361
|
+
flags: {
|
|
6362
|
+
test: { description: "test run, do not upload files to crowdin" }
|
|
6363
|
+
}
|
|
6364
|
+
}, pc => {
|
|
6365
|
+
if (pc.flags.test)
|
|
6366
|
+
pxt.crowdin.setTestMode();
|
|
6367
|
+
return crowdin.execCrowdinAsync.apply(undefined, pc.args);
|
|
6368
|
+
});
|
|
6358
6369
|
advancedCommand("hidlist", "list HID devices", hid.listAsync);
|
|
6359
6370
|
advancedCommand("hidserial", "run HID serial forwarding", hid.serialAsync, undefined, true);
|
|
6360
6371
|
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>;
|