From 5eb60e24150b2c55df0a4a298d93ed73085b1a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Mach?= <92859870+JMach1@users.noreply.github.com> Date: Fri, 26 Aug 2022 18:03:20 +0200 Subject: [PATCH] Apim/custom widgets scaffolder beta2 - templates updated (#22974) ### Packages impacted by this PR @azure/api-management-custom-widgets-scaffolder ### Issues associated with this PR n/a ### Describe the problem that is addressed by this PR Updates & synchronizes dependencies used in various templates. Improves formatting in the templates. Removes unnecessary duplicated path from fetch requests in templates. ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? n/a ### Are there test cases added in this PR? _(If not, why?)_ No, there were no changes to the API, only minor improvements to existing templates. ### Provide a list of related PRs _(if any)_ n/a --- .../CHANGELOG.md | 10 +++++----- .../bin/templates/_shared/src/styles/app.scss | 1 + .../bin/templates/react/package.json.mustache | 11 +++++------ .../bin/templates/react/src/app/index.tsx | 2 +- .../bin/templates/react/vite.config.ts.mustache | 2 +- .../bin/templates/typescript/package.json.mustache | 8 ++++---- .../bin/templates/typescript/src/index.html.mustache | 2 +- .../bin/templates/typescript/tsconfig.json | 2 +- .../bin/templates/vue/package.json.mustache | 6 +++--- .../bin/templates/vue/src/components/app/index.vue | 2 +- .../src/templates/_shared/src/styles/app.scss | 1 + .../src/templates/react/package.json.mustache | 11 +++++------ .../src/templates/react/src/app/index.tsx | 2 +- .../src/templates/react/vite.config.ts.mustache | 2 +- .../src/templates/typescript/package.json.mustache | 8 ++++---- .../src/templates/typescript/src/index.html.mustache | 2 +- .../src/templates/typescript/tsconfig.json | 2 +- .../src/templates/vue/package.json.mustache | 6 +++--- .../src/templates/vue/src/components/app/index.vue | 2 +- 19 files changed, 41 insertions(+), 41 deletions(-) diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/CHANGELOG.md b/sdk/apimanagement/api-management-custom-widgets-scaffolder/CHANGELOG.md index c3c074cde112..ad30b75545fa 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/CHANGELOG.md +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/CHANGELOG.md @@ -1,15 +1,15 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2022-08-26) -### Features Added +### Bugs fixed -### Breaking Changes - -### Bugs Fixed +- fetch fail on CORS error while fetching data in managed Developer Portals ### Other Changes +- templates dependencies update & synchronization among the frameworks + ## 1.0.0-beta.1 (2022-08-03) - First release of package, see README.md for details. diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/_shared/src/styles/app.scss b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/_shared/src/styles/app.scss index 5ceb38fc1cef..9b7b237857b1 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/_shared/src/styles/app.scss +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/_shared/src/styles/app.scss @@ -47,6 +47,7 @@ body { padding: 9px 50px; background-color: rgba(254, 213, 60, 1); border-radius: 3px; + cursor: pointer; } } diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/package.json.mustache b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/package.json.mustache index 78ff5ab343b1..930d0e01b5e8 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/package.json.mustache +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/package.json.mustache @@ -12,16 +12,15 @@ "dependencies": { "@azure/api-management-custom-widgets-tools": "^1.0.0-beta.1", "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-helmet-async": "^1.3.0" + "react-dom": "^18.2.0" }, "devDependencies": { - "@types/react": "^18.0.15", + "@types/react": "^18.0.17", "@types/react-dom": "^18.0.6", - "@vitejs/plugin-react": "^2.0.0", + "@vitejs/plugin-react": "^2.0.1", "prettier": "^2.7.1", - "sass": "^1.53.0", + "sass": "^1.54.4", "typescript": "^4.7.4", - "vite": "^3.0.0" + "vite": "^3.0.7" } } diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/src/app/index.tsx b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/src/app/index.tsx index b053e8a67c50..ae673b8eaf49 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/src/app/index.tsx +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/src/app/index.tsx @@ -14,7 +14,7 @@ const App = () => { return } - request(`/subscriptions/000/resourceGroups/000/providers/Microsoft.ApiManagement/service/000/users/${userId}`) + request(`/users/${userId}`) .then(e => e.json()) .then(({properties}) => setDefaultEmail(properties.email)) .catch(e => { diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/vite.config.ts.mustache b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/vite.config.ts.mustache index 9386e1c04ffc..eef1566eb098 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/vite.config.ts.mustache +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/react/vite.config.ts.mustache @@ -1,5 +1,5 @@ import {defineConfig} from "vite" -import react from '@vitejs/plugin-react' +import react from "@vitejs/plugin-react" // https://vitejs.dev/config/ export default defineConfig(() => ({ diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/package.json.mustache b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/package.json.mustache index da8a8169d70f..873e16266533 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/package.json.mustache +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/package.json.mustache @@ -13,9 +13,9 @@ "@azure/api-management-custom-widgets-tools": "^1.0.0-beta.1" }, "devDependencies": { - "prettier": "^2.5.1", - "sass": "^1.53.0", - "typescript": "^4.5.4", - "vite": "^2.8.3" + "prettier": "^2.7.1", + "sass": "^1.54.4", + "typescript": "^4.7.4", + "vite": "^3.0.7" } } diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/src/index.html.mustache b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/src/index.html.mustache index 82e70fe279ed..bca847bda521 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/src/index.html.mustache +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/src/index.html.mustache @@ -14,7 +14,7 @@ const appInstance = new App(secrets) if (!secrets.userId) return - appInstance.request(`/subscriptions/000/resourceGroups/000/providers/Microsoft.ApiManagement/service/000/users/${secrets.userId}`) + appInstance.request(`/users/${secrets.userId}`) .then(e => e.json()) .then(({properties}) => { if (properties.email) document.getElementById("email").value = properties.email diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/tsconfig.json b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/tsconfig.json index 5c732fe0ee39..03edeaa6f80e 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/tsconfig.json +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/typescript/tsconfig.json @@ -3,7 +3,7 @@ "module": "ESNext", "target": "es6", "useDefineForClassFields": true, - "lib": ["ESNext", "ES6", "DOM.Iterable"], + "lib": ["ESNext", "ES6", "DOM", "DOM.Iterable"], "moduleResolution": "Node", "strict": true, "sourceMap": true, diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/vue/package.json.mustache b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/vue/package.json.mustache index b01e294ccbea..4867eba5e4f6 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/vue/package.json.mustache +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/vue/package.json.mustache @@ -14,10 +14,10 @@ "vue": "^3.2.37" }, "devDependencies": { - "@vitejs/plugin-vue": "^3.0.1", + "@vitejs/plugin-vue": "^3.0.3", "prettier": "^2.7.1", - "sass": "^1.53.0", + "sass": "^1.54.4", "typescript": "^4.7.4", - "vite": "^3.0.3" + "vite": "^3.0.7" } } diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/vue/src/components/app/index.vue b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/vue/src/components/app/index.vue index 32ce7df544cc..4937f346e108 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/vue/src/components/app/index.vue +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/templates/vue/src/components/app/index.vue @@ -50,7 +50,7 @@ export default { return } - request(`/subscriptions/000/resourceGroups/000/providers/Microsoft.ApiManagement/service/000/users/${secrets.userId}`) + request(`/users/${secrets.userId}`) .then(e => e.json()) .then(({properties}) => this.defaultEmail = properties.email) .catch(e => { diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/_shared/src/styles/app.scss b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/_shared/src/styles/app.scss index 5ceb38fc1cef..9b7b237857b1 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/_shared/src/styles/app.scss +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/_shared/src/styles/app.scss @@ -47,6 +47,7 @@ body { padding: 9px 50px; background-color: rgba(254, 213, 60, 1); border-radius: 3px; + cursor: pointer; } } diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/package.json.mustache b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/package.json.mustache index 78ff5ab343b1..930d0e01b5e8 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/package.json.mustache +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/package.json.mustache @@ -12,16 +12,15 @@ "dependencies": { "@azure/api-management-custom-widgets-tools": "^1.0.0-beta.1", "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-helmet-async": "^1.3.0" + "react-dom": "^18.2.0" }, "devDependencies": { - "@types/react": "^18.0.15", + "@types/react": "^18.0.17", "@types/react-dom": "^18.0.6", - "@vitejs/plugin-react": "^2.0.0", + "@vitejs/plugin-react": "^2.0.1", "prettier": "^2.7.1", - "sass": "^1.53.0", + "sass": "^1.54.4", "typescript": "^4.7.4", - "vite": "^3.0.0" + "vite": "^3.0.7" } } diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/src/app/index.tsx b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/src/app/index.tsx index b053e8a67c50..ae673b8eaf49 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/src/app/index.tsx +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/src/app/index.tsx @@ -14,7 +14,7 @@ const App = () => { return } - request(`/subscriptions/000/resourceGroups/000/providers/Microsoft.ApiManagement/service/000/users/${userId}`) + request(`/users/${userId}`) .then(e => e.json()) .then(({properties}) => setDefaultEmail(properties.email)) .catch(e => { diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/vite.config.ts.mustache b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/vite.config.ts.mustache index 9386e1c04ffc..eef1566eb098 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/vite.config.ts.mustache +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/react/vite.config.ts.mustache @@ -1,5 +1,5 @@ import {defineConfig} from "vite" -import react from '@vitejs/plugin-react' +import react from "@vitejs/plugin-react" // https://vitejs.dev/config/ export default defineConfig(() => ({ diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/package.json.mustache b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/package.json.mustache index da8a8169d70f..873e16266533 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/package.json.mustache +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/package.json.mustache @@ -13,9 +13,9 @@ "@azure/api-management-custom-widgets-tools": "^1.0.0-beta.1" }, "devDependencies": { - "prettier": "^2.5.1", - "sass": "^1.53.0", - "typescript": "^4.5.4", - "vite": "^2.8.3" + "prettier": "^2.7.1", + "sass": "^1.54.4", + "typescript": "^4.7.4", + "vite": "^3.0.7" } } diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/src/index.html.mustache b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/src/index.html.mustache index 82e70fe279ed..bca847bda521 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/src/index.html.mustache +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/src/index.html.mustache @@ -14,7 +14,7 @@ const appInstance = new App(secrets) if (!secrets.userId) return - appInstance.request(`/subscriptions/000/resourceGroups/000/providers/Microsoft.ApiManagement/service/000/users/${secrets.userId}`) + appInstance.request(`/users/${secrets.userId}`) .then(e => e.json()) .then(({properties}) => { if (properties.email) document.getElementById("email").value = properties.email diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/tsconfig.json b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/tsconfig.json index 5c732fe0ee39..03edeaa6f80e 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/tsconfig.json +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/typescript/tsconfig.json @@ -3,7 +3,7 @@ "module": "ESNext", "target": "es6", "useDefineForClassFields": true, - "lib": ["ESNext", "ES6", "DOM.Iterable"], + "lib": ["ESNext", "ES6", "DOM", "DOM.Iterable"], "moduleResolution": "Node", "strict": true, "sourceMap": true, diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/vue/package.json.mustache b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/vue/package.json.mustache index b01e294ccbea..4867eba5e4f6 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/vue/package.json.mustache +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/vue/package.json.mustache @@ -14,10 +14,10 @@ "vue": "^3.2.37" }, "devDependencies": { - "@vitejs/plugin-vue": "^3.0.1", + "@vitejs/plugin-vue": "^3.0.3", "prettier": "^2.7.1", - "sass": "^1.53.0", + "sass": "^1.54.4", "typescript": "^4.7.4", - "vite": "^3.0.3" + "vite": "^3.0.7" } } diff --git a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/vue/src/components/app/index.vue b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/vue/src/components/app/index.vue index 32ce7df544cc..4937f346e108 100644 --- a/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/vue/src/components/app/index.vue +++ b/sdk/apimanagement/api-management-custom-widgets-scaffolder/src/templates/vue/src/components/app/index.vue @@ -50,7 +50,7 @@ export default { return } - request(`/subscriptions/000/resourceGroups/000/providers/Microsoft.ApiManagement/service/000/users/${secrets.userId}`) + request(`/users/${secrets.userId}`) .then(e => e.json()) .then(({properties}) => this.defaultEmail = properties.email) .catch(e => {