Skip to content

Commit

Permalink
更新至node16,lit3,及更新所有依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
zdhxiong committed Oct 21, 2023
1 parent 39a6c5d commit 5149a5e
Show file tree
Hide file tree
Showing 16 changed files with 2,452 additions and 2,018 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
}
],
"prettier/prettier": "error",
"grouped-accessor-pairs": ["error", "getBeforeSet"],
"import/no-unresolved": "off",
"import/extensions": ["error", "always", { "ignorePackages": true }],
"import/no-default-export": "error",
Expand Down
4 changes: 1 addition & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "lf"
"singleQuote": true
}
1 change: 1 addition & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"color-function-notation": null,
"no-descending-specificity": null,
"function-no-unknown": null,
"media-query-no-invalid": null,
"media-feature-range-notation": "prefix"
}
}
77 changes: 37 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"private": true,
"type": "module",
"workspaces": [
"packages/**"
],
"scripts": {
"preinstall": "npx -y only-allow pnpm",
"clean:jq": "rimraf --glob packages/jq/{functions,methods,shared,static} packages/jq/*.{js,d.ts}",
Expand Down Expand Up @@ -38,46 +35,46 @@
"publish": "npm run bundle && pnpm publish --recursive --access public"
},
"devDependencies": {
"@custom-elements-manifest/analyzer": "0.8.2",
"@material-design-icons/svg": "^0.14.2",
"@open-wc/testing": "^3.1.4",
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@types/jquery": "^3.5.14",
"@types/mocha": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"@vscode/vsce": "^2.21.0",
"@web/dev-server-rollup": "^0.4.1",
"@web/test-runner": "^0.15.0",
"@web/test-runner-playwright": "^0.9.0",
"autoprefixer": "^10.4.8",
"clean-css": "^5.2.4",
"concurrently": "^8.0.1",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.4.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-lit": "^1.6.1",
"eslint-plugin-prettier": "^4.0.0",
"jquery": "^3.6.0",
"less": "^4.1.2",
"@custom-elements-manifest/analyzer": "0.9.0",
"@material-design-icons/svg": "^0.14.13",
"@open-wc/testing": "^3.2.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@types/jquery": "^3.5.24",
"@types/mocha": "^10.0.3",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"@vscode/vsce": "^2.21.1",
"@web/dev-server-rollup": "^0.5.4",
"@web/test-runner": "^0.17.2",
"@web/test-runner-playwright": "^0.10.2",
"autoprefixer": "^10.4.16",
"clean-css": "^5.3.2",
"concurrently": "^8.2.2",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-lit": "^1.9.1",
"eslint-plugin-prettier": "^5.0.1",
"jquery": "^3.7.1",
"less": "^4.2.0",
"less-plugin-npm-import": "^2.1.0",
"lint-staged": "^13.0.3",
"lint-staged": "^14.0.1",
"minify-html-literals": "^1.3.5",
"node-watch": "^0.7.3",
"node-watch": "^0.7.4",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.16",
"postcss": "^8.4.31",
"postcss-less": "^6.0.0",
"pretender": "^3.4.7",
"prettier": "^2.5.1",
"rimraf": "^5.0.0",
"rollup": "^3.9.1",
"rollup-plugin-visualizer": "^5.6.0",
"stylelint": "^15.1.0",
"stylelint-config-standard": "^33.0.0",
"typescript": "^5.0.4",
"vite": "^4.0.4",
"prettier": "^3.0.3",
"rimraf": "^5.0.5",
"rollup": "^3.29.4",
"rollup-plugin-visualizer": "^5.9.2",
"stylelint": "^15.11.0",
"stylelint-config-standard": "^34.0.0",
"typescript": "^5.2.2",
"vite": "^4.5.0",
"yorkie": "^2.0.0"
},
"gitHooks": {
Expand All @@ -93,7 +90,7 @@
]
},
"engines": {
"node": ">=14.19.0",
"pnpm": ">=7"
"node": ">=16.15.1",
"pnpm": ">=8"
}
}
4 changes: 2 additions & 2 deletions packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"homepage": "https://github.com/zdhxiong/mdui",
"dependencies": {
"@mdui/shared": "workspace:^",
"lit": "^2.7.5",
"tslib": "^2.6.0"
"lit": "^3.0.0",
"tslib": "^2.6.2"
}
}
2 changes: 1 addition & 1 deletion packages/jq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"homepage": "https://github.com/zdhxiong/mdui",
"dependencies": {
"ssr-window": "^4.0.2",
"tslib": "^2.6.0"
"tslib": "^2.6.2"
}
}
8 changes: 4 additions & 4 deletions packages/mdui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
},
"homepage": "https://www.mdui.org",
"dependencies": {
"@lit-labs/motion": "^1.0.3",
"@lit-labs/motion": "^1.0.5",
"@material/material-color-utilities": "^0.2.7",
"@mdui/shared": "workspace:^",
"@mdui/jq": "workspace:^",
"@open-wc/dedupe-mixin": "^1.3.1",
"@open-wc/dedupe-mixin": "^1.4.0",
"classcat": "^5.0.4",
"is-promise": "^4.0.0",
"lit": "^2.7.5",
"lit": "^3.0.0",
"ssr-window": "^4.0.2",
"tslib": "^2.6.0"
"tslib": "^2.6.2"
}
}
24 changes: 11 additions & 13 deletions packages/mdui/src/components/circular-progress/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,17 @@ export class CircularProgress extends LitElement {
const circumference = 2 * π * circleRadius;
const halfCircumference = 0.5 * circumference;

const circle = (thisStrokeWidth: number) => html`<svg
class="circle"
viewBox="0 0 ${center * 2} ${center * 2}"
>
<circle
cx="${center}"
cy="${center}"
r="${circleRadius}"
stroke-dasharray="${circumference}"
stroke-dashoffset="${halfCircumference}"
stroke-width="${thisStrokeWidth}"
></circle>
</svg>`;
const circle = (thisStrokeWidth: number) =>
html`<svg class="circle" viewBox="0 0 ${center * 2} ${center * 2}">
<circle
cx="${center}"
cy="${center}"
r="${circleRadius}"
stroke-dasharray="${circumference}"
stroke-dashoffset="${halfCircumference}"
stroke-width="${thisStrokeWidth}"
></circle>
</svg>`;

return html`<div class="layer">
<div class="clipper left">${circle(strokeWidth)}</div>
Expand Down
18 changes: 10 additions & 8 deletions packages/mdui/src/components/dialog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,17 +409,19 @@ export class Dialog extends LitElement {
>
${when(
hasHeader,
() => html`<slot name="header" part="header" class="header">
${when(hasIcon, () => this.renderIcon())}
${when(hasHeadline, () => this.renderHeadline())}
</slot>`,
() =>
html`<slot name="header" part="header" class="header">
${when(hasIcon, () => this.renderIcon())}
${when(hasHeadline, () => this.renderHeadline())}
</slot>`,
)}
${when(
hasBody,
() => html`<div ${ref(this.bodyRef)} part="body" class="body">
${when(hasDescription, () => this.renderDescription())}
<slot></slot>
</div>`,
() =>
html`<div ${ref(this.bodyRef)} part="body" class="body">
${when(hasDescription, () => this.renderDescription())}
<slot></slot>
</div>`,
)}
${when(
hasActionSlot,
Expand Down
13 changes: 7 additions & 6 deletions packages/mdui/src/components/navigation-drawer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,13 @@ export class NavigationDrawer extends LayoutItemBase {
protected override render(): TemplateResult {
return html`${when(
this.isModal,
() => html`<div
${ref(this.overlayRef)}
part="overlay"
class="overlay"
@click=${this.onOverlayClick}
></div>`,
() =>
html`<div
${ref(this.overlayRef)}
part="overlay"
class="overlay"
@click=${this.onOverlayClick}
></div>`,
)}
<slot
${ref(this.panelRef)}
Expand Down
35 changes: 18 additions & 17 deletions packages/mdui/src/components/snackbar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,23 +341,24 @@ export class Snackbar extends LitElement {
</slot>
${when(
this.closeable,
() => html`<slot
name="close-button"
part="close-button"
class="close-button"
@click=${this.onCloseClick}
>
<mdui-button-icon>
<slot name="close-icon" part="close-icon">
${this.closeIcon
? html`<mdui-icon
name=${this.closeIcon}
class="i"
></mdui-icon>`
: html`<mdui-icon-clear class="i"></mdui-icon-clear>`}
</slot>
</mdui-button-icon>
</slot>`,
() =>
html`<slot
name="close-button"
part="close-button"
class="close-button"
@click=${this.onCloseClick}
>
<mdui-button-icon>
<slot name="close-icon" part="close-icon">
${this.closeIcon
? html`<mdui-icon
name=${this.closeIcon}
class="i"
></mdui-icon>`
: html`<mdui-icon-clear class="i"></mdui-icon-clear>`}
</slot>
</mdui-button-icon>
</slot>`,
)}
</div>`;
}
Expand Down
9 changes: 5 additions & 4 deletions packages/mdui/src/components/text-field/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,11 @@ export class TextField
</div>
${when(
hasError || hasHelper || hasCounter,
() => html`<div part="supporting" class="supporting">
${this.renderHelper(hasError, hasHelper)}
${this.renderCounter(hasCounter)}
</div>`,
() =>
html`<div part="supporting" class="supporting">
${this.renderHelper(hasError, hasHelper)}
${this.renderCounter(hasCounter)}
</div>`,
)}`;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"homepage": "https://github.com/zdhxiong/mdui#readme",
"dependencies": {
"@mdui/jq": "workspace:^",
"@open-wc/dedupe-mixin": "^1.3.1",
"lit": "^2.7.5",
"@open-wc/dedupe-mixin": "^1.4.0",
"lit": "^3.0.0",
"ssr-window": "^4.0.2",
"tslib": "^2.6.0"
"tslib": "^2.6.2"
}
}
19 changes: 10 additions & 9 deletions packages/shared/src/icons/shared/svg-tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { html } from 'lit';
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
import type { TemplateResult } from 'lit';

export const svgTag = (svgPaths: string): TemplateResult => html`<svg
xmlns="http://www.w3.org/2000/svg"
width="100%"
height="100%"
viewBox="0 0 24 24"
fill="currentColor"
>
${unsafeSVG(svgPaths)}
</svg>`;
export const svgTag = (svgPaths: string): TemplateResult =>
html`<svg
xmlns="http://www.w3.org/2000/svg"
width="100%"
height="100%"
viewBox="0 0 24 24"
fill="currentColor"
>
${unsafeSVG(svgPaths)}
</svg>`;
Loading

0 comments on commit 5149a5e

Please sign in to comment.