Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
bf1ba71
Migrate to proxy architecture with lazy loading
talissoncosta Dec 17, 2025
8ecc16c
Add husky, lint-staged, and CI workflow
talissoncosta Dec 17, 2025
b430daa
Add dist-types to gitignore
talissoncosta Dec 17, 2025
af2cc62
Fix CI build with safer TypeScript compilation
talissoncosta Dec 17, 2025
1d87124
Simplify TypeScript build script
talissoncosta Dec 17, 2025
a4bdcb5
Split CI into 3 parallel jobs: lint, typecheck, build
talissoncosta Dec 17, 2025
4e25dbf
Add dev preview with mock data and Codespaces support
talissoncosta Dec 17, 2025
5319f85
Fix TypeError when accessing feature_state_value properties
talissoncosta Dec 19, 2025
55f1245
Remove unused getEnvironmentFeatures method
talissoncosta Dec 19, 2025
17d538c
Remove unused dependencies: @backstage/theme, @material-ui/lab, react…
talissoncosta Dec 19, 2025
83e9c32
chore: add missing EOF newline and ignore dist-demo
talissoncosta Dec 23, 2025
9511e90
Add alpha export with Backstage new frontend system
talissoncosta Dec 19, 2025
c50659d
refactor: remove legacy frontend system files
talissoncosta Dec 23, 2025
fc41454
feat: make new frontend system the default export
talissoncosta Dec 23, 2025
796e205
chore: remove alpha export path from package.json
talissoncosta Dec 23, 2025
bf06364
fix(dev): update dev server for new frontend system
talissoncosta Dec 23, 2025
74f6679
refactor: remove component exports from index
talissoncosta Dec 23, 2025
747085b
feat(theme): add Flagsmith theme constants and dashboard URL helpers
talissoncosta Dec 19, 2025
92ee2bd
feat(components): add shared UI components for flag status display
talissoncosta Dec 19, 2025
c847928
feat(api): add feature state interfaces for lazy loading
talissoncosta Dec 19, 2025
ebcdedc
feat(FlagsTab): add Jira-style per-environment table with lazy loading
talissoncosta Dec 19, 2025
3d1e341
feat(OverviewCard): add summary stats and dashboard link
talissoncosta Dec 19, 2025
355b327
feat(UsageCard): apply Flagsmith brand colors to chart
talissoncosta Dec 19, 2025
e75d793
test(mocks): update mock data for lazy loading feature states
talissoncosta Dec 19, 2025
14787ef
refactor(FlagsTab): remove misleading enabled/disabled counts
talissoncosta Dec 19, 2025
0a90fe1
refactor(FlagsTab): split into smaller focused components
talissoncosta Dec 23, 2025
25c64e4
feat: add custom hooks and utility functions for testability
talissoncosta Dec 23, 2025
4fd7019
refactor(FlagsmithOverviewCard): split into smaller components
talissoncosta Dec 23, 2025
5f65b4c
refactor(FlagsmithUsageCard): split into smaller components
talissoncosta Dec 23, 2025
78a2a98
refactor(FlagsTab): use useFlagsmithProject hook for consistency
talissoncosta Dec 23, 2025
8c1638a
feat(shared): add reusable LoadingState and MiniPagination components
talissoncosta Dec 23, 2025
dec15e2
ci: add test job to GitHub Actions workflow
talissoncosta Dec 23, 2025
e01bc6d
test: add test fixtures and utilities
talissoncosta Dec 23, 2025
2ee5e5c
test(utils): add unit tests for flagHelpers
talissoncosta Dec 23, 2025
c35a527
test(theme): add unit tests for flagsmithTheme
talissoncosta Dec 23, 2025
5501efa
test(api): add unit tests for FlagsmithClient
talissoncosta Dec 23, 2025
51b218b
test(hooks): add unit tests for custom hooks
talissoncosta Dec 23, 2025
10479f4
test(components): add unit tests for shared components
talissoncosta Dec 23, 2025
6fc20da
test(components): add integration tests for main components
talissoncosta Dec 23, 2025
c521897
fix(test): fix CI test failures
talissoncosta Dec 23, 2025
2fa9463
feat(demo): add GitHub Pages demo with mock data
talissoncosta Dec 19, 2025
d901671
feat(demo): add configuration screen and PR preview deployments
talissoncosta Dec 23, 2025
0f1a9e6
fix(ci): handle missing gh-pages branch in PR preview workflow
talissoncosta Dec 23, 2025
c7cf7f9
fix(test): fix FlagsTab test mock pattern matching and role selector
talissoncosta Dec 24, 2025
4d693d3
fix(demo): correct discovery API URL for MSW interception
talissoncosta Dec 24, 2025
0b80489
fix(demo): strip /flagsmith from URLs in live mode
talissoncosta Dec 24, 2025
69fb10e
refactor(components): replace inline styles with makeStyles
talissoncosta Dec 24, 2025
7dcb70e
refactor(demo): use makeStyles for LoadingScreen component
talissoncosta Dec 24, 2025
8a34ac9
feat(demo): make project and org IDs optional in live mode
talissoncosta Dec 24, 2025
b2ce0f6
chore(demo): add MSW debug logging
talissoncosta Dec 24, 2025
b1e5251
chore(demo): add MSW service worker for mock mode
talissoncosta Dec 24, 2025
e89895b
feat(demo): add dark/light theme toggle
talissoncosta Dec 24, 2025
feb2cc9
fix(demo): make AppBar and Tabs theme-aware
talissoncosta Dec 24, 2025
8fe852e
fix(demo): improve theme toggle reliability and styling
talissoncosta Dec 24, 2025
f655eff
fix(ci): preserve build artifact before switching to gh-pages branch
talissoncosta Dec 24, 2025
6d6960e
feat(release): add NPM publishing workflow and prepare for npm release
talissoncosta Dec 25, 2025
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
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "Flagsmith Backstage Plugin",
"image": "mcr.microsoft.com/devcontainers/typescript-node:22",
"postCreateCommand": "yarn install",
"forwardPorts": [3000],
"portsAttributes": {
"3000": {
"label": "Plugin Preview",
"onAutoForward": "openBrowser"
}
},
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
],
"settings": {
"editor.formatOnSave": true
}
}
},
"postStartCommand": "echo '🚀 Run: yarn start' && echo '📍 Then open the forwarded port 3000'"
}
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Exclude demo build files from linting
demo/
dist-demo/
vite.config.demo.ts
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI

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

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'

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

