diff --git a/packages/lit-dev-content/site/docs/v3/getting-started.md b/packages/lit-dev-content/site/docs/v3/getting-started.md index 45d90ac92..158783ae9 100644 --- a/packages/lit-dev-content/site/docs/v3/getting-started.md +++ b/packages/lit-dev-content/site/docs/v3/getting-started.md @@ -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 diff --git a/packages/lit-dev-content/site/docs/v3/tools/overview.md b/packages/lit-dev-content/site/docs/v3/tools/overview.md index 381a9faa7..09f6877f9 100644 --- a/packages/lit-dev-content/site/docs/v3/tools/overview.md +++ b/packages/lit-dev-content/site/docs/v3/tools/overview.md @@ -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. diff --git a/packages/lit-dev-content/site/docs/v3/tools/starter-kits.md b/packages/lit-dev-content/site/docs/v3/tools/starter-kits.md index fc66501a1..84c0fcfbc 100644 --- a/packages/lit-dev-content/site/docs/v3/tools/starter-kits.md +++ b/packages/lit-dev-content/site/docs/v3/tools/starter-kits.md @@ -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/). @@ -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. @@ -53,13 +47,13 @@ The quickest way to try out a project locally is to download one of the starter
**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.
### 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 @@ -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 @@ -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: @@ -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 @@ -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 @@ -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/). diff --git a/packages/lit-dev-tests/known-good-urls.txt b/packages/lit-dev-tests/known-good-urls.txt index caa0340bb..c73d79a4e 100644 --- a/packages/lit-dev-tests/known-good-urls.txt +++ b/packages/lit-dev-tests/known-good-urls.txt @@ -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