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

Change import path to relative #1289

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"cSpell.words": ["noindex", "nofollow"]
"cSpell.words": ["noindex", "nofollow"],
"typescript.preferences.importModuleSpecifier": "relative"
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
"husky": "4.3.8",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"lint-staged": "11.1.1",
"microbundle": "^0.15.1",
"lint-staged": "13.2.3",
"microbundle": "^0.14.2",
"next": "^13.0.0",
Expand Down
6 changes: 3 additions & 3 deletions src/jsonld/article.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';

import { JsonLd, JsonLdProps } from './jsonld';
import { setAuthor } from 'src/utils/schema/setAuthor';
import { setPublisher } from 'src/utils/schema/setPublisher';
import { ArticleAuthor } from 'src/types';
import { setAuthor } from '../utils/schema/setAuthor';
import { setPublisher } from '../utils/schema/setPublisher';
import { ArticleAuthor } from '../types';

export interface ArticleJsonLdProps extends JsonLdProps {
type?: 'Article' | 'BlogPosting' | 'NewsArticle' | 'Blog';
Expand Down
4 changes: 2 additions & 2 deletions src/jsonld/brand.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import type { AggregateRating } from 'src/types';
import { setAggregateRating } from 'src/utils/schema/setAggregateRating';
import type { AggregateRating } from '../types';
import { setAggregateRating } from '../utils/schema/setAggregateRating';

import { JsonLd, JsonLdProps } from './jsonld';

Expand Down
4 changes: 2 additions & 2 deletions src/jsonld/breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import type { ItemListElements } from 'src/types';
import { setItemListElements } from 'src/utils/schema/setItemListElements';
import type { ItemListElements } from '../types';
import { setItemListElements } from '../utils/schema/setItemListElements';

import { JsonLd, JsonLdProps } from './jsonld';

Expand Down
16 changes: 8 additions & 8 deletions src/jsonld/carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import React from 'react';

import { JsonLd, JsonLdProps } from './jsonld';

import type { CourseJsonLdProps, RecipeJsonLdProps } from 'src/index';
import type { Review, AggregateRating } from 'src/types';
import { setReviews } from 'src/utils/schema/setReviews';
import { setAuthor } from 'src/utils/schema/setAuthor';
import { setNutrition } from 'src/utils/schema/setNutrition';
import { setAggregateRating } from 'src/utils/schema/setAggregateRating';
import { setVideo } from 'src/utils/schema/setVideo';
import { setInstruction } from 'src/utils/schema/setInstruction';
import type { CourseJsonLdProps, RecipeJsonLdProps } from '../index';
import type { Review, AggregateRating } from '../types';
import { setReviews } from '../utils/schema/setReviews';
import { setAuthor } from '../utils/schema/setAuthor';
import { setNutrition } from '../utils/schema/setNutrition';
import { setAggregateRating } from '../utils/schema/setAggregateRating';
import { setVideo } from '../utils/schema/setVideo';
import { setInstruction } from '../utils/schema/setInstruction';

type Director = {
name: string;
Expand Down
4 changes: 2 additions & 2 deletions src/jsonld/collectionPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';

import { JsonLd, JsonLdProps } from './jsonld';
import type { CreativeWork } from 'src/types';
import { setCreativeWork } from 'src/utils/schema/setCreativeWork';
import type { CreativeWork } from '../types';
import { setCreativeWork } from '../utils/schema/setCreativeWork';

export interface CollectionPageJsonLdProps extends JsonLdProps {
name: string;
Expand Down
4 changes: 2 additions & 2 deletions src/jsonld/corporateContact.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';

import { JsonLd, JsonLdProps } from './jsonld';
import type { ContactPoint } from 'src/types';
import type { ContactPoint } from '../types';

import { setContactPoint } from 'src/utils/schema/setContactPoint';
import { setContactPoint } from '../utils/schema/setContactPoint';

export interface CorporateContactJsonLdProps extends JsonLdProps {
url: string;
Expand Down
4 changes: 2 additions & 2 deletions src/jsonld/course.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import type { Provider } from 'src/types';
import { setProvider } from 'src/utils/schema/setProvider';
import type { Provider } from '../types';
import { setProvider } from '../utils/schema/setProvider';

import { JsonLd, JsonLdProps } from './jsonld';

Expand Down
12 changes: 6 additions & 6 deletions src/jsonld/event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import type {
Organizer,
EventStatus,
EventAttendanceMode,
} from 'src/types';
import { setLocation } from 'src/utils/schema/setLocation';
import { setPerformer } from 'src/utils/schema/setPerformer';
import { setOffers } from 'src/utils/schema/setOffers';
import { setAggregateOffer } from 'src/utils/schema/setAggregateOffer';
import { setOrganizer } from 'src/utils/schema/setOrganizer';
} from '../types';
import { setLocation } from '../utils/schema/setLocation';
import { setPerformer } from '../utils/schema/setPerformer';
import { setOffers } from '../utils/schema/setOffers';
import { setAggregateOffer } from '../utils/schema/setAggregateOffer';
import { setOrganizer } from '../utils/schema/setOrganizer';

export interface EventJsonLdProps extends JsonLdProps {
name: string;
Expand Down
4 changes: 2 additions & 2 deletions src/jsonld/faqPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';

import type { Question } from 'src/types';
import type { Question } from '../types';
import { JsonLd, JsonLdProps } from './jsonld';
import { setQuestions } from 'src/utils/schema/setQuestions';
import { setQuestions } from '../utils/schema/setQuestions';

export interface FAQPageJsonLdProps extends JsonLdProps {
mainEntity: Question[];
Expand Down
12 changes: 6 additions & 6 deletions src/jsonld/howTo.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';

import { JsonLd, JsonLdProps } from './jsonld';
import { setImage } from 'src/utils/schema/setImage';
import { setCost } from 'src/utils/schema/setCost';
import { setSupply } from 'src/utils/schema/setSupply';
import { setTool } from 'src/utils/schema/setTool';
import { setStep } from 'src/utils/schema/setStep';
import { setImage } from '../utils/schema/setImage';
import { setCost } from '../utils/schema/setCost';
import { setSupply } from '../utils/schema/setSupply';
import { setTool } from '../utils/schema/setTool';
import { setStep } from '../utils/schema/setStep';

import { PriceSpecification, Step } from 'src/types';
import { PriceSpecification, Step } from '../types';

export interface HowToJsonLdProps extends JsonLdProps {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion src/jsonld/jsonld.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import Head from 'next/head';

import toJson from 'src/utils/toJson';
import toJson from '../utils/toJson';

export interface JsonLdProps {
type?: string;
Expand Down
18 changes: 9 additions & 9 deletions src/jsonld/localBusiness.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import type {
GeoCircle,
OpeningHoursSpecification,
Offer,
} from 'src/types';
import { setAddress } from 'src/utils/schema/setAddress';
import { setReviews } from 'src/utils/schema/setReviews';
import { setGeo } from 'src/utils/schema/setGeo';
import { setAggregateRating } from 'src/utils/schema/setAggregateRating';
import { setAction } from 'src/utils/schema/setAction';
import { setGeoCircle } from 'src/utils/schema/setGeoCircle';
import { setOffer } from 'src/utils/schema/setOffer';
import { setOpeningHours } from 'src/utils/schema/setOpeningHours';
} from '../types';
import { setAddress } from '../utils/schema/setAddress';
import { setReviews } from '../utils/schema/setReviews';
import { setGeo } from '../utils/schema/setGeo';
import { setAggregateRating } from '../utils/schema/setAggregateRating';
import { setAction } from '../utils/schema/setAction';
import { setGeoCircle } from '../utils/schema/setGeoCircle';
import { setOffer } from '../utils/schema/setOffer';
import { setOpeningHours } from '../utils/schema/setOpeningHours';

export interface LocalBusinessJsonLdProps extends JsonLdProps {
type: string;
Expand Down
4 changes: 2 additions & 2 deletions src/jsonld/newsarticle.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { setAuthor } from 'src/utils/schema/setAuthor';
import { setPublisher } from 'src/utils/schema/setPublisher';
import { setAuthor } from '../utils/schema/setAuthor';
import { setPublisher } from '../utils/schema/setPublisher';

import { JsonLd, JsonLdProps } from './jsonld';
import { ArticleAuthor } from '../types';
Expand Down
6 changes: 3 additions & 3 deletions src/jsonld/organization.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';

import type { Address, OrganizationCategory, ContactPoint } from 'src/types';
import type { Address, OrganizationCategory, ContactPoint } from '../types';
import { JsonLd, JsonLdProps } from './jsonld';
import { setAddress } from 'src/utils/schema/setAddress';
import { setContactPoints } from 'src/utils/schema/setContactPoints';
import { setAddress } from '../utils/schema/setAddress';
import { setContactPoints } from '../utils/schema/setContactPoints';

export interface OrganizationJsonLdProps extends JsonLdProps {
type?: OrganizationCategory;
Expand Down
19 changes: 7 additions & 12 deletions src/jsonld/product.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import React from 'react';

import { JsonLd, JsonLdProps } from './jsonld';
import type {
Review,
AggregateRating,
AggregateOffer,
Offers,
} from 'src/types';
import type { Review, AggregateRating, AggregateOffer, Offers } from '../types';

import { setOffers } from 'src/utils/schema/setOffers';
import { setReviews } from 'src/utils/schema/setReviews';
import { setAggregateRating } from 'src/utils/schema/setAggregateRating';
import { setAggregateOffer } from 'src/utils/schema/setAggregateOffer';
import { setManufacturer } from 'src/utils/schema/setManufacturer';
import { setBrand } from 'src/utils/schema/setBrand';
import { setOffers } from '../utils/schema/setOffers';
import { setReviews } from '../utils/schema/setReviews';
import { setAggregateRating } from '../utils/schema/setAggregateRating';
import { setAggregateOffer } from '../utils/schema/setAggregateOffer';
import { setManufacturer } from '../utils/schema/setManufacturer';
import { setBrand } from '../utils/schema/setBrand';

export interface ProductJsonLdProps extends JsonLdProps {
productName: string;
Expand Down
4 changes: 2 additions & 2 deletions src/jsonld/profilePage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';

import { JsonLd, JsonLdProps } from './jsonld';
import type { ItemListElements } from 'src/types';
import { setItemListElements } from 'src/utils/schema/setItemListElements';
import type { ItemListElements } from '../types';
import { setItemListElements } from '../utils/schema/setItemListElements';

export interface ProfilePageJsonLdProps extends JsonLdProps {
breadcrumb: string | ItemListElements[];
Expand Down
4 changes: 2 additions & 2 deletions src/jsonld/qaPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import type { Question } from 'src/types';
import { setAuthor } from 'src/utils/schema/setAuthor';
import type { Question } from '../types';
import { setAuthor } from '../utils/schema/setAuthor';

import { JsonLd, JsonLdProps } from './jsonld';

Expand Down
12 changes: 6 additions & 6 deletions src/jsonld/recipe.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';

import { JsonLd, JsonLdProps } from './jsonld';
import type { Instruction, AggregateRating, Video } from 'src/types';
import type { Instruction, AggregateRating, Video } from '../types';

import { setAggregateRating } from 'src/utils/schema/setAggregateRating';
import { setAuthor } from 'src/utils/schema/setAuthor';
import { setVideo } from 'src/utils/schema/setVideo';
import { setInstruction } from 'src/utils/schema/setInstruction';
import { setNutrition } from 'src/utils/schema/setNutrition';
import { setAggregateRating } from '../utils/schema/setAggregateRating';
import { setAuthor } from '../utils/schema/setAuthor';
import { setVideo } from '../utils/schema/setVideo';
import { setInstruction } from '../utils/schema/setInstruction';
import { setNutrition } from '../utils/schema/setNutrition';

export interface RecipeJsonLdProps extends JsonLdProps {
name: string;
Expand Down
6 changes: 3 additions & 3 deletions src/jsonld/softwareApp.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';

import { JsonLd, JsonLdProps } from './jsonld';
import type { Review, AggregateRating } from 'src/types';
import { setAggregateRating } from 'src/utils/schema/setAggregateRating';
import { setReviews } from 'src/utils/schema/setReviews';
import type { Review, AggregateRating } from '../types';
import { setAggregateRating } from '../utils/schema/setAggregateRating';
import { setReviews } from '../utils/schema/setReviews';

export interface SoftwareAppJsonLdProps extends JsonLdProps {
name: string;
Expand Down
4 changes: 2 additions & 2 deletions src/jsonld/video.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { Video } from 'src/types';
import { Video } from '../types';

import { JsonLd, JsonLdProps } from './jsonld';
import { setVideo } from 'src/utils/schema/setVideo';
import { setVideo } from '../utils/schema/setVideo';

export interface VideoJsonLdProps extends JsonLdProps, Video {}

Expand Down
18 changes: 9 additions & 9 deletions src/jsonld/videoGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import type {
Video,
Review,
ApplicationCategory,
} from 'src/types';
import { setAggregateRating } from 'src/utils/schema/setAggregateRating';
import { setAuthor } from 'src/utils/schema/setAuthor';
import { setImage } from 'src/utils/schema/setImage';
import { setOffers } from 'src/utils/schema/setOffers';
import { setProducer } from 'src/utils/schema/setProducer';
import { setProvider } from 'src/utils/schema/setProvider';
import { setReviews } from 'src/utils/schema/setReviews';
import { setVideo } from 'src/utils/schema/setVideo';
} from '../types';
import { setAggregateRating } from '../utils/schema/setAggregateRating';
import { setAuthor } from '../utils/schema/setAuthor';
import { setImage } from '../utils/schema/setImage';
import { setOffers } from '../utils/schema/setOffers';
import { setProducer } from '../utils/schema/setProducer';
import { setProvider } from '../utils/schema/setProvider';
import { setReviews } from '../utils/schema/setReviews';
import { setVideo } from '../utils/schema/setVideo';

import { JsonLd, JsonLdProps } from './jsonld';

Expand Down
4 changes: 2 additions & 2 deletions src/jsonld/webPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import type { ReviewedBy } from 'src/types';
import type { ReviewedBy } from '../types';

import { JsonLd, JsonLdProps } from './jsonld';
import { setReviewedBy } from 'src/utils/schema/setReviewedBy';
import { setReviewedBy } from '../utils/schema/setReviewedBy';

export interface WebPageJsonLdProps extends JsonLdProps {
keyOverride?: string;
Expand Down
6 changes: 3 additions & 3 deletions src/meta/nextSEO.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { Fragment } from 'react';

import { NextSeoProps } from '../types';
import { WithHead } from './withHead';
Expand All @@ -22,7 +22,7 @@ export const NextSeo = ({
additionalLinkTags,
}: NextSeoProps) => {
return (
<>
<Fragment>
<WithHead
title={title}
themeColor={themeColor}
Expand All @@ -41,6 +41,6 @@ export const NextSeo = ({
languageAlternates={languageAlternates}
additionalLinkTags={additionalLinkTags}
/>
</>
</Fragment>
);
};
2 changes: 1 addition & 1 deletion src/utils/schema/__tests__/setAction.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Action } from 'src/types';
import { Action } from '../../../types';
import { setAction } from '../setAction';

describe('setAction', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/schema/__tests__/setAddress.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Address } from 'src/types';
import { Address } from '../../../types';
import { setAddress } from '../setAddress';

const addressOne: Address = {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/schema/__tests__/setAggregateOffer.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AggregateOffer, Offers } from 'src/types';
import { AggregateOffer, Offers } from '../../../types';
import { setAggregateOffer } from '../setAggregateOffer';

const offerOne: Offers = {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/schema/__tests__/setAggregateRating.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AggregateRating } from 'src/types';
import { AggregateRating } from '../../../types';
import { setAggregateRating } from '../setAggregateRating';

const aggregateRating: AggregateRating = {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/schema/__tests__/setAuthor.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ArticleAuthor } from 'src/types';
import { ArticleAuthor } from '../../../types';
import { setAuthor } from '../setAuthor';

describe('setAuthor', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/schema/__tests__/setLocation.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Place, VirtualLocation } from 'src/types';
import { Place, VirtualLocation } from '../../../types';
import { setLocation } from '../setLocation';

const virtualLocation: VirtualLocation = {
Expand Down
Loading
Loading