Skip to content

Commit 3c3ffe6

Browse files
authored
Merge pull request #1830 from microsoft/dev
Sync from dev
2 parents b197e17 + c7f84b4 commit 3c3ffe6

42 files changed

Lines changed: 1875 additions & 4188 deletions

File tree

Some content is hidden

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

docs/concepts.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ This section outlines the main concepts and definitions used in *Web Template St
66

77
*Web Template Studio* is divided in the following main elements:
88

9-
- **Extension**: Refers to the Visual Studio Code Extension project, which, once installed, allows users to have an improved experience when creating a new Web Application from the `Web Template Studio: [command name]` command. The extension is written in typescript.
9+
- **Extension**: Refers to the Visual Studio Code Extension project, which, once installed, allows users to have an improved experience when creating a new Web or React Native Application. The extension is written in typescript.
10+
11+
The extension is started by using the the `Web Template Studio: [command name]` command. Currently available commands are:
12+
- Web Template Studio: Create Web App
13+
- Web Template Studio: Create React Native App
14+
- Web Template Studio: Deploy Web App
1015

11-
Can check available commands [here](./contributing/application-architecture.md#extension).
1216
- **Wizard**: Refers to the WebTS client project, where all user interaction occurs after launching *Web Template Studio*. The Wizard guides the user through some steps to create the desired project. It allows the user to select from the available frameworks, pages and Azure Cloud Services. The wizard is created with React Typescript and is displayed through the React Panel.
1317
- **Core Template Studio and Core Template Studio CLI**: Refers to the .NET Core executable that handles all of the template synchronization and code generation (composition, generation + postaction execution). The CLI is the entry point for executing commands on Core Template Studio executable. CoreTS CLI is a self-contained .NET Core 3.1 application.
14-
- **Template**: A template contains code with metadata. The metadata will contain the following template information: name, description, licensing, remarks, programming language, type, etc. The template definition is based on [dotnet Template Engine](https://github.com/dotnet/templating). [More details on templates](./contributing/templates.md)
18+
- **Template**: A template contains code with metadata. The metadata will contain the following template information: name, description, licensing, remarks, programming language, type, etc. The template definition is based on [dotnet Template Engine](https://github.com/dotnet/templating). For more details templates see [Understanding the Templates](./contributing/templates.md)
1519

1620
## Other Terminology
1721

docs/contributing/getting-started-developers.md

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ This document covers:
99
- [Core Template Studio Submodule](#core-template-studio-submodule)
1010
- [How to run the extension locally](#how-to-run-the-extension-locally)
1111
- [How to develop the client](#how-to-develop-the-client)
12+
- [Troubleshooting](#troubleshooting)
1213
- [How to build a local vsix](#how-to-build-a-local-vsix)
1314
- [Tests](#tests)
1415
- [Under the hood](#under-the-hood)
16+
- [Folder overview](#folder-overview)
1517

1618
Before starting make sure you read the [Web Template Studio arquitecture](application-architecture.md) document.
1719

@@ -29,15 +31,16 @@ If you just want to take advantage from *Web Template Studio* extension, check t
2931
1. Run the command `npm config set scripts-prepend-node-path true`. This tells VSCode which Node version to run during the extension compilation (otherwise you'll get an error during the build process).
3032

3133
### For a react native application
32-
1. You have to check the following [dependencies](https://microsoft.github.io/react-native-windows/docs/rnw-dependencies).
34+
You have to check the following [dependencies](https://microsoft.github.io/react-native-windows/docs/rnw-dependencies).
3335

34-
In the Wizard you have a link on the right-side bar, to show a modal with the System Requirements.
36+
In the Wizard you have a link on the right-side bar, to show a modal with the System Requirements. If any of them is missing you will see a warning.
3537

36-
<img alt="React Native System Requirements" src="../resources/react-native-requirements.png" width="85%" />
38+
If you are running `WebTS` in Mac/Linux you will see a different message, notifying you that the generated native Windows application cannot be run.
3739

38-
**Note**: If using Windows, use Git Bash.
40+
<img alt="React Native System Requirements" src="../resources/react-native-requirements.png" width="85%" />
3941

40-
At some point you may also need to install [React-scripts](https://yarnpkg.com/package/react-scripts) and [Typescript](https://www.typescriptlang.org/).
42+
43+
**Note**: When developing in `WebTS` you may also need to install [React-scripts](https://yarnpkg.com/package/react-scripts) and [Typescript](https://www.typescriptlang.org/).
4144

4245
## Project folder structure
4346

@@ -92,7 +95,11 @@ Core Template Studio is integrated into *Web Template Studio* using a git submod
9295
When you clone *Web Template Studio* you have to run two commands: `git submodule init` and `git submodule update` to fetch all the data from Core Template Studio. When fetching changes, also execute `git submodule update` after doing git fetch to be sure you're submodule is up to date.
9396

9497
### Update with remote changes
95-
Changes on Core Template Studio should be done on the Core Template Studio repos. In WebTS, to update the submodule to the most recent commit, you have to run the command: `git submodule update --remote`.
98+
Changes on Core Template Studio should be done on the Core Template Studio repos. In WebTS, to update the submodule to the most recent commit, you have to run the command: `git submodule update --remote`.
99+
100+
This will require a new `git submodule update` on other local repositories to get the update.
101+
102+
For more info visit the [official documentation](https://git-scm.com/docs/git-submodule).
96103

97104
## How to run the extension locally
98105
1. Run `./build-all.sh` from the `_build` folder. This script installs dependencies and compiles the client and core template studio and copies it to the extension. It also builds and installs the extension.
@@ -117,9 +124,12 @@ Changes on Core Template Studio should be done on the Core Template Studio repos
117124
As the client is injected as a static web app in the webview of the extension, debugging inside the extension can be challenging. Running the client in a browser is useful for quickly testing HTML or CSS changes and for debugging since you can use **Chrome extensions** such as `React and Redux developer tools`.
118125

119126
When running in the browser, communication with the extension is done against the mock `mockVsCodeApi.ts` in the `mockData` folder. Note that the behaviour of the client on the browser may differ from the behaviour in the extension, so make sure to test out both.
127+
120128
Styles are mocked in the Browser using the file [`mockThemes.css`](../../src/client/src/css/mockThemes.css).
121129

122-
1. Run `./build-client.sh` from the _build folder.
130+
To choose what platform you want to debug, you can modify `mockConfig.ts` in the `mockData`folder.
131+
132+
1. Run `./build-client.sh` from the `_build` folder. Or you can use the command `yarn build` if you are on the `client` folder already.
123133
2. Open the `src/client` folder using `VSCode`.
124134
3. Start the client using `yarn start` to begin development in the browser. We recommend using a chromium based browser such as Chrome.
125135

@@ -129,7 +139,7 @@ Styles are mocked in the Browser using the file [`mockThemes.css`](../../src/cli
129139

130140
### To debug from Visual Studio Code:
131141
Install [Debugger for Chrome extension](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) in Visual Studio Code debug Wizard Client.
132-
After starting the client using `yarn start` in VSCode Debug View (`Ctrl + Shift ⇧ + D` (Windows/Linux) or `Shift ⇧ + Command ⌘ + D` (Mac) in Visual Studio Code) select "*Debug WebTS Client*" and start debugging (`F5`).
142+
After starting the client using `yarn start` in VSCode Debug View (`Ctrl + Shift ⇧ + D` (Windows/Linux) or `Shift ⇧ + Command ⌘ + D` (Mac) in Visual Studio Code) select "*Debug WebTS Client*" and start debugging (you can directly press: `F5`).
133143

134144
#### More info:
135145
- [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome)
@@ -155,10 +165,14 @@ After installation, use `Ctrl + Shift ⇧ + P` (Windows/Linux) or `Command ⌘ +
155165
You can check available commands [here](./contributing/application-architecture.md#extension).
156166

157167
### Possible problems and workarounds to fix them
158-
1. You may get some errors on the output console for the extension: `webtemplatestudio-{env}`, or maybe you realise that there´s missing information displayed on the screen.
159-
For example, no Frameworks at all for the `Create Web App` command. Make sure you have the proper versions of the .mstx for the templates in the extension folder - as mentioned above, for *Windows* would be `%USERPROFILE%\.vscode\extensions\wasteamaccount.webtemplatestudio-{environment}-{version}\src\corets-cli` or in *Mac/Linux* `~/.vscode/extensions/wasteamaccount.webtemplatestudio-{environment}-{version}/src/corets-cli`.
168+
You may get some errors on the output console for the extension: `webtemplatestudio-{env}`, or maybe you realise that there´s missing information displayed on the screen.
169+
For example, no Frameworks at all for the `Create Web App` command. Make sure you have the proper versions of the `.mstx` for the templates in the extension folder - as mentioned above, for *Windows* would be `%USERPROFILE%\.vscode\extensions\wasteamaccount.webtemplatestudio-{environment}-{version}\src\corets-cli` or in *Mac/Linux* `~/.vscode/extensions/wasteamaccount.webtemplatestudio-{environment}-{version}/src/corets-cli`.
170+
171+
If that´s not the case, and you have an older version, or you´re missing some package of templates, then you will need to retrieve them from the generated `.vsix`.
172+
1. You can follow [the following instructions](https://github.com/microsoft/CoreTemplateStudio/wiki/Tools:-WTS-Packaging-Tool) to create the package.
173+
2. If you have permissions, you can download the `.vsix` from the *Build Pipeline*.
160174

161-
If that´s not the case, and you have an older version, or you´re missing some package of templates, then you will need to retrieve them from the generated .vsix in the [Build Pipeline](https://winappstudio.visualstudio.com/Vegas). Also will need to update the `Allowed Packages` with the .mstx hashes in the file `CoreTemplateStudio.config` within the proper folder depending on the OS you are working (*win21* for instance, when developing on *Windows* for example).
175+
**Note**: You will also need to update the `Allowed Packages` with the `.mstx` hashes in the file `CoreTemplateStudio.config` within the proper folder depending on the OS you are working (*win32* for instance, when developing on *Windows* for example).
162176

163177
<img alt="Install extension from .vsix" src="../resources/vscode-output-window-errors.png" width="500px" />
164178
<img alt="Folder where you can find the .mstx for the templates" src="../resources/extension-folder-mstx.png" width="400px" />
@@ -194,6 +208,46 @@ repository by [rebornix](https://github.com/rebornix):
194208
- For all resources going to the webview, their scheme is `vscode-resource`
195209
- We add a baseUrl `<base href="${vscode.Uri.file(path.join(this._extensionPath, 'build')).with({ scheme: 'vscode-resource' })}/">` and then all relative paths work.
196210

211+
## Troubleshooting
212+
You may encounter some issues when using or developing in WebTS. It could be due to folder permissions, missing to create the Template packages,... Find below a list of folders that you may be interested in visiting and removing if this happens to you.
213+
214+
- You need permissions to write on the local `WebTS` folder, where you can find the `Logs` and `Templates` folders.
215+
216+
- Web Template Studio may be missing execute permissions on the `corets-cli` folder, can check full path on the table below, where the Core Template Studio CLI is located.
217+
218+
- The template cache is located in the `.templateengine` folder. Template caches are isolated by environment.
219+
220+
**Note**: If you clean or remove the corets-cli folder, you should make sure that you re run the build-all.sh script. Otherwise, if you removed the Templates or the Template Cache, you need to Launch the `Web Template Studio` wizard again.
221+
222+
**Warning**: When you are debugging the application, a shortcut to the `Templates` folder of your code is used. Mind that everything you modified there, will be changed on the **local repository**.
223+
224+
## Useful folders
225+
To make it easier for you to see which folder is used on the different OS, we added a summary table below:
226+
227+
| Environment | Description | Folder |
228+
| ----------- | ------ | ----------- |
229+
| `Windows` | Core Template Studio CLI | `%userprofile%\.vscode\extensions\wasteamaccount.webtemplatestudio-[environment]-[version]\src\corets-cli\` |
230+
| | Logs and Templates |`%LocalAppData%/WebTS` |
231+
| | Template cache | `%userprofile%\.templateengine\[environment].[platform].Any` |
232+
| `Mac` | Core Template Studio CLI | `/Users/[username]/.vscode-server/extensions/wasteamaccount.webtemplatestudio-[environment]-[version]/src/corets-cli/` |
233+
| | Logs and Templates | `/Users/[username]/.local/share/WebTS` |
234+
| | Template cache | `/Users/[username]/.templateengine/[environment].[platform].Any` |
235+
| `Linux` | Core Template Studio CLI | `//home/[username]/.vscode-server/extensions/wasteamaccount.webtemplatestudio-[environment]-[version]/src/corets-cli/` |
236+
| | Logs and Templates | `//home/[username]/.local/share/WebTS` | |
237+
| | Template cache | `//home/[username]/.templateengine/[environment].[platform].Any` |
238+
239+
Below you have an overview of the different folder names for the different environments:
240+
241+
| Environment name | Description | .vsix folder name | Template Cache Folder Name |
242+
| ----------- | ----------- | -------------- | ------------ |
243+
| WebTSDebug | Debug extension locally | - | WebTSDebug |
244+
| Local | Local vsix | local | Local.Web.Any |
245+
| | | | Local.RN.Any |
246+
| Nightly | Nightly version | nightly | Nightly.Web.Any |
247+
| | | | Nightly.RN.Any |
248+
| Dev | Marketplace version | dev-nightly | Dev.Web.Any |
249+
| | | | Dev.RN.Any |
250+
197251
## Learn more
198252

199253
- [All docs](../README.md)

docs/generated-apps/web/deployment.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ This folder will contain all the necessary frontend and backend files for the de
3737

3838
*Web Template Studio* will then automatically launch the command `Azure App Service: Deploy to Web App...`, which will be in charge of deploying the application to an *Azure App Service*.
3939

40-
- If you have added an *Azure App Service* when creating your application with *Web Template Studio*, the application already has a deployment configuration, so it will use the created *Azure App Service*.
41-
42-
- Otherwise, the *Azure App Service* extension will ask you for the configuration settings to create a new *Azure App Service*:
43-
- The folder that contains the app to deploy to the App Service. Select the `publish` folder for deployment to be successful.
44-
- Select `Create New Web App...`
45-
- Enter your web app name
46-
- Select Linux as your OS
47-
- Select Node.js 12 LTS for a Node/Express application, Python 3.7 for a Flask application or .Net Core Latest runtime for ASP .NET application.
40+
- If you have added an *Azure App Service* when creating your application with *Web Template Studio*, the application already has a deployment configuration, so it will use the created *Azure App Service*.
41+
42+
- Otherwise, the *Azure App Service* extension will ask you for the configuration settings to create a new *Azure App Service*:
43+
- The folder that contains the app to deploy to the App Service. Select the `publish` folder for deployment to be successful.
44+
- Select `Create New Web App...`
45+
- Enter your web app name
46+
- Select Linux as your OS
47+
- Select Node.js 12 LTS for a Node/Express application, Python 3.7 for a Flask application or .Net Core Latest runtime for ASP .NET application.
4848

4949
Start the application deployment to *Azure App Service*. We can see the progress of the deployment in the output of the *Azure App Service* extension.
5050

docs/telemetryData.md

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,65 @@
1-
# Telemetry for Web Template Studio - 2021.04
1+
# Telemetry for Web Template Studio - 2021.05
22

33
As new features and pages roll out, percentages will adjust.
44

5+
### Category
6+
7+
|Type|Percentage|
8+
|:---|:---:|
9+
|Web|92.1%|
10+
|RN|7.9%|
11+
12+
### Project Generation by category
13+
14+
<details>
15+
<summary>Web Full Stack Generation</summary>
16+
517
### Frontend Frameworks
618

719
|Framework Type|Percentage|
820
|:---|:---:|
9-
|React|67.7%|
10-
|Vue|22.2%|
11-
|Angular|10.1%|
21+
|React|61.8%|
22+
|Vue|21.3%|
23+
|Angular|16.9%|
1224

1325
### Backend Frameworks
1426

1527
|Framework Type|Percentage|
1628
|:---|:---:|
17-
|Node|61.9%|
18-
|AspNet|19.4%|
19-
|Flask|14.5%|
20-
|Moleculer|4.2%|
29+
|Node|53.5%|
30+
|Flask|21.3%|
31+
|AspNet|19.9%|
32+
|Moleculer|5.3%|
2133

2234
### Pages
2335

2436
|Pages|Percentage|
2537
|:---|:---:|
26-
|Blank|44%|
27-
|Grid|20.1%|
28-
|Master Detail|19%|
29-
|List|16.8%|
38+
|Blank|33.6%|
39+
|Master Detail|24.5%|
40+
|Grid|20.9%|
41+
|List|20.9%|
42+
43+
44+
</details>
45+
46+
<details>
47+
<summary>React Native Generation</summary>
48+
49+
### Project Types
50+
51+
|Framework Type|Percentage|
52+
|:---|:---:|
53+
|Tabbed|100%|
3054

31-
### Services
55+
### Pages
3256

33-
|Services|Percentage|
57+
|Pages|Percentage|
3458
|:---|:---:|
35-
|Cosmos DB|55.2%|
36-
|App Service|44.8%|
59+
|Blank|46.9%|
60+
|MasterDetail|30.6%|
61+
|Settings|22.4%|
62+
63+
64+
</details>
3765

sha256-release.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Version: 0.5.2104801
1+
Version: 0.6.2113301
22

3-
sha256: 88CF0E6466A1D760AF6AB47D3F768FFAC58035129B60FC0C4A4EE1FC9A57F2BC
3+
sha256: B17C1FAF05B604FD25EF8A5D0D4A557764052F64F71F1E93A18C95B2C280F5B4

src/CoreTemplateStudio

Submodule CoreTemplateStudio updated 136 files

src/client/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,9 @@
7070
],
7171
"devDependencies": {
7272
"@testing-library/jest-dom": "^5.5.0",
73-
"@types/enzyme": "^3.10.5",
74-
"@types/enzyme-adapter-react-16": "^1.0.6",
7573
"@types/redux-mock-store": "^1.0.2",
7674
"@typescript-eslint/eslint-plugin": "^4.15.1",
7775
"@typescript-eslint/parser": "^4.15.1",
78-
"enzyme": "^3.11.0",
79-
"enzyme-adapter-react-16": "^1.15.2",
8076
"eslint": "^7.20.0",
8177
"eslint-config-prettier": "^8.0.0",
8278
"eslint-plugin-prettier": "^3.3.1",

src/client/src/App.test.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
import { shallow } from "enzyme";
1+
import { RenderResult } from "@testing-library/react";
22
import * as React from "react";
3+
import configureMockStore from "redux-mock-store";
34

45
import App from "./App";
6+
import { getInitialState } from "./mockData/mockStore";
7+
import { renderWithStore } from "./testUtils";
58

6-
xdescribe("App", () => {
9+
describe("App", () => {
710
let props: any;
8-
let wrapper: any;
11+
let wrapper: RenderResult;
12+
13+
const mockStore = configureMockStore();
14+
const initialState = getInitialState();
15+
const store = mockStore(initialState);
916

1017
beforeEach(() => {
1118
props = {};
12-
wrapper = shallow(<App {...props} />);
19+
wrapper = renderWithStore(<App {...props} />, store);
1320
});
1421

1522
it("renders without crashing", () => {

0 commit comments

Comments
 (0)