Skip to content

chore: move js sdk and demo app to its own repository#5668

Merged
mattinannt merged 3 commits intomainfrom
chore/migrate-js-package
May 5, 2025
Merged

chore: move js sdk and demo app to its own repository#5668
mattinannt merged 3 commits intomainfrom
chore/migrate-js-package

Conversation

@mattinannt
Copy link
Copy Markdown
Member

@mattinannt mattinannt commented May 5, 2025

With this PR the js SDK and the demo app for the JS SDK is now moved to its own repository formbricks/js.
This pull request removes the apps/demo directory and its associated files, effectively deprecating the demo application. Additionally, it updates the .env.example file to remove unused environment variables and provide a default value for DISABLE_USER_MANAGEMENT.

Removal of the demo application:

  • Deleted the entire apps/demo directory, including configuration files (.env.example, .eslintrc.js, .gitignore, next.config.mjs, package.json, postcss.config.js), global styles (globals.css), utility functions (lib/utils.ts), and all components and pages (layout-app.tsx, sidebar.tsx, _app.tsx, _document.tsx, index.tsx). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

Updates to .env.example:

  • Removed unused FORMBRICKS_API_HOST and FORMBRICKS_ENVIRONMENT_ID variables.
  • Added a default value (1) for the DISABLE_USER_MANAGEMENT variable to disable user management from the UI by default.

Summary by CodeRabbit

  • Chores
    • Removed all code, configuration, and dependencies related to the Formbricks JavaScript SDK and demo app, including environment variables, build scripts, and documentation.
    • Cleaned up environment files and Docker configuration by deleting unused Formbricks-related variables.
    • Updated project build and test workflows to remove references to the demo and JS packages.
  • Bug Fixes
    • Simplified logout and account deletion flows by removing Formbricks-specific logout logic.
  • Tests
    • Updated or removed tests to eliminate dependencies on Formbricks constants and components.
  • Documentation
    • Deleted documentation and example files related to the Formbricks JS package and demo application.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2025

Thank you for following the naming conventions for pull request titles! 🙏

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2025

