Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Commit 661e1cd

Browse files
authored
Create Release Version (to staging) (#230)
merge to staging for microbit feature flag release
1 parent ee10dd9 commit 661e1cd

File tree

127 files changed

+34281
-11307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+34281
-11307
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ out/
88
!locales/**/out/
99
package.nls.*.json
1010

11+
# virtual environment
12+
venv/
13+
1114
# testing
1215
.vscode-test
1316

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
},
99
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
1010
"typescript.tsc.autoDetect": "off"
11-
}
11+
}

README.md

Lines changed: 84 additions & 48 deletions
Large diffs are not rendered by default.

gulpfile.js

Lines changed: 140 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,135 +1,140 @@
1-
/*---------------------------------------------------------------------------------------------
2-
* Copyright (c) Microsoft Corporation. All rights reserved.
3-
* Licensed under the MIT License. See License.txt in the project root for license information.
4-
*--------------------------------------------------------------------------------------------*/
5-
6-
const gulp = require("gulp");
7-
8-
const ts = require("gulp-typescript");
9-
const sourcemaps = require("gulp-sourcemaps");
10-
const typescript = require("typescript");
11-
const del = require("del");
12-
const es = require("event-stream");
13-
const vsce = require("vsce");
14-
const nls = require("vscode-nls-dev");
15-
16-
const tsProject = ts.createProject("./tsconfig.json", { typescript });
17-
18-
const inlineMap = true;
19-
const inlineSource = false;
20-
const outDest = "out";
21-
22-
// A list of all locales supported by VSCode can be found here: https://code.visualstudio.com/docs/getstarted/locales
23-
const languages = [{ folderName: "en", id: "en" }];
24-
25-
gulp.task("clean", () => {
26-
return del(
27-
[
28-
"out/*",
29-
"package.nls.*.json",
30-
"../../dist/*0.0.0-UNTRACKEDVERSION.vsix"
31-
],
32-
{ force: true }
33-
);
34-
});
35-
36-
const pythonToMove = [
37-
"./src/adafruit_circuitplayground/*.*",
38-
"./src/*.py",
39-
"./src/requirements.txt",
40-
];
41-
42-
gulp.task("python-compile", () => {
43-
// the base option sets the relative root for the set of files,
44-
// preserving the folder structure
45-
return gulp.src(pythonToMove, { base: "./src/" }).pipe(gulp.dest("out"));
46-
});
47-
48-
gulp.task("internal-compile", () => {
49-
return compile(false);
50-
});
51-
52-
gulp.task("internal-nls-compile", () => {
53-
return compile(true);
54-
});
55-
56-
gulp.task("add-locales", () => {
57-
return gulp
58-
.src(["package.nls.json"])
59-
.pipe(nls.createAdditionalLanguageFiles(languages, "locales"))
60-
.pipe(gulp.dest("."));
61-
});
62-
63-
gulp.task("vsce:publish", () => {
64-
return vsce.publish();
65-
});
66-
67-
gulp.task("vsce:package", () => {
68-
return vsce.createVSIX({
69-
packagePath: "../../dist/deviceSimulatorExpress-0.0.0-UNTRACKEDVERSION.vsix"
70-
});
71-
});
72-
73-
gulp.task(
74-
"compile",
75-
gulp.series("clean", "internal-compile", "python-compile", callback => {
76-
callback();
77-
})
78-
);
79-
80-
gulp.task(
81-
"build",
82-
gulp.series(
83-
"clean",
84-
"internal-nls-compile",
85-
"python-compile",
86-
"add-locales",
87-
callback => {
88-
callback();
89-
}
90-
)
91-
);
92-
93-
gulp.task(
94-
"publish",
95-
gulp.series("compile", "vsce:publish", callback => {
96-
callback();
97-
})
98-
);
99-
100-
gulp.task(
101-
"package",
102-
gulp.series("compile", "vsce:package", callback => {
103-
callback();
104-
})
105-
);
106-
107-
//---- internal
108-
109-
function compile(buildNls) {
110-
var r = tsProject
111-
.src()
112-
.pipe(sourcemaps.init())
113-
.pipe(tsProject())
114-
.js.pipe(buildNls ? nls.rewriteLocalizeCalls() : es.through())
115-
.pipe(
116-
buildNls
117-
? nls.createAdditionalLanguageFiles(languages, "locales", "out")
118-
: es.through()
119-
);
120-
121-
if (inlineMap && inlineSource) {
122-
r = r.pipe(sourcemaps.write());
123-
} else {
124-
r = r.pipe(
125-
sourcemaps.write("../out", {
126-
// no inlined source
127-
includeContent: inlineSource,
128-
// Return relative source map root directories per file.
129-
sourceRoot: "../src"
130-
})
131-
);
132-
}
133-
134-
return r.pipe(gulp.dest(outDest));
135-
}
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
const gulp = require("gulp");
7+
8+
const ts = require("gulp-typescript");
9+
const sourcemaps = require("gulp-sourcemaps");
10+
const typescript = require("typescript");
11+
const del = require("del");
12+
const es = require("event-stream");
13+
const vsce = require("vsce");
14+
const nls = require("vscode-nls-dev");
15+
16+
const tsProject = ts.createProject("./tsconfig.json", { typescript });
17+
18+
const inlineMap = true;
19+
const inlineSource = false;
20+
const outDest = "out";
21+
22+
// A list of all locales supported by VSCode can be found here: https://code.visualstudio.com/docs/getstarted/locales
23+
const languages = [{ folderName: "en", id: "en" }];
24+
25+
gulp.task("clean", () => {
26+
return del(
27+
[
28+
"out/*",
29+
"package.nls.*.json",
30+
"../../dist/*0.0.0-UNTRACKEDVERSION.vsix",
31+
],
32+
{ force: true }
33+
);
34+
});
35+
36+
const pythonToMove = [
37+
"./src/adafruit_circuitplayground/*.*",
38+
"./src/microbit/*.*",
39+
"./src/microbit/!(test)/**/*",
40+
"./src/*.py",
41+
"./src/common/*.py",
42+
"./src/requirements.txt",
43+
"./src/templates/*.*"
44+
];
45+
46+
gulp.task("python-compile", () => {
47+
// the base option sets the relative root for the set of files,
48+
// preserving the folder structure
49+
return gulp.src(pythonToMove, { base: "./src/" }).pipe(gulp.dest("out"));
50+
});
51+
52+
gulp.task("internal-compile", () => {
53+
return compile(false);
54+
});
55+
56+
gulp.task("internal-nls-compile", () => {
57+
return compile(true);
58+
});
59+
60+
gulp.task("add-locales", () => {
61+
return gulp
62+
.src(["package.nls.json"])
63+
.pipe(nls.createAdditionalLanguageFiles(languages, "locales"))
64+
.pipe(gulp.dest("."));
65+
});
66+
67+
gulp.task("vsce:publish", () => {
68+
return vsce.publish();
69+
});
70+
71+
gulp.task("vsce:package", () => {
72+
return vsce.createVSIX({
73+
packagePath:
74+
"../../dist/deviceSimulatorExpress-0.0.0-UNTRACKEDVERSION.vsix",
75+
});
76+
});
77+
78+
gulp.task(
79+
"compile",
80+
gulp.series("clean", "internal-compile", "python-compile", callback => {
81+
callback();
82+
})
83+
);
84+
85+
gulp.task(
86+
"build",
87+
gulp.series(
88+
"clean",
89+
"internal-nls-compile",
90+
"python-compile",
91+
"add-locales",
92+
callback => {
93+
callback();
94+
}
95+
)
96+
);
97+
98+
gulp.task(
99+
"publish",
100+
gulp.series("compile", "vsce:publish", callback => {
101+
callback();
102+
})
103+
);
104+
105+
gulp.task(
106+
"package",
107+
gulp.series("compile", "vsce:package", callback => {
108+
callback();
109+
})
110+
);
111+
112+
//---- internal
113+
114+
function compile(buildNls) {
115+
var r = tsProject
116+
.src()
117+
.pipe(sourcemaps.init())
118+
.pipe(tsProject())
119+
.js.pipe(buildNls ? nls.rewriteLocalizeCalls() : es.through())
120+
.pipe(
121+
buildNls
122+
? nls.createAdditionalLanguageFiles(languages, "locales", "out")
123+
: es.through()
124+
);
125+
126+
if (inlineMap && inlineSource) {
127+
r = r.pipe(sourcemaps.write());
128+
} else {
129+
r = r.pipe(
130+
sourcemaps.write("../out", {
131+
// no inlined source
132+
includeContent: inlineSource,
133+
// Return relative source map root directories per file.
134+
sourceRoot: "../src",
135+
})
136+
);
137+
}
138+
139+
return r.pipe(gulp.dest(outDest));
140+
}

