Skip to content

Commit 2606cc8

Browse files
committed
chore: update dependencies, add modules export
1 parent baa04ef commit 2606cc8

File tree

5 files changed

+101
-62
lines changed

5 files changed

+101
-62
lines changed

.babelrc

Lines changed: 0 additions & 16 deletions
This file was deleted.

.babelrc.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const sharedPresets = [];
2+
const shared = {
3+
4+
}
5+
6+
module.exports = {
7+
env: {
8+
esmUnbundled: shared,
9+
esmBundled: {
10+
...shared,
11+
presets: [['@babel/env', {
12+
targets: "> 0.25%, not dead"
13+
}], ...sharedPresets],
14+
},
15+
cjs: {
16+
...shared,
17+
presets: [['@babel/env', {
18+
modules: 'commonjs'
19+
}], ...sharedPresets],
20+
},
21+
test: {
22+
presets: ['@babel/env', ...sharedPresets]
23+
},
24+
}
25+
}

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55
"main": "dist/plugins-client-sdk.js",
66
"module": "dist/plugins-client-sdk.esm.js",
77
"browser": "dist/plugins-client-sdk.umd.js",
8+
"exports": {
9+
"require": "./dist/cjs/index.js",
10+
"import": "./dist/esm/index.js"
11+
},
812
"scripts": {
9-
"build": "rollup -c",
13+
"build:esm": "BABEL_ENV=esmUnbundled babel src --extensions '.js' --out-dir 'dist/esm' --source-maps",
14+
"build:cjs": "BABEL_ENV=cjs babel src --extensions '.js' --out-dir 'dist/cjs' --source-maps",
15+
"build:bundles": "BABEL_ENV=esmBundled rollup -c",
16+
"build": "yarn build:esm & yarn build:cjs & yarn build:bundles",
1017
"prebuild": "yarn run lint",
1118
"prepare": "husky install",
1219
"dev": "rollup -c -w --config rollup.dev.js",
@@ -51,7 +58,7 @@
5158
}
5259
],
5360
"dependencies": {
54-
"fast-async": "7",
61+
"@babel/cli": "7.16.8",
5562
"jsdoc": "^3.6.7",
5663
"loglevel": "^1.8.0",
5764
"object.entries-ponyfill": "1.0.1"

rollup.config.js

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,22 @@ Bundle of <%= pkg.name %>
1818
@license <%= pkg.license %>
1919
`;
2020

21+
const stripLog = stripLogger({
22+
variableNames: ['log'],
23+
propertyNames: ['debug', 'info', 'enableAll'],
24+
packageNames: ['log-level']
25+
});
26+
27+
2128
const defaultPlugins = [
22-
stripLogger({
23-
variableNames: ['log'],
24-
propertyNames: ['debug', 'info', 'enableAll'],
25-
packageNames: ['log-level']
26-
}),
29+
stripLog,
2730
resolve(),
2831
commonjs(),
29-
babel({ babelHelpers: 'bundled' }),
32+
babel({
33+
babelHelpers: 'bundled',
34+
include: ['src/**/*.js'],
35+
exclude: './node_modules/**'
36+
}),
3037
license({
3138
banner: bannerTemplate
3239
})
@@ -53,13 +60,12 @@ export default {
5360
plugins: [terser()]
5461
},
5562

56-
// CommonJS (for Node) and ES module (for bundlers) build.
57-
// (We could have three entries in the configuration array
58-
// instead of two, but it's quicker to generate multiple
59-
// builds from a single configuration where possible, using
60-
// an array for the `output` option, where we can specify
61-
// `file` and `format` for each target)
62-
{ file: pkg.main, format: 'cjs', sourcemap: true },
63-
{ file: pkg.module, format: 'esm', sourcemap: true }
63+
{ file: pkg.module, format: 'esm', sourcemap: true },
64+
{
65+
file: pkg.module.replace('.js', '.min.js'),
66+
format: 'esm',
67+
sourcemap: true,
68+
plugins: [terser()]
69+
}
6470
]
6571
};

yarn.lock

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010
"@semantic-release/npm" "^7.0.6"
1111
require-reload "^0.2.2"
1212

13+
14+
version "7.16.8"
15+
resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.16.8.tgz#44b9be7706762bfa3bff8adbf746da336eb0ab7c"
16+
integrity sha512-FTKBbxyk5TclXOGmwYyqelqP5IF6hMxaeJskd85jbR5jBfYlwqgwAbJwnixi1ZBbTqKfFuAA95mdmUFeSRwyJA==
17+
dependencies:
18+
commander "^4.0.1"
19+
convert-source-map "^1.1.0"
20+
fs-readdir-recursive "^1.1.0"
21+
glob "^7.0.0"
22+
make-dir "^2.1.0"
23+
slash "^2.0.0"
24+
source-map "^0.5.0"
25+
optionalDependencies:
26+
"@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3"
27+
chokidar "^3.4.0"
28+
1329
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13":
1430
version "7.12.13"
1531
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658"
@@ -76,7 +92,7 @@
7692
semver "^6.3.0"
7793
source-map "^0.5.0"
7894

79-
"@babel/generator@^7.0.0-beta.44", "@babel/generator@^7.14.2":
95+
"@babel/generator@^7.14.2":
8096
version "7.14.2"
8197
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.2.tgz#d5773e8b557d421fd6ce0d5efa5fd7fc22567c30"
8298
integrity sha512-OnADYbKrffDVai5qcpkMxQ7caomHOoEwjkouqnN2QhydAjowFAZcsdecFIRUBdb+ZcruwYE4ythYmF1UBZU5xQ==
@@ -246,7 +262,7 @@
246262
dependencies:
247263
"@babel/types" "^7.16.7"
248264

249-
"@babel/helper-module-imports@^7.0.0-beta.44", "@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.13.12":
265+
"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.13.12":
250266
version "7.13.12"
251267
resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977"
252268
integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==
@@ -1591,6 +1607,11 @@
15911607
"@types/yargs" "^16.0.0"
15921608
chalk "^4.0.0"
15931609

1610+
"@nicolo-ribaudo/[email protected]":
1611+
version "2.1.8-no-fsevents.3"
1612+
resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b"
1613+
integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==
1614+
15941615
"@nodelib/[email protected]":
15951616
version "2.1.4"
15961617
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69"
@@ -2696,11 +2717,6 @@ babel-preset-jest@^27.4.0:
26962717
babel-plugin-jest-hoist "^27.4.0"
26972718
babel-preset-current-node-syntax "^1.0.0"
26982719

2699-
babylon@^7.0.0-beta.44:
2700-
version "7.0.0-beta.47"
2701-
resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.47.tgz#6d1fa44f0abec41ab7c780481e62fd9aafbdea80"
2702-
integrity sha512-+rq2cr4GDhtToEzKFD6KZZMDBXhjFAr9JjPw9pAppZACeEWqNM294j+NdBzkSHYXwzzBmVjZ3nEVJlOhbR2gOQ==
2703-
27042720
balanced-match@^1.0.0:
27052721
version "1.0.2"
27062722
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
@@ -2960,7 +2976,7 @@ cheerio@^1.0.0-rc.2:
29602976
parse5-htmlparser2-tree-adapter "^6.0.1"
29612977
tslib "^2.2.0"
29622978

2963-
chokidar@^3.5.2:
2979+
chokidar@^3.4.0, chokidar@^3.5.2:
29642980
version "3.5.2"
29652981
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75"
29662982
integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==
@@ -3179,6 +3195,11 @@ commander@^2.20.0:
31793195
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
31803196
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
31813197

3198+
commander@^4.0.1:
3199+
version "4.1.1"
3200+
resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
3201+
integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==
3202+
31823203
31833204
version "1.1.0"
31843205
resolved "https://registry.yarnpkg.com/commenting/-/commenting-1.1.0.tgz#fae14345c6437b8554f30bc6aa6c1e1633033590"
@@ -3281,6 +3302,13 @@ conventional-commits-parser@^3.2.2, conventional-commits-parser@^3.2.3:
32813302
split2 "^3.0.0"
32823303
through2 "^4.0.0"
32833304

3305+
convert-source-map@^1.1.0:
3306+
version "1.8.0"
3307+
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369"
3308+
integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==
3309+
dependencies:
3310+
safe-buffer "~5.1.1"
3311+
32843312
convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0:
32853313
version "1.7.0"
32863314
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442"
@@ -4075,17 +4103,6 @@ [email protected], extsprintf@^1.2.0:
40754103
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
40764104
integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=
40774105

4078-
fast-async@7:
4079-
version "7.0.6"
4080-
resolved "https://registry.yarnpkg.com/fast-async/-/fast-async-7.0.6.tgz#a9bcc0b4aa6c7a5b25f0cec1a9b7324d13cb169b"
4081-
integrity sha512-/iUa3eSQC+Xh5tN6QcVLsEsN7b1DaPIoTZo++VpLLIxtdNW2tEmMZex4TcrMeRnBwMOpZwue2CB171wjt5Kgqg==
4082-
dependencies:
4083-
"@babel/generator" "^7.0.0-beta.44"
4084-
"@babel/helper-module-imports" "^7.0.0-beta.44"
4085-
babylon "^7.0.0-beta.44"
4086-
nodent-runtime "^3.2.1"
4087-
nodent-transform "^3.2.4"
4088-
40894106
fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
40904107
version "3.1.3"
40914108
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
@@ -4307,6 +4324,11 @@ fs-minipass@^2.0.0, fs-minipass@^2.1.0:
43074324
dependencies:
43084325
minipass "^3.0.0"
43094326

4327+
fs-readdir-recursive@^1.1.0:
4328+
version "1.1.0"
4329+
resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27"
4330+
integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==
4331+
43104332
fs-then-native@^2.0.0:
43114333
version "2.0.0"
43124334
resolved "https://registry.yarnpkg.com/fs-then-native/-/fs-then-native-2.0.0.tgz#19a124d94d90c22c8e045f2e8dd6ebea36d48c67"
@@ -4441,7 +4463,7 @@ glob-parent@^6.0.1:
44414463
dependencies:
44424464
is-glob "^4.0.3"
44434465

4444-
[email protected], glob@^7.2.0:
4466+
[email protected], glob@^7.0.0, glob@^7.2.0:
44454467
version "7.2.0"
44464468
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
44474469
integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
@@ -6415,16 +6437,6 @@ node-releases@^2.0.1:
64156437
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5"
64166438
integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==
64176439

6418-
nodent-runtime@^3.2.1:
6419-
version "3.2.1"
6420-
resolved "https://registry.yarnpkg.com/nodent-runtime/-/nodent-runtime-3.2.1.tgz#9e2755d85e39f764288f0d4752ebcfe3e541e00e"
6421-
integrity sha512-7Ws63oC+215smeKJQCxzrK21VFVlCFBkwl0MOObt0HOpVQXs3u483sAmtkF33nNqZ5rSOQjB76fgyPBmAUrtCA==
6422-
6423-
nodent-transform@^3.2.4:
6424-
version "3.2.9"
6425-
resolved "https://registry.yarnpkg.com/nodent-transform/-/nodent-transform-3.2.9.tgz#ec11a6116b5476e60bc212371cf6b8e4c74f40b6"
6426-
integrity sha512-4a5FH4WLi+daH/CGD5o/JWRR8W5tlCkd3nrDSkxbOzscJTyTUITltvOJeQjg3HJ1YgEuNyiPhQbvbtRjkQBByQ==
6427-
64286440
nopt@^5.0.0:
64296441
version "5.0.0"
64306442
resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88"
@@ -7700,6 +7712,11 @@ size-limit@^7.0.5:
77007712
nanospinner "^0.6.0"
77017713
picocolors "^1.0.0"
77027714

7715+
slash@^2.0.0:
7716+
version "2.0.0"
7717+
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
7718+
integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==
7719+
77037720
slash@^3.0.0:
77047721
version "3.0.0"
77057722
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"

0 commit comments

Comments
 (0)