Shared dev tooling config for homeassistant-extras custom Lovelace cards and libraries.
yarn add -D @homeassistant-extras/configLocal sibling checkout:
"@homeassistant-extras/config": "file:../config"Install the peer ESLint/Prettier plugins listed in each card repo's devDependencies (same set as before).
In package.json:
"prettier": "@homeassistant-extras/config/prettier".nycrc:
{
"extends": "@homeassistant-extras/config/nyc"
}tsconfig.json:
{
"extends": "@homeassistant-extras/config/tsconfig.base.json",
"compilerOptions": {
"paths": { "@/*": ["./src/*"] }
},
"include": ["src/**/*.ts"]
}tsconfig.test.json:
{
"extends": "./tsconfig.json",
"compilerOptions": {
/* match @homeassistant-extras/config/tsconfig.test.base.json */
},
"include": ["test/**/*.ts", "test/**/*.spec.ts", "src/**/*.ts"],
"exclude": ["node_modules"]
}Copy compilerOptions from tsconfig.test.base.json (ts-node does not support array extends yet).
eslint.config.mjs:
import { createCardEslintConfig } from "@homeassistant-extras/config/eslint/card";
export default createCardEslintConfig({
tsconfigRootDir: import.meta.dirname,
});Libraries use @homeassistant-extras/config/eslint/library.
Add repo-local requires first, then shared setup:
{
"require": [
"./test/helpers/my-stub.cjs",
"ts-node/register",
"tsconfig-paths/register",
"@homeassistant-extras/config/mocha/setup.card",
"./test/mocha.hooks.ts"
],
"extensions": ["ts"],
"spec": ["test/**/*.spec.ts"],
"watch-files": ["src/**/*.ts", "test/**/*.spec.ts"]
}This package ships config files only — there is no build step. Published artifacts are listed in package.json files.
Repository: github.com/homeassistant-extras/config
GitHub and npm are separate. Pushing to GitHub (git push) does not put the package on npm. Consumers install from the npm registry with yarn add -D @homeassistant-extras/config only after you run npm publish from this directory.
Check whether npm has the package:
npm view @homeassistant-extras/config versionIf that returns 404, publish has not happened yet (or the version does not exist).
- npm account with access to the
@homeassistant-extrasscope (org member on npmjs.com) - GitHub SSH access to
git@github.com:homeassistant-extras/config.git
npm loginVerify:
npm whoamiYou should see your npm username. If publish fails with 403, ask an org owner to add you to the @homeassistant-extras team on npm.
From the repo root:
yarn install
git add .
git commit -m "Initial release."
git push -u origin main
npm publishpublishConfig.access is set to public in package.json, so the scoped package publishes publicly without passing --access public.
Preview what npm would ship (optional):
npm pack --dry-run- Bump
versioninpackage.json(semver). - Commit, tag, and push:
git add package.json
git commit -m "chore: release v0.1.1"
git tag v0.1.1
git push origin main --tags- Publish:
npm publishReplace local file:../config in consuming repos with:
"@homeassistant-extras/config": "^0.1.0"Then:
yarn installOr install directly:
yarn add -D @homeassistant-extras/configIf the repo is on GitHub but not npm yet, use a git dependency:
"@homeassistant-extras/config": "git+ssh://git@github.com/homeassistant-extras/config.git#v0.1.0"Then yarn install. Prefer npm once @homeassistant-extras/config is published — installs are faster and semver ranges work with yarn upgrade.