Skip to content
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

Proof-of-concept: Rewrite to ts #212

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": 3,
"targets": {
"browsers": [
"> 1%",
"last 10 chrome major versions",
"last 10 firefox major versions",
"last 10 opera major versions",
"last 2 safari major versions",
"last 2 ios major versions",
"last 2 ie major versions",
"last 5 edge major versions"
]
}
}
],
"@babel/preset-typescript"
],
"plugins": ["@babel/plugin-proposal-class-properties"]
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
coverage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to myself: we need to add eslint typescript plugin

docs/
node_modules/
webpack.config.js
6 changes: 6 additions & 0 deletions @types/globals.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export {};
declare global {
interface Window {
openSimplifiedLoginWidget?: (initialParams: any, loginHandler: any, loginNotYouHandler: any) => void;
}
}
21 changes: 0 additions & 21 deletions build.sh

This file was deleted.

3 changes: 3 additions & 0 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

rm -rf es5
Comment on lines +1 to +3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file is not used 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the folder webpack use to output es5 into, so at least for now it is still used and should be cleaned I think. (This was the only non-webpack command from the old build.sh)

5 changes: 5 additions & 0 deletions identity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Copyright 2018 Schibsted Products & Technology AS. Licensed under the terms of the MIT license.
* See LICENSE.md in the project root.
*/

export { default, Identity } from './src/identity.js';
2 changes: 0 additions & 2 deletions index.js → index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* See LICENSE.md in the project root.
*/

'use strict';

export * from './identity.js';
export * from './monetization.js';
export * from './payment.js';
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ module.exports = {
testPathIgnorePatterns: [
'/node_modules/',
'__tests__/utils.js',
'webpack.config.js',
],
};
Loading