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 .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
.idea/copilot.*
/.esphome/
/secrets.yaml

secrets.yaml


# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,node,phpstorm
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@
"packages/localdeck-configurator"
],
"devDependencies": {
"@vue/language-server": "^2.2.0",
"@nuxt/test-utils": "catalog:",
"@vue/language-server": "^3.2.4",
"shx": "^0.3.4",
"typescript": "^5.7.3"
"typescript": "^5.9.3",
"vitest": "^4.0.18"
},
"packageManager": "pnpm@9.10.0+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c"
"packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264",
"dependencies": {
"nuxt": "^4.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/localdeck-codegen/esphome-localdeck-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ esphome:
on_boot:
- light.turn_on:
id: ledstrip
brightness: 25%
brightness: 50%
effect: Addressable Rainbow
esp32:
board: esp32-c3-devkitm-1
Expand Down
20 changes: 10 additions & 10 deletions packages/localdeck-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
"license": "ISC",
"dependencies": {
"esphome-config-ts": "github:LocalBytes/esphome-config-ts",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"zod": "^3.24.1"
"js-yaml": "^4.1.1",
"lodash": "^4.17.23",
"zod": "^4.3.6"
},
"devDependencies": {
"@eslint/js": "^9.20.0",
"@stylistic/eslint-plugin": "^2.13.0",
"@tsconfig/node-lts": "^20.1.3",
"@eslint/js": "^9.39.2",
"@stylistic/eslint-plugin": "^5.7.1",
"@tsconfig/node-lts": "^24.0.0",
"@types/js-yaml": "^4.0.9",
"@types/lodash": "^4.17.15",
"@types/node": "^22.13.1",
"eslint": "~9.9.1",
"@types/lodash": "^4.17.23",
"@types/node": "^25.1.0",
"eslint": "catalog:",
"globals": "^15.14.0",
"ts-node": "^10.9.2",
"ts-patch": "^3.3.0",
"typescript-eslint": "^8.23.0",
"typescript-eslint": "^8.54.0",
"typescript-transform-paths": "^3.5.3"
}
}
142 changes: 0 additions & 142 deletions packages/localdeck-codegen/scripts/flash.py

This file was deleted.

