Skip to content

Commit

Permalink
doc: update all documentation (#4869)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfrancois authored Nov 28, 2023
1 parent 4582fc6 commit 9bdcf3a
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 55 deletions.
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: 2 additions & 0 deletions tools/babel-plugin-assets-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ assetsAPI.getURL('/', 'react', '16.14.0');
assetsAPI.getJSON('/foo.json', 'react', '16.14.0');
assetsAPI.getUMD('react', '16.14.0', 'React', '/umd/react.production.min.js');
```

As you can see it uses production path in the getUMD.
23 changes: 7 additions & 16 deletions tools/eslint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,29 @@ This package contains internal rules used at Talend.

## Installation

You have nothing to do if you use Talend/ui-scripts.

You have nothing to do if you use Talend/ui-scripts. If not this can be used as any other eslint plugin

## Usage

Add `talend` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
"plugins": [
"@talend"
]
"plugins": ["@talend"]
}
```


Then configure the rules you want to use under the rules section.

```json
{
"rules": {
"@talend/import-depth": 2
}
"rules": {
"@talend/import-depth": 2
}
}
```

## Supported Rules

* [talend/import-depth](./docs/rules/talend-import-depth.md)
* [talend/import-d3](./docs/rules/talend-import-d3.md)





- [talend/import-depth](./docs/rules/talend-import-depth.md)
- [talend/import-d3](./docs/rules/talend-import-d3.md)
10 changes: 5 additions & 5 deletions tools/scripts-cmf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## Usage

launch the command below to build your webapp. you can add it into `prepublish` npm script.

```
yarn cmf-settings
npx @talend/scripts-cmf
```

Note: If you add `node_modules/.bin` into your env _PATH_ you can directly type `cmf-settings`.
You can also launch the command below to build your webapp. you can add it into `prepublish` npm script.

## cmf-settings
```
yarn cmf-settings
```

This script merge a set of settings `sources` into a `destination` file.
Each sources is a path to eiter a folder or a file.
Expand Down
4 changes: 3 additions & 1 deletion tools/scripts-config-babel/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Babel config customisation
This package contains the main babel configuration used everywhere else in Talend.

## Babel config customisation

You can use your own babelrc but it is not recommanded. To do so, you will need to extend the preset babelrc.

Expand Down

0 comments on commit 9bdcf3a

Please sign in to comment.