Skip to content

Commit

Permalink
Merge branch 'master' into jmfrancois/chore/upgrade-testing-library
Browse files Browse the repository at this point in the history
  • Loading branch information
romainseb committed Nov 29, 2023
2 parents 8ae32c2 + ea01ec5 commit 4201510
Show file tree
Hide file tree
Showing 58 changed files with 788 additions and 493 deletions.
5 changes: 0 additions & 5 deletions .changeset/ninety-baboons-join.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0

- name: Use Node.js
uses: ./.github/actions/setup-node
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/design-system-component-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
browser: ["chrome", "firefox"]
steps:
- name: Checkout repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0

- name: Use Node.js
uses: ./.github/actions/setup-node
Expand All @@ -42,7 +42,7 @@ jobs:
yarn workspace @talend/design-tokens run build:lib
- name: Cypress Component Testing
uses: cypress-io/github-action@59810ebfa5a5ac6fcfdcfdf036d1cd4d083a88f2 #v6.5.0
uses: cypress-io/github-action@ebe8b24c4428922d0f793a5c4c96853a633180e3 #v6.6.0
with:
install: false
browser: ${{ matrix.browser }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
working-directory: ./packages/icons
steps:
- name: Checkout sources
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
with:
# Required when using a PAT for opening the PR
persist-credentials: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0

- name: Use Node.js
uses: ./.github/actions/setup-node
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-playground.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0

- name: Use Node.js
uses: ./.github/actions/setup-node
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0

- name: Use Node.js
uses: ./.github/actions/setup-node
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0

- name: Use Node.js
uses: ./.github/actions/setup-node
Expand All @@ -33,7 +33,7 @@ jobs:
run: yarn test --coverage --coverageReporters json-summary

- name: Jest Coverage Comment
uses: MishaKav/jest-coverage-comment@41b5ca01d1250de84537448d248b8d18152cb277 #1.0.23
uses: MishaKav/jest-coverage-comment@f2e8b560403c4fd8234a2b268af3c28ca91e5cc7 #1.0.24
with:
multiple-files: |
assets-api, ./packages/assets-api/coverage/coverage-summary.json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
environment: main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
- name: Scan
uses: ./.github/actions/sourceclear
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
if: (github.actor != 'dependabot[bot]')

steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
# Run the "semgrep ci" command on the command line of the docker image.
- run: semgrep ci
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0

- name: Use Node.js
uses: ./.github/actions/setup-node
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/visual-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
environment: pull_request_unsafe
if: ( github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'need visual approval') )
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yarn-deduplicate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
Expand Down
78 changes: 45 additions & 33 deletions fork/module-to-cdn/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,21 @@
# @talend/module-to-cdn

