pxt-core 13.2.9 → 13.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 +14 -1
- package/built/commandparser.d.ts +7 -1
- package/built/commandparser.js +7 -1
- package/built/localrepos.d.ts +65 -0
- package/built/localrepos.js +169 -0
- package/built/pxt.js +151 -48
- package/built/pxtlib.d.ts +14 -0
- package/built/pxtlib.js +107 -31
- package/built/pxtsim.d.ts +13 -0
- package/built/pxtsim.js +30 -16
- package/built/server.d.ts +1 -0
- package/built/server.js +14 -0
- package/built/target.js +1 -1
- package/built/targetlight.js +1 -1
- package/built/tests/blocksrunner.js +3 -2
- package/built/tests/blockssetup.js +3 -2
- package/built/tests/cli-test/cli/localrepos.d.ts +65 -0
- package/built/tests/cli-test/tests/cli-test/clirunner.d.ts +2 -0
- package/built/tests/simdriver-test/simdriverrunner.d.ts +2 -0
- package/built/web/main.js +30 -30
- package/built/web/pxtapp.js +2 -2
- package/built/web/pxtasseteditor.js +1 -1
- package/built/web/pxtembed.js +1 -1
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtsim.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/runnerembed.js +1 -1
- package/built/web/semantic.css +1 -1
- package/package.json +1 -1
- package/react-common/components/controls/TeachingBubble.tsx +1 -1
- package/theme/common.less +5 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name of the machine-local file, at the root of a target checkout, that maps
|
|
3
|
+
* GitHub repositories to local directories for `pxt serve`. It holds paths of
|
|
4
|
+
* the developer's machine, so it is meant to stay out of source control.
|
|
5
|
+
*/
|
|
6
|
+
export declare const LOCAL_CONFIG_NAME = "pxtlocal.json";
|
|
7
|
+
/**
|
|
8
|
+
* Contents of pxtlocal.json.
|
|
9
|
+
*/
|
|
10
|
+
export interface LocalConfig {
|
|
11
|
+
/**
|
|
12
|
+
* Maps a GitHub repository ("owner/repo") to the local directory holding
|
|
13
|
+
* its checkout, absolute or relative to the directory of pxtlocal.json.
|
|
14
|
+
*/
|
|
15
|
+
localRepos?: pxt.Map<string>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Repository metadata, in the shape the MakeCode GitHub proxy returns it.
|
|
19
|
+
*/
|
|
20
|
+
export interface LocalRepoMeta {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Refs listing, in the shape the MakeCode GitHub proxy returns it.
|
|
26
|
+
*/
|
|
27
|
+
export interface LocalRepoRefs {
|
|
28
|
+
refs: pxt.Map<string>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Builds the map of GitHub repositories that `pxt serve` resolves from local
|
|
32
|
+
* directories.
|
|
33
|
+
*
|
|
34
|
+
* Entries come from pxtlocal.json in `targetDir`, when the file exists, with
|
|
35
|
+
* relative directories resolved against `targetDir`. Each `flagValue`
|
|
36
|
+
* ("owner/repo=dir", relative directories resolved against `cwd`) is applied
|
|
37
|
+
* after the file and replaces a file entry for the same repository.
|
|
38
|
+
*
|
|
39
|
+
* Returns the map from lowercase "owner/repo" to absolute directory. Throws a
|
|
40
|
+
* user error when pxtlocal.json is not valid JSON, or an entry names
|
|
41
|
+
* something other than a repository or a directory that does not exist.
|
|
42
|
+
*/
|
|
43
|
+
export declare function loadLocalRepos(targetDir: string, flagValues: string[], cwd: string): pxt.Map<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Answers a request for an aliased repository in the shape the MakeCode
|
|
46
|
+
* GitHub proxy answers it, reading the repository's local directory. The
|
|
47
|
+
* request is the path after "gh/":
|
|
48
|
+
*
|
|
49
|
+
* - "owner/repo": the repository metadata ({@link LocalRepoMeta}); the
|
|
50
|
+
* description is the one in the repository's root pxt.json, if any
|
|
51
|
+
* - "owner/repo/refs": the refs listing ({@link LocalRepoRefs}), always
|
|
52
|
+
* empty, because an aliased repository serves its working tree whatever
|
|
53
|
+
* ref is asked for
|
|
54
|
+
* - "owner/repo[/path]/text": the files of the package at `path` (the
|
|
55
|
+
* repository root when omitted), keyed by file name: its pxt.json and
|
|
56
|
+
* every file that pxt.json lists
|
|
57
|
+
*
|
|
58
|
+
* Throws an error carrying the HTTP `statusCode` to answer with: 404 when
|
|
59
|
+
* the repository is not aliased, or when the package's pxt.json or a file it
|
|
60
|
+
* lists does not exist; 400 when the path lies outside the repository's
|
|
61
|
+
* directory, the pxt.json is not valid or lists a file outside the package's
|
|
62
|
+
* directory, or the request matches none of the forms above. Every error is
|
|
63
|
+
* also written to the console.
|
|
64
|
+
*/
|
|
65
|
+
export declare function resolveLocalRepoRequest(localRepos: pxt.Map<string>, request: string): LocalRepoMeta | LocalRepoRefs | pxt.Map<string>;
|