Skip to content

Commit

Permalink
big commit pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
smouillour committed Oct 12, 2023
1 parent 810e755 commit 9e1dac4
Show file tree
Hide file tree
Showing 97 changed files with 26,344 additions and 20,289 deletions.
7 changes: 7 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#shamefully-hoist=true
#node-linker=hoisted
#symlink=false
prefer-workspace-packages=true
#link-workspace-packages=false
#link-workspace-packages=deep
#strict-peer-dependencies=true
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodejs 20.8.0
yarn 1.22.19
5 changes: 5 additions & 0 deletions fork/dynamic-cdn-webpack-plugin/src/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function findPackagesFromScopeFolder(scope, name, scopeFolderPath) {
// just add the path to the found list
return accu.concat(subFolderPath);
}
// TODO CHECKJM Not compatible with pnpm
// 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');
Expand All @@ -54,6 +55,9 @@ function findPackagesFromNonScopeFolder(scope, name, nonScopeFolderPath) {
if (subFolder.name === '.bin') {
return accu;
}
// if (subFolder.name === '.pnpm') {
// return accu;
// }
if (subFolder.name.startsWith('@')) {
// 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
Expand Down Expand Up @@ -83,6 +87,7 @@ function findPackagesFromNonScopeFolder(scope, name, nonScopeFolderPath) {
}

function findPackages(scope, name, buff = []) {
console.log('findPackages', scope, name, buff)
// https://nodejs.org/dist/latest-v14.x/docs/api/modules.html#modules_require_resolve_paths_request
const roots = require.resolve.paths(name).filter(p => fs.existsSync(p));
if (roots === null) {
Expand Down
4 changes: 1 addition & 3 deletions fork/module-to-cdn/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"extends": "../../node_modules/@talend/scripts-config-babel/.babelrc.json"
}
{}
3 changes: 1 addition & 2 deletions fork/module-to-cdn/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"root": true,
"extends": "@talend"
"root": true
}
2 changes: 1 addition & 1 deletion fork/module-to-cdn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"scripts": {
"test": "jest index.test.js",
"test:cron": "jest modules.test.js",
"lint": "talend-scripts lint ./"
"lint": "echo \"Not possible to use talend-scripts here (risk of circular dependency)\" && exit 0"
},
"files": [
"index.js",
Expand Down
2 changes: 1 addition & 1 deletion fork/react-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"scripts": {
"build:dev": "talend-scripts build --umd --dev",
"build:prod": "talend-scripts build --umd --prod",
"pre-release": "yarn build:dev && yarn build:prod",
"pre-release": "pnpm build:dev && pnpm build:prod",
"build:lib": "talend-scripts build",
"lint": "talend-scripts lint",
"test": "talend-scripts test",
Expand Down
81 changes: 40 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,66 @@
{
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@talend/scripts-config-prettier": "^12.0.0",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.20",
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
"eslint": "^7.32.0",
"husky": "^8.0.3",
"i18next-scanner": "^4.4.0",
"lint-staged": "^13.3.0",
"prettier": "^2.8.8"
"prettier": "^3.0.3",
"rimraf": "^3.0.2",
"terser-webpack-plugin": "^5.3.9",
"typescript": "^5.0.4",
"webpack": "^5.73.0"
},
"scripts": {
"postinstall": "talend-yarn-workspace run build:lib",
"pre-release": "talend-yarn-workspace run pre-release",
"start": "yarn workspace @talend/ui-playground run start",
"start-storybook": "yarn workspace @talend/ui-storybook-one run start",
"release": "yarn pre-release && yarn changeset publish",
"postinstall": "pnpm --sort -r run build:lib",
"pre-release": "pnpm -r run pre-release",
"start": "pnpm --filter @talend/ui-playground run start",
"start-storybook": "pnpm --filter @talend/ui-storybook-one run start",
"release": "pnpm run pre-release && pnpm changeset publish",
"lint-staged": "lint-staged",
"lint": "cross-env WORKSPACE_RUN_FAIL=no-bail talend-yarn-workspace run lint",
"lint-merge-report": "talend-yarn-workspace lint-merge-report",
"test": "cross-env TZ=Europe/Paris talend-yarn-workspace run test --silent",
"test:update": "cross-env TZ=Europe/Paris yarn workspaces run test --silent -u",
"test:cov": "cross-env TZ=Europe/Paris talend-yarn-workspace run test:cov",
"test:demo": "talend-yarn-workspace run test:demo",
"test:cron": "talend-yarn-workspace run test:cron",
"start-components": "yarn workspace @talend/react-components run start",
"start-containers": "yarn workspace @talend/react-containers run start",
"start-stepper": "yarn workspace @talend/react-stepper run start",
"start-forms": "yarn workspace @talend/react-forms run start",
"start-theme": "yarn workspace @talend/bootstrap-theme run start",
"lint": "pnpm -r --no-bail run lint",
"lint-merge-report": "pnpm -r lint-merge-report",
"test": "cross-env TZ=Europe/Paris pnpm -r --no-bail run test --silent",
"test:update": "cross-env TZ=Europe/Paris pnpm -r --no-bail run test --silent -u",
"test:cov": "cross-env TZ=Europe/Paris pnpm -r run test:cov",
"test:demo": "pnpm -r run test:demo",
"test:cron": "pnpm -r run test:cron",
"start-components": "pnpm --filter @talend/react-components run start",
"start-containers": "pnpm --filter @talend/react-containers run start",
"start-stepper": "pnpm --filter @talend/react-stepper run start",
"start-forms": "pnpm --filter @talend/react-forms run start",
"start-theme": "pnpm --filter @talend/bootstrap-theme run start",
"changelog": "git log --pretty=\"format:%C(bold green)%ad%C(reset) %s\" --date=short --color",
"prepare": "husky install"
},
"resolutions": {
"**/@types/react": "^17.0.2",
"**/@types/react-dom": "^17.0.2",
"**/i18next-scanner-typescript/typescript": "^5.0.4",
"**/browser-sync-client/typescript": "^5.0.4",
"**/vinyl-fs/glob-parent": "^5.1.2",
"**/fast-glob/glob-parent": "^5.1.2",
"**/trim": "^1.0.1",
"**/x-default-browser": "^0.5.2"
"clean": "pnpm -r exec npx rimraf node_modules && npx rimraf node_modules",
"clean:dist": "pnpm -r exec npx rimraf dist && npx rimraf dist",
"clean:lib": "pnpm -r exec npx rimraf lib && npx rimraf lib",
"clean:cache": "pnpm store prune",
"prepare": "husky install",
"preinstall": "npx only-allow pnpm"
},
"repository": {
"type": "git",
"url": "https://github.com/Talend/ui.git"
},
"version": "0.0.0",
"private": true,
"workspaces": [
"packages/*",
"tools/*",
"fork/*"
],
"pnpm": {
"overrides": {
"@cypress/request@<=2.88.12": ">=3.0.0",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"nth-check@<2.0.1": ">=2.0.1",
"postcss@<8.4.31": ">=8.4.31"
}
},
"lint-staged": {
"*.{json,md,mdx,html,js,jsx,ts,tsx}": [
"prettier --write"
]
},
"dependencies": {
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.20",
"terser-webpack-plugin": "^5.3.9",
"typescript": "^5.0.4",
"webpack": "^5.73.0"
}
}
1 change: 1 addition & 0 deletions packages/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"devDependencies": {
"@talend/scripts-core": "^15.0.0",
"@talend/scripts-config-prettier": "^12.0.0",
"@testing-library/react": "^12.1.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
Expand Down
3 changes: 3 additions & 0 deletions packages/assets-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
},
"dependencies": {},
"devDependencies": {
"@talend/babel-plugin-import-from-index": "^1.5.1",
"@talend/icons": "^6.60.1",
"@talend/scripts-core": "^15.0.0",
"@talend/scripts-config-babel": "^13.0.0",
"@talend/scripts-config-react-webpack": "^16.0.0",
"read-pkg-up": "^7.0.1"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/assets-api/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ describe('assets-api', () => {
it('should prevent // as start url', () => {
const original = window.Talend.CDN_URL;
window.Talend.CDN_URL = '/cdn';
const mockedBaseElement = { getAttribute: jest.fn().mockReturnValueOnce('/') };
// @ts-ignore
const mockedBaseElement = {
getAttribute: jest.fn().mockReturnValueOnce('/'),
} as unknown as Element;
jest.spyOn(document, 'querySelector').mockImplementation(() => mockedBaseElement);
const url = assetsApi.getURL(bundlePath, '@talend/icons', iconsInfo?.packageJson.version);
expect(url).toBe(`/cdn/@talend/icons/${iconsInfo?.packageJson.version}${bundlePath}`);
Expand Down
4 changes: 2 additions & 2 deletions packages/cmf-cqrs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"build:dev": "talend-scripts build --umd --dev",
"build:prod": "talend-scripts build --umd --prod",
"pre-release": "yarn build:dev && yarn build:prod",
"pre-release": "pnpm build:dev && pnpm build:prod",
"build:lib": "talend-scripts build",
"start": "echo nothing to start",
"test": "talend-scripts test",
Expand All @@ -33,7 +33,7 @@
"homepage": "https://github.com/Talend/ui/cmf-cqrs#readme",
"dependencies": {
"@talend/react-cmf": "^7.3.0",
"@talend/utils": "2.6.0",
"@talend/utils": "^2.6.0",
"immutable": "^3.8.2",
"redux-saga": "^1.2.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cmf-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"build:dev": "talend-scripts build --umd --dev",
"build:prod": "talend-scripts build --umd --prod",
"pre-release": "yarn build:dev && yarn build:prod",
"pre-release": "pnpm build:dev && pnpm build:prod",
"build:lib": "talend-scripts build",
"start": "echo nothing to start",
"test": "talend-scripts test",
Expand Down
2 changes: 1 addition & 1 deletion packages/cmf/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const defaults = require('../../node_modules/@talend/scripts-config-jest/jest.config.js');
const defaults = require('@talend/scripts-config-jest/jest.config.js');

module.exports = {
...defaults,
Expand Down
6 changes: 3 additions & 3 deletions packages/cmf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
"scripts": {
"build:dev": "talend-scripts build --umd --dev",
"build:prod": "talend-scripts build --umd --prod",
"pre-release": "yarn build:dev && yarn build:prod",
"pre-release": "pnpm build:dev && pnpm build:prod",
"build:lib": "talend-scripts build",
"start": "echo nothing to start",
"test": "talend-scripts test",
"test:watch": "talend-scripts test --watch",
"test:cov": "talend-scripts test --coverage",
"test:demo": "yarn jsdoc -c ./docs.json",
"test:demo": "pnpm jsdoc -c ./docs.json",
"lint": "talend-scripts lint"
},
"keywords": [
Expand Down Expand Up @@ -56,6 +55,7 @@
"devDependencies": {
"@redux-saga/testing-utils": "^1.1.5",
"@talend/scripts-core": "^15.0.0",
"@talend/scripts-config-jest": "^12.2.0",
"@talend/scripts-config-react-webpack": "^16.0.0",
"@testing-library/react": "^12.1.5",
"jest-in-case": "^1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cmf/src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function getActionObject(context, action, event, data) {
*/
function getOnProps(props) {
return Object.keys(props).filter(
name => ({}.hasOwnProperty.call(props, name) && /^on.+/.test(name)),
name => ({}).hasOwnProperty.call(props, name) && /^on.+/.test(name),
);
}

Expand Down
5 changes: 4 additions & 1 deletion packages/cmf/src/reduxstorage/reduxLocalStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import createEngine from 'redux-storage-engine-localstorage';
import filter from 'redux-storage-decorator-filter';
import immutablejs from './redux-storage-decorator-immutablejs';

const CMF_IMMUTABLE_PATHS = [['cmf', 'components'], ['cmf', 'collections']];
const CMF_IMMUTABLE_PATHS = [
['cmf', 'components'],
['cmf', 'collections'],
];

const CMF_MIDDLEWARE_BLACK_LIST = ['@@INIT', '@@router/LOCATION_CHANGE'];

Expand Down
9 changes: 3 additions & 6 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"scripts": {
"build:dev": "talend-scripts build --umd --dev",
"build:prod": "talend-scripts build --umd --prod",
"pre-release": "yarn build:dev && yarn build:prod",
"build:lib": "talend-scripts build && yarn run tsc",
"pre-release": "pnpm build:dev && pnpm build:prod",
"build:lib": "talend-scripts build && pnpm run tsc",
"tsc": "tsc --emitDeclarationOnly --project ./tsconfig.json --outDir ./types",
"test": "cross-env TZ=Europe/Paris talend-scripts test",
"test:watch": "cross-env TZ=Europe/Paris talend-scripts test --watch",
Expand All @@ -34,6 +34,7 @@
},
"dependencies": {
"@popperjs/core": "^2.11.8",
"@talend/assets-api": "^1.2.2",
"@talend/bootstrap-theme": "^8.1.3",
"@talend/design-tokens": "^2.9.0",
"@talend/react-a11y": "^1.1.0",
Expand Down Expand Up @@ -71,7 +72,6 @@
"@storybook/addon-actions": "^7.4.1",
"@talend/bootstrap-theme": "^8.1.3",
"@talend/design-system": "^7.15.1",
"@talend/icons": "^6.60.1",
"@talend/locales-design-system": "^7.3.0",
"@talend/locales-tui-components": "^9.5.0",
"@talend/scripts-core": "^15.0.0",
Expand Down Expand Up @@ -107,9 +107,6 @@
"react-dom": ">= 16.14.0",
"react-i18next": "^11.18.6"
},
"resolutions": {
"minimist": "^1.2.5"
},
"publishConfig": {
"access": "public"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/containers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"build:dev": "talend-scripts build --umd --dev",
"build:prod": "talend-scripts build --umd --prod",
"pre-release": "yarn build:dev && yarn build:prod",
"pre-release": "pnpm build:dev && pnpm build:prod",
"build:lib": "talend-scripts build",
"start": "talend-scripts start-storybook -p 6007",
"test": "talend-scripts test",
Expand All @@ -33,6 +33,7 @@
"url": "https://github.com/Talend/ui.git"
},
"dependencies": {
"@talend/design-system": "^7.15.1",
"@talend/react-bootstrap": "^1.35.2",
"@talend/react-cmf": "^7.3.0",
"@talend/react-components": "^11.4.0",
Expand Down
31 changes: 15 additions & 16 deletions packages/containers/src/ConfirmDialog/ConfirmDialog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@ import { showConfirmDialog, hideConfirmDialog } from './showHideConfirmDialog';
jest.mock(
'@talend/react-components/lib/ConfirmDialog',
() =>
({ cancelAction, validateAction, show, ...props }) =>
(
<div
data-testid="ConfirmDialog"
className="tc-confirm-dialog"
{...props}
aria-hidden={(!show).toString()}
>
<button data-testid="cancelAction" onClick={cancelAction.onClick}>
cancelAction.label
</button>
<button data-testid="validateAction" onClick={validateAction.onClick}>
validateAction.label
</button>
</div>
),
({ cancelAction, validateAction, show, ...props }) => (
<div
data-testid="ConfirmDialog"
className="tc-confirm-dialog"
{...props}
aria-hidden={(!show).toString()}
>
<button data-testid="cancelAction" onClick={cancelAction.onClick}>
cancelAction.label
</button>
<button data-testid="validateAction" onClick={validateAction.onClick}>
validateAction.label
</button>
</div>
),
);
jest.unmock('@talend/design-system');

Expand Down
Loading

0 comments on commit 9e1dac4

Please sign in to comment.