Skip to content

Commit

Permalink
[FEATURE] Loaded official (alpha) releases from yoast instead of git …
Browse files Browse the repository at this point in the history
…submodule, fixed imports accordingly
  • Loading branch information
RinyVT committed Jul 3, 2024
1 parent 71b948f commit 24b19e8
Show file tree
Hide file tree
Showing 10 changed files with 1,298 additions and 225 deletions.
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, {useEffect, useState} from 'react';
import {connect} from 'react-redux';
import ProgressBar from '@yoast/components/ProgressBar';
import getProgressColor from '../helpers/progressColor';
import MetaDescriptionLengthAssessment from 'yoastseo/scoring/assessments/seo/MetaDescriptionLengthAssessment';
import { ProgressBar } from '@yoast/ui-library';
import { assessments } from 'yoastseo';

/**
* Gets the description progress.
Expand All @@ -19,7 +19,7 @@ const getDescriptionProgress = (description, date) => {
if (date !== "" && descriptionLength > 0) {
descriptionLength += date.length + 3;
}
const metaDescriptionLengthAssessment = new MetaDescriptionLengthAssessment();
const metaDescriptionLengthAssessment = new assessments.seo.MetaDescriptionLengthAssessment();
const score = metaDescriptionLengthAssessment.calculateScore(descriptionLength);
const maximumLength = metaDescriptionLengthAssessment.getMaximumLength();

Expand Down
6 changes: 3 additions & 3 deletions Resources/Public/JavaScript/Components/SnippetPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React, {useState} from 'react';
import { connect } from 'react-redux';
import LoadingIndicator from './LoadingIndicator';
import SnippetPreviewError from './SnippetPreviewError';
import YoastSnippetPreview from '@yoast/search-metadata-previews/snippet-preview/SnippetPreview';
import { SnippetPreview as YoastSnippetPreview } from '@yoast/search-metadata-previews';
import ModeSwitcher from './ModeSwitcher';
import {DEFAULT_MODE} from '@yoast/search-metadata-previews/snippet-preview/constants';
//import {DEFAULT_MODE} from '@yoast/search-metadata-previews/snippet-preview/constants';

const SnippetPreview = ({isFetching, title, url, faviconSrc, wordsToHighlight, description, locale}) => {
const [mode, setMode] = useState(DEFAULT_MODE);
const [mode, setMode] = useState('');

if (isFetching === false) {
if (typeof title === 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/Components/StatusIcon.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { connect } from 'react-redux';

import SvgIcon from '@yoast/components/SvgIcon'
import { SvgIcon } from '@yoast/components'

import { getIconForScore, getTextForScore } from "../helpers/mapResults";
import { interpreters } from "yoastseo";
Expand Down
6 changes: 3 additions & 3 deletions Resources/Public/JavaScript/Components/TitleProgressBar.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, {useEffect, useState} from 'react';
import {connect} from 'react-redux';
import ProgressBar from '@yoast/components/ProgressBar';
import { ProgressBar } from '@yoast/ui-library';
import getProgressColor from '../helpers/progressColor';
import measureTextWidth from '../helpers/measureTextWidth';
import PageTitleWidthAssessment from 'yoastseo/scoring/assessments/seo/PageTitleWidthAssessment';
import { assessments } from 'yoastseo';

const getTitleProgress = (title) => {
const titleWidth = measureTextWidth(title);
const pageTitleWidthAssessment = new PageTitleWidthAssessment();
const pageTitleWidthAssessment = new assessments.seo.PageTitleWidthAssessment();
const score = pageTitleWidthAssessment.calculateScore(titleWidth);
const maximumLength = pageTitleWidthAssessment.getMaximumLength();

Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/redux/actions/content.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {stripHTMLTags} from '@yoast/helpers/strings';
import {stripHTMLTags} from '@yoast/helpers';

export const GET_CONTENT_REQUEST = 'GET_CONTENT_REQUEST';
export const GET_CONTENT_SUCCESS = 'GET_CONTENT_SUCCESS';
Expand Down
11 changes: 6 additions & 5 deletions grunt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@
"dependencies": {
"@babel/polyfill": "^7.12.1",
"@wordpress/babel-plugin-makepot": "^3.10.0",
"@yoast/analysis-report": "file:submodules/wordpress-seo/packages/analysis-report",
"@yoast/components": "file:submodules/wordpress-seo/packages/components",
"@yoast/helpers": "file:submodules/wordpress-seo/packages/helpers",
"@yoast/search-metadata-previews": "file:submodules/wordpress-seo/packages/search-metadata-previews",
"@yoast/analysis-report": "1.21.0",
"@yoast/components": "3.0.0-alpha.0",
"@yoast/helpers": "0.17.0-alpha.0",
"@yoast/search-metadata-previews": "3.0.0-alpha.0",
"@yoast/ui-library": "^4.0.0",
"entities": "^1.1",
"fstream": "^1.0.12",
"lodash": "^4.17.21",
Expand All @@ -58,7 +59,7 @@
"react-redux": "^7.2.6",
"url": "^0.11.3",
"util": "^0.12.5",
"yoastseo": "file:submodules/wordpress-seo/packages/yoastseo"
"yoastseo": "2.0.0-alpha.0"
},
"repository": {
"type": "git",
Expand Down
1 change: 0 additions & 1 deletion grunt/submodules/wordpress-seo
Submodule wordpress-seo deleted from 6f67f9
7 changes: 0 additions & 7 deletions grunt/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ module.exports = {
"url": require.resolve("url/"),
"util": require.resolve("util/")
},
alias: {
'yoastseo': path.resolve(__dirname, 'submodules/wordpress-seo/packages/yoastseo/src'),
'@yoast/analysis-report': path.resolve(__dirname, 'submodules/wordpress-seo/packages/analysis-report/src'),
'@yoast/components': path.resolve(__dirname, 'submodules/wordpress-seo/packages/components/src'),
'@yoast/helpers': path.resolve(__dirname, 'submodules/wordpress-seo/packages/helpers/src'),
'@yoast/search-metadata-previews': path.resolve(__dirname, 'submodules/wordpress-seo/packages/search-metadata-previews/src'),
}
},
plugins: [
// fix "process is not defined" error:
Expand Down
Loading

0 comments on commit 24b19e8

Please sign in to comment.