From e3df504423b51e29d4b7ca11199cac6641d9f7a0 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Sun, 16 Mar 2025 02:01:16 +0100 Subject: [PATCH] rename uzu to mondo --- packages/{uzu => mondo}/README.md | 8 ++++---- packages/{uzu/uzu.mjs => mondo/mondo.mjs} | 8 ++++---- packages/{uzu => mondo}/package.json | 10 +++++----- .../uzu.test.mjs => mondo/test/mondo.test.mjs} | 10 +++++----- packages/{uzu => mondo}/vite.config.js | 4 ++-- pnpm-lock.yaml | 18 +++++++++--------- 6 files changed, 29 insertions(+), 29 deletions(-) rename packages/{uzu => mondo}/README.md (72%) rename packages/{uzu/uzu.mjs => mondo/mondo.mjs} (98%) rename packages/{uzu => mondo}/package.json (79%) rename packages/{uzu/test/uzu.test.mjs => mondo/test/mondo.test.mjs} (95%) rename packages/{uzu => mondo}/vite.config.js (78%) diff --git a/packages/uzu/README.md b/packages/mondo/README.md similarity index 72% rename from packages/uzu/README.md rename to packages/mondo/README.md index 53eef51f..d7ee20ac 100644 --- a/packages/uzu/README.md +++ b/packages/mondo/README.md @@ -1,4 +1,4 @@ -# uzu +# mondo an experimental parser for an *uzulang*, a custom dsl for patterns that can stand on its own feet. more info: @@ -6,9 +6,9 @@ an experimental parser for an *uzulang*, a custom dsl for patterns that can stan - [uzulang II](https://garten.salat.dev/uzu/uzulang2.html) ```js -import { UzuRunner } from 'uzu' +import { MondoRunner } from 'uzu' -const runner = UzuRunner({ seq, cat, s, crush, speed, '*': fast }); +const runner = MondoRunner({ seq, cat, s, crush, speed, '*': fast }); const pat = runner.run('s [bd hh*2 cp.(crush 4) ] . speed .8') ``` @@ -26,4 +26,4 @@ the above code will create the following call structure: ) ``` -you can pass all available functions to *UzuRunner* as an object. +you can pass all available functions to *MondoRunner* as an object. diff --git a/packages/uzu/uzu.mjs b/packages/mondo/mondo.mjs similarity index 98% rename from packages/uzu/uzu.mjs rename to packages/mondo/mondo.mjs index e79488a5..2037cce7 100644 --- a/packages/uzu/uzu.mjs +++ b/packages/mondo/mondo.mjs @@ -1,11 +1,11 @@ /* -uzu.mjs - +mondo.mjs - Copyright (C) 2022 Strudel contributors - see This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ // evolved from https://garten.salat.dev/lisp/parser.html -export class UzuParser { +export class MondoParser { // these are the tokens we expect token_types = { string: /^"(.*?)"/, @@ -251,9 +251,9 @@ export function printAst(ast, compact = false, lvl = 0) { } // lisp runner -export class UzuRunner { +export class MondoRunner { constructor(lib) { - this.parser = new UzuParser(); + this.parser = new MondoParser(); this.lib = lib; } // a helper to check conditions and throw if they are not met diff --git a/packages/uzu/package.json b/packages/mondo/package.json similarity index 79% rename from packages/uzu/package.json rename to packages/mondo/package.json index 9b59078d..d8a4a0bf 100644 --- a/packages/uzu/package.json +++ b/packages/mondo/package.json @@ -1,11 +1,11 @@ { - "name": "uzu", + "name": "mondo", "version": "1.1.0", - "description": "an uzu notation", - "main": "uzu.mjs", + "description": "a language for functional composition that translates to js", + "main": "mondo.mjs", "type": "module", "publishConfig": { - "main": "dist/uzu.mjs" + "main": "dist/mondo.mjs" }, "scripts": { "test": "vitest run", @@ -29,7 +29,7 @@ "bugs": { "url": "https://github.com/tidalcycles/strudel/issues" }, - "homepage": "https://github.com/tidalcycles/strudel/blob/main/packages/uzu/README.md", + "homepage": "https://github.com/tidalcycles/strudel/blob/main/packages/mondo/README.md", "devDependencies": { "vite": "^6.0.11", "vitest": "^3.0.4" diff --git a/packages/uzu/test/uzu.test.mjs b/packages/mondo/test/mondo.test.mjs similarity index 95% rename from packages/uzu/test/uzu.test.mjs rename to packages/mondo/test/mondo.test.mjs index 33451f0c..6ed2df17 100644 --- a/packages/uzu/test/uzu.test.mjs +++ b/packages/mondo/test/mondo.test.mjs @@ -1,16 +1,16 @@ /* -uzu.test.mjs - +mondo.test.mjs - Copyright (C) 2022 Strudel contributors - see This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ import { describe, expect, it } from 'vitest'; -import { UzuParser, UzuRunner, printAst } from '../uzu.mjs'; +import { MondoParser, MondoRunner, printAst } from '../mondo.mjs'; -const parser = new UzuParser(); +const parser = new MondoParser(); const p = (code) => parser.parse(code); -describe('uzu s-expressions parser', () => { +describe('mondo s-expressions parser', () => { it('should parse an empty string', () => expect(p('')).toEqual({ type: 'list', children: [] })); it('should parse a single item', () => expect(p('a')).toEqual({ type: 'list', children: [{ type: 'plain', value: 'a' }] })); @@ -56,7 +56,7 @@ let desguar = (a) => { return printAst(parser.parse(a), true); }; -describe('uzu sugar', () => { +describe('mondo sugar', () => { it('should desugar []', () => expect(desguar('[a b c]')).toEqual('(seq a b c)')); it('should desugar [] nested', () => expect(desguar('[a [b c] d]')).toEqual('(seq a (seq b c) d)')); it('should desugar <>', () => expect(desguar('')).toEqual('(cat a b c)')); diff --git a/packages/uzu/vite.config.js b/packages/mondo/vite.config.js similarity index 78% rename from packages/uzu/vite.config.js rename to packages/mondo/vite.config.js index e61a69e4..19e53d7f 100644 --- a/packages/uzu/vite.config.js +++ b/packages/mondo/vite.config.js @@ -7,9 +7,9 @@ export default defineConfig({ plugins: [], build: { lib: { - entry: resolve(__dirname, 'uzu.mjs'), + entry: resolve(__dirname, 'mondo.mjs'), formats: ['es'], - fileName: (ext) => ({ es: 'uzu.mjs' })[ext], + fileName: (ext) => ({ es: 'mondo.mjs' })[ext], }, rollupOptions: { // external: [...Object.keys(dependencies)], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbe64f07..264b7440 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -344,6 +344,15 @@ importers: specifier: ^3.0.4 version: 3.0.4(@types/debug@4.1.12)(@types/node@22.10.10)(@vitest/ui@3.0.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(yaml@2.7.0) + packages/mondo: + devDependencies: + vite: + specifier: ^6.0.11 + version: 6.0.11(@types/node@22.10.10)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(yaml@2.7.0) + vitest: + specifier: ^3.0.4 + version: 3.0.4(@types/debug@4.1.12)(@types/node@22.10.10)(@vitest/ui@3.0.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(yaml@2.7.0) + packages/motion: dependencies: '@strudel/core': @@ -540,15 +549,6 @@ importers: specifier: ^3.0.4 version: 3.0.4(@types/debug@4.1.12)(@types/node@22.10.10)(@vitest/ui@3.0.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(yaml@2.7.0) - packages/uzu: - devDependencies: - vite: - specifier: ^6.0.11 - version: 6.0.11(@types/node@22.10.10)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(yaml@2.7.0) - vitest: - specifier: ^3.0.4 - version: 3.0.4(@types/debug@4.1.12)(@types/node@22.10.10)(@vitest/ui@3.0.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(yaml@2.7.0) - packages/web: dependencies: '@strudel/core':