Skip to content
Draft
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
20 changes: 16 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
- name: checkout
uses: actions/checkout@v7
- uses: perses/github-actions@v0.13.0
- uses: pnpm/setup@v2.1.0
with:
install: false
cache: true
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_npm: true
Expand All @@ -35,7 +39,7 @@ jobs:
restore-keys: |
${{ runner.os }}-cue-
- name: install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: build plugin
if: github.event_name == 'release'
run: go run ./scripts/build-plugins/build-plugins.go --tag=${{ github.event.release.tag_name }}
Expand Down Expand Up @@ -74,17 +78,21 @@ jobs:
with:
compose-file: .github/dev/docker-compose.ci.yml
- uses: perses/github-actions@v0.13.0
- uses: pnpm/setup@v2.1.0
with:
install: false
cache: true
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_npm: true
nvmrc_path: '.nvmrc'
- name: install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: install Playwright browsers
run: npx playwright install --with-deps
run: pnpm exec playwright install --with-deps
working-directory: e2e
- name: run e2e tests
run: npm run test:ci --prefix e2e -- src/tests
run: pnpm --dir e2e test:ci -- src/tests

release:
name: 'release'
Expand All @@ -100,6 +108,10 @@ jobs:
- name: checkout
uses: actions/checkout@v7
- uses: perses/github-actions@v0.13.0
- uses: pnpm/setup@v2.1.0
with:
install: false
cache: true
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_npm: true
Expand Down
34 changes: 23 additions & 11 deletions .github/workflows/react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,39 @@ on:
merge_group:

jobs:
lint-npm:
name: 'lint-npm'
lint-pnpm:
name: 'lint-pnpm'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v7
- uses: perses/github-actions@v0.13.0
- uses: pnpm/setup@v2.1.0
with:
install: false
cache: true
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_npm: true
- run: npm ci
- run: npm run lint
- run: npm run format:check
test-npm:
name: 'test-npm'
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm format:check
test-pnpm:
name: 'test-pnpm'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v7
- uses: perses/github-actions@v0.13.0
- uses: pnpm/setup@v2.1.0
with:
install: false
cache: true
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_npm: true
- run: npm ci
- run: npm run test
- run: pnpm install --frozen-lockfile
- run: pnpm test

type-check:
name: 'type-check'
Expand All @@ -40,8 +48,12 @@ jobs:
- name: checkout
uses: actions/checkout@v7
- uses: perses/github-actions@v0.13.0
- uses: pnpm/setup@v2.1.0
with:
install: false
cache: true
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_npm: true
- run: npm ci
- run: npm run type-check
- run: pnpm install --frozen-lockfile
- run: pnpm type-check
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
node_modules
dist/

# Ignore turborepo cache
.turbo

# IDE
.vscode/*
!.vscode/extensions.json
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v24.19.0
v24.20.0
2 changes: 1 addition & 1 deletion .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"**/*.md",
"**/*.mdx",
"**/mock-query-range.json",
"package-lock.json",
"pnpm-lock.yaml",
".github/perses-ci",
".github/perses-ci/**"
]
Expand Down
20 changes: 10 additions & 10 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Before editing:
- `<plugin>/cue.mod/`: CUE module metadata and dependencies.
- `e2e/`: Playwright coverage for integrated plugin behavior.
- `scripts/` and the root `Makefile`: plugin validation, generation, packaging, schema tests, and documentation checks.
- Upper-case plugin directories, `dist/`, `.turbo/`, `node_modules/`, and `cue.mod/pkg/` are generated or downloaded
- Upper-case plugin directories, `dist/`, `node_modules/`, and `cue.mod/pkg/` are generated or downloaded
outputs. Do not edit or commit them unless a documented release process explicitly requires it.

Reusable UI primitives and plugin APIs belong in `perses/shared`; canonical resource contracts belong in `perses/spec`.
Expand All @@ -41,22 +41,22 @@ Consume their public exports instead of copying their internals or deep-importin

## Validation

Use Go 1.26.x, Node.js from `.nvmrc`, and npm from `package.json`. While iterating, run the affected workspace first:
Use Go 1.26.x, Node.js from `.nvmrc`, and pnpm 12 from `package.json`. While iterating, run the affected workspace first:

