@viur/shop-components 0.0.1-dev.58 → 0.0.1-dev.60

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 (86) hide show
  1. package/.editorconfig +16 -0
  2. package/.github/workflows/npm-publish.yml +42 -0
  3. package/.gitmodules +3 -0
  4. package/LICENSE +21 -0
  5. package/README.md +13 -2
  6. package/package.json +19 -32
  7. package/src/components/ShopCart.vue +512 -0
  8. package/src/components/ShopOrderComplete.vue +73 -0
  9. package/src/components/ShopOrderConfirm.vue +291 -0
  10. package/src/components/ShopOrderStepper.vue +264 -0
  11. package/src/components/ShopUserData.vue +232 -0
  12. package/src/components/cart/CartLeaf.vue +277 -0
  13. package/src/components/cart/CartLeafModel.vue +304 -0
  14. package/src/components/cart/CartNode.vue +25 -0
  15. package/src/components/cart/CartTree.vue +54 -0
  16. package/src/components/cart/CartTreeWrapper.vue +73 -0
  17. package/src/components/cart/CartView.vue +723 -0
  18. package/src/components/cart/Discount.vue +91 -0
  19. package/src/components/lib/utils.js +0 -0
  20. package/src/components/order/OrderSidebar.vue +102 -0
  21. package/src/components/order/category/CategoryList.vue +83 -0
  22. package/src/components/order/category/CategoryView.vue +143 -0
  23. package/src/components/order/information/adress/ShippingAdress.vue +143 -0
  24. package/src/components/order/item/ItemCard.vue +168 -0
  25. package/src/components/order/item/ItemView.vue +232 -0
  26. package/src/components/order/process/ConfirmView.vue +312 -0
  27. package/src/components/order/process/ExampleUsage.vue +113 -0
  28. package/src/components/order/process/OrderTabHeader.vue +16 -0
  29. package/src/components/order/process/SelectPaymentProvider.vue +62 -0
  30. package/src/components/order/process/Shipping.vue +46 -0
  31. package/src/components/ui/ShopSummary.vue +145 -0
  32. package/src/components/ui/generic/ArticleList.vue +222 -0
  33. package/src/components/ui/generic/ExamplePagination.vue +236 -0
  34. package/src/components/ui/generic/ShopPriceFormatter.vue +41 -0
  35. package/src/components/ui/generic/alerts/ShopAlert.vue +19 -0
  36. package/src/components/ui/generic/makeData.js +39 -0
  37. package/src/components/ui/stepper/StepperItem.vue +39 -0
  38. package/src/components/ui/stepper/StepperTab.vue +133 -0
  39. package/src/components/ui/stepper/StepperTrigger.vue +35 -0
  40. package/src/components/ui/userdata/AddForm.vue +125 -0
  41. package/src/components/ui/userdata/AddressBox.vue +117 -0
  42. package/src/components/ui/userdata/BaseLayout.vue +94 -0
  43. package/src/components/ui/userdata/CustomBooleanBone.vue +58 -0
  44. package/src/components/ui/userdata/CustomSelectBone.vue +91 -0
  45. package/src/components/ui/userdata/CustomStringBone.vue +71 -0
  46. package/src/components/ui/userdata/DefaultLayout.vue +126 -0
  47. package/src/components/ui/userdata/SelectAddress.vue +21 -0
  48. package/src/components/ui/userdata/multi/ActionBar.vue +38 -0
  49. package/src/components/ui/userdata/multi/CartSelection.vue +42 -0
  50. package/src/main.js +50 -0
  51. package/src/router/index.js +103 -0
  52. package/src/stores/cart.js +336 -0
  53. package/src/style/ignite/.editorconfig +20 -0
  54. package/src/style/ignite/.github/workflows/ignite.yml +64 -0
  55. package/src/style/ignite/.github/workflows/node.yml +30 -0
  56. package/src/style/ignite/.postcssrc.cjs +25 -0
  57. package/src/style/ignite/CHANGELOG.md +244 -0
  58. package/src/style/ignite/LICENSE +21 -0
  59. package/src/style/ignite/README.md +92 -0
  60. package/src/style/ignite/dist/ignite.css +2019 -0
  61. package/src/style/ignite/dist/ignite.min.css +4 -0
  62. package/src/style/ignite/foundation/basic.css +371 -0
  63. package/src/style/ignite/foundation/color.css +323 -0
  64. package/src/style/ignite/foundation/config.css +188 -0
  65. package/src/style/ignite/foundation/grid.css +78 -0
  66. package/src/style/ignite/foundation/mediaqueries.css +71 -0
  67. package/src/style/ignite/foundation/reset.css +261 -0
  68. package/src/style/ignite/ignite.css +29 -0
  69. package/src/style/ignite/ignite.css.map +1 -0
  70. package/src/style/ignite/package-lock.json +5530 -0
  71. package/src/style/ignite/package.json +58 -0
  72. package/src/style/ignite/shoelace.css +19 -0
  73. package/src/style/ignite/themes/dark.css +12 -0
  74. package/src/style/ignite/themes/light.css +11 -0
  75. package/src/style/ignite/utilities/shoelace.css +537 -0
  76. package/src/style/ignite/utilities/utilities.css +24 -0
  77. package/src/views/ViewMissing.vue +20 -0
  78. package/vite.config.js +53 -0
  79. package/dist/CategoryView-Z-tCFNv1.mjs +0 -60
  80. package/dist/ItemCard-CVfih_bz.mjs +0 -64
  81. package/dist/ItemView-cjeQBSTR.mjs +0 -1848
  82. package/dist/ItemView.css +0 -1
  83. package/dist/main-CZfMYx-A.mjs +0 -3167
  84. package/dist/main.css +0 -1
  85. package/dist/viur-shop-components.es.js +0 -10
  86. package/dist/viur-shop-components.umd.js +0 -417
