Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into smouillour/fix/TDOPS-5327-…
Browse files Browse the repository at this point in the history
…pnpm-7
  • Loading branch information
Sebastien LE MOUILLOUR committed Nov 24, 2023
2 parents 4719211 + 039b362 commit b7ccea6
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 20 deletions.
5 changes: 0 additions & 5 deletions .changeset/mighty-shoes-jam.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/design-system/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @talend/design-system

## 8.4.0

### Minor Changes

- 4dc277f42: feat: allow token override with theme provider

## 8.3.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@talend/design-system",
"version": "8.3.1",
"version": "8.4.0",
"description": "Talend Design System",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
import ThemeContext from './ThemeContext';
import './ThemeProvider.scss';
import { PropsWithChildren, useContext, useEffect, useState } from 'react';

import 'modern-css-reset/dist/reset.min.css';
import 'typeface-inconsolata/index.css';
import 'typeface-source-sans-pro/index.css';

// eslint-disable-next-line @talend/import-depth
import '@talend/design-tokens/dist/TalendDesignTokens.css';
import { useEffect, PropsWithChildren, useContext, useState } from 'react';

import 'typeface-source-sans-pro/index.css';
import 'typeface-inconsolata/index.css';
import 'modern-css-reset/dist/reset.min.css';
import ThemeContext from './ThemeContext';

import './ThemeProvider.scss';

export type ThemeProviderProps = PropsWithChildren<{
theme?: string;
tokensOverride?: React.CSSProperties;
}>;

export const ThemeProvider = ({ theme = 'light', children }: ThemeProviderProps) => {
export const ThemeProvider = ({
theme = 'light',
children,
tokensOverride,
}: ThemeProviderProps) => {
const [selectedTheme, setSelectedTheme] = useState(theme);
// Handle nested Providers: parent Provider doesn't have context, child does
const context = useContext(ThemeContext);
Expand All @@ -28,7 +36,7 @@ export const ThemeProvider = ({ theme = 'light', children }: ThemeProviderProps)
const switchTheme = (newTheme: string) => setSelectedTheme(newTheme);
return (
<ThemeContext.Provider value={context.theme ? context : { switchTheme, theme: selectedTheme }}>
{children}
{tokensOverride ? <div style={tokensOverride}>{children}</div> : children}
</ThemeContext.Provider>
);
};
6 changes: 6 additions & 0 deletions tools/scripts-config-cdn/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 10.9.1

### Patch Changes

- 06598a0c0: fix(TDP-12694): require valid package-lock file path

## 10.9.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-config-cdn/cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function getModulesFromLockFile(dir) {

let infos = [];
if (fs.existsSync(lockTypeMap.npm.path)) {
const packagelock = require(lockTypeMap.npm.lockfile);
const packagelock = require(lockTypeMap.npm.path);
infos = getAllFlattenDependencies(packagelock)
.map(({ name, version }) => moduleToCdn(name, version, { env: 'development' }))
.map(addLocal);
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-config-cdn/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@talend/scripts-config-cdn",
"version": "10.9.0",
"version": "10.9.1",
"description": "Provide a simple API to inject CDN config into existing webpack configuration",
"main": "cdn.js",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions tools/scripts-config-jest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @talend/scripts-config-jest

## 13.1.1

### Patch Changes

- 06598a0c0: fix(TDP-12694): broken applyBabelTransformOn after pnpm use-case

## 13.1.0

### Minor Changes
Expand Down
15 changes: 15 additions & 0 deletions tools/scripts-config-jest/__tests__/utils.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { applyBabelTransformOn } from '../utils';

describe('utilities', () => {
describe('applyBabelTransformOn', () => {
it('should add babel transform directive', () => {
const config = {
transformIgnorePatterns: ['node_modules/(?!(?:.pnpm/)?(d3|internmap))'],
};
applyBabelTransformOn(config, ['dexie']);
expect(config.transformIgnorePatterns[0]).toBe(
'node_modules/(?!(?:.pnpm/)?(d3|internmap|dexie))',
);
});
});
});
2 changes: 1 addition & 1 deletion tools/scripts-config-jest/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@talend/scripts-config-jest",
"description": "Jest configuration for @talend/scripts-core",
"version": "13.1.0",
"version": "13.1.1",
"license": "Apache-2.0",
"main": "index.js",
"author": "Talend Frontend <[email protected]>",
Expand Down
4 changes: 2 additions & 2 deletions tools/scripts-config-jest/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function applyBabelTransformOn(config, pkgs) {
config.transformIgnorePatterns[0] = config.transformIgnorePatterns[0].replace(
')',
`|${pkgs.join('|')})`,
/(\)\)$)/,
`|${pkgs.join('|')}$1`,
);
}

Expand Down
6 changes: 6 additions & 0 deletions tools/scripts-config-prettier/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @talend/scripts-config-prettier

## 12.1.2

### Patch Changes

- 5455b6517: fix: prettier configuration for sort imports

## 12.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-config-prettier/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@talend/scripts-config-prettier",
"version": "12.1.1",
"version": "12.1.2",
"description": "Shared Prettier config",
"main": ".prettierrc.js",
"homepage": "https://github.com/Talend/ui/tree/master/packages/ui-scripts#readme",
Expand Down

0 comments on commit b7ccea6

Please sign in to comment.