Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
dc2602d
feat: upgrade nx from 16.10.0 to 22.1.1
jonathannorris Nov 25, 2025
abe7c90
feat: migrate all tsc builds to esbuild
jonathannorris Nov 25, 2025
b941033
fix: ignore tmp directory in bucketing-assembly-script eslint config
jonathannorris Nov 26, 2025
0ca4f56
chore: run prettier
jonathannorris Nov 26, 2025
1e3cd14
fix: update e2e configs for NX 22 compatibility
jonathannorris Nov 26, 2025
b04f598
fix: use tsc for nextjs SDK to preserve 'use client' directives
jonathannorris Nov 26, 2025
cc4d0f8
chore: update e2e yarn.lock files
jonathannorris Nov 26, 2025
7aaa171
fix: add webpack config for example-js build
jonathannorris Dec 11, 2025
aac92bb
fix: change export of VariableDefinitions to type export from '@devcy…
jonathannorris Dec 11, 2025
c2fb426
fix: resolve rollup build and type-check issues for react-native-expo
jonathannorris Dec 15, 2025
1ee6269
chore: run prettier:format
jonathannorris Dec 15, 2025
16f4ee9
fix: update webpack configs for NX 22 compatibility
jonathannorris Dec 15, 2025
299dd0f
fix: ignore @nx/webpack in js sdk dependency checks
jonathannorris Dec 15, 2025
44bc28f
chore: ignore .yarn folders in subdirectories and remove tracked files
jonathannorris Dec 15, 2025
025eccd
fix: update dev-apps webpack configs and nextjs pages-router API
jonathannorris Dec 15, 2025
6373b74
fix: update webpack configs and tsconfig for dev-apps
jonathannorris Dec 15, 2025
2f09901
chore: prettier
jonathannorris Dec 15, 2025
d98fd0a
chore: update Nx affected E2E workflow to include shared libraries bu…
jonathannorris Dec 15, 2025
1567288
fix: update e2e test ports to avoid conflicts and pre-build shared libs
jonathannorris Dec 15, 2025
8bee1c9
fix: update nx run-many command syntax in e2e workflow
jonathannorris Dec 15, 2025
784df2d
fix: address copilot comments - remove redundant type annotations and…
jonathannorris Dec 15, 2025
71043e7
fix: enhance Playwright config with comments for clarity and maintain…
jonathannorris Dec 15, 2025
2e9f49a
fix: limit e2e parallel execution to 3
jonathannorris Dec 17, 2025
c3dea34
fix: increase timeout for navigation in E2E tests to improve reliability
jonathannorris Dec 17, 2025
a96cf6e
fix: preserve NX project config in playwright configs
jonathannorris Dec 19, 2025
f2828ca
fix: add shared-bucketing to e2e build dependencies
jonathannorris Dec 19, 2025
dbb999e
fix: add fallback for undefined projects in playwright configs
jonathannorris Dec 19, 2025
92b227d
fix: format playwright configs to comply with max-len
jonathannorris Dec 19, 2025
bbaccf6
chore: apply prettier formatting to playwright configs
jonathannorris Dec 19, 2025
3a868d1
chore: add worktrees.json for cursor worktree setup
jonathannorris Dec 19, 2025
6d15b3f
chore: create worktrees.json for setting up cursor worktree
jonathannorris Dec 19, 2025
1daeddc
fix: resolve WASM path and webpack config for nodejs-local dev-app
jonathannorris Dec 19, 2025
ca8f6f9
fix: resolve WASM path and webpack config for openfeature-nodejs dev-app
jonathannorris Dec 19, 2025
04f388c
chore: add trailing newline to js webpack config
jonathannorris Dec 23, 2025
4c07218
chore: remove nextjs app-router and pages-router directories along wi…
jonathannorris Dec 23, 2025
3ec1c58
chore: clean up yarn.lock by removing unused nextjs app-router and pa…
jonathannorris Dec 23, 2025
5a4419a
chore: simplify JSON formatting and clean up webpack configuration files
jonathannorris Dec 23, 2025
0e1df07
chore: update webpack configuration to use Nx plugin composition
jonathannorris Dec 23, 2025
ea64662
fix: correct package.json main fields for nestjs SDKs to match build …
jonathannorris Dec 23, 2025
e8a8fa0
chore: use dot notation for process.env and add timeout comment
jonathannorris Dec 31, 2025
331f493
fix: lint errors and simplify webpack config
jonathannorris Jan 2, 2026
947e664
fix: reduce CDN bundle size by using tsc compiler
jonathannorris Jan 9, 2026
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
3 changes: 3 additions & 0 deletions .cursor/worktrees.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"setup-worktree": ["yarn install"]
}
87 changes: 45 additions & 42 deletions .github/workflows/nx-affected-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
name: Nx Affected E2E
on:
pull_request:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubicloud-standard-8
permissions:
contents: read
id-token: write
pull-requests: write
issues: write
strategy:
matrix:
node-version: [22.12]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Enable Corepack
run: corepack enable
- name: Set Secrets
uses: DevCycleHQ/aws-secrets-action@main
with:
secrets_map: '{"NEXT_PUBLIC_E2E_OPTIN_CLIENT_KEY":"DEVCYCLE_GITHUB_js-sdks_NEXT_PUBLIC_E2E_OPTIN_CLIENT_KEY","E2E_OPTIN_SERVER_KEY":"DEVCYCLE_GITHUB_js-sdks_E2E_OPTIN_SERVER_KEY","NEXT_PUBLIC_E2E_EDGEDB_CLIENT_KEY":"DEVCYCLE_GITHUB_js-sdks_NEXT_PUBLIC_E2E_EDGEDB_CLIENT_KEY","E2E_EDGEDB_SERVER_KEY":"DEVCYCLE_GITHUB_js-sdks_E2E_EDGEDB_SERVER_KEY","E2E_NEXTJS_SERVER_KEY":"DEVCYCLE_GITHUB_js-sdks_E2E_NEXTJS_SERVER_KEY", "NEXT_PUBLIC_E2E_NEXTJS_CLIENT_KEY": "DEVCYCLE_GITHUB_js-sdks_NEXT_PUBLIC_E2E_NEXTJS_CLIENT_KEY", "DVC_E2E_SERVER_SDK_KEY": "DEVCYCLE_GITHUB_js-sdks_DVC_E2E_SERVER_SDK_KEY"}'
aws_account_id: '134377926370'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: git fetch origin main
- run: yarn --immutable
- name: Install Playwright Browsers
shell: bash
run: yarn playwright install --with-deps
- name: Run Affected E2E Tests
shell: bash
run: yarn affected:e2e
- name: Upload Playwright Report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: dist/.playwright/e2e/
build:
runs-on: ubicloud-standard-8
permissions:
contents: read
id-token: write
pull-requests: write
issues: write
strategy:
matrix:
node-version: [22.12]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Enable Corepack
run: corepack enable
- name: Set Secrets
uses: DevCycleHQ/aws-secrets-action@main
with:
secrets_map: '{"NEXT_PUBLIC_E2E_OPTIN_CLIENT_KEY":"DEVCYCLE_GITHUB_js-sdks_NEXT_PUBLIC_E2E_OPTIN_CLIENT_KEY","E2E_OPTIN_SERVER_KEY":"DEVCYCLE_GITHUB_js-sdks_E2E_OPTIN_SERVER_KEY","NEXT_PUBLIC_E2E_EDGEDB_CLIENT_KEY":"DEVCYCLE_GITHUB_js-sdks_NEXT_PUBLIC_E2E_EDGEDB_CLIENT_KEY","E2E_EDGEDB_SERVER_KEY":"DEVCYCLE_GITHUB_js-sdks_E2E_EDGEDB_SERVER_KEY","E2E_NEXTJS_SERVER_KEY":"DEVCYCLE_GITHUB_js-sdks_E2E_NEXTJS_SERVER_KEY", "NEXT_PUBLIC_E2E_NEXTJS_CLIENT_KEY": "DEVCYCLE_GITHUB_js-sdks_NEXT_PUBLIC_E2E_NEXTJS_CLIENT_KEY", "DVC_E2E_SERVER_SDK_KEY": "DEVCYCLE_GITHUB_js-sdks_DVC_E2E_SERVER_SDK_KEY"}'
aws_account_id: "134377926370"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- run: git fetch origin main
- run: yarn --immutable
- name: Install Playwright Browsers
shell: bash
run: yarn playwright install --with-deps
- name: Build shared libraries
shell: bash
run: yarn nx run-many -t build -p shared-types shared-bucketing server-request js-cloud-server-sdk nextjs js react --parallel=1
- name: Run Affected E2E Tests
shell: bash
run: yarn affected:e2e
- name: Upload Playwright Report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: dist/.playwright/e2e/
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
node_modules
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
**/.yarn/*
!**/.yarn/patches
!**/.yarn/plugins
!**/.yarn/sdks
!**/.yarn/versions
.nx/cache
.nx/workspace-data
lerna-debug.log
yarn-error.log
.tmp/
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ node_modules
dev-apps/react/react-native-app/package.json
.wrangler/
*.html
tmp/
tmp/
.nx/
81 changes: 41 additions & 40 deletions AGENTS.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

