From 0e3459337f7e073cb5b759f81785d42d108c2f5e Mon Sep 17 00:00:00 2001 From: johnthagen Date: Fri, 13 Nov 2020 09:38:58 -0500 Subject: [PATCH 1/2] Set cache expiration so that if the server's frontend implementation is updated (#809) --- nginx/templates/thecombine.conf.template | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nginx/templates/thecombine.conf.template b/nginx/templates/thecombine.conf.template index 2d3a6d9720..341e0c3c68 100644 --- a/nginx/templates/thecombine.conf.template +++ b/nginx/templates/thecombine.conf.template @@ -35,9 +35,13 @@ server { } location / { - root /usr/share/nginx/html; - index index.html index.htm; - try_files $uri $uri/ /index.html; + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + # Set cache expiration so that if the server's frontend implementation is updated, + # clients will automatically pull in a fresh version at the beginning of the next day. + expires 12h; + add_header Cache-Control "public, no-transform" } error_page 500 502 503 504 /50x.html; From 5c1a0f2600bfe82e93f1498ea0f31c66783d0e6f Mon Sep 17 00:00:00 2001 From: "D. Ror" Date: Fri, 13 Nov 2020 11:44:11 -0500 Subject: [PATCH 2/2] Add explicit default formatters by language (#808) --- .vscode/extensions.json | 2 +- .vscode/settings.json | 28 ++++++++++++++++++++++++++++ README.md | 12 +++++------- package.json | 4 ++-- scripts/printVersion.js | 2 +- 5 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 8b3e3c0ca3..26c61fddb9 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,7 +3,7 @@ // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp // List of extensions which should be recommended for users of this workspace. - "recommendations": ["esbenp.prettier-vscode"], + "recommendations": ["esbenp.prettier-vscode", "ms-dotnettools.csharp"], // List of extensions recommended by VS Code that should not be recommended for users of this workspace. "unwantedRecommendations": [] diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..ea225fb56f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,28 @@ +{ + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "file", + "[csharp]": { + "editor.defaultFormatter": "ms-dotnettools.csharp" + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[markdown]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + } +} diff --git a/README.md b/README.md index d5ca65f1dc..41f9486bda 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,9 @@ A rapid word collection tool. - [MongoDB](https://docs.mongodb.com/manual/administration/install-community/) and add /bin to PATH Environment Variable - On Windows, if using [Chocolatey][chocolatey]: `choco install mongodb` - - [VS Code](https://code.visualstudio.com/download) and Prettier code - formatting extension + - [VS Code](https://code.visualstudio.com/download) and the following extensions: + - C# (`ms-dotnettools.csharp`) + - Prettier - Code formatter (`esbenp.prettier-vscode`) - [dotnet-format](https://github.com/dotnet/format): `dotnet tool update --global dotnet-format --version 4.1.131201` - [dotnet-reportgenerator](https://github.com/danielpalme/ReportGenerator) @@ -85,13 +86,10 @@ A rapid word collection tool. - `COMBINE_SMTP_ADDRESS` - `COMBINE_SMTP_FROM` -6. (VS Code Users Only) Enable automatic formatting on save. - - **File** | **Preferences** | **Settings** | Search for **formatOnSave** and - check the box. -7. Run `npm start` from the project directory to install dependencies and start +6. Run `npm start` from the project directory to install dependencies and start the project. -8. Consult our [C#](docs/c_sharp_style_guide.md) +7. Consult our [C#](docs/c_sharp_style_guide.md) and [JavaScript/TypeScript](docs/ts_style_guide.md) style guides for best coding practices in this project. diff --git a/package.json b/package.json index 3e347355c4..d27128257e 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "eject": "react-scripts eject", "fmt-backend": "dotnet-format", "fmt-backend-check": "dotnet-format --check", - "fmt-frontend": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,json}\"", - "fmt-frontend-check": "prettier --check \"./src/**/*.{js,jsx,ts,tsx,json}\"", + "fmt-frontend": "prettier --write \"./{.vscode,public,scripts,src}/**/*.{js,jsx,ts,tsx,json}\"", + "fmt-frontend-check": "prettier --check \"./{.vscode,public,scripts,src}/**/*.{js,jsx,ts,tsx,json}\"", "frontend": "react-scripts start", "gen-backend-coverage-report": "tsc scripts/genBackendCoverageReport.ts && node scripts/genBackendCoverageReport.js", "import-sem-doms": "tsc scripts/importSemanticDomains.ts && node scripts/importSemanticDomains.js", diff --git a/scripts/printVersion.js b/scripts/printVersion.js index 8729268eea..eeb45766b7 100755 --- a/scripts/printVersion.js +++ b/scripts/printVersion.js @@ -1 +1 @@ -console.log(require('../package.json').version); +console.log(require("../package.json").version);