move to vite

This commit is contained in:
Niccolo Borgioli 2023-07-12 23:05:30 +02:00
parent bcfd32ea8f
commit 3a2339002d
No known key found for this signature in database
GPG Key ID: D93C615F75EE4F0B
6 changed files with 57 additions and 1751 deletions

1
.gitignore vendored
View File

@ -6,5 +6,4 @@ node_modules/
dist
build
.cache
.parcel-cache
.vercel

View File

@ -3,6 +3,7 @@
<head>
<title>canihazusername</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="utf-8" />
<link rel="stylesheet" href="./main.css" />
</head>
@ -22,7 +23,7 @@
<a target="blank" href="https://github.com/cupcakearmy/canihazusername">
<button id="button" class="button is-link is-rounded is-fullwidth mb-3">🔗 Github & Docs 🔗</button>
</a>
<pre>yarn add canihazusername</pre>
<pre>pnpm i canihazusername</pre>
<pre>
import { generate } from 'canihazusername'
generate('{character}_{english}')</pre

View File

@ -1,3 +1,5 @@
@import 'bulma/css/bulma.css';
* {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';

View File

@ -1,16 +1,15 @@
import 'bulma/css/bulma.css'
import { generate, showAvailableLists } from '../'
import { generate, showAvailableLists } from '../src/index'
const input = window.document.getElementById('format') as HTMLInputElement
const output = window.document.getElementById('username') as HTMLInputElement
const list = window.document.getElementById('lists')
const button = window.document.getElementById('button')
const calculate = () => {
function calculate() {
output.value = generate(input.value)
}
// Init
button.addEventListener('click', calculate)
button?.addEventListener('click', calculate)
calculate()
list.innerHTML = showAvailableLists().join(', ')
if (list) list.innerHTML = showAvailableLists().join(', ')

View File

@ -27,10 +27,10 @@
"generate": "git submodule update --recursive --remote --init && node ./generate/wordlist.js",
"dev": "tsc -w",
"build": "tsup src/index.ts --format cjs,esm --dts --sourcemap",
"docs": "pnpm run build && parcel build --target docs demo/index.html",
"docs:dev": "parcel --target docs demo/index.html",
"docs": "vite build demo --outDir ../build",
"docs:dev": "vite demo",
"prepublishOnly": "rm -rf ./dist && pnpm run build",
"clean": "rm -rf ./dist ./build ./.parcel-cache"
"clean": "rm -rf ./dist ./build"
},
"repository": {
"type": "git",
@ -50,8 +50,8 @@
"homepage": "https://github.com/CupCakeArmy/canihazusername#readme",
"devDependencies": {
"bulma": "^0.9.4",
"parcel": "^2.9.3",
"tsup": "^7.1.0",
"typescript": "^5.1.6"
"typescript": "^5.1.6",
"vite": "^4.4.3"
}
}

File diff suppressed because it is too large Load Diff