worth copying these changes elsewhere?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

its basically just formatting, so probably not

Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,68 @@

## Configuration and Tooling

- The project root contains configuration files for building, linting, formatting, and testing.
- Key files include:
- `package.json`: Project dependencies and scripts
- `tsconfig.base.json`: Base TypeScript configuration
- `jest.config.ts`: Jest test runner configuration
- `.eslintrc.json`: ESLint configuration
- `.prettierrc.json`: Prettier formatting rules
- `nx.json`: NX workspace configuration
- `project.json`: Project definitions for NX
- always use `yarn` not `npm`
- The project root contains configuration files for building, linting, formatting, and testing.
- Key files include:
- `package.json`: Project dependencies and scripts
- `tsconfig.base.json`: Base TypeScript configuration
- `jest.config.ts`: Jest test runner configuration
- `.eslintrc.json`: ESLint configuration
- `.prettierrc.json`: Prettier formatting rules
- `nx.json`: NX workspace configuration
- `project.json`: Project definitions for NX

## Formatting

- Defer all formatting to Prettier for supported file types (JavaScript, TypeScript, JSON, Markdown, etc.).
- ESLint enforces code quality and linting rules.
- Defer all formatting to Prettier for supported file types (JavaScript, TypeScript, JSON, Markdown, etc.).
- ESLint enforces code quality and linting rules.

