Skip to content

Commit fdcba23

Browse files
author
Marko Petzold
committed
vite and external material
1 parent 4e824e5 commit fdcba23

File tree

8 files changed

+690
-2685
lines changed

8 files changed

+690
-2685
lines changed

.github/workflows/build-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and Publish to npm and unpkg
33
on:
44
push:
55
tags:
6-
- '*'
6+
- "*"
77

88
jobs:
99
build:
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install Node.js
1717
uses: actions/setup-node@v4
1818
with:
19-
node-version: '18'
19+
node-version: "24"
2020

2121
- name: Install dependencies
2222
run: npm install --omit-dev --frozen-lockfile

package-lock.json

Lines changed: 610 additions & 2542 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
"license": "MIT",
55
"author": "widget-sidenav",
66
"version": "1.0.10",
7+
"engines": {
8+
"node": ">=24.9.0",
9+
"npm": ">=10.0.2"
10+
},
711
"type": "module",
812
"main": "dist/widget-sidenav.js",
913
"types": "dist/src/widget-sidenav.d.ts",
@@ -14,30 +18,28 @@
1418
],
1519
"scripts": {
1620
"analyze": "cem analyze --litelement",
17-
"start": "node rename-material-package.js && concurrently -k -r \"npm run watch\" \"wds\"",
18-
"build": "node rename-material-package.js && rollup -c rollup.config.js",
19-
"watch": "node rename-material-package.js && rollup -w -c rollup.config.js",
20-
"link": "npm link && cd ../RESWARM/frontend && npm link @record-evolution/widget-sidenav",
21+
"start": "vite",
22+
"build": "vite build",
23+
"watch": "vite build --watch",
24+
"link": "npm run build && npm link && cd ../RESWARM/frontend && npm link @record-evolution/widget-sidenav",
2125
"unlink": "npm unlink --global && cd ../RESWARM/frontend && npm unlink @record-evolution/widget-sidenav && npm i @record-evolution/widget-sidenav",
22-
"types": "cat src/definition-schema.json | json2ts > src/definition-schema.d.ts",
26+
"types": "cat src/definition-schema.json | json2ts --style.tabWidth=4 > src/definition-schema.d.ts",
2327
"release": "npm run build && npm run types && npm version patch --tag-version-prefix='' && git push && git push --tag && npm run build"
2428
},
2529
"dependencies": {
26-
"lit": "^3.3.1",
27-
"@material/web": "^2.4.0"
30+
"lit": "^3.3.2",
31+
"tslib": "^2.8.1"
32+
},
33+
"peerDependencies": {
34+
"@material/web": "^2.4.1"
2835
},
2936
"devDependencies": {
3037
"@custom-elements-manifest/analyzer": "^0.10.5",
31-
"@rollup/plugin-babel": "^6.0.4",
32-
"@rollup/plugin-commonjs": "^28.0.6",
33-
"@rollup/plugin-node-resolve": "^16.0.1",
38+
"@material/web": "^2.4.1",
3439
"@rollup/plugin-replace": "^6.0.2",
35-
"@rollup/plugin-typescript": "^12.1.4",
36-
"@web/dev-server": "^0.4.6",
37-
"concurrently": "^9.2.1",
3840
"json-schema-to-typescript": "^15.0.4",
39-
"tslib": "^2.8.1",
40-
"typescript": "^5.9.2"
41+
"typescript": "5.9.3",
42+
"vite": "^7.3.0"
4143
},
4244
"repository": {
4345
"type": "git",

rename-material-package.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

rollup.config.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/definition-schema.d.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,33 @@ export type AddLeadingSlash1 = boolean;
3838
*/
3939
export type AddTraillingSlash1 = boolean;
4040
export type NavigationItems = {
41-
label?: Label;
42-
iconName?: IconName;
43-
route?: NavigationRoute;
44-
leadingSlash?: AddLeadingSlash1;
45-
trailingSlash?: AddTraillingSlash1;
46-
[k: string]: unknown;
41+
label?: Label;
42+
iconName?: IconName;
43+
route?: NavigationRoute;
44+
leadingSlash?: AddLeadingSlash1;
45+
trailingSlash?: AddTraillingSlash1;
46+
[k: string]: unknown;
4747
}[];
4848

4949
export interface InputData {
50-
title?: TitleSettings;
51-
route?: TitleNavigation;
52-
leadingSlash?: AddLeadingSlash;
53-
trailingSlash?: AddTraillingSlash;
54-
style?: ItemStyle;
55-
navItems?: NavigationItems;
56-
[k: string]: unknown;
50+
title?: TitleSettings;
51+
route?: TitleNavigation;
52+
leadingSlash?: AddLeadingSlash;
53+
trailingSlash?: AddTraillingSlash;
54+
style?: ItemStyle;
55+
navItems?: NavigationItems;
56+
[k: string]: unknown;
5757
}
5858
export interface ItemStyle {
59-
fontSize?: FontSize;
60-
fontWeight?: FontWeight;
61-
color?: FontColor;
62-
backgroundColor?: BackgroundColor;
63-
[k: string]: unknown;
59+
fontSize?: FontSize;
60+
fontWeight?: FontWeight;
61+
color?: FontColor;
62+
backgroundColor?: BackgroundColor;
63+
[k: string]: unknown;
6464
}
6565
export interface FontColor {
66-
[k: string]: unknown;
66+
[k: string]: unknown;
6767
}
6868
export interface BackgroundColor {
69-
[k: string]: unknown;
69+
[k: string]: unknown;
7070
}

vite.config.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { defineConfig } from 'vite'
2+
import { readFileSync } from 'fs'
3+
import replace from '@rollup/plugin-replace'
4+
5+
const pkg = JSON.parse(readFileSync('./package.json', 'utf-8'))
6+
7+
export default defineConfig({
8+
server: {
9+
open: '/demo/',
10+
port: 8000
11+
},
12+
resolve: {
13+
alias: {
14+
tslib: 'tslib/tslib.es6.js'
15+
},
16+
conditions: ['browser']
17+
},
18+
define: {
19+
'process.env.NODE_ENV': JSON.stringify('production')
20+
},
21+
plugins: [
22+
replace({
23+
versionplaceholder: pkg.version,
24+
preventAssignment: true
25+
})
26+
],
27+
build: {
28+
lib: {
29+
entry: 'src/widget-sidenav.ts',
30+
formats: ['es'],
31+
fileName: 'widget-sidenav'
32+
},
33+
sourcemap: true,
34+
rollupOptions: {
35+
external: [/^lit/, /^@lit/, /^@material\/web/],
36+
output: {
37+
banner: '/* @license Copyright (c) 2025 IronFlock GmbH. All rights reserved.*/'
38+
}
39+
}
40+
}
41+
})

web-dev-server.config.mjs

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)