Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
26f1b3c
Using React18 for check, build and tests
EmilianoSanchez May 11, 2022
2e179a1
Fix Sonarqube scanner in GHA
Israphel Jan 26, 2023
ad5d409
Europe roles were deleted
Israphel Jan 26, 2023
c0fc098
Merge pull request #125 from splitio/fix/disable-europe-upload
Israphel Jan 27, 2023
bb21302
comment out europe
Israphel Jan 27, 2023
a819a7c
updated linter dependencies and rules
EmilianoSanchez Mar 15, 2023
3e5bad7
prepare rc
EmilianoSanchez Mar 15, 2023
4a78e3d
prepare stable release
EmilianoSanchez Mar 15, 2023
5ae7719
fix linter warnings
EmilianoSanchez Mar 16, 2023
b46f7e2
types update
EmilianoSanchez Mar 16, 2023
6e0c250
added linter rule
EmilianoSanchez Mar 17, 2023
6fc729a
capitalize the s in Javascript ocurrences
EmilianoSanchez Mar 17, 2023
3d3903c
Merge branch 'linter_update' into react18_tests_migration
EmilianoSanchez Mar 21, 2023
addad1d
fix some tests
EmilianoSanchez Mar 21, 2023
da5f0bb
uninstall enzyme-adapter-react-16 to avoid peer-dependencies installa…
EmilianoSanchez Mar 21, 2023
3e27ae0
uninstall enzyme and install react-testing-library
EmilianoSanchez Mar 21, 2023
42001c2
refactor tests
EmilianoSanchez Mar 28, 2023
ca9a7b6
refactor withSplitFactory and withSplitClient tests
EmilianoSanchez Mar 28, 2023
c6faeaa
update jest config
EmilianoSanchez Mar 28, 2023
8a0374a
polishing to remove testing warnings
EmilianoSanchez Mar 28, 2023
a27f0fb
update changelog entry
EmilianoSanchez Mar 31, 2023
08842b1
Merge pull request #128 from splitio/react18_tests_migration
EmilianoSanchez Apr 3, 2023
c614ed2
Merge pull request #127 from splitio/linter_update
EmilianoSanchez Apr 3, 2023
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
58 changes: 58 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
module.exports = {
'env': {
'browser': true,
'es6': true,
'node': true
},
'extends': [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended'
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaVersion': 2015,
'sourceType': 'module'
},
'plugins': [
'react',
'@typescript-eslint',
'import'
],
'rules': {
'indent': ['error', 2, { 'SwitchCase': 1 }],
'quotes': ['warn', 'single', 'avoid-escape'],
'linebreak-style': ['error', 'unix'],
'camelcase': ['error', { 'properties': 'never' }],
'no-use-before-define': ['error', 'nofunc'],
'eol-last': ['error', 'always'],
'keyword-spacing': 'error',
'no-trailing-spaces': 'error',
'space-before-function-paren': ['error', {'named': 'never'}],
'react/display-name': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { 'argsIgnorePattern': '^_' }],
},
'overrides': [{
'files': ['src/**/*.ts', 'src/**/*.tsx'],
'excludedFiles': ['src/**/__tests__/**'],
'extends': [
'plugin:compat/recommended'
],
'settings': {
'polyfills': [
'Promise' // required as a polyfill by the user
]
},
'rules': {
'no-restricted-syntax': ['error', 'ForOfStatement', 'ForInStatement'],
'compat/compat': ['error', 'defaults, not ie < 11'],
'no-throw-literal': 'error',
'import/no-self-import': 'error',
// 'import/no-default-export': 'error', // Default exports are a common practice in React
}
}]
}
82 changes: 41 additions & 41 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,39 @@ jobs:
- name: npm build
run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") BUILD_COMMIT=${{ github.sha }} npm run build

- name: SonarQube Scan (Push)
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master') }}
uses: SonarSource/sonarcloud-github-action@v1.8
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.projectName=${{ github.event.repository.name }}
-Dsonar.projectKey=${{ github.event.repository.name }}
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"