## Git Commit Message Conventions

- Follow Conventional Commits specification: `<type>: <description>` or `<type>(<scope>): <description>` (scopes are optional and rarely used)
- Valid types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
- Description should be imperative mood, lowercase, single sentence.
- Examples: `feat: add support for multi-threaded tests`, `fix: correct response for invalid input`, `docs: update README with new usage instructions`
- Follow Conventional Commits specification: `<type>: <description>` or `<type>(<scope>): <description>` (scopes are optional and rarely used)
- Valid types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
- Description should be imperative mood, lowercase, single sentence.
- Examples: `feat: add support for multi-threaded tests`, `fix: correct response for invalid input`, `docs: update README with new usage instructions`

## Internal Library Imports

- Internal libraries should be imported using their package name (e.g., `@devcycle/bucketing`) rather than relative or absolute paths.
- The package path for a library can be found in the library's `package.json` file under the `name` field.
- This applies to code in `lib/`, `sdk/`, and test/script files are excluded.
- **Example:**
- Correct: `import { generateBucketedConfig } from '@devcycle/bucketing'`
- Incorrect: `import { generateBucketedConfig } from '../../lib/shared/bucketing'`
- Internal libraries should be imported using their package name (e.g., `@devcycle/bucketing`) rather than relative or absolute paths.
- The package path for a library can be found in the library's `package.json` file under the `name` field.
- This applies to code in `lib/`, `sdk/`, and test/script files are excluded.
- **Example:**
- Correct: `import { generateBucketedConfig } from '@devcycle/bucketing'`
- Incorrect: `import { generateBucketedConfig } from '../../lib/shared/bucketing'`

