Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] Create usa-link with Stencil #5877

Closed
wants to merge 3 commits into from

Conversation

amyleadem
Copy link
Contributor

@amyleadem amyleadem commented Apr 19, 2024

Notes about what I did

  1. Open uswds repo

  2. git checkout jm-setup-stenciljs

  3. cd web-components

  4. npm install

    1. 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 details

      found 0 vulnerabilities

  5. npm run build

  6. cd ..

  7. npm install

  8. npm run start

    1. Success: [localhost:6006](http://localhost:6006) renders as expected
  9. cd web-components

  10. npm run watch

    1. Received: build finished, watching for changes…
  11. cd ..

  12. npm run start

    1. Error: ModuleNotFoundError: Module not found: Error: Can't resolve '../dist/esm/polyfills/index.js' in '/Users/amy.leadem/Dev/github/uswds/web-components/loader'
  13. cd web-components

  14. npx stencil generate usa-link

    1. Received: Which additional files do you want to generate?
      1. Pressed enter

      2. Received:

        The following files have been generated:

        • src/components/usa-link/usa-link.tsx
        • src/components/usa-link/usa-link.css
        • src/components/usa-link/test/usa-link.spec.tsx
        • src/components/usa-link/test/usa-link.e2e.ts
      3. Generated web-components/src/components/usa-link

  15. Renamed usa-link.css → usa-link.scss

  16. Updated styleUrl value to: styleUrl: 'usa-link.scss

  17. Add @forward 'usa-link'; to web-components/src/components/usa-link/usa-link.scss

  18. Add “Prop” import to web-components/src/components/usa-link/usa-link.tsx

    1. Add references to new props:
      1. @prop() text: string;
        @prop() href: string;
      2. Create render markup
        1. { this.text }
  19. Open `packages/usa-link/src/usa-link.stories.js

    1. Create new story:

      1. const WCTemplate = (args) => <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/"
      };

  20. Run npm run build in web-components

  21. Run npm run start in root directory

  22. View WC story in localhost:6006

  23. Run npm run build in web-components after each change in web-components

@amyleadem amyleadem changed the base branch from develop to jm-setup-stenciljs April 19, 2024 19:50
@mejiaj
Copy link
Contributor

mejiaj commented May 17, 2024

Closing due to work moving to uswds/uswds-next repo to cleanly prototype without adding noise to this repo.

@mejiaj mejiaj closed this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants