Skip to content

Commit 21c7f11

Browse files
committed
initial unleash provider - wip
Signed-off-by: jarebudev <[email protected]>
1 parent 4e21b83 commit 21c7f11

17 files changed

+480
-2
lines changed

.release-please-manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
"libs/providers/multi-provider-web": "0.0.2",
1919
"libs/providers/growthbook-client": "0.1.1",
2020
"libs/providers/config-cat-web": "0.1.2",
21-
"libs/shared/config-cat-core": "0.1.0"
21+
"libs/shared/config-cat-core": "0.1.0",
22+
"libs/providers/unleash-web": "0.1.0"
2223
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": ["../../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["*.json"],
19+
"parser": "jsonc-eslint-parser",
20+
"rules": {
21+
"@nx/dependency-checks": "error"
22+
}
23+
}
24+
]
25+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# unleash-web Provider
2+
3+
## Installation
4+
5+
```
6+
$ npm install @openfeature/unleash-web-provider
7+
```
8+
9+
## Building
10+
11+
Run `nx package providers-unleash-web` to build the library.
12+
13+
## Running unit tests
14+
15+
Run `nx test providers-unleash-web` to execute the unit tests via [Jest](https://jestjs.io).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": [["minify", { "builtIns": false }]]
3+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'providers-unleash-web',
4+
preset: '../../../jest.preset.js',
5+
transform: {
6+
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
7+
},
8+
moduleFileExtensions: ['ts', 'js', 'html'],
9+
coverageDirectory: '../../../coverage/libs/providers/unleash-web',
10+
};

libs/providers/unleash-web/package-lock.json

Lines changed: 104 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "@openfeature/unleash-web-provider",
3+
"version": "0.0.1",
4+
"dependencies": {
5+
"tslib": "^2.3.0",
6+
"unleash-proxy-client": "^3.6.1"
7+
},
8+
"main": "./src/index.js",
9+
"typings": "./src/index.d.ts",
10+
"scripts": {
11+
"publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ \"$(npm show $npm_package_name@$npm_package_version version)\" = \"$(npm run current-version -s)\" ]; then echo 'already published, skipping'; else npm publish --access public; fi",
12+
"current-version": "echo $npm_package_version"
13+
},
14+
"peerDependencies": {
15+
"@openfeature/web-sdk": "^1.0.0"
16+
}
17+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"name": "providers-unleash-web",
3+
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "libs/providers/unleash-web/src",
5+
"projectType": "library",
6+
"targets": {
7+
"publish": {
8+
"executor": "nx:run-commands",
9+
"options": {
10+
"command": "npm run publish-if-not-exists",
11+
"cwd": "dist/libs/providers/unleash-web"
12+
},
13+
"dependsOn": [
14+
{
15+
"projects": "self",
16+
"target": "package"
17+
}
18+
]
19+
},
20+
"lint": {
21+
"executor": "@nx/linter:eslint",
22+
"outputs": ["{options.outputFile}"],
23+
"options": {
24+
"lintFilePatterns": ["libs/providers/unleash-web/**/*.ts", "libs/providers/unleash-web/package.json"]
25+
}
26+
},
27+
"test": {
28+
"executor": "@nx/jest:jest",
29+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
30+
"options": {
31+
"jestConfig": "libs/providers/unleash-web/jest.config.ts",
32+
"passWithNoTests": true
33+
},
34+
"configurations": {
35+
"ci": {
36+
"ci": true,
37+
"codeCoverage": true
38+
}
39+
}
40+
},
41+
"package": {
42+
"executor": "@nx/rollup:rollup",
43+
"outputs": ["{options.outputPath}"],
44+
"options": {
45+
"project": "libs/providers/unleash-web/package.json",
46+
"outputPath": "dist/libs/providers/unleash-web",
47+
"entryFile": "libs/providers/unleash-web/src/index.ts",
48+
"tsConfig": "libs/providers/unleash-web/tsconfig.lib.json",
49+
"buildableProjectDepsInPackageJsonType": "dependencies",
50+
"updateBuildableProjectDepsInPackageJson": true,
51+
"compiler": "tsc",
52+
"generateExportsField": true,
53+
"umdName": "unleash-web",
54+
"external": "all",
55+
"format": ["cjs", "esm"],
56+
"assets": [
57+
{
58+
"glob": "package.json",
59+
"input": "./assets",
60+
"output": "./src/"
61+
},
62+
{
63+
"glob": "LICENSE",
64+
"input": "./",
65+
"output": "./"
66+
},
67+
{
68+
"glob": "README.md",
69+
"input": "./libs/providers/unleash-web",
70+
"output": "./"
71+
}
72+
]
73+
}
74+
}
75+
},
76+
"tags": []
77+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib/unleash-web-provider';
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export interface UnleashContextOptions {
2+
userId?: string;
3+
sessionId?: string;
4+
remoteAddress?: string;
5+
currentTime?: string;
6+
properties?: {
7+
[key: string]: string;
8+
};
9+
}
10+
11+
export interface UnleashOptions {
12+
url: string;
13+
clientKey: string;
14+
appName: string;
15+
context?: UnleashContextOptions;
16+
refreshInterval?: number;
17+
disableRefresh?: boolean;
18+
metricsInterval?: number;
19+
metricsIntervalInitial?: number;
20+
}
21+

0 commit comments

Comments
 (0)