-
Notifications
You must be signed in to change notification settings - Fork 1
chore: Reduce npm vulnerability and attack surface across workspace #43
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
6 commits
Select commit
Hold shift + click to select a range
c80b5f2
Reduce npm attack surface across workspace
mattinannt 0d2eb8c
Fix playground workspace type resolution
mattinannt 549c7b4
docs: add repository guidelines
mattinannt 3778163
Address playground review feedback
mattinannt 7ba82dc
Address remaining PR review feedback
mattinannt 9f206c3
Fix CI pnpm cache setup and move to Node 24
mattinannt 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
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,46 @@ | ||
| name: Lint | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| merge_group: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: "Lint" | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - name: Harden the runner | ||
| uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | ||
|
|
||
| - name: Setup Node.js 24.x | ||
| uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | ||
| with: | ||
| cache: pnpm | ||
| cache-dependency-path: pnpm-lock.yaml | ||
| node-version: 24.x | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Lint | ||
| run: pnpm lint | ||
|
|
||
| - name: Typecheck | ||
| run: pnpm check-types |
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
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
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
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,47 @@ | ||
| # Repository Guidelines | ||
|
|
||
| ## Project Structure & Module Organization | ||
|
|
||
| - This repository is a `pnpm` workspace managed with Turborepo. | ||
| - The published SDK lives in `packages/js`. | ||
| - SDK source, helpers, and shared types live in `packages/js/src`, `packages/js/src/lib`, and `packages/js/src/types`. | ||
| - The demo app lives in `apps/playground` and exercises SDK behavior locally with Vite + React. | ||
| - Generated output such as `dist/`, `coverage/`, and `.turbo/` should not be edited by hand. | ||
|
|
||
| ## Build, Test, and Development Commands | ||
|
|
||
| Run commands from the repo root unless you are working on a single package. | ||
|
|
||
| - `pnpm install` installs workspace dependencies. | ||
| - `pnpm dev` runs workspace dev tasks through Turbo; for interactive UI work, use `pnpm --filter playground dev`. | ||
| - `pnpm build` builds all packages; `pnpm --filter @formbricks/js build` rebuilds only the SDK. | ||
| - `pnpm test` runs workspace tests; `pnpm test:coverage` collects coverage via Vitest. | ||
| - `pnpm lint` checks formatting and lint rules with Biome. | ||
| - `pnpm check-types` runs TypeScript without emitting output. | ||
| - `pnpm clean` removes local build artifacts. | ||
|
|
||
| ## Coding Style & Naming Conventions | ||
|
|
||
| - Biome is the formatter and linter. | ||
| - The repository uses 2-space indentation, double quotes, trailing commas, and semicolons. | ||
| - Prefer TypeScript modules and keep public exports in `packages/js/src/index.ts`. | ||
| - Use `camelCase` for variables and functions. | ||
| - Use `PascalCase` for types and components. | ||
| - Keep filenames descriptive; tests follow the source name, for example `load-formbricks.test.ts`. | ||
|
|
||
| ## Testing Guidelines | ||
|
|
||
| - SDK tests use Vitest and currently live beside the implementation under `packages/js/src`. | ||
| - Add or update `*.test.ts` files when changing SDK behavior, especially proxy/loading logic in `src/lib`. | ||
| - Run `pnpm --filter @formbricks/js test` before opening a PR. | ||
| - Use `pnpm --filter @formbricks/js test:coverage` when touching core runtime paths. | ||
| - No explicit coverage threshold is configured, so contributors should cover new branches and regressions directly. | ||
|
|
||
| ## Commit & Pull Request Guidelines | ||
|
|
||
| - Recent history follows Conventional Commits such as `fix: restore eslint 9` and `chore: bump minor dependencies`. | ||
| - Keep commit subjects short, imperative, and prefixed with `fix:`, `feat:`, `chore:`, or similar. | ||
| - PRs should explain the behavioral change and note affected packages (`packages/js`, `apps/playground`, or both). | ||
| - Link related issues when applicable. | ||
| - Include screenshots or short recordings for playground UI changes. | ||
| - Mention any required environment setup, such as `apps/playground/.env` variables, in the PR description. | ||
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 |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| NEXT_PUBLIC_FORMBRICKS_API_HOST=http://localhost:3000 | ||
| NEXT_PUBLIC_FORMBRICKS_ENVIRONMENT_ID=YOUR-ENVIRONMENT-ID | ||
| VITE_FORMBRICKS_API_HOST=http://localhost:3000 | ||
| VITE_FORMBRICKS_ENVIRONMENT_ID=YOUR-ENVIRONMENT-ID |
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
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.
Uh oh!
There was an error while loading. Please reload this page.