Skip to content

Commit

Permalink
fix babel config using resolve + fix all extends
Browse files Browse the repository at this point in the history
  • Loading branch information
smouillour committed Oct 13, 2023
1 parent 18486f8 commit dd7cc38
Show file tree
Hide file tree
Showing 31 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion fork/react-bootstrap/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/cmf-cqrs/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/cmf-router/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/cmf/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/components/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/containers/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/dataviz/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/design-docs/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/design-docs/.storybook/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/design-system/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/faceted-search/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/forms/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/http/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/icons/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/icons/scripts/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const path = require('path');
const mkdirp = require('mkdirp');
const babel = require('@babel/core');

const defaultOptions = require('@talend/scripts-config-babel/.babelrc.json');
const defaultOptions = require('@talend/scripts-config-babel/babel.config.js');
const src = require('../src');
const info = require('../src/info').info;
const infoFromFigma = require('../src/info').infoFromFigma;
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/router-bridge/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/sagas/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/stepper/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/storybook-cmf/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/storybook-docs/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/storybook-one/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion packages/storybook-one/.storybook/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion tools/cmf-webpack-plugin/.babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}
2 changes: 1 addition & 1 deletion tools/scripts-config-babel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

```diff
{
- "extends": "@talend/scripts-config-babel/.babelrc.json"
- "extends": "@talend/scripts-config-babel/babel.config.js"
+ "extends": "@talend/scripts-config-babel"
}
```
Expand Down
4 changes: 2 additions & 2 deletions tools/scripts-config-babel/babel-resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const fs = require('fs');

function checkBabelJsonExtension(babelConfigJsonPath) {
const babelrc = JSON.parse(fs.readFileSync(babelConfigJsonPath, 'utf8'));
const babelrcExtends = '@talend/scripts-config-babel/.babelrc.json';
const babelrcExtends = '@talend/scripts-config-babel/babel.config.js';
if (babelrc.extends !== babelrcExtends) {
throw new Error(`
You have your own babelrc. Please extends our babelrc:
Expand All @@ -16,7 +16,7 @@ function getBabelConfigPath() {
const userBabelrc = path.join(process.cwd(), '.babelrc');
const userBabelrcJson = path.join(process.cwd(), '.babelrc.json');
const userBabelJs = path.join(process.cwd(), 'babel.config.js');
const defaultBabelrc = path.join(__dirname, '.babelrc.json');
const defaultBabelrc = path.join(__dirname, 'babel.config.js');

if (fs.existsSync(userBabelrc)) {
checkBabelJsonExtension(userBabelrc);
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-config-babel/test/nullish.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const babel = require('@babel/core');
const options = require('../.babelrc.json');
const options = require('../babel.config');

describe('@babel/plugin-syntax-nullish-coalescing-operator is installed', () => {
it('should transpile nullish', () => {
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-config-react-webpack/config/inject.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const babel = require('@babel/core');
const fs = require('fs');
const path = require('path');
const defaultOptions = require('@talend/scripts-config-babel/.babelrc.json');
const defaultOptions = require('@talend/scripts-config-babel/babel.config.js');
const { minify } = require('terser');

// terser.minify is an async function, we use deasync to make it used as synced function within webpack
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-core/src/scripts/build-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default async function build(env, presetApi, unsafeOptions) {
const tsRootPath = utils.path.getPkgRootPath('@talend/scripts-config-typescript');
const babelConfigPath =
getUserConfigFile(['.babelrc', '.babelrc.json', 'babel.config.js']) ||
path.join(babelRootPath, '.babelrc.json');
path.join(babelRootPath, 'babel.config.js');
const tscConfigPath =
getUserConfigFile(['tsconfig.build.json', 'tsconfig.json']) ||
path.join(tsRootPath, 'tsconfig.json');
Expand Down
4 changes: 2 additions & 2 deletions tools/scripts-core/src/scripts/extends.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ export default async function extend() {

generateConfigFile({
configFileNames: ['.babelrc', '.babelrc.json', 'babel.config.js'],
defaultConfigFilePath: path.join(rootPath, '.babelrc.json'),
defaultConfigFilePath: path.join(rootPath, 'babel.config.js'),
generateContent() {
const configPath = utils.path.getPkgRootPath('@talend/scripts-config-babel');
const presetConfigPath = path.join(configPath, '.babelrc.json');
const presetConfigPath = path.join(configPath, 'babel.config.js');
const presetConfigRelativePath = path.relative(nodeModulesPath, presetConfigPath);
return babelExtendsTemplate({ presetConfigRelativePath });
},
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-utils/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@talend/scripts-config-babel/.babelrc.json"
"extends": "@talend/scripts-config-babel/babel.config.js"
}

0 comments on commit dd7cc38

Please sign in to comment.