-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'e2e/add-react-crossword' of github.com:guardian/dotcom-…
…rendering into e2e/add-react-crossword
- Loading branch information
Showing
14 changed files
with
812 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ | |
"@guardian/libs": "19.2.1", | ||
"@guardian/ophan-tracker-js": "2.2.5", | ||
"@guardian/react-crossword": "2.0.2", | ||
"@guardian/react-crossword-next": "npm:@guardian/[email protected]", | ||
"@guardian/shimport": "1.0.2", | ||
"@guardian/source": "8.0.0", | ||
"@guardian/source-development-kitchen": "12.0.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,24 @@ if (pkg.devDependencies) { | |
process.exit(1); | ||
} | ||
|
||
const mismatches = Object.entries(pkg.dependencies).filter( | ||
([, version]) => | ||
!semver.valid(version) && !version.startsWith('workspace:'), | ||
); | ||
/** | ||
* We don't check packages that are not semver-compatible | ||
* @type {RegExp[]} | ||
*/ | ||
const exceptions = /** @type {const} */ ([ | ||
/npm:@guardian\/[email protected]/, | ||
]); | ||
|
||
const mismatches = Object.entries(pkg.dependencies) | ||
.filter( | ||
([, version]) => | ||
!exceptions.some((exception) => exception.test(version)), | ||
) | ||
|
||
.filter( | ||
([, version]) => | ||
!semver.valid(version) && !version.startsWith('workspace:'), | ||
); | ||
|
||
if (mismatches.length !== 0) { | ||
warn('dotcom-rendering dependencies should be pinned.'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Crossword as ReactCrossword } from '@guardian/react-crossword-next'; | ||
import type { CrosswordProps } from '@guardian/react-crossword-next'; | ||
|
||
export const Crossword = (data: CrosswordProps['data']) => ( | ||
<ReactCrossword data={data} clueMinWidth={150} /> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.