mirror of
https://github.com/cupcakearmy/canihazusername.git
synced 2024-11-16 10:00:56 +01:00
move to vite
This commit is contained in:
parent
bcfd32ea8f
commit
3a2339002d
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,5 +6,4 @@ node_modules/
|
||||
dist
|
||||
build
|
||||
.cache
|
||||
.parcel-cache
|
||||
.vercel
|
||||
|
@ -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
|
||||
|
@ -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';
|
||||
|
@ -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(', ')
|
||||
|
10
package.json
10
package.json
@ -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"
|
||||
}
|
||||
}
|
||||
|
1783
pnpm-lock.yaml
1783
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user