Skip to content

Rename distribution folders #828

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 30 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0a082b2
Rename dist folders: /lib -> /cjs, /es -> /esm
EmilianoSanchez Oct 4, 2024
4cfec03
Drop support for NodeJS v6
EmilianoSanchez Oct 4, 2024
4a58e9e
Merge branch 'add_factory_destroy_method' into breaking_changes
EmilianoSanchez Oct 8, 2024
9eefd1b
Upgrade JS-commons. Updated type definitions & tests
EmilianoSanchez Oct 8, 2024
aaad4a2
Remove lib folder
EmilianoSanchez Oct 8, 2024
42f06dc
Merge branch 'rename_dist_folders' into breaking_changes
EmilianoSanchez Oct 8, 2024
38469cf
Merge branch 'add_factory_destroy_method' into rename_dist_folders
EmilianoSanchez Oct 8, 2024
e3fe523
Merge branch 'rename_dist_folders' into breaking_changes
EmilianoSanchez Oct 8, 2024
7c0d050
rc
EmilianoSanchez Oct 8, 2024
3c1034b
Update changelog entry
EmilianoSanchez Oct 9, 2024
e0dd572
Update changelog entry
EmilianoSanchez Oct 9, 2024
2e5d502
Merge branch 'SDKS-8407_baseline' into rename_dist_folders
EmilianoSanchez Oct 18, 2024
33f6374
Merge branch 'rename_dist_folders' into breaking_changes
EmilianoSanchez Oct 18, 2024
79e33e7
Update JS-commons dep
EmilianoSanchez Oct 18, 2024
7a9782c
rc
EmilianoSanchez Oct 18, 2024
a3230a2
Fix test
EmilianoSanchez Oct 18, 2024
c078249
Internal refactor after removing sync.localhostMode option in JS-commons
EmilianoSanchez Oct 25, 2024
d7d6eb6
Move SplitIO namespace definition from JS SDK to JS-Commons and merge
EmilianoSanchez Oct 25, 2024
194e58a
Update changelog entry
EmilianoSanchez Oct 26, 2024
93d807e
Update eslint config
EmilianoSanchez Oct 28, 2024
e2f1b71
Update JS-commons and prepare rc
EmilianoSanchez Oct 29, 2024
e0229c4
rc in CDN
EmilianoSanchez Oct 30, 2024
a625171
Merge pull request #833 from splitio/remove_pluggable_localhost_mode
EmilianoSanchez Oct 31, 2024
8075815
Merge branch 'breaking_changes' into refactor_type_definitions
EmilianoSanchez Oct 31, 2024
7945e00
Update ts test
EmilianoSanchez Oct 31, 2024
98df0fd
Upgrade JS-commons
EmilianoSanchez Oct 31, 2024
9467095
Update ts test
EmilianoSanchez Oct 31, 2024
4c9b7af
rc
EmilianoSanchez Oct 31, 2024
8d92ba9
Merge pull request #834 from splitio/refactor_type_definitions
EmilianoSanchez Nov 2, 2024
ea5e43a
Merge pull request #827 from splitio/breaking_changes
EmilianoSanchez Nov 2, 2024
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
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
],
"rules": {
"no-restricted-syntax": ["error", "ForOfStatement", "ForInStatement", "ArrayPattern"],
"compat/compat": ["error", "defaults, ie 10, node 6"],
"compat/compat": ["error", "defaults, node >=14"],
"no-throw-literal": "error",
"import/no-default-export": "error",
"import/no-self-import": "error"
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 @@ -58,7 +58,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/master') }}
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/refactor_type_definitions' || github.ref == 'refs/heads/master') }}
uses: actions/upload-artifact@v3
with:
name: assets
Expand All @@ -69,7 +69,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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ dump.rdb
/stats

## transpiled code
/lib
/es
/cjs
/esm
/umd

## TS tests compilated files
Expand Down
18 changes: 11 additions & 7 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
10.29.0 (October XX, 2024)
- Added `factory.destroy()` method, which invokes the `destroy` method on all SDK clients created by the factory.
- Updated @splitsoftware/splitio-commons package to version 1.18.0 that includes minor updates:
- Added support for targeting rules based on large segments for browsers.
- Updated some transitive dependencies for vulnerability fixes.
- Bugfixing - Removed an overloaded `client` method in the `SplitIO.ISDK` interface that accepted a key and trafficType parameters. This interface corresponds to the SDK factory instance in NodeJS, which, unlike `SplitIO.IBrowserSDK` for the Browser, does not handle multiple client instances based on keys or traffic types.
11.0.0 (November 1, 2024)
- Added support for targeting rules based on large segments for browsers.
- 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.
- Renamed distribution folders from `/lib` to `/cjs` for CommonJS build, and `/es` to `/esm` for ECMAScript Modules build.
- BREAKING CHANGES:
- Dropped support for NodeJS v6. The SDK now requires NodeJS v14 or above.
- 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 `GOOGLE_ANALYTICS_TO_SPLIT` and `SPLIT_TO_GOOGLE_ANALYTICS` integrations. The `integrations` configuration option has been removed from the SDK factory configuration, along with the associated interfaces in the TypeScript definitions.
- Removed the `core.trafficType` configuration option (`SplitIO.IBrowserSettings['core']['trafficType]`) and the `trafficType` parameter from the SDK `client()` method in Browser (`SplitIO.IBrowserSDK['client']`). As a result, traffic types can no longer be bound to SDK clients, and the traffic type must be provided in the `track` method.

10.28.0 (September 6, 2024)
- Updated @splitsoftware/splitio-commons package to version 1.17.0 that includes minor updates:
Expand Down Expand Up @@ -514,7 +518,7 @@
- Bugfixing - Return correct label when consulted Split is not found.

9.1.1 (May 03, 2017)
- Bugfixing - Fixed invalid behaviour when using native Fetch API and comparing statusText
- Bugfixing - Fixed invalid behavior when using native Fetch API and comparing statusText
instead of resp.ok

9.1.0 (April 21, 2017)
Expand Down
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"main": "../lib/factory/browser.js",
"module": "../es/factory/browser.js",
"main": "../cjs/factory/browser.js",
"module": "../esm/factory/browser.js",
"types": "../types/client/index.d.ts"
}
20 changes: 0 additions & 20 deletions karma/e2e.gaIntegration.karma.conf.js

