Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a linter to validate external links #148

Merged
merged 4 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions .remarkrc.mjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
import remarkValidateLinks from "remark-validate-links";
import remarkFrontmatter from "remark-frontmatter";
import remarkLintFrontmatterSchema from "remark-lint-frontmatter-schema";
import remarkLintNoDeadUrls from "remark-lint-no-dead-urls";

const remarkConfig = {
plugins: [
remarkValidateLinks,
remarkFrontmatter,
[
remarkLintFrontmatterSchema,
{
schemas: {
/* One schema for many files */
"./.github/linters/metadata.schema.yml": [
/* Support glob patterns ———v */
"./src/pages/**/*.md",
],
},
},
],
],
plugins: [
remarkValidateLinks,
remarkFrontmatter,
[
remarkLintFrontmatterSchema,
{
schemas: {
/* One schema for many files */
"./.github/linters/metadata.schema.yml": [
/* Support glob patterns ———v */
"./src/pages/**/*.md",
],
},
},
],
[
remarkLintNoDeadUrls,
{
skipUrlPatterns: [
"https://www.php.net",
"https://jqueryvalidation.org"
]
}
],
],
};
export default remarkConfig;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"remark-cli": "^10.0.1",
"remark-frontmatter": "4.0.1",
"remark-lint-frontmatter-schema": "^3.15.2",
"remark-lint-no-dead-urls": "^1.1.0",
"remark-validate-links": "^11.0.2"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/guide/css/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ To compile `.less` files, add your theme to `module.exports` in the Grunt config

**IMPORTANT NOTE** : If grunt gives the error "Error: Cannot find module ....", check the path in your `grunt-config.json` file and correct as necessary.

1. (Optional) If you want to use Grunt for "watching" changes automatically, without reloading pages in a browser each time, install the [LiveReload extension](http://livereload.com/extensions/) in your browser.
1. (Optional) If you want to use Grunt for "watching" changes automatically, without reloading pages in a browser each time, install the LiveReload extension in your browser.

## Grunt commands

Expand Down
8 changes: 4 additions & 4 deletions src/pages/page-builder/migration/install-migration-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,23 @@ After completing these steps, the data migration source code can be found within

This installation option is for those who are part of the Commerce organization on GitHub and want easier access to the migration source code during migration development work.

To install the migration module from the GitHub repo ([magento2/magento2-page-builder-data-migration](<https://github.com/magento/magento2-page-builder-data-migration>)):
To install the migration module from the GitHub repo, you will need access to the private repo: `magento/magento2-page-builder-data-migration`:

1. Navigate into the directory above your Magento 2 installation.

1. Clone the `magento/magento2-page-builder-data-migration` repository using the following command:
2. Clone the `magento/magento2-page-builder-data-migration` repository using the following command:

```bash
git clone git@github.com:magento/magento2-page-builder-data-migration.git
```

1. Symlink the `magento2-page-builder-data-migration` into your Commerce installation:
3. Symlink the `magento2-page-builder-data-migration` into your Commerce installation:

```bash
php <magento-root-directory>/dev/tools/build-ee.php --command=link --ce-source <magento-root-directory> --ee-source magento2-page-builder-data-migration
```

1. [Disable the default migration-on-deployment feature](#disable-migration-on-deployment).
4. [Disable the default migration-on-deployment feature](#disable-migration-on-deployment).

**Note**: This step is critical for migration development work. It disables the default migration module behavior that migrates your content as part of the deployment using `setup:upgrade`. We made this the default behavior so that deployment to production is easy. But during development, you need to turn it off so that you do not run your migrations accidentally, before you have made strategic changes to your migration code, or backups to your database.

Expand Down
2 changes: 1 addition & 1 deletion src/pages/ui-components/components/columns-controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The ColumnsControls component is a collection of columns. It provides an interfa
Extends [`uiCollection`](../concepts/collection.md):

* [`app/code/Magento/Ui/view/base/web/js/grid/controls/columns.js`](https://github.com/magento/magento2/blob/2.4/app/code/Magento/Ui/view/base/web/js/grid/controls/columns.js)
* [`app/code/Magento/Ui/view/base/web/templates/grid/controls/columns.html`](https://github.com/magento/magento2/blob/2.4/app/code/Magento/Ui/view/base/web/templates/grid/controls/columns.md)
* [`app/code/Magento/Ui/view/base/web/templates/grid/controls/columns.html`](https://github.com/magento/magento2/blob/2.4/app/code/Magento/Ui/view/base/web/templates/grid/controls/columns.html)

## Example

Expand Down
3 changes: 1 addition & 2 deletions src/pages/ui-components/components/file-uploader.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The File Uploader component is an adapter for the [jQuery-File-Upload](https://g
| Title | Description | Type | Default Value |
| --- | --- | --- | --- |
| `allowedExtensions` | List of allowed file extensions. For example, `'jpg jpeg gif png svg'`. If set to "false" - then no extension is allowed, "true" - any extension is allowed. | Boolean/String | `false` |
| `component` | The path to the components JS constructor in terms of RequireJS. | String | `'Magento_Ui/js/form/element/file-uploader'` |
| `component` | The path to the component's JS constructor in terms of RequireJS. | String | `'Magento_Ui/js/form/element/file-uploader'` |
| `dropZone` | CSS selector of a drop zone element. | String | `[data-role=drop-zone]` |
| `isMultipleFiles` | Defines whether multiple files can be uploaded. | Boolean | `false` |
| `maxFileSize` | Defines the maximum allowed file size in bytes. | Boolean/Number | `false` |
Expand Down Expand Up @@ -63,6 +63,5 @@ Here is an example of how File Uploader component integrates with [Form](form.md
Extends `abstract`:

- [`<Magento_Ui_module_dir>/view/base/web/js/form/element/file-uploader.js`](https://github.com/magento/magento2/blob/2.4/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js)
- [`jquery/fileUploader/jquery.fileupload-fp`](https://github.com/magento/magento2/blob/2.4/lib/web/jquery/fileUploader/jquery.fileupload-fp.js)
- [`<Magento_Ui_module_dir>/view/base/web/templates/form/element/uploader/uploader.html`](https://github.com/magento/magento2/blob/2.4/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/uploader.html)
- [`<Magento_Ui_module_dir>/view/base/web/templates/form/element/uploader/preview.html`](https://github.com/magento/magento2/blob/2.4/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/preview.html)
Loading