Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mirrow",
"version": "0.2.0",
"version": "0.2.2",
"description": "Mirrow CLI interface for generating SVGs",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -11,10 +11,11 @@
"build": "bun build src/index.ts --outdir dist --target node"
},
"files": [
"dist"
"dist",
"README.md"
],
"dependencies": {
"@mirrowjs/core": "^0.1.9",
"@mirrowjs/core": "^0.2.0",
"chokidar": "^4.0.3",
"commander": "^14.0.1"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import { fileURLToPath } from 'url';
import type { CliOptions } from "./runner.js";

const __dirname = dirname(fileURLToPath(import.meta.url));

const cliPkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
const corePkg = JSON.parse(readFileSync(join(__dirname, '../../core/package.json'), 'utf-8'));

import corePackage from "@mirrowjs/core/package.json" with { type: "json" };
const corePkg = corePackage;

function parseDepth(raw: string): number | typeof Infinity {
if (raw === "unbound") {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import process from "node:process";

import { runCli, } from "./cli.js";
import { runCli } from "./cli.js";

runCli(process.argv).catch((error: unknown) => {
if (error instanceof Error) {
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { promises as fs } from "node:fs";
import os from "node:os";
import path from "node:path";

import type * as Chokidar from "chokidar";
import * as chokidar from "chokidar";
import { compile } from "@mirrowjs/core";

Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mirrowjs/core",
"version": "0.2.0",
"version": "0.2.1",
"description": "Core compiler and parser for the Mirrow DSL",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
46 changes: 0 additions & 46 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,49 +32,3 @@ process.on("uncaughtException", (err) => {
console.error(err.message);
process.exit(1);
});

function runExample(): void {
const code = `
svg {
// Internal coordinate space: viewBox x y w h
box: (0, 0, 200, 200)

// Rendered size on the page
size: (200px, 200px)

// How to map box to size
preserve: (xMidYMid, meet)

circle {
id: "pulse"
at: (100, 100)
r: 40
fill: "hotpink"

animate {
prop: "r"
from: 40px
to: 60px
dur: 2s
repeat: indefinite
}
}

@hover, @active {
#pulse {
cy: 150px
r: 60px
}
}
}

`;
console.log(compile(code));
}

if (process.argv[1]) {
const entryUrl = pathToFileURL(process.argv[1]).href;
if (import.meta.url === entryUrl) {
runExample();
}
}