@flagship.io/react-sdk 2.2.0-alpha.5 → 2.2.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,7 @@ export interface FsStatus {
24
24
  */
25
25
  firstInitSuccess?: string;
26
26
  }
27
- interface FsState {
27
+ export interface FsState {
28
28
  visitor?: Visitor;
29
29
  config?: IFlagshipConfig;
30
30
  modifications?: Map<string, Modification>;
@@ -3,35 +3,18 @@ import { FsStatus } from './FlagshipContext';
3
3
  /**
4
4
  * Retrieve a modification value by its key. If no modification match the given key or if the stored value type and default value type do not match, default value will be returned.
5
5
  */
6
- export declare const useFsModifications: {
7
- <T>(params: modificationsRequested<T>[], activateAll?: boolean): Promise<Record<string, T>>;
8
- };
9
- /**
10
- * Retrieve a modification value by its key. If no modification match the given key or if the stored value type and default value type do not match, default value will be returned.
11
- */
12
- export declare const useFsModificationsSync: <T extends unknown>(params: modificationsRequested<T>[], activateAll?: boolean | undefined) => Record<string, T>;
6
+ export declare const useFsModifications: <T extends unknown>(params: modificationsRequested<T>[], activateAll?: boolean | undefined) => Record<string, T>;
13
7
  /**
14
8
  * Retrieve a modification value by its key. If no modification match the given key or if the stored value type and default value type do not match, default value will be returned.
15
9
  */
16
10
  export declare const useFsModification: {
17
- <T>(params: modificationsRequested<T>): Promise<T>;
18
- };
19
- /**
20
- * Retrieve a modification value by its key. If no modification match the given key or if the stored value type and default value type do not match, default value will be returned.
21
- */
22
- export declare const useFsModificationSync: {
23
11
  <T>(params: modificationsRequested<T>): T;
24
12
  };
25
13
  /**
26
14
  * Get the campaign modification information value matching the given key.
27
15
  * @param {string} key key which identify the modification.
28
16
  */
29
- export declare const useFsModificationInfo: (key: string) => Promise<Modification | null>;
30
- /**
31
- * Get the campaign modification information value matching the given key.
32
- * @param {string} key key which identify the modification.
33
- */
34
- export declare const useFsModificationInfoSync: {
17
+ export declare const useFsModificationInfo: {
35
18
  (key: string): Modification | null;
36
19
  };
37
20
  /**
File without changes
File without changes
package/package.json CHANGED
@@ -1,19 +1,22 @@
1
1
  {
2
2
  "name": "@flagship.io/react-sdk",
3
- "version": "2.2.0-alpha.5",
3
+ "version": "2.2.0-alpha.9",
4
4
  "description": "Flagship REACT SDK",
5
5
  "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/types/index.d.ts",
7
8
  "files": [
8
- "dist/*",
9
+ "dist/**/*",
9
10
  "CONTRIBUTING.md",
10
11
  "README.md"
11
12
  ],
12
13
  "dependencies": {
13
- "@flagship.io/js-sdk": "^2.3.1-alpha.4"
14
+ "@flagship.io/js-sdk": "^2.3.1-alpha.6",
15
+ "encoding": "^0.1.13"
14
16
  },
15
17
  "peerDependencies": {
16
- "react": "^16.8.0"
18
+ "react": "^16.8.0 || ^17.0.0",
19
+ "react-dom": "^16.8.0 || ^17.0.0"
17
20
  },
18
21
  "homepage": "https://github.com/flagship-io/flagship-react-sdk",
19
22
  "repository": {
@@ -27,8 +30,10 @@
27
30
  "sdk"
28
31
  ],
29
32
  "devDependencies": {
33
+ "@babel/cli": "^7.14.6",
30
34
  "@babel/core": "^7.14.6",
31
35
  "@babel/preset-env": "^7.14.7",
36
+ "@babel/preset-react": "^7.14.5",
32
37
  "@babel/preset-typescript": "^7.14.5",
33
38
  "@testing-library/jest-dom": "^5.11.4",
34
39
  "@testing-library/react": "^11.1.0",
@@ -41,6 +46,8 @@
41
46
  "@typescript-eslint/eslint-plugin": "^4.32.0",
42
47
  "@typescript-eslint/parser": "^4.32.0",
43
48
  "babel-loader": "^8.2.2",
49
+ "babel-plugin-add-module-exports": "^1.0.4",
50
+ "core-js": "^3.18.1",
44
51
  "eslint": "^7.32.0",
45
52
  "eslint-config-standard": "^16.0.3",
46
53
  "eslint-plugin-import": "^2.24.2",
@@ -51,6 +58,8 @@
51
58
  "react": "^17.0.2",
52
59
  "react-dom": "^17.0.2",
53
60
  "react-test-renderer": "^17.0.2",
61
+ "regenerator-runtime": "^0.13.9",
62
+ "terser-webpack-plugin": "^5.2.4",
54
63
  "ts-jest": "^27.0.3",
55
64
  "ts-loader": "^9.2.3",
56
65
  "typescript": "^4.4.3",
@@ -63,8 +72,12 @@
63
72
  "dev": "tsc --watch",
64
73
  "test": "jest",
65
74
  "lint": "eslint . --ext .tsx",
66
- "build:prod": "rm -Rf dist && NODE_ENV=production webpack",
67
- "build": "rm -Rf dist && webpack"
75
+ "clean": "rm -rf dist && mkdir dist",
76
+ "build:es": "BABEL_ENV=es babel src --extensions '.ts,.tsx' --out-dir dist/es --copy-files",
77
+ "build:esm": "BABEL_ENV=esm babel src --extensions '.ts,.tsx' --out-dir dist/esm --copy-files",
78
+ "build:types": "tsc --noEmit false --declaration --emitDeclarationOnly --outDir dist/types",
79
+ "build:prod": "NODE_ENV=production webpack",
80
+ "build": "npm run clean && npm run build:es && npm run build:esm && npm run build:types && npm run build:prod"
68
81
  },
69
82
  "eslintConfig": {
70
83
  "extends": [