locales/en/out/constants.i18n.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"info.deploySimulator": "\n[INFO] Deploying code to the simulator...\n",
2828
"info.deploySuccess": "\n[INFO] Code successfully deployed\n",
2929
"info.extensionActivated": "Congratulations, your extension Adafruit_Simulator is now active!",
30-
"info.firstTimeWebview": "To reopen the simulator click on the \"Open Simulator\" button on the upper right corner of the text editor, or select the command \"Open Simulator\" from command palette.",
30+
"info.firstTimeWebview": "To reopen the simulator select the command \"Open Simulator\" from command palette.",
3131
"info.installPythonDependencies": "Do you want us to try and install this extensions dependencies for you?",
3232
"error.invalidFileExtensionDebug": "The file you tried to run isn\\'t a Python file.",
3333
"info.newFile": "New to Python or the Circuit Playground Express? We are here to help!",
@@ -36,7 +36,7 @@
3636
"info.privacyStatement": "Privacy Statement",
3737
"info.successfulInstall": "Successfully installed Python dependencies.",
3838
"info.thirdPartyWebsite": "By clicking \"Agree and Proceed\" you will be redirected to adafruit.com, a third party website not managed by Microsoft. Please note that your activity on adafruit.com is subject to Adafruit's privacy policy",
39-
"info.welcomeOutputTab": "Welcome to the Adafruit Simulator output tab!\n\n",
39+
"info.welcomeOutputTab": "Welcome to the Device Simulator Express output tab!\n\n",
4040
"label.webviewPanel": "Device Simulator Express",
4141
"name": "Device Simulator Express",
4242

