create-gleam
Advanced tools
Comparing version 0.1.2 to 0.1.4
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "0.1.2", | ||
"version": "0.1.4", | ||
"description": "scaffold a web app with gleam and vite", | ||
@@ -9,0 +9,0 @@ "dependencies": { |
@@ -12,3 +12,2 @@ { | ||
"keywords": [], | ||
"author": "endercheif", | ||
"license": "MIT", | ||
@@ -15,0 +14,0 @@ "dependencies": { |
@@ -9,4 +9,7 @@ # Gleam + Typescript, Web Template | ||
├── .gitignore // list of files/folders hidden by git | ||
├── assets // location of static/nonjs files (images, css) | ||
├── assets // location of static/nonjs files to be (images, css). can be imported/compiled | ||
│ └── main.css | ||
├── public // location of static files served on the root of the site (ex: `example.com/image.svg`) | ||
│ └── gleam.svg | ||
│ └── vite.svg | ||
├── gleam.toml // no need to edit | ||
@@ -13,0 +16,0 @@ ├── index.html // modify as you wish, keep script tag |
@@ -1,10 +0,19 @@ | ||
export function randInt(max: number) { | ||
return Math.ceil(Math.random() * max); | ||
export function eventListener( | ||
element: HTMLElement, | ||
event: keyof HTMLElementEventMap, | ||
handler: VoidFunction | ||
) { | ||
element.addEventListener(event, handler); | ||
} | ||
export function mathy(x: number, y: number) { | ||
return 2 ** y + x; | ||
export function select(tag: string) { | ||
return document.querySelector(tag); | ||
} | ||
export function counter() { | ||
export function update( | ||
elem: HTMLElement, | ||
attr: string, | ||
updater: (old: string) => string | ||
) { | ||
elem[attr] = updater(elem[attr]); | ||
} |
@@ -8,4 +8,5 @@ { | ||
"@assets/*": ["./assets/*"] | ||
} | ||
}, | ||
"rootDirs": ["src", "build/dev/javascript/sample_project"] | ||
} | ||
} |
@@ -23,3 +23,2 @@ import { execSync } from "node:child_process"; | ||
handleHotUpdate(ctx) { | ||
// console.log(ctx.file); | ||
if (path.join(__dirname, "src").includes(path.join(ctx.file, ".."))) { | ||
@@ -31,3 +30,8 @@ console.log("$ gleam build"); | ||
}, | ||
async resolveId(source, importer, options) { | ||
buildStart() { | ||
console.log("$ gleam build"); | ||
const out = execSync("gleam build"); | ||
console.log(out.toString("utf-8")); | ||
}, | ||
async resolveId(source, importer) { | ||
if (gleamRegex.test(source)) { | ||
@@ -34,0 +38,0 @@ return { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24436
19
314