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 month ago

Patch Changes

  • dfa5c65: refactor: move legacy descriptor prop rendering into its own file
  • 1081caa: refactor: move basic controls' value resolution to the new resolveValue method
  • ec65529: Performs runtime verification of incoming data during control deserialization.
    Also adds new fields to the deserializeControls error callback.
  • 4d82ccd: refactor: move is, deepEqual and shallowEqual predicates to the @makeswift/controls package
  • Updated dependencies [1081caa]
  • Updated dependencies [4d82ccd]
makeswift - @makeswift/[email protected]

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

Patch Changes

  • Updated dependencies [1081caa]
  • Updated dependencies [4d82ccd]
makeswift - @makeswift/[email protected]

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

Patch Changes

  • 1081caa: refactor: move basic controls' value resolution to the new resolveValue method
  • 4d82ccd: refactor: move is, deepEqual and shallowEqual predicates to the @makeswift/controls package
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 2 months ago

Patch Changes

  • b42d767: Only forward a ref if the component supports it, with the exception of lazy components, which continue to receive a ref unconditionally.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 2 months ago

Patch Changes

  • be118e6: fixes Shape introspection and copying to properly handle non-existent/orphaned props.
  • Updated dependencies [be118e6]
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 2 months ago

Patch Changes

makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 2 months ago

Patch Changes

  • be118e6: fixes Shape introspection and copying to properly handle non-existent/orphaned props.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 2 months ago

Patch Changes

  • 6bb81f0: deserializeControls now handles deserialization issues more gracefully: the function attempts to deserialize all of the controls, reporting deserialization errors through an optional error callback.
  • 5cfd1af: Relax Select options schema to allow values that can be coerced to a string.
  • Updated dependencies [5cfd1af]
makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 2 months ago

Patch Changes

makeswift - @makeswift/[email protected]

Published by github-actions[bot] about 2 months ago

Patch Changes

  • 5cfd1af: Relax Select options schema to allow values that can be coerced to a string.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] 2 months ago

Patch Changes

  • 30a7c9b: Refactored package to use common types and schemas defined in the
    @makeswift/controls package.
  • Updated dependencies [30a7c9b]
makeswift - @makeswift/[email protected]

Published by github-actions[bot] 2 months ago

Minor Changes

  • 30a7c9b: This change updates the runtime to use the latest version of
    @makeswift/controls. As part of this update, this package is no longer
    exposing internal data types and functions associated with our controls.

    BREAKING:

    1. Attempting to create a control with arbitrary configuration options will
      now result in a TypeScript compilation error:

      import { Number } from "@makeswift/runtime/controls";
      
      const num = Number({ foo: "bar" }); // error, `foo` is not a valid `Number` param
      

      Prior to this version, the arbitrary options were silently ignored.

    2. The Select control now requires options to be a readonly array with at
      least one entry. If you are not defining your options inline, you may need
      to declare the options as const.

      import { Select } from "@makeswift/runtime/controls";
      
      const sel = Select({
        label: "Select",
        options: [], // error, non-empty array is required
      });
      

      Previously, the options array was allowed to be empty.

Patch Changes

makeswift - @makeswift/[email protected]

Published by github-actions[bot] 2 months ago

Minor Changes

  • 30a7c9b: This change converts our control definitions to active classes, each with
    encapsulated implementations for control serialization/deserialization, data and
    value parsing, copying, and other core operations for controls.

    In addition, base definitions of all controls, as well as several shared
    types/schemas, have now been defined in this package.

    BREAKING:

    1. Several types and utilities associated with controls have been removed as part of
      this change. As an example, let's look over the types/functions associated with
      the Color control (keep in mind that this applies to all controls, not just
      Color):

      • ColorControlType: a string literal identifying the Color control
      • ColorControlDataTypeValueV1 - a string literal identifying V1 Color control
        data.
      • ColorControlDataTypeKey: a string literal defining the key in which the V1
        data signature for the Color control is stored in.
      • ColorControlDataV0 / ColorControlDataV1 - types describing the data format
        of the color control, depending on the version of the definition.
      • ColorControlData - describes the data format for a Color control. In this
        case, it is a union of type definitions for ColorControlDataV0 and
        ColorControlDataV1
      • ColorControlDefinition - describes the type of the Color control
        definition, namely its type and config options
      • copyColorData - Creates a copy of a given ColorControlData, given a copy
        context.

      All of these have been removed. Most of them have been replaced by
      functionality available on the ColorDefinition active class. Let's see how
      we can use this class to achieve the functionality of the removed constructs
      above:

      import { type DataType, Color, ColorDefinition } from '@makeswift/controls`
      
      const color = Color({ defaultValue: "red" })
      
      // Accessing config information:
      console.log(color.config)
      
      type ColorControlType = ColorDefinition['controlType']
      
      type ColorControlData = DataType<ColorDefinition> // a union of V1 and V0 data
      
      // Copying Data:
      color.copyData({ swatchId: '###', alpha: 1 }, ...)
      

      Note the use of the DataType type, which can infer the data type given a
      control definition. Also note that the copyData method is defined on an
      instance of a color, rather than a standalone function.

