Coder Social home page Coder Social logo

steverep / lit.dev Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lit/lit.dev

0.0 0.0 0.0 27.57 MB

The Lit website

Home Page: https://lit.dev

License: BSD 3-Clause "New" or "Revised" License

JavaScript 8.85% TypeScript 68.77% CSS 6.80% HTML 15.09% Dockerfile 0.31% Nunjucks 0.18%

lit.dev's Introduction

lit.dev

New site, new repo.

Packages

This is an npm workspaces monorepo.

  • lit-dev-content: Main content of lit.dev
  • lit-dev-server: Production web server for lit.dev
  • lit-dev-tools: Eleventy plugins and other internal tools

Developing

Install dependencies

npm ci

Develop site content

npm run dev

Serves at http://localhost:5415.

Dev mode is different to production in these ways:

  • Browser auto-reload.
  • CSS is not inlined or minified. CSS changes are reflected immediately.
  • JS is not inlined, bundled, bare-module transformed, or minified. JS changes are reflected immediately after tsc compile.
  • HTML is not minified.

If needed, you can check for dev mode from an Eleventy template using the env.DEV global:

{% if env.DEV %}
  <p>Dev mode</p>
{% else %}
  <p>Prod mode</p>
{% endif %}

Update generated API docs

First run npm run dev as shown above, and then in another terminal:

cd packages/lit-dev-api
npm run build:watch

You can now edit the comments in any .ts file in the lit directory, and after the automatic rebuild, the dev site will refresh.

code packages/lit-dev-api/lit/

The lit directory is a regular cloned git repo, so you can make changes directly here, and push PRs from it as normal. It's configured to track the main branch, but is pinned to a particular commit. To update the current commit, update the sha field in packages/lit-dev-tools-cjs/src/api-docs/configs/lit-2.ts.

Serve production mode

npm run build
npm start

Serves at http://localhost:6415

Watch production mode

npm start # production server

cd packages/lit-dev-content
npm run build:ts:watch     # TypeScript
npm run build:rollup:watch # Rollup
npm run build:eleventy:watch   # Eleventy

Serves at http://localhost:6415

Start production Docker environment locally

docker build -t litdev . --build-arg LITDEV_ENV=local
docker run --rm --name litdev -p 6415:6415 -e LITDEV_ENV=local -e MODE=main litdev
docker run --rm --name litdev-playground -p 6416:6416 -e LITDEV_ENV=local -e MODE=playground litdev

Serves at http://localhost:6415

Updating screenshots tests

Unless you are using Linux, screenshot test goldens need to be created by downloading artifacts from the "Integration Tests" Github Action.

If the integration tests fail, two .zip archives are generated as artifacts, which can be downloaded from the "Artifacts" menu in the top-right of the failing action:

  • screenshot-goldens.zip: New goldens which, if correct, can be extracted into packages/lit-dev-tests/src/playwright and committed as the new goldens:

    unzip screenshot-goldens.zip -d packages/lit-dev-tests/src/playwright
  • screenshot-diffs.zip: Expected, actuals, and diff screenshots. Can be extracted and viewed directly to help understand what failed.

Contributing Tutorials

See the Tutorial Contributing guide at packages/lit-dev-content/samples/tutorials/CONTRIBUTING.md

lit.dev's People

Contributors

e111077 avatar aomarks avatar taylor-vann avatar andrewjakubowicz avatar justinfagnani avatar kevinpschaaf avatar graynorton avatar bicknellr avatar rictic avatar augustjk avatar 38elements avatar davidmaxwaterman avatar rodydavis avatar talhaguy avatar haprog avatar dependabot[bot] avatar johnspurlock avatar aarondrabeck avatar butterflyhug avatar malobre avatar marcushellberg avatar mastapegs avatar mikkelhl avatar miltonhowe avatar nkabrown avatar nikolamicic21 avatar nozomuikuta avatar oelhanafey avatar ottowinter avatar peter50216 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.