" + stackTrace + ""; 49 | } else { 50 | issueBody += "
No stack trace available."; 51 | } 52 | // Developer Information 53 | issueBody += "\n## Developer Information:\n"; 54 | if (devInfo) { 55 | issueBody += "| Key | Value |"; 56 | issueBody += "\n|---|---|"; 57 | issueBody += "\n| Frontend URL | " + devInfo?.frontend?.url + " |"; 58 | issueBody += "\n| Frontend Version | " + devInfo?.frontend?.version + " |"; 59 | issueBody += "\n| Backend URL | " + devInfo?.backend?.url + " |"; 60 | issueBody += "\n| Backend Version | " + devInfo?.backend?.version + " |"; 61 | issueBody += "\n| User Agent | " + devInfo?.client?.userAgent + " |"; 62 | issueBody += "\n| Device | " + devInfo?.client?.device + " |"; 63 | issueBody += "\n| Browser | " + devInfo?.client?.browser + " |"; 64 | issueBody += "\n| OS | " + devInfo?.client?.os + " |"; 65 | } else { 66 | issueBody += "No developer information provided."; 67 | } 68 | 69 | // Reporter Information 70 | issueBody += "\n## Reporter Information:\n"; 71 | if (reporterInfo) { 72 | issueBody += "| Key | Value |"; 73 | issueBody += "\n|---|---|"; 74 | issueBody += "\n| Name | " + reporterInfo?.name + " |"; 75 | issueBody += "\n| Email | " + reporterInfo?.email + " |"; 76 | issueBody += "\n| Phone | " + reporterInfo?.phone + " |"; 77 | issueBody += "\n| Role | " + reporterInfo?.role + " |"; 78 | issueBody += "\n| Creation Time | " + reporterInfo?.creationTime + " |"; 79 | } else { 80 | issueBody += "No reporter information provided."; 81 | } 82 | const issueData = { 83 | title: title, 84 | body: issueBody, 85 | labels: [...ApplicationContext.getContext("config").github.defaultLabels, ...labels], 86 | }; 87 | 88 | const result = await fetch(ApplicationContext.getContext("config").github.createIssueURL, { 89 | method: "POST", 90 | headers: { 91 | "Content-Type": "application/json", 92 | Authorization: "Bearer " + ApplicationContext.getContext("config").github.token, 93 | }, 94 | body: JSON.stringify(issueData), 95 | }) 96 | .then((response) => response.json()) 97 | .then((data) => { 98 | if (data) { 99 | return data; 100 | } else { 101 | throw new Error("Something went wrong."); 102 | } 103 | }) 104 | .catch((error:any) => { 105 | console.error("error: ", error); 106 | throw new Error(error); 107 | }); 108 | return result; 109 | } catch (error:any) { 110 | console.error(error); 111 | throw new Error(error?.message || "Something went wrong."); 112 | } 113 | }; 114 | 115 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | ### [0.0.14](https://https//github.com/wrappid/support-module/compare/v0.0.13...v0.0.14) (2025-03-21) 6 | 7 | ### [0.0.13](https://https//github.com/wrappid/support-module/compare/v0.0.12...v0.0.13) (2025-02-20) 8 | 9 | ### [0.0.12](https://https//github.com/wrappid/support-module/compare/v0.0.11...v0.0.12) (2025-02-18) 10 | 11 | ### [0.0.11](https://https//github.com/wrappid/support-module/compare/v0.0.10...v0.0.11) (2025-02-13) 12 | 13 | ### [0.0.10](https://https//github.com/wrappid/support-module/compare/v0.0.9...v0.0.10) (2025-02-12) 14 | 15 | ### [0.0.9](https://https//github.com/wrappid/support-module/compare/v0.0.8...v0.0.9) (2025-02-10) 16 | 17 | ### [0.0.8](https://https//github.com/wrappid/support-module/compare/v0.0.7...v0.0.8) (2025-01-29) 18 | 19 | ### [0.0.7](https://https//github.com/wrappid/support-module/compare/v0.0.6...v0.0.7) (2025-01-28) 20 | 21 | ### [0.0.6](https://https//github.com/wrappid/support-module/compare/v0.0.5...v0.0.6) (2024-12-09) 22 | 23 | ### [0.0.5](https://https//github.com/wrappid/support-module/compare/v0.0.4...v0.0.5) (2024-11-18) 24 | 25 | 26 | ### Bug Fixes 27 | 28 | * **core:** :bug: core and auth related impact handled ([5460c3c](https://https//github.com/wrappid/support-module/commit/5460c3c7013cadd9709be2a95dad4d3637715e3b)) 29 | 30 | ### [0.0.4](https://https//github.com/wrappid/support-module/compare/v0.0.3...v0.0.4) (2024-10-25) 31 | 32 | 33 | ### Bug Fixes 34 | 35 | * **core:** :recycle: liniting fix ([e4377f4](https://https//github.com/wrappid/support-module/commit/e4377f46c4496c88942fa3d96fca3e75fa0f5307)), closes [#20](https://https//github.com/wrappid/support-module/issues/20) 36 | 37 | ### [0.0.3](https://https//github.com/wrappid/support-module/compare/v0.0.2...v0.0.3) (2024-05-07) 38 | 39 | 40 | ### Bug Fixes 41 | 42 | * **global:** :ambulance: impact handling for change in configprovider ([ca265c2](https://https//github.com/wrappid/support-module/commit/ca265c209ce5b4d07ae8caf14c82ce523ecf059c)), closes [#17](https://https//github.com/wrappid/support-module/issues/17) 43 | 44 | ### 0.0.2 (2024-03-23) 45 | 46 | 47 | ### Features 48 | 49 | * **global:** :bug: added validation for create issue req body ([5973448](https://https//github.com/wrappid/support-module/commit/59734483369b3210b2747da385934bb272b50140)), closes [#12](https://https//github.com/wrappid/support-module/issues/12) 50 | * **global:** :sparkles: cheking github issue exist or not ([d828887](https://https//github.com/wrappid/support-module/commit/d828887b7120ac70c3c0555a5a8413af497d9df0)), closes [#12](https://https//github.com/wrappid/support-module/issues/12) 51 | * **global:** :sparkles: create comment if same isssue exist ([a5c2eda](https://https//github.com/wrappid/support-module/commit/a5c2eda3e55fa492ac1f3e301325671512735b38)), closes [#12](https://https//github.com/wrappid/support-module/issues/12) 52 | * **global:** :sparkles: if issue exist create comment ([7be92ef](https://https//github.com/wrappid/support-module/commit/7be92ef1459eb58aac718ccc11cc43011d67cba5)), closes [#12](https://https//github.com/wrappid/support-module/issues/12) 53 | 54 | 55 | ### Bug Fixes 56 | 57 | * :art: styles related issues fix ([c77a383](https://https//github.com/wrappid/support-module/commit/c77a383e6759bbb81bfd7bf2682d3fdf792af8a6)), closes [#24](https://https//github.com/wrappid/support-module/issues/24) 58 | * :bug: correct the typo in ModuleStyles files ([ee2f71d](https://https//github.com/wrappid/support-module/commit/ee2f71d04a968369d2f8dfd13b61d4c4fdbac57a)), closes [#7](https://https//github.com/wrappid/support-module/issues/7) 59 | * **core:** :art: layout oriented changes ([ca96054](https://https//github.com/wrappid/support-module/commit/ca96054c1488d9a04606f6edd8017c9c026efdfd)), closes [#15](https://https//github.com/wrappid/support-module/issues/15) 60 | * **core:** :zap: merge from template ([8d61dd7](https://https//github.com/wrappid/support-module/commit/8d61dd7d391844a9c67438e451f66d7f4ada97a3)), closes [#15](https://https//github.com/wrappid/support-module/issues/15) 61 | 62 | ### 0.0.4 (2024-03-18) 63 | 64 | ### 0.0.3 (2024-03-16) 65 | 66 | ### 0.0.2 (2024-03-15) 67 | -------------------------------------------------------------------------------- /.eslint/app/.eslintrc.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line no-undef 2 | module.exports = { 3 | "env": { 4 | "browser": true, 5 | "es2021" : true, 6 | "node" : true, 7 | }, 8 | "extends" : ["eslint:recommended", "plugin:react/recommended", "plugin:import/recommended", "plugin:react/jsx-runtime"], 9 | "parserOptions" : { 10 | "ecmaVersion": "latest", 11 | "sourceType" : "module", 12 | }, 13 | "plugins": [ 14 | "etc", 15 | "import", 16 | "react", 17 | "sort-keys-fix", 18 | "unused-imports", 19 | ], 20 | "rules": { 21 | "array-bracket-newline": [ 22 | "error", 23 | { 24 | "minItems" : 5, 25 | "multiline": true, 26 | }, 27 | ], 28 | "array-bracket-spacing" : ["error", "never"], 29 | "array-element-newline" : ["error", { "minItems": 5, "multiline": true }], 30 | "comma-dangle" : ["error", { "arrays": "only-multiline", "objects": "only-multiline" }], 31 | "comma-spacing" : ["error", { "after": true, "before": false }], 32 | "etc/no-commented-out-code": "error", 33 | "id-length" : ["error", { "exceptions": ["i", "j", "id"], "min": 3, "properties": "never" }], 34 | "import/order" : [ 35 | "error", 36 | { 37 | "alphabetize": { 38 | "caseInsensitive": true, 39 | "order" : "asc", 40 | }, 41 | "groups" : ["builtin", "external", "internal"], 42 | "newlines-between": "always", 43 | "pathGroups" : [ 44 | { 45 | "group" : "builtin", 46 | "pattern" : "react", 47 | "position": "before", 48 | }, 49 | ], 50 | "pathGroupsExcludedImportTypes": ["react"], 51 | }, 52 | ], 53 | "indent" : ["error", 2, { "MemberExpression": 1, "SwitchCase": 1 }], 54 | "key-spacing" : ["error", { "align": "colon" }], 55 | "linebreak-style" : ["error", "unix"], 56 | "newline-after-var" : ["error", "always"], 57 | "newline-per-chained-call": ["error", { "ignoreChainWithDepth": 3 }], 58 | "no-console" : "error", 59 | "no-multi-spaces" : ["error", { exceptions: { "VariableDeclarator": true } }], 60 | "no-multiple-empty-lines" : ["error", { "max": 1 }], 61 | "no-unused-vars" : ["error", { "args": "after-used", "vars": "all" }], 62 | "no-var" : "error", 63 | "object-curly-newline" : [ 64 | "error", 65 | { 66 | "ExportDeclaration": { "minProperties": 6, "multiline": true }, 67 | "ImportDeclaration": { "minProperties": 6, "multiline": true }, 68 | "ObjectExpression" : { "minProperties": 6, "multiline": true }, 69 | "ObjectPattern" : { "minProperties": 6, "multiline": true }, 70 | }, 71 | ], 72 | "object-curly-spacing" : ["error", "always"], 73 | "object-property-newline" : ["error", { "allowAllPropertiesOnSameLine": true }], 74 | "padding-line-between-statements": [ 75 | "error", 76 | { 77 | blankLine: "always", 78 | next : "*", 79 | prev : ["const", "let"], 80 | }, 81 | { 82 | blankLine: "any", 83 | next : ["const", "let"], 84 | prev : ["const", "let"], 85 | }, 86 | { 87 | blankLine: "always", 88 | next : "*", 89 | prev : ["case", "default"], 90 | } 91 | ], 92 | "quotes" : ["error", "double"], 93 | "react/jsx-first-prop-new-line" : "error", 94 | "react/jsx-max-props-per-line" : ["error", { "maximum": { "multi": 1, "single": 3 } }], 95 | "react/jsx-newline" : "error", 96 | "react/jsx-props-no-multi-spaces" : "error", 97 | "react/prop-types" : "off", 98 | "semi" : ["error", "always"], 99 | "sort-keys-fix/sort-keys-fix" : "error", 100 | "space-infix-ops" : ["error", { "int32Hint": false }], 101 | "unused-imports/no-unused-imports": "error", 102 | }, 103 | "settings": { "react": { "version": "detect" } }, 104 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `Wrappid` Module Boilerplate 2 | ``` 3 | _ _ 4 | __ ___ __ __ _ _ __ _ __ (_) __| | 5 | \ \ /\ / / '__/ _` | '_ \| '_ \| |/ _` | 6 | \ V V /| | | (_| | |_) | |_) | | (_| | 7 | \_/\_/ |_| \__,_| .__/| .__/|_|\__,_| 8 | |_| |_| 9 | 10 | ``` 11 | 12 | **This is a template documentation, @wrappid/toolkit uses this template to create module boilerplate.** 13 | 14 | - [`Wrappid` Module Boilerplate](#wrappid-module-boilerplate) 15 | - [1. Introduction](#1-introduction) 16 | - [2. Getting Started](#2-getting-started) 17 | - [2.1. What are my Pre-requisites?](#21-what-are-my-pre-requisites) 18 | - [2.2. How to Create?](#22-how-to-create) 19 | - [2.3 How to Use Modules?](#23-how-to-use-modules) 20 | - [2.3.1 Include module in `wrappid-[app|service]`](#231-include-module-in-wrappid-appservice) 21 | - [2.2.2 Exclude module from `wrappid-[app|service]`](#222-exclude-module-from-wrappid-appservice) 22 | - [2.3 Where to Code?](#23-where-to-code) 23 | - [2.3.1 Frontend](#231-frontend) 24 | - [2.3.2 Backend](#232-backend) 25 | - [2.4. How to see code in action?](#24-how-to-see-code-in-action) 26 | 27 | ## 1. Introduction 28 | 29 | This is a **module boilerplate** to build wrappid modules which serves specific technical needs or business specific needs. 30 | 31 | ## 2. Getting Started 32 | This getting started section will help you setup a basic module built using the `Wrappid` framework Wrappid Projects. Follow the below steps to get going. 33 | 34 | [2.1. What are my Pre-requisites?](#21-what-are-my-pre-requisites) 35 | 36 | [2.2. How to Create?](#22-how-to-create) 37 | 38 | [2.3 How to Use Modules?](#23-how-to-use-modules) 39 | 40 | 41 | ### 2.1. What are my Pre-requisites? 42 | 43 | - [Refer here](https://github.com/wrappid/#1-check-pre-requisites) 44 | - install @wrappid/toolkit globally. [Click here](https://github.com/wrappid/#2-install-wrappid-toolkit)for installation guide of @wrappid/toolkit. 45 | 46 | ### 2.2. How to Create? 47 | Run the below command to create Module Wrappid Project 48 | 49 | ```terminal 50 | wrappid init module
([\s\S]*?)<\/pre>/;
129 | // const developerInfoRegex = /## Developer Information:(.*?)## Reporter Information:/s;
130 | // const reporterInformationRegex = /## Reporter Information:(.*?)\|(.*)/s;
131 |
132 | // Extract the description using match()
133 | const descriptionMatch = issueBody.match(descriptionRegex);
134 | const description = descriptionMatch ? descriptionMatch[1].trim() : "";
135 |
136 | // Extracting steps to create
137 | const stepsToCreateMatch = issueBody.match(stepsToCreateRegex);
138 | const stepsToCreate = stepsToCreateMatch ? stepsToCreateMatch[1].trim() : "";
139 |
140 | // Extracting stack trace
141 | // const stackTracematch = stackTraceRegex.exec(issueBody);
142 | const stackTracematch = issueBody.match(stackTraceRegex);
143 | const stackTrace = stackTracematch ? stackTracematch[1].trim(): "";
144 |
145 | /*
146 | // Extracting developer Info
147 | const developerInfoMatch = issueBody.match(developerInfoRegex);
148 | const developerInformation = developerInfoMatch ? developerInfoMatch[1].trim(): "";
149 |
150 | //Extracting Reporter Information
151 | const reporterInformatinMatch = issueBody.match(reporterInformationRegex);
152 | const reporterInformaion = reporterInformatinMatch ? reporterInformatinMatch[1].trim(): "";
153 | */
154 |
155 | let commentBody = "## Description:\n";
156 | if(currentDescription.trim() != description.trim() ){
157 | if(currentDescription.trim() === ""){
158 | commentBody += "No description provided.";
159 | }else{
160 | commentBody += currentDescription;
161 | }
162 | }else{
163 | commentBody += "Same as above";
164 | }
165 |
166 | commentBody += "\n## Steps To Create:\n";
167 | if(currentStepsToCreate.trim() != stepsToCreate.trim()){
168 | if(currentStepsToCreate.trim() === ""){
169 | commentBody += "No steps provided.";
170 | }else{
171 | commentBody += currentStepsToCreate;
172 | }
173 | }else{
174 | commentBody += "Same as above";
175 | }
176 |
177 | commentBody += "\n## Stack trace:\n";
178 | if(currentStackTrace.trim() != stackTrace.trim()){
179 | if(currentStackTrace.trim() === ""){
180 | issueBody += "No stack trace available.
";
181 | }else{
182 | commentBody += "" + stackTrace + "
";
183 | }
184 | }else{
185 | commentBody += "Same as above";
186 | }
187 |
188 | /*
189 | commentBody += "\n## Developer Information:\n";
190 | if(currentDevInfo.trim() != developerInformation.trim()){
191 | if(currentDevInfo.trim() === ""){
192 | commentBody += "No developer information provided.";
193 | }else{
194 | currentDevInfo = JSON.parse(currentDevInfo);
195 | commentBody += "| Key | Value |";
196 | commentBody += "\n|---|---|";
197 | commentBody += "\n| Frontend URL | " + currentDevInfo?.frontend?.url + " |";
198 | commentBody += "\n| Frontend Version | " + currentDevInfo?.frontend?.version + " |";
199 | commentBody += "\n| Backend URL | " + currentDevInfo?.backend?.url + " |";
200 | commentBody += "\n| Backend Version | " + currentDevInfo?.backend?.version + " |";
201 | commentBody += "\n| User Agent | " + currentDevInfo?.client?.userAgent + " |";
202 | commentBody += "\n| Device | " + currentDevInfo?.client?.device + " |";
203 | commentBody += "\n| Browser | " + currentDevInfo?.client?.browser + " |";
204 | commentBody += "\n| OS | " + currentDevInfo?.client?.os + " |";
205 | }
206 | }else{
207 | commentBody += "Same as above";
208 | }
209 | */
210 |
211 | /*
212 | commentBody += "\n## Reporter Information:\n";
213 | if(currentReporterInfo.trim() != reporterInformaion.trim()){
214 | if(currentReporterInfo.trim() === ""){
215 | commentBody += "No reporter information provided.";
216 | }else{
217 | currentReporterInfo = JSON.parse(currentReporterInfo);
218 | commentBody += "| Key | Value |";
219 | commentBody += "\n|---|---|";
220 | commentBody += "\n| Name | " + currentReporterInfo?.name + " |";
221 | commentBody += "\n| Email | " + currentReporterInfo?.email + " |";
222 | commentBody += "\n| Phone | " + currentReporterInfo?.phone + " |";
223 | commentBody += "\n| Role | " + currentReporterInfo?.role + " |";
224 | commentBody += "\n| Creation Time | " + currentReporterInfo?.creationTime + " |";
225 | }
226 | }else{
227 | commentBody += "Same as above";
228 | }
229 | */
230 |
231 | // Developer Information
232 | commentBody += "\n## Developer Information:\n";
233 | if (currentDevInfo) {
234 | const devInfo = JSON.parse(currentDevInfo);
235 | commentBody += "| Key | Value |";
236 | commentBody += "\n|---|---|";
237 | commentBody += "\n| Frontend URL | " + devInfo?.frontend?.url + " |";
238 | commentBody += "\n| Frontend Version | " + devInfo?.frontend?.version + " |";
239 | commentBody += "\n| Backend URL | " + devInfo?.backend?.url + " |";
240 | commentBody += "\n| Backend Version | " + devInfo?.backend?.version + " |";
241 | commentBody += "\n| User Agent | " + devInfo?.client?.userAgent + " |";
242 | commentBody += "\n| Device | " + devInfo?.client?.device + " |";
243 | commentBody += "\n| Browser | " + devInfo?.client?.browser + " |";
244 | commentBody += "\n| OS | " + devInfo?.client?.os + " |";
245 | } else {
246 | commentBody += "No developer information provided.";
247 | }
248 |
249 | // Reporter Information
250 | commentBody += "\n## Reporter Information:\n";
251 | if (currentReporterInfo) {
252 | const reporterInfo = JSON.parse(currentReporterInfo);
253 | commentBody += "| Key | Value |";
254 | commentBody += "\n|---|---|";
255 | commentBody += "\n| Name | " + reporterInfo?.name + " |";
256 | commentBody += "\n| Email | " + reporterInfo?.email + " |";
257 | commentBody += "\n| Phone | " + reporterInfo?.phone + " |";
258 | commentBody += "\n| Role | " + reporterInfo?.role + " |";
259 | commentBody += "\n| Creation Time | " + reporterInfo?.creationTime + " |";
260 | } else {
261 | commentBody += "No reporter information provided.";
262 | }
263 | return commentBody;
264 | } catch (error) {
265 | console.log(error);
266 | throw error;
267 | }
268 | }
--------------------------------------------------------------------------------