Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/lit-dev-content/site/docs/v3/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Get started right away with the interactive playground and examples. Start with

Take our [step-by-step tutorial](/tutorials/intro-to-lit) to learn how to build a Lit component in minutes.

## Lit starter kits
## Lit starter kit

We provide TypeScript and JavaScript component starter kits for creating standalone reusable components. See [Starter Kits](/docs/v3/tools/starter-kits/).
We provide a TypeScript component starter kit for creating standalone reusable components. See [Starter Kits](/docs/v3/tools/starter-kits/).

## Install locally from npm

Expand Down
2 changes: 1 addition & 1 deletion packages/lit-dev-content/site/docs/v3/tools/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ The tools and workflows docs cover the different phases of development:
* [Testing](/docs/v3/tools/testing/): Recommendations for testing Lit projects in modern and legacy browsers.
* [Publishing](/docs/v3/tools/publishing/): Guidelines for publishing your component packages to npm.
* [Building for production](/docs/v3/tools/production/): Building applications for production, including bundling, optimizations, and differential serving for modern and legacy browsers.
* [Starter Kits](/docs/v3/tools/starter-kits): Instructions on using our Lit component starter kits for JavaScript and TypeScript.
* [Starter Kits](/docs/v3/tools/starter-kits): Instructions on using our Lit component starter kit for TypeScript.
* [Adding Lit](/docs/v3/tools/adding-lit): Installing and adding Lit to an existing project.
43 changes: 11 additions & 32 deletions packages/lit-dev-content/site/docs/v3/tools/starter-kits.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ versionLinks:
v2: tools/starter-kits/
---

The Lit Starter Kits are project templates for reusable Lit components that can be published for others to use.
The Lit Starter Kit is a project template for reusable Lit components that can be published for others to use.

To get started working on a component locally, you can use one of these starter projects:
To get started working on a component locally, you can use the [Lit TypeScript starter project](https://github.com/lit/lit-element-starter-ts).

* [Lit JavaScript starter project ](https://github.com/lit/lit-element-starter-js)
* [Lit TypeScript starter project](https://github.com/lit/lit-element-starter-ts)

Both projects define a Lit component. They also add a set of optional tools for developing, linting, and testing the component:
The project defines a Lit component. It also adds a set of optional tools for developing, linting, and testing the component:

* Node.js and npm for managing dependencies. _Requires Node.js 10 or greater._
* A local dev server, [Web Dev Server](https://modern-web.dev/docs/dev-server/overview/).
Expand All @@ -34,12 +31,9 @@ None of these tools is _required_ to work with Lit. They represent one possible

### Download the starter project

The quickest way to try out a project locally is to download one of the starter projects as a zip file.

1. Download the starter project from GitHub as a zip file:
The quickest way to try out a project locally is to download the starter project as a zip file.

* [JavaScript starter project](https://github.com/lit/lit-element-starter-js/archive/main.zip)
* [TypeScript starter project](https://github.com/lit/lit-element-starter-ts/archive/main.zip)
1. Download the [starter project](https://github.com/lit/lit-element-starter-ts/archive/main.zip) from GitHub as a zip file.

1. Uncompress the zip file.

Expand All @@ -53,13 +47,13 @@ The quickest way to try out a project locally is to download one of the starter
<div class="alert alert-info">

**Want it on GitHub?** If you're familiar with git you may want to create a GitHub repository for your starter project,
instead of just downloading the zip file. You can use the [GitHub template repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) feature to create your own repository from the [JavaScript starter project ](https://github.com/PolymerLabs/lit-element-starter-js) or the [TypeScript starter project](https://github.com/PolymerLabs/lit-element-starter-ts). Then clone your new repository and install dependencies, as above.
instead of just downloading the zip file. You can use the [GitHub template repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) feature to create your own repository from the [starter project](https://github.com/lit/lit-element-starter-ts). Then clone your new repository and install dependencies, as above.

</div>

### Try out your project

1. **If you're using the TypeScript version of the starter**, build the JavaScript version of your project:
1. Build your project:

```bash
npm run build
Expand All @@ -71,8 +65,6 @@ instead of just downloading the zip file. You can use the [GitHub template repos
npm run build:watch
```

**No build step is required if you're using the JavaScript version of the starter project.**

1. Run the dev server:

```bash
Expand All @@ -88,10 +80,7 @@ instead of just downloading the zip file. You can use the [GitHub template repos

### Edit your component

Edit your component definition. The file you edit depends on which language you're using:

* JavaScript. Edit the `my-element.js` file in the project root.
* TypeScript. Edit the `my-element.ts` file in the `src` directory.
Edit your component definition in the `my-element.ts` file in the `src` directory.

A couple of things to look for in the code:

Expand Down Expand Up @@ -165,7 +154,7 @@ A couple of things to look for in the code:

You'll probably want to change the component name from "my-element" to something more appropriate. This is easiest to do using an IDE or other text editor that lets you do a global search and replace through an entire project.

1. **If you're using the TypeScript version**, remove generated files:
1. Remove generated files:

```bash
npm run clean
Expand All @@ -175,17 +164,10 @@ You'll probably want to change the component name from "my-element" to something
1. Search and replace "MyElement" with your new class name in all files in your project (except in the `node_modules` folder).
1. Rename the source and test files to match the new component name:

JavaScript:

* `src/my-element.js`
* `src/test/my-element_test.js`

TypeScript:

* `src/my-element.ts`
* `src/test/my-element_test.ts`

1. **If you're using the TypeScript version**, rebuild the project:
1. Rebuild the project:

```bash
npm run build
Expand All @@ -201,9 +183,6 @@ You'll probably want to change the component name from "my-element" to something

Ready to add features to your component? Head over to [Components](/docs/v3/components/overview/) to learn about building your first Lit component, or [Templates](/docs/v3/templates/overview/) for details on writing templates.

For details on running tests and using other tools, see the starter project README:

* [TypeScript project README](https://github.com/PolymerLabs/lit-element-starter-ts/blob/master/README.md)
* [JavaScript project README](https://github.com/PolymerLabs/lit-element-starter-js/blob/master/README.md)
For details on running tests and using other tools, see the [starter project README](https://github.com/lit/lit-element-starter-ts/blob/main/README.md).

For a guide on publishing your component to `npm`, see [Publishing](/docs/v3/tools/publishing/).
1 change: 1 addition & 0 deletions packages/lit-dev-tests/known-good-urls.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ https://github.com/PolymerLabs/lit-element-starter-js
https://github.com/PolymerLabs/lit-element-starter-ts
https://github.com/PolymerLabs/lit-element-starter-ts/blob/master/README.md
https://github.com/PolymerLabs/lit-element-starter-js/blob/master/README.md
https://github.com/lit/lit-element-starter-ts/blob/main/README.md
https://custom-elements-everywhere.com/
https://docs.npmjs.com/cli/v7/configuring-npm/install
https://www.w3.org/International/articles/language-tags/index.en
Expand Down