Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use live workflows version #178

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions actions/charge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface Props {
value: number;
}

const sleep = (timeout: number) =>
new Promise((resolve) => setTimeout(resolve, timeout));
export default async function charge(
{ value }: Props,
) {
console.log("charging...", value);
await sleep(3000); // pretending some delay
console.log("Charged!");
return { value };
}
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"tasks": {
"start": "deno run -A --watch=tailwind.css,sections/,functions/,loaders/,actions/,workflows/,accounts/ dev.ts",
"gen": "deno run -A dev.ts --gen-only",
"start_local": "USE_LOCAL_STORAGE=true deno run -A --watch=sections/,functions/ dev.ts",
"component": "deno eval 'import \"$live/scripts/component.ts\"'",
"release": "deno eval 'import \"$live/scripts/release.ts\"'",
"update": "deno eval 'import \"$live/scripts/update.ts\"'",
Expand Down
4 changes: 2 additions & 2 deletions import_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"imports": {
"deco-sites/fashion/": "./",
"$store/": "./",
"deco-sites/std/": "https://denopkg.com/deco-sites/std@1.12.8/",
"$live/": "https://denopkg.com/deco-cx/live@1.19.1/",
"deco-sites/std/": "https://denopkg.com/deco-sites/std@1.12.9/",
"$live/": "https://denopkg.com/deco-cx/live@1.19.6/",
"$fresh/": "https://denopkg.com/deco-cx/fresh@1.3.0/",
"preact": "https://esm.sh/preact@10.15.1",
"preact/": "https://esm.sh/preact@10.15.1/",
Expand Down
92 changes: 49 additions & 43 deletions live.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ import * as $$$$$$$$20 from "./sections/Links/LinkTree.tsx";
import * as $$$$$$$$21 from "./sections/Links/Shortcuts.tsx";
import * as $$$$$$$$22 from "./sections/Newsletter/Newsletter.tsx";
import * as $$$$$$$$23 from "./sections/Header/Header.tsx";
import * as $$$$$$$$$$$0 from "./actions/charge.ts";
import * as $$$$$$$$$$$$0 from "./workflows/simple.ts";
import * as $live_workflows from "$live/routes/live/workflows/run.ts";
import * as $live_middleware from "$live/routes/_middleware.ts";
import * as $live_workbench from "$live/routes/live/workbench.ts";
import * as $live_invoke from "$live/routes/live/invoke/index.ts";
Expand Down Expand Up @@ -80,11 +83,10 @@ import * as i2$$$$$$$$9 from "$live/matchers/MatchUserAgent.ts";
import * as i2$$$$$$$$$0 from "$live/flags/audience.ts";
import * as i2$$$$$$$$$1 from "$live/flags/everyone.ts";
import * as i2$$$$$$$$$2 from "$live/flags/flag.ts";
import * as i1$$$$$$3 from "$live/flags/multivariate.ts";
import * as i2$$$$$$$$$3 from "$live/flags/multivariate.ts";
import * as i2$$$$$$0 from "$live/actions/workflows/cancel.ts";
import * as i2$$$$$$1 from "$live/actions/workflows/run.ts";
import * as i2$$$$$$2 from "$live/actions/workflows/signal.ts";
import * as i2$$$$$$3 from "$live/actions/workflows/start.ts";
import * as i2$$$$$$1 from "$live/actions/workflows/signal.ts";
import * as i2$$$$$$2 from "$live/actions/workflows/start.ts";
import * as i2$0 from "deco-sites/std/functions/butterCMSAds.ts";
import * as i2$1 from "deco-sites/std/functions/butterCMSBrands.ts";
import * as i2$2 from "deco-sites/std/functions/butterCMSCategories.ts";
Expand Down Expand Up @@ -147,22 +149,22 @@ import * as i2$$$$$12 from "deco-sites/std/sections/SEO.tsx";
import * as i2$$$$$13 from "deco-sites/std/sections/SEOPDP.tsx";
import * as i2$$$$$14 from "deco-sites/std/sections/SEOPLP.tsx";
import * as i2$$$$$15 from "deco-sites/std/sections/VTEXPortalDataLayerCompatibility.tsx";
import * as i2$$$$$$4 from "deco-sites/std/actions/vtex/cart/addItems.ts";
import * as i2$$$$$$5 from "deco-sites/std/actions/vtex/cart/getInstallment.ts";
import * as i2$$$$$$6 from "deco-sites/std/actions/vtex/cart/removeItemAttachment.ts";
import * as i2$$$$$$7 from "deco-sites/std/actions/vtex/cart/removeItems.ts";
import * as i2$$$$$$8 from "deco-sites/std/actions/vtex/cart/simulation.ts";
import * as i2$$$$$$9 from "deco-sites/std/actions/vtex/cart/updateAttachment.ts";
import * as i2$$$$$$10 from "deco-sites/std/actions/vtex/cart/updateCoupons.ts";
import * as i2$$$$$$11 from "deco-sites/std/actions/vtex/cart/updateItemAttachment.ts";
import * as i2$$$$$$12 from "deco-sites/std/actions/vtex/cart/updateItemPrice.ts";
import * as i2$$$$$$13 from "deco-sites/std/actions/vtex/cart/updateItems.ts";
import * as i2$$$$$$14 from "deco-sites/std/actions/vtex/cart/updateProfile.ts";
import * as i2$$$$$$15 from "deco-sites/std/actions/vtex/cart/updateUser.ts";
import * as i2$$$$$$16 from "deco-sites/std/actions/vtex/newsletter/subscribe.ts";
import * as i2$$$$$$17 from "deco-sites/std/actions/vtex/notifyme.ts";
import * as i2$$$$$$18 from "deco-sites/std/actions/vtex/wishlist/addItem.ts";
import * as i2$$$$$$19 from "deco-sites/std/actions/vtex/wishlist/removeItem.ts";
import * as i2$$$$$$3 from "deco-sites/std/actions/vtex/cart/addItems.ts";
import * as i2$$$$$$4 from "deco-sites/std/actions/vtex/cart/getInstallment.ts";
import * as i2$$$$$$5 from "deco-sites/std/actions/vtex/cart/removeItemAttachment.ts";
import * as i2$$$$$$6 from "deco-sites/std/actions/vtex/cart/removeItems.ts";
import * as i2$$$$$$7 from "deco-sites/std/actions/vtex/cart/simulation.ts";
import * as i2$$$$$$8 from "deco-sites/std/actions/vtex/cart/updateAttachment.ts";
import * as i2$$$$$$9 from "deco-sites/std/actions/vtex/cart/updateCoupons.ts";
import * as i2$$$$$$10 from "deco-sites/std/actions/vtex/cart/updateItemAttachment.ts";
import * as i2$$$$$$11 from "deco-sites/std/actions/vtex/cart/updateItemPrice.ts";
import * as i2$$$$$$12 from "deco-sites/std/actions/vtex/cart/updateItems.ts";
import * as i2$$$$$$13 from "deco-sites/std/actions/vtex/cart/updateProfile.ts";
import * as i2$$$$$$14 from "deco-sites/std/actions/vtex/cart/updateUser.ts";
import * as i2$$$$$$15 from "deco-sites/std/actions/vtex/newsletter/subscribe.ts";
import * as i2$$$$$$16 from "deco-sites/std/actions/vtex/notifyme.ts";
import * as i2$$$$$$17 from "deco-sites/std/actions/vtex/wishlist/addItem.ts";
import * as i2$$$$$$18 from "deco-sites/std/actions/vtex/wishlist/removeItem.ts";

const manifest = {
"routes": {
Expand All @@ -179,6 +181,7 @@ const manifest = {
"./routes/live/previews/index.tsx": $live_previews_index,
"./routes/live/release.ts": $live_release,
"./routes/live/workbench.ts": $live_workbench,
"./routes/live/workflows/run.ts": $live_workflows,
"./routes/styles.css.ts": $$$$0,
},
"islands": {
Expand Down Expand Up @@ -236,6 +239,31 @@ const manifest = {
"deco-sites/std/sections/SEOPLP.tsx": i2$$$$$14,
"deco-sites/std/sections/VTEXPortalDataLayerCompatibility.tsx": i2$$$$$15,
},
"actions": {
"$live/actions/workflows/cancel.ts": i2$$$$$$0,
"$live/actions/workflows/signal.ts": i2$$$$$$1,
"$live/actions/workflows/start.ts": i2$$$$$$2,
"deco-sites/fashion/actions/charge.ts": $$$$$$$$$$$0,
"deco-sites/std/actions/vtex/cart/addItems.ts": i2$$$$$$3,
"deco-sites/std/actions/vtex/cart/getInstallment.ts": i2$$$$$$4,
"deco-sites/std/actions/vtex/cart/removeItemAttachment.ts": i2$$$$$$5,
"deco-sites/std/actions/vtex/cart/removeItems.ts": i2$$$$$$6,
"deco-sites/std/actions/vtex/cart/simulation.ts": i2$$$$$$7,
"deco-sites/std/actions/vtex/cart/updateAttachment.ts": i2$$$$$$8,
"deco-sites/std/actions/vtex/cart/updateCoupons.ts": i2$$$$$$9,
"deco-sites/std/actions/vtex/cart/updateItemAttachment.ts": i2$$$$$$10,
"deco-sites/std/actions/vtex/cart/updateItemPrice.ts": i2$$$$$$11,
"deco-sites/std/actions/vtex/cart/updateItems.ts": i2$$$$$$12,
"deco-sites/std/actions/vtex/cart/updateProfile.ts": i2$$$$$$13,
"deco-sites/std/actions/vtex/cart/updateUser.ts": i2$$$$$$14,
"deco-sites/std/actions/vtex/newsletter/subscribe.ts": i2$$$$$$15,
"deco-sites/std/actions/vtex/notifyme.ts": i2$$$$$$16,
"deco-sites/std/actions/vtex/wishlist/addItem.ts": i2$$$$$$17,
"deco-sites/std/actions/vtex/wishlist/removeItem.ts": i2$$$$$$18,
},
"workflows": {
"deco-sites/fashion/workflows/simple.ts": $$$$$$$$$$$$0,
},
"loaders": {
"$live/loaders/state.ts": i2$$$0,
"$live/loaders/workflows/events.ts": i2$$$1,
Expand Down Expand Up @@ -289,29 +317,7 @@ const manifest = {
"$live/flags/audience.ts": i2$$$$$$$$$0,
"$live/flags/everyone.ts": i2$$$$$$$$$1,
"$live/flags/flag.ts": i2$$$$$$$$$2,
"$live/flags/multivariate.ts": i1$$$$$$3,
},
"actions": {
"$live/actions/workflows/cancel.ts": i2$$$$$$0,
"$live/actions/workflows/run.ts": i2$$$$$$1,
"$live/actions/workflows/signal.ts": i2$$$$$$2,
"$live/actions/workflows/start.ts": i2$$$$$$3,
"deco-sites/std/actions/vtex/cart/addItems.ts": i2$$$$$$4,
"deco-sites/std/actions/vtex/cart/getInstallment.ts": i2$$$$$$5,
"deco-sites/std/actions/vtex/cart/removeItemAttachment.ts": i2$$$$$$6,
"deco-sites/std/actions/vtex/cart/removeItems.ts": i2$$$$$$7,
"deco-sites/std/actions/vtex/cart/simulation.ts": i2$$$$$$8,
"deco-sites/std/actions/vtex/cart/updateAttachment.ts": i2$$$$$$9,
"deco-sites/std/actions/vtex/cart/updateCoupons.ts": i2$$$$$$10,
"deco-sites/std/actions/vtex/cart/updateItemAttachment.ts": i2$$$$$$11,
"deco-sites/std/actions/vtex/cart/updateItemPrice.ts": i2$$$$$$12,
"deco-sites/std/actions/vtex/cart/updateItems.ts": i2$$$$$$13,
"deco-sites/std/actions/vtex/cart/updateProfile.ts": i2$$$$$$14,
"deco-sites/std/actions/vtex/cart/updateUser.ts": i2$$$$$$15,
"deco-sites/std/actions/vtex/newsletter/subscribe.ts": i2$$$$$$16,
"deco-sites/std/actions/vtex/notifyme.ts": i2$$$$$$17,
"deco-sites/std/actions/vtex/wishlist/addItem.ts": i2$$$$$$18,
"deco-sites/std/actions/vtex/wishlist/removeItem.ts": i2$$$$$$19,
"$live/flags/multivariate.ts": i2$$$$$$$$$3,
},
"functions": {
"deco-sites/std/functions/butterCMSAds.ts": i2$0,
Expand Down
1 change: 1 addition & 0 deletions runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ import { withManifest } from "$live/clients/withManifest.ts";
import type { Manifest } from "./live.gen.ts";

export const Runtime = withManifest<Manifest>();

Loading