Skip to content

Refactor TypeScript declarations #130

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 16 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"eslint-plugin-tsdoc",
"import"
],

Expand Down Expand Up @@ -60,7 +61,14 @@
"files": ["types/**"],
"rules": {
"no-use-before-define": "off",
"no-undef": "off" // turned off to avoid issue with triple-slash path directive
"no-undef": "off" // turned off to avoid issue with SplitIO namespace not defined
}
},
{
// Enable TSDoc rules for TypeScript files, allowing the use of JSDoc in JS files.
"files": ["**/*.ts"],
"rules": {
"tsdoc/syntax": "warn"
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") npm run build

- name: Store assets
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main') }}
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/refactor_type_definitions' || github.ref == 'refs/heads/main') }}
uses: actions/upload-artifact@v3
with:
name: assets
Expand All @@ -58,7 +58,7 @@ jobs:
name: Upload assets
runs-on: ubuntu-20.04
needs: build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/refactor_type_definitions' }}
strategy:
matrix:
environment:
Expand Down
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Added `factory.destroy()` method, which invokes the `destroy` method of all clients created by the factory.
- Updated @splitsoftware/splitio-commons package to version 2.0.0 that includes major updates and updated some transitive dependencies for vulnerability fixes.
- BREAKING CHANGES:
- 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`.
- 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.
- Removed the deprecated `GoogleAnalyticsToSplit` and `SplitToGoogleAnalytics` pluggable integration modules, along with the related interfaces in the TypeScript definitions.
- 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.
Expand Down
170 changes: 155 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio-browserjs",
"version": "1.0.0-rc.0",
"version": "1.0.0-rc.3",
"description": "Split SDK for JavaScript on Browser",
"main": "cjs/index.js",
"module": "esm/index.js",
Expand Down Expand Up @@ -36,9 +36,7 @@
"test:e2e-errorCatching": "karma start karma/e2e.errorCatching.karma.conf.js",
"test:e2e-push": "karma start karma/e2e.push.karma.conf.js",
"test:e2e-consumer": "karma start karma/e2e.consumer.karma.conf.js",
"pretest-ts-decls": "npm run build:esm && npm run build:cjs && npm link",
"test-ts-decls": "./scripts/ts-tests.sh",
"posttest-ts-decls": "npm rm --location=global @splitsoftware/splitio-browserjs && npm install",
"test-ts-decls": "tsc --build ts-tests",
"all": "npm run check && npm run build && npm run test-ts-decls && npm run test",
"publish:rc": "npm run check && npm run build && npm publish --tag rc",
"publish:stable": "npm run check && npm run build && npm publish"
Expand All @@ -61,7 +59,7 @@
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
"dependencies": {
"@splitsoftware/splitio-commons": "2.0.0-rc.3",
"@splitsoftware/splitio-commons": "2.0.0-rc.6",
"tslib": "^2.3.1",
"unfetch": "^4.2.0"
},
Expand All @@ -77,6 +75,7 @@
"eslint": "^8.48.0",
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-tsdoc": "^0.3.0",
"fetch-mock": "^11.1.3",
"jest": "^27.2.3",
"karma": "^6.4.1",
Expand Down
Loading
Loading