Skip to content

Commit

Permalink
fix blocks (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlgimenes authored Feb 8, 2024
1 parent 6834158 commit 564fcd0
Show file tree
Hide file tree
Showing 21 changed files with 564 additions and 531 deletions.
17 changes: 17 additions & 0 deletions admin/loaders/blocks/get.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { AppContext } from "../../mod.ts";
import { Props, Returns } from "../releases/get.ts";

const loader = async (
props: Props,
_req: Request,
ctx: AppContext,
): Promise<Returns["blocks"] | null> => {
const release = await ctx.invoke(
"deco-sites/admin/loaders/releases/get.ts",
props,
);

return release?.blocks ?? null;
};

export default loader;
24 changes: 19 additions & 5 deletions admin/loaders/releases/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { fetchState } from "../../actions/releases/fork.ts";
import { AppContext } from "../../mod.ts";
import { State } from "../../types.ts";

interface Props {
export interface Props {
/** Site name */
site: string;
/** Environment name */
Expand All @@ -11,15 +11,29 @@ interface Props {
revision?: string;
}

export interface Returns {
site: string;
name?: string;
blocks: State["decofile"];
revision: State["revision"];
revisions: unknown;
}

/** TODO(@gimenes): Implement fetching the state from the proper environment name */
const loader = async (
_props: Props,
props: Props,
_req: Request,
ctx: AppContext,
): Promise<State["decofile"]> => {
const { decofile } = await fetchState(ctx.release());
): Promise<Returns> => {
const state = await fetchState(ctx.release());

return decofile;
return {
site: props.site,
name: props.name,
blocks: state.decofile,
revision: state.revision,
revisions: {},
};
};

export default loader;
122 changes: 62 additions & 60 deletions admin/manifest.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,73 @@
// This file SHOULD be checked into source version control.
// This file is automatically updated during development when running `dev.ts`.

import * as $$$0 from "./loaders/assistants/code.ts";
import * as $$$1 from "./loaders/blocks/latest.ts";
import * as $$$2 from "./loaders/blocks/listRevisions.ts";
import * as $$$3 from "./loaders/blocks/published.ts";
import * as $$$4 from "./loaders/blocks/revision.ts";
import * as $$$5 from "./loaders/deploy.ts";
import * as $$$6 from "./loaders/pages/list.ts";
import * as $$$7 from "./loaders/platforms/forSite.ts";
import * as $$$8 from "./loaders/releases/blocks.ts";
import * as $$$9 from "./loaders/releases/get.ts";
import * as $$$10 from "./loaders/state.ts";
import * as $$$$$$$$$0 from "./actions/blocks/delete.ts";
import * as $$$$$$$$$1 from "./actions/blocks/newRevision.ts";
import * as $$$$$$$$$2 from "./actions/blocks/publish.ts";
import * as $$$$$$$$$3 from "./actions/blocks/restore.ts";
import * as $$$$$$$$$4 from "./actions/blocks/safeDelete.ts";
import * as $$$$$$$$$5 from "./actions/code/suggestions.ts";
import * as $$$$$$$$$6 from "./actions/code/vision.ts";
import * as $$$$$$$$$7 from "./actions/deployments/create.ts";
import * as $$$$$$$$$8 from "./actions/github/setStatus.ts";
import * as $$$$$$$$$9 from "./actions/github/webhooks/broker.ts";
import * as $$$$$$$$$10 from "./actions/pages/delete.ts";
import * as $$$$$$$$$11 from "./actions/pages/new.ts";
import * as $$$$$$$$$12 from "./actions/pages/publish.ts";
import * as $$$$$$$$$13 from "./actions/platforms/assign.ts";
import * as $$$$$$$$$14 from "./actions/releases/fork.ts";
import * as $$$$$$$$$15 from "./actions/sites/create.ts";
import * as $$$$$$$$$16 from "./actions/sites/linkRepo.ts";
import * as $$$$$$$$$17 from "./actions/sites/newDomain.ts";
import * as $$$$$$$$$18 from "./actions/sites/unlinkRepo.ts";
import * as $$$0 from "./loaders/blocks/get.ts";
import * as $$$1 from "./loaders/blocks/revision.ts";
import * as $$$2 from "./loaders/blocks/published.ts";
import * as $$$3 from "./loaders/blocks/latest.ts";
import * as $$$4 from "./loaders/blocks/listRevisions.ts";
import * as $$$5 from "./loaders/state.ts";
import * as $$$6 from "./loaders/releases/get.ts";
import * as $$$7 from "./loaders/releases/blocks.ts";
import * as $$$8 from "./loaders/platforms/forSite.ts";
import * as $$$9 from "./loaders/assistants/code.ts";
import * as $$$10 from "./loaders/deploy.ts";
import * as $$$11 from "./loaders/pages/list.ts";
import * as $$$$$$$$$0 from "./actions/blocks/publish.ts";
import * as $$$$$$$$$1 from "./actions/blocks/restore.ts";
import * as $$$$$$$$$2 from "./actions/blocks/safeDelete.ts";
import * as $$$$$$$$$3 from "./actions/blocks/newRevision.ts";
import * as $$$$$$$$$4 from "./actions/blocks/delete.ts";
import * as $$$$$$$$$5 from "./actions/releases/fork.ts";
import * as $$$$$$$$$6 from "./actions/platforms/assign.ts";
import * as $$$$$$$$$7 from "./actions/code/vision.ts";
import * as $$$$$$$$$8 from "./actions/code/suggestions.ts";
import * as $$$$$$$$$9 from "./actions/sites/linkRepo.ts";
import * as $$$$$$$$$10 from "./actions/sites/newDomain.ts";
import * as $$$$$$$$$11 from "./actions/sites/create.ts";
import * as $$$$$$$$$12 from "./actions/sites/unlinkRepo.ts";
import * as $$$$$$$$$13 from "./actions/github/setStatus.ts";
import * as $$$$$$$$$14 from "./actions/github/webhooks/broker.ts";
import * as $$$$$$$$$15 from "./actions/pages/publish.ts";
import * as $$$$$$$$$16 from "./actions/pages/new.ts";
import * as $$$$$$$$$17 from "./actions/pages/delete.ts";
import * as $$$$$$$$$18 from "./actions/deployments/create.ts";

const manifest = {
"loaders": {
"deco-sites/admin/loaders/assistants/code.ts": $$$0,
"deco-sites/admin/loaders/blocks/latest.ts": $$$1,
"deco-sites/admin/loaders/blocks/listRevisions.ts": $$$2,
"deco-sites/admin/loaders/blocks/published.ts": $$$3,
"deco-sites/admin/loaders/blocks/revision.ts": $$$4,
"deco-sites/admin/loaders/deploy.ts": $$$5,
"deco-sites/admin/loaders/pages/list.ts": $$$6,
"deco-sites/admin/loaders/platforms/forSite.ts": $$$7,
"deco-sites/admin/loaders/releases/blocks.ts": $$$8,
"deco-sites/admin/loaders/releases/get.ts": $$$9,
"deco-sites/admin/loaders/state.ts": $$$10,
"deco-sites/admin/loaders/assistants/code.ts": $$$9,
"deco-sites/admin/loaders/blocks/get.ts": $$$0,
"deco-sites/admin/loaders/blocks/latest.ts": $$$3,
"deco-sites/admin/loaders/blocks/listRevisions.ts": $$$4,
"deco-sites/admin/loaders/blocks/published.ts": $$$2,
"deco-sites/admin/loaders/blocks/revision.ts": $$$1,
"deco-sites/admin/loaders/deploy.ts": $$$10,
"deco-sites/admin/loaders/pages/list.ts": $$$11,
"deco-sites/admin/loaders/platforms/forSite.ts": $$$8,
"deco-sites/admin/loaders/releases/blocks.ts": $$$7,
"deco-sites/admin/loaders/releases/get.ts": $$$6,
"deco-sites/admin/loaders/state.ts": $$$5,
},
"actions": {
"deco-sites/admin/actions/blocks/delete.ts": $$$$$$$$$0,
"deco-sites/admin/actions/blocks/newRevision.ts": $$$$$$$$$1,
"deco-sites/admin/actions/blocks/publish.ts": $$$$$$$$$2,
"deco-sites/admin/actions/blocks/restore.ts": $$$$$$$$$3,
"deco-sites/admin/actions/blocks/safeDelete.ts": $$$$$$$$$4,
"deco-sites/admin/actions/code/suggestions.ts": $$$$$$$$$5,
"deco-sites/admin/actions/code/vision.ts": $$$$$$$$$6,
"deco-sites/admin/actions/deployments/create.ts": $$$$$$$$$7,
"deco-sites/admin/actions/github/setStatus.ts": $$$$$$$$$8,
"deco-sites/admin/actions/github/webhooks/broker.ts": $$$$$$$$$9,
"deco-sites/admin/actions/pages/delete.ts": $$$$$$$$$10,
"deco-sites/admin/actions/pages/new.ts": $$$$$$$$$11,
"deco-sites/admin/actions/pages/publish.ts": $$$$$$$$$12,
"deco-sites/admin/actions/platforms/assign.ts": $$$$$$$$$13,
"deco-sites/admin/actions/releases/fork.ts": $$$$$$$$$14,
"deco-sites/admin/actions/sites/create.ts": $$$$$$$$$15,
"deco-sites/admin/actions/sites/linkRepo.ts": $$$$$$$$$16,
"deco-sites/admin/actions/sites/newDomain.ts": $$$$$$$$$17,
"deco-sites/admin/actions/sites/unlinkRepo.ts": $$$$$$$$$18,
"deco-sites/admin/actions/blocks/delete.ts": $$$$$$$$$4,
"deco-sites/admin/actions/blocks/newRevision.ts": $$$$$$$$$3,
"deco-sites/admin/actions/blocks/publish.ts": $$$$$$$$$0,
"deco-sites/admin/actions/blocks/restore.ts": $$$$$$$$$1,
"deco-sites/admin/actions/blocks/safeDelete.ts": $$$$$$$$$2,
"deco-sites/admin/actions/code/suggestions.ts": $$$$$$$$$8,
"deco-sites/admin/actions/code/vision.ts": $$$$$$$$$7,
"deco-sites/admin/actions/deployments/create.ts": $$$$$$$$$18,
"deco-sites/admin/actions/github/setStatus.ts": $$$$$$$$$13,
"deco-sites/admin/actions/github/webhooks/broker.ts": $$$$$$$$$14,
"deco-sites/admin/actions/pages/delete.ts": $$$$$$$$$17,
"deco-sites/admin/actions/pages/new.ts": $$$$$$$$$16,
"deco-sites/admin/actions/pages/publish.ts": $$$$$$$$$15,
"deco-sites/admin/actions/platforms/assign.ts": $$$$$$$$$6,
"deco-sites/admin/actions/releases/fork.ts": $$$$$$$$$5,
"deco-sites/admin/actions/sites/create.ts": $$$$$$$$$11,
"deco-sites/admin/actions/sites/linkRepo.ts": $$$$$$$$$9,
"deco-sites/admin/actions/sites/newDomain.ts": $$$$$$$$$10,
"deco-sites/admin/actions/sites/unlinkRepo.ts": $$$$$$$$$12,
},
"name": "deco-sites/admin",
"baseUrl": import.meta.url,
Expand Down
20 changes: 10 additions & 10 deletions algolia/manifest.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
// This file SHOULD be checked into source version control.
// This file is automatically updated during development when running `dev.ts`.

import * as $$$0 from "./loaders/product/list.ts";
import * as $$$1 from "./loaders/product/listingPage.ts";
import * as $$$0 from "./loaders/product/listingPage.ts";
import * as $$$1 from "./loaders/product/list.ts";
import * as $$$2 from "./loaders/product/suggestions.ts";
import * as $$$$$$0 from "./sections/Analytics/Algolia.tsx";
import * as $$$$$$$$$0 from "./actions/index/product.ts";
import * as $$$$$$$$$1 from "./actions/index/wait.ts";
import * as $$$$$$$$$2 from "./actions/setup.ts";
import * as $$$$$$$$$0 from "./actions/setup.ts";
import * as $$$$$$$$$1 from "./actions/index/product.ts";
import * as $$$$$$$$$2 from "./actions/index/wait.ts";
import * as $$$$$$$$$$0 from "./workflows/index/product.ts";

const manifest = {
"loaders": {
"algolia/loaders/product/list.ts": $$$0,
"algolia/loaders/product/listingPage.ts": $$$1,
"algolia/loaders/product/list.ts": $$$1,
"algolia/loaders/product/listingPage.ts": $$$0,
"algolia/loaders/product/suggestions.ts": $$$2,
},
"sections": {
"algolia/sections/Analytics/Algolia.tsx": $$$$$$0,
},
"actions": {
"algolia/actions/index/product.ts": $$$$$$$$$0,
"algolia/actions/index/wait.ts": $$$$$$$$$1,
"algolia/actions/setup.ts": $$$$$$$$$2,
"algolia/actions/index/product.ts": $$$$$$$$$1,
"algolia/actions/index/wait.ts": $$$$$$$$$2,
"algolia/actions/setup.ts": $$$$$$$$$0,
},
"workflows": {
"algolia/workflows/index/product.ts": $$$$$$$$$$0,
Expand Down
48 changes: 24 additions & 24 deletions commerce/manifest.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@
// This file SHOULD be checked into source version control.
// This file is automatically updated during development when running `dev.ts`.

import * as $$$0 from "./loaders/extensions/productDetailsPage.ts";
import * as $$$1 from "./loaders/extensions/productListingPage.ts";
import * as $$$2 from "./loaders/extensions/products.ts";
import * as $$$3 from "./loaders/navbar.ts";
import * as $$$4 from "./loaders/product/extensions/detailsPage.ts";
import * as $$$5 from "./loaders/product/extensions/list.ts";
import * as $$$6 from "./loaders/product/extensions/listingPage.ts";
import * as $$$7 from "./loaders/product/extensions/suggestions.ts";
import * as $$$8 from "./loaders/product/productListingPage.ts";
import * as $$$9 from "./loaders/product/products.ts";
import * as $$$$$$0 from "./sections/Seo/SeoPDP.tsx";
import * as $$$$$$1 from "./sections/Seo/SeoPLP.tsx";
import * as $$$0 from "./loaders/product/extensions/listingPage.ts";
import * as $$$1 from "./loaders/product/extensions/detailsPage.ts";
import * as $$$2 from "./loaders/product/extensions/list.ts";
import * as $$$3 from "./loaders/product/extensions/suggestions.ts";
import * as $$$4 from "./loaders/product/productListingPage.ts";
import * as $$$5 from "./loaders/product/products.ts";
import * as $$$6 from "./loaders/extensions/productDetailsPage.ts";
import * as $$$7 from "./loaders/extensions/productListingPage.ts";
import * as $$$8 from "./loaders/extensions/products.ts";
import * as $$$9 from "./loaders/navbar.ts";
import * as $$$$$$0 from "./sections/Seo/SeoPLP.tsx";
import * as $$$$$$1 from "./sections/Seo/SeoPDP.tsx";

const manifest = {
"loaders": {
"commerce/loaders/extensions/productDetailsPage.ts": $$$0,
"commerce/loaders/extensions/productListingPage.ts": $$$1,
"commerce/loaders/extensions/products.ts": $$$2,
"commerce/loaders/navbar.ts": $$$3,
"commerce/loaders/product/extensions/detailsPage.ts": $$$4,
"commerce/loaders/product/extensions/list.ts": $$$5,
"commerce/loaders/product/extensions/listingPage.ts": $$$6,
"commerce/loaders/product/extensions/suggestions.ts": $$$7,
"commerce/loaders/product/productListingPage.ts": $$$8,
"commerce/loaders/product/products.ts": $$$9,
"commerce/loaders/extensions/productDetailsPage.ts": $$$6,
"commerce/loaders/extensions/productListingPage.ts": $$$7,
"commerce/loaders/extensions/products.ts": $$$8,
"commerce/loaders/navbar.ts": $$$9,
"commerce/loaders/product/extensions/detailsPage.ts": $$$1,
"commerce/loaders/product/extensions/list.ts": $$$2,
"commerce/loaders/product/extensions/listingPage.ts": $$$0,
"commerce/loaders/product/extensions/suggestions.ts": $$$3,
"commerce/loaders/product/productListingPage.ts": $$$4,
"commerce/loaders/product/products.ts": $$$5,
},
"sections": {
"commerce/sections/Seo/SeoPDP.tsx": $$$$$$0,
"commerce/sections/Seo/SeoPLP.tsx": $$$$$$1,
"commerce/sections/Seo/SeoPDP.tsx": $$$$$$1,
"commerce/sections/Seo/SeoPLP.tsx": $$$$$$0,
},
"name": "commerce",
"baseUrl": import.meta.url,
Expand Down
28 changes: 14 additions & 14 deletions compat/$live/manifest.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
// This file SHOULD be checked into source version control.
// This file is automatically updated during development when running `dev.ts`.

import * as $$$0 from "./loaders/secret.ts";
import * as $$$1 from "./loaders/state.ts";
import * as $$$$0 from "./handlers/devPage.ts";
import * as $$$$1 from "./handlers/router.ts";
import * as $$$$$$0 from "./sections/EmptySection.tsx";
import * as $$$$$$1 from "./sections/PageInclude.tsx";
import * as $$$$$$2 from "./sections/Slot.tsx";
import * as $$$0 from "./loaders/state.ts";
import * as $$$1 from "./loaders/secret.ts";
import * as $$$$0 from "./handlers/router.ts";
import * as $$$$1 from "./handlers/devPage.ts";
import * as $$$$$$0 from "./sections/Slot.tsx";
import * as $$$$$$1 from "./sections/EmptySection.tsx";
import * as $$$$$$2 from "./sections/PageInclude.tsx";

const manifest = {
"loaders": {
"$live/loaders/secret.ts": $$$0,
"$live/loaders/state.ts": $$$1,
"$live/loaders/secret.ts": $$$1,
"$live/loaders/state.ts": $$$0,
},
"handlers": {
"$live/handlers/devPage.ts": $$$$0,
"$live/handlers/router.ts": $$$$1,
"$live/handlers/devPage.ts": $$$$1,
"$live/handlers/router.ts": $$$$0,
},
"sections": {
"$live/sections/EmptySection.tsx": $$$$$$0,
"$live/sections/PageInclude.tsx": $$$$$$1,
"$live/sections/Slot.tsx": $$$$$$2,
"$live/sections/EmptySection.tsx": $$$$$$1,
"$live/sections/PageInclude.tsx": $$$$$$2,
"$live/sections/Slot.tsx": $$$$$$0,
},
"name": "$live",
"baseUrl": import.meta.url,
Expand Down
Loading

0 comments on commit 564fcd0

Please sign in to comment.