Skip to content

Commit

Permalink
fix: use @typography-org/native with commonjs
Browse files Browse the repository at this point in the history
  • Loading branch information
drdevelop committed May 21, 2022
1 parent cbf6be0 commit ac85d04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
8 changes: 2 additions & 6 deletions packages/typography-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typography-org/vue",
"version": "1.0.0-beta.8",
"version": "1.0.0-beta.9",
"description": "A vue component library that calculates fonts according to browser behavior and omits expanding and collapsing",
"types": "dist/src/index.d.ts",
"repository": "https://github.com/drdevelop/typography",
Expand All @@ -20,10 +20,6 @@
"type": "tsc -d",
"test": "jest",
"docs:build": "rm -rf docs-dist && cross-env NODE_ENV=production vitepress-fc build --root=docs",
"docs-serve": "cross-env NODE_ENV=production vitepress-fc serve --root=docs",
"docs-build-serve": "cross-env NODE_ENV=true yarn docs-build && yarn docs-serve",
"docs-deploy": "gh-pages -d docs/dist -t true",
"docs-build-deploy": "yarn docs-build && yarn docs-deploy",
"pub": "yarn build && lerna publish",
"lint": "eslint --ignore-pattern **/__tests__/* --ignore-pattern **/dist/* \"src/**/*.{vue,js,ts,tsx}\"",
"lint-fix": "npm run lint -- --fix",
Expand Down Expand Up @@ -74,7 +70,7 @@
"whatwg-fetch": "^3.5.0"
},
"dependencies": {
"@typography-org/native": "^1.0.0-rc.0",
"@typography-org/native": "^1.0.0-rc.1",
"vue-demi": "^0.6.0"
},
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions packages/typography-vue/src/components/Paragraph/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import formatWithEllipsis from "@typography-org/native";
import * as formatWithEllipsis from "@typography-org/native";

export default {
props: ["ellipsis"],
Expand Down Expand Up @@ -51,7 +51,7 @@ export default {
const fontFamily = getComputedStyle(dom).fontFamily;
const suffixWidth = vm.suffixWidth;
const text = vm.$slots.default()[0].children?.trim();
const calc = (formatWithEllipsis as any).default || formatWithEllipsis;
const calc = formatWithEllipsis.default;
const newDisplayText = calc(
text,
{
Expand Down
8 changes: 4 additions & 4 deletions packages/typography-vue/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -954,10 +954,10 @@
"@typescript-eslint/types" "4.14.1"
eslint-visitor-keys "^2.0.0"

"@typography-org/native@^1.0.0-rc.0":
version "1.0.0-rc.0"
resolved "https://registry.npmjs.org/@typography-org/native/-/native-1.0.0-rc.0.tgz#4e422087701436f9a56d7b2a4efa10afa7d37c14"
integrity sha512-28i6u3yt31QC5zo+fvPvCZ1yJ+i+cQN4neplJMOZ23LLlKTp0naQNyXgpVuuEAvR5MXjaU7Z5hJ7LSxCgl4dLA==
"@typography-org/native@^1.0.0-rc.1":
version "1.0.0-rc.1"
resolved "https://registry.npmjs.org/@typography-org/native/-/native-1.0.0-rc.1.tgz#b225f88057ec17da2ada352630ac11fa6f4a3696"
integrity sha512-tG0m0WTKZ+l81pL52BB6tRmCP9ENz/gu6zhIcyjXiAOKAl9ll2rYyWtwWMEPc8zoB8ka+d5rseqWF7fQqp2++w==

"@vitejs/plugin-vue@^2.1.0":
version "2.1.0"
Expand Down

0 comments on commit ac85d04

Please sign in to comment.