This file was deleted.

51 changes: 20 additions & 31 deletions package-lock.json

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

30 changes: 11 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "@splitsoftware/splitio",
"version": "10.28.1-rc.4",
"version": "11.0.0-rc.5",
"description": "Split SDK",
"files": [
"README.md",
"CONTRIBUTORS-GUIDE.md",
"LICENSE",
"CHANGES.txt",
"lib",
"cjs",
"types",
"es",
"esm",
"src",
"scripts/ga-to-split-autorequire.js",
"client",
"server"
],
Expand All @@ -32,17 +31,14 @@
"sdk",
"javascript"
],
"main": "lib/index.js",
"module": "es/index.js",
"main": "cjs/index.js",
"module": "esm/index.js",
"types": "types",
"engines": {
"npm": ">=3",
"node": ">=6"
"node": ">=14.0.0"
},
"dependencies": {
"@splitsoftware/splitio-commons": "1.17.1-rc.4",
"@types/google.analytics": "0.0.40",
"@types/ioredis": "^4.28.0",
"@splitsoftware/splitio-commons": "2.0.0-rc.6",
"bloom-filters": "^3.0.0",
"ioredis": "^4.28.0",
"js-yaml": "^3.13.1",
Expand Down Expand Up @@ -84,14 +80,13 @@
"webpack-merge": "^5.8.0"
},
"scripts": {
"build-esm": "rimraf es && tsc -outDir es",
"postbuild-esm": "cross-env NODE_ENV=es node scripts/copy.packages.json.js && ./scripts/build_esm_replace_imports.sh",
"build-esm": "rimraf esm && tsc -outDir esm",
"postbuild-esm": "cross-env NODE_ENV=esm node scripts/copy.packages.json.js && ./scripts/build_esm_replace_imports.sh",
"build-umd:stats": "webpack --progress --env production --json > ./stats/stat_results.json",
"build-cjs": "rimraf lib && tsc -outDir lib -m CommonJS",
"build-cjs": "rimraf cjs && tsc -outDir cjs -m CommonJS",
"postbuild-cjs": "cross-env NODE_ENV=cjs node scripts/copy.packages.json.js && ./scripts/build_cjs_replace_imports.sh",
"build-umd": "rimraf umd && webpack --config webpack.dev.js --env branch=$BUILD_BRANCH && webpack --config webpack.prod.js --env branch=$BUILD_BRANCH && ./scripts/clean_umd_build.sh",
"build:npm": "npm run build-cjs && npm run build-esm",
"build:ga-to-split-autorequire": "terser ./node_modules/@splitsoftware/splitio-commons/src/integrations/ga/autoRequire.js --mangle --output ./scripts/ga-to-split-autorequire.js && cp ./scripts/ga-to-split-autorequire.js umd/ga-to-split-autorequire.js",
"build": "npm run build-cjs && npm run build-esm && npm run build-umd",
"check": "npm run check:lint && npm run check:version",
"check:lint": "eslint src",
Expand All @@ -104,7 +99,6 @@
"test-browser-e2e-destroy": "cross-env NODE_ENV=test karma start karma/e2e.destroy.karma.conf.js",
"test-browser-e2e-errorCatching": "cross-env NODE_ENV=test karma start karma/e2e.errorCatching.karma.conf.js",
"test-browser-e2e-push": "cross-env NODE_ENV=test karma start karma/e2e.push.karma.conf.js",
"test-browser-e2e-gaIntegration": "cross-env NODE_ENV=test karma start karma/e2e.gaIntegration.karma.conf.js",
"test-node": "npm run test-node-unit && npm run test-node-e2e",
"test-node-unit": "cross-env NODE_ENV=test tape -r ./ts-node.register \"src/*/**/__tests__/**/!(browser).spec.js\" | tap-min",
"test-node-e2e": "npm run test-node-e2e-online && npm run test-node-e2e-offline && npm run test-node-e2e-destroy && npm run test-node-e2e-errorCatching && npm run test-node-e2e-push && npm run test-node-e2e-redis",
Expand All @@ -114,9 +108,7 @@
"test-node-e2e-errorCatching": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/errorCatching/node.spec.js | tap-min",
"test-node-e2e-push": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/push/node.spec.js | tap-min",
"test-node-e2e-redis": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/consumer/node_redis.spec.js | tap-min",
"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 && npm install",
"test-ts-decls": "tsc --build ts-tests",
"test": "npm run test-node && npm run test-browser",
"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 canary",
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_cjs_replace_imports.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# replace splitio-commons imports to use ES modules
replace '@splitsoftware/splitio-commons/src' '@splitsoftware/splitio-commons/cjs' ./lib -r
# replace splitio-commons imports to use CommonJS
replace '@splitsoftware/splitio-commons/src' '@splitsoftware/splitio-commons/cjs' ./cjs -r

if [ $? -eq 0 ]
then
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_esm_replace_imports.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# replace splitio-commons imports to use ES modules
replace '@splitsoftware/splitio-commons/src' '@splitsoftware/splitio-commons/esm' ./es -r
# replace splitio-commons imports to use EcmaScript Modules
replace '@splitsoftware/splitio-commons/src' '@splitsoftware/splitio-commons/esm' ./esm -r

if [ $? -eq 0 ]
then
Expand Down
4 changes: 2 additions & 2 deletions scripts/copy.packages.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const copyfiles = require('copyfiles');

const input = './src/**/package.json';
const outputCjsDir = './lib';
const outputEsmDir = './es';
const outputCjsDir = './cjs';
const outputEsmDir = './esm';

copyfiles([input, process.env.NODE_ENV === 'cjs' ? outputCjsDir : outputEsmDir], {
up: 1,
Expand Down
1 change: 0 additions & 1 deletion scripts/ga-to-split-autorequire.js

This file was deleted.

28 changes: 0 additions & 28 deletions scripts/ts-tests.sh

This file was deleted.

4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"main": "../lib/factory/node.js",
"module": "../es/factory/node.js",
"main": "../cjs/factory/node.js",
"module": "../esm/factory/node.js",
"types": "../types/server/index.d.ts"
}
2 changes: 1 addition & 1 deletion src/__tests__/browserSuites/telemetry.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default async function telemetryBrowserSuite(fetchMock, t) {
oM: 0, st: 'memory', aF: 1, rF: 0, sE: false,
rR: { sp: 99999, ms: 60, im: 300, ev: 60, te: 1 } /* override featuresRefreshRate */,
uO: { s: true, e: true, a: false, st: false, t: true } /* override sdk, events and telemetry URLs */,
iQ: 30000, eQ: 500, iM: 0, iL: false, hP: false, nR: 1 /* 1 non ready usage */, t: [], i: [], uC: 2 /* Default GRANTED */,
iQ: 30000, eQ: 500, iM: 0, iL: false, hP: false, nR: 1 /* 1 non ready usage */, t: [], uC: 2 /* Default GRANTED */,
fsT: 0, fsI: 0
}, 'metrics/config JSON payload should be the expected');

Expand Down
Loading
Loading