-
Notifications
You must be signed in to change notification settings - Fork 24
WIP: Node SDK v2 #23
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
WIP: Node SDK v2 #23
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
6ad2ca7
feat: initial sdk rewrite
eder-zadrima 37e8964
chore: refactor tests structure to account for sdk tests
eder-zadrima 35ceaa0
feat: add flagsmith node.js SDK implementation
eder-zadrima d8bfea9
chore: minor refactoring
eder-zadrima d1c9631
docs: add JSDoc comments for the SDK
eder-zadrima 3c7de37
docs: update example of SDK usage
eder-zadrima 869107e
chore: add example to precommit linting
eder-zadrima 2c9d554
chore: add gh action for tests
eder-zadrima 3a11cbe
chore: trigger tests when pushed to main
eder-zadrima ffd8e1d
fix: retry logic for sdk
eder-zadrima 5dba295
SDK Fixes
kyle-ssg 89bc661
Throw on empty SDK key
kyle-ssg 3eb2b1a
Minor
kyle-ssg cd487db
Update test, update updateEnvironment function names
kyle-ssg dce0afc
Log defaultFlagHandler on Feature does not exist error
kyle-ssg 3de5c72
Merge pull request #24 from Flagsmith/sdk-rewrite-improvements
kyle-ssg 9c4c1b4
Update example package.json readme
kyle-ssg eb474e6
Renamed BT to Flagsmith last remnants
dabeeeenster 3f54c41
Use flagsmith 2.0.0-beta.1 in example
kyle-ssg c57ac4e
Merge remote-tracking branch 'origin/sdk-rewrite' into sdk-rewrite
kyle-ssg aebddc9
chore: fixes as per PR comments
eder-zadrima 76f9d6c
chore: update exports for commonjs valid module
eder-zadrima f722f1d
chore: fix exporting issues
eder-zadrima 9b55819
Fix setTrait Return Type
beeme1mr 78b96e0
Fix traits logic
3d1987e
Merge pull request #27 from Flagsmith/fix/identity-flags-with-traits
kyle-ssg 1c75677
Bump version
kyle-ssg bd66dcc
Merge pull request #26 from beeme1mr/fix-set-trait-typing
kyle-ssg 7d33644
Prevent local eval race conditions, getIdentitySegments, add server k…
kyle-ssg ce8dde2
lint
kyle-ssg bf64da2
Adjust default flag handling
kyle-ssg a4a76c8
correct retries prop
kyle-ssg 945192d
correct retries prop
kyle-ssg f95ad4c
added asdf
dabeeeenster 6a8a31d
Version bump
dabeeeenster 5f4aa26
Merge pull request #28 from Flagsmith/v2/get_identity_segments
kyle-ssg 187b9db
bump 2.0.0-beta.5, build on prepublish
kyle-ssg c8e16ce
ES5 support, beta.6 bump
kyle-ssg af72ca3
ES5 compat for IdentityFeaturesList
kyle-ssg 571b513
PR Feedback
kyle-ssg 605a264
Resolve todo on mv test
kyle-ssg ad5b25b
Merge branch 'main' into sdk-rewrite
kyle-ssg 5aca735
chore: update tests
eder-zadrima 0fcebde
Merge branch 'sdk-rewrite' of https://github.com/Flagsmith/flagsmith-…
eder-zadrima 298ab46
chore: remove redundant submodule
eder-zadrima 707fbd9
chore: remove submodule files
eder-zadrima e121229
chore: fix tests running for submodule with test data
eder-zadrima 7d92229
chore: wip on submodule
eder-zadrima 32e0bb9
chore: clear old submodule
eder-zadrima 7bbeea5
fix: get test data after clone
eder-zadrima e2c3c27
fix: checkout submodules on the action stage
eder-zadrima 92fc1fe
chore: additional tests
eder-zadrima 8db2de4
feat: add caching & tests
eder-zadrima d69e2a3
feat: add onEnvironmentChange callback
eder-zadrima 255a977
chore: add test for local environment + identity flags
eder-zadrima de5a9f1
chore: fix race condition checking for environment flags
eder-zadrima 60ffc15
chore: add misc tests
eder-zadrima ba0cdb5
chore: split sdk main test file
eder-zadrima fe39a33
bump 2.0.0-beta.7
kyle-ssg b63f461
chore: add test coverage
eder-zadrima 78cb01c
feat: feature segments add
eder-zadrima 0914942
Merge branch 'sdk-rewrite' of https://github.com/Flagsmith/flagsmith-…
eder-zadrima 0a86930
fix: feature state priority calculation
eder-zadrima d944be5
chore: remove unused code
eder-zadrima 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: Unit/Integration Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
| - ready_for_review | ||
| push: | ||
| branches: | ||
| - main | ||
| jobs: | ||
| build-and-test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Checkout submodules # checkout rest | ||
| shell: bash | ||
| run: | | ||
| # If your submodules are configured to use SSH instead of HTTPS please uncomment the following line | ||
| git config --global url."https://github.com/".insteadOf "git@github.com:" | ||
| auth_header="$(git config --local --get http.https://github.com/.extraheader)" | ||
| git submodule sync --recursive | ||
| git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 | ||
| - uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: "15.x" | ||
| - name: cache node modules | ||
| uses: actions/cache@v1 | ||
| with: | ||
| path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS | ||
| key: npm-${{ hashFiles('package-lock.json') }} | ||
| restore-keys: | | ||
| npm-${{ hashFiles('package-lock.json') }} | ||
| npm- | ||
| - run: npm i -g npm@7.0.2 | ||
| - run: npm install | ||
| - run: npm test | ||
| env: | ||
| CI: true |
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 |
|---|---|---|
|
|
@@ -6,4 +6,7 @@ | |
|
|
||
| .idea/* | ||
|
|
||
| node_modules/ | ||
| node_modules/ | ||
| build/ | ||
|
|
||
| .tool-versions | ||
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,3 @@ | ||
| [submodule "tests/engine/engine-tests/engine-test-data"] | ||
| path = tests/engine/engine-tests/engine-test-data | ||
| url = git@github.com:Flagsmith/engine-test-data.git |
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,6 @@ | ||
| #!/bin/sh | ||
| . "$(dirname "$0")/_/husky.sh" | ||
|
|
||
| npm run lint | ||
| git add ./flagsmith-engine ./sdk ./tests ./example ./index.ts ./.github | ||
| npm run test |
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 |
|---|---|---|
|
|
@@ -2,12 +2,6 @@ | |
|
|
||
| ## Getting Started | ||
|
|
||
| # Setup via cli | ||
|
|
||
| `npm i ssg-node -g` | ||
|
|
||
| `ssg-node PROJECT_NAME` | ||
|
|
||
| # Run | ||
|
|
||
| `$ npm start` | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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.