makeswift

The official Makeswift CLI

MIT License

Downloads
1.6K
Stars
103
Committers
16

Bot releases are visible (Hide)

makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • d08bf7d: Add getPage method to Makeswift client.
  • fcd32d2: Use localized pathname on LinkControl and Button component if available.
  • fcd32d2: Use the new REST API endpoint for page-pathname-slices.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 2333764: Revert automatically adding hreflang tags to pages that have localized versions.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 079297d: Update translatable-data API handler to handle opional values for composable controls.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • fe522b9: Add hreflang tag to the HTML <head> for pages that have localized versions. Click here to learn more about hreflang tag.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • b9bc710: Fix "Module not found: Can't resolve 'slate-hyperscript'" error created in 0.11.3.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • feae6ba: Added merge-translated-data API handler to merge translated data back into a Makeswift page.

    To use this translation merging functionality, make sure to pass an instance of ReactRuntime to the Makeswift API handler like so:

    import { MakeswiftApiHandler } from '@makeswift/runtime/next'
    import { runtime } from '../../../lib/makeswift/register-components'
    
    export default MakeswiftApiHandler(process.env.MAKESWIFT_SITE_API_KEY, {
      runtime,
    })
    
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • c630617: Add locale option to getSitemap. If a locale is using domain-based localization, passing the locale to getSitemap will return the sitemap for that particular domain.

    For example, if in the site settings there is an es locale with a domain of foo.es, then passing es to getSitemap will return the sitemap for foo.es.

makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • f434abe: Update the translation fallback value to prevent client side errors that can occur when upgrading RichText.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Minor Changes

  • 935ca2b: This version includes the stable release of the localization feature.

    With this feature, you can create different variations of a page. For example, if you have a /pricing page that you want to localize for Spanish-speaking countries, you can add an es locale, and create a /es/pricing page.

    If you have used the unstable version before, here are the steps required to migrate to the stable version:

    • Remove unstable_i18n on the ReactRuntime.
    • Rename unstable_locale to locale on the getPageSnapshot.

    Now, all locales and default locale can be managed directly in the settings in the builder, on the Locales tab.

    You can also add the domain on the locale if you want to use domain-based localization. For example, if your main domain is company.com, on your es locale, you can add the company.es domain to make it the domain for your Spanish version of the site.

    If you're interested in this feature, reach out to our support at [email protected].

Patch Changes

  • 8b89c39: Fix stale localized global element when first created.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 3c5cb43: Update the translatable data API handler to primitively return translatable data for the rich text controls.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • a0e5b8f: Add support for external files in Image control
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 44bf879: Add support for external files in legacy Backgrounds prop controller. Use descriptor in Backgrounds prop controller copy function.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 47ebca4: Add API handler for getting translatable data for an element tree. Not yet fully implemented—only returns translatable data for text input and text area controls and prop controllers.
  • 4dc09fb: Add support for external files in legacy Image prop controller.
    • Use descriptor in legacy Images prop controller copy function.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • cb87c42: Add support for external files in legacy Image prop controller.
  • 838d1bb: Use descriptor in legacy Image prop controller copy function.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • fb0b370: Change versioning from unstable to stable.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 7e21729: Call new typography endpoints that can use versioning.
  • 155014d: Add calls to new global element endpoints
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 6a2c502: Fix localization not working on recent versions of Next.js.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 60a252d: Fix localized global element being fetched on the client instead of during SSR.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • b8e8124: Add getSitemap to Makeswift client.

    Use this method to generate a sitemap for your Makeswift host. Here's an example using the popular library next-sitemap:

    import { makeswift } from '@lib/makeswift'
    import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'
    import { getServerSideSitemapLegacy } from 'next-sitemap'
    
    export async function getServerSideProps(
      ctx: GetServerSidePropsContext,
    ): Promise<GetServerSidePropsResult<{}>> {
      const sitemap = await makeswift.getSitemap()
    
      return getServerSideSitemapLegacy(ctx, sitemap)
    }
    
    export default function Sitemap() {}
    

    The getSitemap method is paginated with a default page size of 50. If you want to request more pages or use a different page size pass the limit and after arguments. Here's an example:

    const sitemap: Sitemap = []
    let page
    let after: string | undefined = undefined
    
    do {
      page = await makeswift.getSitemap({ limit: 10, after })
    
      sitemap.push(...page)
      after = page.at(-1)?.id
    } while (page.length > 0)
    

    If using TypeScript, you can import the Sitemap type from @makeswift/runtime/next.

    Also, the getSitemap method supports filtering results by a pathname prefix using the pathnamePrefix parameter. Here's an example using the popular library next-sitemap:

    import { makeswift } from '@lib/makeswift'
    import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'
    import { getServerSideSitemapLegacy } from 'next-sitemap'
    
    export async function getServerSideProps(
      ctx: GetServerSidePropsContext,
    ): Promise<GetServerSidePropsResult<{}>> {
      const blogSitemap = await makeswift.getSitemap({ pathnamePrefix: '/blog/' })
    
      return getServerSideSitemapLegacy(ctx, blogSitemap)
    }
    
    export default function BlogSitemap() {}
    
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • b18aae3: Fix preview mode for localized pages.