```sh
npm ci
npm run lint -w <workspace>
npm run type-check -w <workspace>
npm run test -w <workspace>
pnpm install --frozen-lockfile
pnpm --filter <workspace> lint
pnpm --filter <workspace> type-check
pnpm --filter <workspace> test
```

Before completion of a TypeScript change, run the relevant repository checks:

```sh
npm run lint
npm run format:check
npm run type-check
npm run test
pnpm lint
pnpm format:check
pnpm type-check
pnpm test
```

For schema, SDK, or repository-wide changes, select the relevant Make targets:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ This repository contains the core plugins for [Perses](https://github.com/perses
As prerequisites, you need:

- NodeJS [version 24 or greater](https://nodejs.org/).
- npm [version 11 or greater](https://www.npmjs.com/).
- pnpm [version 12](https://pnpm.io/installation).

You should first run `npm install` at the root of the repository.
You should first run `pnpm install` at the root of the repository.

Then in [`perses`](https://github.com/perses/perses) repository:

Expand All @@ -26,23 +26,23 @@ Then in [`perses`](https://github.com/perses/perses) repository:

### Code quality

Run `npm run lint` for the regular Oxlint checks, including the React Doctor rules configured in `.oxlintrc.json`. Run
`npm run doctor` for the full React Doctor project scan. Pull requests and pushes to `main` also run the scan in GitHub
Run `pnpm lint` for the regular Oxlint checks, including the React Doctor rules configured in `.oxlintrc.json`. Run
`pnpm doctor` for the full React Doctor project scan. Pull requests and pushes to `main` also run the scan in GitHub
Actions.

### Working with Snapshots

This will allow you to use the updates from perses core in your plugin so you can test the changes.

1. In perses/shared create a [snapshot](https://github.com/perses/perses/blob/30758a963337564ab58c78646a1134e51d74e146/RELEASE.md?plain=1#L109-L146). Snapshots will be released in npm:
1. In perses/shared create a [snapshot](https://github.com/perses/perses/blob/30758a963337564ab58c78646a1134e51d74e146/RELEASE.md?plain=1#L109-L146). Snapshots will be released to the npm registry:
- https://www.npmjs.com/package/@perses-dev/components/
- https://www.npmjs.com/package/@perses-dev/plugin-system
- https://www.npmjs.com/package/@perses-dev/dashboards
- https://www.npmjs.com/package/@perses-dev/explore

2. Copy the name of your snapshot, for example `v0.0.0-snapshot-panel-actions-520389b`.

3. In perses/plugin, navigate to the plugin you are changing and install the snapshot npm packages, this should be installed as "dependencies" NOT "peerDependencies" for example:
3. In perses/plugin, navigate to the plugin you are changing and install the snapshot packages. They should be installed as "dependencies", not "peerDependencies", for example:

```
# perses/plugins/timeserieschart/package.json
Expand All @@ -69,4 +69,4 @@ This will allow you to use the updates from perses core in your plugin so you ca
}
```

4. Then run `npm install` on the plugin folder to update the dependencies of your plugin (e.g., `cd perses/plugins/timeserieschart && npm install`).
4. Then run `pnpm install` on the plugin folder to update the dependencies of your plugin (e.g., `cd perses/plugins/timeserieschart && pnpm install`).
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ To release a new version of one or multiple plugins, you should:

1. Checkout to a new branch
2. Update the version number in its(their) respective `package.json` file(s).
3. Run `npm install` at the root of the repo to propagate this update to the root `package-lock.json`.
3. Run `pnpm install` at the root of the repo to propagate this update to the root `pnpm-lock.yaml`.
4. Commit these changes - as a standalone commit ("Prepare \<plugin\> release vX.Y.Z") or as part of your changes.
5. Push the changes (new version(s)) and create a PR.
6. After the PR is merged, checkout to and update the main.
Expand Down
2 changes: 1 addition & 1 deletion STYLEGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ touch without expanding the task into unrelated cleanup.
queries; use test IDs only as a last resort.
- Use Playwright for critical end-to-end flows or browser behavior that unit/integration tests cannot cover.
- Run a focused test while iterating, then the affected workspace's type-check and test commands.
- Before completion, run repository-level `npm run lint`, `npm run format:check`, and `npm run type-check`.
- Before completion, run repository-level `pnpm lint`, `pnpm format:check`, and `pnpm type-check`.
- Oxfmt owns formatting and import sorting. Do not manually fight its output.
- A lint suppression must be narrow, name the rule, and include a nearby explanation of why the exception is necessary.
Do not enable type-aware linting or change lint configuration unless the task explicitly concerns repository tooling.
10 changes: 5 additions & 5 deletions alertmanager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ This plugin requires react and react-dom 18
Install peer dependencies:

```bash
npm install react@18 react-dom@18
pnpm add react@18 react-dom@18
```

Install the plugin:

```bash
npm install @perses-dev/alert-manager-plugin
pnpm add @perses-dev/alert-manager-plugin
```

## Development
Expand All @@ -23,19 +23,19 @@ npm install @perses-dev/alert-manager-plugin
Install dependencies:

```bash
npm install
pnpm install
```

### Get Started

Start the dev server:

```bash
npm run dev
pnpm dev
```

Build the plugin for distribution:

```bash
npm run build
pnpm build
```
12 changes: 6 additions & 6 deletions alertmanager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"scripts": {
"dev": "rsbuild dev",
"build": "npm run build-mf && concurrently \"npm:build:*\"",
"build": "pnpm build-mf && concurrently \"pnpm build:esm\" \"pnpm build:types\"",
"build-mf": "rsbuild build",
"build:esm": "swc ./src -d dist/lib --strip-leading-paths --config-file ../.swcrc",
"build:types": "tsc --project tsconfig.build.json",
Expand All @@ -26,16 +26,16 @@
"module": "lib/index.js",
"types": "lib/index.d.ts",
"peerDependencies": {
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@perses-dev/components": "^0.55.0-beta.7",
"@perses-dev/spec": "^0.3.0-beta.5",
"@perses-dev/dashboards": "^0.55.0-beta.7",
"@perses-dev/explore": "^0.55.0-beta.7",
"@perses-dev/plugin-system": "^0.55.0-beta.7",
"@tanstack/react-query": "^4.39.1",
"date-fns": "^4.1.0",
"lodash": "^4.17.21",
"@tanstack/react-query": "^4.44.0",
"date-fns": "^4.2.1",
"lodash": "^4.18.1",
"react": "^18.3.0",
"react-dom": "^18.3.0"
},
Expand Down
10 changes: 5 additions & 5 deletions barchart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ This plugin requires react and react-dom 18
Install peer dependencies:

```bash
npm install react@18 react-dom@18
pnpm add react@18 react-dom@18
```

Install the plugin:

```bash
npm install @perses-dev/bar-chart-plugin
pnpm add @perses-dev/bar-chart-plugin
```

## Development
Expand All @@ -23,19 +23,19 @@ npm install @perses-dev/bar-chart-plugin
Install dependencies:

```bash
npm install
pnpm install
```

### Get Started

Start the dev server:

```bash
npm run dev
pnpm dev
```

Build the plugin for distribution:

```bash
npm run build
pnpm build
```
14 changes: 7 additions & 7 deletions barchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"scripts": {
"dev": "rsbuild dev",
"build": "npm run build-mf && concurrently \"npm:build:*\"",
"build": "pnpm build-mf && concurrently \"pnpm build:esm\" \"pnpm build:types\"",
"build-mf": "rsbuild build",
"build:esm": "swc ./src -d dist/lib --strip-leading-paths --config-file ../.swcrc",
"build:types": "tsc --project tsconfig.build.json",
Expand All @@ -25,20 +25,20 @@
"module": "lib/index.js",
"types": "lib/index.d.ts",
"peerDependencies": {
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@hookform/resolvers": "^3.2.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@hookform/resolvers": "^3.10.0",
"@perses-dev/components": "^0.55.0-beta.7",
"@perses-dev/plugin-system": "^0.55.0-beta.7",
"@perses-dev/spec": "^0.3.0-beta.5",
"date-fns": "^4.1.0",
"date-fns": "^4.2.1",
"date-fns-tz": "^3.2.0",
"echarts": "5.5.0",
"lodash": "^4.17.21",
"lodash": "^4.18.1",
"react": "^18.3.0",
"react-dom": "^18.3.0",
"use-resize-observer": "^9.0.0",
"immer": "^10.1.1"
"immer": "^10.2.0"
},
"files": [
"lib/**/*",
Expand Down
Loading
Loading