Giter VIP home page Giter VIP logo

Comments (9)

hasanizmir avatar hasanizmir commented on May 20, 2024

Hi @RobWattCT ,

  • I am answering "no" to the TypeScript question and using it in that manner without any issues. Because TypeScript is not used in the project.
  • You can use the " index.js " file instead of "schema.js" like this:
import works from './works'
import testimonials from './testimonials'
import brands from './brands'

export const schemaTypes = [works, testimonials, brands]

from project_professional_portfolio.

acej0k3r avatar acej0k3r commented on May 20, 2024

The fact is sanity v3 and v2 has various connection process however the v2 method works for v3. The only difference for me was to use npm run dev on the backend folder instead of sanity start. Other than that everything is still the same. Good luck.

from project_professional_portfolio.

BurningVertex avatar BurningVertex commented on May 20, 2024

export const schemaTypes = [works, testimonials, brands]

Just wondering if you have some steps to get this working in V3?
also where are you adding the above? in index.js? do we just delete the old schema.js? is it now unused?

from project_professional_portfolio.

yomi3tech avatar yomi3tech commented on May 20, 2024

export const schemaTypes = [works, testimonials, brands]

Just wondering if you have some steps to get this working in V3? also where are you adding the above? in index.js? do we just delete the old schema.js? is it now unused?

Specifically in the index.js files and export as stated, everything should work perfectly even with version 3 but the React Tooltip is deprecated in this version to "Tooltip ", and at the backend, Sanity start is now npm run dev

from project_professional_portfolio.

BurningVertex avatar BurningVertex commented on May 20, 2024

export const schemaTypes = [works, testimonials, brands]

Just wondering if you have some steps to get this working in V3? also where are you adding the above? in index.js? do we just delete the old schema.js? is it now unused?

Specifically in the index.js files and export as stated, everything should work perfectly even with version 3 but the React Tooltip is deprecated in this version to "Tooltip ", and at the backend, Sanity start is now npm run dev

Thanks, i decided to recreate the project from scratch fresh sanity install. Though I'm having the issue with the tooltip. Any chance you can post a code snippet from skills.jsx?

from project_professional_portfolio.

Code-Parth avatar Code-Parth commented on May 20, 2024

The steps in the video do not work with the latest version of Sanity, version 3.

i.e. It's no longer possible to follow the exact steps of the video's Sanity setup and result in getting the Sanity Server up and running with the schema displaying.

There's a new prompt to setup the project for TypeScript (yes/no ?). Need clarity on that.