- name: SonarQube Scan (Pull Request)
if: github.event_name == 'pull_request'
uses: SonarSource/sonarcloud-github-action@v1.8
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.projectName=${{ github.event.repository.name }}
-Dsonar.projectKey=${{ github.event.repository.name }}
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}

- name: Store assets
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master') }}
uses: actions/upload-artifact@v3
Expand All @@ -61,14 +94,14 @@ jobs:
matrix:
environment:
- stage
- stage-eu
#- stage-eu
include:
- environment: stage
account_id: "079419646996"
bucket: split-public-stage
- environment: stage-eu
account_id: "901851837056"
bucket: split-public-stage-eu-west-1
# - environment: stage-eu
# account_id: "901851837056"
# bucket: split-public-stage-eu-west-1

steps:
- name: Download assets
Expand Down Expand Up @@ -104,14 +137,14 @@ jobs:
matrix:
environment:
- prod
- prod-eu
#- prod-eu
include:
- environment: prod
account_id: "825951051969"
bucket: split-public
- environment: prod-eu
account_id: "842946900133"
bucket: split-public-eu-west-1
# - environment: prod-eu
# account_id: "842946900133"
# bucket: split-public-eu-west-1

steps:
- name: Download assets
Expand All @@ -137,36 +170,3 @@ jobs:
SOURCE_DIR: ./umd
DEST_DIR: sdk
ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public

- name: SonarQube Scan (Push)
if: github.event_name == 'push'
uses: SonarSource/sonarcloud-github-action@v1.8
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.projectName=${{ github.event.repository.name }}
-Dsonar.projectKey=${{ github.event.repository.name }}
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"

- name: SonarQube Scan (Pull Request)
if: github.event_name == 'pull_request'
uses: SonarSource/sonarcloud-github-action@v1.8
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.projectName=${{ github.event.repository.name }}
-Dsonar.projectKey=${{ github.event.repository.name }}
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
7 changes: 6 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.8.2 (April 3, 2023)
- Updated linter dependencies and rules. The deprecated TSLint package was replaced by ESLint.
- Updated some transitive dependencies for vulnerability fixes.
- Updated @splitsoftware/splitio package to version 10.22.4 that includes minor improvements.

1.8.1 (December 16, 2022)
- Updated some transitive dependencies for vulnerability fixes.
- Bugfixing - Upgrade @splitsoftware/splitio dependency to version 10.22.3 which includes a memory leak fix for localhost mode (Related to issue https://github.com/splitio/javascript-commons/issues/181) among other improvements.
Expand Down Expand Up @@ -64,7 +69,7 @@
- Updated Split's SDK package for vulnerability fixes.

1.2.4 (February 11, 2021)
- Updated CommonJS and ES Modules builds to always resolve browser modules of the Javascript SDK and avoid issues when using Node-based testing framework such as Jest (issues #13, #34).
- Updated CommonJS and ES Modules builds to always resolve browser modules of the JavaScript SDK and avoid issues when using Node-based testing framework such as Jest (issues #13, #34).

1.2.3 (February 8, 2021)
- Updated React peer dependency range to include React@17.x.x.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2022 Split Software, Inc.
Copyright © 2023 Split Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ Split has built and maintains SDKs for:
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
* Javascript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
* Javascript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
* JavaScript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
* JavaScript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
* PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
* Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)
Expand Down
12 changes: 8 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ module.exports = {

testEnvironment: 'jsdom',

setupFilesAfterEnv: ['./setupTests.js'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.jest.json',
}
},

// Test files are .js, .jsx, .ts and .tsx files inside of __tests__ folders and with a suffix of .test or .spec
testMatch: [ "**/__tests__/**/?(*.)+(spec|test).[jt]s?(x)" ],
testMatch: ['**/__tests__/**/?(*.)+(spec|test).[jt]s?(x)'],

// Included files for test coverage (npm run test:coverage)
collectCoverageFrom: [
"src/**/*.{js,jsx,ts,tsx}",
"!src/__tests__/**",
'src/**/*.{js,jsx,ts,tsx}',
'!src/__tests__/**',
]
};
Loading