cloudcommerce 0.37.1 → 0.38.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.
Files changed (142) hide show
  1. package/.github/workflows/test-apps.yml +2 -2
  2. package/.vscode/settings.json +1 -1
  3. package/CHANGELOG.md +36 -0
  4. package/action.yml +2 -2
  5. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  6. package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
  7. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  8. package/ecomplus-stores/barra-doce/package.json +2 -2
  9. package/package.json +7 -7
  10. package/packages/api/lib/api.d.ts +2 -2
  11. package/packages/api/package.json +1 -1
  12. package/packages/api/types.d.ts +4 -1
  13. package/packages/apps/affilate-program/package.json +1 -1
  14. package/packages/apps/correios/package.json +1 -1
  15. package/packages/apps/custom-payment/package.json +1 -1
  16. package/packages/apps/custom-shipping/package.json +1 -1
  17. package/packages/apps/datafrete/package.json +1 -1
  18. package/packages/apps/discounts/package.json +1 -1
  19. package/packages/apps/emails/package.json +1 -1
  20. package/packages/apps/fb-conversions/package.json +1 -1
  21. package/packages/apps/flash-courier/package.json +1 -1
  22. package/packages/apps/frenet/package.json +1 -1
  23. package/packages/apps/galaxpay/package.json +1 -1
  24. package/packages/apps/google-analytics/package.json +1 -1
  25. package/packages/apps/jadlog/package.json +1 -1
  26. package/packages/apps/loyalty-points/package.json +1 -1
  27. package/packages/apps/mandae/package.json +1 -1
  28. package/packages/apps/melhor-envio/package.json +1 -1
  29. package/packages/apps/mercadopago/package.json +1 -1
  30. package/packages/apps/pagarme/package.json +1 -1
  31. package/packages/apps/pagarme-v5/package.json +1 -1
  32. package/packages/apps/paghiper/package.json +1 -1
  33. package/packages/apps/pix/package.json +1 -1
  34. package/packages/apps/tiny-erp/package.json +1 -1
  35. package/packages/apps/webhooks/package.json +1 -1
  36. package/packages/cli/config/firestore.rules +4 -1
  37. package/packages/cli/lib/cli.js +30 -9
  38. package/packages/cli/package.json +2 -1
  39. package/packages/cli/src/cli.ts +37 -9
  40. package/packages/config/package.json +1 -1
  41. package/packages/emails/package.json +1 -1
  42. package/packages/eslint/package.json +3 -3
  43. package/packages/events/package.json +1 -1
  44. package/packages/feeds/package.json +1 -1
  45. package/packages/firebase/package.json +1 -1
  46. package/packages/i18n/package.json +1 -1
  47. package/packages/modules/package.json +1 -1
  48. package/packages/passport/package.json +1 -1
  49. package/packages/ssr/package.json +5 -5
  50. package/packages/storefront/.auto-imports.d.ts +1 -0
  51. package/packages/storefront/client.d.ts +1 -0
  52. package/packages/storefront/config/storefront.tailwind.cjs +21 -20
  53. package/packages/storefront/config/storefront.unocss.cjs +11 -0
  54. package/packages/storefront/dist/client/_astro/{AccountPage.700be123.js → AccountPage.j0C5JBLY.js} +1 -1
  55. package/packages/storefront/dist/client/_astro/{CartSidebar.430b55df.js → CartSidebar.1kUFk9Xn.js} +1 -1
  56. package/packages/storefront/dist/client/_astro/HeroSlider.tR1dVXyu.js +1 -0
  57. package/packages/storefront/dist/client/_astro/{PitchBar.06e0f831.js → PitchBar.FelC04wE.js} +1 -1
  58. package/packages/storefront/dist/client/_astro/{Prices.0e829c31.js → Prices.PuQc6C7F.js} +1 -1
  59. package/packages/storefront/dist/client/_astro/ProductCard.ephJafAE.js +1 -0
  60. package/packages/storefront/dist/client/_astro/ProductDetails.B6Ih5MGf.js +7 -0
  61. package/packages/storefront/dist/client/_astro/ProductShelf.GESxuPZ_.js +1 -0
  62. package/packages/storefront/dist/client/_astro/{QuantitySelector.ebf60845.js → QuantitySelector.YNmWjN8y.js} +1 -1
  63. package/packages/storefront/dist/client/_astro/SearchContainer.BzixfU3R.js +1 -0
  64. package/packages/storefront/dist/client/_astro/SearchModal.F7vbwxIv.js +1 -0
  65. package/packages/storefront/dist/client/_astro/ShopHeader.5vR1LgSW.js +10 -0
  66. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.sk5AFsEV.js +1 -0
  67. package/packages/storefront/dist/client/_astro/_slug_.r8QHNfdw.css +1 -0
  68. package/packages/storefront/dist/client/_astro/client.RF8UxjZd.js +1 -0
  69. package/packages/storefront/dist/client/_astro/customer-session._VkzXnXT.js +7 -0
  70. package/packages/storefront/dist/client/_astro/ecom-utils.gJYgRPRz.js +1 -0
  71. package/packages/storefront/dist/client/_astro/{firebase-app.992a296f.js → firebase-app.cPMfoOsn.js} +1 -1
  72. package/packages/storefront/dist/client/_astro/{format-money.9cf6b04d.js → format-money.FMQXgKHB.js} +1 -1
  73. package/packages/storefront/dist/client/_astro/{hoisted.c90fc6ab.js → hoisted.B6fKrLPR.js} +1 -1
  74. package/packages/storefront/dist/client/_astro/{hoisted.54eaab04.js → hoisted._FbzheVm.js} +1 -1
  75. package/packages/storefront/dist/client/_astro/{i18n.29216eeb.js → i18n.m7SpISxy.js} +1 -1
  76. package/packages/storefront/dist/client/_astro/{img.4f23a3dd.js → img.zh-Drf-O.js} +1 -1
  77. package/packages/storefront/dist/client/_astro/{index-61e5ac61.bdc8d0cd.js → index-dd468b12.D5s8VdAL.js} +92 -107
  78. package/packages/storefront/dist/client/_astro/{index.570b84fe.js → index.5PN-EYMS.js} +1 -1
  79. package/packages/storefront/dist/client/_astro/index.XrHFaN2F.js +1 -0
  80. package/packages/storefront/dist/client/_astro/{modules-info.55780599.js → modules-info.sD0tdb2b.js} +1 -1
  81. package/packages/storefront/dist/client/_astro/name.HU5l7TJo.js +1 -0
  82. package/packages/storefront/dist/client/_astro/{photoswipe-lightbox.esm.c157838f.js → photoswipe-lightbox.esm.dZBqKD9u.js} +1 -1
  83. package/packages/storefront/dist/client/_astro/{photoswipe.01431ec7.js → photoswipe.0V7m2jWu.js} +1 -2
  84. package/packages/storefront/dist/client/_astro/{photoswipe.esm.92c2d901.js → photoswipe.esm.Ylh9TGkz.js} +1 -1
  85. package/packages/storefront/dist/client/_astro/sf-utils.5t7r9A2G.js +1 -0
  86. package/packages/storefront/dist/client/_astro/{shopping-cart.d9f601dd.js → shopping-cart.A-1jhlKi.js} +1 -1
  87. package/packages/storefront/dist/client/_astro/use-analytics.1EVxbrS7.js +1 -0
  88. package/packages/storefront/dist/client/_astro/{use-product-card.437911bb.js → use-product-card.erbOV6Fv.js} +1 -1
  89. package/packages/storefront/dist/client/robots.txt +1 -0
  90. package/packages/storefront/dist/server/chunks/{CartSidebar_eab28771.mjs → CartSidebar_hAgJQJgm.mjs} +1 -1
  91. package/packages/storefront/dist/server/chunks/SearchModal_eWb5SdQM.mjs +351 -0
  92. package/packages/storefront/dist/server/chunks/{_.._5a781fb3.mjs → _.._S7DDBn_b.mjs} +1 -1
  93. package/packages/storefront/dist/server/chunks/{account_519edb70.mjs → account_3ySmGzMc.mjs} +1 -1
  94. package/packages/storefront/dist/server/chunks/astro/{assets-service_a9d9ab5f.mjs → assets-service_QlOZG8ov.mjs} +1 -1
  95. package/packages/storefront/dist/server/chunks/{astro_d98f7186.mjs → astro_zcC1GStV.mjs} +17 -34
  96. package/packages/storefront/dist/server/chunks/{index_5e3ed8a0.mjs → index_nIwq11oA.mjs} +1 -1
  97. package/packages/storefront/dist/server/chunks/{index_10e14f85.mjs → index_uAR5ZV4d.mjs} +1 -1
  98. package/packages/storefront/dist/server/chunks/{node_1119b0d1.mjs → node_2VvC7trl.mjs} +1 -1
  99. package/packages/storefront/dist/server/chunks/pages/{__93ade2dd.mjs → __MSibDuuV.mjs} +652 -255
  100. package/packages/storefront/dist/server/chunks/pages/{account_e5d410a7.mjs → account_iG-YqJ5q.mjs} +3 -2
  101. package/packages/storefront/dist/server/chunks/pages/{index_7e25afc1.mjs → index_BtDyKPh_.mjs} +3 -2
  102. package/packages/storefront/dist/server/chunks/pages/{node_bd378ac0.mjs → node_bKqL47eZ.mjs} +2 -2
  103. package/packages/storefront/dist/server/chunks/pages/{~fallback_73578d2f.mjs → ~fallback_73R5VA6j.mjs} +3 -2
  104. package/packages/storefront/dist/server/chunks/{photoswipe_9528923e.mjs → photoswipe_IcWDJiwc.mjs} +1 -1
  105. package/packages/storefront/dist/server/chunks/{~fallback_41122b9b.mjs → ~fallback_7q1dqY4e.mjs} +1 -1
  106. package/packages/storefront/dist/server/entry.mjs +970 -93
  107. package/packages/storefront/dist/server/manifest_dSwvaOdW.mjs +195 -0
  108. package/packages/storefront/dist/server/renderers.mjs +2 -2
  109. package/packages/storefront/package.json +12 -12
  110. package/packages/storefront/src/helpers/sf-utils.ts +29 -1
  111. package/packages/storefront/src/lib/composables/use-search-container.ts +48 -0
  112. package/packages/storefront/src/lib/composables/use-search-modal.ts +1 -1
  113. package/packages/storefront/src/lib/composables/use-shop-header.ts +14 -5
  114. package/packages/storefront/src/lib/composables/use-sticky-header.ts +2 -0
  115. package/packages/storefront/src/lib/layouts/BaseHead.astro +8 -1
  116. package/packages/storefront/src/lib/layouts/use-page-main.ts +15 -0
  117. package/packages/storefront/src/lib/scripts/firestore.ts +27 -0
  118. package/packages/storefront/src/lib/ssr-context.ts +14 -0
  119. package/packages/storefront/src/lib/state/search-engine.ts +62 -25
  120. package/packages/storefront/src/lib/state/use-analytics.ts +9 -10
  121. package/packages/test-base/package.json +1 -1
  122. package/packages/types/package.json +1 -1
  123. package/packages/storefront/dist/client/_astro/HeroSlider.bd684ed8.js +0 -1
  124. package/packages/storefront/dist/client/_astro/ProductDetails.06da998d.js +0 -1
  125. package/packages/storefront/dist/client/_astro/ProductShelf.3f4f38b5.js +0 -1
  126. package/packages/storefront/dist/client/_astro/ProductShelf.bf82838b.js +0 -1
  127. package/packages/storefront/dist/client/_astro/SearchModal.b6aa5ef7.js +0 -1
  128. package/packages/storefront/dist/client/_astro/ShopHeader.2d6e361a.js +0 -4
  129. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.f75743ee.js +0 -1
  130. package/packages/storefront/dist/client/_astro/_slug_.e7cac999.css +0 -1
  131. package/packages/storefront/dist/client/_astro/client.41b42098.js +0 -1
  132. package/packages/storefront/dist/client/_astro/customer-session.5ab9ab1a.js +0 -1
  133. package/packages/storefront/dist/client/_astro/ecom-utils.5cbfb95e.js +0 -1
  134. package/packages/storefront/dist/client/_astro/index.8ac1db99.js +0 -1
  135. package/packages/storefront/dist/client/_astro/name.01410784.js +0 -1
  136. package/packages/storefront/dist/client/_astro/sf-utils.b04e1813.js +0 -1
  137. package/packages/storefront/dist/client/_astro/use-analytics.cc95e346.js +0 -1
  138. package/packages/storefront/dist/server/chunks/SearchModal_f66549d4.mjs +0 -147
  139. package/packages/storefront/dist/server/manifest_221d806b.mjs +0 -1069
  140. /package/packages/storefront/dist/client/_astro/{afetch.f4507208.js → afetch.5c8VmT0-.js} +0 -0
  141. /package/packages/storefront/dist/client/_astro/{img-sizes.41e0efe4.js → img-sizes.gxAI9JNh.js} +0 -0
  142. /package/packages/storefront/dist/client/_astro/{price.04ceb6c4.js → price.Easct8WC.js} +0 -0
