Skip to content

Commit

Permalink
chore(prettier): fix prettier formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAlbin committed Nov 1, 2023
1 parent cc6552b commit 0649a73
Show file tree
Hide file tree
Showing 28 changed files with 159 additions and 160 deletions.
5 changes: 3 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
This pull request is for: (mark with an "x")

- [ ] `examples/*`
- [ ] `modules/next`
- [ ] `packages/next-drupal`
Expand All @@ -11,8 +12,8 @@ _Please add a link to the GitHub issue
where this problem is discussed._

- [ ] I need help adding tests. (mark with an "x")
_Code changes need test coverage. If you don't know
how to make tests, check this box to ask for help._
_Code changes need test coverage. If you don't know
how to make tests, check this box to ask for help._

## Describe your changes

Expand Down
6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ Refer to the table below for versions supported with security updates.
| Version | Supported |
| ------- | ------------------ |
| 1.x.x | :white_check_mark: |
| < 1.0.0 | :x: |
| < 1.0.0 | :x: |

### `next` Drupal module

| Version | Supported |
| ------- | ------------------ |
| 1.x.x | :white_check_mark: |
| < 1.0.0 | :x: |
| < 1.0.0 | :x: |

## Reporting a Vulnerability

If you believe you have found a security vulnerability in `next-drupal` package or the `next` Drupal module, we encourage you to let us know right away.

We will do our best to quickly fix the problem.
We will do our best to quickly fix the problem.

We will sync with the [Drupal Security Team](https://www.drupal.org/drupal-security-team) if the vulnerability affects the `next` Drupal module.

Expand Down
2 changes: 1 addition & 1 deletion examples/example-auth/cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
import "./commands"

// Alternatively you can use CommonJS syntax:
// require('./commands')
28 changes: 6 additions & 22 deletions examples/example-blog/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
Expand All @@ -19,24 +15,12 @@
"jsx": "preserve",
"baseUrl": "./",
"paths": {
"@/components/*": [
"src/components/*"
],
"@utils/*": [
"src/utils/*"
],
"@/config": [
"src/config"
]
"@/components/*": ["src/components/*"],
"@utils/*": ["src/utils/*"],
"@/config": ["src/config"]
},
"incremental": true
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion examples/example-marketing/cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
import "./commands"

// Alternatively you can use CommonJS syntax:
// require('./commands')
6 changes: 5 additions & 1 deletion examples/example-marketing/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import * as React from "react"
import Router from "next/router"
import { QueryClient, QueryClientProvider, Hydrate } from "@tanstack/react-query"
import {
QueryClient,
QueryClientProvider,
Hydrate,
} from "@tanstack/react-query"
import NProgress from "nprogress"
import { syncDrupalPreviewRoutes } from "next-drupal"
import "nprogress/nprogress.css"
Expand Down
2 changes: 1 addition & 1 deletion examples/example-query/pages/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function getStaticProps(context) {
}
}

const type = path.jsonapi.resourceName as typeof RESOURCE_TYPES[number]
const type = path.jsonapi.resourceName as (typeof RESOURCE_TYPES)[number]

