eddev 0.2.5 → 0.2.8

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.
@@ -32,7 +32,7 @@ var react_1 = require("react");
32
32
  var blockAttributes_1 = require("./blockAttributes");
33
33
  var react_2 = require("@stitches/react");
34
34
  var remoteProps_1 = require("../routing/remoteProps");
35
- var __1 = require("..");
35
+ var routing_1 = require("../routing");
36
36
  function EditableText(_a) {
37
37
  var id = _a.id, as = _a.as, appendOnEnter = _a.appendOnEnter, props = __rest(_a, ["id", "as", "appendOnEnter"]);
38
38
  if (process.admin) {
@@ -48,7 +48,7 @@ function EditableText(_a) {
48
48
  }
49
49
  else {
50
50
  var value = (0, blockAttributes_1.useInlineEditableValue)(id)[0];
51
- var router_1 = (0, __1.useRouter)();
51
+ var router_1 = (0, routing_1.useRouter)();
52
52
  var otherProps = __assign({}, props);
53
53
  delete otherProps.inlineToolbar;
54
54
  delete otherProps.disableLineBreaks;
package/cli/preinstall.js CHANGED
@@ -9,7 +9,7 @@ function main() {
9
9
  // const pkg = JSON.parse(readFileSync(pkgFile).toString()) as any
10
10
  // pkg.devDependencies["next"] = "^12.1.0"
11
11
  // writeFile(pkgFile, JSON.stringify(pkg, null, " "), () => {})
12
- var proc = (0, child_process_1.spawn)("yarn", ["add", "--dev", "next@^12.1.0"], {
12
+ var proc = (0, child_process_1.spawn)("yarn", ["add", "--dev", "next@^12.1.6"], {
13
13
  cwd: process.cwd(),
14
14
  });
15
15
  (_a = proc.stdout) === null || _a === void 0 ? void 0 : _a.pipe(process.stdout);
@@ -68,7 +68,6 @@ function BrowserRouter(props) {
68
68
  setIsLoading(true);
69
69
  }
70
70
  (0, remoteProps_1.fetchProps)(pending.url).then(function (data) {
71
- console.log("FETCHED", data);
72
71
  var view = views_1.default[data.view];
73
72
  var nextUrl = data.canonical || pending.url;
74
73
  var finish = function () {
@@ -6,7 +6,10 @@ declare type GraphQLError = {
6
6
  declare type CreateUseQueryOptions = {
7
7
  name: string;
8
8
  };
9
- declare type QueryOptions = {};
9
+ declare type QueryOptions = {
10
+ revalidateIfStale?: boolean;
11
+ revalidateOnFocus?: boolean;
12
+ };
10
13
  declare type MaybeVars = {
11
14
  [key: string]: any;
12
15
  } | undefined;
@@ -83,9 +83,11 @@ var fetcherGET = function (name, params) { return __awaiter(void 0, void 0, void
83
83
  }); };
84
84
  function createUseQuery(init) {
85
85
  var hook = function (vars, opts) {
86
- var _a = (0, swr_1.default)([init.name, JSON.stringify(vars)], fetcherGET, {
87
- revalidateIfStale: false,
88
- }), payload = _a.data, isValidating = _a.isValidating, error = _a.error, mutate = _a.mutate;
86
+ var _a, _b;
87
+ var _c = (0, swr_1.default)([init.name, JSON.stringify(vars)], fetcherGET, {
88
+ revalidateIfStale: (_a = opts === null || opts === void 0 ? void 0 : opts.revalidateIfStale) !== null && _a !== void 0 ? _a : false,
89
+ revalidateOnFocus: (_b = opts === null || opts === void 0 ? void 0 : opts.revalidateOnFocus) !== null && _b !== void 0 ? _b : false,
90
+ }), payload = _c.data, isValidating = _c.isValidating, error = _c.error, mutate = _c.mutate;
89
91
  return {
90
92
  loading: isValidating && !payload,
91
93
  data: payload === null || payload === void 0 ? void 0 : payload.data,
package/hooks/useRPC.d.ts CHANGED
@@ -1,25 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { TRPCClientError } from "@trpc/client";
3
- declare const trpc: {
4
- Provider: ({ client, queryClient, children, isPrepass, ssrContext, }: {
5
- queryClient: import("react-query").QueryClient;
6
- client: import("@trpc/react").TRPCClient<import("@trpc/server").AnyRouter<any>>;
7
- children: import("react").ReactNode;
8
- isPrepass?: boolean | undefined;
9
- ssrContext?: unknown;
10
- }) => JSX.Element;
11
- createClient: (opts: import("@trpc/react").CreateTRPCClientOptions<import("@trpc/server").AnyRouter<any>>) => import("@trpc/react").TRPCClient<import("@trpc/server").AnyRouter<any>>;
12
- useContext: () => import("@trpc/react/dist/declarations/src/internals/context").TRPCContextState<import("@trpc/server").AnyRouter<any>, unknown>;
13
- useQuery: <TPath extends string>(pathAndInput: [TPath, (null | undefined)?], opts?: import("@trpc/react").UseTRPCQueryOptions<TPath, unknown, any, import("@trpc/react").TRPCClientErrorLike<import("@trpc/server").AnyRouter<any>>> | undefined) => import("react-query").UseQueryResult<any, import("@trpc/react").TRPCClientErrorLike<import("@trpc/server").AnyRouter<any>>>;
14
- useMutation: <TPath_1 extends string>(path: TPath_1 | [TPath_1], opts?: import("@trpc/react").UseTRPCMutationOptions<unknown, import("@trpc/react").TRPCClientErrorLike<import("@trpc/server").AnyRouter<any>>, any> | undefined) => import("react-query").UseMutationResult<any, import("@trpc/react").TRPCClientErrorLike<import("@trpc/server").AnyRouter<any>>, unknown, unknown>;
15
- useSubscription: <TPath_2 extends string, TOutput extends any>(pathAndInput: [TPath_2, (null | undefined)?], opts: {
16
- enabled?: boolean | undefined;
17
- onError?: ((err: import("@trpc/react").TRPCClientErrorLike<import("@trpc/server").AnyRouter<any>>) => void) | undefined;
18
- onNext: (data: TOutput) => void;
19
- }) => void;
20
- useDehydratedState: (client: import("@trpc/react").TRPCClient<import("@trpc/server").AnyRouter<any>>, trpcState: import("react-query").DehydratedState | undefined) => import("react-query").DehydratedState | undefined;
21
- useInfiniteQuery: <TPath_3 extends never>(pathAndInput: [path: TPath_3, input: Omit<unknown, "cursor">], opts?: import("@trpc/react").UseTRPCInfiniteQueryOptions<TPath_3, Omit<unknown, "cursor">, any, import("@trpc/react").TRPCClientErrorLike<import("@trpc/server").AnyRouter<any>>> | undefined) => import("react-query").UseInfiniteQueryResult<any, import("@trpc/react").TRPCClientErrorLike<import("@trpc/server").AnyRouter<any>>>;
22
- };
2
+ declare const trpc: any;
23
3
  export declare const useRPCQuery: RPCUseQuery;
24
4
  export declare const useRPCMutation: RPCUseMutation;
25
5
  export declare const useRPCInfiniteQuery: RPCUseInfiniteQuery;
package/index.d.ts CHANGED
@@ -1,3 +1 @@
1
- export * from "./components";
2
- export * from "./hooks";
3
- export * from "./routing";
1
+ export {};
package/index.js CHANGED
@@ -1,15 +1,5 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
2
+ // export * from "./components"
3
+ // export * from "./hooks"
4
+ // export * from "./routing"
12
5
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./components"), exports);
14
- __exportStar(require("./hooks"), exports);
15
- __exportStar(require("./routing"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "0.2.5",
3
+ "version": "0.2.8",
4
4
  "main": "./index.js",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -27,7 +27,7 @@
27
27
  "@types/url-parse": "^1.4.4",
28
28
  "@types/webpack-dev-server": "^3.11.2",
29
29
  "csstype": "^3.0.9",
30
- "next": "^12.1.0",
30
+ "next": "^12.1.6",
31
31
  "react-html-props": "^1.0.32"
32
32
  },
33
33
  "dependencies": {
@@ -48,8 +48,8 @@
48
48
  "@loadable/webpack-plugin": "^5.15.2",
49
49
  "@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
50
50
  "@soda/friendly-errors-webpack-plugin": "^1.8.0",
51
- "@stitches/core": "^1.2.7",
52
- "@stitches/react": "^1.2.7",
51
+ "@stitches/core": "^1.2.8",
52
+ "@stitches/react": "^1.2.8",
53
53
  "@trpc/client": "^9.19.0",
54
54
  "@trpc/next": "^9.19.0",
55
55
  "@trpc/react": "^9.19.0",
@@ -21,6 +21,7 @@
21
21
  "@components/*": ["components/*"],
22
22
  "@views/*": ["views/*"],
23
23
  "@hooks/*": ["hooks/*"],
24
+ "@utils/*": ["utils/*"],
24
25
  "@queries/*": ["hooks/queries/*"],
25
26
  "@theme": ["theme.css.tsx"],
26
27
  "@wordpress/components": ["null.ts"],