This repository was archived by the owner on Sep 19, 2025. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 4 files changed +43
-1
lines changed Expand file tree Collapse file tree 4 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ install:
1919	$(MAKE )  -C $(JS )  install
2020	cargo install cargo-zigbuild
2121	#  brew install binaryen
22+ 	brew install caddy
2223
2324bump :
2425	$(MAKE )  -C $(JS )  bump VERSION=$(VERSION ) 
Original file line number Diff line number Diff line change @@ -3,8 +3,10 @@ ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
33build :
44	$(MAKE )  build-target WASM_PATH=$(WASM_PATH )  TARGET=experimental-nodejs-module
55	$(MAKE )  build-target WASM_PATH=$(WASM_PATH )  TARGET=deno
6+ 	$(MAKE )  build-target WASM_PATH=$(WASM_PATH )  TARGET=web
67
78	#  shim workerd
9+ 	rm -rf $(ROOT_DIR)/pkg-workerd
810	cp -r $(ROOT_DIR)/pkg-experimental-nodejs-module $(ROOT_DIR)/pkg-workerd
911	cp $(ROOT_DIR)/shim-workerd.js $(ROOT_DIR)/pkg-workerd/pulsebeam_core.js
1012
@@ -34,3 +36,6 @@ install:
3436
3537bump :
3638	bash bump.bash ${VERSION}  
39+ 
40+ serve :
41+ 	caddy file-server --root . 
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>  
2+ < html  lang ="en "> 
3+ 
4+ < head > 
5+   < meta  charset ="UTF-8 "> 
6+   < meta  name ="viewport " content ="width=device-width, initial-scale=1 "> 
7+ </ head > 
8+ 
9+ < body > 
10+ 
11+   < script  type ="module "> 
12+     import  init ,  { 
13+       AccessToken , 
14+       PeerClaims , 
15+       PeerPolicy , 
16+     }  from  "./pkg-web/pulsebeam_core.js" ; 
17+ 
18+     await  init ( ) ; 
19+     const  app  =  new  AccessToken ( 
20+       "kid_73d8caa6c387d46c" , 
21+       "sk_7edea599046490dfd271b863b03398d2b613812b1f23efd023ca3b08026d3e67" , 
22+     ) ; 
23+ 
24+     const  claims  =  new  PeerClaims ( "default" ,  "alice" ) ; 
25+     const  policy  =  new  PeerPolicy ( "default" ,  "*" ) ; 
26+     claims . setAllowPolicy ( policy ) ; 
27+ 
28+     const  token  =  app . createToken ( claims ,  3600 ) ; 
29+     console . log ( token ) ; 
30+   </ script > 
31+ </ body > 
32+ 
33+ </ html > 
Original file line number Diff line number Diff line change 1414    "." : " ./pkg-experimental-nodejs-module/pulsebeam_core.js"  ,
1515    "./node" : " ./pkg-experimental-nodejs-module/pulsebeam_core.js"  ,
1616    "./deno" : " ./pkg-deno/pulsebeam_core.js"  ,
17-     "./workerd" : " ./pkg-workerd/pulsebeam_core.js" 
17+     "./workerd" : " ./pkg-workerd/pulsebeam_core.js"  ,
18+     "./web" : " ./pkg-web/pulsebeam_core.js" 
1819  },
1920  "publish" : {
2021    "include" : [
2122      " pkg-experimental-nodejs-module"  ,
2223      " pkg-deno"  ,
2324      " pkg-workerd"  ,
25+       " pkg-web"  ,
2426      " README.md"  ,
2527      " LICENSE"  ,
2628      " jsr.json" 
3032    " pkg-experimental-nodejs-module"  ,
3133    " pkg-deno"  ,
3234    " pkg-workerd"  ,
35+     " pkg-web"  ,
3336    " README.md"  ,
3437    " LICENSE"  ,
3538    " package.json" 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments