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

feat: update target to es2022 for babel and typescript #1181

Closed
wants to merge 8 commits into from
2 changes: 1 addition & 1 deletion maintenance/projects/js-toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"jest": "^26.5.2",
"lerna": "^3.16.4",
"ts-jest": "^26.4.1",
"typescript": "^4.0.3",
"typescript": "4.9.5",
"yo": "^3.1.0"
},
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"inlineSources": true,
"lib": ["es2015", "dom"],
"lib": ["ES2022", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"noStrictGenericChecks": true,
"outDir": "build",
"sourceMap": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5",
"target": "ES2022",
"typeRoots": ["./node_modules/@types/"]
},
"include": ["./src/**/*.ts"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Liferay Frontend Infrastructure Team <[email protected]>",
"dependencies": {
"babel-core": "^6.26.3",
"@babel/core": "^7.23.3",
"data-urls": "^1.1.0",
"liferay-npm-build-tools-common": "2.31.2",
"read-json-sync": "^2.0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/

import * as babel from 'babel-core';
import * as babel from '@babel/core';
import project from 'liferay-npm-build-tools-common/lib/project';

/**
Expand All @@ -24,7 +24,7 @@ export default function (context, config) {
// Tune babel config

babelConfig.babelrc = false;
babelConfig.only = '**/*';
babelConfig.only = ['**/*'];
if (babelConfig.sourceMaps === undefined) {
babelConfig.sourceMaps = true;
}
Expand All @@ -37,7 +37,7 @@ export default function (context, config) {
);
delete babelConfig.presets;

const result = babel.transform(content, babelConfig);
const result = babel.transformSync(content, babelConfig);

context.sourceMap = result.map;
context.extraArtifacts[`${filePath}.map`] = JSON.stringify(result.map);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"liferay-npm-bundler": "bin/liferay-npm-bundler.js"
},
"dependencies": {
"babel-core": "^6.26.3",
"@babel/core": "^7.23.3",
"clone": "^2.1.2",
"data-urls": "^1.1.0",
"dot-prop": "^5.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/

import * as babel from 'babel-core';
import * as babel from '@babel/core';
import clone from 'clone';
import parseDataURL from 'data-urls';
import fs from 'fs-extra';
Expand Down Expand Up @@ -138,7 +138,7 @@ function babelifyPackage(destPkg) {

babelConfig.babelrc = false;
babelConfig.compact = false;
babelConfig.only = '**/*';
babelConfig.only = ['**/*'];
if (babelConfig.sourceMaps === undefined) {
babelConfig.sourceMaps = true;
}
Expand Down
4 changes: 2 additions & 2 deletions maintenance/projects/js-toolkit/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"allowJs": true,
"checkJs": false,
"esModuleInterop": true,
"lib": ["DOM", "ES2015"],
"lib": ["DOM", "ES2022"],
"module": "CommonJS",
"moduleResolution": "node",
"sourceMap": false,
"target": "ES2018",
"target": "ES2022",
"typeRoots": ["./node_modules/@types"]
}
}
Loading
Loading