diff --git a/.gitignore b/.gitignore index 926bde277..855d4040c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,13 +11,13 @@ docs/docs/.vitepress/temp/ ui/dist/ build/ dist/ -src/streamsync.egg-info/ +src/writer.egg-info/ *:Zone.Identifier *.DS_Store -src/streamsync/static -src/streamsync/app_templates/* -!src/streamsync/app_templates/.gitkeep -src/streamsync/ui.py +src/writer/static +src/writer/app_templates/* +!src/writer/app_templates/.gitkeep +src/writer/ui.py src/ui/src/stories/** src/ui/components.codegen.json playground/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 840c91fe7..e1a4f6ba5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,17 +1,17 @@ -# Contributing to Streamsync +# Contributing to Writer Framework -Thank you for your interest in contributing to Streamsync. +Thank you for your interest in contributing to Writer Framework. ## Ways to contribute -Beyond contributing to the repository, some ways to contribute to this project include: +Beyond contributing to the repository, some ways to contribute to this project include: -- *Reporting bugs*. Bug reports are relatively easy to write, but have a big impact. Please include the steps required to reproduce the bug. Use "Issues" on GitHub. This is an example of a [wonderful bug report](https://github.com/streamsync-cloud/streamsync/issues/24). -- *Creating content*. Think articles or tutorials. It doesn't have to be overwhelmingly positive; constructive criticism is appreciated. A great example is [this review](https://jreyesr.github.io/posts/streamsync-review/). A YouTube tutorial would be fantastic! -- *Browse Issues and Discussions*. Browse these sections on GitHub and see if you can help. -- *Suggesting valuable enhancements*. If you think of a feature that can have a positive impact, suggest it. Please use the "Discussions" on GitHub. -- *Sponsoring the project*. Helps offset hosting and other expenses. -- *Promoting the project*. Star it, share on LinkedIn or other social media. +- _Reporting bugs_. Bug reports are relatively easy to write, but have a big impact. Please include the steps required to reproduce the bug. Use "Issues" on GitHub. This is an example of a [wonderful bug report](https://github.com/streamsync-cloud/streamsync/issues/24). +- _Creating content_. Think articles or tutorials. It doesn't have to be overwhelmingly positive; constructive criticism is appreciated. A great example is [this review](https://jreyesr.github.io/posts/streamsync-review/). A YouTube tutorial would be fantastic! +- _Browse Issues and Discussions_. Browse these sections on GitHub and see if you can help. +- _Suggesting valuable enhancements_. If you think of a feature that can have a positive impact, suggest it. Please use the "Discussions" on GitHub. +- _Sponsoring the project_. Helps offset hosting and other expenses. +- _Promoting the project_. Star it, share on LinkedIn or other social media. ## Contributing to the repository @@ -23,8 +23,9 @@ Pull requests should be done on the `dev` branch. When the release is finalised, ## Setting up a development environment -Whether you're interested in contributing to the repository, creating a fork, or just improving your understanding of Streamsync, these are the suggested steps for setting up a development environment. +Whether you're interested in contributing to the repository, creating a fork, or just improving your understanding of Writer Framework, these are the suggested steps for setting up a development environment. + - You can install the package in editable mode using `poetry install` - Enable the virtual environment with `poetry shell` - Install all the dev dependencies with `alfred install.dev` -- Run streamsync in port 5000. For example, `streamsync edit apps/hello --port 5000`. +- Run Writer Framework on port 5000. For example, `writer edit apps/hello --port 5000`. diff --git a/README.md b/README.md index 06c9edb6c..b87039c47 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ ## What is Streamsync? [![PyPi](https://img.shields.io/pypi/v/streamsync.svg?label=Version)](https://pypi.org/project/streamsync/) -[![CI](https://github.com/streamsync-cloud/streamsync/actions/workflows/ci.yml/badge.svg)](https://github.com/streamsync-cloud/streamsync/actions/workflows/ci.yml) +[![CI](https://github.com/streamsync-cloud/streamsync/actions/workflows/ci.yml/badge.svg)](https://github.com/streamsync-cloud/streamsync/actions/workflows/ci.yml) [![Discord](https://img.shields.io/badge/discord-streamsync-sn677E3Pd3?logo=discord&logoColor=white)](https://discord.gg/sn677E3Pd3) [![License](https://img.shields.io/pypi/l/streamsync)](LICENSE) -Streamsync is an open-source framework for creating data apps. Build user interfaces using a visual editor; write the backend code in Python. +Writer Framework is an open-source framework for creating data apps. Build user interfaces using a visual editor; write the backend code in Python. -![Streamsync Builder screenshot](https://raw.githubusercontent.com/streamsync-cloud/streamsync/master/docs/docs/public/sc1.png "Streamsync Builder screenshot") +![Writer Framework Builder screenshot](https://raw.githubusercontent.com/streamsync-cloud/streamsync/master/docs/docs/public/sc1.png "Writer Framework Builder screenshot") - [Live demo](https://hello.streamsync.cloud/) of an app. [Source code](https://github.com/streamsync-cloud/streamsync/blob/master/apps/hello/main.py). - [1 minute introduction video](https://youtu.be/XBAPBy_zf8s) on YouTube @@ -20,15 +20,15 @@ It aims to be as simple as Streamlit, but faster, more flexible and with a clean ### Reactive and state-driven -Streamsync is **fully state-driven** and provides **separation of concerns** between user interface and business logic. +Writer Framework is **fully state-driven** and provides **separation of concerns** between user interface and business logic. ```py -import streamsync as ss +import writer as wf def handle_increment(state): state["counter"] += 1 -ss.init_state({ +wf.init_state({ "counter": 0 }) ``` @@ -36,18 +36,21 @@ ss.init_state({ The user interface is a template, which is defined visually. The template contains reactive references to state, e.g. `@{counter}`, and references to event handlers, e.g. when _Button_ is clicked, trigger `handle_increment`. ### Flexible + - Elements are highly customisable with no CSS required, allowing for shadows, button icons, background colours, etc. - HTML elements with custom CSS can be included using the _HTML Element_ component. They can serve as containers for built-in components. ### Fast -- Event handling adds minimal overhead to your Python code (~1-2ms*). + +- Event handling adds minimal overhead to your Python code (~1-2ms\*). - Streaming (WebSockets) is used to synchronise frontend and backend states. - The script only runs once. - Non-blocking by default. Events are handled asynchronously in a thread pool running in a dedicated process. -*End-to-end figure, including DOM mutation. Tested locally on a Macbook Air M2. [Measurement methodology](https://medium.com/@ramiromedina/measuring-time-elapsed-between-an-event-and-its-associated-dom-mutation-80431ad576e1). +\*End-to-end figure, including DOM mutation. Tested locally on a Macbook Air M2. [Measurement methodology](https://medium.com/@ramiromedina/measuring-time-elapsed-between-an-event-and-its-associated-dom-mutation-80431ad576e1). ### Developer-friendly + - It's all contained in a standard Python package, just one `pip install` away. - User interfaces are saved as JSON, so they can be version controlled together with the rest of the application. - Use your local code editor and get instant refreshes when you save your code. Alternatively, use the provided web-based editor. @@ -55,17 +58,17 @@ The user interface is a template, which is defined visually. The template contai ## Installation and Quickstart -Getting started with Streamsync is easy. It works on Linux, Mac and Windows. +Getting started with Writer Framework is easy. It works on Linux, Mac and Windows. ```sh pip install "streamsync[ds]" streamsync hello ``` -- The first command will install Streamsync using `pip` and include the optional data science dependencies. -- The second command will create a demo application in the subfolder "hello" and start Streamsync Builder, the framework's visual editor, which will be accessible via a local URL. +- The first command will install Writer Framework using `pip` and include the optional data science dependencies. +- The second command will create a demo application in the subfolder "hello" and start Writer Framework Builder, the framework's visual editor, which will be accessible via a local URL. -The following commands can be used to create, launch Streamsync Builder and run an application. +The following commands can be used to create, launch Writer Framework Builder and run an application. ```sh streamsync create my_app diff --git a/alfred/build.py b/alfred/build.py index efbba5978..b2d04f076 100644 --- a/alfred/build.py +++ b/alfred/build.py @@ -17,11 +17,10 @@ def build(ignore_ci: bool = False): @alfred.command("build.app_provisionning", help="update app templates using ./apps", hidden=True) def build_app_provisionning(): - if os.path.isdir('src/streamsync/app_templates'): - shutil.rmtree('src/streamsync/app_templates') + if os.path.isdir('src/writer/app_templates'): + shutil.rmtree('src/writer/app_templates') - shutil.copytree( 'apps/default', 'src/streamsync/app_templates/default') - shutil.copytree( 'apps/hello', 'src/streamsync/app_templates/hello') + shutil.copytree( 'apps', 'src/writer/app_templates') @alfred.command("build.poetry", help="build python packages with poetry", hidden=True) def build_poetry(): diff --git a/alfred/ci.py b/alfred/ci.py index a6b06bdf4..87cab2d8d 100644 --- a/alfred/ci.py +++ b/alfred/ci.py @@ -28,9 +28,9 @@ def ci(front, back, e2e, docs): if e2e: alfred.invoke_command("npm.e2e", browser=e2e) -@alfred.command("ci.mypy", help="typing checking with mypy on ./src/streamsync") +@alfred.command("ci.mypy", help="typing checking with mypy on ./src/writer") def ci_mypy(): - alfred.run("mypy ./src/streamsync --exclude app_templates/*") + alfred.run("mypy ./src/writer --exclude app_templates/*") @alfred.command("ci.ruff", help="linting with ruff") def ci_ruff(): diff --git a/alfred/publish.py b/alfred/publish.py index cdd912f52..9dcf70d9e 100644 --- a/alfred/publish.py +++ b/alfred/publish.py @@ -22,8 +22,8 @@ def publish(): >>> $ alfred publish """ - import streamsync - VERSION = f"v{streamsync.VERSION}" + import writer + VERSION = f"v{writer.VERSION}" git = alfred.sh("git", "git should be present") os.chdir(ROOT_DIR) diff --git a/apps/default/main.py b/apps/default/main.py index abfb8734b..9e48fb9c7 100644 --- a/apps/default/main.py +++ b/apps/default/main.py @@ -1,4 +1,4 @@ -import streamsync as ss +import writer as wf # This is a placeholder to get you started or refresh your memory. # Delete it or adapt it as necessary. @@ -28,7 +28,7 @@ def increment(state): # "_my_private_element" won't be serialised or sent to the frontend, # because it starts with an underscore -initial_state = ss.init_state({ +initial_state = wf.init_state({ "my_app": { "title": "MY APP" }, diff --git a/apps/default/ui.json b/apps/default/ui.json index 611a89d89..9e210de40 100644 --- a/apps/default/ui.json +++ b/apps/default/ui.json @@ -1,6 +1,6 @@ { "metadata": { - "streamsync_version": "0.5.0" + "writer_version": "0.5.0" }, "components": { "root": { diff --git a/apps/hello/Dockerfile b/apps/hello/Dockerfile index f63e29a7e..913b5e8c6 100644 --- a/apps/hello/Dockerfile +++ b/apps/hello/Dockerfile @@ -3,7 +3,7 @@ RUN apt-get update -y && mkdir /app && python3 -m venv /app/venv ENV PATH="/app/venv/bin:$PATH" COPY . /app WORKDIR /app -RUN pip3 install 'streamsync[ds]' && pip3 install -r requirements.txt +RUN pip3 install 'writer' && pip3 install -r requirements.txt FROM python:3.10-slim AS run-image RUN apt-get update -y && mkdir /app @@ -11,6 +11,6 @@ COPY --from=compile-image /app /app ENV PATH="/app/venv/bin:$PATH" WORKDIR /app -ENTRYPOINT [ "streamsync", "run" ] +ENTRYPOINT [ "writer", "run" ] EXPOSE 5000 CMD [ ".", "--port", "5000", "--host", "0.0.0.0" ] diff --git a/apps/hello/main.py b/apps/hello/main.py index 5fae9ada3..fb11ecac0 100644 --- a/apps/hello/main.py +++ b/apps/hello/main.py @@ -3,12 +3,12 @@ import numpy as np import pandas as pd import plotly.express as px -import streamsync as ss -from streamsync.core import StreamsyncState +import writer as wf +from writer.core import WriterState # EVENT HANDLERS -def handle_timer_tick(state: StreamsyncState): +def handle_timer_tick(state: WriterState): df = state["random_df"] for i in range(5): df[f'pgcf_{i+1}'] = np.around(np.random.rand(10, 1), decimals=9) @@ -30,7 +30,7 @@ def update(state, session): def handle_story_download(state): - data = ss.pack_file("assets/story.txt", "text/plain") + data = wf.pack_file("assets/story.txt", "text/plain") file_name = "hacker_pigeons.txt" state.file_download(data, file_name) @@ -129,7 +129,7 @@ def _update_scatter_chart(state): # STATE INIT -initial_state = ss.init_state({ +initial_state = wf.init_state({ "main_df": _get_main_df(), "highlighted_members": _get_highlighted_members(), "random_df": _generate_random_df(), diff --git a/apps/hello/ui.json b/apps/hello/ui.json index 7c252a569..42858f31c 100644 --- a/apps/hello/ui.json +++ b/apps/hello/ui.json @@ -1,6 +1,6 @@ { "metadata": { - "streamsync_version": "0.5.0" + "writer_version": "0.5.0" }, "components": { "root": { @@ -170,10 +170,10 @@ "position": 1, "parentId": "7e625201-20c2-4b05-951c-d825de28b216", "handlers": { - "ss-number-change": "update" + "wf-number-change": "update" }, "binding": { - "eventType": "ss-number-change", + "eventType": "wf-number-change", "stateRef": "filter.min_weight" } }, @@ -190,10 +190,10 @@ "position": 0, "parentId": "7e625201-20c2-4b05-951c-d825de28b216", "handlers": { - "ss-number-change": "update" + "wf-number-change": "update" }, "binding": { - "eventType": "ss-number-change", + "eventType": "wf-number-change", "stateRef": "filter.min_length" } }, @@ -363,7 +363,7 @@ "id": "5da5e007-d60a-4313-9d21-885deae7b37d", "type": "text", "content": { - "text": "You can put other Streamsync components inside HTML Elements." + "text": "You can put other Writer Framework components inside HTML Elements." }, "isCodeManaged": false, "position": 1, @@ -413,7 +413,7 @@ "position": 0, "parentId": "09ddb2da-6fa3-4157-8da3-4d5d44a6a58d", "handlers": { - "ss-tick": "handle_timer_tick" + "wf-tick": "handle_timer_tick" } }, "e296866a-75d2-4677-b55d-3c1456113b89": { @@ -475,7 +475,7 @@ "position": 2, "parentId": "b1ee642e-f2e7-453b-a6ef-3d96eea37140", "binding": { - "eventType": "ss-number-change", + "eventType": "wf-number-change", "stateRef": "hue_rotation" } }, @@ -950,7 +950,7 @@ "id": "77cb256b-ef12-4a55-a051-500497f41302", "type": "text", "content": { - "text": "It's easy to switch between pages and it can be done from the frontend (via Streamsync Builder) and from the backend (via Python)." + "text": "It's easy to switch between pages and it can be done from the frontend (via Writer Framework Builder) and from the backend (via Python)." }, "isCodeManaged": false, "position": 2, @@ -1039,8 +1039,8 @@ "position": 1, "parentId": "e1ax8ctt8lrao0e4", "handlers": { - "ss-change-page": "handle_paginated_members_page_change", - "ss-change-page-size": "handle_paginated_members_page_size_change" + "wf-change-page": "handle_paginated_members_page_change", + "wf-change-page-size": "handle_paginated_members_page_size_change" }, "visible": true }, diff --git a/apps/quickstart/main.py b/apps/quickstart/main.py index bbeff594d..c73e9cf1b 100644 --- a/apps/quickstart/main.py +++ b/apps/quickstart/main.py @@ -1,5 +1,5 @@ import plotly.graph_objects as go -import streamsync as ss +import writer as wf from sklearn.datasets import make_blobs from sklearn.linear_model import LogisticRegression @@ -98,7 +98,7 @@ def update(state): state['figure'] = fig -initial_state = ss.init_state({ +initial_state = wf.init_state({ "my_app": { "title": "Logistic regression visualizer" }, diff --git a/apps/quickstart/ui.json b/apps/quickstart/ui.json index 6843cdb3f..efe6ca0b4 100644 --- a/apps/quickstart/ui.json +++ b/apps/quickstart/ui.json @@ -1,6 +1,6 @@ { "metadata": { - "streamsync_version": "0.3.0" + "writer_version": "0.3.0" }, "components": { "root": { @@ -75,10 +75,10 @@ "parentId": "t3zfxwztd4cozu6v", "position": 0, "handlers": { - "ss-number-change": "update" + "wf-number-change": "update" }, "binding": { - "eventType": "ss-number-change", + "eventType": "wf-number-change", "stateRef": "number_of_groups" }, "visible": true @@ -106,10 +106,10 @@ "parentId": "t3zfxwztd4cozu6v", "position": 1, "handlers": { - "ss-number-change": "update" + "wf-number-change": "update" }, "binding": { - "eventType": "ss-number-change", + "eventType": "wf-number-change", "stateRef": "number_of_points" }, "visible": true @@ -136,10 +136,10 @@ "parentId": "t3zfxwztd4cozu6v", "position": 3, "handlers": { - "ss-option-change": "update" + "wf-option-change": "update" }, "binding": { - "eventType": "ss-option-change", + "eventType": "wf-option-change", "stateRef": "multi_class" }, "visible": true @@ -156,10 +156,10 @@ "parentId": "t3zfxwztd4cozu6v", "position": 2, "handlers": { - "ss-number-change": "update" + "wf-number-change": "update" }, "binding": { - "eventType": "ss-number-change", + "eventType": "wf-number-change", "stateRef": "cluster_std" }, "visible": true @@ -173,7 +173,7 @@ "parentId": "t3zfxwztd4cozu6v", "position": 4, "handlers": { - "ss-click": "update" + "wf-click": "update" }, "visible": true }, diff --git a/docs/codegen/generator_components_pages.mjs b/docs/codegen/generator_components_pages.mjs index 1d42cef6d..9f1e3446d 100644 --- a/docs/codegen/generator_components_pages.mjs +++ b/docs/codegen/generator_components_pages.mjs @@ -4,7 +4,7 @@ */ /* eslint-disable @typescript-eslint/no-var-requires */ -import components from "streamsync-ui/components.codegen.json" with { type: "json" }; +import components from "writer-ui/components.codegen.json" with { type: "json" }; import * as fs from "fs"; import * as path from "path"; import { fileURLToPath } from "url"; diff --git a/docs/docs/components/component-list.md b/docs/docs/components/component-list.md index 5b78e7052..81674ca3b 100644 --- a/docs/docs/components/component-list.md +++ b/docs/docs/components/component-list.md @@ -3,7 +3,7 @@ outline: [2, 2] --- diff --git a/docs/docs/core.ts b/docs/docs/core.ts index 9e8bca173..23c1e6e55 100644 --- a/docs/docs/core.ts +++ b/docs/docs/core.ts @@ -1,7 +1,7 @@ import hljs from 'highlight.js/lib/core'; import python from 'highlight.js/lib/languages/python'; import { marked } from 'marked'; -import components from "streamsync-ui/components.codegen.json" assert { type: "json" }; +import components from "writer-ui/components.codegen.json" assert { type: "json" }; // @ts-ignore hljs.registerLanguage('python', python); diff --git a/docs/package.json b/docs/package.json index ef1d13bca..785c83b09 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,5 +1,5 @@ { - "name": "streamsync-docs", + "name": "writer-docs", "version": "0.2.4", "description": "", "main": "index.js", @@ -15,7 +15,7 @@ "highlight.js": "^11.9.0", "marked": "^12.0.1", "monaco-editor": "^0.47.0", - "streamsync-ui": "*", + "writer-ui": "*", "vite-plugin-monaco-editor": "^1.1.0", "vitepress": "^1.0.2", "vue": "^3.4.21" diff --git a/docs/tests/componentImages.spec.js b/docs/tests/componentImages.spec.js index 4156f2d2d..902850bad 100644 --- a/docs/tests/componentImages.spec.js +++ b/docs/tests/componentImages.spec.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const components = require('streamsync-ui/components.codegen.json'); +const components = require('writer-ui/components.codegen.json'); describe('Components docs', () => { for (const component of components) { diff --git a/package-lock.json b/package-lock.json index f700ffc9f..d25a14a51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "Streamsync", + "name": "writer", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "Streamsync", + "name": "writer", "version": "1.0.0", "workspaces": [ "src/ui", @@ -18,16 +18,16 @@ } }, "docs": { - "name": "streamsync-docs", + "name": "writer-docs", "version": "0.2.4", "dependencies": { "highlight.js": "^11.9.0", "marked": "^12.0.1", "monaco-editor": "^0.47.0", - "streamsync-ui": "*", "vite-plugin-monaco-editor": "^1.1.0", "vitepress": "^1.0.2", - "vue": "^3.4.21" + "vue": "^3.4.21", + "writer-ui": "*" }, "devDependencies": { "jest": "29.7.0" @@ -15624,18 +15624,6 @@ "dev": true, "license": "MIT" }, - "node_modules/streamsync-docs": { - "resolved": "docs", - "link": true - }, - "node_modules/streamsync-e2e": { - "resolved": "tests/e2e", - "link": true - }, - "node_modules/streamsync-ui": { - "resolved": "src/ui", - "link": true - }, "node_modules/string_decoder": { "version": "1.3.0", "devOptional": true, @@ -17575,6 +17563,18 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/writer-docs": { + "resolved": "docs", + "link": true + }, + "node_modules/writer-e2e": { + "resolved": "tests/e2e", + "link": true + }, + "node_modules/writer-ui": { + "resolved": "src/ui", + "link": true + }, "node_modules/ws": { "version": "8.16.0", "dev": true, @@ -17657,7 +17657,7 @@ } }, "src/ui": { - "name": "streamsync-ui", + "name": "writer-ui", "version": "0.0.0", "dependencies": { "@apache-arrow/ts": "^15.0.2", @@ -17705,12 +17705,12 @@ } }, "tests/e2e": { - "name": "streamsync-e2e", + "name": "writer-e2e", "version": "1.0.0", "dependencies": { "express": "4.19.2", "http-proxy": "1.18.1", - "streamsync-ui": "*" + "writer-ui": "*" }, "devDependencies": { "@playwright/test": "1.42.1", diff --git a/package.json b/package.json index 25b82282a..7925299d4 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "Streamsync", + "name": "writer", "version": "1.0.0", "description": "", "workspaces": [ @@ -15,38 +15,38 @@ "build": "npm run ui:build && npm run apps:build && npm run ui:codegen && npm run docs:codegen && npm run docs:build", "test": "npm run --if-present -ws test", "lint": "npm run --if-present -ws lint", - "dev": "npm run -w streamsync-ui dev", - "storybook": "npm run -w streamsync-ui storybook", - "storybook.build": "npm run -w streamsync-ui storybook.build", - "custom.dev": "npm run -w streamsync-ui dev", + "dev": "npm run -w writer-ui dev", + "storybook": "npm run -w writer-ui storybook", + "storybook.build": "npm run -w writer-ui storybook.build", + "custom.dev": "npm run -w writer-ui dev", "cli:test": "pytest tests -o log_cli=true ", - "cli:lint": "mypy ./src/streamsync --exclude app_templates/* && ruff check", + "cli:lint": "mypy ./src/writer --exclude app_templates/* && ruff check", "cli:build": "npm run ui:codegen", - "ui:codegen": "npm run -w streamsync-ui codegen", - "ui:dev": "npm run -w streamsync-ui dev", - "ui:build": "npm run -w streamsync-ui build", - "ui:preview": "npm run -w streamsync-ui preview", - "ui:custom.build": "npm run -w streamsync-ui custom.build", - "ui:lint": "npm run -w streamsync-ui lint", - "ui:lint:ci": "npm run -w streamsync-ui lint:ci", + "ui:codegen": "npm run -w writer-ui codegen", + "ui:dev": "npm run -w writer-ui dev", + "ui:build": "npm run -w writer-ui build", + "ui:preview": "npm run -w writer-ui preview", + "ui:custom.build": "npm run -w writer-ui custom.build", + "ui:lint": "npm run -w writer-ui lint", + "ui:lint:ci": "npm run -w writer-ui lint:ci", - "docs:codegen": "npm run -w streamsync-docs codegen", - "docs:dev": "npm run -w streamsync-docs dev", - "docs:build": "npm run -w streamsync-docs build", - "docs:preview": "npm run -w streamsync-docs preview", - "docs:test": "npm run -w streamsync-docs test", + "docs:codegen": "npm run -w writer-docs codegen", + "docs:dev": "npm run -w writer-docs dev", + "docs:build": "npm run -w writer-docs build", + "docs:preview": "npm run -w writer-docs preview", + "docs:test": "npm run -w writer-docs test", - "e2e": "npm run -w streamsync-e2e e2e", - "e2e:setup": "npm run -w streamsync-e2e e2e:setup", - "e2e:ui": "npm run -w streamsync-e2e e2e:ui", - "e2e:ci": "npm run -w streamsync-e2e e2e:ci", - "e2e:firefox": "npm run -w streamsync-e2e e2e:firefox", - "e2e:chromium": "npm run -w streamsync-e2e e2e:chromium", - "e2e:webkit": "npm run -w streamsync-e2e e2e:webkit", + "e2e": "npm run -w writer-e2e e2e", + "e2e:setup": "npm run -w writer-e2e e2e:setup", + "e2e:ui": "npm run -w writer-e2e e2e:ui", + "e2e:ci": "npm run -w writer-e2e e2e:ci", + "e2e:firefox": "npm run -w writer-e2e e2e:firefox", + "e2e:chromium": "npm run -w writer-e2e e2e:chromium", + "e2e:webkit": "npm run -w writer-e2e e2e:webkit", - "apps:build": "cp -R ./apps/hello ./src/streamsync/app_templates/ && cp -R ./apps/default ./src/streamsync/app_templates/", + "apps:build": "cp -R ./apps/hello ./src/writer/app_templates/ && cp -R ./apps/default ./src/writer/app_templates/", "codegen": "npm run ui:codegen && npm run docs:codegen" } } diff --git a/poetry.lock b/poetry.lock index 07f0a7817..cec3a9586 100644 --- a/poetry.lock +++ b/poetry.lock @@ -923,6 +923,7 @@ optional = false python-versions = ">=3.9" files = [ {file = "pandas-2.2.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:90c6fca2acf139569e74e8781709dccb6fe25940488755716d1d354d6bc58bce"}, + {file = "pandas-2.2.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c7adfc142dac335d8c1e0dcbd37eb8617eac386596eb9e1a1b77791cf2498238"}, {file = "pandas-2.2.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4abfe0be0d7221be4f12552995e58723c7422c80a659da13ca382697de830c08"}, {file = "pandas-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8635c16bf3d99040fdf3ca3db669a7250ddf49c55dc4aa8fe0ae0fa8d6dcc1f0"}, {file = "pandas-2.2.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:40ae1dffb3967a52203105a077415a86044a2bea011b5f321c6aa64b379a3f51"}, @@ -943,6 +944,7 @@ files = [ {file = "pandas-2.2.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:43498c0bdb43d55cb162cdc8c06fac328ccb5d2eabe3cadeb3529ae6f0517c32"}, {file = "pandas-2.2.2-cp312-cp312-win_amd64.whl", hash = "sha256:d187d355ecec3629624fccb01d104da7d7f391db0311145817525281e2804d23"}, {file = "pandas-2.2.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0ca6377b8fca51815f382bd0b697a0814c8bda55115678cbc94c30aacbb6eff2"}, + {file = "pandas-2.2.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9057e6aa78a584bc93a13f0a9bf7e753a5e9770a30b4d758b8d5f2a62a9433cd"}, {file = "pandas-2.2.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:001910ad31abc7bf06f49dcc903755d2f7f3a9186c0c040b827e522e9cef0863"}, {file = "pandas-2.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:66b479b0bd07204e37583c191535505410daa8df638fd8e75ae1b383851fe921"}, {file = "pandas-2.2.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a77e9d1c386196879aa5eb712e77461aaee433e54c68cf253053a73b7e49c33a"}, @@ -2152,13 +2154,13 @@ files = [ [[package]] name = "writer-sdk" -version = "0.1.0a1" +version = "0.1.0a2" description = "The official Python library for the writer API" optional = false python-versions = ">=3.7" files = [ - {file = "writer_sdk-0.1.0a1-py3-none-any.whl", hash = "sha256:bba646d3eff598a08f756537bb45ad5b1d2e2deb36b719b1d9141fc186e9478e"}, - {file = "writer_sdk-0.1.0a1.tar.gz", hash = "sha256:a1a12dede41817016192e83bae674254b00de0c7fef853f722baaaf29dc12649"}, + {file = "writer_sdk-0.1.0a2-py3-none-any.whl", hash = "sha256:ffbfcc51aa03b36445e19e4d59632cb2f286eb812517aa5cc485b6639279c410"}, + {file = "writer_sdk-0.1.0a2.tar.gz", hash = "sha256:2ee574325c561f8fe02633d208d176571e258786626dae2bdb0cb2df1fe48793"}, ] [package.dependencies] @@ -2169,10 +2171,7 @@ pydantic = ">=1.9.0,<3" sniffio = "*" typing-extensions = ">=4.7,<5" -[extras] -ds = ["pandas", "plotly", "pyarrow"] - [metadata] lock-version = "2.0" python-versions = ">=3.9.2, <4.0" -content-hash = "14d24fe303bef4e05f04602ee213ecc2bb533e72915ec481d39b11fe06398f4e" +content-hash = "b98581abdb0e0272d272ae876ae13efa28878ef7f03a4cdc57f7bf8d70eca1d3" diff --git a/pyproject.toml b/pyproject.toml index d19ced263..c25878303 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,13 +3,12 @@ requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.poetry] -name = "streamsync" -version = "0.6.0rc2" -description = "Streamsync helps you create performant data apps, via Python code and its built-in visual UI editor." -authors = ["Ramiro Medina "] -license = "Apache 2.0" +name = "writer" +version = "0.6.0rc3" +description = "Writer Framework helps you create performant data apps, via Python code and its built-in visual UI editor." +authors = ["Writer, Inc. "] readme = "README.md" -homepage = "https://www.streamsync.cloud" +homepage = "https://www.writer.com" repository = "https://www.github.com/streamsync-cloud/streamsync" documentation = "https://www.streamsync.cloud/getting-started.html" keywords = ["data apps", "gui", "ui"] @@ -21,13 +20,13 @@ classifiers = [ "Development Status :: 4 - Beta" ] packages = [ - { include = "streamsync", from = "src" } + { include = "writer", from = "src" } ] include = [ - "src/streamsync/*.py", - "src/streamsync/static/**/*", - "src/streamsync/templates/**/*", - "src/streamsync/app_templates/**/*" + "src/writer/*.py", + "src/writer/static/**/*", + "src/writer/templates/**/*", + "src/writer/app_templates/**/*" ] [tool.poetry.dependencies] @@ -37,10 +36,10 @@ fastapi = ">= 0.89.1, < 1" websockets = ">= 12, < 13" uvicorn = ">= 0.20.0, < 1" watchdog = ">= 3.0.0, < 4" -writer-sdk = "0.1.0a1" -pandas = {version = ">= 2.2.0, < 3", optional = true} -pyarrow = {version = ">= 15.0.0, < 16.0.0",optional = true} -plotly = {version = ">= 5.18.0, < 6", optional = true} +writer-sdk = "0.1.0a2" +pandas = ">= 2.2.0, < 3" +pyarrow = ">= 15.0.0, < 16.0.0" +plotly = ">= 5.18.0, < 6" authlib = "^1.3.0" requests = "^2.31.0" jinja2 = "^3.1.4" @@ -63,17 +62,14 @@ alfred-cli = "^2.2.7" polars = "^0.20.15" ruff = "^0.3.4" -[tool.poetry.extras] -ds = ["pandas", "pyarrow", "plotly"] - [tool.poetry.scripts] -streamsync = 'streamsync.command_line:main' +writer = 'writer.command_line:main' [tool.ruff] exclude = [ "src/ui", - "src/streamsync/ui.py", + "src/writer/ui.py", "docs", "tests/e2e", ".git", diff --git a/src/ui/package.json b/src/ui/package.json index 49918dc4a..04cf954d5 100644 --- a/src/ui/package.json +++ b/src/ui/package.json @@ -1,5 +1,5 @@ { - "name": "streamsync-ui", + "name": "writer-ui", "version": "0.0.0", "type": "module", "scripts": { diff --git a/src/ui/src/ambientTypes.ts b/src/ui/src/ambientTypes.ts index 12449a20a..f5f09f230 100644 --- a/src/ui/src/ambientTypes.ts +++ b/src/ui/src/ambientTypes.ts @@ -1,9 +1,9 @@ -import { StreamsyncComponentDefinition } from "./streamsyncTypes"; +import { WriterComponentDefinition } from "./writerTypes"; declare module "marked"; declare module "vue" { interface ComponentCustomOptions { - streamsync?: StreamsyncComponentDefinition; + writer?: WriterComponentDefinition; } } diff --git a/src/ui/src/builder/BuilderApp.vue b/src/ui/src/builder/BuilderApp.vue index 68bc65da7..4d6fb34c8 100644 --- a/src/ui/src/builder/BuilderApp.vue +++ b/src/ui/src/builder/BuilderApp.vue @@ -79,7 +79,7 @@ :prevent-settings-bar-overlap="true" :instance-path="selectedInstancePath" :vertical-offset-pixels="-48" - data-streamsync-cage + data-writer-cage @dragstart="handleRendererDragStart" @dragend="handleRendererDragEnd" > @@ -106,8 +106,8 @@ > {{ - ss.getComponentDefinition( - ss.getComponentById(candidateId).type, + wf.getComponentDefinition( + wf.getComponentById(candidateId).type, ).name }} @@ -136,7 +136,7 @@ import BuilderInsertionOverlay from "./BuilderInsertionOverlay.vue"; import BuilderInsertionLabel from "./BuilderInsertionLabel.vue"; import { isPlatformMac } from "../core/detectPlatform"; -const ss = inject(injectionKeys.core); +const wf = inject(injectionKeys.core); const ssbm = inject(injectionKeys.builderManager); const { @@ -146,7 +146,7 @@ const { dropComponent, assignInsertionCandidacy, removeInsertionCandidacy, -} = useDragDropComponent(ss); +} = useDragDropComponent(wf); const { createAndInsertComponent, undo, @@ -164,7 +164,7 @@ const { copyComponent, removeComponentSubtree, goToParent, -} = useComponentActions(ss, ssbm); +} = useComponentActions(wf, ssbm); const builderMode = computed(() => ssbm.getMode()); @@ -254,11 +254,11 @@ function handleRendererClick(ev: PointerEvent): void { if (builderMode.value === "preview") return; const targetEl: HTMLElement = (ev.target as HTMLElement).closest( - "[data-streamsync-id]", + "[data-writer-id]", ); if (!targetEl) return; - const targetId = targetEl.dataset.streamsyncId; - const targetInstancePath = targetEl.dataset.streamsyncInstancePath; + const targetId = targetEl.dataset.writerId; + const targetInstancePath = targetEl.dataset.writerInstancePath; if (targetId !== ssbm.getSelectedId()) { ev.preventDefault(); ev.stopPropagation(); @@ -270,14 +270,14 @@ const handleRendererDragStart = (ev: DragEvent) => { if (builderMode.value === "preview") return; const targetEl: HTMLElement = (ev.target as HTMLElement).closest( - "[data-streamsync-id]", + "[data-writer-id]", ); - const componentId = targetEl.dataset.streamsyncId; - const { type } = ss.getComponentById(componentId); + const componentId = targetEl.dataset.writerId; + const { type } = wf.getComponentById(componentId); ev.dataTransfer.setData( - `application/json;streamsync=${type},${componentId}`, + `application/json;writer=${type},${componentId}`, "{}", ); }; diff --git a/src/ui/src/builder/BuilderComponentShortcuts.vue b/src/ui/src/builder/BuilderComponentShortcuts.vue index 5aff4a7ae..29b72c2fb 100644 --- a/src/ui/src/builder/BuilderComponentShortcuts.vue +++ b/src/ui/src/builder/BuilderComponentShortcuts.vue @@ -3,7 +3,7 @@ v-if="shortcutsInfo" :draggable="shortcutsInfo?.isDraggable" class="BuilderComponentShortcuts" - :data-streamsync-id="componentId" + :data-writer-id="componentId" >
{{ shortcutsInfo?.componentTypeName }} @@ -149,11 +149,11 @@ diff --git a/src/ui/src/builder/BuilderFieldsPadding.vue b/src/ui/src/builder/BuilderFieldsPadding.vue index 81293575a..53b2967a5 100644 --- a/src/ui/src/builder/BuilderFieldsPadding.vue +++ b/src/ui/src/builder/BuilderFieldsPadding.vue @@ -135,16 +135,16 @@ import { ref, toRefs, } from "vue"; -import { Component } from "../streamsyncTypes"; +import { Component } from "../writerTypes"; import { useComponentActions } from "./useComponentActions"; import injectionKeys from "../injectionKeys"; import BuilderSelect from "./BuilderSelect.vue"; import { languages } from "monaco-editor"; import css = languages.css; -const ss = inject(injectionKeys.core); +const wf = inject(injectionKeys.core); const ssbm = inject(injectionKeys.builderManager); -const { setContentValue } = useComponentActions(ss, ssbm); +const { setContentValue } = useComponentActions(wf, ssbm); const rootEl: Ref = ref(null); const pickerEl: Ref = ref(null); @@ -209,7 +209,7 @@ const props = defineProps<{ }>(); const { componentId, fieldKey } = toRefs(props); -const component = computed(() => ss.getComponentById(componentId.value)); +const component = computed(() => wf.getComponentById(componentId.value)); const selectOptions = computed(() => { return subModes.map((m) => { diff --git a/src/ui/src/builder/BuilderFieldsShadow.vue b/src/ui/src/builder/BuilderFieldsShadow.vue index 4ccadd0d1..6a38a2c58 100644 --- a/src/ui/src/builder/BuilderFieldsShadow.vue +++ b/src/ui/src/builder/BuilderFieldsShadow.vue @@ -135,13 +135,13 @@ import { ref, toRefs, } from "vue"; -import { Component } from "../streamsyncTypes"; +import { Component } from "../writerTypes"; import { useComponentActions } from "./useComponentActions"; import injectionKeys from "../injectionKeys"; -const ss = inject(injectionKeys.core); +const wf = inject(injectionKeys.core); const ssbm = inject(injectionKeys.builderManager); -const { setContentValue } = useComponentActions(ss, ssbm); +const { setContentValue } = useComponentActions(wf, ssbm); const rootEl: Ref = ref(null); const freehandInputEl: Ref = ref(null); @@ -164,7 +164,7 @@ const props = defineProps<{ fieldKey: string; }>(); const { componentId, fieldKey } = toRefs(props); -const component = computed(() => ss.getComponentById(componentId.value)); +const component = computed(() => wf.getComponentById(componentId.value)); const boxShadowRegex = /^(?[0-9]+)px (?[0-9]+)px (?[0-9]+)px (?[0-9-]+)px (?#[A-Fa-f0-9]{6})$/; diff --git a/src/ui/src/builder/BuilderFieldsText.vue b/src/ui/src/builder/BuilderFieldsText.vue index 951309495..d7a96493b 100644 --- a/src/ui/src/builder/BuilderFieldsText.vue +++ b/src/ui/src/builder/BuilderFieldsText.vue @@ -56,23 +56,23 @@ diff --git a/src/ui/src/core_components/other/CoreReuse.vue b/src/ui/src/core_components/other/CoreReuse.vue index a710dc5ec..46ac9e571 100644 --- a/src/ui/src/core_components/other/CoreReuse.vue +++ b/src/ui/src/core_components/other/CoreReuse.vue @@ -3,12 +3,12 @@