@alma/widgets 3.1.1 → 3.1.3

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.
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@alma/widgets",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "Widgets to easily display information from Alma - https://getalma.eu",
5
- "keywords": [],
6
5
  "main": "dist/widgets.js",
7
6
  "umd:main": "dist/widgets.umd.js",
8
7
  "module": "dist/widgets.m.js",
@@ -19,73 +18,6 @@
19
18
  "engines": {
20
19
  "node": ">=6.0.0"
21
20
  },
22
- "scripts": {
23
- "start": "NODE_ENV=development microbundle --name Alma --sourcemap --jsx React.createElement --jsxImportSource react --globals react/jsx-runtime=jsx --define process.env.NODE_ENV=development --css-modules true --format umd watch",
24
- "test": "NODE_ENV=test jest --coverage",
25
- "test:no-coverage": "NODE_ENV=test jest",
26
- "test:watch": "NODE_ENV=test jest --watch",
27
- "test:prod": "npm run lint && npm run test -- --no-cache",
28
- "lint": "npx eslint src --ext .js,.ts,.tsx",
29
- "lint:fix": "npx eslint --fix src --ext .js,.ts,.tsx",
30
- "prebuild": "rm -rf dist",
31
- "build:minified": "NODE_ENV=production microbundle --name Alma --sourcemap --jsx React.createElement --jsxImportSource react --globals react/jsx-runtime=jsx --define process.env.NODE_ENV=production --css-modules true",
32
- "build:raw": "NODE_ENV=production microbundle --name Alma --sourcemap --jsx React.createElement --jsxImportSource react --globals react/jsx-runtime=jsx --define process.env.NODE_ENV=production --css-modules true --compress false -o ./raw",
33
- "build": "npm run build:minified && npm run build:raw && mv ./raw ./dist/",
34
- "semantic-release": "semantic-release",
35
- "translations:extract": "formatjs extract 'src/**/*.ts*' --out-file 'src/intl/messages.json' --format simple --ignore 'src/*.d.ts' && prettier ./src/intl --write",
36
- "translations:upload": "crowdin upload sources",
37
- "translations:download": "crowdin download && prettier ./src/intl --write"
38
- },
39
- "devDependencies": {
40
- "@babel/plugin-proposal-class-properties": "^7.12.1",
41
- "@babel/plugin-proposal-export-default-from": "^7.12.1",
42
- "@babel/plugin-transform-react-jsx": "^7.12.7",
43
- "@babel/plugin-transform-runtime": "^7.12.1",
44
- "@babel/preset-env": "^7.12.7",
45
- "@babel/preset-react": "^7.12.7",
46
- "@babel/preset-typescript": "^7.12.7",
47
- "@commitlint/cli": "^11.0.0",
48
- "@commitlint/config-conventional": "^11.0.0",
49
- "@crowdin/cli": "^3.7.1",
50
- "@formatjs/cli": "^4.4.0",
51
- "@google/semantic-release-replace-plugin": "^1.0.2",
52
- "@octokit/core": "^3.2.4",
53
- "@rollup/plugin-image": "^2.0.5",
54
- "@semantic-release/changelog": "^5.0.1",
55
- "@semantic-release/git": "^9.0.0",
56
- "@testing-library/jest-dom": "^5.14.1",
57
- "@testing-library/react": "^12.1.2",
58
- "@types/classnames": "^2.3.1",
59
- "@types/jest": "^26.0.16",
60
- "@types/no-scroll": "^2.1.0",
61
- "@types/node": "^14.14.10",
62
- "@types/react": "^17.0.30",
63
- "@types/react-dom": "^17.0.9",
64
- "@types/react-modal": "^3.13.1",
65
- "@typescript-eslint/eslint-plugin": "^4.9.1",
66
- "@typescript-eslint/parser": "^4.9.1",
67
- "babel-plugin-css-modules-transform": "^1.6.2",
68
- "commitizen": "^4.2.1",
69
- "core-js": "^3.8.1",
70
- "cz-conventional-changelog": "^3.3.0",
71
- "eslint": "^7.15.0",
72
- "eslint-config-prettier": "^6.15.0",
73
- "eslint-plugin-jest": "^24.1.0",
74
- "expect-type": "^0.9.2",
75
- "husky": "^4.3.5",
76
- "jest": "^26.6.0",
77
- "jest-config": "^26.6.0",
78
- "lint-staged": "^10.5.3",
79
- "microbundle": "github:olance/microbundle#rollup/config-override",
80
- "postcss-assets": "^5.0.0",
81
- "prettier": "^2.2.1",
82
- "rollup": "^1.32.1",
83
- "rollup-plugin-copy": "^3.4.0",
84
- "semantic-release": "^17.3.0",
85
- "ts-essentials": "^7.0.1",
86
- "ts-jest": "^26.4.1",
87
- "typescript": "^4.1.2"
88
- },
89
21
  "dependencies": {
90
22
  "classnames": "^2.3.1",
91
23
  "date-fns": "^2.28.0",
@@ -96,192 +28,12 @@
96
28
  "react-modal": "^3.14.4",
97
29
  "react-responsive": "^9.0.0-beta.6"
98
30
  },