@@ -104,11 +104,11 @@ jobs:
104
104
  ${{ steps.npm-paths.outputs.LIB_PATH }}
105
105
  ${{ steps.npm-paths.outputs.BIN_PATH }}
106
106
  ~/.npm-global/bin
107
- key: ${{ runner.os }}-npm-globals-firebase-tools-13.0.0
107
+ key: ${{ runner.os }}-npm-globals-firebase-tools-13.0.1
108
108
 
109
109
  - if: steps.npm-g-cache.outputs.cache-hit != 'true'
110
110
  shell: bash
111
- run: npm install -g firebase-tools@13.0.0
111
+ run: npm install -g firebase-tools@13.0.1
112
112
 
113
113
  - name: Initialize Firebase emulators
114
114
  shell: bash
@@ -3,7 +3,7 @@
3
3
  "strings": true
4
4
  },
5
5
  "editor.codeActionsOnSave": {
6
- "source.fixAll.eslint": true
6
+ "source.fixAll.eslint": "explicit"
7
7
  },
8
8
  "files.associations": {
9
9
  "*.css": "tailwindcss"
package/CHANGELOG.md CHANGED
@@ -2,6 +2,42 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [0.38.0](https://github.com/ecomplus/cloud-commerce/compare/v0.37.1...v0.38.0) (2023-12-13)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * **deps:** Astro major version update
11
+ * **storefront:** Return of `useSearchModal` composable refactored
12
+
13
+ ### Features
14
+
15
+ * **cli:** Keep user Firebase config files from `/conf` path if any ([4c96a25](https://github.com/ecomplus/cloud-commerce/commit/4c96a25f253e52bce6eacb216bdb78f59f2f77be))
16
+ * **cli:** Update default Firestore rules to allow creation on forms colelction ([54d1ff6](https://github.com/ecomplus/cloud-commerce/commit/54d1ff6dd0885c39c420c57418313bace7cb30f3))
17
+ * **deps:** Bump Vite to v5 and Astro to v4 ([f7dab35](https://github.com/ecomplus/cloud-commerce/commit/f7dab3546f331915e840e7af578284e32a1957cd))
18
+ * **storefront:** Accepting `term = null` on search method for no term filter search ([06f66a8](https://github.com/ecomplus/cloud-commerce/commit/06f66a8036dc637fa9bcaccfc50c0db7361c7a95))
19
+ * **storefront:** Adding search term to page title on SSR ([950a100](https://github.com/ecomplus/cloud-commerce/commit/950a100a0bb7c05f03ac7280e08eb79a045f7be3))
20
+ * **storefront:** New `scripts/firestore` with abstractions for forms docs and app check support ([4b39c0d](https://github.com/ecomplus/cloud-commerce/commit/4b39c0d89541dc01ce9d03d6f0f13116d0a5be19))
21
+ * **storefront:** New properties on `SearchEngine` to control fetching state and promises ([7c45cc7](https://github.com/ecomplus/cloud-commerce/commit/7c45cc731b241438b1a6367ac2af62117f906323))
22
+ * **storefront:** New SSR route context properties `isSearchPage` and `searchPageTerm` ([53e1dcb](https://github.com/ecomplus/cloud-commerce/commit/53e1dcb99babea36136168b2842f6c3b85418330))
23
+ * **storefront:** New Tailwind/UnoCSS variant `sticky-header:` ([de941a6](https://github.com/ecomplus/cloud-commerce/commit/de941a68f0b4cec95053ca7dc77b9638f5ad49f7))
24
+ * **storefront:** New utils: `toLowerCaseAccents`, `termify` and `getSearchUrl` ([e75fb37](https://github.com/ecomplus/cloud-commerce/commit/e75fb3712530c3f015c0f0b510162e04cb5acf09))
25
+ * **storefront:** Setting up `useSearchContainer` composable and and `search-container` section ([6ffb202](https://github.com/ecomplus/cloud-commerce/commit/6ffb20252e1279a00cc585a028857bca363d3c91))
26
+ * **storefront:** Update `useStickyHeader` composable to toggle body class ".StickyHeader" ([afc0e0f](https://github.com/ecomplus/cloud-commerce/commit/afc0e0f09b1d3f74f062fe0e38990df3abd97d23))
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * **api:** Updating `ResourceAndFind` typedef adding stores/me and authentications/me endpoints ([0c514e9](https://github.com/ecomplus/cloud-commerce/commit/0c514e91d6a7b98f78e51e9bd21dacfff208e9f0))
32
+ * **cli:** Fix default Firestore rules to enable creation on _forms_ subcolls ([21c40c5](https://github.com/ecomplus/cloud-commerce/commit/21c40c57d8f32412d242d303b5c1e57b3377f26b))
33
+ * **deps:** Update non-major dependencies ([#286](https://github.com/ecomplus/cloud-commerce/issues/286)) ([d35aaa9](https://github.com/ecomplus/cloud-commerce/commit/d35aaa9b4014f7dd3e835cf61b37fd1eae7a0663))
34
+ * **storefront:** Better generating brand colors pallete on Tailwind/UnoCSS config ([b85f9df](https://github.com/ecomplus/cloud-commerce/commit/b85f9df973c6221d2dd20783e89cc934e26ca60f))
35
+ * **storefront:** Update shop header to search submit redirecting to /s/term indexable URL ([c57a2a3](https://github.com/ecomplus/cloud-commerce/commit/c57a2a3573a4c07904be941a1577454f9dd3ecde))
36
+ * **storefront:** Update Vue to v3.3.11 ([#287](https://github.com/ecomplus/cloud-commerce/issues/287)) ([d514012](https://github.com/ecomplus/cloud-commerce/commit/d514012ca73337bdda341108a0f1fe3ea6ac183f))
37
+
38
+
39
+ * **storefront:** Renaming `useSearchModal` returned `products` ([cd44b51](https://github.com/ecomplus/cloud-commerce/commit/cd44b513bcec27aea0c9301d99aa5cbf7c9b1ae5))
40
+
5
41
  ### [0.37.1](https://github.com/ecomplus/cloud-commerce/compare/v0.37.0...v0.37.1) (2023-12-07)
6
42
 
7
43
 
package/action.yml CHANGED
@@ -149,11 +149,11 @@ runs:
149
149
  ${{ steps.npm-paths.outputs.LIB_PATH }}
150
150
  ${{ steps.npm-paths.outputs.BIN_PATH }}
151
151
  ~/.npm-global/bin
152
- key: ${{ runner.os }}-npm-g-firebase-tools-13.0.0
152
+ key: ${{ runner.os }}-npm-g-firebase-tools-13.0.1
153
153
 
154
154
  - if: ${{ github.event_name == 'push' && steps.npm-g-cache.outputs.cache-hit != 'true' }}
155
155
  shell: bash
156
- run: npm i --location=global firebase-tools@13.0.0
156
+ run: npm i --location=global firebase-tools@13.0.1
157
157
 
158
158
  - if: steps.npm-cache-many.outputs.cache-hit != 'true'
159
159
  name: Install codebase "many" dependencies
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "main": "index.js",
17
17
  "dependencies": {
18
- "@cloudcommerce/feeds": "^0.37.0",
19
- "@cloudcommerce/firebase": "^0.37.0",
20
- "@cloudcommerce/passport": "^0.37.0"
18
+ "@cloudcommerce/feeds": "^0.37.1",
19
+ "@cloudcommerce/firebase": "^0.37.1",
20
+ "@cloudcommerce/passport": "^0.37.1"
21
21
  }
22
22
  }
@@ -17,15 +17,15 @@
17
17
  },
18
18
  "main": "index.js",
19
19
  "dependencies": {
20
- "@cloudcommerce/api": "^0.37.0",
21
- "@cloudcommerce/firebase": "^0.37.0",
22
- "@cloudcommerce/ssr": "^0.37.0",
20
+ "@cloudcommerce/api": "^0.37.1",
21
+ "@cloudcommerce/firebase": "^0.37.1",
22
+ "@cloudcommerce/ssr": "^0.37.1",
23
23
  "@headlessui/vue": "^1.7.16"
24
24
  },
25
25
  "devDependencies": {
26
- "@cloudcommerce/i18n": "^0.37.0",
27
- "@cloudcommerce/storefront": "^0.37.0",
28
- "@cloudcommerce/types": "^0.37.0",
26
+ "@cloudcommerce/i18n": "^0.37.1",
27
+ "@cloudcommerce/storefront": "^0.37.1",
28
+ "@cloudcommerce/types": "^0.37.1",
29
29
  "@fontsource/croissant-one": "^5.0.17",
30
30
  "@iconify-json/mingcute": "^1.1.11",
31
31
  "photoswipe": "^5.4.2"
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "main": "index.js",
17
17
  "dependencies": {
18
- "@cloudcommerce/events": "^0.37.0",
19
- "@cloudcommerce/firebase": "^0.37.0",
20
- "@cloudcommerce/modules": "^0.37.0"
18
+ "@cloudcommerce/events": "^0.37.1",
19
+ "@cloudcommerce/firebase": "^0.37.1",
20
+ "@cloudcommerce/modules": "^0.37.1"
21
21
  }
22
22
  }
@@ -23,9 +23,9 @@
23
23
  "url": "https://github.com/ecomplus/cloud-commerce/issues"
24
24
  },
25
25
  "dependencies": {
26
- "@cloudcommerce/cli": "^0.37.0"
26
+ "@cloudcommerce/cli": "^0.37.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@cloudcommerce/eslint": "^0.37.0"
29
+ "@cloudcommerce/eslint": "^0.37.1"
30
30
  }
31
31
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "Open fair-code headless commerce platform: API-first, microservices based, event driven and cloud native",
6
6
  "main": "packages/api/lib/index.js",
7
7
  "author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
@@ -19,18 +19,18 @@
19
19
  "@commitlint/cli": "^18.4.3",
20
20
  "@commitlint/config-conventional": "^18.4.3",
21
21
  "@commitlint/rules": "^18.4.3",
22
- "@types/node": "^18.19.2",
22
+ "@types/node": "^18.19.3",
23
23
  "eslint": "^8.55.0",
24
24
  "husky": "^8.0.3",
25
25
  "standard-version": "^9.5.0",
26
- "ts-node": "^10.9.1",
27
- "turbo": "^1.10.16",
26
+ "ts-node": "^10.9.2",
27
+ "turbo": "^1.11.1",
28
28
  "typescript": "~5.2.2",
29
29
  "uglify-js": "^3.17.4",
30
- "vite": "^4.5.1",
31
- "vitest": "^0.34.6",
30
+ "vite": "^5.0.8",
31
+ "vitest": "^1.0.4",
32
32
  "zx": "^7.2.3",
33
- "@cloudcommerce/eslint": "0.37.1"
33
+ "@cloudcommerce/eslint": "0.38.0"
34
34
  },
35
35
  "scripts": {
36
36
  "fix-install": "bash scripts/pre-install.sh && pnpm i",
@@ -59,7 +59,7 @@ declare const api: {
59
59
  _id: import("../types.d").ResourceId;
60
60
  };
61
61
  }>;
62
- put: <E_1 extends import("../types.d").ResourceAndFind | `products/${import("../types.d").ResourceId}/${string}` | `categories/${import("../types.d").ResourceId}/${string}` | `brands/${import("../types.d").ResourceId}/${string}` | `collections/${import("../types.d").ResourceId}/${string}` | `grids/${import("../types.d").ResourceId}/${string}` | `carts/${import("../types.d").ResourceId}/${string}` | `orders/${import("../types.d").ResourceId}/${string}` | `customers/${import("../types.d").ResourceId}/${string}` | `stores/${import("../types.d").ResourceId}/${string}` | `applications/${import("../types.d").ResourceId}/${string}` | `authentications/${import("../types.d").ResourceId}/${string}` | `products/${string}:${string}/${string}` | `categories/${string}:${string}/${string}` | `brands/${string}:${string}/${string}` | `collections/${string}:${string}/${string}` | `grids/${string}:${string}/${string}` | `carts/${string}:${string}/${string}` | `orders/${string}:${string}/${string}` | `customers/${string}:${string}/${string}` | `stores/${string}:${string}/${string}` | `applications/${string}:${string}/${string}` | `authentications/${string}:${string}/${string}` | `slugs/${string}` | ("search/v1" | `search/v1?${string}` | "search/_els" | `search/_els?${string}`) | ("events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${import("../types.d").ResourceId}` | `events/categories/${import("../types.d").ResourceId}` | `events/brands/${import("../types.d").ResourceId}` | `events/collections/${import("../types.d").ResourceId}` | `events/grids/${import("../types.d").ResourceId}` | `events/carts/${import("../types.d").ResourceId}` | `events/orders/${import("../types.d").ResourceId}` | `events/customers/${import("../types.d").ResourceId}` | `events/stores/${import("../types.d").ResourceId}` | `events/applications/${import("../types.d").ResourceId}` | `events/authentications/${import("../types.d").ResourceId}` | "events/me") | "login" | "authenticate" | "ask-auth-callback" | "check-username" | "$aggregate/products" | "$aggregate/categories" | "$aggregate/brands" | "$aggregate/collections" | "$aggregate/grids" | "$aggregate/carts" | "$aggregate/orders" | "$aggregate/customers" | "schemas/products" | "schemas/categories" | "schemas/brands" | "schemas/collections" | "schemas/grids" | "schemas/carts" | "schemas/orders" | "schemas/customers" | "schemas/stores" | "schemas/applications" | "schemas/authentications", C_1 extends AbstractedConfig>(endpoint: E_1, body: RequestBody<{
62
+ put: <E_1 extends import("../types.d").ResourceAndFind | `products/${import("../types.d").ResourceId}/${string}` | `categories/${import("../types.d").ResourceId}/${string}` | `brands/${import("../types.d").ResourceId}/${string}` | `collections/${import("../types.d").ResourceId}/${string}` | `grids/${import("../types.d").ResourceId}/${string}` | `carts/${import("../types.d").ResourceId}/${string}` | `orders/${import("../types.d").ResourceId}/${string}` | `customers/${import("../types.d").ResourceId}/${string}` | `stores/${import("../types.d").ResourceId}/${string}` | `applications/${import("../types.d").ResourceId}/${string}` | `authentications/${import("../types.d").ResourceId}/${string}` | `products/${string}:${string}/${string}` | `categories/${string}:${string}/${string}` | `brands/${string}:${string}/${string}` | `collections/${string}:${string}/${string}` | `grids/${string}:${string}/${string}` | `carts/${string}:${string}/${string}` | `orders/${string}:${string}/${string}` | `customers/${string}:${string}/${string}` | `stores/${string}:${string}/${string}` | `applications/${string}:${string}/${string}` | `authentications/${string}:${string}/${string}` | `stores/me/${string}` | `authentications/me/${string}` | `slugs/${string}` | ("search/v1" | `search/v1?${string}` | "search/_els" | `search/_els?${string}`) | ("events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${import("../types.d").ResourceId}` | `events/categories/${import("../types.d").ResourceId}` | `events/brands/${import("../types.d").ResourceId}` | `events/collections/${import("../types.d").ResourceId}` | `events/grids/${import("../types.d").ResourceId}` | `events/carts/${import("../types.d").ResourceId}` | `events/orders/${import("../types.d").ResourceId}` | `events/customers/${import("../types.d").ResourceId}` | `events/stores/${import("../types.d").ResourceId}` | `events/applications/${import("../types.d").ResourceId}` | `events/authentications/${import("../types.d").ResourceId}` | "events/me") | "login" | "authenticate" | "ask-auth-callback" | "check-username" | "$aggregate/products" | "$aggregate/categories" | "$aggregate/brands" | "$aggregate/collections" | "$aggregate/grids" | "$aggregate/carts" | "$aggregate/orders" | "$aggregate/customers" | "schemas/products" | "schemas/categories" | "schemas/brands" | "schemas/collections" | "schemas/grids" | "schemas/carts" | "schemas/orders" | "schemas/customers" | "schemas/stores" | "schemas/applications" | "schemas/authentications", C_1 extends AbstractedConfig>(endpoint: E_1, body: RequestBody<{
63
63
  endpoint: E_1;
64
64
  method: 'put';
65
65
  }>, config?: C_1 | undefined) => Promise<Response & {
@@ -103,7 +103,7 @@ declare const post: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E
103
103
  _id: import("../types.d").ResourceId;
104
104
  };
105
105
  }>;
106
- declare const put: <E extends import("../types.d").ResourceAndFind | `products/${import("../types.d").ResourceId}/${string}` | `categories/${import("../types.d").ResourceId}/${string}` | `brands/${import("../types.d").ResourceId}/${string}` | `collections/${import("../types.d").ResourceId}/${string}` | `grids/${import("../types.d").ResourceId}/${string}` | `carts/${import("../types.d").ResourceId}/${string}` | `orders/${import("../types.d").ResourceId}/${string}` | `customers/${import("../types.d").ResourceId}/${string}` | `stores/${import("../types.d").ResourceId}/${string}` | `applications/${import("../types.d").ResourceId}/${string}` | `authentications/${import("../types.d").ResourceId}/${string}` | `products/${string}:${string}/${string}` | `categories/${string}:${string}/${string}` | `brands/${string}:${string}/${string}` | `collections/${string}:${string}/${string}` | `grids/${string}:${string}/${string}` | `carts/${string}:${string}/${string}` | `orders/${string}:${string}/${string}` | `customers/${string}:${string}/${string}` | `stores/${string}:${string}/${string}` | `applications/${string}:${string}/${string}` | `authentications/${string}:${string}/${string}` | `slugs/${string}` | ("search/v1" | `search/v1?${string}` | "search/_els" | `search/_els?${string}`) | ("events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${import("../types.d").ResourceId}` | `events/categories/${import("../types.d").ResourceId}` | `events/brands/${import("../types.d").ResourceId}` | `events/collections/${import("../types.d").ResourceId}` | `events/grids/${import("../types.d").ResourceId}` | `events/carts/${import("../types.d").ResourceId}` | `events/orders/${import("../types.d").ResourceId}` | `events/customers/${import("../types.d").ResourceId}` | `events/stores/${import("../types.d").ResourceId}` | `events/applications/${import("../types.d").ResourceId}` | `events/authentications/${import("../types.d").ResourceId}` | "events/me") | "login" | "authenticate" | "ask-auth-callback" | "check-username" | "$aggregate/products" | "$aggregate/categories" | "$aggregate/brands" | "$aggregate/collections" | "$aggregate/grids" | "$aggregate/carts" | "$aggregate/orders" | "$aggregate/customers" | "schemas/products" | "schemas/categories" | "schemas/brands" | "schemas/collections" | "schemas/grids" | "schemas/carts" | "schemas/orders" | "schemas/customers" | "schemas/stores" | "schemas/applications" | "schemas/authentications", C extends AbstractedConfig>(endpoint: E, body: RequestBody<{
106
+ declare const put: <E extends import("../types.d").ResourceAndFind | `products/${import("../types.d").ResourceId}/${string}` | `categories/${import("../types.d").ResourceId}/${string}` | `brands/${import("../types.d").ResourceId}/${string}` | `collections/${import("../types.d").ResourceId}/${string}` | `grids/${import("../types.d").ResourceId}/${string}` | `carts/${import("../types.d").ResourceId}/${string}` | `orders/${import("../types.d").ResourceId}/${string}` | `customers/${import("../types.d").ResourceId}/${string}` | `stores/${import("../types.d").ResourceId}/${string}` | `applications/${import("../types.d").ResourceId}/${string}` | `authentications/${import("../types.d").ResourceId}/${string}` | `products/${string}:${string}/${string}` | `categories/${string}:${string}/${string}` | `brands/${string}:${string}/${string}` | `collections/${string}:${string}/${string}` | `grids/${string}:${string}/${string}` | `carts/${string}:${string}/${string}` | `orders/${string}:${string}/${string}` | `customers/${string}:${string}/${string}` | `stores/${string}:${string}/${string}` | `applications/${string}:${string}/${string}` | `authentications/${string}:${string}/${string}` | `stores/me/${string}` | `authentications/me/${string}` | `slugs/${string}` | ("search/v1" | `search/v1?${string}` | "search/_els" | `search/_els?${string}`) | ("events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${import("../types.d").ResourceId}` | `events/categories/${import("../types.d").ResourceId}` | `events/brands/${import("../types.d").ResourceId}` | `events/collections/${import("../types.d").ResourceId}` | `events/grids/${import("../types.d").ResourceId}` | `events/carts/${import("../types.d").ResourceId}` | `events/orders/${import("../types.d").ResourceId}` | `events/customers/${import("../types.d").ResourceId}` | `events/stores/${import("../types.d").ResourceId}` | `events/applications/${import("../types.d").ResourceId}` | `events/authentications/${import("../types.d").ResourceId}` | "events/me") | "login" | "authenticate" | "ask-auth-callback" | "check-username" | "$aggregate/products" | "$aggregate/categories" | "$aggregate/brands" | "$aggregate/collections" | "$aggregate/grids" | "$aggregate/carts" | "$aggregate/orders" | "$aggregate/customers" | "schemas/products" | "schemas/categories" | "schemas/brands" | "schemas/collections" | "schemas/grids" | "schemas/carts" | "schemas/orders" | "schemas/customers" | "schemas/stores" | "schemas/applications" | "schemas/authentications", C extends AbstractedConfig>(endpoint: E, body: RequestBody<{
107
107
  endpoint: E;
108
108
  method: 'put';
109
109
  }>, config?: C | undefined) => Promise<Response & {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce APIs client/adapter",
6
6
  "main": "lib/api.js",
7
7
  "types": "lib/api.d.ts",
@@ -24,7 +24,10 @@ type Resource = 'products'
24
24
 
25
25
  type ResourceId = string & { length: 24 };
26
26
  type ResourceAndId = `${Resource}/${ResourceId}`;
27
- type ResourceAndFind = ResourceAndId | `${Resource}/${string}:${string}`;
27
+ type ResourceAndFind = ResourceAndId
28
+ | `${Resource}/${string}:${string}`
29
+ | 'stores/me'
30
+ | 'authentications/me';
28
31
  type ResourceOpQuery = Resource | `${Resource}?${string}`;
29
32
 
30
33
  type SearchOpQuery = 'search/v1'
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-affilate-program",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for simple affiliate program",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-correios",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for Correios shipping calculation",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-custom-payment",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for simple custom payment methods",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-custom-shipping",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for custom shipping methods",
6
6
  "main": "lib/custom-shipping.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-datafrete",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Datafrete shipping gateway ",
6
6
  "main": "lib/datafrete.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-discounts",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for complex discount rules",
6
6
  "main": "lib/discounts.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-emails",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce default transactional email app",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-fb-conversions",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to send carts/orders to Facebook Conversions API",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-flash-courier",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Flash Courier",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-frenet",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for Frenet shipping calculation",
6
6
  "main": "lib/frenet.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-galaxpay",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Galax Pay for recurring payments",
6
6
  "main": "lib/galaxpay.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-google-analytics",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to send carts/orders events to GA Measurement Protocol",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-jadlog",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for Jadlog shipping calculation",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-loyalty-points",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to handle simple loyalty points programs",
6
6
  "main": "lib/loyalty-points.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-mandae",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Mandaê shipping intermediator",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-melhor-envio",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Melhor Envio",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-mercadopago",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Mercado Pago",
6
6
  "main": "lib/mercadopago.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pagarme",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pagar.me",
6
6
  "main": "lib/pagarme.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pagarme-v5",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pagar.me API v5 with recurring payments",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-paghiper",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate PagHiper",
6
6
  "main": "lib/paghiper.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pix",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pix API (Bacen)",
6
6
  "main": "lib/pix.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-tiny-erp",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for Tiny ERP",
6
6
  "main": "lib/tiny-erp.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-webhooks",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for general order webhooks",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,8 +1,11 @@
1
1
  rules_version = '2';
2
2
  service cloud.firestore {
3
3
  match /databases/{database}/documents {
4
+ match /forms/p/{form}/{document=*} {
5
+ allow create;
6
+ }
4
7
  match /{document=**} {
5
8
  allow read, write: if false;
6
9
  }
7
10
  }
8
- }
11
+ }
@@ -1,8 +1,9 @@
1
1
  import { fileURLToPath } from 'node:url';
2
- import path from 'node:path';
2
+ import { join as joinPath } from 'node:path';
3
3
  import {
4
4
  $, argv, fs, echo, chalk,
5
5
  } from 'zx';
6
+ import Deepmerge from '@fastify/deepmerge';
6
7
  import login from './login.js';
7
8
  import build, { prepareCodebases } from './build.js';
8
9
  import { siginGcloudAndSetIAM, createServiceAccountKey } from './setup-gcloud.js';
@@ -15,13 +16,13 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url));
15
16
  const pwd = process.cwd();
16
17
  let projectId = FIREBASE_PROJECT_ID;
17
18
  if (projectId) {
18
- if (!fs.existsSync(path.join(pwd, '.firebaserc'))) {
19
- fs.writeFileSync(path.join(pwd, '.firebaserc'), JSON.stringify({ projects: { default: projectId } }, null, 2));
19
+ if (!fs.existsSync(joinPath(pwd, '.firebaserc'))) {
20
+ fs.writeFileSync(joinPath(pwd, '.firebaserc'), JSON.stringify({ projects: { default: projectId } }, null, 2));
20
21
  }
21
22
  } else {
22
23
  if (GOOGLE_APPLICATION_CREDENTIALS) {
23
24
  try {
24
- const gac = fs.readJSONSync(path.join(pwd, GOOGLE_APPLICATION_CREDENTIALS));
25
+ const gac = fs.readJSONSync(joinPath(pwd, GOOGLE_APPLICATION_CREDENTIALS));
25
26
  projectId = gac.project_id;
26
27
  } catch (e) {
27
28
  //
@@ -29,7 +30,7 @@ if (projectId) {
29
30
  }
30
31
  if (!projectId) {
31
32
  try {
32
- const firebaserc = fs.readJSONSync(path.join(pwd, '.firebaserc'));
33
+ const firebaserc = fs.readJSONSync(joinPath(pwd, '.firebaserc'));
33
34
  projectId = firebaserc.projects.default;
34
35
  } catch (e) {
35
36
  projectId = 'ecom2-demo';
@@ -38,7 +39,27 @@ if (projectId) {
38
39
  }
39
40
 
40
41
  export default async () => {
41
- await fs.copy(path.join(__dirname, '..', 'config'), pwd);
42
+ const baseConfigDir = joinPath(__dirname, '..', 'config');
43
+ await fs.copy(baseConfigDir, pwd);
44
+ const userConfigDir = joinPath(pwd, 'conf');
45
+ if (fs.existsSync(userConfigDir) && fs.lstatSync(userConfigDir).isDirectory()) {
46
+ await fs.copy(userConfigDir, pwd);
47
+ const userFirebaseJsonPath = joinPath(userConfigDir, 'firebase.json');
48
+ if (fs.existsSync(userFirebaseJsonPath)) {
49
+ let userFirebaseConfig;
50
+ try {
51
+ userFirebaseConfig = JSON.parse(fs.readFileSync(userFirebaseJsonPath, 'utf8'));
52
+ } catch {
53
+ //
54
+ }
55
+ if (userFirebaseConfig) {
56
+ const deepmerge = Deepmerge();
57
+ const baseFirebaseConfig = JSON.parse(fs.readFileSync(joinPath(baseConfigDir, 'firebase.json'), 'utf8'));
58
+ const mergedConfig = deepmerge(baseFirebaseConfig, userFirebaseConfig);
59
+ fs.writeFileSync(joinPath(pwd, 'firebase.json'), JSON.stringify(mergedConfig, null, 2));
60
+ }
61
+ }
62
+ }
42
63
  const options = [];
43
64
  Object.keys(argv).forEach((key) => {
44
65
  if (key !== '_' && argv[key] !== false) {
@@ -86,7 +107,7 @@ ${chalk.bold('npx kill-port 4000 9099 5001 8080 5000 8085 9199 4400 4500')}
86
107
  }
87
108
  if (argv._.includes('setup')) {
88
109
  const { storeId, authenticationId, apiKey } = await login();
89
- await fs.writeFile(path.join(pwd, 'functions', '.env'), `ECOM_AUTHENTICATION_ID=${authenticationId}
110
+ await fs.writeFile(joinPath(pwd, 'functions', '.env'), `ECOM_AUTHENTICATION_ID=${authenticationId}
90
111
  ECOM_API_KEY=${apiKey}
91
112
  ECOM_STORE_ID=${storeId}
92
113
  `);
@@ -94,7 +115,7 @@ ECOM_STORE_ID=${storeId}
94
115
  await $firebase('deploy');
95
116
  }
96
117
  if (argv.commit !== false) {
97
- await fs.writeFile(path.join(pwd, 'functions', 'config.json'), JSON.stringify({ storeId }, null, 2));
118
+ await fs.writeFile(joinPath(pwd, 'functions', 'config.json'), JSON.stringify({ storeId }, null, 2));
98
119
  await build(argv.codebase);
99
120
  try {
100
121
  await $`git add .firebaserc functions/config.json`;
@@ -150,7 +171,7 @@ Finish by saving the following secrets to your GitHub repository:
150
171
  }
151
172
  if (argv._.includes('dev') || !argv._.length) {
152
173
  await prepareCodebases(true);
153
- const prefix = path.join(pwd, 'functions/ssr');
174
+ const prefix = joinPath(pwd, 'functions/ssr');
154
175
  // https://docs.astro.build/en/reference/cli-reference/#astro-dev
155
176
  const host = typeof argv.host === 'string' ? argv.host : '';
156
177
  const port = typeof argv.port === 'string' || typeof argv.port === 'number' ? argv.port : '';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.38.0",
5
5
  "description": "E-Com Plus Cloud Commerce CLI tools",
6
6
  "bin": {
7
7
  "cloudcommerce": "./bin/run.mjs"
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@cloudcommerce/api": "workspace:*",
30
+ "@fastify/deepmerge": "^1.3.0",
30
31
  "libsodium-wrappers": "^0.7.13",
31
32
  "md5": "^2.3.0",
32
33
  "typescript": "~5.2.2",