Skip to content

Commit

Permalink
Merge branch 'v6' into feature/create-function-for-umd-bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
ribeiroguilherme committed Oct 23, 2023
2 parents fd10ebf + 11a8323 commit 905f976
Show file tree
Hide file tree
Showing 5 changed files with 298 additions and 77 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/.size-limit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Size limit

on: [pull_request]

jobs:
size:
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.15

- uses: andresz1/size-limit-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
directory: packages/lib
52 changes: 52 additions & 0 deletions packages/lib/.size-limit.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module.exports = [
/**
* UMD
*/
{
name: 'UMD',
path: 'dist/umd/adyen.js',
limit: '215 KB',
running: false,
},
/**
* 'auto' bundle with all Components included, excluding Languages
*/
{
name: 'Auto',
path: 'auto/auto.js',
import: "{ AdyenCheckout, Dropin }",
limit: '130 KB',
running: false,
},
/**
* ES modules (tree-shake)
*/
{
name: 'ESM - Core',
path: 'dist/es/index.js',
import: "{ AdyenCheckout }",
limit: '30 KB',
running: false,
},
{
name: 'ESM - Core + Card',
path: 'dist/es/index.js',
import: "{ AdyenCheckout, Card }",
limit: '70 KB',
running: false,
},
{
name: 'ESM - Core + Dropin with Card and Ideal',
path: 'dist/es/index.js',
import: "{ AdyenCheckout, Dropin, Card, Ideal }",
limit: '75 KB',
running: false,
},
{
name: 'ESM - Core + Dropin with Card and multiple languages',
path: 'dist/es/index.js',
import: "{ AdyenCheckout, Dropin, Card, pt_BR, nl_NL, es_ES }",
limit: '90 KB',
running: false,
},
]
9 changes: 4 additions & 5 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@
"test": "jest --config config/jest.config.cjs",
"test:watch": "npm run test -- --watchAll",
"test:coverage": "npm run test -- --coverage",
"size": "npm run build && node ./scripts/size",
"size-only": "node ./scripts/size",
"type-check": "tsc --noEmit",
"types:generate": "tsc --emitDeclarationOnly",
"format": "npm run lint:fix && npm run prettier:fix && npm run styles:fix",
Expand All @@ -78,7 +76,8 @@
"lint:fix": "npm run lint -- --fix",
"prettier:fix": "prettier \"src/**/*.{js,ts,tsx}\" \"package.json\" --write --loglevel silent",
"prepublishOnly": "npm run build",
"prepare": "cd ../.. && husky install packages/lib/.husky"
"prepare": "cd ../.. && husky install packages/lib/.husky",
"size": "npm run build && size-limit"
},
"devDependencies": {
"@rollup/plugin-commonjs": "25.0.4",
Expand All @@ -87,6 +86,7 @@
"@rollup/plugin-node-resolve": "15.2.1",
"@rollup/plugin-replace": "5.0.2",
"@rollup/plugin-terser": "0.4.3",
"@size-limit/preset-big-lib": "^9.0.0",
"@storybook/addon-a11y": "^7.4.6",
"@storybook/addon-essentials": "^7.4.6",
"@storybook/manager-api": "^7.4.6",
Expand All @@ -112,8 +112,6 @@
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-storybook": "^0.6.14",
"eslint-plugin-testing-library": "^5.9.1",
"filesize": "^10.0.0",
"gzip-size": "^6.0.0",
"husky": "^8.0.1",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
Expand All @@ -129,6 +127,7 @@
"rollup-plugin-swc3": "0.10.1",
"rollup-plugin-visualizer": "5.9.2",
"sass": "1.62.1",
"size-limit": "^9.0.0",
"storybook": "^7.4.6",
"stylelint": "15.10.1",
"stylelint-config-standard-scss": "7.0.1",
Expand Down
16 changes: 0 additions & 16 deletions packages/lib/scripts/size.js

This file was deleted.

Loading

0 comments on commit 905f976

Please sign in to comment.