- name: Run lint
run: yarn lint

typecheck:
name: TypeScript
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'

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

- name: TypeScript check
run: yarn tsc

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'

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

- name: Build package
run: yarn build:all

test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'

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

- name: Run tests
run: yarn test --coverage --ci
204 changes: 204 additions & 0 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
name: Deploy Demo

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, closed]
workflow_dispatch:

permissions:
contents: write
pull-requests: write
pages: write
id-token: write

concurrency:
group: 'pages-${{ github.event.pull_request.number || github.ref }}'
cancel-in-progress: true

jobs:
build:
if: github.event.action != 'closed'
runs-on: ubuntu-latest
outputs:
preview_url: ${{ steps.set-url.outputs.url }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'

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

- name: Determine base path
id: base-path
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "path=/flagsmith-backstage-plugin/pr-${{ github.event.pull_request.number }}/" >> $GITHUB_OUTPUT
else
echo "path=/flagsmith-backstage-plugin/" >> $GITHUB_OUTPUT
fi

- name: Build demo
run: yarn build:demo
env:
VITE_BASE_PATH: ${{ steps.base-path.outputs.path }}

- name: Set preview URL
id: set-url
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "url=https://${{ github.repository_owner }}.github.io/flagsmith-backstage-plugin/pr-${{ github.event.pull_request.number }}/" >> $GITHUB_OUTPUT
fi

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: demo-build
path: ./dist-demo

deploy-main:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: demo-build
path: ./dist-demo

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload to Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./dist-demo

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

deploy-pr-preview:
if: github.event_name == 'pull_request' && github.event.action != 'closed'
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: demo-build
path: ./dist-demo

- name: Deploy PR preview
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Move artifact to temp location before switching branches
mv dist-demo /tmp/dist-demo

# Check if gh-pages branch exists
if git ls-remote --heads origin gh-pages | grep -q gh-pages; then
git fetch origin gh-pages
git checkout gh-pages
else
# Create orphan gh-pages branch if it doesn't exist
git checkout --orphan gh-pages
git rm -rf .
echo "# GitHub Pages" > README.md
git add README.md
git commit -m "Initialize gh-pages branch"
fi

# Deploy PR preview
PR_DIR="pr-${{ github.event.pull_request.number }}"
rm -rf "$PR_DIR"
mkdir -p "$PR_DIR"
cp -r /tmp/dist-demo/* "$PR_DIR/"

git add .
git diff --staged --quiet || git commit -m "Deploy PR #${{ github.event.pull_request.number }} preview"
git push origin gh-pages

- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
const url = '${{ needs.build.outputs.preview_url }}';
const body = `## Demo Preview

Preview URL: ${url}

This preview will be automatically cleaned up when the PR is closed.`;

const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const botComment = comments.find(c =>
c.user.type === 'Bot' && c.body.includes('Demo Preview')
);

if (botComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
});
}

cleanup-pr-preview:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Remove PR preview
run: |
# Check if gh-pages branch exists
if ! git ls-remote --heads origin gh-pages | grep -q gh-pages; then
echo "gh-pages branch does not exist, nothing to clean up"
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin gh-pages
git checkout gh-pages

PR_DIR="pr-${{ github.event.pull_request.number }}"
if [ -d "$PR_DIR" ]; then
rm -rf "$PR_DIR"
git add .
git diff --staged --quiet || git commit -m "Remove PR #${{ github.event.pull_request.number }} preview"
git push origin gh-pages
fi
Loading
Loading