Skip to content

Commit ef212f8

Browse files
committed
chore: merge main
1 parent 724f329 commit ef212f8

File tree

122 files changed

+2662
-580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+2662
-580
lines changed

.cursorrules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.github/copilot-instructions.md

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@ name: Bug Report
33
about: Report a bug to help us improve
44
title: "[Bug]: "
55
labels: bug
6-
assignees:
6+
assignees:
77
---
88

99
**Describe the bug**
1010
A clear and concise description of what the bug is.
1111

1212
**Environment**
13+
1314
- Node version: [e.g. 14.17.0] and package manager
1415
- Browser: [e.g. Chrome, Safari] and version
1516
- React version: [e.g. 19.0.0]
1617
- lightweight-charts-react-components version: [e.g. 1.0.0]
1718

1819
**To Reproduce**
1920
Steps to reproduce the behavior:
21+
2022
1. Go to '...'
2123
2. Click on '...'
2224
3. See error

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Feature Request
33
about: Suggest a new feature or improvement
44
title: "[Feature]: "
55
labels: enhancement
6-
assignees:
6+
assignees:
77
---
88

99
**Is your feature request related to a problem? Please describe.**

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Question
33
about: Ask a question or request information
44
title: "[Question]: "
55
labels: question
6-
assignees:
6+
assignees:
77
---
88

99
**What’s your question?**

.github/actions/check-changelog/action.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Check versions in sync"
2+
description: "Checks that the version in package.json matches the version in other files like jsr.json"
3+
4+
inputs:
5+
PACKAGE_JSON:
6+
description: "Path to the package.json file"
7+
required: true
8+
default: "lib/package.json"
9+
JSR_JSON:
10+
description: "Path to the jsr.json file"
11+
required: true
12+
default: "lib/jsr.json"
13+
VERSION_FILE:
14+
description: "Path to the version.ts file"
15+
required: false
16+
default: "lib/src/version.ts"
17+
18+
runs:
19+
using: "composite"
20+
steps:
21+
- name: Get package.json version
22+
shell: bash
23+
run: |
24+
PKG_VERSION=$(jq -r .version ${{ inputs.PACKAGE_JSON }})
25+
echo "PKG_VERSION=$PKG_VERSION" >> $GITHUB_ENV
26+
27+
- name: Check jsr.json version
28+
shell: bash
29+
run: |
30+
JS_VERSION=$(jq -r .version ${{ inputs.JSR_JSON }})
31+
if [[ "$JS_VERSION" != "$PKG_VERSION" ]]; then
32+
echo "Error: jsr.json version ($JS_VERSION) does not match package.json version ($PKG_VERSION)"
33+
exit 1
34+
fi
35+
echo "jsr.json version ($JS_VERSION) matches package.json version ($PKG_VERSION)."
36+
37+
- name: Check version.ts version
38+
shell: bash
39+
run: |
40+
if [[ -f ${{ inputs.VERSION_FILE }} ]]; then
41+
TS_VERSION=$(grep -oP '(?<=export const version = ")[^"]+' ${{ inputs.VERSION_FILE }})
42+
if [[ "$TS_VERSION" != "$PKG_VERSION" ]]; then
43+
echo "Error: version.ts version ($TS_VERSION) does not match package.json version ($PKG_VERSION)"
44+
exit 1
45+
fi
46+
echo "version.ts version ($TS_VERSION) matches package.json version ($PKG_VERSION)."
47+
else
48+
echo "Warning: ${{ inputs.VERSION_FILE }} does not exist, skipping version check."
49+
fi

.github/actions/create-release/action.yaml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,29 @@ inputs:
1212
runs:
1313
using: "composite"
1414
steps:
15+
- name: Check that was not published on npm
16+
working-directory: lib
17+
run: |
18+
VERSION=$(echo "${{ inputs.tag }}" | sed 's/^v//')
19+
PACKAGE_NAME=$(jq -r .name package.json)
20+
if ! npm view "$PACKAGE_NAME@$VERSION" > /dev/null 2>&1; then
21+
echo "✅ Version $VERSION is not published on npm."
22+
else
23+
echo "❌ ERROR: Version $VERSION already exists on npm! Please use a different version."
24+
exit 1
25+
fi
26+
shell: bash
27+
28+
- name: Check npm publishing (dry run)
29+
working-directory: lib
30+
run: npm publish --dry-run
31+
shell: bash
32+
33+
- name: Check JSR publishing (dry run)
34+
working-directory: lib
35+
run: npx jsr publish --dry-run
36+
shell: bash
37+
1538
- name: Create a new release
1639
uses: softprops/action-gh-release@v2
1740
with:
@@ -24,7 +47,12 @@ runs:
2447
run: echo "//registry.npmjs.org/:_authToken=${{ inputs.npm-token }}" > ~/.npmrc
2548
shell: bash
2649

27-
- name: Publish package
50+
- name: Publish package on npm
2851
working-directory: lib
2952
run: npm publish
3053
shell: bash
54+
55+
- name: Publish package on jsr
56+
working-directory: lib
57+
run: npx jsr publish
58+
shell: bash

.github/actions/test/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ runs:
2323
uses: coverallsapp/github-action@v2
2424
with:
2525
github-token: ${{ inputs.github-token }}
26+
base-path: "lib"

.github/copilot-instructions.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Repository technical context
2+
3+
This is a modern, ESM-only React library that wraps TradingView's Lightweight Charts with idiomatic React components.
4+
The repository contains library code and example usage.
5+
6+
## General Guidelines
7+
8+
- Use React 16.8.0+ and ESM-only syntax.
9+
- All components are functional and use React Hooks only. No class components.
10+
- Follow strict TypeScript typing. Avoid `any` unless absolutely necessary.
11+
- Use named exports for all components and hooks.
12+
- Library files are not placed in the root, but under `lib/` directory.
13+
- The library supports tree-shaking. Ensure exports stay modular and side-effect free.
14+
- Do not include React state or props unrelated to chart rendering.
15+
- lightweight-charts is a peer dependency of the project.
16+
- Only lightweight-charts 5+ version is compatible with this library.
17+
- Library internal hooks should be named with the `use` prefix, e.g., `useChart`, `useSeries`.
18+
19+
## Styling & DOM
20+
21+
- Do not use external CSS. Library does not need any styling.
22+
- Never use className or style props unless the chart component explicitly needs a wrapper div.
23+
24+
## Testing
25+
26+
- Tests use Vitest.
27+
- Mock DOM and chart dependencies where needed.
28+
29+
## Code Style
30+
31+
- Use `tsx` for all component files.
32+
- Keep props interfaces named as `ComponentNameProps`.
33+
- Use `PascalCase` for components and `camelCase` for hooks.
34+
- Write clear JSDoc comments for public components and utilities.
35+
- Use `eslint` and `prettier` for code formatting and linting.
36+
- Implement comprehensive error handling
37+
- Write maintainable, self-documenting code
38+
- Follow security best practices
39+
- Ensure proper type coverage

.github/dependabot.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "monthly"
7-
reviewers:
8-
- "ukorvl"
97
commit-message:
108
prefix: "chore"
119
include: "scope"
@@ -22,3 +20,11 @@ updates:
2220
- "react-dom"
2321
- "@types/react"
2422
- "@types/react-dom"
23+
labels:
24+
- "dependencies"
25+
- package-ecosystem: "github-actions"
26+
directory: "/"
27+
schedule:
28+
interval: "monthly"
29+
labels:
30+
- "dependencies"

0 commit comments

Comments
 (0)