[![Build Status](https://travis-ci.org/toutpt/module-to-cdn.svg?branch=jmfrancois/chore/fork)](https://travis-ci.org/toutpt/module-to-cdn)
[![NPM][npm-icon] ][npm-url]
[![dependencies][dependencies-image] ][dependencies-url]
[![devdependencies][devdependencies-image] ][devdependencies-url]

[npm-icon]: https://img.shields.io/npm/v/@talend/module-to-cdn.svg
[npm-url]: https://npmjs.org/package/@talend/module-to-cdn
[travis-ci-image]: https://travis-ci.org/toutpt/module-to-cdn.svg?branch=jmfrancois/chore/fork
[travis-ci-url]: https://travis-ci.org/toutpt/module-to-cdn
[dependencies-image]: https://david-dm.org/toutpt/module-to-cdn/status.svg
[dependencies-url]: https://david-dm.org/toutpt/module-to-cdn
[devdependencies-image]: https://david-dm.org/toutpt/module-to-cdn/dev-status.svg
[devdependencies-url]: https://david-dm.org/toutpt/module-to-cdn?type=dev


> Get cdn config from npm module name
## Fork

This module is fork of module-to-cdn from [Thomas Sileghem](http://mastilver.com).

Because unpkg is great for free usage [but not for production usage](https://kentcdodds.com/blog/unpkg-an-open-source-cdn-for-npm) we decided to made some changes to go forward.

After the following [big PR]() on the repository and an email to the author we have got no news from the author as all other PRs. So we decided to fork.
Because unpkg is great for free usage [but not for production usage](https://kentcdodds.com/blog/unpkg-an-open-source-cdn-for-npm) we decided to made some changes to going forward.

After big PR on the repository and an email to the author we have got no news as all other PRs. So we decided to fork.

## Install

```
$ npm install --save @talend/module-to-cdn
```


## Usage

```js
Expand All @@ -50,6 +33,7 @@ moduleToCdn('react', '15.3.0');
*/
```

Note if the package comes with css you will have them under `styleUrl` and `stylePath` properties

## API

Expand Down Expand Up @@ -79,12 +63,12 @@ Default: `development`

### Result

* `name`: name of the module
* `var`: name of the global variable exposing the module
* `url`: url where the module is available
* `version`: the version asked for
* `path`: relative path of the umd file in the distributed package
* `local`: absolute path on the current system to the file
- `name`: name of the module
- `var`: name of the global variable exposing the module
- `url`: url where the module is available
- `version`: the version asked for
- `path`: relative path of the umd file in the distributed package
- `local`: absolute path on the current system to the file

## Configuration of the resolver

Expand Down Expand Up @@ -118,9 +102,9 @@ moduleToCdn.add({
'@talend/my-private-module': {
var: 'TalendMyPrivateModule',
versions: {
'>= 0.0.0' : {
'development': '/dist/build.js',
'production': '/dist/build.min.js',
'>= 0.0.0': {
development: '/dist/build.js',
production: '/dist/build.min.js'
}
}
}
Expand All @@ -141,17 +125,45 @@ LIMIT=";ag-grid;ag-grid-community;ag-grid-enterprise;" ava -v

## Excluded modules

- hoist-non-react-statics: the umd build contains JS errors (process.env.NODE and require) on every versions.

## style-versions

* hoist-non-react-statics: the umd build contains JS errors (process.env.NODE and require) on every versions.
For the sake of simplicity, range must match between js and styles.
Here is the line in the code that read it:

```javascript
const styleConfig = moduleConf['style-versions'] && moduleConf['style-versions'][range];
```

So take it as a constraint, for example:

```json
"@talend/design-tokens": {
"var": "TalendDesignTokens",
"versions": {
"> 2.6.0": {
"development": "/dist/TalendDesignTokens.js",
"production": "/dist/TalendDesignTokens.min.js"
}
},
"style-versions": {
"> 2.6.0": {
"development": "/dist/TalendDesignTokens.css",
"production": "/dist/TalendDesignTokens.min.css"
}
}
}
```

## Contribute

To add your modules you have to

* checkout this package on github
* install and run the tests (it will load the cache for the tests)
* add your module in the module.json file
* ensure everytime the provided umd path exists and is valid.
- checkout this package on github
- install and run the tests (it will load the cache for the tests)
- add your module in the module.json file
- ensure everytime the provided umd path exists and is valid.

Example of not valid umd: https://unpkg.com/browse/[email protected]/dist/index.umd.js
createContext,deepEqual dependencies are always null.
Expand Down
34 changes: 34 additions & 0 deletions fork/module-to-cdn/jsonschema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/Talend/ui/modules.schema.json",
"title": "cdn modules schema",
"description": "Help you edit the file in vscode",
"type": "object",
"patternProperties": {
".*": {
"type": "object",

"properties": {
"var": {
"type": "string"
},
"versions": {
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"development": {
"type": "string"
},
"production": {
"type": "string"
}
}
}
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"prepare": "husky install"
},
"resolutions": {
"**/cypress": "^12.17.4",
"**/cypress": "^13.6.0",
"**/@types/react": "^18.2.7",
"**/@types/react-dom": "^18.2.7",
"**/i18next-scanner-typescript/typescript": "^5.0.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig } from 'cypress';
import path from 'path';
const { defineConfig } = require('cypress');
const path = require('path');

import {
const {
getWebpackRules,
getWebpackPlugins,
} from '@talend/scripts-config-react-webpack/config/webpack.config.common';
} = require('@talend/scripts-config-react-webpack/config/webpack.config.common');

const webpack = require('webpack');
const srcDirectories = [
Expand Down Expand Up @@ -34,7 +34,7 @@ const webpackConfig = {
},
},
module: {
rules: getWebpackRules(srcDirectories, true, true),
rules: getWebpackRules([path.resolve(process.cwd(), './src/')], true, true),
},
plugins: getWebpackPlugins().concat([
new webpack.ProvidePlugin({
Expand All @@ -43,7 +43,7 @@ const webpackConfig = {
]),
};

export default defineConfig({
module.exports = defineConfig({
viewportWidth: 400,
viewportHeight: 400,
video: false,
Expand Down
9 changes: 0 additions & 9 deletions packages/dataviz/cypress.d.ts

This file was deleted.

12 changes: 1 addition & 11 deletions packages/dataviz/cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
/* eslint-disable import/no-extraneous-dependencies */
/// <reference types="cypress" />

import '@testing-library/cypress/add-commands';
import { mount } from 'cypress/react';
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
mount: typeof mount;
}
}
}

Cypress.Commands.add('mount', (component, options) => {
const wrapper = component;
return mount(wrapper, options);
});

import '@testing-library/cypress/add-commands';
2 changes: 1 addition & 1 deletion packages/dataviz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@types/react": "^18.2.38",
"@types/topojson-client": "^3.1.4",
"@types/topojson-specification": "^1.0.5",
"cypress": "^12.17.4",
"cypress": "^13.6.0",
"cross-env": "^7.0.3",
"i18next": "^23.7.6",
"react": "^18.2.0",
Expand Down
Loading

0 comments on commit 4201510

Please sign in to comment.