-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: realanna <[email protected]>
- Loading branch information
Showing
18 changed files
with
310 additions
and
88 deletions.
There are no files selected for viewing
This file contains 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 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,18 @@ | ||
{ | ||
"extends": ["../../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains 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,15 @@ | ||
# backstage Provider | ||
|
||
## Installation | ||
|
||
``` | ||
$ npm install @openfeature/backstage-provider | ||
``` | ||
|
||
## Building | ||
|
||
Run `nx package providers-backstage` to build the library. | ||
|
||
## Running unit tests | ||
|
||
Run `nx test providers-backstage` to execute the unit tests via [Jest](https://jestjs.io). |
This file contains 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,3 @@ | ||
{ | ||
"presets": [["minify", { "builtIns": false }]] | ||
} |
This file contains 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,10 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'providers-backstage', | ||
preset: '../../../jest.preset.js', | ||
transform: { | ||
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }], | ||
}, | ||
moduleFileExtensions: ['ts', 'js', 'html'], | ||
coverageDirectory: '../../../coverage/libs/providers/backstage', | ||
}; |
This file contains 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,12 @@ | ||
{ | ||
"name": "@openfeature/backstage-provider", | ||
"version": "0.0.1", | ||
"type": "commonjs", | ||
"scripts": { | ||
"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", | ||
"current-version": "echo $npm_package_version" | ||
}, | ||
"peerDependencies": { | ||
"@openfeature/js-sdk": "^1.0.0" | ||
} | ||
} |
This file contains 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,76 @@ | ||
{ | ||
"name": "providers-backstage", | ||
"$schema": "../../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "libs/providers/backstage/src", | ||
"projectType": "library", | ||
"targets": { | ||
"publish": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "npm run publish-if-not-exists", | ||
"cwd": "dist/libs/providers/backstage" | ||
}, | ||
"dependsOn": [ | ||
{ | ||
"projects": "self", | ||
"target": "package" | ||
} | ||
] | ||
}, | ||
"lint": { | ||
"executor": "@nrwl/linter:eslint", | ||
"outputs": ["{options.outputFile}"], | ||
"options": { | ||
"lintFilePatterns": ["libs/providers/backstage/**/*.ts"] | ||
} | ||
}, | ||
"test": { | ||
"executor": "@nrwl/jest:jest", | ||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"], | ||
"options": { | ||
"jestConfig": "libs/providers/backstage/jest.config.ts", | ||
"passWithNoTests": true | ||
}, | ||
"configurations": { | ||
"ci": { | ||
"ci": true, | ||
"codeCoverage": true | ||
} | ||
} | ||
}, | ||
"package": { | ||
"executor": "@nrwl/rollup:rollup", | ||
"outputs": ["{options.outputPath}"], | ||
"options": { | ||
"project": "libs/providers/backstage/package.json", | ||
"outputPath": "dist/libs/providers/backstage", | ||
"entryFile": "libs/providers/backstage/src/index.ts", | ||
"tsConfig": "libs/providers/backstage/tsconfig.lib.json", | ||
"buildableProjectDepsInPackageJsonType": "dependencies", | ||
"compiler": "tsc", | ||
"generateExportsField": true, | ||
"umdName": "backstage", | ||
"external": ["typescript"], | ||
"format": ["cjs", "esm"], | ||
"assets": [ | ||
{ | ||
"glob": "package.json", | ||
"input": "./assets", | ||
"output": "./src/" | ||
}, | ||
{ | ||
"glob": "LICENSE", | ||
"input": "./", | ||
"output": "./" | ||
}, | ||
{ | ||
"glob": "README.md", | ||
"input": "./libs/providers/backstage", | ||
"output": "./" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
This file contains 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 @@ | ||
export * from './lib/backstage-provider'; |
This file contains 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,7 @@ | ||
import { BackstageProvider } from './backstage-provider'; | ||
|
||
describe('BackstageProvider', () => { | ||
it('should be and instance of BackstageProvider', () => { | ||
expect(new BackstageProvider()).toBeInstanceOf(BackstageProvider); | ||
}); | ||
}); |
This file contains 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,41 @@ | ||
import { EvaluationContext, Provider, JsonValue, ResolutionDetails } from '@openfeature/js-sdk'; | ||
|
||
export class BackstageProvider implements Provider { | ||
metadata = { | ||
name: BackstageProvider.name, | ||
}; | ||
|
||
hooks = []; | ||
|
||
resolveBooleanEvaluation( | ||
flagKey: string, | ||
defaultValue: boolean, | ||
context: EvaluationContext | ||
): Promise<ResolutionDetails<boolean>> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
resolveStringEvaluation( | ||
flagKey: string, | ||
defaultValue: string, | ||
context: EvaluationContext | ||
): Promise<ResolutionDetails<string>> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
resolveNumberEvaluation( | ||
flagKey: string, | ||
defaultValue: number, | ||
context: EvaluationContext | ||
): Promise<ResolutionDetails<number>> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
resolveObjectEvaluation<U extends JsonValue>( | ||
flagKey: string, | ||
defaultValue: U, | ||
context: EvaluationContext | ||
): Promise<ResolutionDetails<U>> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
} |
This file contains 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,22 @@ | ||
{ | ||
"extends": "../../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"module": "ES6", | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"noImplicitOverride": true, | ||
"noPropertyAccessFromIndexSignature": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.lib.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
} |
This file contains 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,10 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../../dist/out-tsc", | ||
"declaration": true, | ||
"types": ["node"] | ||
}, | ||
"include": ["src/**/*.ts"], | ||
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] | ||
} |
This file contains 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,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../../dist/out-tsc", | ||
"module": "commonjs", | ||
"types": ["jest", "node"] | ||
}, | ||
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"] | ||
} |
This file contains 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.