99
- "commitlint": {
100
- "extends": [
101
- "@commitlint/config-conventional"
102
- ]
103
- },
104
31
  "config": {
105
32
  "commitizen": {
106
33
  "path": "./node_modules/cz-conventional-changelog"
107
34
  }
108
35
  },
109
- "eslintConfig": {
110
- "root": true,
111
- "parser": "@typescript-eslint/parser",
112
- "extends": [
113
- "eslint:recommended",
114
- "prettier"
115
- ],
116
- "rules": {
117
- "@typescript-eslint/no-unused-vars": [
118
- "warn",
119
- {
120
- "varsIgnorePattern": "^_+$",
121
- "argsIgnorePattern": "^_+$"
122
- }
123
- ]
124
- },
125
- "overrides": [
126
- {
127
- "files": [
128
- "*.ts",
129
- "*.tsx"
130
- ],
131
- "excludedFiles": [
132
- "*.test.ts"
133
- ],
134
- "env": {
135
- "browser": true
136
- },
137
- "extends": [
138
- "plugin:@typescript-eslint/recommended",
139
- "prettier/@typescript-eslint"
140
- ],
141
- "plugins": [
142
- "@typescript-eslint"
143
- ]
144
- },
145
- {
146
- "files": [
147
- "*.js"
148
- ],
149
- "env": {
150
- "node": true
151
- }
152
- },
153
- {
154
- "files": [
155
- "*.test.ts"
156
- ],
157
- "extends": [
158
- "plugin:@typescript-eslint/recommended",
159
- "prettier/@typescript-eslint",
160
- "plugin:jest/recommended"
161
- ],
162
- "env": {
163
- "es6": true,
164
- "node": true,
165
- "jest/globals": true
166
- },
167
- "plugins": [
168
- "@typescript-eslint",
169
- "jest"
170
- ],
171
- "parserOptions": {
172
- "ecmaVersion": 2019,
173
- "sourceType": "module"
174
- },
175
- "rules": {
176
- "jest/expect-expect": [
177
- "warn",
178
- {
179
- "assertFunctionNames": [
180
- "expect",
181
- "expectTypeOf"
182
- ]
183
- }
184
- ]
185
- }
186
- }
187
- ]
188
- },
189
- "eslintIgnore": [
190
- "node_modules",
191
- "dist"
192
- ],
193
- "husky": {
194
- "hooks": {
195
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
196
- "pre-commit": "lint-staged",
197
- "pre-push": "npm run test:prod && npm run build"
198
- }
199
- },
200
- "jest": {
201
- "testEnvironment": "jsdom",
202
- "rootDir": "src",
203
- "moduleNameMapper": {
204
- "\\.s?css": "<rootDir>/__mocks__/styleMock.js",
205
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
206
- "^@/(.*)$": [
207
- "<rootDir>/src/$1"
208
- ],
209
- "^test/(.*)$": [
210
- "<rootDir>/test/$1"
211
- ]
212
- },
213
- "moduleFileExtensions": [
214
- "ts",
215
- "tsx",
216
- "js"
217
- ],
218
- "coveragePathIgnorePatterns": [
219
- "/node_modules/",
220
- "/test/"
221
- ],
222
- "coverageThreshold": {
223
- "global": {
224
- "branches": 0,
225
- "functions": 0,
226
- "lines": 0,
227
- "statements": 0
228
- }
229
- },
230
- "collectCoverageFrom": [
231
- "src/**/*.{js,ts}"
232
- ]
233
- },
234
- "lint-staged": {
235
- "{src,test}/**/*.ts": [
236
- "prettier --write"
237
- ]
238
- },
239
- "prettier": {
240
- "semi": false,
241
- "singleQuote": true,
242
- "trailingComma": "all"
243
- },
244
36
  "publishConfig": {
245
37
  "access": "public"
246
- },
247
- "release": {
248
- "plugins": [
249
- "@semantic-release/commit-analyzer",
250
- [
251
- "@google/semantic-release-replace-plugin",
252
- {
253
- "replacements": [
254
- {
255
- "files": [
256
- "dist/**"
257
- ],
258
- "from": "%%_SEMANTIC_VERSION_%%",
259
- "to": "${nextRelease.version}",
260
- "countMatches": true
261
- }
262
- ]
263
- }
264
- ],
265
- "@semantic-release/release-notes-generator",
266
- [
267
- "@semantic-release/changelog",
268
- {
269
- "changelogFile": "CHANGELOG.md"
270
- }
271
- ],
272
- "@semantic-release/npm",
273
- "@semantic-release/github",
274
- [
275
- "@semantic-release/git",
276
- {
277
- "assets": [
278
- "dist/**",
279
- "CHANGELOG.md",
280
- "package.json"
281
- ],
282
- "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
283
- }
284
- ]
285
- ]
286
38
  }