"""

Walkthrough

This change removes all code, configuration, and dependencies related to the Formbricks JavaScript SDK and its demo application from the repository. The entire @formbricks/js package is deleted, including its source files, configuration, documentation, and build scripts. The apps/demo directory, which contained a Next.js demo app for showcasing Formbricks integration, is also fully removed. All environment variables and configuration references related to Formbricks API host and environment ID are eliminated from environment files, Docker Compose, and build tools. In the main web application, all Formbricks client components, logout utilities, and related constants are deleted, and their usages are removed from layouts and other components. Test files and mocks referencing Formbricks are updated accordingly. Build and task definitions in turbo.json and package scripts are adjusted to remove tasks and dependencies related to the deleted packages and environment variables.

Possibly related PRs

Suggested labels

❗️ .env changes
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 63fe40e and 01f0f2e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • apps/web/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/package.json
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Build Formbricks-web / Build Formbricks-web
  • GitHub Check: Run Unit Tests / Unit Tests
  • GitHub Check: Run Linters / Linters
  • GitHub Check: Run E2E Tests / Run E2E Tests
  • GitHub Check: Validate Docker Build
  • GitHub Check: SonarQube
  • GitHub Check: Analyze (javascript)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
turbo.json (1)

176-176: Document & ensure default for DISABLE_USER_MANAGEMENT
You've added DISABLE_USER_MANAGEMENT to the environment. Update .env.example and README/docs to reflect this new variable and its default of 1, and confirm CI/CD pipelines include it.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 616210f and 0c1fc25.

⛔ Files ignored due to path filters (6)
  • apps/demo/public/favicon.ico is excluded by !**/*.ico
  • apps/demo/public/fb-setup.png is excluded by !**/*.png
  • apps/demo/public/next.svg is excluded by !**/*.svg
  • apps/demo/public/thirteen.svg is excluded by !**/*.svg
  • apps/demo/public/vercel.svg is excluded by !**/*.svg
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (47)
  • .env.example (1 hunks)
  • apps/demo/.env.example (0 hunks)
  • apps/demo/.eslintrc.js (0 hunks)
  • apps/demo/.gitignore (0 hunks)
  • apps/demo/components/layout-app.tsx (0 hunks)
  • apps/demo/components/sidebar.tsx (0 hunks)
  • apps/demo/globals.css (0 hunks)
  • apps/demo/lib/utils.ts (0 hunks)
  • apps/demo/next-env.d.ts (0 hunks)
  • apps/demo/next.config.mjs (0 hunks)
  • apps/demo/package.json (0 hunks)
  • apps/demo/pages/_app.tsx (0 hunks)
  • apps/demo/pages/_document.tsx (0 hunks)
  • apps/demo/pages/index.tsx (0 hunks)
  • apps/demo/postcss.config.js (0 hunks)
  • apps/demo/tsconfig.json (0 hunks)
  • apps/web/app/(app)/(onboarding)/organizations/[organizationId]/landing/components/landing-sidebar.tsx (0 hunks)
  • apps/web/app/(app)/components/FormbricksClient.test.tsx (0 hunks)
  • apps/web/app/(app)/components/FormbricksClient.tsx (0 hunks)
  • apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx (1 hunks)
  • apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/DeleteAccount.tsx (0 hunks)
  • apps/web/app/(app)/layout.test.tsx (0 hunks)
  • apps/web/app/(app)/layout.tsx (1 hunks)
  • apps/web/app/lib/formbricks.ts (0 hunks)
  • apps/web/lib/constants.ts (0 hunks)
  • apps/web/lib/env.ts (0 hunks)
  • apps/web/modules/account/components/DeleteAccountModal/index.tsx (0 hunks)
  • apps/web/modules/setup/organization/create/components/removed-from-organization.tsx (0 hunks)
  • apps/web/modules/survey/components/question-form-input/index.test.tsx (0 hunks)
  • apps/web/modules/survey/editor/components/create-new-action-tab.test.tsx (0 hunks)
  • apps/web/modules/ui/components/client-logout/index.tsx (0 hunks)
  • apps/web/modules/ui/components/environmentId-base-layout/index.test.tsx (0 hunks)
  • apps/web/modules/ui/components/environmentId-base-layout/index.tsx (1 hunks)
  • apps/web/package.json (0 hunks)
  • docker/docker-compose.yml (0 hunks)
  • package.json (0 hunks)
  • packages/js/.eslintrc.cjs (0 hunks)
  • packages/js/.gitignore (0 hunks)
  • packages/js/LICENSE (0 hunks)
  • packages/js/README.md (0 hunks)
  • packages/js/package.json (0 hunks)
  • packages/js/src/index.ts (0 hunks)
  • packages/js/src/lib/load-formbricks.ts (0 hunks)
  • packages/js/src/vite-env.d.ts (0 hunks)
  • packages/js/tsconfig.json (0 hunks)
  • packages/js/vite.config.ts (0 hunks)
  • turbo.json (2 hunks)
💤 Files with no reviewable changes (42)
  • apps/web/app/(app)/layout.test.tsx
  • apps/web/modules/survey/editor/components/create-new-action-tab.test.tsx
  • apps/web/modules/ui/components/environmentId-base-layout/index.test.tsx
  • packages/js/README.md
  • apps/demo/lib/utils.ts
  • package.json
  • apps/web/lib/constants.ts
  • apps/web/modules/survey/components/question-form-input/index.test.tsx
  • apps/web/app/(app)/(onboarding)/organizations/[organizationId]/landing/components/landing-sidebar.tsx
  • apps/demo/postcss.config.js
  • apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/DeleteAccount.tsx
  • packages/js/src/vite-env.d.ts
  • docker/docker-compose.yml
  • apps/demo/.eslintrc.js
  • apps/web/modules/account/components/DeleteAccountModal/index.tsx
  • apps/demo/.env.example
  • packages/js/tsconfig.json
  • packages/js/.eslintrc.cjs
  • packages/js/.gitignore
  • apps/web/app/lib/formbricks.ts
  • apps/demo/next.config.mjs
  • apps/demo/next-env.d.ts
  • packages/js/vite.config.ts
  • apps/web/package.json
  • apps/demo/globals.css
  • apps/demo/components/sidebar.tsx
  • apps/demo/package.json
  • packages/js/src/index.ts
  • apps/demo/pages/_document.tsx
  • apps/web/app/(app)/components/FormbricksClient.tsx
  • apps/web/modules/ui/components/client-logout/index.tsx
  • apps/demo/pages/_app.tsx
  • apps/web/modules/setup/organization/create/components/removed-from-organization.tsx
  • apps/web/lib/env.ts
  • apps/web/app/(app)/components/FormbricksClient.test.tsx
  • apps/demo/pages/index.tsx
  • packages/js/LICENSE
  • apps/demo/tsconfig.json
  • apps/demo/.gitignore
  • apps/demo/components/layout-app.tsx
  • packages/js/package.json
  • packages/js/src/lib/load-formbricks.ts
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Run Unit Tests / Unit Tests
  • GitHub Check: Run E2E Tests / Run E2E Tests
  • GitHub Check: Build Formbricks-web / Build Formbricks-web
  • GitHub Check: SonarQube
  • GitHub Check: Validate Docker Build
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (6)
.env.example (1)

223-223: Updated default value for user management setting

The change adds a default value of 1 for the DISABLE_USER_MANAGEMENT variable, which sets the system to disable user management from the UI by default. This aligns with the overall goal of streamlining the repository and removing unnecessary components.

apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx (1)

267-267: LGTM: Minor CSS class reordering

The change simply reorders CSS classes in the toggle sidebar button without affecting functionality.

apps/web/modules/ui/components/environmentId-base-layout/index.tsx (1)

3-3: Removed Formbricks constants imports

The import statement has been updated to only include IS_POSTHOG_CONFIGURED, removing Formbricks-related constants. This is consistent with the PR objective to move the JS SDK and demo app to its own repository.

apps/web/app/(app)/layout.tsx (1)

2-2: Removed Formbricks constants imports

The import statement has been updated to only include PostHog-related constants, removing Formbricks-related constants. This is consistent with the PR objective to move the JS SDK and demo app to its own repository.

turbo.json (2)

64-64: Review coverage dependencies for web#test:coverage
Similarly, web#test:coverage only depends on logger build. Ensure coverage is measured on compiled code—add @formbricks/web#build as a prerequisite if necessary.


61-61:

Details

❓ Verification inconclusive

Review test dependencies for web#test
The web#test task now only depends on @formbricks/logger#build. Verify that it still builds and tests the web application itself—consider adding @formbricks/web#build (or other core build tasks) to its dependsOn to avoid running tests against stale code.

Run:


🏁 Script executed:

#!/bin/bash
# Check the definition of web#test in turbo.json
rg -n '"@formbricks/web#test"' -C2 turbo.json

Length of output: 179


🏁 Script executed:

#!/bin/bash
# Verify that @formbricks/web#build task exists in turbo.json
rg -n '"@formbricks/web#build"' -C2 turbo.json

Length of output: 48


Verify web build dependency for web#test
We didn’t find a @formbricks/web#build task in turbo.json, so it’s unclear whether the web code is being rebuilt before tests run. Please confirm that your web#test step actually compiles the latest web code, and if not, add the appropriate @formbricks/web#build (or equivalent) to its dependsOn.

• File: turbo.json
• Section:

"@formbricks/web#test": {
  "dependsOn": ["@formbricks/logger#build"]
}

Comment thread turbo.json
Comment thread turbo.json
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 2025

@mattinannt mattinannt merged commit bd22aaa into main May 5, 2025
18 checks passed
@mattinannt mattinannt deleted the chore/migrate-js-package branch May 5, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant