core-js-builder 3.27.1 → 3.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2022 Denis Pushkarev
1
+ Copyright (c) 2014-2023 Denis Pushkarev
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -6,6 +6,9 @@
6
6
 
7
7
  </div>
8
8
 
9
+ **I highly recommend reading this: [So, what's next?](https://github.com/zloirock/core-js/blob/master/docs/2023-02-14-so-whats-next.md)**
10
+ ---
11
+
9
12
  For some cases could be useful to exclude some `core-js` features or generate a polyfill for target engines. This API helps conditionally include or exclude certain parts of [`core-js`](https://github.com/zloirock/core-js) and build for targets. `modules`, `exclude` and `targets` options are specified in [the `core-js-compat` format](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat).
10
13
 
11
14
  ```js
@@ -32,3 +35,5 @@ const bundle = await builder({
32
35
  filename: PATH_TO_MY_COREJS_BUNDLE,
33
36
  });
34
37
  ```
38
+
39
+ ℹ️ When using TypeScript, make sure to set `esModuleInterop` to `true`.
package/config.js CHANGED
@@ -5,7 +5,7 @@ module.exports = {
5
5
  /* eslint-disable prefer-template -- for better formatting */
6
6
  banner: '/**\n' +
7
7
  ' * core-js ' + version + '\n' +
8
- ' * © 2014-2022 Denis Pushkarev (zloirock.ru)\n' +
8
+ ' * © 2014-2023 Denis Pushkarev (zloirock.ru)\n' +
9
9
  ' * license: https://github.com/zloirock/core-js/blob/v' + version + '/LICENSE\n' +
10
10
  ' * source: https://github.com/zloirock/core-js\n' +
11
11
  ' */',
package/index.d.ts ADDED
@@ -0,0 +1,71 @@
1
+ type StringOrRegExp = string | RegExp;
2
+
3
+ type Modules = StringOrRegExp | readonly StringOrRegExp[];
4
+
5
+ type Target =
6
+ | 'android'
7
+ | 'bun'
8
+ | 'chrome'
9
+ | 'chrome-android'
10
+ | 'deno'
11
+ | 'edge'
12
+ | 'electron'
13
+ | 'firefox'
14
+ | 'firefox-android'
15
+ | 'hermes'
16
+ | 'ie'
17
+ | 'ios'
18
+ | 'node'
19
+ | 'opera'
20
+ | 'opera-android'
21
+ | 'phantom'
22
+ | 'quest'
23
+ | 'react-native'
24
+ | 'rhino'
25
+ | 'safari'
26
+ | 'samsung';
27
+
28
+ type BrowserslistQuery = string | ReadonlyArray<string>;
29
+
30
+ type Environments = {
31
+ [target in Target]?: string | number;
32
+ };
33
+
34
+ type Targets = Environments & {
35
+ browsers?: Environments | BrowserslistQuery,
36
+ esmodules?: boolean,
37
+ };
38
+
39
+ type Format = 'bundle' | 'esm' | 'cjs';
40
+
41
+ type SummaryEntry = boolean | {
42
+ size?: boolean,
43
+ modules?: boolean,
44
+ };
45
+
46
+ type Summary = {
47
+ /** in the console, you could specify required parts or set `true` for enable all of them */
48
+ comment?: SummaryEntry,
49
+ /** in the comment, you could specify required parts or set `true` for enable all of them */
50
+ console?: SummaryEntry,
51
+ };
52
+
53
+ type Options = {
54
+ /** entry / module / namespace / an array of them, by default - all `core-js` modules */
55
+ modules?: Modules,
56
+ /** a blacklist, entry / module / namespace / an array of them, by default - empty list */
57
+ exclude?: Modules,
58
+ /** optional browserslist or core-js-compat format query */
59
+ targets?: Targets | BrowserslistQuery,
60
+ /** output format, 'bundle' by default, can be 'cjs' or 'esm', and in this case
61
+ * the result will not be bundled and will contain imports of required modules */
62
+ format?: Format,
63
+ /** optional target filename, if it's missed a file will not be created */
64
+ filename?: string,
65
+ /** shows summary for the bundle, disabled by default */
66
+ summary?: Summary,
67
+ };
68
+
69
+ declare function builder(options?: Options): Promise<string>;
70
+
71
+ export = builder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-js-builder",
3
- "version": "3.27.1",
3
+ "version": "3.28.0",
4
4
  "description": "core-js builder",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,9 +19,10 @@
19
19
  },
20
20
  "sideEffects": false,
21
21
  "main": "index.js",
22
+ "types": "index.d.ts",
22
23
  "dependencies": {
23
- "core-js": "3.27.1",
24
- "core-js-compat": "3.27.1",
24
+ "core-js": "3.28.0",
25
+ "core-js-compat": "3.28.0",
25
26
  "mkdirp": ">=0.5.5 <1",
26
27
  "webpack": ">=4.46.0 <5"
27
28
  },