From 28ac9a82d43d16475e4499fef01467c920abb4df Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 20 May 2022 11:13:10 +0200 Subject: [PATCH] meta: remove CJS-related hack in `build:locale-pack` script --- private/locale-pack/index.mjs | 9 +-------- website/src/docs/audio.md | 3 --- website/src/docs/aws-s3.md | 3 --- website/src/docs/box.md | 3 --- website/src/docs/core.md | 3 --- website/src/docs/dashboard.md | 3 --- website/src/docs/drag-drop.md | 3 --- website/src/docs/dropbox.md | 3 --- website/src/docs/facebook.md | 3 --- website/src/docs/file-input.md | 3 --- website/src/docs/google-drive.md | 3 --- website/src/docs/image-editor.md | 3 --- website/src/docs/instagram.md | 3 --- website/src/docs/onedrive.md | 3 --- website/src/docs/screen-capture.md | 3 --- website/src/docs/status-bar.md | 3 --- website/src/docs/thumbnail-generator.md | 3 --- website/src/docs/transloadit.md | 3 --- website/src/docs/url.md | 3 --- website/src/docs/webcam.md | 3 --- website/src/docs/xhr-upload.md | 3 --- website/src/docs/zoom.md | 3 --- 22 files changed, 1 insertion(+), 71 deletions(-) diff --git a/private/locale-pack/index.mjs b/private/locale-pack/index.mjs index 590afa81db..9a27ecc278 100644 --- a/private/locale-pack/index.mjs +++ b/private/locale-pack/index.mjs @@ -93,18 +93,11 @@ async function generateLocaleDocs (pluginName) { // Replace all nodes after the locale heading until the next heading (or eof) headingRange(tree, rangeOptions, (start, _, end) => [ start, - { - type: 'html', - // `module.exports` is not allowed by eslint in our docs. - // The script outputs an extra newline which also isn't excepted by eslint - // TODO: remove the no-restricted-globals when switch to ESM is completed. - value: '', - }, { type: 'code', lang: 'js', meta: null, - value: fs.readFileSync(localePath, 'utf-8'), + value: fs.readFileSync(localePath, 'utf-8').trimEnd(), }, end, ]) diff --git a/website/src/docs/audio.md b/website/src/docs/audio.md index 678ac9c219..4a69d003eb 100644 --- a/website/src/docs/audio.md +++ b/website/src/docs/audio.md @@ -65,8 +65,6 @@ Configures whether to show a dropdown which enables to choose the audio device t ### `locale: {}` - - ```js export default { strings: { @@ -98,5 +96,4 @@ export default { discardRecordedFile: 'Discard recorded file', }, } - ``` diff --git a/website/src/docs/aws-s3.md b/website/src/docs/aws-s3.md index 4f3fc62305..3cf48b5b09 100644 --- a/website/src/docs/aws-s3.md +++ b/website/src/docs/aws-s3.md @@ -115,15 +115,12 @@ This option is useful when uploading to an S3-like service that doesn’t reply ### `locale: {}` - - ```js export default { strings: { timedOut: 'Upload stalled for %{seconds} seconds, aborting.', }, } - ``` ## S3 Bucket configuration diff --git a/website/src/docs/box.md b/website/src/docs/box.md index 763f4c108a..4606a64db0 100644 --- a/website/src/docs/box.md +++ b/website/src/docs/box.md @@ -127,13 +127,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil ### `locale: {}` - - ```js export default { strings: { pluginNameBox: 'Box', }, } - ``` diff --git a/website/src/docs/core.md b/website/src/docs/core.md index 8f836954dd..8d3869cef6 100644 --- a/website/src/docs/core.md +++ b/website/src/docs/core.md @@ -277,8 +277,6 @@ const uppy = new Uppy({ ### `locale: {}` - - ```js export default { strings: { @@ -338,7 +336,6 @@ export default { }, }, } - ``` ### `store: defaultStore()` diff --git a/website/src/docs/dashboard.md b/website/src/docs/dashboard.md index a7537f8962..71c97ca4e5 100644 --- a/website/src/docs/dashboard.md +++ b/website/src/docs/dashboard.md @@ -334,8 +334,6 @@ Dashboard ships with the `ThumbnailGenerator` plugin that adds small resized ima ### `locale: {}` - - ```js export default { strings: { @@ -425,7 +423,6 @@ export default { }, }, } - ``` ### `theme: 'light'` diff --git a/website/src/docs/drag-drop.md b/website/src/docs/drag-drop.md index 1e35d8333f..c87451f615 100644 --- a/website/src/docs/drag-drop.md +++ b/website/src/docs/drag-drop.md @@ -86,8 +86,6 @@ Optionally, specify a string of text that explains something about the upload fo ### `locale: {}` - - ```js export default { strings: { @@ -98,7 +96,6 @@ export default { browse: 'browse', }, } - ``` ### `onDragOver(event)` diff --git a/website/src/docs/dropbox.md b/website/src/docs/dropbox.md index 5ec0d9f7da..18de62aee7 100644 --- a/website/src/docs/dropbox.md +++ b/website/src/docs/dropbox.md @@ -127,13 +127,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil ### `locale: {}` - - ```js export default { strings: { pluginNameDropbox: 'Dropbox', }, } - ``` diff --git a/website/src/docs/facebook.md b/website/src/docs/facebook.md index dbdda2d7c4..dafc2b9eb4 100644 --- a/website/src/docs/facebook.md +++ b/website/src/docs/facebook.md @@ -86,13 +86,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil ### `locale: {}` - - ```js export default { strings: { pluginNameFacebook: 'Facebook', }, } - ``` diff --git a/website/src/docs/file-input.md b/website/src/docs/file-input.md index 6fa3beb10a..d9c3b0b4b5 100644 --- a/website/src/docs/file-input.md +++ b/website/src/docs/file-input.md @@ -84,8 +84,6 @@ The `name` attribute for the `` element. ### `locale: {}` - - ```js export default { strings: { @@ -95,7 +93,6 @@ export default { chooseFiles: 'Choose files', }, } - ``` ## Custom file input diff --git a/website/src/docs/google-drive.md b/website/src/docs/google-drive.md index 65df5ec3e9..b15f4c961b 100644 --- a/website/src/docs/google-drive.md +++ b/website/src/docs/google-drive.md @@ -122,13 +122,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil ### `locale: {}` - - ```js export default { strings: { pluginNameGoogleDrive: 'Google Drive', }, } - ``` diff --git a/website/src/docs/image-editor.md b/website/src/docs/image-editor.md index 0f1a6ad658..31ba34f265 100644 --- a/website/src/docs/image-editor.md +++ b/website/src/docs/image-editor.md @@ -123,8 +123,6 @@ uppy.on('file-editor:complete', (updatedFile) => { ### `locale: {}` - - ```js export default { strings: { @@ -138,5 +136,4 @@ export default { aspectRatioPortrait: 'Crop portrait (9:16)', }, } - ``` diff --git a/website/src/docs/instagram.md b/website/src/docs/instagram.md index 4bf6ad5f3e..47d8f99d04 100644 --- a/website/src/docs/instagram.md +++ b/website/src/docs/instagram.md @@ -92,13 +92,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil ### `locale: {}` - - ```js export default { strings: { pluginNameInstagram: 'Instagram', }, } - ``` diff --git a/website/src/docs/onedrive.md b/website/src/docs/onedrive.md index 0d0b831632..7692993ede 100644 --- a/website/src/docs/onedrive.md +++ b/website/src/docs/onedrive.md @@ -86,13 +86,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil ### `locale: {}` - - ```js export default { strings: { pluginNameOneDrive: 'OneDrive', }, } - ``` diff --git a/website/src/docs/screen-capture.md b/website/src/docs/screen-capture.md index 24b2937573..d516cf11b4 100644 --- a/website/src/docs/screen-capture.md +++ b/website/src/docs/screen-capture.md @@ -102,8 +102,6 @@ If no preferred video mime type is given, the ScreenCapture plugin will prefer t ### `locale: {}` - - ```js export default { strings: { @@ -116,5 +114,4 @@ export default { recording: 'Recording', }, } - ``` diff --git a/website/src/docs/status-bar.md b/website/src/docs/status-bar.md index 568ed800d1..f06a1b7d4a 100644 --- a/website/src/docs/status-bar.md +++ b/website/src/docs/status-bar.md @@ -120,8 +120,6 @@ const doneButtonHandler = () => { ### `locale: {}` - - ```js export default { strings: { @@ -172,7 +170,6 @@ export default { showErrorDetails: 'Show error details', }, } - ``` [`@uppy/file-input`]: /docs/file-input diff --git a/website/src/docs/thumbnail-generator.md b/website/src/docs/thumbnail-generator.md index 600df64e31..eeafcffb78 100644 --- a/website/src/docs/thumbnail-generator.md +++ b/website/src/docs/thumbnail-generator.md @@ -60,15 +60,12 @@ A unique identifier for this plugin. It defaults to `'ThumbnailGenerator'`. ### `locale: {}` - - ```js export default { strings: { generatingThumbnails: 'Generating thumbnails...', }, } - ``` ### `thumbnailWidth: 200` diff --git a/website/src/docs/transloadit.md b/website/src/docs/transloadit.md index 7b55f97632..b100a6436d 100644 --- a/website/src/docs/transloadit.md +++ b/website/src/docs/transloadit.md @@ -302,8 +302,6 @@ Limit the amount of uploads going on at the same time. Setting this to `0` means ### `locale: {}` - - ```js export default { strings: { @@ -316,7 +314,6 @@ export default { encoding: 'Encoding...', }, } - ``` ## Errors diff --git a/website/src/docs/url.md b/website/src/docs/url.md index 025774f0d7..7fd004080b 100644 --- a/website/src/docs/url.md +++ b/website/src/docs/url.md @@ -84,8 +84,6 @@ This option correlates to the [RequestCredentials value](https://developer.mozil ### `locale: {}` - - ```js export default { strings: { @@ -99,7 +97,6 @@ export default { enterCorrectUrl: 'Incorrect URL: Please make sure you are entering a direct link to a file', }, } - ``` ## Methods diff --git a/website/src/docs/webcam.md b/website/src/docs/webcam.md index 3570cda158..3652c15090 100644 --- a/website/src/docs/webcam.md +++ b/website/src/docs/webcam.md @@ -158,8 +158,6 @@ If no preferred image mime type is given, the Webcam plugin will prefer types li ### `locale: {}` - - ```js export default { strings: { @@ -189,5 +187,4 @@ export default { allowAccessDescription: 'In order to take pictures or record video with your camera, please allow camera access for this site.', }, } - ``` diff --git a/website/src/docs/xhr-upload.md b/website/src/docs/xhr-upload.md index 04ff16fb02..5fdac96425 100644 --- a/website/src/docs/xhr-upload.md +++ b/website/src/docs/xhr-upload.md @@ -231,8 +231,6 @@ Indicates whether cross-site Access-Control requests should be made using creden ### `locale: {}` - - ```js export default { strings: { @@ -240,7 +238,6 @@ export default { timedOut: 'Upload stalled for %{seconds} seconds, aborting.', }, } - ``` ## POST Parameters / Form Fields diff --git a/website/src/docs/zoom.md b/website/src/docs/zoom.md index 165a03ef26..919900b55d 100644 --- a/website/src/docs/zoom.md +++ b/website/src/docs/zoom.md @@ -90,15 +90,12 @@ This option correlates to the [RequestCredentials value](https://developer.mozil ### `locale: {}` - - ```js export default { strings: { pluginNameZoom: 'Zoom', }, } - ``` ## Zoom Marketplace