Skip to content

Commit

Permalink
manage changes in fork folder + playground without cdn + fix eslint +…
Browse files Browse the repository at this point in the history
… fix react-webpack basename without cdn
  • Loading branch information
Sebastien LE MOUILLOUR committed Nov 15, 2023
1 parent dc12c4c commit 6a4ceaf
Show file tree
Hide file tree
Showing 52 changed files with 244 additions and 250 deletions.
5 changes: 5 additions & 0 deletions fork/bootstrap-sass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@
},
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@talend/eslint-config": "^13.0.0",
"@talend/eslint-plugin": "^1.1.0",
"eslint": "^8.53.0"
}
}
14 changes: 13 additions & 1 deletion fork/dynamic-cdn-webpack-plugin/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{
"root": true,
"extends": "@talend"
"extends": ["eslint:recommended", "plugin:prettier/recommended", "plugin:import/recommended"],
"env": {
"es6": true,
"node": true,
"jasmine": true,
"jest": true
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"requireConfigFile": false
}
}
1 change: 1 addition & 0 deletions fork/dynamic-cdn-webpack-plugin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ test/fixtures/output
yarn.lock
.nyc_output
coverage
!test/fixtures/app/node_modules
3 changes: 3 additions & 0 deletions fork/dynamic-cdn-webpack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@
"dependencies": {
"@talend/module-to-cdn": "^9.10.0",
"read-pkg-up": "^7.0.1",
"semver": "^7.5.4",
"webpack-sources": "^3.2.3"
},
"peerDependencies": {
"webpack": "^5.89.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.23.3",
"all-contributors-cli": "^6.26.1",
"codecov": "^3.8.3",
"eslint": "^8.53.0",
"html-webpack-plugin": "^5.5.3",
"jest": "^29.7.0",
"mz": "^2.7.0",
Expand Down
36 changes: 18 additions & 18 deletions fork/dynamic-cdn-webpack-plugin/src/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function findPackage(info) {
if (name.startsWith('@')) {
[scope, name] = info.name.split('/');
}
// eslint-disable-next-line no-use-before-define
return findPackages(scope, name).find(cwd => {
const {
packageJson: { version },
Expand All @@ -34,13 +35,13 @@ function findPackagesFromScopeFolder(scope, name, scopeFolderPath) {
// just add the path to the found list
return accu.concat(subFolderPath);
}

// the scope or package name is not the one we look for
// if there is a nested node modules folder, we dive into it for the search
const nestedNodeModulesPath = path.join(subFolderPath, 'node_modules');
if (fs.existsSync(nestedNodeModulesPath)) {
return accu.concat(
findPackagesFromNonScopeFolder(scope, name, nestedNodeModulesPath, []),
);
// eslint-disable-next-line no-use-before-define
return accu.concat(findPackagesFromNonScopeFolder(scope, name, nestedNodeModulesPath, []));
}
return accu;
}, []);
Expand All @@ -54,29 +55,21 @@ function findPackagesFromNonScopeFolder(scope, name, nonScopeFolderPath) {
if (subFolder.name === '.bin') {
return accu;
}
if (subFolder.name.startsWith('@')) {
// MAKE IT COMPATIBLE WITH PNPM (especially for test) WHEN deps is @talend/scripts-...
let regex = /@talend\/(scripts|babel|eslint)-.*\/node_modules$/;
if (subFolder.name.startsWith('@') && !regex.test(subFolder?.path)) {
// for scope folders, we need a special treatment to avoid getting scoped packages when we don't want a scoped one.
// ex: search for `classnames`, we don't want to find `@types/classnames` in the result
return accu.concat(
findPackagesFromScopeFolder(
scope,
name,
path.join(nonScopeFolderPath, subFolder.name),
),
findPackagesFromScopeFolder(scope, name, path.join(nonScopeFolderPath, subFolder.name)),
);
} else if (!scope && subFolder.name === name) {
// we want a NON scoped package, we are in a non scoped folder, and the names match
return accu.concat(path.join(nonScopeFolderPath, subFolder.name));
}
const nestedNodeModulesPath = path.join(
nonScopeFolderPath,
subFolder.name,
'node_modules',
);
const nestedNodeModulesPath = path.join(nonScopeFolderPath, subFolder.name, 'node_modules');
if (fs.existsSync(nestedNodeModulesPath)) {
return accu.concat(
findPackagesFromNonScopeFolder(scope, name, nestedNodeModulesPath),
);
return accu.concat(findPackagesFromNonScopeFolder(scope, name, nestedNodeModulesPath));
}
return accu;
}, []);
Expand All @@ -88,7 +81,14 @@ function findPackages(scope, name, buff = []) {
if (roots === null) {
return buff;
}
return buff.concat(...roots.map(root => findPackagesFromNonScopeFolder(scope, name, root)));
const result = buff.concat(
...roots.map(root => findPackagesFromNonScopeFolder(scope, name, root)),
);
// Return a new Set to remove duplicate values: case possible with PNPM in GHA, due to pnpm/action-setup
// With the action, a folder setup-pnpm is created to manage the store and the script see it and try to scan it, and this generate duplicate entry
// Before we returned directly result of buff.concat...
// TODO: Manage pnpm installation manually (not repoduce the issue in this case but need to find solution to install global dep like surge)
return [...new Set(result)];
}

module.exports = {
Expand Down
9 changes: 3 additions & 6 deletions fork/dynamic-cdn-webpack-plugin/src/find.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ describe('findPackages', () => {
'/node_modules/react/index.js': 'console.log("react");',
'/node_modules/react/package.json': '{"name": "react", "version": "16.14.0"}',
'/node_modules/@types/classnames/index.js': 'console.log("@types/classnames");',
'/node_modules/@talend/react-components/index.js':
'console.log("@talend/react-components");',
'/node_modules/@talend/react-components/node_modules/react/index.js':
'console.log("react");',
'/node_modules/@talend/react-containers/index.js':
'console.log("@talend/react-containers");',
'/node_modules/@talend/react-components/index.js': 'console.log("@talend/react-components");',
'/node_modules/@talend/react-components/node_modules/react/index.js': 'console.log("react");',
'/node_modules/@talend/react-containers/index.js': 'console.log("@talend/react-containers");',
};

beforeEach(() => {
Expand Down
4 changes: 1 addition & 3 deletions fork/dynamic-cdn-webpack-plugin/test/core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ describe('core', () => {
expect(output).toContain('module.exports = React');
const manifest = JSON.parse(
fs
.readFileSync(
path.resolve(__dirname, './fixtures/output/basic/app.js.dependencies.json'),
)
.readFileSync(path.resolve(__dirname, './fixtures/output/basic/app.js.dependencies.json'))
.toString(),
);
expect(manifest.react.peerDependency).toBe('^15.6.1');
Expand Down

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

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

8 changes: 4 additions & 4 deletions fork/react-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
},
"devDependencies": {
"@talend/eslint-config": "^13.0.0",
"@talend/eslint-plugin": "^1.0.1",
"@talend/scripts-core": "^16.1.1",
"@talend/scripts-config-babel": "^13.1.0",
"@talend/scripts-config-react-webpack": "^16.2.0",
"@talend/eslint-plugin": "^1.1.0",
"@talend/scripts-core": "^16.2.0",
"@talend/scripts-config-babel": "^13.2.0",
"@talend/scripts-config-react-webpack": "^16.3.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^12.1.5",
"@testing-library/user-event": "^13.5.0",
Expand Down
11 changes: 6 additions & 5 deletions fork/react-bootstrap/server/ModalSpec.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { assert } from 'chai';
import React from 'react';

import ReactDOMServer from 'react-dom/server';

import Modal from '../../src/Modal';
import Modal from '../src/Modal';

describe('Modal', () => {
it('Should be rendered on the server side', () => {
let noOp = () => {};
const noOp = () => {};

assert.doesNotThrow(() =>
ReactDOMServer.renderToString(
<Modal onHide={noOp}>
<strong>Message</strong>
</Modal>
)
</Modal>,
),
);
});
});
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@talend/scripts-config-prettier": "^12.0.0",
"@talend/scripts-config-babel": "^13.1.0",
"@talend/scripts-yarn-workspace": "^1.2.0",
"@talend/scripts-config-prettier": "^12.1.0",
"@talend/scripts-config-babel": "^13.2.0",
"@talend/scripts-yarn-workspace": "^1.3.0",
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
"eslint": "^8.53.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
},
"devDependencies": {
"@talend/eslint-config": "^13.0.0",
"@talend/eslint-plugin": "^1.0.1",
"@talend/scripts-core": "^16.1.1",
"@talend/scripts-config-typescript": "^11.1.0",
"@talend/eslint-plugin": "^1.1.0",
"@talend/scripts-core": "^16.2.0",
"@talend/scripts-config-typescript": "^11.2.0",
"@testing-library/react": "^12.1.5",
"@testing-library/user-event": "^13.5.0",
"@types/date-fns": "^0.0.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/assets-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
},
"dependencies": {},
"devDependencies": {
"@talend/babel-plugin-import-from-index": "^1.5.1",
"@talend/babel-plugin-import-from-index": "^1.6.0",
"@talend/eslint-config": "^13.0.0",
"@talend/eslint-plugin": "^1.0.1",
"@talend/scripts-core": "^16.1.1",
"@talend/scripts-config-react-webpack": "^16.2.0",
"@talend/scripts-config-typescript": "^11.1.0",
"@talend/eslint-plugin": "^1.1.0",
"@talend/scripts-core": "^16.2.0",
"@talend/scripts-config-react-webpack": "^16.3.0",
"@talend/scripts-config-typescript": "^11.2.0",
"@types/node": "^6.14.13",
"@types/jest": "^29.5.5",
"read-pkg-up": "^7.0.1"
Expand Down
10 changes: 5 additions & 5 deletions packages/cmf-cqrs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
},
"devDependencies": {
"@talend/eslint-config": "^13.0.0",
"@talend/eslint-plugin": "^1.0.1",
"@talend/scripts-core": "^16.1.1",
"@talend/scripts-config-babel": "^13.1.0",
"@talend/scripts-config-react-webpack": "^16.2.0",
"@talend/scripts-config-typescript": "^11.1.0",
"@talend/eslint-plugin": "^1.1.0",
"@talend/scripts-core": "^16.2.0",
"@talend/scripts-config-babel": "^13.2.0",
"@talend/scripts-config-react-webpack": "^16.3.0",
"@talend/scripts-config-typescript": "^11.2.0",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^8.0.1",
"mock-socket": "^9.3.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/cmf-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"devDependencies": {
"@redux-saga/testing-utils": "^1.1.5",
"@talend/eslint-config": "^13.0.0",
"@talend/eslint-plugin": "^1.0.1",
"@talend/scripts-core": "^16.1.1",
"@talend/scripts-config-babel": "^13.1.0",
"@talend/scripts-config-react-webpack": "^16.2.0",
"@talend/eslint-plugin": "^1.1.0",
"@talend/scripts-core": "^16.2.0",
"@talend/scripts-config-babel": "^13.2.0",
"@talend/scripts-config-react-webpack": "^16.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redux-saga-tester": "^1.0.874"
Expand Down
12 changes: 6 additions & 6 deletions packages/cmf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"url": "https://github.com/Talend/ui.git"
},
"dependencies": {
"@talend/scripts-cmf": "^1.1.0",
"@talend/scripts-cmf": "^1.2.0",
"@talend/utils": "^2.8.0",
"hoist-non-react-statics": "^3.3.2",
"immutable": "^3.8.2",
Expand All @@ -56,11 +56,11 @@
"devDependencies": {
"@redux-saga/testing-utils": "^1.1.5",
"@talend/eslint-config": "^13.0.0",
"@talend/eslint-plugin": "^1.0.1",
"@talend/scripts-core": "^16.1.1",
"@talend/scripts-config-babel": "^13.1.0",
"@talend/scripts-config-jest": "^13.0.0",
"@talend/scripts-config-react-webpack": "^16.2.0",
"@talend/eslint-plugin": "^1.1.0",
"@talend/scripts-core": "^16.2.0",
"@talend/scripts-config-babel": "^13.2.0",
"@talend/scripts-config-jest": "^13.1.0",
"@talend/scripts-config-react-webpack": "^16.3.0",
"@testing-library/react": "^12.1.5",
"jest-in-case": "^1.0.2",
"jsdoc": "^3.6.11",
Expand Down
17 changes: 8 additions & 9 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@
"devDependencies": {
"@storybook/addon-actions": "^7.5.3",
"@talend/bootstrap-theme": "^8.3.0",
"@talend/design-system": "^8.2.0",
"@talend/design-system": "^8.3.0",
"@talend/eslint-config": "^13.0.0",
"@talend/eslint-plugin": "^1.0.1",
"@talend/eslint-plugin": "^1.1.0",
"@talend/locales-design-system": "^7.15.1",
"@talend/locales-tui-components": "^11.4.5",
"@talend/scripts-core": "^16.1.1",
"@talend/scripts-config-babel": "^13.1.0",
"@talend/scripts-config-react-webpack": "^16.2.0",
"@talend/scripts-config-storybook-lib": "^5.1.0",
"@talend/scripts-config-typescript": "^11.1.0",
"@talend/scripts-core": "^16.2.0",
"@talend/scripts-config-babel": "^13.2.0",
"@talend/scripts-config-react-webpack": "^16.3.0",
"@talend/scripts-config-storybook-lib": "^5.2.0",
"@talend/scripts-config-typescript": "^11.2.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^12.1.5",
"@testing-library/user-event": "^13.5.0",
Expand All @@ -105,11 +105,10 @@
"react-dom": "^18.2.0",
"react-router-dom": "~6.3.0",
"react-i18next": "^13.3.1",
"react-storybook-addon-props-combinations": "^1.1.0",
"react-test-renderer": "^18.2.0"
},
"peerDependencies": {
"@talend/design-system": "^8.1.3",
"@talend/design-system": "^8.3.0",
"i18next": "^23.6.0",
"prop-types": "^15.5.10",
"react": ">= 16.14.0",
Expand Down
24 changes: 1 addition & 23 deletions packages/components/src/Actions/ActionButton/Button.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Fragment } from 'react';

import { action } from '@storybook/addon-actions';
import withPropsCombinations from 'react-storybook-addon-props-combinations';

import ActionButton from './ActionButton.component';

Expand Down Expand Up @@ -158,25 +158,3 @@ export const Default = () => (
</div>
</div>
);

export const Combinations = withPropsCombinations(ActionButton, {
label: ['Click me'],
bsStyle: [
'default',
'primary',
'success',
'info',
'warning',
'danger',
'link',
'info btn-inverse',
],
icon: ['talend-dataprep'],
'data-feature': ['my.feature'],
onClick: [action('You clicked me')],
hideLabel: [false, true],
inProgress: [true, false],
disabled: [false, true],
tooltip: [true],
tooltipLabel: ['Tooltip custom label'],
});
Loading

0 comments on commit 6a4ceaf

Please sign in to comment.