diff --git a/.gitignore b/.gitignore index 756d83e..7d42c20 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ .lsp/ tokens.clj *.love +/time-guesser +/dist +*.zip diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..a45fd52 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24 diff --git a/Makefile b/Makefile index ced9260..e901892 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,5 @@ build: + ./minify.bb main.fnl zip time-guesser.love main.lua main.min.fnl bootstrap.fnl fennel.lua L5.lua + bash -c 'source ~/.nvm/nvm.sh && nvm use && yarn dlx love.js time-guesser.love dist -c' + zip -r time-guesser-web.zip dist diff --git a/minify.bb b/minify.bb index 069b36d..b24c1fe 100755 --- a/minify.bb +++ b/minify.bb @@ -12,7 +12,6 @@ (defn tokenize [source] (let [chars (vec source) total-chars (count chars)] (loop [cursor 0 tokens []] - ; (when (< cursor 100) (pprint {:tokens tokens})) (if (>= cursor total-chars) tokens (let [c (chars cursor) nxt (get chars (inc cursor))] @@ -98,7 +97,6 @@ (defn needs-space? "does this token need space before it?" [prev current nxt] - (when (= (current :type) :string) (pprint {:current current})) (or (= (current :type) :open-annon-fn) (and @@ -178,7 +176,6 @@ re-map (build-rename-map (collect-bindings tokens)) output (emit tokens re-map) output-file-name (gen-output-file-name file-name)] - (pprint {:output output :token-sample (take 15 tokens) :bindings (build-rename-map (collect-bindings tokens))}) (write-file "tokens.clj" (with-out-str (pprint (transform-tokens tokens re-map)))) (write-file output-file-name output) (println (str "Wrote file " output-file-name)))) diff --git a/package.json b/package.json new file mode 100644 index 0000000..4a2cee2 --- /dev/null +++ b/package.json @@ -0,0 +1,3 @@ +{ + "packageManager": "yarn@4.15.0" +}