package/src/main.js ADDED
@@ -0,0 +1,50 @@
1
+ // imports
2
+ import { createPinia } from "pinia";
3
+ import { createI18n } from "vue-i18n";
4
+ import {
5
+ de_translations,
6
+ en_translations,
7
+ } from "@viur/vue-components/translations/translations";
8
+
9
+ import { useCartStore } from "./stores/cart";
10
+ import createRouterInstance from "./router/index";
11
+ import CartNode from "./components/cart/CartNode.vue";
12
+ import CartLeaf from "./components/cart/CartLeaf.vue";
13
+ // import { createApp } from "vue";
14
+ // import bone from "@viur/vue-utils/bones/edit/bone.vue";
15
+ // import Wrapper_nested from "@viur/vue-utils/bones/edit/wrapper_nested.vue";
16
+
17
+ export { useCartStore, createRouterInstance };
18
+
19
+ // export all main components
20
+ export { default as ShopOrderStepper } from "./components/ShopOrderStepper.vue";
21
+ export { default as ShopUserData } from "./components/ShopUserData.vue";
22
+
23
+ export { default as CartView } from "./components/cart/CartView.vue";
24
+ export { default as ExampleUsage } from "./components/order/process/ExampleUsage.vue";
25
+ export { default as ConfirmView } from "./components/ShopOrderConfirm.vue";
26
+ export { default as OrderComplete } from "./components/ShopOrderComplete.vue";
27
+ // export { default as UserInformation } from "./components/order/information/UserInformation.vue";
28
+ // export { default as UserInfoMulti } from "./components/order/information/UserInfoMulti.vue";
29
+ export { default as SelectPaymentProvider } from "./components/order/process/SelectPaymentProvider.vue";
30
+
31
+ const pinia = createPinia();
32
+ const i18n = createI18n({
33
+ locale: "de",
34
+ fallbackLocale: "en",
35
+ messages: {
36
+ en: { ...en_translations },
37
+ de: { ...de_translations },
38
+ },
39
+ });
40
+
41
+ // Create a plugin to install all components
42
+ const ViurShopComponents = {
43
+ install(app) {
44
+ app.use(pinia);
45
+ app.use(i18n);
46
+ },
47
+ };
48
+
49
+ // Export the plugin as default
50
+ export default ViurShopComponents;
@@ -0,0 +1,103 @@
1
+ // @ts-nocheck
2
+ import { createRouter, createWebHashHistory } from "vue-router";
3
+ import ViewMissing from "../views/ViewMissing.vue";
4
+
5
+ const default_routes = [
6
+ {
7
+ path: "/:pathMatch(.*)*",
8
+ name: "view_missing",
9
+ component: ViewMissing,
10
+ },
11
+ {
12
+ path: "/shop/category/:identifier",
13
+ name: "CategoryView",
14
+ component: () => import("../components/order/category/CategoryView.vue"),
15
+ },
16
+ {
17
+ path: "/shop/item/:item",
18
+ name: "itemView",
19
+ component: () => import("../components/order/item/ItemView.vue"),
20
+ },
21
+ {
22
+ path: "/shop/cart/view",
23
+ name: "CartView",
24
+ component: () => import("../components/cart/CartView.vue"),
25
+ },
26
+ {
27
+ path: "/shop/order/",
28
+ name: "OrderView",
29
+ component: () => import("../components/order/process/ExampleUsage.vue"),
30
+ },
31
+ {
32
+ path: "/shop/order/confirm",
33
+ name: "ConfirmView",
34
+ component: () => import("../components/ShopOrderConfirm.vue"),
35
+ },
36
+ ];4
37
+
38
+ function createRouterInstance(routes, replace = false) {
39
+ let newRoutes = [];
40
+ if (replace) {
41
+ newRoutes = routes;
42
+ } else {
43
+ newRoutes = routes.concat(default_routes);
44
+ }
45
+
46
+ const router = createRouter({
47
+ // @ts-ignore
48
+ history: createWebHashHistory(import.meta.env.BASE_URL),
49
+ routes: newRoutes,
50
+ });
51
+
52
+ // router.afterEach((to, from) => {
53
+ // //useUserStore().addAction();
54
+ // });
55
+
56
+ // router.beforeEach((to, from, next) => {
57
+ // const contextStore = useContextStore();
58
+ // let localContext = {};
59
+ // let handlerId = to.query["_"]?.toString();
60
+ // if (!handlerId) next();
61
+ // if (Object.keys(contextStore.state.localContext).includes(handlerId)) {
62
+ // localContext = contextStore.state.localContext[handlerId];
63
+ // }
64
+ // let newQuery = {
65
+ // ...contextStore.state.globalContext,
66
+ // ...localContext,
67
+ // ...to.query,
68
+ // };
69
+ // if (
70
+ // Object.keys(to.query).every(
71
+ // (key) =>
72
+ // to.query[key] === newQuery[key] &&
73
+ // to.query.hasOwnProperty(key) &&
74
+ // newQuery.hasOwnProperty(key),
75
+ // ) &&
76
+ // Object.keys(newQuery).every(
77
+ // (key) =>
78
+ // to.query[key] === newQuery[key] &&
79
+ // to.query.hasOwnProperty(key) &&
80
+ // newQuery.hasOwnProperty(key),
81
+ // )
82
+ // ) {
83
+ // //disabled because of to much context copy and updates
84
+ // // Writes query to context
85
+ // /*
86
+ // for (const [k, v] of Object.entries(to.query)) {
87
+ // if (k.startsWith("_")) continue
88
+ // if (Object.keys(contextStore.state.localContext).includes(handlerId)) {
89
+ // contextStore.state.localContext[handlerId][k] = v
90
+ // } else {
91
+ // contextStore.state.localContext[handlerId] = { [k]: v }
92
+ // }
93
+ // }*/
94
+ // next(); // no change
95
+ // } else {
96
+ // to.query = newQuery;
97
+ // next(to);
98
+ // }
99
+ // });
100
+ return router;
101
+ }
102
+
103
+ export default createRouterInstance;
@@ -0,0 +1,336 @@
1
+ import { reactive, computed, watch } from "vue";
2
+ import { defineStore } from "pinia";
3
+ import { ViURShopClient } from "@viur/viur-shop-client";
4
+
5
+ export const useCartStore = defineStore("cartstore", () => {
6
+ const shopClient = new ViURShopClient({
7
+ host_url:
8
+ window.location.origin === "http://localhost:8081"
9
+ ? "http://localhost:8080"
10
+ : window.location.origin,
11
+ });
12
+ let isFetching = false;
13
+ const waitForFetching = [];
14
+ const waitForFetchingResolver = [];
15
+ const state = reactive({
16
+ basketRootNode: {},
17
+ basket: [],
18
+ wishlistRootNodes: [],
19
+ childrenByNode: {},
20
+ structure: { address: {}, cart: {} },
21
+ paymentProviders: {},
22
+ billingAddressList: [],
23
+ shippingAddressList: [],
24
+ cloneBilling: true,
25
+ activeBillingAddress: {},
26
+ activeShippingAddress: {},
27
+ selectedPaymentProvider: {},
28
+ selectedPaymentProviderName: "",
29
+ customer: {},
30
+ isLoggedIn: false,
31
+ placeholder: "",
32
+ });
33
+
34
+ async function init(placeholder = "") {
35
+ if (!isFetching) {
36
+ isFetching = true;
37
+ await getRootNodes();
38
+ await getCustomer();
39
+ await getAddress();
40
+ await getBasket();
41
+
42
+ isFetching = false;
43
+ for (const waiter of waitForFetchingResolver) {
44
+ waiter();
45
+ }
46
+ waitForFetchingResolver.splice(0, waitForFetchingResolver.length);
47
+ waitForFetching.splice(0, waitForFetchingResolver.length);
48
+ } else {
49
+ const p = new Promise((resolve, reject) => {
50
+ waitForFetchingResolver.push(resolve);
51
+ });
52
+ waitForFetching.push(p);
53
+ return p;
54
+ }
55
+ state.placeholder = placeholder;
56
+ }
57
+
58
+ async function getCustomer() {
59
+ try {
60
+ const resp = await shopClient.user_view();
61
+ state.customer = resp;
62
+ state.isLoggedIn = true;
63
+ } catch (e) {
64
+ state.isLoggedIn = false;
65
+ }
66
+
67
+ console.log("passiert", state.customer);
68
+ }
69
+ async function getBasket() {
70
+ state.basket = await shopClient.basket_list();
71
+ }
72
+
73
+ async function getChildren(parentKey) {
74
+ return await shopClient.cart_list({ cart_key: parentKey });
75
+ }
76
+
77
+ async function getRootNodes() {
78
+ let resp = await shopClient.cart_list();
79
+
80
+ resp.forEach(async (rootNode) => {
81
+ if (rootNode.is_root_node) {
82
+ if (rootNode.cart_type === "basket") {
83
+ state.basketRootNode = rootNode;
84
+ const rootChildren = await getChildren(rootNode.key);
85
+ state.childrenByNode[rootNode.key] = rootChildren;
86
+ } else {
87
+ state.whishlistRootNodes.push(rootNode);
88
+ }
89
+ }
90
+ });
91
+ }
92
+
93
+ async function addToCart(articleKey, cartKey) {
94
+ let resp = await shopClient.article_add({
95
+ article_key: articleKey,
96
+ parent_cart_key: cartKey,
97
+ });
98
+
99
+ // await updateCart(cartKey);
100
+ console.log("addToCart", resp); //TODO: Errorhandling as soon as shop module works again
101
+ }
102
+
103
+ async function getArticleView(articleKey, cartKey) {
104
+ let article = await shopClient.article_view({
105
+ article_key: articleKey,
106
+ parent_cart_key: cartKey,
107
+ });
108
+
109
+ console.log("getArticleView", article); // ? Talk about necessarity
110
+ }
111
+
112
+ async function removeItem(articleKey, cartKey) {
113
+ let resp = await shopClient.article_remove({
114
+ article_key: articleKey,
115
+ parent_cart_key: cartKey,
116
+ });
117
+
118
+ console.log("remove Resp", resp); //TODO: Errorhandling as soon as shop module works again
119
+ }
120
+
121
+ async function updateItem(articleKey, cartKey, quantity) {
122
+ const resp = await shopClient.article_update({
123
+ article_key: articleKey,
124
+ parent_cart_key: cartKey,
125
+ quantity: quantity,
126
+ quantity_mode: "replace",
127
+ });
128
+
129
+ console.log("update Resp", resp); //TODO: Errorhandling as soon as shop module works again
130
+ }
131
+
132
+ // async function updateCart(cartKey) {
133
+ // await getChildren(cartKey);
134
+ // }
135
+
136
+ async function getAddressStructure() {
137
+ const structure = await shopClient.address_structure();
138
+ state.structure.address = struct2dict(structure.addSkel);
139
+ }
140
+
141
+ function getDefaultAddress() {
142
+ if (!!state.billingAddressList) {
143
+ state.billingAddressList.forEach((address) => {
144
+ if (address.is_default) {
145
+ state.activeBillingAddress = address;
146
+ }
147
+ });
148
+ } else {
149
+ state.activeBillingAddress = setAddressValues("billing");
150
+ }
151
+ if (!!state.shippingAddressList) {
152
+ state.shippingAddressList.forEach((address) => {
153
+ if (address.is_default && !state.cloneBilling) {
154
+ state.activeShippingAddress = address;
155
+ }
156
+ });
157
+ } else {
158
+ if (state.cloneBilling) {
159
+ state.activeShippingAddress = { ...state.activeBillingAddress };
160
+ } else {
161
+ state.activeShippingAddress = setAddressValues("shipping");
162
+ }
163
+ }
164
+ }
165
+
166
+ function setAddressValues(mode) {
167
+ let structure = state.structure.address;
168
+ let skel = {};
169
+
170
+ Object.entries(structure).forEach(([boneName, boneValue]) => {
171
+ if (boneName === "customer") {
172
+ skel[boneName] = state.customer.key;
173
+ } else if (boneName === "address_type") {
174
+ skel[boneName] = mode;
175
+ } else {
176
+ skel[boneName] = boneValue.emptyvalue;
177
+ }
178
+ });
179
+
180
+ return skel;
181
+ }
182
+
183
+ async function getAddress() {
184
+ if (!state.isLoggedIn) {
185
+ return;
186
+ }
187
+ try {
188
+ const addressList = await shopClient.address_list();
189
+ } catch (e) {
190
+ console.log("error", e);
191
+ return;
192
+ }
193
+
194
+ const addressList = await shopClient.address_list();
195
+ state.billingAddressList = [];
196
+ state.shippingAddressList = [];
197
+
198
+ for (const address of addressList) {
199
+ if (address.address_type === "billing") {
200
+ console.log("add to bill address ?", address);
201
+ state.billingAddressList.push(address);
202
+ }
203
+ if (address.address_type === "shipping") {
204
+ state.shippingAddressList.push(address);
205
+ }
206
+ }
207
+
208
+ getDefaultAddress();
209
+ }
210
+
211
+ async function addDiscount(code) {
212
+ await shopClient.discount_add({ code });
213
+ }
214
+
215
+ async function addNode(
216
+ parentCart,
217
+ cartType = "whishlist",
218
+ cartName = undefined,
219
+ comment = undefined,
220
+ shipping_key = undefined,
221
+ shipping_address_key = undefined,
222
+ discount_key = undefined,
223
+ ) {
224
+ return await shopClient.cart_add({
225
+ parent_cart_key: parentCart,
226
+ // cart_type: cartType, // "basket" for main cart, "whishlist" for everything else
227
+ // name: cartName,
228
+ // customer_comment: comment,
229
+ // shipping_address_key: shipping_address_key,
230
+ // shipping_key: shipping_key,
231
+ // discount_key: discount_key,
232
+ });
233
+ }
234
+
235
+ async function getShippingData() {
236
+ return await shopClient.shipping_list({
237
+ cart_key: state.basketRootNode.key,
238
+ });
239
+ }
240
+ async function setShiping() {
241
+ return await shopClient.shipping_set();
242
+ }
243
+
244
+ async function getPaymentProviders() {
245
+ const paymentProvieders = await shopClient.payment_providers_list();
246
+ state.paymentProviders = paymentProvieders;
247
+ //select first paymentprovider as default
248
+ state.selectedPaymentProvider =
249
+ paymentProvieders[Object.keys(paymentProvieders)[0]];
250
+ state.selectedPaymentProviderName = Object.keys(paymentProvieders)[0];
251
+ }
252
+
253
+ function struct2dict(structure) {
254
+ if (!Array.isArray(structure)) {
255
+ return structure;
256
+ }
257
+
258
+ let result = {};
259
+ structure.forEach((bone) => (result[bone[0]] = bone[1]));
260
+
261
+ return result;
262
+ }
263
+
264
+ async function orderAdd() {
265
+ const order = await shopClient.order_add({
266
+ cart_key: state.basketRootNode.key,
267
+ payment_provider: state.selectedPaymentProviderName,
268
+ billing_address_key: state.activeBillingAddress["key"],
269
+ customer_key: state.customer["key"],
270
+ });
271
+ return order;
272
+ }
273
+ async function setShipping() {
274
+ const shipping_skel = shopClient;
275
+ }
276
+
277
+ watch(
278
+ () => state.activeBillingAddress,
279
+ (newValue, oldValue) => {
280
+ if (oldValue) {
281
+ const isAddress = (address) => address.key === newValue.key;
282
+
283
+ let index = state.billingAddressList.findIndex(isAddress);
284
+
285
+ state.billingAddressList[index] = newValue;
286
+ }
287
+ if (state.cloneBilling) {
288
+ state.activeShippingAddress = newValue;
289
+ }
290
+ },
291
+ );
292
+
293
+ watch(
294
+ () => state.activeShippingAddress,
295
+ (newValue, oldValue) => {
296
+ if (oldValue) {
297
+ const isAddress = (address) => address.key === newValue.key;
298
+
299
+ let index = state.shippingAddressList.findIndex(isAddress);
300
+
301
+ state.shippingAddressList[index] = newValue;
302
+ }
303
+ },
304
+ );
305
+
306
+ watch(
307
+ () => state.cloneBilling,
308
+ (newValue, oldValue) => {
309
+ if (newValue) {
310
+ let temp = { ...state.activeBillingAddress };
311
+ temp.address_type = "shipping";
312
+ state.activeShippingAddress = { ...temp };
313
+ }
314
+ },
315
+ );
316
+
317
+ return {
318
+ state,
319
+ addToCart,
320
+ getArticleView,
321
+ removeItem,
322
+ updateItem,
323
+ init,
324
+ getAddressStructure,
325
+ getChildren,
326
+ addDiscount,
327
+ getPaymentProviders,
328
+ getAddress,
329
+ addNode,
330
+ getShippingData,
331
+ getDefaultAddress,
332
+ orderAdd,
333
+ getBasket,
334
+ setShiping,
335
+ };
336
+ });
@@ -0,0 +1,20 @@
1
+ # editorconfig.org
2
+ # source: https://gist.github.com/sveneberth/b30d6639067177a31b5ab68af63a23e9
3
+
4
+ root = true
5
+
6
+ [*]
7
+ indent_style = tab
8
+ tab_width = 4
9
+ end_of_line = lf
10
+ charset = utf-8
11
+ trim_trailing_whitespace = true
12
+ insert_final_newline = true
13
+ max_line_length = 120
14
+
15
+ [*.{css,less,yml,yaml,json}]
16
+ indent_style = space
17
+ indent_size = 2
18
+
19
+ [*.md]
20
+ trim_trailing_whitespace = false
@@ -0,0 +1,64 @@
1
+ name: Build Ignite
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v5.*"
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+
12
+ strategy:
13
+ matrix:
14
+ node-version: [16.x]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ with:
19
+ submodules: true
20
+ path: "app/sources"
21
+
22
+ - name: Use Node.js ${{ matrix.node-version }}
23
+ uses: actions/setup-node@v2
24
+ with:
25
+ node-version: ${{ matrix.node-version }}
26
+ cache: 'npm'
27
+ cache-dependency-path: 'package-lock.json'
28
+ - run: npm install
29
+ - run: npm run build
30
+ - uses: actions/upload-artifact@master
31
+ with:
32
+ name: buildfiles
33
+ path: dist
34
+
35
+
36
+ release:
37
+ runs-on: ubuntu-latest
38
+ needs: [ build ]
39
+
40
+ steps:
41
+ - name: Checkout code
42
+ uses: actions/checkout@v2
43
+
44
+ - uses: actions/download-artifact@master
45
+ with:
46
+ name: buildfiles
47
+ path: ./dist
48
+
49
+ - name: archive
50
+ run: cd ./dist && zip viur-ignite.zip -r ./*
51
+
52
+ - name: Get version from tag
53
+ id: tag_name
54
+ run: |
55
+ echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
56
+
57
+ - name: create release
58
+ uses: softprops/action-gh-release@v1
59
+ with:
60
+ files: ./dist/viur-ignite.zip
61
+ env:
62
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63
+
64
+
@@ -0,0 +1,30 @@
1
+ name: Node.js CI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v5.*"
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+
12
+ strategy:
13
+ matrix:
14
+ node-version: [16.x]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ with:
19
+ submodules: true
20
+ - name: Use Node.js ${{ matrix.node-version }}
21
+ uses: actions/setup-node@v2
22
+ with:
23
+ node-version: ${{ matrix.node-version }}
24
+ cache: 'npm'
25
+ - run: npm install
26
+ - run: npm run build
27
+ - uses: JS-DevTools/npm-publish@v1
28
+ with:
29
+ access: "public"
30
+ token: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,25 @@
1
+ const enableBuild = process.env.mode === 'build'
2
+
3
+ module.exports = ({ ctx }) => ({
4
+ map: enableBuild ? false : 'inline',
5
+ plugins: {
6
+ 'postcss-discard-comments': enableBuild ? {} : false,
7
+ '@csstools/postcss-bundler': {},
8
+ 'postcss-preset-env': {
9
+ stage: 3,
10
+ minimumVendorImplementations: 2,
11
+ autoprefixer: {},
12
+ debug: true,
13
+ features: {
14
+ 'color-mix': true,
15
+ 'nesting-rules': true,
16
+ 'oklab-function': true,
17
+ //'cascade-layers': true,
18
+ 'custom-media-queries': true,
19
+ }
20
+ },
21
+ 'postcss-focus': {},
22
+ 'postcss-sort-media-queries': {},
23
+ 'cssnano': enableBuild ? {} : false,
24
+ }
25
+ })