@lightspeed/crane 2.0.5 → 3.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/CHANGELOG.md +34 -0
- package/UPGRADE.md +96 -0
- package/dist/cli.mjs +44 -25
- package/package.json +6 -3
- package/template/blank/sections/blank-section/BlankSection.vue +9 -0
- package/template/blank/sections/blank-section/assets/blank_section_showcase_1_preview.jpg +0 -0
- package/template/blank/sections/blank-section/client.ts +6 -0
- package/template/blank/sections/blank-section/server.ts +6 -0
- package/template/blank/sections/blank-section/settings/content.ts +2 -0
- package/template/blank/sections/blank-section/settings/design.ts +2 -0
- package/template/blank/sections/blank-section/settings/layout.ts +2 -0
- package/template/blank/sections/blank-section/settings/translations.ts +8 -0
- package/template/blank/sections/blank-section/showcases/1.ts +15 -0
- package/template/blank/sections/blank-section/showcases/translations.ts +10 -0
- package/template/blank/sections/blank-section/type.ts +5 -0
- package/template/collections/assets/collection_cover_image.png +0 -0
- package/template/collections/example-collection/configuration.ts +21 -0
- package/template/crane.config.json +1 -1
- package/template/footers/example-footer/ExampleFooter.vue +4 -4
- package/template/footers/example-footer/component/LegalLinks.vue +1 -1
- package/template/footers/example-footer/component/MadeWith.vue +1 -1
- package/template/footers/example-footer/component/ReportAbuse.vue +1 -1
- package/template/footers/example-footer/settings/design.ts +5 -4
- package/template/footers/example-footer/settings/translations.ts +4 -3
- package/template/footers/example-footer/showcases/1.ts +4 -2
- package/template/footers/example-footer/showcases/translations.ts +4 -2
- package/template/headers/example-header/ExampleHeader.vue +1 -1
- package/template/headers/example-header/component/Account.vue +1 -1
- package/template/headers/example-header/component/CategoriesDropdown.vue +1 -1
- package/template/headers/example-header/component/Logo.vue +7 -7
- package/template/headers/example-header/component/NavigationMenu.vue +1 -1
- package/template/headers/example-header/settings/content.ts +8 -1
- package/template/headers/example-header/settings/design.ts +7 -1
- package/template/headers/example-header/settings/layout.ts +1 -1
- package/template/headers/example-header/settings/translations.ts +4 -2
- package/template/headers/example-header/showcases/1.ts +15 -11
- package/template/headers/example-header/showcases/2.ts +12 -8
- package/template/headers/example-header/showcases/translations.ts +4 -2
- package/template/layouts/catalog/example-catalog/components/Icon.vue +14 -14
- package/template/layouts/catalog/example-catalog/slots/custom-bottom-bar/CustomBottomBar.vue +1 -1
- package/template/package.json +1 -0
- package/template/page-templates/example-template/configuration.ts +8 -10
- package/template/page-templates/example-template/pages/catalog.ts +3 -6
- package/template/page-templates/example-template/pages/category.ts +3 -6
- package/template/page-templates/example-template/pages/home.ts +42 -57
- package/template/page-templates/example-template/pages/product.ts +3 -6
- package/template/preview/sections/preview.html +10 -6
- package/template/preview/shared/api-routes.ts +235 -102
- package/template/preview/shared/logger.ts +9 -0
- package/template/preview/shared/preview.ts +108 -72
- package/template/preview/shared/utils.ts +63 -43
- package/template/preview/ssr-server.ts +1 -1
- package/template/reference/sections/about-us/AboutUs.vue +20 -22
- package/template/reference/sections/about-us/component/Image.vue +18 -18
- package/template/reference/sections/about-us/component/Stats.vue +40 -40
- package/template/reference/sections/about-us/component/Title.vue +1 -1
- package/template/reference/sections/about-us/settings/content.ts +15 -19
- package/template/reference/sections/about-us/settings/design.ts +14 -18
- package/template/reference/sections/about-us/settings/layout.ts +7 -5
- package/template/reference/sections/about-us/settings/translations.ts +4 -2
- package/template/reference/sections/about-us/showcases/1.ts +48 -62
- package/template/reference/sections/about-us/showcases/2.ts +44 -56
- package/template/reference/sections/about-us/showcases/translations.ts +4 -2
- package/template/reference/sections/featured-products/FeaturedProducts.vue +12 -6
- package/template/reference/sections/featured-products/component/ProductItem.vue +18 -1
- package/template/reference/sections/featured-products/component/ProductPlaceholder.vue +42 -0
- package/template/reference/sections/featured-products/component/Title.vue +1 -1
- package/template/reference/sections/featured-products/settings/content.ts +8 -10
- package/template/reference/sections/featured-products/settings/design.ts +7 -7
- package/template/reference/sections/featured-products/settings/translations.ts +4 -2
- package/template/reference/sections/featured-products/showcases/1.ts +8 -12
- package/template/reference/sections/featured-products/showcases/translations.ts +4 -2
- package/template/reference/sections/intro-slider/IntroSlider.vue +6 -6
- package/template/reference/sections/intro-slider/component/Slider.vue +42 -43
- package/template/reference/sections/intro-slider/component/Title.vue +7 -7
- package/template/reference/sections/intro-slider/settings/content.ts +33 -36
- package/template/reference/sections/intro-slider/settings/design.ts +17 -22
- package/template/reference/sections/intro-slider/settings/layout.ts +6 -4
- package/template/reference/sections/intro-slider/settings/translations.ts +4 -2
- package/template/reference/sections/intro-slider/showcases/1.ts +52 -75
- package/template/reference/sections/intro-slider/showcases/2.ts +50 -72
- package/template/reference/sections/intro-slider/showcases/translations.ts +4 -2
- package/template/reference/sections/tag-lines/TagLines.vue +41 -47
- package/template/reference/sections/tag-lines/component/HighlightedText.vue +1 -1
- package/template/reference/sections/tag-lines/component/SectionImage.vue +18 -18
- package/template/reference/sections/tag-lines/component/Title.vue +1 -1
- package/template/reference/sections/tag-lines/settings/content.ts +47 -47
- package/template/reference/sections/tag-lines/settings/design.ts +15 -19
- package/template/reference/sections/tag-lines/settings/layout.ts +6 -4
- package/template/reference/sections/tag-lines/settings/translations.ts +4 -2
- package/template/reference/sections/tag-lines/showcases/1.ts +40 -50
- package/template/reference/sections/tag-lines/showcases/2.ts +40 -50
- package/template/reference/sections/tag-lines/showcases/translations.ts +4 -2
- package/template/reference/sections/trending-categories/TrendingCategories.vue +1 -1
- package/template/reference/sections/trending-categories/component/CategoryItem.vue +18 -1
- package/template/reference/sections/trending-categories/component/Title.vue +1 -1
- package/template/reference/sections/trending-categories/settings/content.ts +8 -10
- package/template/reference/sections/trending-categories/settings/design.ts +7 -7
- package/template/reference/sections/trending-categories/settings/translations.ts +4 -2
- package/template/reference/sections/trending-categories/showcases/1.ts +14 -15
- package/template/reference/sections/trending-categories/showcases/translations.ts +4 -2
- package/template/reference/shared/components/Button.vue +6 -6
- package/template/reference/shared/components/SectionWrapper.vue +5 -5
- package/template/reference/shared/components/Tagline.vue +12 -11
- package/template/reference/templates/reference-template-apparel/configuration.ts +8 -8
- package/template/reference/templates/reference-template-apparel/pages/catalog.ts +3 -6
- package/template/reference/templates/reference-template-apparel/pages/category.ts +3 -6
- package/template/reference/templates/reference-template-apparel/pages/home.ts +14 -18
- package/template/reference/templates/reference-template-apparel/pages/product.ts +3 -6
- package/template/reference/templates/reference-template-bike/configuration.ts +9 -9
- package/template/reference/templates/reference-template-bike/pages/catalog.ts +3 -6
- package/template/reference/templates/reference-template-bike/pages/category.ts +3 -6
- package/template/reference/templates/reference-template-bike/pages/home.ts +14 -18
- package/template/reference/templates/reference-template-bike/pages/product.ts +3 -6
- package/template/sections/example-section/ExampleSection.vue +3 -5
- package/template/sections/example-section/component/button/Button.vue +1 -1
- package/template/sections/example-section/component/image/Image.vue +43 -43
- package/template/sections/example-section/component/image/ImagesGrid.vue +21 -32
- package/template/sections/example-section/component/selectbox/Selectbox.vue +1 -1
- package/template/sections/example-section/component/title/Title.vue +1 -1
- package/template/sections/example-section/component/toggle/Toggle.vue +4 -4
- package/template/sections/example-section/settings/content.ts +25 -34
- package/template/sections/example-section/settings/design.ts +15 -19
- package/template/sections/example-section/settings/layout.ts +15 -14
- package/template/sections/example-section/settings/translations.ts +4 -2
- package/template/sections/example-section/showcases/1.ts +52 -79
- package/template/sections/example-section/showcases/2.ts +46 -62
- package/template/sections/example-section/showcases/3.ts +50 -76
- package/template/sections/example-section/showcases/translations.ts +4 -2
- package/template/shared/components/LanguageSelector.vue +1 -1
- package/template/shared/components/SectionWrapper.vue +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.0.0 - 2026-02-25
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Add placeholder image for the Category and Product selector reference sections.
|
|
8
|
+
- Add 'PRODUCT_SELECTOR' and 'CATEGORY_SELECTOR' type support for 'preview' mode.
|
|
9
|
+
- Add missing properties support to 'TEXT' and 'LOGO' design editor defaults.
|
|
10
|
+
- Add crane pull command to download source code for open source sections.
|
|
11
|
+
- Add fetching of design settings into Instant Site for 'preview' mode.
|
|
12
|
+
- Add support for previewing headers and footers.
|
|
13
|
+
- Add '--blank' option to 'crane init --section' command to create empty sections with minimal files.
|
|
14
|
+
- Add Section Collection support.
|
|
15
|
+
- Add `--debug` flag to `preview` command for detailed debug logging.
|
|
16
|
+
- Add partial build during hot reload in preview mode.
|
|
17
|
+
- Add websocket to 'preview' mode for Chrome extension communication.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Unify input configuration file validation.
|
|
22
|
+
- Migrate all template styles from SASS to native CSS
|
|
23
|
+
- Update `featured-products` and `trending-categories` sections in reference templates.
|
|
24
|
+
- Update internal import resolutions.
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
- @lightspeed/crane-api@2.0.0
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Fix validation of custom layout settings at the layout level instead of slots.
|
|
31
|
+
- Support sections without layout files in 'preview' mode.
|
|
32
|
+
|
|
33
|
+
### Removed
|
|
34
|
+
|
|
35
|
+
- SCSS configuration from build system (Crane is now CSS framework agnostic)
|
|
36
|
+
|
|
3
37
|
## 2.0.5 - 2026-01-14
|
|
4
38
|
|
|
5
39
|
### Added
|
package/UPGRADE.md
CHANGED
|
@@ -1,5 +1,101 @@
|
|
|
1
1
|
# Upgrades
|
|
2
2
|
|
|
3
|
+
## 2.0.x to 2.1.x
|
|
4
|
+
|
|
5
|
+
### Layout configuration changes
|
|
6
|
+
|
|
7
|
+
1.) **Add `type` property to `selectedDesignSettings` entries**
|
|
8
|
+
|
|
9
|
+
Each entry in `selectedDesignSettings` now requires a `type` property at the root level specifying the design editor type. Valid values: `TEXT`, `BUTTON`, `IMAGE`, `TOGGLE`, `SELECTBOX`, `BACKGROUND`, `COLOR_PICKER`, `LOGO`, `DIVIDER`.
|
|
10
|
+
|
|
11
|
+
**Before:**
|
|
12
|
+
```ts
|
|
13
|
+
selectedDesignSettings: [
|
|
14
|
+
{
|
|
15
|
+
fieldName: 'image_text',
|
|
16
|
+
defaults: { font: 'global.fontFamily.body', size: 16, bold: true, italic: false, color: '#000000', visible: true },
|
|
17
|
+
},
|
|
18
|
+
]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**After:**
|
|
22
|
+
```ts
|
|
23
|
+
selectedDesignSettings: [
|
|
24
|
+
{
|
|
25
|
+
type: 'TEXT',
|
|
26
|
+
fieldName: 'image_text',
|
|
27
|
+
defaults: { font: 'global.fontFamily.body', size: 16, bold: true, italic: false, color: '#000000', visible: true },
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Alternatively, use factory methods which handle the type automatically:
|
|
33
|
+
```ts
|
|
34
|
+
import { layout } from '@lightspeed/crane-api';
|
|
35
|
+
|
|
36
|
+
selectedDesignSettings: [
|
|
37
|
+
layout.designOverride.text({
|
|
38
|
+
fieldName: 'image_text',
|
|
39
|
+
defaults: { font: 'global.fontFamily.body', size: 16, bold: true, italic: false, color: '#000000', visible: true },
|
|
40
|
+
}),
|
|
41
|
+
]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
2.) **Header content settings must match showcase content**
|
|
45
|
+
|
|
46
|
+
If your header showcases include `logo` or `menu` content, you must also define these editors in your header's `content.ts` file. The schema validation ensures consistency between content settings and showcase content.
|
|
47
|
+
|
|
48
|
+
The content editors defined in `content.ts` must include all keys referenced in showcase `content` objects.
|
|
49
|
+
|
|
50
|
+
3.) **Define logo and menu in content.ts and design.ts when used in showcases**
|
|
51
|
+
|
|
52
|
+
If you override `logo` or `menu` in a section’s showcase `content` or `design`, those keys must be defined in that section’s `content.ts` (for content) and `design.ts` (for design). Otherwise the build fails with `INVALID_SHOWCASE_CONTENT_ELEMENT` (“Element … is not defined in content.ts”) or `INVALID_SHOWCASE_DESIGN_ELEMENT` (“Element … is not defined in design.ts”). Add the missing `logo` and/or `menu` editors to the corresponding files.
|
|
53
|
+
|
|
54
|
+
4.) **Migrate from single-page to multi-page template format**
|
|
55
|
+
|
|
56
|
+
Single-page template descriptors are no longer supported. Templates must now use the multi-page structure with separate files for configuration and each page type.
|
|
57
|
+
|
|
58
|
+
**Before (single file):**
|
|
59
|
+
```
|
|
60
|
+
templates/
|
|
61
|
+
example-template.ts # Contains metadata + sections
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
// example-template.ts
|
|
66
|
+
export default {
|
|
67
|
+
metadata: { name: '...', description: '...', preview_url: '...', cover_image: { ... } },
|
|
68
|
+
sections: [ { type: 'default', id: 'header' }, { type: 'custom', id: 'example-section' }, ... ],
|
|
69
|
+
};
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**After (multi-page structure):**
|
|
73
|
+
```
|
|
74
|
+
templates/
|
|
75
|
+
example-template/
|
|
76
|
+
configuration.ts # Metadata, header, footer
|
|
77
|
+
pages/
|
|
78
|
+
home.ts # Home page sections
|
|
79
|
+
category.ts # Category page sections
|
|
80
|
+
catalog.ts # Catalog page sections
|
|
81
|
+
product.ts # Product page sections
|
|
82
|
+
custom.ts # Custom page sections (optional)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
// configuration.ts
|
|
87
|
+
export default {
|
|
88
|
+
metadata: { name: '...', description: '...', categories: [...], preview_url: '...', cover_image: { ... } },
|
|
89
|
+
header: { type: 'default', id: 'header' },
|
|
90
|
+
footer: { type: 'default', id: 'footer' },
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// pages/home.ts
|
|
94
|
+
export default {
|
|
95
|
+
sections: [ { type: 'custom', id: 'example-section', showcase_id: '1' }, ... ],
|
|
96
|
+
};
|
|
97
|
+
```
|
|
98
|
+
|
|
3
99
|
## 1.x.x to 2.0.0
|
|
4
100
|
|
|
5
101
|
### Move app to new package named crane-api
|