287
39
  }
@@ -1,77 +0,0 @@
1
- import { EligibilityPlan } from 'types';
2
- export declare const mockPlansAllEligible: EligibilityPlan[];
3
- export declare const mockButtonPlans: ({
4
- customer_total_cost_amount: number;
5
- customer_total_cost_bps: number;
6
- deferred_days: number;
7
- deferred_months: number;
8
- eligible: boolean;
9
- installments_count: number;
10
- payment_plan: {
11
- customer_fee: number;
12
- customer_interest: number;
13
- due_date: number;
14
- purchase_amount: number;
15
- total_amount: number;
16
- }[];
17
- purchase_amount: number;
18
- annual_interest_rate?: undefined;
19
- } | {
20
- annual_interest_rate: number;
21
- customer_total_cost_amount: number;
22
- customer_total_cost_bps: number;
23
- deferred_days: number;
24
- deferred_months: number;
25
- eligible: boolean;
26
- installments_count: number;
27
- payment_plan: {
28
- customer_fee: number;
29
- customer_interest: number;
30
- due_date: number;
31
- purchase_amount: number;
32
- refunded_interest: number;
33
- total_amount: number;
34
- }[];
35
- purchase_amount: number;
36
- })[];
37
- export declare const mockEligibilityPaymentPlanWithIneligiblePlan: ({
38
- customer_fee: number;
39
- customer_interest: number;
40
- customer_total_cost_amount: number;
41
- customer_total_cost_bps: number;
42
- deferred_days: number;
43
- deferred_months: number;
44
- eligible: boolean;
45
- installments_count: number;
46
- payment_plan: {
47
- customer_fee: number;
48
- customer_interest: number;
49
- due_date: number;
50
- purchase_amount: number;
51
- total_amount: number;
52
- }[];
53
- purchase_amount: number;
54
- constraints?: undefined;
55
- reasons?: undefined;
56
- } | {
57
- constraints: {
58
- purchase_amount: {
59
- maximum: number;
60
- minimum: number;
61
- };
62
- };
63
- deferred_days: number;
64
- deferred_months: number;
65
- eligible: boolean;
66
- installments_count: number;
67
- purchase_amount: number;
68
- reasons: {
69
- purchase_amount: string;
70
- };
71
- customer_fee?: undefined;
72
- customer_interest?: undefined;
73
- customer_total_cost_amount?: undefined;
74
- customer_total_cost_bps?: undefined;
75
- payment_plan?: undefined;
76
- })[];
77
- export declare const mockPlansWithoutDeferred: EligibilityPlan[];
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { Locale } from 'types';
3
- declare type Props = {
4
- locale: Locale;
5
- };
6
- declare const renderWithProviders: (ui: React.ReactNode, { locale }?: Props) => React.ReactNode;
7
- export default renderWithProviders;