diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..bf1d0a6 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,5 @@ +{ + "tabWidth": 2, + "useTabs": true, + "printWidth": 160 +} diff --git a/build.ts b/build.ts index 52c6fe6..6a23c62 100644 --- a/build.ts +++ b/build.ts @@ -1,43 +1,41 @@ -import dts from 'bun-plugin-dts'; -import Logger from '@rabbit-company/logger'; -import fs from 'fs/promises'; +import dts from "bun-plugin-dts"; +import Logger from "@rabbit-company/logger"; +import fs from "fs/promises"; -await fs.rm('./module', {recursive: true, force: true}); -await fs.rm('./dist', {recursive: true, force: true}); +await fs.rm("./module", { recursive: true, force: true }); +await fs.rm("./dist", { recursive: true, force: true }); -Logger.info('Start bulding module...'); +Logger.info("Start bulding module..."); let moduleBuild = await Bun.build({ - entrypoints: ['./src/password-entropy.ts'], - outdir: './module', - target: 'browser', - format: 'esm', - plugins: [ - dts({output: {noBanner: true}}) - ], + entrypoints: ["./src/password-entropy.ts"], + outdir: "./module", + target: "browser", + format: "esm", + plugins: [dts({ output: { noBanner: true } })], }); -if(moduleBuild.success){ - Logger.info('Bulding module complete'); -}else{ - Logger.error('Bulding module failed'); +if (moduleBuild.success) { + Logger.info("Bulding module complete"); +} else { + Logger.error("Bulding module failed"); } -fs.cp('./src/index.html', './dist/index.html', {recursive: true, force: true}); +fs.cp("./src/index.html", "./dist/index.html", { recursive: true, force: true }); -Logger.info('Start bundling dist...'); +Logger.info("Start bundling dist..."); let distBuild = await Bun.build({ - entrypoints: ['./src/index.ts'], - outdir: './dist', - target: 'browser', - format: 'esm', + entrypoints: ["./src/index.ts"], + outdir: "./dist", + target: "browser", + format: "esm", minify: true, - sourcemap: 'none', // Bun still generates incorrect sourcemaps - plugins: [], + sourcemap: "none", // Bun still generates incorrect sourcemaps + plugins: [], }); -if(distBuild.success){ - Logger.info('Bundling dist complete'); -}else{ - Logger.error('Bundling dist failed'); +if (distBuild.success) { + Logger.info("Bundling dist complete"); +} else { + Logger.error("Bundling dist failed"); Logger.error(distBuild.logs); -} \ No newline at end of file +} diff --git a/bun.lockb b/bun.lockb index 5575bdd..f965f9f 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/dist/index.html b/dist/index.html index 0b05ff2..c8709b1 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1,22 +1,22 @@ -
-Your password entropy is 0.
+ +Your password entropy is 0.
-