Skip to content

Commit be8b75f

Browse files
Merge pull request #130 from splitio/refactor_type_definitions
Refactor TypeScript declarations
2 parents 4cfbd3b + 964235a commit be8b75f

File tree

17 files changed

+211
-1649
lines changed

17 files changed

+211
-1649
lines changed

.eslintrc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"parser": "@typescript-eslint/parser",
66
"plugins": [
77
"@typescript-eslint",
8+
"eslint-plugin-tsdoc",
89
"import"
910
],
1011

@@ -60,7 +61,14 @@
6061
"files": ["types/**"],
6162
"rules": {
6263
"no-use-before-define": "off",
63-
"no-undef": "off" // turned off to avoid issue with triple-slash path directive
64+
"no-undef": "off" // turned off to avoid issue with SplitIO namespace not defined
65+
}
66+
},
67+
{
68+
// Enable TSDoc rules for TypeScript files, allowing the use of JSDoc in JS files.
69+
"files": ["**/*.ts"],
70+
"rules": {
71+
"tsdoc/syntax": "warn"
6472
}
6573
}
6674
],

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") npm run build
4848

4949
- name: Store assets
50-
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main') }}
50+
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/refactor_type_definitions' || github.ref == 'refs/heads/main') }}
5151
uses: actions/upload-artifact@v3
5252
with:
5353
name: assets
@@ -58,7 +58,7 @@ jobs:
5858
name: Upload assets
5959
runs-on: ubuntu-20.04
6060
needs: build
61-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
61+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/refactor_type_definitions' }}
6262
strategy:
6363
matrix:
6464
environment:

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Added `factory.destroy()` method, which invokes the `destroy` method of all clients created by the factory.
44
- Updated @splitsoftware/splitio-commons package to version 2.0.0 that includes major updates and updated some transitive dependencies for vulnerability fixes.
55
- BREAKING CHANGES:
6+
- Renamed some TypeScript definitions in the SplitIO namespace to avoid conflicts with other Split packages: `SplitIO.IBrowserSettings` to `SplitIO.IClientSideSettings`, `SplitIO.IBrowserAsyncSettings` to `SplitIO.IClientSideAsyncSettings`, `SplitIO.ISDK` to `SplitIO.IBrowserSDK`, and `SplitIO.IAsyncSDK` to `SplitIO.IBrowserAsyncSDK`.
67
- Removed internal ponyfills for the `Map` and `Set` global objects, dropping support for IE and other outdated browsers. The SDK now requires the runtime environment to support these features natively or provide a polyfill.
78
- Removed the deprecated `GoogleAnalyticsToSplit` and `SplitToGoogleAnalytics` pluggable integration modules, along with the related interfaces in the TypeScript definitions.
89
- Removed the `LocalhostFromObject` export from the default import (`import { LocalhostFromObject } from '@splitsoftware/splitio-browserjs'`). It is no longer necessary to manually import and configure it in the `sync.localhostMode` option to enable localhost mode.

package-lock.json

Lines changed: 155 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio-browserjs",
3-
"version": "1.0.0-rc.0",
3+
"version": "1.0.0-rc.3",
44
"description": "Split SDK for JavaScript on Browser",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",
@@ -36,9 +36,7 @@
3636
"test:e2e-errorCatching": "karma start karma/e2e.errorCatching.karma.conf.js",
3737
"test:e2e-push": "karma start karma/e2e.push.karma.conf.js",
3838
"test:e2e-consumer": "karma start karma/e2e.consumer.karma.conf.js",
39-
"pretest-ts-decls": "npm run build:esm && npm run build:cjs && npm link",
40-
"test-ts-decls": "./scripts/ts-tests.sh",
41-
"posttest-ts-decls": "npm rm --location=global @splitsoftware/splitio-browserjs && npm install",
39+
"test-ts-decls": "tsc --build ts-tests",
4240
"all": "npm run check && npm run build && npm run test-ts-decls && npm run test",
4341
"publish:rc": "npm run check && npm run build && npm publish --tag rc",
4442
"publish:stable": "npm run check && npm run build && npm publish"
@@ -61,7 +59,7 @@
6159
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
6260
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
6361
"dependencies": {
64-
"@splitsoftware/splitio-commons": "2.0.0-rc.3",
62+
"@splitsoftware/splitio-commons": "2.0.0-rc.6",
6563
"tslib": "^2.3.1",
6664
"unfetch": "^4.2.0"
6765
},
@@ -77,6 +75,7 @@
7775
"eslint": "^8.48.0",
7876
"eslint-plugin-compat": "^4.2.0",
7977
"eslint-plugin-import": "^2.25.4",
78+
"eslint-plugin-tsdoc": "^0.3.0",
8079
"fetch-mock": "^11.1.3",
8180
"jest": "^27.2.3",
8281
"karma": "^6.4.1",

0 commit comments

Comments
 (0)