Title: Code Generators should have a central place for naming Nova Services · Issue #25 · ara-framework/ara-cli · GitHub
Open Graph Title: Code Generators should have a central place for naming Nova Services · Issue #25 · ara-framework/ara-cli
X Title: Code Generators should have a central place for naming Nova Services · Issue #25 · ara-framework/ara-cli
Description: Currently if we generate the projects using the CLI for example ara new:nova novas/global -t vue There are two files we need to modify in case we need to change the name of the nova service from Example (if we are enabling SSR as well) c...
Open Graph Description: Currently if we generate the projects using the CLI for example ara new:nova novas/global -t vue There are two files we need to modify in case we need to change the name of the nova service from Ex...
X Description: Currently if we generate the projects using the CLI for example ara new:nova novas/global -t vue There are two files we need to modify in case we need to change the name of the nova service from Ex...
Opengraph URL: https://github.com/ara-framework/ara-cli/issues/25
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Code Generators should have a central place for naming Nova Services","articleBody":"Currently if we generate the projects using the CLI for example\r\n\r\n```\r\nara new:nova novas/global -t vue\r\n```\r\nThere are two files we need to modify in case we need to change the name of the nova service from `Example` (if we are enabling SSR as well)\r\n - client.js\r\n - index.js\r\n\r\nThere is a change that the developer may miss out modifying the name in all places.\r\n\r\nPossible Solution\r\n\r\nAdd a common place where the name is specified for example \r\n\r\n`constants.js`\r\n\r\n```\r\nconst NOVA_NAME = 'VueNovaMFE';\r\n\r\nexport default NOVA_NAME;\r\n```\r\n\r\nNow in each of the files `index.js` and `client.js`\r\n\r\ninclude it\r\n```\r\nimport NOVA_NAME from './constants';\r\n```\r\n\r\nThe index.js could look like this\r\n\r\n```\r\nhypernova({\r\n devMode: process.env.NODE_ENV !== 'production',\r\n getComponent(name) {\r\n if (name === NOVA_NAME) {\r\n return renderVue(name, Vue.extend(MonthlySalesChart));\r\n }\r\n },\r\n port: process.env.PORT || 3000,\r\n\r\n createApplication() {\r\n const app = express();\r\n\r\n app.use('/public', express.static(path.join(process.cwd(), 'dist')));\r\n\r\n return app;\r\n },\r\n});\r\n```\r\n\r\nSimilarly the `client.js` could look like this\r\n\r\n```\r\nimport NOVA_NAME from './constants';\r\n\r\nconst render = (name, { node, data }) =\u003e {\r\n if (name === NOVA_NAME) {\r\n return mountComponent(Vue.extend(MonthlySalesChart), node, data);\r\n }\r\n};\r\n\r\ndocument.addEventListener('NovaMount', ({ detail }) =\u003e {\r\n const { name, id } = detail;\r\n\r\n const payload = loadById(name, id);\r\n\r\n if (payload) {\r\n render(name, payload);\r\n }\r\n});\r\n\r\nload(NOVA_NAME).forEach(render.bind(null, NOVA_NAME));\r\n```","author":{"url":"https://github.com/tsukhu","@type":"Person","name":"tsukhu"},"datePublished":"2020-04-30T07:15:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/25/ara-cli/issues/25"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:25107233-b783-0fbf-118f-23deb0581647 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B1E:34B1A9:10F617F:18AB599:6A4E37FF |
| html-safe-nonce | b7a6202e0fa8eac2eb2b159137f4877713211db832b29a85066f10a45e83c4bb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjFFOjM0QjFBOToxMEY2MTdGOjE4QUI1OTk6NkE0RTM3RkYiLCJ2aXNpdG9yX2lkIjoiMzk1ODgzMjQwNjg5NTQwOTE1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 667b306b307bf92700d5d0d052a5f606d49efbfae785f6f7a1b23e25e5cc3612 |
| hovercard-subject-tag | issue:609656949 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ara-framework/ara-cli/25/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5168ddefca3254faf2f808484788829a089266ef20b64549ae99dfc27263d58/ara-framework/ara-cli/issues/25 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5168ddefca3254faf2f808484788829a089266ef20b64549ae99dfc27263d58/ara-framework/ara-cli/issues/25 |
| og:image:alt | Currently if we generate the projects using the CLI for example ara new:nova novas/global -t vue There are two files we need to modify in case we need to change the name of the nova service from Ex... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tsukhu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/ara-framework/ara-cli git https://github.com/ara-framework/ara-cli.git |
| octolytics-dimension-user_id | 51374834 |
| octolytics-dimension-user_login | ara-framework |
| octolytics-dimension-repository_id | 190247803 |
| octolytics-dimension-repository_nwo | ara-framework/ara-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 190247803 |
| octolytics-dimension-repository_network_root_nwo | ara-framework/ara-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 42a6d378d7587a44c93aca255096cd66b7c8eb2d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width