makeswift - [email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • efec6cd: Fix bug where link command overwrites existing environment variables
makeswift - [email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • 2a5e096: Add a link command.

    The link command will allow users with an existing Next.js site to link it to a Makeswift site. This command does nothing in terms of setting up Makeswift pages or using the client inside the Next.js site - that part is expected to already be done upon use of this command.

makeswift - @makeswift/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • 4050164: Fix issue where Makeswift integrations with Pages Router wouldn't load in the builder when deployed on Vercel.
  • 5b3d400: Send the REGISTER_BUILDER_DOCUMENT event during initialize(). This is used to inform the builder which document or element tree to subscribe to.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • 1e9e820: Fix the scaling issue with social link icons when using the small or large variant.
makeswift - @makeswift/[email protected]

Published by github-actions[bot] 4 months ago

Patch Changes

  • 1ec894f: Fixes an invalid "publishedAt" sort option for getPages, which results in a
    400 exception. Replaces this sort option with "description".
makeswift - @makeswift/[email protected]

Published by github-actions[bot] 4 months ago

Minor Changes

  • 75cf3fd: BREAKING: The latest upgrade to the Makeswift client getPages method
    introduces sorting, path filtering, and pagination. This method was not
    previously paginated - in order to get all your pages, you may now use our
    toArray pagination helper method, which will automatically paginate through
    all results and aggregate them into an array:

    import { client } from "@/makeswift/client";
    import { MakeswiftPage } from "@makeswift/runtime/next";
    
    async function getAllPages(): Promise<MakeswiftPage[]> {
      return await client.getPages().toArray();
    }
    

    getPages now returns an instance of IterablePaginationResult, a decorated
    async iterator which includes methods .map and .filter, in addition to
    .toArray, mentioned above.

    This change also deprecates the client getSitemap method, with the
    recommendation that sitemaps should now be generated using data returned from
    getPages. Note that the deprecation of getSitemap now involves the host
    being responsible for the construction of page paths in the sitemap (either with
    domain or path based localization). Below is an example that uses path-based
    localization with the next-sitemap library:

    import { getServerSideSitemapLegacy } from "next-sitemap";
    import { MakeswiftPage } from "@makeswift/runtime/next";
    import { client } from "@makeswift/client";
    
    const DOMAIN = "https://example.com";
    const DEFAULT_PRIORITY = 0.75;
    const DEFAULT_FREQUENCY = "hourly";
    
    function pageToSitemapItem(page: MakeswiftPage) {
      const pageUrl = new URL(page.path, DOMAIN);
      return {
        loc: pageUrl.href,
        lastmod: page.createdAt,
        changefreq: page.sitemapFrequency ?? DEFAULT_FREQUENCY,
        priority: page.sitemapPriority ?? DEFAULT_PRIORITY,
        alternateRefs: page.localizedVariants.map((variant) => {
          const localizedPath = `/${variant.locale}/${variant.path}`;
          const localizedPageUrl = new URL(localizedPath, DOMAIN);
          return {
            hreflang: variant.locale,
            href: localizedPageUrl.href,
          };
        }),
      };
    }
    
    export async function getServerSideProps(context) {
      const sitemap = client
        .getPages()
        .filter((page) => !page.excludedFromSearch)
        .map((page) => pageToSitemapItem(page))
        .toArray();
    
      return getServerSideSitemapLegacy(context, sitemap);
    }
    
    export default function Sitemap() {}
    

    Here's another example for Next.js's App Router built-in support for sitemaps:

    import { MetadataRoute } from "next";
    import { MakeswiftPage } from "@makeswift/runtime/dist/types/next";
    import { client } from "@/lib/makeswift/client";
    
    type NextSitemapItem = MetadataRoute.Sitemap[number];
    
    const DOMAIN = "https://example.com";
    const DEFAULT_PRIORITY = 0.75;
    const DEFAULT_FREQUENCY = "hourly";
    
    function pageToSitemapEntry(page: MakeswiftPage): NextSitemapItem {
      const pageUrl = new URL(page.path, DOMAIN);
      return {
        url: pageUrl.href,
        lastModified: page.createdAt,
        changeFrequency: page.sitemapFrequency ?? DEFAULT_FREQUENCY,
        priority: page.sitemapPriority ?? DEFAULT_PRIORITY,
      };
    }
    
    export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
      return client
        .getPages()
        .filter((page) => !page.excludedFromSearch)
        .map((page) => pageToSitemapEntry(page))
        .toArray();
    }
    

    BREAKING: The exported MakeswiftPage type now includes several more data
    fields from the Makeswift page.

makeswift - @makeswift/[email protected] Latest Release

Published by github-actions[bot] 5 months ago

Patch Changes

  • 26b0262: Fix uncaught client exception on incomplete, protocol-only links