Comparing version 0.7.0 to 0.8.0
@@ -124,2 +124,3 @@ "use strict"; | ||
const hwVariants = prj.service.hwVariants; | ||
const targetId = prj.service.runSync("pxt.appTarget.id"); | ||
if (opts.hw) { | ||
@@ -153,3 +154,3 @@ const hw = opts.hw.toLowerCase(); | ||
prj.guessHwVariant(); | ||
info(`using hwVariant: ${prj.mainPkg.mkcConfig.hwVariant}`); | ||
info(`using hwVariant: ${prj.mainPkg.mkcConfig.hwVariant} (target ${targetId})`); | ||
if (!opts.alwaysBuilt) | ||
@@ -165,2 +166,7 @@ prj.outputPrefix = "built/" + prj.mainPkg.mkcConfig.hwVariant; | ||
const prj0 = prj.mkChildProject(fulldir); | ||
const cfg = yield prj0.readPxtConfig(); | ||
if (cfg.supportedTargets && cfg.supportedTargets.indexOf(targetId) < 0) { | ||
info(`skipping due to supportedTargets`); | ||
continue; | ||
} | ||
try { | ||
@@ -167,0 +173,0 @@ const ok = yield buildOnePrj(opts, prj0); |
@@ -57,2 +57,3 @@ /// <reference path="../external/pxtpackage.d.ts" /> | ||
protected savePxtModulesAsync(filesmap: pxt.Map<string>): Promise<void>; | ||
readPxtConfig(): Promise<pxt.PackageConfig>; | ||
protected readPackageAsync(): Promise<Package>; | ||
@@ -59,0 +60,0 @@ loadPkgAsync(): Promise<void>; |
@@ -71,2 +71,8 @@ "use strict"; | ||
} | ||
readPxtConfig() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const pxtJson = yield this.readFileAsync("pxt.json"); | ||
return JSON.parse(pxtJson); | ||
}); | ||
} | ||
readPackageAsync() { | ||
@@ -76,14 +82,10 @@ return __awaiter(this, void 0, void 0, function* () { | ||
this.mkcConfig = JSON.parse(yield this.readFileAsync("mkc.json").then(s => s, _err => "{}")); | ||
const pxtJson = yield this.readFileAsync("pxt.json"); | ||
const res = { | ||
config: JSON.parse(pxtJson), | ||
config: yield this.readPxtConfig(), | ||
mkcConfig: this.mkcConfig, | ||
files: { | ||
"pxt.json": pxtJson | ||
} | ||
files: {} | ||
}; | ||
if (res.mkcConfig.overrides) { | ||
if (res.mkcConfig.overrides) | ||
jsonCopyFrom(res.config, res.mkcConfig.overrides); | ||
res.files["pxt.json"] = JSON.stringify(res.config, null, 4); | ||
} | ||
res.files["pxt.json"] = JSON.stringify(res.config, null, 4); | ||
for (let f of res.config.files.concat(res.config.testFiles || [])) { | ||
@@ -90,0 +92,0 @@ res.files[f] = yield this.readFileAsync(f); |
declare namespace pxt { | ||
type CodeCardType = "file" | "example" | "codeExample" | "tutorial" | "side" | "template" | "package" | "hw" | "forumUrl"; | ||
type CodeCardType = "file" | "example" | "codeExample" | "tutorial" | "side" | "template" | "package" | "hw" | "forumUrl" | "forumExample" | "sharedExample" | "link"; | ||
type CodeCardEditorType = "blocks" | "js" | "py"; | ||
@@ -27,2 +27,8 @@ | ||
interface CodeCardAction { | ||
url: string, | ||
editor?: CodeCardEditorType; | ||
cardType?: CodeCardType; | ||
} | ||
/** | ||
@@ -34,7 +40,7 @@ * The schema for the pxt.json package files | ||
version?: string; | ||
installedVersion?: string; | ||
// installedVersion?: string; moved to Package class | ||
// url to icon -- support for built-in packages only | ||
icon?: string; | ||
// semver description for support target version | ||
documentation?: string; // doc page to open when loading project | ||
documentation?: string; // doc page to open when loading project, used by sidedocs | ||
targetVersions?: TargetVersions; // versions of the target/pxt the package was compiled against | ||
@@ -48,6 +54,9 @@ description?: string; | ||
testFiles?: string[]; | ||
fileDependencies?: Map<string>; // exclude certain files if dependencies are not fulfilled | ||
preferredEditor?: string; // tsprj, blocksprj, pyprj | ||
// languageRestriction?: pxt.editor.LanguageRestriction; // language restrictions that have been placed on the package | ||
testDependencies?: pxt.Map<string>; | ||
cppDependencies?: pxt.Map<string>; | ||
public?: boolean; | ||
partial?: boolean; // true if project is not compileable on its own (eg base) | ||
binaryonly?: boolean; | ||
@@ -57,4 +66,6 @@ platformio?: PlatformIOConfig; | ||
palette?: string[]; | ||
paletteNames?: string[]; | ||
screenSize?: Size; | ||
yotta?: YottaConfig; | ||
codal?: CodalConfig; | ||
npmDependencies?: Map<string>; | ||
@@ -80,2 +91,7 @@ card?: CodeCard; | ||
requiredCategories?: string[]; // ensure that those block categories are visible | ||
supportedTargets?: string[]; // a hint about targets in which this extension is supported | ||
firmwareUrl?: string; // link to documentation page about upgrading firmware | ||
disablesVariants?: string[]; // don't build these variants, when this extension is enabled | ||
utf8?: boolean; // force compilation with UTF8 enabled | ||
disableTargetTemplateFiles?: boolean; // do not override target template files when commiting to github | ||
} | ||
@@ -100,2 +116,6 @@ | ||
interface CodalConfig { | ||
libraries?: string[]; | ||
} | ||
interface YottaConfig { | ||
@@ -126,2 +146,3 @@ dependencies?: Map<string>; | ||
tabIndex?: number; | ||
style?: string; // "card" | "item" | undefined; | ||
@@ -135,3 +156,6 @@ color?: string; // one of semantic ui colors | ||
largeImageUrl?: string; | ||
videoUrl?: string; | ||
youTubeId?: string; | ||
youTubePlaylistId?: string; // playlist this video belongs to | ||
buttonLabel?: string; | ||
time?: number; | ||
@@ -145,9 +169,6 @@ url?: string; | ||
editor?: CodeCardEditorType; | ||
otherActions?: CodeCardAction[]; | ||
directOpen?: boolean; // skip the details view, directly do the card action | ||
header?: string; | ||
any?: number; | ||
hardware?: number; | ||
software?: number; | ||
blocks?: number; | ||
javascript?: number; | ||
@@ -176,2 +197,5 @@ tutorialStep?: number; | ||
mimeType: string; | ||
displayName?: string; | ||
tilemapTile?: boolean; | ||
tileset?: string[]; | ||
} | ||
@@ -192,3 +216,3 @@ | ||
type SnippetAnswerTypes = 'number' | 'text' | 'dropdown' | 'spriteEditor' | string; // TODO(jb) Should include custom answer types for number, enums, string, image | ||
type SnippetAnswerTypes = 'number' | 'text' | 'variableName' | 'dropdown' | 'spriteEditor' | 'yesno' | string; // TODO(jb) Should include custom answer types for number, enums, string, image | ||
@@ -237,5 +261,9 @@ interface SnippetGoToOptions { | ||
interface SnippetInputYesNoType { | ||
type: "yesno"; | ||
} | ||
type SnippetQuestionInput = { label?: string; } | ||
& (SnippetInputAnswerSingular | SnippetInputAnswerPlural) | ||
& (SnippetInputOtherType | SnippetInputNumberType | SnippetInputDropdownType) | ||
& (SnippetInputOtherType | SnippetInputNumberType | SnippetInputDropdownType | SnippetInputYesNoType) | ||
@@ -256,2 +284,3 @@ interface SnippetValidateRegex { | ||
output?: string; | ||
outputConditionalOnAnswer?: string; | ||
errorMessage?: string; | ||
@@ -258,0 +287,0 @@ goto?: SnippetGoToOptions; |
{ | ||
"name": "makecode", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "MakeCode (PXT) - web-cached build tool", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124936
1829