Skip to content

Commit

Permalink
Ignore multiple errors (#229)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia authored Jan 11, 2024
1 parent f88d70e commit af9c87f
Show file tree
Hide file tree
Showing 61 changed files with 102 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
"[css]": {
"editor.defaultFormatter": "vscode.css-language-features"
}
}
}
2 changes: 1 addition & 1 deletion commerce/butterCMS/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LiveState } from "deco/types.ts";
import { DecoState as LiveState } from "deco/types.ts";
import { ConfigButterCMS } from "./client.ts";

export type StateButterCMS = LiveState<{ configButterCMS?: ConfigButterCMS }>;
Expand Down
5 changes: 4 additions & 1 deletion commerce/sdk/sendAnalyticsEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ export const sendAnalyticsEvent = <T extends AnalyticsEvent>(
ecommerce: event.params,
});

window.jitsu && window.jitsu("track", "ecommerce", event);
// deno-lint-ignore no-explicit-any
const w = window as unknown as { jitsu: any };

w.jitsu && w.jitsu("track", "ecommerce", event);
};
1 change: 0 additions & 1 deletion commerce/shopify/client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { fetchAPI } from "deco-sites/std/utils/fetch.server.ts";
import { Account } from "deco/blocks/account.ts";
import { Product } from "./types.ts";

const gql = (x: TemplateStringsArray) => x.toString().trim();

export interface ConfigShopify extends Account {
Expand Down
4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"lock": false,
"tasks": {
"start": "deno run -A --watch=sections/,functions/,loaders/,actions/,workflows/,accounts/ dev.ts",
"start": "deno run -A --watch=sections/,functions/,loaders/,actions/,workflows/,accounts/ main.ts",
"component": "deno eval 'import \"deco/scripts/component.ts\"'",
"check": "deno fmt && deno lint && deno check dev.ts main.ts",
"check": "deno fmt && deno lint && deno check main.ts",
"release": "deno eval 'import \"deco/scripts/release.ts\"'"
},
"githooks": {
Expand Down
14 changes: 0 additions & 14 deletions dev.ts

This file was deleted.

1 change: 1 addition & 0 deletions functions/butterCMSPosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const postsLoader: LoaderFunction<
ctx,
{ pageSize = 6 },
) => {
// @ts-ignore: global should be set
const { global: { configButterCMS } } = ctx.state;
const client = createClient(configButterCMS);
const url = new URL(req.url);
Expand Down
1 change: 1 addition & 0 deletions functions/butterCMSRelatedPosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const relatedPostsLoader: LoaderFunction<
ctx,
{ pageSize, withPagination = false },
) => {
// @ts-ignore: global should be set
const { state: { global: { configButterCMS } }, params: { slug } } = ctx;
const client = createClient(configButterCMS);

Expand Down
3 changes: 2 additions & 1 deletion functions/occProductDetailsPage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LiveState, LoaderFunction } from "deco/types.ts";
import type { DecoState as LiveState, LoaderFunction } from "deco/types.ts";

import { ConfigOCC, createClient } from "../commerce/occ/client.ts";
import { toProductPage } from "../commerce/occ/transform.ts";
Expand All @@ -13,6 +13,7 @@ const productPageLoader: LoaderFunction<
ProductDetailsPage | null,
LiveState<{ configOCC: ConfigOCC }>
> = async (_req, ctx) => {
// @ts-ignore this should work.
const { configOCC } = ctx.state.global;
const occ = createClient(configOCC);

Expand Down
2 changes: 1 addition & 1 deletion functions/requestToParam.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { FunctionContext, LoaderFunction } from "deco/types.ts";
import type { RequestURLParam } from "https://denopkg.com/deco-cx/apps@0.9.0/website/functions/requestToParam.ts";
import type { RequestURLParam } from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/website/functions/requestToParam.ts";

export type { RequestURLParam };
export interface Props {
Expand Down
3 changes: 2 additions & 1 deletion functions/shopifyProductDetailsPage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LiveState, LoaderFunction } from "deco/types.ts";
import type { DecoState as LiveState, LoaderFunction } from "deco/types.ts";

import { ConfigShopify, createClient } from "../commerce/shopify/client.ts";
import { toProductPage } from "../commerce/shopify/transform.ts";
Expand All @@ -16,6 +16,7 @@ const productPageLoader: LoaderFunction<
_req,
ctx,
) => {
// @ts-ignore this should work.
const { configShopify } = ctx.state.global;
const shopify = createClient(configShopify);

Expand Down
3 changes: 2 additions & 1 deletion functions/shopifyProductList.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LiveState, LoaderFunction } from "deco/types.ts";
import type { DecoState as LiveState, LoaderFunction } from "deco/types.ts";

import { ConfigShopify, createClient } from "../commerce/shopify/client.ts";
import { toProduct } from "../commerce/shopify/transform.ts";
Expand All @@ -24,6 +24,7 @@ const searchLoader: LoaderFunction<
ctx,
props,
) => {
// @ts-ignore this should work.
const { configShopify } = ctx.state.global;
const shopify = createClient(configShopify);

Expand Down
3 changes: 2 additions & 1 deletion functions/shopifyProductListingPage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LiveState, LoaderFunction } from "deco/types.ts";
import type { DecoState as LiveState, LoaderFunction } from "deco/types.ts";

