Stand up stub of npm export

This commit is contained in:
Scott Richmond 2023-12-01 19:56:22 -05:00
parent bc7565926a
commit 478d0347f2
3 changed files with 27 additions and 19 deletions

View File

@ -1,22 +1,14 @@
{ {
"name": "ludus", "name": "@ludus/ludus",
"version": "1.0.0", "version": "0.1.0-ALPHA",
"description": "![Ludus logo](logo.png) ## Ludus: A friendly, dynamic, functional language", "description": "Ludus: A friendly, dynamic, functional language",
"main": "index.js", "main": "target/js/ludus.js",
"directories": { "directories": {},
"doc": "doc",
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [], "keywords": [],
"author": "", "author": "Scott Richmond",
"license": "ISC", "license": "GPL-3.0",
"devDependencies": { "devDependencies": {
"shadow-cljs": "^2.26.0" "shadow-cljs": "^2.26.0"
}, },
"dependencies": { "dependencies": {}
"p5": "^1.8.0"
}
} }

View File

@ -6,9 +6,8 @@
:builds :builds
{:node {:target :node-library {:node {:target :node-library
:output-to "target/js/ludus.js" :output-to "target/js/ludus.js"
:exports-fn ludus.core/run :exports {:run ludus.node/run}
:asset-path "/js" :modules {:main {:entries [ludus.node]}}}
:modules {:main {:entries [ludus.core]}}}
:browser {:target :browser :browser {:target :browser
:output-dir "target/js" :output-dir "target/js"
:asset-path "target" :asset-path "target"

17
src/ludus/node.cljs Normal file
View File

@ -0,0 +1,17 @@
(ns ludus.node
; (:require [ludus.interpreter :as i]
; [ludus.grammar :as g]
; [ludus.parser :as p]
; [ludus.scanner :as s])
)
(defn run [source]
(println "Running source!")
(println "(This is a stub.)")
(clj->js {
:result "Hello, world!"
:errors [{:msg "An error"}, {:msg "Another error"}]
:console ["Here's a log.", "Here's another log."]
:draw [[:background 0]
[:fill 255]
[:rect 10 10 50 50]]}))