vite-plugin-react-shopify 1.1.0 → 2.0.0
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/README.md +205 -288
- package/dist/index.d.ts +22 -3
- package/dist/index.js +225 -112
- package/dist/runtime/index.d.ts +32 -0
- package/dist/runtime/index.js +73 -0
- package/package.json +3 -15
- package/dist/runtime/Liquid.client.d.ts +0 -6
- package/dist/runtime/Liquid.client.js +0 -7
- package/dist/runtime/Liquid.d.ts +0 -11
- package/dist/runtime/Liquid.js +0 -10
- package/dist/runtime/settings.d.ts +0 -8
- package/dist/runtime/settings.js +0 -44
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ interface Options {
|
|
|
6
6
|
snippetFile?: string;
|
|
7
7
|
buildDir?: string;
|
|
8
8
|
debug?: boolean;
|
|
9
|
-
hash?: boolean;
|
|
10
9
|
ssg?: SSGOptions;
|
|
11
10
|
importMap?: ImportMapOptions;
|
|
12
11
|
}
|
|
@@ -16,14 +15,16 @@ interface SSGOptions {
|
|
|
16
15
|
template?: string;
|
|
17
16
|
section?: string;
|
|
18
17
|
block?: string;
|
|
18
|
+
snippet?: string;
|
|
19
19
|
};
|
|
20
20
|
outputName?: string;
|
|
21
|
+
cssPrefix?: string;
|
|
21
22
|
}
|
|
22
23
|
interface ImportMapOptions {
|
|
23
24
|
react?: string;
|
|
24
25
|
reactDomClient?: string;
|
|
25
26
|
}
|
|
26
|
-
type ShopifyBlockType = "template" | "section" | "block";
|
|
27
|
+
type ShopifyBlockType = "template" | "section" | "block" | "snippet";
|
|
27
28
|
type SettingValue = string | number | boolean;
|
|
28
29
|
type InputSettings = Record<string, SettingValue>;
|
|
29
30
|
interface BaseSettingSchema {
|
|
@@ -211,6 +212,24 @@ type SidebarSetting = HeaderSetting | ParagraphSetting | LineBreakSetting;
|
|
|
211
212
|
type SettingSchema = InputSettingSchema | SidebarSetting;
|
|
212
213
|
/** @deprecated Use {@link SettingSchema} instead */
|
|
213
214
|
type SchemaSetting = SettingSchema;
|
|
215
|
+
/**
|
|
216
|
+
* Type-level assertion: prevents settings with empty-string defaults.
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```ts
|
|
220
|
+
* const settings = [...] as const satisfies SettingSchema[];
|
|
221
|
+
* type __noEmptyCheck = AssertNoEmptyDefaults<typeof settings>;
|
|
222
|
+
* // TypeScript will show `never` if any setting has `default: ""`
|
|
223
|
+
* declare const __assert: __noEmptyCheck;
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
type IsEmptyStringDefault<T> = T extends {
|
|
227
|
+
default: "";
|
|
228
|
+
} ? true : false;
|
|
229
|
+
type EmptyDefaultsExist<T extends readonly any[]> = true extends {
|
|
230
|
+
[K in keyof T]: IsEmptyStringDefault<T[K]>;
|
|
231
|
+
}[number] ? true : false;
|
|
232
|
+
type AssertNoEmptyDefaults<T extends readonly SettingSchema[]> = EmptyDefaultsExist<T> extends true ? never : true;
|
|
214
233
|
interface ShopifyMeta {
|
|
215
234
|
type?: ShopifyBlockType;
|
|
216
235
|
name: string;
|
|
@@ -260,4 +279,4 @@ type InferSettings<T extends readonly {
|
|
|
260
279
|
|
|
261
280
|
declare const vitePluginShopify: (options?: Options) => Plugin[];
|
|
262
281
|
|
|
263
|
-
export { type ArticleListSetting, type ArticleSetting, type BlogSetting, type CheckboxSetting, type CollectionListSetting, type CollectionSetting, type ColorBackgroundSetting, type ColorSchemeGroupSetting, type ColorSchemeRole, type ColorSchemeSetting, type ColorSetting, type FontPickerSetting, type HeaderSetting, type HtmlSetting, type ImagePickerSetting, type ImportMapOptions, type InferSettings, type InlineRichtextSetting, type InputSettingSchema, type InputSettings, type LineBreakSetting, type LinkListSetting, type LiquidSetting, type MetaobjectListSetting, type MetaobjectSetting, type NumberSetting, type Options, type PageSetting, type ParagraphSetting, type PresetBlock, type PresetDefinition, type ProductListSetting, type ProductSetting, type RadioSetting, type RangeSetting, type RichtextSetting, type SSGEntry, type SSGOptions, type SchemaSetting, type SelectSetting, type SettingSchema, type SettingType, type SettingValue, type ShopifyBlockType, type ShopifyMeta, type SidebarSetting, type TextAlignmentSetting, type TextSetting, type TextareaSetting, type UrlSetting, type VideoSetting, type VideoUrlSetting, vitePluginShopify as default };
|
|
282
|
+
export { type ArticleListSetting, type ArticleSetting, type AssertNoEmptyDefaults, type BlogSetting, type CheckboxSetting, type CollectionListSetting, type CollectionSetting, type ColorBackgroundSetting, type ColorSchemeGroupSetting, type ColorSchemeRole, type ColorSchemeSetting, type ColorSetting, type FontPickerSetting, type HeaderSetting, type HtmlSetting, type ImagePickerSetting, type ImportMapOptions, type InferSettings, type InlineRichtextSetting, type InputSettingSchema, type InputSettings, type LineBreakSetting, type LinkListSetting, type LiquidSetting, type MetaobjectListSetting, type MetaobjectSetting, type NumberSetting, type Options, type PageSetting, type ParagraphSetting, type PresetBlock, type PresetDefinition, type ProductListSetting, type ProductSetting, type RadioSetting, type RangeSetting, type RichtextSetting, type SSGEntry, type SSGOptions, type SchemaSetting, type SelectSetting, type SettingSchema, type SettingType, type SettingValue, type ShopifyBlockType, type ShopifyMeta, type SidebarSetting, type TextAlignmentSetting, type TextSetting, type TextareaSetting, type UrlSetting, type VideoSetting, type VideoUrlSetting, vitePluginShopify as default };
|