locales/en/package.i18n.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
{
2-
"deviceSimulatorExpressExtension.commands.changeBaudRate": "Change Baud Rate",
3-
"deviceSimulatorExpressExtension.commands.closeSerialMonitor": "Close Serial Monitor",
4-
"deviceSimulatorExpressExtension.commands.label": "Device Simulator Express",
5-
"deviceSimulatorExpressExtension.commands.openSerialMonitor": "Open Serial Monitor",
6-
"deviceSimulatorExpressExtension.commands.openSimulator": "Open Simulator",
7-
"deviceSimulatorExpressExtension.commands.runSimulator": "Run Simulator",
8-
"deviceSimulatorExpressExtension.commands.newFile": "New File",
9-
"deviceSimulatorExpressExtension.commands.runDevice": "Deploy to Device",
10-
"deviceSimulatorExpressExtension.commands.selectSerialPort": "Select Serial Port",
2+
"deviceSimulatorExpressExtension.commands.common.installDependencies": "Install Extension Dependencies",
3+
"deviceSimulatorExpressExtension.commands.common.label": "Device Simulator Express",
4+
"deviceSimulatorExpressExtension.commands.common.runSimulator": "Run Simulator",
5+
"deviceSimulatorExpressExtension.commands.cpx.changeBaudRate": "[Circuit Playground Express] Change Baud Rate",
6+
"deviceSimulatorExpressExtension.commands.cpx.closeSerialMonitor": "[Circuit Playground Express] Close Serial Monitor",
7+
"deviceSimulatorExpressExtension.commands.cpx.openSerialMonitor": "[Circuit Playground Express] Open Serial Monitor",
8+
"deviceSimulatorExpressExtension.commands.cpx.openSimulator": "[Circuit Playground Express] Open Simulator",
9+
"deviceSimulatorExpressExtension.commands.cpx.newFile": "[Circuit Playground Express] New File",
10+
"deviceSimulatorExpressExtension.commands.cpx.deployToDevice": "[Circuit Playground Express] Deploy to Device",
11+
"deviceSimulatorExpressExtension.commands.cpx.selectSerialPort": "[Circuit Playground Express] Select Serial Port",
12+
"deviceSimulatorExpressExtension.commands.microbit.openSimulator": "[micro:bit] Open Simulator",
13+
"deviceSimulatorExpressExtension.commands.microbit.newFile": "[micro:bit] New File",
1114
"deviceSimulatorExpressExtension.configuration.title": "Device Simulator Express configuration",
12-
"deviceSimulatorExpressExtension.configuration.properties.open": "Whether to show 'Open Simulator' icon in editor title menu.",
13-
"deviceSimulatorExpressExtension.configuration.properties.device": "Whether to show 'Run Device' icon in editor title menu.",
14-
"deviceSimulatorExpressExtension.configuration.properties.simulator": "Whether to show 'Run Simulator' icon in editor title menu.",
15-
"deviceSimulatorExpressExtension.configuration.properties.debuggerPort": "The port the Server will listen on for communication with the debugger."
15+
"deviceSimulatorExpressExtension.configuration.properties.configEnvOnChange": "When you change the Python interpreter, the Device Simulator Express will automatically configure itself for the required dependencies.",
16+
"deviceSimulatorExpressExtension.configuration.properties.debuggerPort": "The port the Server will listen on for communication with the debugger.",
17+
"deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask if we can download dependencies. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files."
18+
"deviceSimulatorExpressExtension.configuration.properties.previewMode": "Enable this to test out and play with the new micro:bit simulator!"
1619
}

0 commit comments

Comments
 (0)