Skip to content

Commit fc5d7c2

Browse files
chaged app-root to app-root-portfolio component to avoid any external npm package conflict
1 parent c6ae2b8 commit fc5d7c2

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

src/components.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export namespace Components {
2525
*/
2626
"width": string;
2727
}
28-
interface AppRoot {
28+
interface AppRootPortfolio {
2929
}
3030
interface FeedbackForm {
3131
"disableQuickbars": boolean;
@@ -68,11 +68,11 @@ declare global {
6868
prototype: HTMLAppProfilePageElement;
6969
new (): HTMLAppProfilePageElement;
7070
};
71-
interface HTMLAppRootElement extends Components.AppRoot, HTMLStencilElement {
71+
interface HTMLAppRootPortfolioElement extends Components.AppRootPortfolio, HTMLStencilElement {
7272
}
73-
var HTMLAppRootElement: {
74-
prototype: HTMLAppRootElement;
75-
new (): HTMLAppRootElement;
73+
var HTMLAppRootPortfolioElement: {
74+
prototype: HTMLAppRootPortfolioElement;
75+
new (): HTMLAppRootPortfolioElement;
7676
};
7777
interface HTMLFeedbackFormElementEventMap {
7878
"valueChange": string;
@@ -116,7 +116,7 @@ declare global {
116116
"about-us": HTMLAboutUsElement;
117117
"app-home-page": HTMLAppHomePageElement;
118118
"app-profile-page": HTMLAppProfilePageElement;
119-
"app-root": HTMLAppRootElement;
119+
"app-root-portfolio": HTMLAppRootPortfolioElement;
120120
"feedback-form": HTMLFeedbackFormElement;
121121
"header-navigation": HTMLHeaderNavigationElement;
122122
"posts-dashboard": HTMLPostsDashboardElement;
@@ -143,7 +143,7 @@ declare namespace LocalJSX {
143143
*/
144144
"width"?: string;
145145
}
146-
interface AppRoot {
146+
interface AppRootPortfolio {
147147
}
148148
interface FeedbackForm {
149149
"disableQuickbars"?: boolean;
@@ -170,7 +170,7 @@ declare namespace LocalJSX {
170170
"about-us": AboutUs;
171171
"app-home-page": AppHomePage;
172172
"app-profile-page": AppProfilePage;
173-
"app-root": AppRoot;
173+
"app-root-portfolio": AppRootPortfolio;
174174
"feedback-form": FeedbackForm;
175175
"header-navigation": HeaderNavigation;
176176
"posts-dashboard": PostsDashboard;
@@ -184,7 +184,7 @@ declare module "@stencil/core" {
184184
"about-us": LocalJSX.AboutUs & JSXBase.HTMLAttributes<HTMLAboutUsElement>;
185185
"app-home-page": LocalJSX.AppHomePage & JSXBase.HTMLAttributes<HTMLAppHomePageElement>;
186186
"app-profile-page": LocalJSX.AppProfilePage & JSXBase.HTMLAttributes<HTMLAppProfilePageElement>;
187-
"app-root": LocalJSX.AppRoot & JSXBase.HTMLAttributes<HTMLAppRootElement>;
187+
"app-root-portfolio": LocalJSX.AppRootPortfolio & JSXBase.HTMLAttributes<HTMLAppRootPortfolioElement>;
188188
"feedback-form": LocalJSX.FeedbackForm & JSXBase.HTMLAttributes<HTMLFeedbackFormElement>;
189189
"header-navigation": LocalJSX.HeaderNavigation & JSXBase.HTMLAttributes<HTMLHeaderNavigationElement>;
190190
"posts-dashboard": LocalJSX.PostsDashboard & JSXBase.HTMLAttributes<HTMLPostsDashboardElement>;

src/components/about-us/about-us.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class AboutUs {
1414
return (
1515
<div>
1616
<div>
17-
<p>by Default,Stencil Web app creates three components:app-root, app-home, app-profile with Routung from "stencil-router-v2" pre-installed </p>
17+
<p>by Default,Stencil Web app creates three components:app-root-portfolio, app-home, app-profile with Routung from "stencil-router-v2" pre-installed </p>
1818
<p>To avoid conflict with npm package (stenciljs-components) which has similar naming components, renamed the component in this web app to app-home-page and app-profile-page respectively</p>
1919
<h1>Steps to create Stencil Web App</h1>
2020
<h1>Start by npm init stencil and then choose 2nd option</h1>

src/components/app-profile-page/app-profile-page.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('app-profile-page', () => {
1212
it.skip('displays the specified name', async () => {
1313
const page = await newE2EPage({ url: '/profile/joseph' });
1414

15-
const profileElement = await page.find('app-root >>> app-profile-page');
15+
const profileElement = await page.find('app-root-portfolio >>> app-profile-page');
1616
const element = profileElement.shadowRoot.querySelector('div');
1717
expect(element.textContent).toContain('Hello! My name is Joseph.');
1818
});
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { newE2EPage } from '@stencil/core/testing';
22

3-
describe('app-root', () => {
3+
describe('app-root-portfolio', () => {
44
it.skip('renders', async () => {
55
const page = await newE2EPage({ url: '/' });
66

7-
const element = await page.find('app-root');
7+
const element = await page.find('app-root-portfolio');
88
expect(element).toHaveClass('hydrated');
99
});
1010

1111
it.skip('renders the title', async () => {
1212
const page = await newE2EPage({ url: '/' });
1313

14-
const element = await page.find('app-root >>> h1');
14+
const element = await page.find('app-root-portfolio >>> h1');
1515
expect(element.textContent).toEqual('Stencil App Starter');
1616
});
1717
});

src/components/app-root/app-root.tsx renamed to src/components/app-root-portfolio/app-root-portfolio.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { Router } from "../../"; //in index.ts its already there so no need to
55
import { Route, match } from "stencil-router-v2";
66
//https://www.npmjs.com/package/stencil-router-v2
77
@Component({
8-
tag: 'app-root',
9-
styleUrl: 'app-root.css',
8+
tag: 'app-root-portfolio',
9+
styleUrl: 'app-root-portfolio.css',
1010
shadow: true,
1111
})
1212
export class AppRoot {

src/components/web-components/web-components.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class WebComponents {
2929
<div>
3030
<p>Below components in this page are rendering from <a href="https://www.npmjs.com/package/stenciljs-components" target="_blank"><strong>stenciljs-components npm package</strong></a></p>
3131
<p>Sandbox page of this component library:<a href="https://sanjeetkumaritoutlook.github.io/stenciljs-components/" target="_blank">Visit</a></p>
32-
<p>By Default,Stencil Web app creates three components:app-root, app-home, app-profile with Routung from "stencil-router-v2" pre-installed </p>
32+
<p>By Default,Stencil Web app creates three components:app-root-portfolio, app-home, app-profile with Routung from "stencil-router-v2" pre-installed </p>
3333
<p>To avoid conflict with npm package (stenciljs-components) which has similar naming components, renamed the component in this web app to app-home-page and app-profile-page respectively</p>
3434
<json-schema-form schema= {formSchema}></json-schema-form>
3535
</div>

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
<link rel="manifest" href="/manifest.json">
2020
</head>
2121
<body>
22-
<app-root></app-root>
22+
<app-root-portfolio></app-root-portfolio>
2323
</body>
2424
</html>

0 commit comments

Comments
 (0)