[Test] Create usa-link with Stencil #5877
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notes about what I did
Open uswds repo
git checkout jm-setup-stenciljs
cd web-components
npm install
npm WARN deprecated @types/autoprefixer@10.2.0: This is a stub types definition. autoprefixer provides its own type definitions, so you do not need this installed.
added 366 packages, and audited 367 packages in 18s
42 packages are looking for funding
run
npm fund
for detailsfound 0 vulnerabilities
npm run build
cd ..
npm install
npm run start
cd web-components
npm run watch
cd ..
npm run start
ModuleNotFoundError: Module not found: Error: Can't resolve '../dist/esm/polyfills/index.js' in '/Users/amy.leadem/Dev/github/uswds/web-components/loader'
cd web-components
npx stencil generate usa-link
Pressed
enter
Received:
The following files have been generated:
Generated
web-components/src/components/usa-link
Renamed usa-link.css → usa-link.scss
Updated
styleUrl
value to:styleUrl: 'usa-link.scss
Add
@forward 'usa-link';
toweb-components/src/components/usa-link/usa-link.scss
Add “Prop” import to
web-components/src/components/usa-link/usa-link.tsx
@prop() href: string;
Open `packages/usa-link/src/usa-link.stories.js
Create new story:
<usa-link text="${args.text}" href="${args.href}"></usa-link>
;export const WCLink = WCTemplate.bind({});
WCLink.args = {
text: "This is some link text 🤙",
href: "http://designsystem.digital.gov/"
};
Run
npm run build
inweb-components
Run
npm run start
in root directoryView WC story in localhost:6006
Run
npm run build
inweb-components
after each change inweb-components