Create a new Local Home app project targeting the Local Home SDK with optional bundler support.
- Node.js LTS 10.16.0+
npm init @google/local-home-app app/
cd app
npm run build
npm start
This will generate a new project scaffold with no bundler configuration enabled, and begin serving the app from your local machine.
To create a new Local Home app, run:
npm init @google/local-home-app app/
This will generate a new TypeScript project with the following structure:
app/
├── index.ts
├── test.ts
├── index.template.html
├── package.json
├── tsconfig.json
├── tslint.json
└── .gitignore
Open index.ts
and begin adding your fulfillment code for the Local Home intents.
The generated project supports the following commands:
Compile the TypeScript source (optionally bundling the JS)
and generate index.html
for hosting the development app into dist/
Start a local development server with the files in dist/
Run ava tests from test.ts
.
Check that TypeScript code compile without creating any output.
Check TypeScript files for common syntax and formatting issues.
To create a new project with support for one of the following bundlers,
add the --bundler
option as shown in the options below:
Generate a new project with support for webpack.
npm init @google/local-home-app app/ --bundler webpack
Generate a new project with support for rollup.js.
npm init @google/local-home-app app/ --bundler rollup
Generate a new project with support for Parcel.
npm init @google/local-home-app app/ --bundler parcel
This software is available under the Apache License, Version 2.0. See LICENSE.