The project uses a schema.js file inside /schemas/, but installing the latest Sanity generates index.js file, with different code to schema.js (excluding what gets added to pull in the project's other schemas files).

It would be great if this could be addressed or if I could get some help on a workaround as I would love to build this tutorial without roadblocks.

@adrianhajdin and team, I love your work! Thank you for investing into the community.

You can do this schema at ./schemas/index.js for V3

export const schemaTypes = [
    {
        name: 'works',
        title: 'Works',
        type: 'document',
        fields: [
            {
                name: 'title',
                title: 'Title',
                type: 'string',
            },

            {
                name: 'description',
                title: 'Description',
                type: 'string',
            },
            {
                name: 'projectLink',
                title: 'Project Link',
                type: 'string',
            },
            {
                name: 'codeLink',
                title: 'Code Link',
                type: 'string',
            },
            {
                name: 'imgUrl',
                title: 'ImageUrl',
                type: 'image',
                options: {
                    hotspot: true,
                },
            },
            {
                name: 'tags',
                title: 'Tags',
                type: 'array',
                of: [
                    {
                        name: 'tag',
                        title: 'Tag',
                        type: 'string'
                    }
                ]
            },

        ],
    },
    {
        name: 'testimonials',
        title: 'Testimonials',
        type: 'document',
        fields: [
            {
                name: 'name',
                title: 'Name',
                type: 'string'
            },
            {
                name: 'company',
                title: 'Company',
                type: 'string'
            },
            {
                name: 'imgurl',
                title: 'ImgUrl',
                type: 'image',
                options: {
                    hotspot: true,
                },
            },
            {
                name: 'feedback',
                title: 'Feedback',
                type: 'string'
            }
        ]
    },
    {
        name: 'brands',
        title: 'Brands',
        type: 'document',
        fields: [
            {
                name: 'imgUrl',
                title: 'ImgUrl',
                type: 'image',
                options: {
                    hotspot: true,
                },
            },
            {
                name: 'name',
                title: 'Name',
                type: 'string'
            }
        ]
    },
    {
        name: 'abouts',
        title: 'Abouts',
        type: 'document',
        fields: [
            {
                name: 'title',
                title: 'Title',
                type: 'string'
            },
            {
                name: 'description',
                title: 'Description',
                type: 'string'
            },
            {
                name: 'imgUrl',
                title: 'ImgUrl',
                type: 'image',
                options: {
                    hotspot: true,
                },
            },

        ]
    },
    {
        name: 'skills',
        title: 'Skills',
        type: 'document',
        fields: [
            {
                name: 'name',
                title: 'Name',
                type: 'string'
            },
            {
                name: 'bgColor',
                title: 'BgColor',
                type: 'string'
            },
            {
                name: 'icon',
                title: 'Icon',
                type: 'image',
                options: {
                    hotspot: true,
                },
            },

        ]
    },
    {
        name: 'workExperience',
        title: 'Work Experience',
        type: 'document',
        fields: [
            {
                name: 'name',
                title: 'name',
                type: 'string'
            },
            {
                name: 'company',
                title: 'Company',
                type: 'string'
            },
            {
                name: 'desc',
                title: 'Desc',
                type: 'string'
            }
        ]
    },
    {
        name: 'experiences',
        title: 'Experiences',
        type: 'document',
        fields: [
            {
                name: 'year',
                title: 'Year',
                type: 'string'
            },
            {
                name: 'works',
                title: 'Works',
                type: 'array',
                of: [{ type: 'workExperience' }]
            },
        ]
    },
    {
        name: 'contact',
        title: 'Contact',
        type: 'document',
        fields: [
            {
                name: 'name',
                title: 'Name',
                type: 'string'
            },
            {
                name: 'email',
                title: 'Email',
                type: 'string'
            },
            {
                name: 'message',
                title: 'Message',
                type: 'text'
            }
        ]
    }
]

from project_professional_portfolio.

AnmolChauhan123 avatar AnmolChauhan123 commented on May 20, 2024

The prompt to use typescript is not showing anymore and it automatically installs all the files of typescript. Anyone know how to change this???]

from project_professional_portfolio.

enith2478 avatar enith2478 commented on May 20, 2024

For the people having trouble with the different versions of Sanity What you have to do is to import your file name into the script.js file inside the schemas folder:

import tesstimonials from "./testimonials"
export const schemaTypes = [testimonials]

You create the "testimonials" file as instructed in the video and skip creating a chema.js file

from project_professional_portfolio.

FredDaFed avatar FredDaFed commented on May 20, 2024

Sanity V3 -vs- V2


For what its worth, here is my input that fixed the issue when using Sanity V3 -vs- Sanity V2
CONSIDER the MIGRATION documentation for Sanity below:
SanityMigrationV2ToV3
Migration Cheat Sheet

INSTALLATION

  1. Use:
npm install openai@latest

NOTE: use SUDO if not a root user and/or have issues installing from the command.
This WILL INSTALL the latest version as V2 of Sanity is deprecated. If you want to BOOSTfreemium from JavascriptMastery2022, you can follow the tutorial but say 'Y' to install version 3.
What was seen in the tutorial were these commands:

npm install -g @sanity/cli

Select: -Y to install version 3
Then

sanity init --coupon javascriptmastery2022
  1. Do not select TypeScript if you just want to use javascript and follow the tutorial
  2. Everything else is pretty musch self explanatory.
    To Initialize: AVOID
sanity start

USE INSTEAD
@/backend_sanity directory

npm run dev

schema.js -vs- index.js

index.js is used as an entry point in V3 instead of schema.js that was used in V2

  1. In the index.js, add the following:

index.js

import works from './works'
import testimonials from "./testimonials"
import brands from './brands'
import abouts from './abouts'
import experiences from './experiences'
import skills from './skills'
import workExperience from './workExperience'
import contact from './contact'

export const schemaTypes = [testimonials, works, brands, abouts, experiences, skills, workExperience, contact]

NOTE:8 This is after you copy the assets in the schemas directory. The above syntax is demonstrating how to invoke the content added in this directory. V2 is much different:
image

RESULTS

image
image

from project_professional_portfolio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.