-
Notifications
You must be signed in to change notification settings - Fork 10
ci: add platform integration check workflow #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
a180928
feat: add export entry points for npm package consumption
cevheri 1ef919f
chore: update .gitignore to exclude files
cevheri dba370c
feat: add API adapter pattern for platform integration
cevheri 032bcde
feat: configure package.json for npm package exports
cevheri f77ddd5
fix: remove unused imports and deprecated types
cevheri a6829a5
merge: add npm package exports and API adapter pattern
cevheri 22c10b3
chore: rename package to @libredb/studio for npm publishing
cevheri 47fb61a
feat: add npm publish workflow for @libredb/studio
cevheri b947cc7
chore: add .npmignore to publish only source code (572 → 205 files)
cevheri 428b655
merge: add npm publish workflow and .npmignore
cevheri b9180a7
fix: use NPMJS_TOKEN secret name in npm publish workflow
cevheri c57a75c
chore: add index.js entry point and update main field for bundler com…
cevheri 044894a
feat(workspace): add StudioWorkspace types and props interface
cevheri c7a7574
feat(workspace): add useConnectionAdapter hook with tests
cevheri 25061f7
feat(workspace): add useQueryAdapter hook with tests
cevheri bf13193
feat(workspace): add StudioWorkspace composite component
cevheri 5665a53
fix(workspace): stub QuerySafetyDialog AI analysis to prevent interna…
cevheri 04cf6bc
feat(workspace): add workspace export entry point and build config
cevheri fb371cd
fix(workspace): remove unused QueryResult import
cevheri c879d1d
fix(workspace): add scoped dark theme CSS variables and remove Mobile…
cevheri b24a179
fix(workspace): inject scoped dark theme CSS via style tag for host a…
cevheri fc119df
feat: switch to Geist font and apply scoped font system in embedded w…
cevheri cdd9d24
fix: replace text-[12px] arbitrary values with text-xs for Tailwind v…
cevheri 5b5ad95
refactor: replace hardcoded text-[Npx] with semantic font scale tokens
cevheri 40c7fe9
fix: remove SQL Engine badge overlay from query editor
cevheri 08a80e4
feat(workspace): implement StudioWorkspace export plan and design spe…
cevheri 332379f
fix: update tests for semantic font tokens and removed SQL Engine badge
cevheri eec1a2e
chore: update CLAUDE.md with library build instructions and clean up …
cevheri 191f80b
bump: version to 0.9.12
cevheri 06e9475
fix(lint): ignore dist/ in eslint config and suppress require() in CJ…
cevheri f1e3053
tests: update QueryEditor and SnapshotTimeline tests for button label…
cevheri cf4bbde
fix(test): update OperationsTab badge variant assertion for Shadcn v2
cevheri 286d28d
fix(test): update RootLayout font mock from Inter to Geist
cevheri fe40158
Merge pull request #51 from libredb/feat/studio-workspace-export
cevheri a74b53f
fix(ci): add bun install and build:lib to npm-publish workflow
cevheri 1c17dbe
fix(tests): update PostgreSQL port in connection form tests to match …
cevheri 26cb073
refactor: standardize font sizes across components
cevheri f36ebb6
refactor: update icon stroke widths across components
cevheri 3f6cfa4
docs: enhance CLAUDE.md with critical platform integration rules and …
cevheri 9ccdf5e
ci: add platform integration check workflow
cevheri 91922bc
fix: replace shadcn Button with plain button in TableItem
cevheri a7a5dd6
fix(tests): update selectors for font and icon changes
cevheri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| name: Platform Integration Check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| integration-rules: | ||
| name: Platform Integration Rules | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 | ||
| with: | ||
| bun-version: "1.3.9" | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install --frozen-lockfile | ||
|
|
||
| - name: Build library dist | ||
| run: bun run build:lib | ||
|
|
||
| - name: Check — No custom @theme text tokens | ||
| run: | | ||
| echo "Checking globals.css for custom text tokens..." | ||
| if grep -E '^\s*--text-[a-z]+:' src/app/globals.css | grep -v 'font-'; then | ||
| echo "::error::Custom text tokens found in @theme. tailwind-merge will silently strip these." | ||
| echo "Use standard Tailwind classes (text-xs, text-sm) or arbitrary values (text-[0.625rem]) instead." | ||
| exit 1 | ||
| fi | ||
| echo "✓ No custom text tokens" | ||
|
|
||
| - name: Check — No custom text-* classes in components | ||
| run: | | ||
| echo "Checking for custom text token usage in components..." | ||
| CUSTOM=$(grep -rn '\btext-body\b\|\btext-data\b\|\btext-label\b\|\btext-title\b\|\btext-micro\b\|\btext-caption\b' \ | ||
| src/components/ src/workspace/ --include="*.tsx" || true) | ||
| if [ -n "$CUSTOM" ]; then | ||
| echo "::error::Custom text tokens used in components. twMerge strips these silently." | ||
| echo "$CUSTOM" | ||
| exit 1 | ||
| fi | ||
| echo "✓ No custom text token usage" | ||
|
|
||
| - name: Check — Lucide icons have strokeWidth | ||
| run: | | ||
| echo "Checking Lucide icons for strokeWidth prop..." | ||
| MISSING=$(grep -rn '<[A-Z][a-zA-Z]* className="w-' src/components/ src/workspace/ --include="*.tsx" \ | ||
| | grep -v 'admin/' | grep -v 'ui/' \ | ||
| | grep -v 'strokeWidth' \ | ||
| | grep -v '<Button\|<Input\|<Label\|<Card\|<Dialog\|<Alert\|<Select\|<Textarea\|<Badge\|<Tooltip\|<Popover\|<Sheet\|<Tabs\|<Table\|<Drawer' \ | ||
| | grep -v 'svg\|div\|span\|motion' || true) | ||
| if [ -n "$MISSING" ]; then | ||
| echo "::warning::Lucide icons without strokeWidth={1.5} found. These may render with inconsistent stroke weight." | ||
| echo "$MISSING" | head -20 | ||
| fi | ||
| echo "✓ Lucide strokeWidth check complete" | ||
|
|
||
| - name: Check — No shadcn Button size=icon in sidebar/explorer | ||
| run: | | ||
| echo "Checking for shadcn Button in compact areas..." | ||
| BUTTONS=$(grep -rn 'size="icon"' \ | ||
| src/components/sidebar/ src/components/schema-explorer/ --include="*.tsx" || true) | ||
| if [ -n "$BUTTONS" ]; then | ||
| echo "::error::shadcn Button size='icon' in sidebar/explorer. Use plain <button> to avoid platform CSS conflicts." | ||
| echo "$BUTTONS" | ||
| exit 1 | ||
| fi | ||
| echo "✓ No Button size=icon in compact areas" | ||
|
|
||
| - name: Check — Dist chunks contain expected classes | ||
| run: | | ||
| echo "Checking dist for responsive class coverage..." | ||
| ALL_MD=$(grep -roh 'md:[a-z-]*' dist/*.mjs | sort -u) | ||
| WORKSPACE_MD=$(grep -roh 'md:[a-z-]*' dist/workspace.mjs | sort -u) | ||
| ONLY_IN_CHUNKS=$(comm -23 <(echo "$ALL_MD") <(echo "$WORKSPACE_MD")) | ||
| if [ -n "$ONLY_IN_CHUNKS" ]; then | ||
| echo "::notice::Responsive classes found only in chunks (not workspace.mjs):" | ||
| echo "$ONLY_IN_CHUNKS" | ||
| echo "Platform must scan chunk-*.mjs via @source directive." | ||
| fi | ||
| echo "✓ Dist chunk analysis complete" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| name: NPM Publish | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version to publish (e.g., 0.9.8). Leave empty to use package.json version.' | ||
| required: false | ||
| type: string | ||
| dry_run: | ||
| description: 'Dry run (do not actually publish)' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| validate: | ||
| name: Validate | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: "1.3.9" | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install --frozen-lockfile | ||
|
|
||
| - name: Lint | ||
| run: bun run lint | ||
|
|
||
| - name: Typecheck | ||
| run: bun run typecheck | ||
|
|
||
| - name: Test | ||
| run: bun run test | ||
|
|
||
| - name: Build | ||
| run: bun run build | ||
| env: | ||
| NEXT_TELEMETRY_DISABLED: 1 | ||
| JWT_SECRET: test-secret-for-ci-build-only-32ch | ||
| ADMIN_EMAIL: admin@libredb.org | ||
| ADMIN_PASSWORD: test-admin | ||
| USER_EMAIL: user@libredb.org | ||
| USER_PASSWORD: test-user | ||
|
|
||
| publish: | ||
| name: Publish to NPM | ||
| runs-on: ubuntu-latest | ||
| needs: validate | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow Medium
Unpinned 3rd party Action 'NPM Publish' step
Uses Step Error loading related location Loading |
||
| with: | ||
| bun-version: "1.3.9" | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install --frozen-lockfile | ||
|
|
||
| - name: Build library (tsup) | ||
| run: bun run build:lib | ||
|
|
||
| - name: Set version (if provided) | ||
| if: inputs.version != '' | ||
| env: | ||
| INPUT_VERSION: ${{ inputs.version }} | ||
| run: npm version "$INPUT_VERSION" --no-git-tag-version | ||
|
|
||
| - name: Verify package | ||
| run: | | ||
| echo "Package name: $(node -p "require('./package.json').name")" | ||
| echo "Package version: $(node -p "require('./package.json').version")" | ||
|
|
||
| - name: Publish (dry run) | ||
| if: inputs.dry_run == true | ||
| run: npm publish --access public --dry-run | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }} | ||
|
|
||
| - name: Publish | ||
| if: inputs.dry_run != true | ||
| run: npm publish --access public | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }} | ||
|
|
||
| - name: Summary | ||
| run: | | ||
| VERSION=$(node -p "require('./package.json').version") | ||
| echo "## Published @libredb/studio@${VERSION}" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "- **Registry:** https://www.npmjs.com/package/@libredb/studio" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "- **Install:** \`npm install @libredb/studio@${VERSION}\`" >> "$GITHUB_STEP_SUMMARY" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,3 +98,6 @@ seed-connections.yaml | |
|
|
||
| .playwright-mcp/*.png | ||
|
|
||
| npmjs-token | ||
|
|
||
| .npmrc | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Publish only source code needed for npm consumers | ||
| # Everything is ignored by default, then we allowlist | ||
|
|
||
| # Ignore everything | ||
| * | ||
|
|
||
| # Allow source exports | ||
| !src/exports/ | ||
| !src/exports/** | ||
|
|
||
| # Allow library code (providers, types, utils) | ||
| !src/lib/ | ||
| !src/lib/** | ||
|
|
||
| # Allow components | ||
| !src/components/ | ||
| !src/components/** | ||
|
|
||
| # Allow hooks (used by components) | ||
| !src/hooks/ | ||
| !src/hooks/** | ||
|
|
||
| # Allow package files | ||
| !package.json | ||
| !README.md | ||
| !LICENSE | ||
| !tsconfig.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium