@lightspeed/crane 1.4.2 → 2.0.1

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.
Files changed (120) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/UPGRADE.md +19 -0
  3. package/dist/app.d.mts +1 -1028
  4. package/dist/app.d.ts +1 -1028
  5. package/dist/app.mjs +1 -1
  6. package/dist/cli.mjs +20 -7
  7. package/package.json +4 -3
  8. package/template/footers/example-footer/ExampleFooter.vue +1 -1
  9. package/template/footers/example-footer/client.ts +2 -1
  10. package/template/footers/example-footer/component/LegalLinks.vue +1 -1
  11. package/template/footers/example-footer/component/MadeWith.vue +1 -1
  12. package/template/footers/example-footer/component/ReportAbuse.vue +1 -1
  13. package/template/footers/example-footer/entity/color.ts +2 -2
  14. package/template/footers/example-footer/server.ts +2 -1
  15. package/template/headers/example-header/client.ts +2 -1
  16. package/template/headers/example-header/component/Account.vue +1 -1
  17. package/template/headers/example-header/component/Cart.vue +1 -1
  18. package/template/headers/example-header/component/CategoriesDropdown.vue +1 -1
  19. package/template/headers/example-header/component/Logo.vue +1 -1
  20. package/template/headers/example-header/component/NavigationMenu.vue +1 -1
  21. package/template/headers/example-header/component/SearchForm.vue +1 -1
  22. package/template/headers/example-header/server.ts +2 -1
  23. package/template/index.d.ts +1 -1
  24. package/template/layouts/catalog/example-catalog/Main.vue +1 -1
  25. package/template/layouts/catalog/example-catalog/slots/custom-bottom-bar/client.ts +2 -1
  26. package/template/layouts/catalog/example-catalog/slots/custom-bottom-bar/server.ts +2 -1
  27. package/template/layouts/category/example-category/Main.vue +1 -1
  28. package/template/layouts/category/example-category/settings/content.ts +1 -1
  29. package/template/layouts/category/example-category/settings/design.ts +1 -1
  30. package/template/layouts/product/example-product/Main.vue +1 -1
  31. package/template/layouts/product/example-product/settings/content.ts +1 -1
  32. package/template/layouts/product/example-product/settings/design.ts +1 -1
  33. package/template/package.json +6 -3
  34. package/template/page-templates/example-template/pages/catalog.ts +1 -1
  35. package/template/page-templates/example-template/pages/category.ts +1 -1
  36. package/template/page-templates/example-template/pages/product.ts +1 -1
  37. package/template/preview/sections/preview.html +1 -1
  38. package/template/preview/shared/api-routes.ts +515 -41
  39. package/template/preview/shared/mock.ts +43 -41
  40. package/template/preview/shared/preview.ts +220 -123
  41. package/template/preview/shared/utils.ts +209 -62
  42. package/template/preview/ssr-server.ts +430 -0
  43. package/template/preview/vite.config.js +76 -75
  44. package/template/reference/sections/about-us/AboutUs.vue +1 -1
  45. package/template/reference/sections/about-us/client.ts +1 -1
  46. package/template/reference/sections/about-us/component/Image.vue +1 -1
  47. package/template/reference/sections/about-us/component/Stats.vue +2 -2
  48. package/template/reference/sections/about-us/component/Title.vue +1 -1
  49. package/template/reference/sections/about-us/server.ts +1 -1
  50. package/template/reference/sections/about-us/util/visibility-provider.ts +1 -1
  51. package/template/reference/sections/featured-products/FeaturedProducts.vue +65 -0
  52. package/template/reference/sections/featured-products/assets/arrow.svg +3 -0
  53. package/template/reference/sections/featured-products/assets/custom_section_showcase_1_preview.png +0 -0
  54. package/template/reference/sections/featured-products/client.ts +6 -0
  55. package/template/reference/sections/featured-products/component/ProductItem.vue +71 -0
  56. package/template/reference/sections/featured-products/component/Title.vue +31 -0
  57. package/template/reference/sections/featured-products/entity/color.ts +4 -0
  58. package/template/reference/sections/featured-products/server.ts +6 -0
  59. package/template/reference/sections/featured-products/settings/content.ts +14 -0
  60. package/template/reference/sections/featured-products/settings/design.ts +33 -0
  61. package/template/reference/sections/featured-products/settings/translations.ts +24 -0
  62. package/template/reference/sections/featured-products/showcases/1.ts +28 -0
  63. package/template/reference/sections/featured-products/showcases/translations.ts +16 -0
  64. package/template/reference/sections/featured-products/type.ts +5 -0
  65. package/template/reference/sections/intro-slider/IntroSlider.vue +1 -1
  66. package/template/reference/sections/intro-slider/client.ts +2 -1
  67. package/template/reference/sections/intro-slider/component/Slider.vue +8 -2
  68. package/template/reference/sections/intro-slider/component/Title.vue +1 -1
  69. package/template/reference/sections/intro-slider/entity/color.ts +2 -2
  70. package/template/reference/sections/intro-slider/server.ts +2 -1
  71. package/template/reference/sections/tag-lines/TagLines.vue +1 -1
  72. package/template/reference/sections/tag-lines/client.ts +2 -1
  73. package/template/reference/sections/tag-lines/component/SectionImage.vue +1 -1
  74. package/template/reference/sections/tag-lines/component/Title.vue +1 -1
  75. package/template/reference/sections/tag-lines/composables/highlighted-text-image-list.ts +4 -3
  76. package/template/reference/sections/tag-lines/server.ts +2 -1
  77. package/template/reference/sections/trending-categories/TrendingCategories.vue +70 -0
  78. package/template/reference/sections/trending-categories/assets/arrow.svg +3 -0
  79. package/template/reference/sections/trending-categories/assets/custom_section_showcase_1_preview.png +0 -0
  80. package/template/reference/sections/trending-categories/client.ts +6 -0
  81. package/template/reference/sections/trending-categories/component/CategoryItem.vue +62 -0
  82. package/template/reference/sections/trending-categories/component/Title.vue +32 -0
  83. package/template/reference/sections/trending-categories/entity/color.ts +4 -0
  84. package/template/reference/sections/trending-categories/server.ts +6 -0
  85. package/template/reference/sections/trending-categories/settings/content.ts +14 -0
  86. package/template/reference/sections/trending-categories/settings/design.ts +33 -0
  87. package/template/reference/sections/trending-categories/settings/translations.ts +24 -0
  88. package/template/reference/sections/trending-categories/showcases/1.ts +36 -0
  89. package/template/reference/sections/trending-categories/showcases/translations.ts +22 -0
  90. package/template/reference/sections/trending-categories/type.ts +5 -0
  91. package/template/reference/shared/components/Button.vue +1 -1
  92. package/template/reference/shared/utils/styles.ts +1 -0
  93. package/template/reference/templates/reference-template-apparel/pages/catalog.ts +1 -1
  94. package/template/reference/templates/reference-template-apparel/pages/category.ts +1 -1
  95. package/template/reference/templates/reference-template-apparel/pages/home.ts +10 -0
  96. package/template/reference/templates/reference-template-apparel/pages/product.ts +1 -1
  97. package/template/reference/templates/reference-template-bike/pages/catalog.ts +1 -1
  98. package/template/reference/templates/reference-template-bike/pages/category.ts +1 -1
  99. package/template/reference/templates/reference-template-bike/pages/home.ts +10 -0
  100. package/template/reference/templates/reference-template-bike/pages/product.ts +1 -1
  101. package/template/sections/example-section/ExampleSection.vue +8 -1
  102. package/template/sections/example-section/client.ts +2 -1
  103. package/template/sections/example-section/component/button/Button.vue +1 -1
  104. package/template/sections/example-section/component/image/Image.vue +1 -1
  105. package/template/sections/example-section/component/image/ImagesGrid.vue +1 -1
  106. package/template/sections/example-section/component/selectbox/Selectbox.vue +1 -1
  107. package/template/sections/example-section/component/title/Title.vue +1 -1
  108. package/template/sections/example-section/component/toggle/Toggle.vue +1 -1
  109. package/template/sections/example-section/entity/color.ts +2 -2
  110. package/template/sections/example-section/server.ts +2 -1
  111. package/template/sections/example-section/settings/translations.ts +1 -1
  112. package/template/sections/example-section/showcases/1.ts +2 -22
  113. package/template/sections/example-section/showcases/2.ts +2 -22
  114. package/template/sections/example-section/showcases/3.ts +2 -22
  115. package/template/sections/example-section/showcases/translations.ts +11 -149
  116. package/template/shared/components/LanguageSelector.vue +1 -1
  117. package/template/shared/translation.ts +16 -0
  118. package/template/shared/utils.ts +3 -1
  119. package/template/tsconfig.json +1 -0
  120. package/types.d.ts +6 -457
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightspeed/crane",
3
- "version": "1.4.2",
3
+ "version": "2.0.1",
4
4
  "type": "module",
