Skip to content

Commit 3b9217d

Browse files
authored
fix(payment-widget): token (#149)
* fix(common): yarn bump * feat(common): add sdks * feat(payment-widget): transform to esm * feat(payment-widget): add sdk * feat(payment-widget): add sdk * feat(payment-widget): esm
1 parent 3ffae52 commit 3b9217d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+6510
-10349
lines changed

.config/husky/.gitignore

-1
This file was deleted.

.config/husky/commit-msg

100644100755
File mode changed.

.config/husky/prepare-commit-msg

100644100755
File mode changed.

.pnp.cjs

+3,465-6,103
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vim/coc-settings.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"eslint.packageManager": "yarn",
3+
"eslint.nodePath": ".yarn/sdks",
4+
"workspace.workspaceFolderCheckCwd": false,
5+
"tsserver.tsdk": ".yarn/sdks/typescript/lib"
6+
}

.yarn/releases/yarn.cjs .yarn/releases/yarn-remote.mjs

+1,455-981
Large diffs are not rendered by default.

.yarn/sdks/eslint/bin/eslint.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
17+
if (existsSync(absPnpApiPath)) {
18+
if (!process.versions.pnp) {
19+
// Setup the environment to be able to require eslint/bin/eslint.js
20+
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
24+
}
25+
}
26+
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real eslint/bin/eslint.js your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint/bin/eslint.js`));

.yarn/sdks/eslint/lib/api.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
17+
if (existsSync(absPnpApiPath)) {
18+
if (!process.versions.pnp) {
19+
// Setup the environment to be able to require eslint
20+
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
24+
}
25+
}
26+
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real eslint your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
17+
if (existsSync(absPnpApiPath)) {
18+
if (!process.versions.pnp) {
19+
// Setup the environment to be able to require eslint
20+
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
24+
}
25+
}
26+
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real eslint your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
17+
if (existsSync(absPnpApiPath)) {
18+
if (!process.versions.pnp) {
19+
// Setup the environment to be able to require eslint/rules
20+
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
24+
}
25+
}
26+
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real eslint/rules your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint/rules`));
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
17+
if (existsSync(absPnpApiPath)) {
18+
if (!process.versions.pnp) {
19+
// Setup the environment to be able to require eslint/universal
20+
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
24+
}
25+
}
26+
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real eslint/universal your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint/universal`));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
17+
if (existsSync(absPnpApiPath)) {
18+
if (!process.versions.pnp) {
19+
// Setup the environment to be able to require eslint/use-at-your-own-risk
20+
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
24+
}
25+
}
26+
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real eslint/use-at-your-own-risk your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`));

.yarn/sdks/eslint/lib/universal.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
17+
if (existsSync(absPnpApiPath)) {
18+
if (!process.versions.pnp) {
19+
// Setup the environment to be able to require eslint/universal
20+
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
24+
}
25+
}
26+
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real eslint/universal your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint/universal`));
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
17+
if (existsSync(absPnpApiPath)) {
18+
if (!process.versions.pnp) {
19+
// Setup the environment to be able to require eslint/use-at-your-own-risk
20+
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
24+
}
25+
}
26+
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real eslint/use-at-your-own-risk your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`));

.yarn/sdks/eslint/package.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "eslint",
3+
"version": "9.16.0-sdk",
4+
"main": "./lib/api.js",
5+
"type": "commonjs",
6+
"bin": {
7+
"eslint": "./bin/eslint.js"
8+
},
9+
"exports": {
10+
".": {
11+
"types": "./lib/types/index.d.ts",
12+
"default": "./lib/api.js"
13+
},
14+
"./package.json": "./package.json",
15+
"./use-at-your-own-risk": {
16+
"types": "./lib/types/use-at-your-own-risk.d.ts",
17+
"default": "./lib/unsupported-api.js"
18+
},
19+
"./rules": {
20+
"types": "./lib/types/rules/index.d.ts"
21+
},
22+
"./universal": {
23+
"types": "./lib/types/universal.d.ts",
24+
"default": "./lib/universal.js"
25+
}
26+
}
27+
}

.yarn/sdks/integrations.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# This file is automatically generated by @yarnpkg/sdks.
22
# Manual changes might be lost!
33

4+
integrations:
5+
- vim

.yarnrc.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ defaultSemverRangePrefix: ''
44

55
enableGlobalCache: true
66

7-
pnpEnableEsmLoader: true
8-
97
globalFolder: ../.yarn/berry
108

119
packageExtensions:
12-
ts-jest@*:
13-
dependencies:
14-
jest: '*'
15-
typescript: 4.6.2
1610
'@atls-ui-parts/text@*':
1711
dependencies:
1812
'@types/styled-system': '*'
1913
'@emotion/utils@*':
2014
dependencies:
2115
'@emotion/sheet': '*'
16+
'@testing-library/react@*':
17+
dependencies:
18+
'@testing-library/dom': '*'
19+
20+
pnpEnableEsmLoader: true
21+
2222
preferReuse: true
2323

24-
yarnPath: .yarn/releases/yarn.cjs
24+
yarnPath: .yarn/releases/yarn-remote.mjs

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
"csstype": "3.1.2"
1515
},
1616
"devDependencies": {
17-
"@atls/code-runtime": "1.1.0",
18-
"@types/node": "22.1.0",
17+
"@atls/code-runtime": "2.0.5",
18+
"@types/node": "22.10.1",
1919
"@types/testing-library__jest-dom": "5.14.2",
20+
"eslint": "9.16.0",
2021
"typescript": "5.4.2"
2122
},
22-
"packageManager": "yarn@4.0.0"
23+
"packageManager": "yarn@4.5.3"
2324
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import 'global-jsdom/register'
2+
3+
import assert from 'node:assert/strict'
4+
import { it } from 'node:test'
5+
import { describe } from 'node:test'
6+
7+
import { render } from '@testing-library/react'
8+
import { fireEvent } from '@testing-library/react'
9+
import React from 'react'
10+
11+
import { LanguagesType } from '../src/index.js'
12+
import { Widget } from '../src/index.js'
13+
import { InputWrapper } from '../src/index.js'
14+
import { AdditionalFieldsType } from '../src/index.js'
15+
16+
const Form = (
17+
<Widget settings={{ storeId: 'tinkoffTest', language: LanguagesType.RUSSIAN }} amount={1000}>
18+
<InputWrapper name={AdditionalFieldsType.Phone}>
19+
{(props) => <input {...props} placeholder='Phone' />}
20+
</InputWrapper>
21+
</Widget>
22+
)
23+
24+
describe('Payment Widget', () => {
25+
it('render', async () => {
26+
const body = render(Form)
27+
28+
const button = await body.findByRole('button')
29+
30+
fireEvent.click(button)
31+
32+
assert.ok(button.innerHTML)
33+
})
34+
})

0 commit comments

Comments
 (0)