import { ConfigShopify, createClient } from "../commerce/shopify/client.ts";
import { toProduct } from "../commerce/shopify/transform.ts";
Expand Down Expand Up @@ -30,6 +30,7 @@ const searchLoader: LoaderFunction<
props,
) => {
const url = new URL(req.url);
// @ts-ignore this should work.
const { configShopify } = ctx.state.global;
const shopify = createClient(configShopify);

Expand Down
1 change: 1 addition & 0 deletions functions/vtexLegacyProductList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const loaderV0: LoaderFunction<
? { term: props.query, count: props.count }
: { collection: props.collection?.[0], count: props.count };

// @ts-ignore this should work.
const data = await loader(p, req, ctx.state);

return { data, status: data ? 200 : 404 };
Expand Down
1 change: 1 addition & 0 deletions functions/vtexLegacyProductListingPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { ProductListingPage } from "../commerce/types.ts";
* @description Useful for category, search, brand and collection pages.
* @deprecated
*/
// @ts-ignore this should work.
const loaderV0: LoaderFunction<
Props,
ProductListingPage | null,
Expand Down
1 change: 1 addition & 0 deletions functions/vtexLegacyRelatedProductsLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface Props {
* @description Works on routes of type /:slug/p
* @deprecated
*/
// @ts-ignore this should work.
const loaderV0: LoaderFunction<
Props,
Product[] | null,
Expand Down
1 change: 1 addition & 0 deletions functions/vtexNavbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface Props {
* @title Navigation Bar
* @deprecated true
*/
// @ts-ignore this should work.
const loaderV0: LoaderFunction<
Props,
Navbar[] | null,
Expand Down
2 changes: 1 addition & 1 deletion handlers/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Handler } from "deco/blocks/handler.ts";
import type { Resolvable } from "deco/engine/core/resolver.ts";
import { isResolvable } from "deco/engine/core/resolver.ts";
import { Route } from "deco/flags/audience.ts";
import { Route } from "deco/types.ts";
import { ConnInfo } from "std/http/server.ts";

const isPage = (handler: Resolvable<Handler>) =>
Expand Down
4 changes: 2 additions & 2 deletions import_map.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"imports": {
"deco-sites/std/": "./",
"deco/": "https://denopkg.com/deco-cx/deco@1.34.6/",
"deco/": "https://denopkg.com/deco-cx/deco@1.51.5/",
"partytown/": "https://deno.land/x/[email protected]/",
"$fresh/": "https://denopkg.com/deco-cx/fresh@1.3.3/",
"$fresh/": "https://deno.land/x/fresh@1.6.1/",
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"preact-render-to-string": "https://esm.sh/*[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion loaders/vnda/proxy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Context } from "deco-sites/std/packs/vnda/accounts/vnda.ts";
import { Route } from "deco/flags/audience.ts";
import { Route } from "deco/types.ts";

const PAGE_PATHS = [
"/admin",
Expand Down
4 changes: 2 additions & 2 deletions loaders/vtex/legacy/suggestions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Context } from "deco-sites/std/packs/vtex/accounts/vtex.ts";
import type { Props } from "https://denopkg.com/deco-cx/apps@0.9.0/vtex/loaders/legacy/suggestions.ts";
import _suggestions from "https://denopkg.com/deco-cx/apps@0.9.0/vtex/loaders/legacy/suggestions.ts";
import type { Props } from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/vtex/loaders/legacy/suggestions.ts";
import _suggestions from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/vtex/loaders/legacy/suggestions.ts";

const loader = (
props: Props,
Expand Down
2 changes: 1 addition & 1 deletion loaders/vtex/proxy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Context } from "deco-sites/std/packs/vtex/accounts/vtex.ts";
import { Route } from "deco/flags/audience.ts";
import { Route } from "deco/types.ts";

const PATHS_TO_PROXY = [
"/account",
Expand Down
2 changes: 1 addition & 1 deletion loaders/x/redirects.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Route } from "deco/flags/audience.ts";
import { Route } from "deco/types.ts";

/** @titleBy from */
export interface Redirect {
Expand Down
2 changes: 1 addition & 1 deletion loaders/x/redirectsFromCsv.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Route } from "deco/flags/audience.ts";
import { Route } from "deco/types.ts";
import { join } from "std/path/mod.ts";

/** @titleBy from */
Expand Down
1 change: 1 addition & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import manifest from "./live.gen.ts";
import plugins from "./plugins/mod.ts";
import site from "./site.json" assert { type: "json" };

// @ts-ignore this should work.
await start($live(manifest, site), {
plugins: [
...plugins(),
Expand Down
2 changes: 2 additions & 0 deletions packs/vnda/accounts/vnda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ export interface Account extends AccountBlock {

export type Context = FnContext<{
configVNDA?: Account;
// @ts-ignore this should work.
}, Manifest>;

export type StateVNDA = FnContext<
{ global: { configVTEX: Account } },
// @ts-ignore this should work.
Manifest
>;

Expand Down
1 change: 1 addition & 0 deletions packs/vtex/accounts/vtex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface Account extends AccountBlock {

export type Context = FnContext<{
configVTEX?: Account;
// @ts-ignore this should work.
}, Manifest>;

function account(acc: Account) {
Expand Down
2 changes: 1 addition & 1 deletion packs/vtex/actions/analytics/sendEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Context } from "deco-sites/std/packs/vtex/accounts/vtex.ts";
import { transform } from "deco-sites/std/packs/vtex/utils/future.ts";
import base, {
Props,
} from "https://denopkg.com/deco-cx/apps@0.9.0/vtex/actions/analytics/sendEvent.ts";
} from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/vtex/actions/analytics/sendEvent.ts";

/**
* @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/items
Expand Down
3 changes: 2 additions & 1 deletion packs/vtex/actions/cart/addItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { OrderForm } from "deco-sites/std/packs/vtex/types.ts";
import { transform } from "deco-sites/std/packs/vtex/utils/future.ts";
import base, {
Props,
} from "https://denopkg.com/deco-cx/apps@0.9.0/vtex/actions/cart/addItems.ts";
} from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/vtex/actions/cart/addItems.ts";

/**
* @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/items
Expand All @@ -12,6 +12,7 @@ const action = (
props: Props,
req: Request,
ctx: Context,
// @ts-ignore this should work.
): Promise<OrderForm> => base(props, req, transform(ctx));

export default action;
3 changes: 2 additions & 1 deletion packs/vtex/actions/cart/getInstallment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { OrderForm } from "deco-sites/std/packs/vtex/types.ts";
import { transform } from "deco-sites/std/packs/vtex/utils/future.ts";
import base, {
Props,
} from "https://denopkg.com/deco-cx/apps@0.9.0/vtex/actions/cart/getInstallment.ts";
} from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/vtex/actions/cart/getInstallment.ts";

/**
* @docs https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/orderForm/-orderFormId-/installments
Expand All @@ -12,6 +12,7 @@ const action = (
props: Props,
req: Request,
ctx: Context,
// @ts-ignore this should work.
): Promise<OrderForm> => base(props, req, transform(ctx));

export default action;
3 changes: 2 additions & 1 deletion packs/vtex/actions/cart/removeItemAttachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import type { OrderForm } from "deco-sites/std/packs/vtex/types.ts";
import { transform } from "deco-sites/std/packs/vtex/utils/future.ts";
import base, {
Props,
} from "https://denopkg.com/deco-cx/apps@0.9.0/vtex/actions/cart/removeItemAttachment.ts";
} from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/vtex/actions/cart/removeItemAttachment.ts";

const action = (
props: Props,
req: Request,
ctx: Context,
// @ts-ignore this should work.
): Promise<OrderForm> => base(props, req, transform(ctx));

export default action;
3 changes: 2 additions & 1 deletion packs/vtex/actions/cart/removeItems.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Context } from "deco-sites/std/packs/vtex/accounts/vtex.ts";
import type { OrderForm } from "deco-sites/std/packs/vtex/types.ts";
import { transform } from "deco-sites/std/packs/vtex/utils/future.ts";
import base from "https://denopkg.com/deco-cx/apps@0.9.0/vtex/actions/cart/removeItems.ts";
import base from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/vtex/actions/cart/removeItems.ts";

/**
* @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/items/removeAll
Expand All @@ -10,6 +10,7 @@ const action = (
props: unknown,
req: Request,
ctx: Context,
// @ts-ignore this should work.
): Promise<OrderForm> => base(props, req, transform(ctx));

export default action;
3 changes: 2 additions & 1 deletion packs/vtex/actions/cart/simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { SimulationOrderForm } from "deco-sites/std/packs/vtex/types.ts";
import { transform } from "deco-sites/std/packs/vtex/utils/future.ts";
import base, {
Props,
} from "https://denopkg.com/deco-cx/apps@0.9.0/vtex/actions/cart/simulation.ts";
} from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/vtex/actions/cart/simulation.ts";

/**
* @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForms/simulation
Expand All @@ -12,6 +12,7 @@ const action = (
props: Props,
req: Request,
ctx: Context,
// @ts-ignore this should work.
): Promise<SimulationOrderForm> => base(props, req, transform(ctx));

export default action;
3 changes: 2 additions & 1 deletion packs/vtex/actions/cart/updateAttachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import type { OrderForm } from "deco-sites/std/packs/vtex/types.ts";
import { transform } from "deco-sites/std/packs/vtex/utils/future.ts";
import base, {
Props,
} from "https://denopkg.com/deco-cx/apps@0.9.0/vtex/actions/cart/updateAttachment.ts";
} from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/vtex/actions/cart/updateAttachment.ts";

const action = (
props: Props,
req: Request,
ctx: Context,
// @ts-ignore this should work.
): Promise<OrderForm> => base(props, req, transform(ctx));

export default action;
3 changes: 2 additions & 1 deletion packs/vtex/actions/cart/updateCoupons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { OrderForm } from "deco-sites/std/packs/vtex/types.ts";
import { transform } from "deco-sites/std/packs/vtex/utils/future.ts";
import base, {
Props,
} from "https://denopkg.com/deco-cx/apps@0.9.0/vtex/actions/cart/updateCoupons.ts";
} from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/vtex/actions/cart/updateCoupons.ts";

/**
* @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/coupons
Expand All @@ -12,6 +12,7 @@ const action = (
props: Props,
req: Request,
ctx: Context,
// @ts-ignore this should work.
): Promise<OrderForm> => base(props, req, transform(ctx));

export default action;
3 changes: 2 additions & 1 deletion packs/vtex/actions/cart/updateItemAttachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import type { OrderForm } from "deco-sites/std/packs/vtex/types.ts";
import { transform } from "deco-sites/std/packs/vtex/utils/future.ts";
import base, {
Props,
} from "https://denopkg.com/deco-cx/apps@0.9.0/vtex/actions/cart/updateItemAttachment.ts";
} from "https://denopkg.com/deco-cx/apps@8a0b1e23cef3f10071d539d2df70bbaf5c2392df/vtex/actions/cart/updateItemAttachment.ts";

const action = (
props: Props,
req: Request,
ctx: Context,
// @ts-ignore this should work.
): Promise<OrderForm> => base(props, req, transform(ctx));

export default action;
Loading

0 comments on commit af9c87f

Please sign in to comment.