2 changes: 1 addition & 1 deletion packages/localdeck-codegen/src/esphome-localdeck-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ config.updateComponent(new Esphome({
{
'light.turn_on': {
id: 'ledstrip',
brightness: '25%',
brightness: '50%',
effect: 'Addressable Rainbow'
}
},
Expand Down
1 change: 1 addition & 0 deletions packages/localdeck-components/.nuxtrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setups.@nuxt/test-utils="3.17.2"
9 changes: 5 additions & 4 deletions packages/localdeck-components/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
export default defineNuxtConfig({
srcDir: 'src',
modules: ['@vueuse/nuxt', '@nuxt/eslint', '@nuxt/test-utils/module'],
modules: ['@vueuse/nuxt', '@nuxt/eslint'],

eslint: { config: { stylistic: { semi: true } } },
srcDir: 'src', // https://github.com/nuxt/nuxt/issues/32965

compatibilityDate: '2026-01-01',

compatibilityDate: '2024-12-01',
eslint: { config: { stylistic: { semi: true } } },
});
19 changes: 10 additions & 9 deletions packages/localdeck-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@
"test": "vitest --run"
},
"devDependencies": {
"@nuxt/eslint": "^0.5.7",
"@nuxt/test-utils": "catalog:",
"@nuxt/eslint": "^1.13.0",
"@types/pako": "^2.0.3",
"@vueuse/core": "^11.3.0",
"@vueuse/nuxt": "^11.3.0",
"@vueuse/core": "^14.2.0",
"@vueuse/nuxt": "^14.2.0",
"eslint": "catalog:",
"vitest": "^4.0.18",
"maska": "^3.1.0",
"nuxt": "catalog:",
"typescript": "catalog:",
"vitest": "^2.1.9"
"typescript": "catalog:"
},
"dependencies": {
"@localbytes/localdeck-codegen": "workspace:^",
"@material-symbols/metadata": "^0.22.2",
"@material-symbols/metadata": "^0.40.2",
"fuse.js": "^7.1.0",
"material-symbols": "^0.22.2",
"material-symbols": "^0.40.2",
"pako": "^2.1.0",
"vue3-emoji-picker": "^1.1.8",
"zod": "^3.24.1"
"zod": "^4.3.6",
"@traversable/zod": "^0.0.57"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<EmojiPicker
:additional-groups="{ material: mdIconsGroups }"
:native="true"
:theme="colorMode.value as ('light'|'dark')"
:theme="emojiTheme"
class="dropdown-menu dropdown-menu-bottom-center picker"
@select="onSelectEmoji"
/>
Expand All @@ -24,10 +24,18 @@ import EmojiPicker from 'vue3-emoji-picker';
import type { ConfiguredButtonOptsLabel } from '@localbytes/localdeck-codegen/dist/virtuals';
import 'vue3-emoji-picker/css';
import { mdIconsGroups } from '~/utils/material';
import '~/assets/material.css';
import '../assets/material.css';

const modelValue = defineModel<ConfiguredButtonOptsLabel>({ required: true });
const colorMode = useColorMode();

// See: https://github.com/nuxt-modules/color-mode/issues/335
let colorMode: ReturnType<typeof useColorMode> | null = null;
if (!import.meta.env.TEST) colorMode = useColorMode();

const emojiTheme = computed(() => {
if (!colorMode) return 'light';
return colorMode.value === 'dark' ? 'dark' : 'light';
});

const onSelectEmoji = (emoji: EmojiExt) => {
const MdIcon = emoji.n.find(s => s.startsWith('mdi:'));
Expand Down
6 changes: 2 additions & 4 deletions packages/localdeck-components/src/utils/PadCfg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import {
zConfiguredButtonOpts,
} from '@localbytes/localdeck-codegen/dist/virtuals';
import { z } from 'zod';
import { zx } from '@traversable/zod';

// Zod has deprecated the deepPartial method, with not replacement
// GH: https://github.com/colinhacks/zod/issues/2854
// noinspection JSDeprecatedSymbols
export const zPadEditor = z.object({
title: z.string().default('LocalDeck'),
buttons: z.preprocess(
val => Object.fromEntries(Object.entries(val as Record<string, unknown>).filter(([key]) => zButtonNumber.safeParse(key).success)),
z.record(zButtonNumber, zConfiguredButtonOpts.deepPartial()),
z.record(zButtonNumber, zx.deepPartial(zConfiguredButtonOpts)),
).default({}),
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { mount } from '@vue/test-utils';
import { zConfiguredButtonOpts } from '@localbytes/localdeck-codegen/dist/virtuals';
import { DeckButtonItem } from '#components';
import DeckButtonItem from '../../src/components/DeckButtonItem.vue';

const CLASS_PRINTMODE = 'printmode';

Expand Down
3 changes: 3 additions & 0 deletions packages/localdeck-components/tests/unit/config-util.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { describe, expect, it } from 'vitest';
import { ObjectUtil, ConfigUtil } from '../../src/utils/config-util';
import { newPadEditor } from '../../src/utils/PadCfg';
import type { DeepPartial } from '../../src/utils/types';

describe('ObjectUtil', () => {
it('should return the value at the given path', () => {
Expand Down
16 changes: 15 additions & 1 deletion packages/localdeck-components/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
{
"extends": "./.nuxt/tsconfig.json"
"files": [],
"references": [
{
"path": "./.nuxt/tsconfig.app.json"
},
{
"path": "./.nuxt/tsconfig.server.json"
},
{
"path": "./.nuxt/tsconfig.shared.json"
},
{
"path": "./.nuxt/tsconfig.node.json"
}
]
}
1 change: 1 addition & 0 deletions packages/localdeck-configurator/.nuxtrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setups.@nuxt/test-utils="3.17.2"
3 changes: 3 additions & 0 deletions packages/localdeck-configurator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased](https://github.com/LocalBytes/localdeck-config/compare/v0.7...main)

### Changed
- Major update to dependencies including Nuxt 4

## [v0.7](https://github.com/LocalBytes/localdeck-config/releases/tag/v0.7)

### Added
Expand Down
Loading