Skip to content

Commit

Permalink
chore: move client/ dir to web/ (#991)
Browse files Browse the repository at this point in the history
I've been meaning to do this for a while... it just renames the
`client/` dir to `web/`. I think this is better because there will be
less confusion around the OpenFeature client object (which has it's own
dirs) and because it's more consistent with the associated artifact name
"web-sdk".

Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert authored Aug 28, 2024
1 parent d9d5a3d commit df4e72e
Show file tree
Hide file tree
Showing 48 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"packages/nest": "0.2.1-experimental",
"packages/react": "0.4.3",
"packages/client": "1.2.2",
"packages/web": "1.2.2",
"packages/server": "1.15.0",
"packages/shared": "1.3.0"
}
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We value having as few runtime dependencies as possible. The addition of any dep
### Modules

This repository uses [NPM workspaces](https://docs.npmjs.com/cli/v9/using-npm/workspaces) to establish a simple monorepo.
Within the root project, there is one common project (`packages/shared`) which features common interfaces and code, consumed by the published modules (`packages/server` and `packages/client`).
Within the root project, there is one common project (`packages/shared`) which features common interfaces and code, consumed by the published modules (`packages/server` and `packages/web`).
The shared module is built and published separately, and is a peer dependency of the SDK packages.
Consumers need not install it separately, since `npm` and `yarn` automatically install required peers.
In order to prevent regressions cause by incompatibilities due to version mismatches, the SDKs are locked to a particular version of the `@openfeature/core` module, and the CI enforces that it's released before any dependant SDKs (see [the related workflow](./.github/workflows/audit-pending-releases.yml)).
Expand All @@ -36,9 +36,9 @@ npm run e2e-server
```
for the server e2e tests and
```
npm run e2e-client
npm run e2e-web
```
for the client e2e tests.
for the web e2e tests.

### Packaging

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ For details, including API documentation, see the respective README files.

- [Server SDK](./packages/server/README.md), for use in Node.js and similar runtimes.
- [NestJS SDK](./packages/nest/README.md), a distribution of the Server SDK with built-in NestJS-specific features.
- [Client SDK](./packages/client/README.md), for use in the web browser.
- [React SDK](./packages/react//README.md), a distribution of the Client SDK with built-in React-specific features.
- [Web SDK](./packages/web/README.md), for use in the web browser.
- [React SDK](./packages/react//README.md), a distribution of the Web SDK with built-in React-specific features.

Each have slightly different APIs, but share many underlying types and components.

Expand Down
10 changes: 5 additions & 5 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ export default {
},
},
{
displayName: 'client',
displayName: 'web',
testEnvironment: 'node',
preset: 'ts-jest',
testMatch: ['<rootDir>/packages/client/test/**/*.spec.ts'],
testMatch: ['<rootDir>/packages/web/test/**/*.spec.ts'],
moduleNameMapper: {
'@openfeature/core': '<rootDir>/packages/shared/src',
},
Expand All @@ -143,10 +143,10 @@ export default {
},
},
{
displayName: 'client-e2e',
displayName: 'web-e2e',
testEnvironment: 'node',
preset: 'ts-jest',
testMatch: ['<rootDir>/packages/client/e2e/**/*.spec.ts'],
testMatch: ['<rootDir>/packages/web/e2e/**/*.spec.ts'],
modulePathIgnorePatterns: ['.*/node-modules/'],
moduleNameMapper: {
'^uuid$': require.resolve('uuid'),
Expand Down Expand Up @@ -178,7 +178,7 @@ export default {
testMatch: ['<rootDir>/packages/react/test/**/*.spec.{ts,tsx}'],
moduleNameMapper: {
'@openfeature/core': '<rootDir>/packages/shared/src',
'@openfeature/web-sdk': '<rootDir>/packages/client/src',
'@openfeature/web-sdk': '<rootDir>/packages/web/src',
},
transform: {
'^.+\\.(ts|tsx)$': [
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"private": true,
"description": "OpenFeature SDK for JavaScript",
"scripts": {
"test": "jest --selectProjects=shared --selectProjects=server --selectProjects=client --selectProjects=react --silent",
"test": "jest --selectProjects=shared --selectProjects=server --selectProjects=web --selectProjects=react --silent",
"e2e-server": "git submodule update --init --recursive && shx cp test-harness/features/evaluation.feature packages/server/e2e/features && jest --selectProjects=server-e2e --verbose",
"e2e-client": "git submodule update --init --recursive && shx cp test-harness/features/evaluation.feature packages/client/e2e/features && jest --selectProjects=client-e2e --verbose",
"e2e": "npm run e2e-server && npm run e2e-client",
"lint": "npm run lint --workspace=packages/shared --workspace=packages/server --workspace=packages/client --workspace=packages/react --workspace=packages/nest",
"e2e-web": "git submodule update --init --recursive && shx cp test-harness/features/evaluation.feature packages/web/e2e/features && jest --selectProjects=web-e2e --verbose",
"e2e": "npm run e2e-server && npm run e2e-web",
"lint": "npm run lint --workspace=packages/shared --workspace=packages/server --workspace=packages/web --workspace=packages/react --workspace=packages/nest",
"clean": "shx rm -rf ./dist",
"build": "npm run build --workspace=packages/shared --workspace=packages/server --workspace=packages/client --workspace=packages/react --workspace=packages/nest",
"publish-all": "npm run publish-if-not-exists --workspace=packages/shared --workspace=packages/server --workspace=packages/client --workspace=packages/react --workspace=packages/nest",
"build": "npm run build --workspace=packages/shared --workspace=packages/server --workspace=packages/web --workspace=packages/react --workspace=packages/nest",
"publish-all": "npm run publish-if-not-exists --workspace=packages/shared --workspace=packages/server --workspace=packages/web --workspace=packages/react --workspace=packages/nest",
"docs": "typedoc",
"core-version": "npm run version --workspace=packages/shared",
"update-core-peers": "export OPENFEATURE_CORE_VERSION=$(npm run --silent core-version) && npm run update-core-peer --workspace=packages/server --workspace=packages/client"
"update-core-peers": "export OPENFEATURE_CORE_VERSION=$(npm run --silent core-version) && npm run update-core-peer --workspace=packages/server --workspace=packages/web"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -74,7 +74,7 @@
"workspaces": [
"packages/shared",
"packages/server",
"packages/client",
"packages/web",
"packages/react",
"packages/nest"
]
Expand Down
2 changes: 1 addition & 1 deletion packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ This is analogous to:
OpenFeature.getClient('my-domain');
```

For more information about `domains`, refer to the [web SDK](https://github.com/open-feature/js-sdk/blob/main/packages/client/README.md).
For more information about `domains`, refer to the [web SDK](https://github.com/open-feature/js-sdk/blob/main/packages/web/README.md).

#### Re-rendering with Context Changes

Expand Down
2 changes: 1 addition & 1 deletion packages/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
"paths": {
"@openfeature/core": [ "../shared/src" ],
"@openfeature/web-sdk": [ "../client/src" ]
"@openfeature/web-sdk": [ "../web/src" ]
}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { defineFeature, loadFeature } from 'jest-cucumber';
import { InMemoryProvider, OpenFeature } from '../../src';
import flagConfiguration from './flags-config';
// load the feature file.
const feature = loadFeature('packages/client/e2e/features/evaluation.feature');
const feature = loadFeature('packages/web/e2e/features/evaluation.feature');

// get a client (flagd provider registered in setup)
const client = OpenFeature.getClient();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"extra-files": ["README.md"],
"versioning": "default"
},
"packages/client": {
"packages/web": {
"release-type": "node",
"prerelease": false,
"bump-minor-pre-major": true,
Expand Down
2 changes: 1 addition & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"entryPointStrategy": "packages",
"entryPoints": [
"packages/server",
"packages/client",
"packages/web",
"packages/shared",
],
"sort": [
Expand Down

0 comments on commit df4e72e

Please sign in to comment.