Skip to content

Commit

Permalink
bump version (without publishing)
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Oct 13, 2023
1 parent 372f327 commit eafde5c
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 71 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
### Installation:[](#index)
```sh
// global version
npm install --save core-js@3.33.0
npm install --save core-js@4.0.0-alpha.0
// version without global namespace pollution
npm install --save @core-js/pure@3.33.0
npm install --save @core-js/pure@4.0.0-alpha.0
// bundled global version
npm install --save @core-js/bundle@3.33.0
npm install --save @core-js/bundle@4.0.0-alpha.0
```

Or you can use `core-js` [from CDN](https://www.jsdelivr.com/package/npm/@core-js/bundle).
Expand Down Expand Up @@ -310,9 +310,9 @@ import 'regenerator-runtime/runtime';

#### `@babel/preset-env`[](#index)

[`@babel/preset-env`](https://github.com/babel/babel/tree/master/packages/babel-preset-env) has `useBuiltIns` option, which optimizes working with global version of `core-js`. With `useBuiltIns` option, you should also set `corejs` option to used version of `core-js`, like `corejs: '3.33'`.
[`@babel/preset-env`](https://github.com/babel/babel/tree/master/packages/babel-preset-env) has `useBuiltIns` option, which optimizes working with global version of `core-js`. With `useBuiltIns` option, you should also set `corejs` option to used version of `core-js`, like `corejs: '4.0'`.

> **Warning!** Recommended to specify used minor `core-js` version, like `corejs: '3.33'`, instead of `corejs: 3`, since with `corejs: 3` will not be injected modules which were added in minor `core-js` releases.
> **Warning!** Recommended to specify used minor `core-js` version, like `corejs: '4.0'`, instead of `corejs: 4`, since with `corejs: 4` will not be injected modules which were added in minor `core-js` releases.
- `useBuiltIns: 'entry'` replaces imports of `core-js` to import only required for a target environment modules. So, for example,
```js
Expand Down Expand Up @@ -367,13 +367,13 @@ import 'core-js/modules/es.array.of';
var array = Array.of(1, 2, 3);
```

By default, `@babel/preset-env` with `useBuiltIns: 'usage'` option only polyfills stable features, but you can enable polyfilling of proposals by `proposals` option, as `corejs: { version: '3.33', proposals: true }`.
By default, `@babel/preset-env` with `useBuiltIns: 'usage'` option only polyfills stable features, but you can enable polyfilling of proposals by `proposals` option, as `corejs: { version: '4.0', proposals: true }`.

> **Warning!** In the case of `useBuiltIns: 'usage'`, you should not add `core-js` imports by yourself, they will be added automatically.
#### `@babel/runtime`[](#index)

[`@babel/runtime`](https://babeljs.io/docs/plugins/transform-runtime/) with `corejs: 3` option simplifies work with `@core-js/pure`. It automatically replaces usage of modern features from JS standard library to imports from the version of `core-js` without global namespace pollution, so instead of:
[`@babel/runtime`](https://babeljs.io/docs/plugins/transform-runtime/) with `corejs: 4` option simplifies work with `@core-js/pure`. It automatically replaces usage of modern features from JS standard library to imports from the version of `core-js` without global namespace pollution, so instead of:
```js
import from from '@core-js/pure/stable/array/from';
import flat from '@core-js/pure/stable/array/flat';
Expand All @@ -391,7 +391,7 @@ Array.from(new Set([1, 2, 3, 2, 1]));
Promise.resolve(32).then(x => console.log(x));
```

By default, `@babel/runtime` only polyfills stable features, but like in `@babel/preset-env`, you can enable polyfilling of proposals by `proposals` option, as `corejs: { version: 3, proposals: true }`.
By default, `@babel/runtime` only polyfills stable features, but like in `@babel/preset-env`, you can enable polyfilling of proposals by `proposals` option, as `corejs: { version: 4, proposals: true }`.

> **Warning!** If you use `@babel/preset-env` and `@babel/runtime` together, use `corejs` option only in one place since it's duplicate functionality and will cause conflicts.
Expand All @@ -403,7 +403,7 @@ Fast JavaScript transpiler `swc` [contains integration with `core-js`](https://s
"env": {
"targets": "> 0.25%, not dead",
"mode": "entry",
"coreJs": "3.33"
"coreJs": "4.0"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion deno/corejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

*Example*:
```js
import 'https://deno.land/x/corejs@v3.33.0/index.js'; // <- at the top of your entry point
import 'https://deno.land/x/corejs@v4.0.0-alpha.0/index.js'; // <- at the top of your entry point

Object.hasOwn({ foo: 42 }, 'foo'); // => true

Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.33.0",
"version": "4.0.0-alpha.0",
"repository": {
"type": "git",
"url": "https://github.com/zloirock/core-js.git"
Expand Down
6 changes: 3 additions & 3 deletions packages/core-js-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@core-js/builder",
"version": "3.33.0",
"version": "4.0.0-alpha.0",
"description": "core-js builder",
"repository": {
"type": "git",
Expand All @@ -21,8 +21,8 @@
"main": "index.js",
"types": "index.d.ts",
"dependencies": {
"core-js": "3.33.0",
"@core-js/compat": "3.33.0",
"core-js": "4.0.0-alpha.0",
"@core-js/compat": "4.0.0-alpha.0",
"webpack": "^5.88.2"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js-bundle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@core-js/bundle",
"version": "3.33.0",
"version": "4.0.0-alpha.0",
"description": "Standard library",
"keywords": [
"ES3",
Expand Down
6 changes: 3 additions & 3 deletions packages/core-js-compat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const {
exclude: [ // optional list / filter of modules to exclude, the signature is similar to `modules` option
'web.atob',
],
version: '3.33', // used `core-js` version, by default - the latest
version: '4.0', // used `core-js` version, by default - the latest
inverse: false, // inverse of the result - shows modules that are NOT required for the target environment
});

Expand Down Expand Up @@ -125,9 +125,9 @@ require('@core-js/compat/modules'); // => Array<ModuleName>
require('@core-js/compat').modules; // => Array<ModuleName>

// the subset of modules which available in the passed `core-js` version:
require('@core-js/compat/get-modules-list-for-target-version')('3.33'); // => Array<ModuleName>
require('@core-js/compat/get-modules-list-for-target-version')('4.0'); // => Array<ModuleName>
// or
require('@core-js/compat').getModulesListForTargetVersion('3.33'); // => Array<ModuleName>
require('@core-js/compat').getModulesListForTargetVersion('4.0'); // => Array<ModuleName>
```

If you wanna help to improve this data, you could take a look at the related section of [`CONTRIBUTING.md`](https://github.com/zloirock/core-js/blob/master/CONTRIBUTING.md#how-to-update-core-js-compat-data). The visualization of compatibility data and the browser tests runner is available [here](http://zloirock.github.io/core-js/compat/), the example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module.exports = function (raw) {
throw new TypeError('`core-js` version should be specified as a SemVer string with minor component');
}
const corejs = semver(raw, true);
if (corejs.major !== 3) {
throw new RangeError('This version of `@core-js/compat` works only with `core-js@3`');
if (corejs.major !== 4) {
throw new RangeError('This version of `@core-js/compat` works only with `core-js@4`');
}
const result = [];
for (const version of Object.keys(modulesByVersions)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js-compat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@core-js/compat",
"version": "3.33.0",
"version": "4.0.0-alpha.0",
"description": "core-js compat",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js-pure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@core-js/pure",
"version": "3.33.0",
"version": "4.0.0-alpha.0",
"description": "Standard library",
"keywords": [
"ES3",
Expand Down
4 changes: 2 additions & 2 deletions packages/core-js/internals/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ var store = require('../internals/shared-store');
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: '3.33.0',
version: '4.0.0-alpha.0',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
license: 'https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE',
license: 'https://github.com/zloirock/core-js/blob/v4.0.0-alpha.0/LICENSE',
source: 'https://github.com/zloirock/core-js',
});
2 changes: 1 addition & 1 deletion packages/core-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "core-js",
"version": "3.33.0",
"version": "4.0.0-alpha.0",
"description": "Standard library",
"keywords": [
"ES3",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-compat/modules-by-versions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ for (const version of Object.values(modulesByVersions)) {
}

await fs.writeJson('packages/core-js-compat/modules-by-versions.json', {
'3.0': [...defaults],
'4.0': [...defaults],
...modulesByVersions,
}, { spaces: ' ' });

Expand Down
12 changes: 6 additions & 6 deletions scripts/bundle-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/update-version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const packages = [];

for (const PATH of packagesFolder) {
const packageJSON = await readJson(`packages/${ PATH }/package.json`, 'utf8');
packages.pash(packageJSON.name);
packages.push(packageJSON.name);
}

for (const PATH of await glob('packages/*/package.json')) {
Expand Down
28 changes: 14 additions & 14 deletions tests/compat-tools/get-modules-list-for-target-version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ import getModulesListForTargetVersion from '@core-js/compat/get-modules-list-for
const modules = await fs.readJson('packages/core-js-compat/modules.json');
const modulesByVersions = await fs.readJson('packages/core-js-compat/modules-by-versions.json');

const modules30 = modulesByVersions['3.0'];
const filter = new Set([...modules30, ...modulesByVersions['3.1'] ?? []]);
const modules31 = modules.filter(it => filter.has(it));
const modules40 = modulesByVersions['4.0'];
const filter = new Set([...modules40, ...modulesByVersions['4.1'] ?? []]);
const modules41 = modules.filter(it => filter.has(it));

deepEqual(getModulesListForTargetVersion('3.0'), modules30, '3.0');
deepEqual(getModulesListForTargetVersion('3.0.0'), modules30, '3.0.0');
deepEqual(getModulesListForTargetVersion('3.0.1'), modules30, '3.0.1');
deepEqual(getModulesListForTargetVersion('3.0.0-alpha.1'), modules30, '3.0.0-alpha.1');
deepEqual(getModulesListForTargetVersion('3.1'), modules31, '3.1');
deepEqual(getModulesListForTargetVersion('3.1.0'), modules31, '3.1.0');
deepEqual(getModulesListForTargetVersion('3.1.1'), modules31, '3.1.1');
deepEqual(getModulesListForTargetVersion('4.0'), modules40, '4.0');
deepEqual(getModulesListForTargetVersion('4.0.0'), modules40, '4.0.0');
deepEqual(getModulesListForTargetVersion('4.0.1'), modules40, '4.0.1');
deepEqual(getModulesListForTargetVersion('4.0.0-alpha.1'), modules40, '4.0.0-alpha.1');
deepEqual(getModulesListForTargetVersion('4.1'), modules41, '4.1');
deepEqual(getModulesListForTargetVersion('4.1.0'), modules41, '4.1.0');
deepEqual(getModulesListForTargetVersion('4.1.1'), modules41, '4.1.1');

throws(() => getModulesListForTargetVersion(3), TypeError, 'num 3');
throws(() => getModulesListForTargetVersion('3'), TypeError, '3');
throws(() => getModulesListForTargetVersion('2.0'), RangeError, '2.0');
throws(() => getModulesListForTargetVersion('4.0'), RangeError, '4.0');
throws(() => getModulesListForTargetVersion(4), TypeError, 'num 4');
throws(() => getModulesListForTargetVersion('4'), TypeError, '4');
throws(() => getModulesListForTargetVersion('3.0'), RangeError, '3.0');
throws(() => getModulesListForTargetVersion('5.0'), RangeError, '5.0');
throws(() => getModulesListForTargetVersion('x'), TypeError, 'x');
throws(() => getModulesListForTargetVersion('*'), TypeError, '*');
throws(() => getModulesListForTargetVersion(), TypeError, 'no arg');
Expand Down
6 changes: 3 additions & 3 deletions tests/eslint/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/observables/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/unit-karma/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eafde5c

Please sign in to comment.