create-grafana-plugin 0.2.6

CLI tool to scaffold production-ready Grafana plugin projects
Documentation
{
  "name": "{{ plugin_id }}",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "packageManager": "bun@1.3.11",
  "scripts": {
{%- if has_wasm %}
    "setup": "rustup target add wasm32-unknown-unknown && cargo install wasm-pack cargo-watch && bun install && bun run build:wasm",
    "dev": "bun run build:wasm && rspack build --watch & (cd {{ crate_name }} && cargo watch --postpone -w src -s 'wasm-pack build --target web') & wait",
{%- else %}
    "dev": "rspack build --watch",
{%- endif %}
    "dev:ts": "rspack build --watch",
{%- if has_wasm %}
    "dev:rust": "cd {{ crate_name }} && cargo watch -w src -s 'wasm-pack build --target web'",
    "build": "bun run build:wasm && bun run build:ts",
{%- else %}
    "build": "bun run build:ts",
{%- endif %}
    "build:ts": "bun scripts/clean-plugin-dist.ts && rspack build",
{%- if has_wasm %}
    "build:wasm": "cd {{ crate_name }} && wasm-pack build --target web",
    "test": "bun run test:ts && bun run test:rust",
{%- else %}
    "test": "bun run test:ts",
{%- endif %}
    "test:ts": "bun test",
    "test:watch": "bun test --watch",
{%- if has_wasm %}
    "test:coverage": "bun test --coverage && cargo test --workspace",
    "test:rust": "cargo test --workspace",
    "lint": "bun run lint:ts && bun run lint:rust",
{%- else %}
    "test:coverage": "bun test --coverage",
    "lint": "bun run lint:ts",
{%- endif %}
    "lint:ts": "biome check src/ tests/ scripts/",
{%- if has_wasm %}
    "lint:rust": "cargo clippy --workspace -- -D warnings && cargo fmt --all -- --check",
    "lint:fix": "bun run lint:fix:ts && bun run lint:fix:rust",
{%- else %}
    "lint:fix": "bun run lint:fix:ts",
{%- endif %}
    "lint:fix:ts": "biome check --write --unsafe src/ tests/ scripts/",
{%- if has_wasm %}
    "lint:fix:rust": "cargo fmt --all && cargo clippy --workspace --fix --allow-dirty -- -D warnings",
    "format": "bun run format:ts && bun run format:rust",
{%- else %}
    "format": "bun run format:ts",
{%- endif %}
    "format:ts": "biome format --write src/ tests/ scripts/",
{%- if has_wasm %}
    "format:rust": "cargo fmt --all",
    "format:check": "bun run format:check:ts && bun run format:check:rust",
{%- else %}
    "format:check": "bun run format:check:ts",
{%- endif %}
    "format:check:ts": "biome format src/ tests/ scripts/",
{%- if has_wasm %}
    "format:check:rust": "cargo fmt --all -- --check",
{%- endif %}
    "package": "bun run build && VER=$(grep -m1 '\"version\"' package.json | cut -d'\"' -f4) && rm -f dist/{{ plugin_id }}*.tar.gz && cd dist && tar czf {{ plugin_id }}-$VER.tar.gz {{ plugin_id }}/",
    "dev:reload": "bun run build && docker compose up -d grafana --force-recreate",
    "verify": "bun run lint && bun run test && bun run build",
    "bump": "bun scripts/bump-version.ts",
    "bump:patch": "bun scripts/bump-version.ts patch",
    "bump:minor": "bun scripts/bump-version.ts minor",
    "bump:major": "bun scripts/bump-version.ts major"
  },
  "dependencies": {
    "@grafana/data": "^12.0.0",
    "@grafana/runtime": "^12.0.0",
    "@grafana/ui": "^12.0.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@biomejs/biome": "^2.4.9",
    "@happy-dom/global-registrator": "^20.8.9",
    "@rspack/cli": "^1.7.10",
    "@rspack/core": "^1.7.10",
    "@types/react": "^18.2.0",
    "@types/react-dom": "^18.2.0",
    "bun-types": "^1.3.11",
    "typescript": "^5.3.0"
  }
}