GithubHelp home page GithubHelp logo

rafagarcia / lit.dev Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lit/lit.dev

0.0 1.0 0.0 9.38 MB

The Lit website

Home Page: https://lit.dev

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

Dockerfile 0.81% JavaScript 8.80% HTML 15.04% TypeScript 61.31% CSS 14.05%

lit.dev's Introduction

lit.dev

New site, new repo.

Packages

This is a Lerna 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 i && npm run bootstrap

Build all

npm run build

Develop site content

npm run dev

Serves at http://localhost:5415.

You may also prefer to run each dev script in its own terminal:

cd packages/lit-dev-content

npm run build:ts:watch       # TypeScript
npm run dev:build:site:watch # Eleventy
npm run dev:serve            # @web/dev-server

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 via the lit.sha file. To update the current commit, run:

cd packages/lit-dev-tools
npm run monorepo:update

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:site:watch   # Eleventy

Serves at http://localhost:6415

Start production Docker environment locally

docker build -t litdev . --build-arg PLAYGROUND_SANDBOX=http://localhost:7416/
docker run --rm --name litdev -p 7415:7415 -e PORT=7415 -e MODE=main -e PLAYGROUND_SANDBOX=http://localhost:7416/ litdev
docker run --rm --name litdev-playground -p 7416:7416 -e PORT=7416 -e MODE=playground litdev

Serves at http://localhost:7415

Updating screenshots tests

Screenshots that are committed to the repository need to be created through the "Artifacts / Download link for updated screenshots" Github Action. This action generates a zip archive golden-results which can be extracted into tests/.

unzip golden-results.zip -d tests/

lit.dev's People

Contributors

a11delavar avatar aarondrabeck avatar afnecors avatar andrewjakubowicz avatar aomarks avatar bicknellr avatar bschlenk avatar butterflyhug avatar christian24 avatar colbywhite avatar davidmaxwaterman avatar davie-robertson avatar e111077 avatar felixschusi avatar fifoosid avatar filipbech avatar graynorton avatar haprog avatar johnspurlock avatar justinfagnani avatar kevinpschaaf avatar lpoulter avatar lucaseverett avatar niznikr avatar nozomuikuta avatar ottowinter avatar peschee avatar rictic avatar sorvell avatar

Watchers

 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.