@augeo/smelt 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schema.d.mts CHANGED
@@ -248,18 +248,20 @@ interface SectionToggle1 {
248
248
  //#endregion
249
249
  //#region lib/schema.d.ts
250
250
  /**
251
- * Identity helper for authoring a Shopify section schema. The `const T`
252
- * parameter preserves literal types so the schema author gets autocomplete
253
- * for setting `type` values, `id`s, etc.
251
+ * Identity helper for authoring a Shopify section schema. Typing the parameter
252
+ * as `SectionSchema` directly (rather than a generic `<const T>`) gives the
253
+ * author both autocomplete for `type` values, `id`s, etc. and excess-property
254
+ * checking — a bare type parameter would silently accept unknown keys.
254
255
  *
255
256
  * Use in `<name>.schema.ts` files under `src/sections/`.
256
257
  */
257
- declare function defineSchemaSection<const T extends SectionSchema>(schema: T): T;
258
+ declare function defineSchemaSection(schema: SectionSchema): SectionSchema;
258
259
  /**
259
- * Identity helper for authoring a Shopify theme-block schema.
260
+ * Identity helper for authoring a Shopify theme-block schema. See
261
+ * {@link defineSchemaSection} for why the parameter is typed directly.
260
262
  *
261
263
  * Use in `<name>.schema.ts` files under `src/blocks/`.
262
264
  */
263
- declare function defineSchemaBlock<const T extends ThemeBlockSchema>(schema: T): T;
265
+ declare function defineSchemaBlock(schema: ThemeBlockSchema): ThemeBlockSchema;
264
266
  //#endregion
265
267
  export { type SectionSchema, type ThemeBlockSchema, defineSchemaBlock, defineSchemaSection };
package/dist/schema.mjs CHANGED
@@ -1,8 +1,9 @@
1
1
  //#region lib/schema.ts
2
2
  /**
3
- * Identity helper for authoring a Shopify section schema. The `const T`
4
- * parameter preserves literal types so the schema author gets autocomplete
5
- * for setting `type` values, `id`s, etc.
3
+ * Identity helper for authoring a Shopify section schema. Typing the parameter
4
+ * as `SectionSchema` directly (rather than a generic `<const T>`) gives the
5
+ * author both autocomplete for `type` values, `id`s, etc. and excess-property
6
+ * checking — a bare type parameter would silently accept unknown keys.
6
7
  *
7
8
  * Use in `<name>.schema.ts` files under `src/sections/`.
8
9
  */
@@ -10,7 +11,8 @@ function defineSchemaSection(schema) {
10
11
  return schema;
11
12
  }
12
13
  /**
13
- * Identity helper for authoring a Shopify theme-block schema.
14
+ * Identity helper for authoring a Shopify theme-block schema. See
15
+ * {@link defineSchemaSection} for why the parameter is typed directly.
14
16
  *
15
17
  * Use in `<name>.schema.ts` files under `src/blocks/`.
16
18
  */
package/lib/schema.ts CHANGED
@@ -13,25 +13,23 @@ import type { ThemeBlockSchema } from "./schema-block.generated.ts";
13
13
  import type { SectionSchema } from "./schema-section.generated.ts";
14
14
 
15
15
  /**
16
- * Identity helper for authoring a Shopify section schema. The `const T`
17
- * parameter preserves literal types so the schema author gets autocomplete
18
- * for setting `type` values, `id`s, etc.
16
+ * Identity helper for authoring a Shopify section schema. Typing the parameter
17
+ * as `SectionSchema` directly (rather than a generic `<const T>`) gives the
18
+ * author both autocomplete for `type` values, `id`s, etc. and excess-property
19
+ * checking — a bare type parameter would silently accept unknown keys.
19
20
  *
20
21
  * Use in `<name>.schema.ts` files under `src/sections/`.
21
22
  */
22
- export function defineSchemaSection<const T extends SectionSchema>(
23
- schema: T,
24
- ): T {
23
+ export function defineSchemaSection(schema: SectionSchema): SectionSchema {
25
24
  return schema;
26
25
  }
27
26
 
28
27
  /**
29
- * Identity helper for authoring a Shopify theme-block schema.
28
+ * Identity helper for authoring a Shopify theme-block schema. See
29
+ * {@link defineSchemaSection} for why the parameter is typed directly.
30
30
  *
31
31
  * Use in `<name>.schema.ts` files under `src/blocks/`.
32
32
  */
33
- export function defineSchemaBlock<const T extends ThemeBlockSchema>(
34
- schema: T,
35
- ): T {
33
+ export function defineSchemaBlock(schema: ThemeBlockSchema): ThemeBlockSchema {
36
34
  return schema;
37
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augeo/smelt",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Library + CLI for building Shopify themes from a colocated component tree",
5
5
  "license": "MIT",
6
6
  "type": "module",