## Naming Conventions

- Files and variables should use camelCase (starting with lowercase).
- Folders should use kebab-case.
- Files and variables should use camelCase (starting with lowercase).
- Folders should use kebab-case.

## Project Structure Guide

- This repository is managed as an NX monorepo.
- Main configuration files: `nx.json`, `project.json`, `package.json`, `tsconfig.base.json`, `jest.config.ts`
- Source code organized under `lib/`, `sdk/`, and `dev-apps/` directories.
- Shared types and utilities found in `lib/shared/`
- Each project (library, SDK, or app) defined in its own directory under `lib/`, `sdk/`, or `dev-apps/`
- NX commands used to build, test, and manage dependencies between projects.
- This repository is managed as an NX monorepo.
- Main configuration files: `nx.json`, `project.json`, `package.json`, `tsconfig.base.json`, `jest.config.ts`
- Source code organized under `lib/`, `sdk/`, and `dev-apps/` directories.
- Shared types and utilities found in `lib/shared/`
- Each project (library, SDK, or app) defined in its own directory under `lib/`, `sdk/`, or `dev-apps/`
- NX commands used to build, test, and manage dependencies between projects.

### README and Documentation

- The main `README.md` at project root provides repository overview.
- Many packages and libraries include their own README.md files with package-specific details.
- The main `README.md` at project root provides repository overview.
- Many packages and libraries include their own README.md files with package-specific details.

## Testing and Mocks

- Source files in `lib/`, `sdk/`, should have corresponding test files.
- Test and script files themselves are not required to have their own tests.
- Test files: use `.spec.ts`, `.spec.js`, `.test.js`, or `.test.ts` suffixes. (prefer `.test.ts`)
- Tests located in `__tests__/` directories or alongside source files.
- Mock implementations placed in `__mocks__/` directories within each package or module.
- Source files in `lib/`, `sdk/`, should have corresponding test files.
- Test and script files themselves are not required to have their own tests.
- Test files: use `.spec.ts`, `.spec.js`, `.test.js`, or `.test.ts` suffixes. (prefer `.test.ts`)
- Tests located in `__tests__/` directories or alongside source files.
- Mock implementations placed in `__mocks__/` directories within each package or module.

## Aviator CLI Workflow (optional)

- Use Aviator CLI (`av`) for managing stacked branches: `av branch chore-fix-invalid-input`
- Sync and push changes: `av sync --push=yes`
- Create PR: `av pr --title "<title>" --body "<body>"`
- title follows Conventional Commits, body uses markdown/bullets, `av pr` will push the branch
- Use Aviator CLI (`av`) for managing stacked branches: `av branch chore-fix-invalid-input`
- Sync and push changes: `av sync --push=yes`
- Create PR: `av pr --title "<title>" --body "<body>"`
- title follows Conventional Commits, body uses markdown/bullets, `av pr` will push the branch
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## JS SDK Monorepo

This is the DevCycle JS SDK Monorepo which contains all the Javascript-based SDKs and public
shared packages used by DevCycle products.

Expand All @@ -13,15 +14,16 @@ To view the README for a specific SDK, navigate to that SDK inside the `sdk` dir
There are several examples included in this repository for various SDKs. If you want to run them, proceed to setup:

## Setup

Ensure you have Node 22.x installed.

1. Clone this repo
2. Run `yarn` from the root directory. SDKs and dev-apps should now be set up to run via Nx.
3. Run `aws configure sso`
4. Run `aws sso login`


## Directory Structure

