From 139124de7296c15ddc5062b9ce348166ec831428 Mon Sep 17 00:00:00 2001 From: Bairui Su Date: Mon, 30 Sep 2024 13:36:25 -0400 Subject: [PATCH] Change namespace to cm (#141) --- README.md | 4 ++-- index.html | 6 +++--- rollup.config.js | 6 +++--- src/{render.js => cell.js} | 2 +- src/index.js | 2 +- test/index.html | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) rename src/{render.js => cell.js} (84%) diff --git a/README.md b/README.md index 6e0409f..89e95e0 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,12 @@ function Star(ctx) { for (let t = 0; t <= Math.PI * 2; t += Math.PI / 120) { const x = ctx.cols() / 2 + 12 * Math.cos(t) * Math.cos(t * 3); const y = ctx.rows() / 2 + 12 * Math.sin(t) * Math.cos(t * 3); - ctx.stroke(Cell.wide("🌟")); + ctx.stroke(cm.wide("🌟")); ctx.point(x, y); } }, }; } -document.body.append(await Cell.render(Star)); +document.body.append(await cm.cell(Star)); ``` diff --git a/index.html b/index.html index 351d25f..6f9bc39 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Preview - + diff --git a/rollup.config.js b/rollup.config.js index ba15a23..462229d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -6,7 +6,7 @@ const umd = { input: "src/index.js", output: { format: "umd", - name: "Cell", + name: "cm", }, plugins: [wasm({targetEnv: "auto-inline"}), node()], }; @@ -26,14 +26,14 @@ export default [ ...umd, output: { ...umd.output, - file: "dist/cell.umd.js", + file: "dist/charming-cell.umd.js", }, }, { ...umd, output: { ...umd.output, - file: "dist/cell.umd.min.js", + file: "dist/charming-cell.umd.min.js", }, plugins: [...umd.plugins, terser()], }, diff --git a/src/render.js b/src/cell.js similarity index 84% rename from src/render.js rename to src/cell.js index 6b68035..bd21193 100644 --- a/src/render.js +++ b/src/cell.js @@ -1,6 +1,6 @@ import {Context} from "./context/index.js"; -export async function render(App) { +export async function cell(App) { const ctx = new Context(); const {setup, ...options} = App(ctx); await ctx.init(options); diff --git a/src/index.js b/src/index.js index f7774c9..b68d092 100644 --- a/src/index.js +++ b/src/index.js @@ -1,2 +1,2 @@ -export {render} from "./render.js"; +export {cell} from "./cell.js"; export {wide} from "./wide.js"; diff --git a/test/index.html b/test/index.html index c8c0797..cd5fc8b 100644 --- a/test/index.html +++ b/test/index.html @@ -3,7 +3,7 @@