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
36 changes: 36 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
root: true,
env: {
browser: true,
es2022: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'prettier',
'plugin:storybook/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['@typescript-eslint', 'react', 'react-hooks'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-unused-vars': 'off',
},
settings: {
react: {
version: 'detect',
},
},
ignorePatterns: ['dist/', 'node_modules/', '*.config.js', '*.config.ts'],
};
12 changes: 0 additions & 12 deletions .eslintrc.json

This file was deleted.

55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: Bug report
about: Create a report to help us improve
title: '[BUG] '
labels: ['bug']
assignees: ''
---

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

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Actual behavior**
A clear and concise description of what actually happened.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment:**

- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 22]
- React version: [e.g. 18.2.0]
- Node version: [e.g. 18.17.0]

**Additional context**
Add any other context about the problem here.

**Code example**

```tsx
// If applicable, add a code example that reproduces the issue
import { Tree, TreeItem, TreeItemLayout } from '@roseline124/react-tree';

function App() {
return (
<Tree>
<TreeItem>
<TreeItemLayout>Example</TreeItemLayout>
</TreeItem>
</Tree>
);
}
```
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Feature request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: ['enhancement']
assignees: ''
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

**Use case examples**

```tsx
// If applicable, provide examples of how this feature would be used
import { Tree, TreeItem, TreeItemLayout } from '@roseline124/react-tree';

function App() {
return (
<Tree>
<TreeItem>
<TreeItemLayout>Example with new feature</TreeItemLayout>
</TreeItem>
</Tree>
);
}
```

**Priority**

- [ ] Low - Nice to have
- [ ] Medium - Important
- [ ] High - Critical for my use case
154 changes: 154 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: CI/CD

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Type check
run: pnpm type-check

- name: Lint
run: pnpm lint

- name: Format check
run: pnpm format:check

- name: Build
run: pnpm build

- name: Build Storybook
run: pnpm build:storybook

publish-alpha:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Generate alpha version
run: |
TIMESTAMP=$(date +"%Y%m%d%H%M%S")
CURRENT_VERSION=$(node -p "require('./package.json').version")
BASE_VERSION=$(echo $CURRENT_VERSION | sed 's/-alpha.*//')
NEW_VERSION="${BASE_VERSION}-alpha.${TIMESTAMP}"
npm version $NEW_VERSION --no-git-tag-version
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV

- name: Publish alpha to npm
run: pnpm publish --tag alpha --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Git Tag
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add package.json
git commit -m "chore: bump version to ${{ env.NEW_VERSION }}" || true
git tag "v${{ env.NEW_VERSION }}" || true
git push origin "v${{ env.NEW_VERSION }}" || echo "Tag push failed, but continuing..."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-release:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Bump patch version
run: |
CURRENT_VERSION=$(node -p "require('./package.json').version")
BASE_VERSION=$(echo $CURRENT_VERSION | sed 's/-alpha.*//')
NEW_VERSION=$(npm version patch --no-git-tag-version)
NEW_VERSION=${NEW_VERSION#v}
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV

- name: Publish to npm
run: pnpm publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Git Tag
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add package.json
git commit -m "chore: release v${{ env.NEW_VERSION }}" || true
git tag "v${{ env.NEW_VERSION }}" || true
git push origin "v${{ env.NEW_VERSION }}" || echo "Tag push failed, but continuing..."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 0 additions & 20 deletions .github/workflows/release.yml

This file was deleted.

Loading