```
dev-apps/
- contains development test applications using each SDK
Expand All @@ -34,13 +36,15 @@ sdk/
```

## Running an development test app

To run an app, use the `yarn start` command with the name of the example you want to run:
`yarn start example-react-with-provider`

The names of the dev-apps are listed in the `workspace.json` file at the root of the repository. All dev-apps are
located in the root-level `dev-apps/` directory.

## Development

The repo is managed using `Nx`, a monorepo management tool. It's worth reading their docs here:
https://nx.dev/l/n/getting-started/intro

Expand All @@ -52,6 +56,7 @@ commands against them. For example, to test the "nodejs" project, run:
These commands can be run from the root directory, but should work in any directory.

The full list of relevant Nx commands is below:

```
build - build the compiled Webpack output of the project
serve - build and then run the compiled project
Expand All @@ -61,6 +66,7 @@ format:write - run prettier against the project and write all formatting changes
```

There are also several root-level yarn commands for running services:

```
yarn start - start all services in the repo
yarn start:partial - start the services you specify (eg. yarn start:partial api,config)
Expand Down Expand Up @@ -102,9 +108,11 @@ You can run commands in every javascript project using Nx: `nx run-many --target
This allows you to lint and/or test all projects at once.

### Publishing a Release

**Note:** You need admin privileges to publish a release. If you don't have them, ask someone who does to do the release for you.

Setup:

- run `aws sso login`
- run `./scripts/brew-install.sh`
- ensure you're on the main branch with the latest code
Expand Down Expand Up @@ -138,4 +146,3 @@ This will create three files in the `dist/sdk/js` folder:
```

Upload them all to S3. Ensure that their access controls allow public access.

3 changes: 2 additions & 1 deletion dev-apps/js-cloud-server/cloudflare-worker/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"outputPath": "dist/dev-apps/js-cloud-server/cloudflare-worker",
"main": "dev-apps/js-cloud-server/cloudflare-worker/src/index.ts",
"tsConfig": "dev-apps/js-cloud-server/cloudflare-worker/tsconfig.json",
"webpackConfig": "dev-apps/js-cloud-server/cloudflare-worker/webpack.config.js",
"compiler": "tsc",
"target": "node"
}
Expand All @@ -31,7 +32,7 @@
"dependsOn": ["upload-sourcemaps"]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
Expand Down
27 changes: 27 additions & 0 deletions dev-apps/js-cloud-server/cloudflare-worker/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { composePlugins, withNx } = require('@nx/webpack')

module.exports = composePlugins(withNx(), (config, { options }) => {
config.node = {
__dirname: true,
}
if (!config.resolve) {
config.resolve = {}
}
// Disable browser field resolution for node targets
config.resolve.mainFields = ['main', 'module']
config.resolve.conditionNames = ['node', 'require', 'import']
// Configure externals - webpack externals function
if (options.external && Array.isArray(options.external)) {
config.externals = config.externals || []
const externalArray = Array.isArray(config.externals)
? config.externals
: [config.externals]
config.externals = [
...externalArray,
...options.external.map((pkg) => ({
[pkg]: `commonjs ${pkg}`,
})),
]
}
return config
})
5 changes: 3 additions & 2 deletions dev-apps/js/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"dev-apps/js/src/assets"
],
"styles": ["dev-apps/js/src/styles.css"],
"scripts": []
"scripts": [],
"webpackConfig": "dev-apps/js/webpack.config.js"
},
"configurations": {
"production": {
Expand Down Expand Up @@ -63,7 +64,7 @@
"defaultConfiguration": "development"
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["dev-apps/js/**/*.ts"]
Expand Down
3 changes: 3 additions & 0 deletions dev-apps/js/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { composePlugins, withNx, withWeb } = require('@nx/webpack')

module.exports = composePlugins(withNx(), withWeb(), (config) => config)
28 changes: 0 additions & 28 deletions dev-apps/nextjs/app-router/.eslintrc.json

This file was deleted.

Loading
Loading