Skip to content

Commit

Permalink
정리하고 재시작
Browse files Browse the repository at this point in the history
  • Loading branch information
HyunSeob committed Aug 19, 2020
1 parent 6f6e694 commit 332db22
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 109 deletions.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2020 Toss Payments Co., Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "@tossteam/payments-web",
"description": "tosspayments.js 모듈 로더 & Web SDK Typings",
"version": "0.1.20",
"name": "@tosspayments/sdk",
"description": "tosspayments.js 스크립트 로더",
"version": "0.0.6",
"main": "dist/tosspayments.cjs.js",
"module": "dist/tosspayments.esm.js",
"types": "types/index.d.ts",
"author": "TossPayments",
"author": "Toss Payments",
"scripts": {
"build": "rm -rf dist && rollup -c",
"build": "rm -rf dist && rollup -c && tsc --emitDeclarationOnly -p types/tsconfig.json",
"test": "jest"
},
"license": "UNLICENSED",
"private": false,
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.0",
Expand All @@ -29,5 +28,8 @@
"src",
"dist",
"types"
]
],
"dependencies": {
"@tosspayments/js-sdk-types": "^0.0.6"
}
}
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
///<reference path='../types/index.d.ts' />

import { TossPaymentsInstance } from '../types';
import { TossPaymentsInstance } from '@tosspayments/js-sdk-types';

const SCRIPT_URL = '//web.tosspayments.com/sdk/v1/tosspayments.js';

Expand Down Expand Up @@ -39,3 +37,5 @@ export async function loadTossPayments(clientKey: string): Promise<TossPaymentsI

return cachedPromise;
}

export { TossPaymentsInstance };
10 changes: 0 additions & 10 deletions src/legacy.ts

This file was deleted.

15 changes: 3 additions & 12 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
import TossPayments from './tosspayments';

export type TossPaymentsConstuctor = typeof TossPayments;
export type TossPaymentsInstance = ReturnType<TossPaymentsConstuctor>;

export function loadTossPayments(clientKey: string): Promise<TossPaymentsInstance | null>;

declare global {
interface Window {
TossPayments?: TossPaymentsConstuctor;
}
}
import { TossPaymentsInstance } from '@tosspayments/js-sdk-types';
export declare function loadTossPayments(clientKey: string): Promise<TossPaymentsInstance | null>;
export { TossPaymentsInstance };
2 changes: 2 additions & 0 deletions types/index.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const SCRIPT_URL = "//web.tosspayments.com/sdk/alpha/tosspayments.js";
declare function dispatchLoadEvent(): void;
72 changes: 0 additions & 72 deletions types/tosspayments/index.d.ts

This file was deleted.

6 changes: 6 additions & 0 deletions types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"declarationDir": "."
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1017,10 +1017,10 @@
dependencies:
type-detect "4.0.8"

"@tossteam/payments-web@^0.1.12":
version "0.1.12"
resolved "https://registry.yarnpkg.com/@tossteam/payments-web/-/payments-web-0.1.12.tgz#fa1f0d8ac1185d0adbf9dfe92786f4557f16b147"
integrity sha512-JOZLBBlX/GWJXqhj9rDxDxdKwwDzH9NNkRqZcAfY+Ihoel7nFf1l+wktXXz0oirHHyLADBG1dWbSlwkXH8WV5w==
"@tosspayments/js-sdk-types@^0.0.6":
version "0.0.6"
resolved "https://registry.yarnpkg.com/@tosspayments/js-sdk-types/-/js-sdk-types-0.0.6.tgz#4af2562c69c2b13b1a9d5316ef55d3cd193b1a6e"
integrity sha512-zngkMgXbnw5d7z2fNRkTdQWi4fd2+47POtQQuJwSvbRVR7FsgQG1nygzZ1oDDEwnKIx5XvVtU/8/Lr1Hs6Uq4A==

"@types/babel__core@^7.1.7":
version "7.1.7"
Expand Down

0 comments on commit 332db22

Please sign in to comment.