if (!RESOURCE_TYPES.includes(type)) {
return {
Expand Down
2 changes: 1 addition & 1 deletion examples/example-search-api/cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
import "./commands"

// Alternatively you can use CommonJS syntax:
// require('./commands')
4 changes: 1 addition & 3 deletions examples/example-umami/components/meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export function Meta({ title, description }: MetaProps) {
rel="canonical"
href={absoluteURL(router.asPath !== "/" ? router.asPath : "")}
/>
<title>
{`${title} | ${siteConfig.name}`}
</title>
<title>{`${title} | ${siteConfig.name}`}</title>
<meta name="description" content={description || siteConfig.slogan} />
<meta
property="og:image"
Expand Down
6 changes: 5 additions & 1 deletion examples/example-umami/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as React from "react"
import Router from "next/router"
import { SessionProvider } from "next-auth/react"
import { QueryClient, QueryClientProvider, Hydrate } from "@tanstack/react-query"
import {
QueryClient,
QueryClientProvider,
Hydrate,
} from "@tanstack/react-query"
import { appWithTranslation } from "next-i18next"
import NProgress from "nprogress"
import "nprogress/nprogress.css"
Expand Down
2 changes: 1 addition & 1 deletion examples/example-webform/cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
import "./commands"

// Alternatively you can use CommonJS syntax:
// require('./commands')
49 changes: 24 additions & 25 deletions modules/next/config/schema/next.schema.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
next.next_site.*:
type: config_entity
label: "Next.js site"
label: 'Next.js site'
mapping:
id:
type: string
label: "ID"
label: 'ID'
label:
type: label
label: "Label"
label: 'Label'
base_url:
type: string
label: "Base URL"
label: 'Base URL'
preview_url:
type: string
label: "Preview URL"
label: 'Preview URL'
preview_secret:
type: string
label: "Preview secret"
label: 'Preview secret'
revalidate_url:
type: string
label: "Revalidate URL"
label: 'Revalidate URL'
revalidate_secret:
type: string
label: "Revalidate secret"

label: 'Revalidate secret'

next.next_entity_type_config.*:
type: config_entity
label: "Next.js entity type config"
label: 'Next.js entity type config'
mapping:
id:
type: string
label: "ID"
label: 'ID'
site_resolver:
type: string
label: "Site resolver"
label: 'Site resolver'
configuration:
type: next.site_resolver.configuration.[%parent.site_resolver]
revalidator:
type: string
label: "Revalidator"
label: 'Revalidator'
revalidator_configuration:
type: next.revalidator.configuration.[%parent.revalidator]

Expand All @@ -48,17 +47,17 @@ next.site_resolver.configuration.site_selector:
mapping:
sites:
type: sequence
label: "Next.js sites"
label: 'Next.js sites'
sequence:
type: string
label: "Site"
label: 'Site'

next.site_resolver.configuration.entity_reference_field:
type: mapping
mapping:
field_name:
type: string
label: "Field name"
label: 'Field name'

next.revalidator.configuration.*:
type: mapping
Expand All @@ -69,23 +68,23 @@ next.revalidator.configuration.path:
mapping:
revalidate_page:
type: boolean
label: "Revalidate page"
label: 'Revalidate page'
additional_paths:
type: string
label: "Additional paths"
label: 'Additional paths'

next.settings:
type: config_object
label: "Next settings"
label: 'Next settings'
mapping:
site_previewer:
type: string
label: "Site previewer"
label: 'Site previewer'
site_previewer_configuration:
type: next.site_previewer.configuration.[%parent.site_previewer]
preview_url_generator:
type: string
label: "Preview URL generator"
label: 'Preview URL generator'
preview_url_generator_configuration:
type: next.preview_url_generator.configuration.[%parent.preview_url_generator]
debug:
Expand All @@ -96,17 +95,17 @@ next.site_previewer.configuration.iframe:
mapping:
width:
type: string
label: "Width"
label: 'Width'
sync_route:
type: boolean
label: "Sync route"
label: 'Sync route'
sync_route_skip_routes:
type: string
label: "Sync route skip pages"
label: 'Sync route skip pages'

next.preview_url_generator.configuration.simple_oauth:
type: mapping
mapping:
secret_expiration:
type: integer
label: "Secret expiration"
label: 'Secret expiration'
52 changes: 28 additions & 24 deletions modules/next/js/next.site_preview.iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,45 @@
* Site preview.
*/

(function($, window, Drupal, drupalSettings) {

(function ($, window, Drupal, drupalSettings) {
Drupal.behaviors.iframePreviewLoader = {
attach(context) {
const $iframe = $('iframe.next-site-preview-iframe', context)
const $iframe = $('iframe.next-site-preview-iframe', context);

$iframe.on('load', () => {
$iframe.addClass('ready');
})
}
}
});
},
};

Drupal.behaviors.iframePreviewSyncRoute = {
attach() {
const { sync_route = false, skip_routes } = drupalSettings.next.iframe_preview
const { sync_route = false, skip_routes } =
drupalSettings.next.iframe_preview;

if (!sync_route) {
return;
}

window.addEventListener("message", (event) => {
const { data } = event

if (data.type !== 'NEXT_DRUPAL_ROUTE_SYNC' || !data.path) {
return;
}

if (skip_routes?.includes(data.path)) {
return;
}

if (window.location.pathname !== data.path) {
window.location.href = data.path
}
}, false);
}
}
window.addEventListener(
'message',
(event) => {
const { data } = event;

if (data.type !== 'NEXT_DRUPAL_ROUTE_SYNC' || !data.path) {
return;
}

if (skip_routes?.includes(data.path)) {
return;
}

if (window.location.pathname !== data.path) {
window.location.href = data.path;
}
},
false,
);
},
};
})(jQuery, window, Drupal, drupalSettings);
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
next.next_entity_type_config.*.third_party.next_extras:
type: mapping
label: "Revalidate"
label: 'Revalidate'
mapping:
revalidate:
type: boolean
label: "Revalidate"
label: 'Revalidate'
revalidate_paths:
type: string
label: "Revalidate paths"
label: 'Revalidate paths'
9 changes: 7 additions & 2 deletions modules/next/modules/next_extras/next_extras.services.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
services:
next_extras.cache_invalidator:
class: Drupal\next_extras\NextCacheInvalidator
arguments: ['@next.entity_type.manager', '@http_client', '@logger.channel.next_extras']
arguments:
[
'@next.entity_type.manager',
'@http_client',
'@logger.channel.next_extras',
]
logger.channel.next_extras:
parent: logger.channel_base
arguments: [ 'next_extras' ]
arguments: ['next_extras']
Loading

0 comments on commit 0649a73

Please sign in to comment.