5
5
  "bin": "bin/crane.js",
6
6
  "main": "./dist/app.mjs",
@@ -28,7 +28,7 @@
28
28
  "build": "unbuild",
29
29
  "link": "npm link",
30
30
  "type-check": "tsc --noEmit",
31
- "lint": "eslint \"./{src,tests}/**/*.{js,ts}\"",
31
+ "lint": "eslint \"./**/*.{js,ts}\"",
32
32
  "lint:all": "yarn lint && yarn type-check",
33
33
  "test": "jest",
34
34
  "test:end-to-end": "jest end-to-end.test.ts --no-coverage"
@@ -39,7 +39,7 @@
39
39
  "license": "MIT",
40
40
  "devDependencies": {
41
41
  "@jest/globals": "^30.0.4",
42
- "@stylistic/eslint-plugin": "^5.1.0",
42
+ "@lightspeed/eslint-config": "workspace:*",
43
43
  "@types/adm-zip": "^0.5.7",
44
44
  "@types/axios-concurrency": "^1.0.0",
45
45
  "@types/cli-progress": "^3.11.6",
@@ -64,6 +64,7 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@jridgewell/sourcemap-codec": "^1.5.4",
67
+ "@lightspeed/crane-api": "1.0.1",
67
68
  "@lightspeed/eslint-config-crane": "1.1.3",
68
69
  "@types/prompts": "^2.4.2",
69
70
  "@vitejs/plugin-vue": "^6.0.1",
@@ -19,7 +19,7 @@
19
19
 
20
20
  <script setup lang="ts">
21
21
  import { computed } from 'vue';
22
- import { useBackgroundElementDesign } from '@lightspeed/crane';
22
+ import { useBackgroundElementDesign } from '@lightspeed/crane-api';
23
23
  import ReportAbuse from './component/ReportAbuse.vue';
24
24
  import MadeWith from './component/MadeWith.vue';
25
25
  import { Design } from './type.ts';
@@ -1,4 +1,5 @@
1
- import { createVueClientApp } from '@lightspeed/crane';
1
+ import { createVueClientApp } from '@lightspeed/crane-api';
2
+
2
3
  import ExampleFooter from './ExampleFooter.vue';
3
4
  import { Content, Design } from './type.ts';
4
5
 
@@ -8,7 +8,7 @@
8
8
  </template>
9
9
 
10
10
  <script setup lang="ts">
11
- import { useVueBaseProps } from '@lightspeed/crane';
11
+ import { useVueBaseProps } from '@lightspeed/crane-api';
12
12
  import { Design } from '../type.ts';
13
13
 
14
14
  const baseProps = useVueBaseProps<unknown, Design>();
@@ -11,7 +11,7 @@
11
11
  </template>
12
12
 
13
13
  <script setup lang="ts">
14
- import { useVueBaseProps } from '@lightspeed/crane';
14
+ import { useVueBaseProps } from '@lightspeed/crane-api';
15
15
  import { Design } from '../type.ts';
16
16
 
17
17
  const baseProps = useVueBaseProps<unknown, Design>();
@@ -7,7 +7,7 @@
7
7
  </template>
8
8
 
9
9
  <script setup lang="ts">
10
- import { useVueBaseProps } from '@lightspeed/crane';
10
+ import { useVueBaseProps } from '@lightspeed/crane-api';
11
11
  import { Design } from '../type.ts';
12
12
 
13
13
  const baseProps = useVueBaseProps<unknown, Design>();
@@ -1,4 +1,4 @@
1
1
  export enum ColorType {
2
- SOLID = 'solid',
3
- GRADIENT = 'gradient',
2
+ SOLID = 'solid',
3
+ GRADIENT = 'gradient',
4
4
  }
@@ -1,4 +1,5 @@
1
- import { createVueServerApp } from '@lightspeed/crane';
1
+ import { createVueServerApp } from '@lightspeed/crane-api';
2
+
2
3
  import ExampleFooter from './ExampleFooter.vue';
3
4
  import { Content, Design } from './type.ts';
4
5
 
@@ -1,4 +1,5 @@
1
- import { createVueClientApp } from '@lightspeed/crane';
1
+ import { createVueClientApp } from '@lightspeed/crane-api';
2
+
2
3
  import ExampleHeader from './ExampleHeader.vue';
3
4
  import { Content, Design } from './type.ts';
4
5
 
@@ -7,7 +7,7 @@
7
7
  </template>
8
8
 
9
9
  <script setup lang="ts">
10
- import { useVueBaseProps } from '@lightspeed/crane';
10
+ import { useVueBaseProps } from '@lightspeed/crane-api';
11
11
  import { Design } from '../type.ts';
12
12
  import accountIcon from '../assets/account_icon.svg';
13
13
 
@@ -13,7 +13,7 @@
13
13
  </template>
14
14
 
15
15
  <script setup lang="ts">
16
- import { useVueBaseProps } from '@lightspeed/crane';
16
+ import { useVueBaseProps } from '@lightspeed/crane-api';
17
17
  import { computed } from 'vue';
18
18
  import { Design } from '../type.ts';
19
19
 
@@ -53,7 +53,7 @@
53
53
 
54
54
  <script setup lang="ts">
55
55
  import { computed } from 'vue';
56
- import { useVueBaseProps } from '@lightspeed/crane';
56
+ import { useVueBaseProps } from '@lightspeed/crane-api';
57
57
  import { Design } from '../type.ts';
58
58
 
59
59
  interface Props {
@@ -28,7 +28,7 @@
28
28
  </template>
29
29
 
30
30
  <script setup lang="ts">
31
- import { useLogoElementContent, useLogoElementDesign } from '@lightspeed/crane';
31
+ import { useLogoElementContent, useLogoElementDesign } from '@lightspeed/crane-api';
32
32
  import { computed } from 'vue';
33
33
 
34
34
  function getColor(color: Color | undefined) {
@@ -38,7 +38,7 @@
38
38
 
39
39
  <script setup lang="ts">
40
40
  import { ref, computed } from 'vue';
41
- import { useNavigationMenuElementContent } from '@lightspeed/crane';
41
+ import { useNavigationMenuElementContent } from '@lightspeed/crane-api';
42
42
  import CategoriesDropdown from './CategoriesDropdown.vue';
43
43
 
44
44
  interface ActiveItem {
@@ -31,7 +31,7 @@
31
31
 
32
32
  <script setup lang="ts">
33
33
  import { ref } from 'vue';
34
- import { useInstantsiteJsApi } from '@lightspeed/crane';
34
+ import { useInstantsiteJsApi } from '@lightspeed/crane-api';
35
35
 
36
36
  const instantsiteJsApi = useInstantsiteJsApi();
37
37
  const searchInputRef = ref<HTMLInputElement>();
@@ -1,4 +1,5 @@
1
- import { createVueServerApp } from '@lightspeed/crane';
1
+ import { createVueServerApp } from '@lightspeed/crane-api';
2
+
2
3
  import ExampleHeader from './ExampleHeader.vue';
3
4
  import { Content, Design } from './type.ts';
4
5
 
@@ -1 +1 @@
1
- /// <reference types="@lightspeed/crane/types" />
1
+ /// <reference types="@lightspeed/crane-api" />
@@ -6,5 +6,5 @@
6
6
  </template>
7
7
 
8
8
  <script setup lang="ts">
9
- import { CatalogLayoutSlot as Slot } from '@lightspeed/crane';
9
+ import { CatalogLayoutSlot as Slot } from '@lightspeed/crane-api';
10
10
  </script>
@@ -1,4 +1,5 @@
1
- import { createVueClientApp } from '@lightspeed/crane';
1
+ import { createVueClientApp } from '@lightspeed/crane-api';
2
+
2
3
  import CustomBottomBar from './CustomBottomBar.vue';
3
4
  import { Content, Design } from '../../type.ts';
4
5
 
@@ -1,4 +1,5 @@
1
- import { createVueServerApp } from '@lightspeed/crane';
1
+ import { createVueServerApp } from '@lightspeed/crane-api';
2
+
2
3
  import CustomBottomBar from './CustomBottomBar.vue';
3
4
  import { Content, Design } from '../../type.ts';
4
5
 
@@ -7,5 +7,5 @@
7
7
  </template>
8
8
 
9
9
  <script setup lang="ts">
10
- import { CategoryLayoutSlot as Slot } from '@lightspeed/crane';
10
+ import { CategoryLayoutSlot as Slot } from '@lightspeed/crane-api';
11
11
  </script>
@@ -1 +1 @@
1
- export default {} as const;
1
+ export default {} as const;
@@ -1 +1 @@
1
- export default {} as const;
1
+ export default {} as const;
@@ -19,7 +19,7 @@
19
19
 
20
20
  <script setup lang="ts">
21
21
  import { HTMLAttributes } from 'vue';
22
- import { ProductLayoutSlot as Slot } from '@lightspeed/crane';
22
+ import { ProductLayoutSlot as Slot } from '@lightspeed/crane-api';
23
23
 
24
24
  interface Props {
25
25
  availableProductClasses?: HTMLAttributes['class'],
@@ -1 +1 @@
1
- export default {} as const;
1
+ export default {} as const;
@@ -1 +1 @@
1
- export default {} as const;
1
+ export default {} as const;
@@ -8,10 +8,13 @@
8
8
  "deploy": "crane build && crane deploy"
9
9
  },
10
10
  "dependencies": {
11
- "@lightspeed/crane": "latest",
11
+ "@lightspeed/crane-api": "latest",
12
12
  "@lightspeed/eslint-config-crane": "latest",
13
- "vue": "^3.4.0",
14
- "eslint": "9.33.0"
13
+ "@swc/core": "^1.15.1",
14
+ "eslint": "9.33.0",
15
+ "linkedom": "^0.18.0",
16
+ "module-from-string": "^3.3.1",
17
+ "vue": "^3.4.0"
15
18
  },
16
19
  "engines": {
17
20
  "node": ">=22"
@@ -1,4 +1,4 @@
1
- import { StorePageConfiguration } from '@lightspeed/crane';
1
+ import { StorePageConfiguration } from '@lightspeed/crane-api';
2
2
 
3
3
  export default {
4
4
  sections: [
@@ -1,4 +1,4 @@
1
- import { StorePageConfiguration } from '@lightspeed/crane';
1
+ import { StorePageConfiguration } from '@lightspeed/crane-api';
2
2
 
3
3
  export default {
4
4
  sections: [
@@ -1,4 +1,4 @@
1
- import { StorePageConfiguration } from '@lightspeed/crane';
1
+ import { StorePageConfiguration } from '@lightspeed/crane-api';
2
2
 
3
3
  export default {
4
4
  sections: [
@@ -14,7 +14,7 @@
14
14
 
15
15
  <style>
16
16
  .top-bar {
17
- position: fixed;
17
+ position: sticky;
18
18
  top: 0;
19
19
  left: 0;
20
20
  right: 0;