mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-21 10:38:37 +00:00
use new transpiler in vite-vanilla-repl
This commit is contained in:
parent
9b2899c8fb
commit
4ed3ca4128
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
import{g as s,b as d,e as t,j as u,l as o,f as r,p as f,i as p,d as g,h as i,w as l,a as m}from"./index.f88145a1.js";export{s as getAudioContext,d as getCachedBuffer,t as getLoadedBuffer,u as getLoadedSamples,o as loadBuffer,r as loadGithubSamples,f as panic,p as resetLoadedSamples,g as reverseBuffer,i as samples,l as webaudioOutput,m as webaudioOutputTrigger};
|
import{g as s,b as d,e as t,j as u,l as o,f as r,p as f,i as p,d as g,h as i,w as l,a as m}from"./index.f17ed672.js";export{s as getAudioContext,d as getCachedBuffer,t as getLoadedBuffer,u as getLoadedSamples,o as loadBuffer,r as loadGithubSamples,f as panic,p as resetLoadedSamples,g as reverseBuffer,i as samples,l as webaudioOutput,m as webaudioOutputTrigger};
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import{c as ut,r as Se,s as pt}from"./index.f88145a1.js";function gt(a,c){function r(){this.constructor=a}r.prototype=c.prototype,a.prototype=new r}function D(a,c,r,_){var p=Error.call(this,a);return Object.setPrototypeOf&&Object.setPrototypeOf(p,D.prototype),p.expected=c,p.found=r,p.location=_,p.name="SyntaxError",p}gt(D,Error);function U(a,c,r){return r=r||" ",a.length>c?a:(c-=a.length,r+=r.repeat(c),a+r.slice(0,c))}D.prototype.format=function(a){var c="Error: "+this.message;if(this.location){var r=null,_;for(_=0;_<a.length;_++)if(a[_].source===this.location.source){r=a[_].text.split(/\r\n|\n|\r/g);break}var p=this.location.start,$=this.location.source+":"+p.line+":"+p.column;if(r){var w=this.location.end,A=U("",p.line.toString().length," "),E=r[p.line-1],m=p.line===w.line?w.column:E.length+1,h=m-p.column||1;c+=`
|
import{c as ut,r as Se,s as pt}from"./index.f17ed672.js";function gt(a,c){function r(){this.constructor=a}r.prototype=c.prototype,a.prototype=new r}function D(a,c,r,_){var p=Error.call(this,a);return Object.setPrototypeOf&&Object.setPrototypeOf(p,D.prototype),p.expected=c,p.found=r,p.location=_,p.name="SyntaxError",p}gt(D,Error);function U(a,c,r){return r=r||" ",a.length>c?a:(c-=a.length,r+=r.repeat(c),a+r.slice(0,c))}D.prototype.format=function(a){var c="Error: "+this.message;if(this.location){var r=null,_;for(_=0;_<a.length;_++)if(a[_].source===this.location.source){r=a[_].text.split(/\r\n|\n|\r/g);break}var p=this.location.start,$=this.location.source+":"+p.line+":"+p.column;if(r){var w=this.location.end,A=U("",p.line.toString().length," "),E=r[p.line-1],m=p.line===w.line?w.column:E.length+1,h=m-p.column||1;c+=`
|
||||||
--> `+$+`
|
--> `+$+`
|
||||||
`+A+` |
|
`+A+` |
|
||||||
`+p.line+" | "+E+`
|
`+p.line+" | "+E+`
|
||||||
64
packages/core/examples/vite-vanilla-repl/dist/assets/index.f17ed672.js
vendored
Normal file
64
packages/core/examples/vite-vanilla-repl/dist/assets/index.f17ed672.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Vite Vanilla Strudel REPL</title>
|
<title>Vite Vanilla Strudel REPL</title>
|
||||||
<script type="module" crossorigin src="/tidalcycles/strudel/general-purpose-scheduler/packages/core/examples/vite-vanilla-repl/dist/assets/index.f88145a1.js"></script>
|
<script type="module" crossorigin src="/tidalcycles/strudel/general-purpose-scheduler/packages/core/examples/vite-vanilla-repl/dist/assets/index.f17ed672.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body style="margin: 0; background: #222">
|
<body style="margin: 0; background: #222">
|
||||||
<div style="display: grid; height: 100vh">
|
<div style="display: grid; height: 100vh">
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { controls, repl, evalScope } from '@strudel.cycles/core';
|
import { controls, repl, evalScope } from '@strudel.cycles/core';
|
||||||
import { getAudioContext, webaudioOutput } from '@strudel.cycles/webaudio';
|
import { getAudioContext, webaudioOutput } from '@strudel.cycles/webaudio';
|
||||||
import { transpiler } from '@strudel.cycles/transpiler';
|
import { transpiler } from '@strudel.cycles/transpiler';
|
||||||
|
// import shapeshifter from '@strudel.cycles/eval/shapeshifter.mjs';
|
||||||
import tune from './tune.mjs';
|
import tune from './tune.mjs';
|
||||||
|
|
||||||
const ctx = getAudioContext();
|
const ctx = getAudioContext();
|
||||||
@ -19,6 +20,7 @@ const { evaluate } = repl({
|
|||||||
defaultOutput: webaudioOutput,
|
defaultOutput: webaudioOutput,
|
||||||
getTime: () => ctx.currentTime,
|
getTime: () => ctx.currentTime,
|
||||||
transpiler,
|
transpiler,
|
||||||
|
// transpiler: shapeshifter,
|
||||||
});
|
});
|
||||||
document.getElementById('start').addEventListener('click', () => {
|
document.getElementById('start').addEventListener('click', () => {
|
||||||
ctx.resume();
|
ctx.resume();
|
||||||
|
|||||||
@ -5,7 +5,8 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build --base /tidalcycles/strudel/general-purpose-scheduler/packages/core/examples/vite-vanilla-repl/dist/",
|
"build-githack": "vite build --base /tidalcycles/strudel/general-purpose-scheduler/packages/core/examples/vite-vanilla-repl/dist/",
|
||||||
|
"build": "vite build",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -9,6 +9,7 @@ export function transpiler(input, options = {}) {
|
|||||||
let ast = parse(input, {
|
let ast = parse(input, {
|
||||||
ecmaVersion: 2022,
|
ecmaVersion: 2022,
|
||||||
allowAwaitOutsideFunction: true,
|
allowAwaitOutsideFunction: true,
|
||||||
|
// locations: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
walk(ast, {
|
walk(ast, {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user