From 086847b368c319e02c8336f44aed2c2c55a6eb2e Mon Sep 17 00:00:00 2001 From: davay Date: Sun, 15 Jan 2023 14:07:06 +0700 Subject: [PATCH] correct types exports --- .gitignore | 3 +- index.html | 121 ++++++++++++++++++++++++++++++++----------------- package.json | 6 +-- tsconfig.json | 2 +- vite.config.js | 4 +- 5 files changed, 88 insertions(+), 48 deletions(-) diff --git a/.gitignore b/.gitignore index 601f53d..f2314d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules .DS_Store dist -demo \ No newline at end of file +demo +public/types \ No newline at end of file diff --git a/index.html b/index.html index 37c2df6..cf18cc3 100644 --- a/index.html +++ b/index.html @@ -101,8 +101,8 @@

Gun-avatar

-
-
+
+
Gun-avatar round >
-

- Gun-avatar is a public key visualization tool -

-

- It's intended to be used with - GUN peer-to-peer - database for creating avatars of - SEA - cryptographic key pairs. -

+
+

+ Gun-avatar is a public key visualization tool +

+

+ It's intended to be used with + GUN peer-to-peer + database for creating avatars of + SEA + cryptographic key pairs. +

+
-
+

User avatars >

-

- A key pair may represent a user or some kind of dedicated data space. So - gun-avatar can visualize a public key in two main modes. We use - circles and symmetry to represent a user account and use squares and no - symmetry to represent "rooms". It's userful to generate small icons and - huge backgrounds as well. You define the size. -

- - +
+ +
+

+ A key pair may represent a user or some kind of dedicated data + space. So + gun-avatar can visualize a public key in two main modes. We + use circles and symmetry to represent a user account and use squares + and no symmetry to represent "rooms". It's userful to generate small + icons and huge backgrounds as well. You define the size. +

+
+

Room avatars @@ -216,35 +222,60 @@

>Web component and use it as a custom HTML element -
+						
+
   <gun-avatar
       pub="O6_tdEg_zCSNO-nMWds2o-fjPgwqQ3sHyxczMiGwl50.zuMgYb93u6LrxWYTVIlIBFG7LkClU_FtOHlsNCbQDH8"
-      size="60"
+      size="100"
       draw="squares"
       reflect="false"
       round
       dark
     ></gun-avatar>
+ > +
+ +
+
  • Mount all <img> elements with a certain class and data-attributes on the page -
    +						
    +
       <img
           class="gun-avatar"
           data-pub="O6_tdEg_zCSNO-nMWds2o-fjPgwqQ3sHyxczMiGwl50.zuMgYb93u6LrxWYTVIlIBFG7LkClU_FtOHlsNCbQDH8"
    -      data-size="60"
    +      data-size="300"
           data-draw="circles"
           data-reflect="false"
           data-round
           data-dark
         />
    + > +
    + +
    +
  • Use the gunAvatar() function programmatically in your @@ -255,13 +286,21 @@
    > <img :src="gunAvatar({ - size:900, + size:100, draw: 'squares' dark: false, reflect: false, })" />
  • +
    + +
    diff --git a/package.json b/package.json index c7828b7..3b84d37 100644 --- a/package.json +++ b/package.json @@ -35,12 +35,12 @@ }, "main": "./dist/gun-avatar.umd.cjs", "module": "./dist/gun-avatar.js", - "types": "./dist/main.d.ts", + "types": "./dist/types/main.d.ts", "files": [ "dist" ], "scripts": { - "build": "vite build", + "build": "tsc && vite build", "deploy": "sh deploy.sh", "dev": "vite --mode page", "page": "vite build --mode page", @@ -62,4 +62,4 @@ "vitepress": "1.0.0-alpha.36", "windicss": "^3.5.6" } -} +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 3126339..cbdc04b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,7 @@ // Types should go into this directory. // Removing this would place the .d.ts files // next to the .js files - "outDir": "dist", + "outDir": "public/types", // go to js file when using IDE functions like // "Go to Definition" in VSCode "declarationMap": true diff --git a/vite.config.js b/vite.config.js index d6c54bb..991069d 100644 --- a/vite.config.js +++ b/vite.config.js @@ -12,7 +12,7 @@ export default defineConfig(({ command, mode }) => { WindiCSS({ scan: { dirs: ["src"], - exclude: ["**/examples/**/*", "/node_modules/"], + exclude: ["/node_modules/"], fileExtensions: ["vue", "ts"], }, }), @@ -20,7 +20,7 @@ export default defineConfig(({ command, mode }) => { /* options */ }), Components({ - dirs: ["./"], + dirs: ["src"], extensions: ["html", "vue"], directoryAsNamespace: true, globalNamespaces: ["global"],