eddev 0.2.0-beta.38 → 0.2.0-beta.40

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.
@@ -130,6 +130,7 @@ function getWebpackConfig(opts) {
130
130
  ALIAS["@views"] = path_1.default.join(opts.baseDirectory, "views");
131
131
  ALIAS["@hooks"] = path_1.default.join(opts.baseDirectory, "hooks");
132
132
  ALIAS["@queries"] = path_1.default.join(opts.baseDirectory, "hooks/queries");
133
+ ALIAS["@utils"] = path_1.default.join(opts.baseDirectory, "utils");
133
134
  RULES.push({
134
135
  test: /\.[jt]sx?$/,
135
136
  exclude: /node_modules/,
@@ -593,9 +593,6 @@ function processSchema(schema) {
593
593
  }
594
594
  };
595
595
  var updateType = function (type) {
596
- if (type.name === "valuesOptional") {
597
- console.log(type);
598
- }
599
596
  if (typeof type.type === "object" && type.type) {
600
597
  updateFieldType(type.type);
601
598
  }
package/cli/build.dev.js CHANGED
@@ -55,20 +55,28 @@ var Observable_1 = require("../utils/Observable");
55
55
  var fs_extra_1 = require("fs-extra");
56
56
  var create_serverless_dev_worker_1 = require("../build/create-serverless-dev-worker");
57
57
  var build_favicon_1 = require("../build/build-favicon");
58
+ var compare_versions_1 = __importDefault(require("compare-versions"));
59
+ var chalk_1 = __importDefault(require("chalk"));
58
60
  function devCommand(opts) {
59
61
  var _a;
60
62
  return __awaiter(this, void 0, void 0, function () {
61
- var configResult, config, themeName, enableFrontend, enableAdmin, enableCodegen, enableServerless, frontendObservable, adminObservable, codegenObservable, configChanged, serverlessObservable;
63
+ var version, requiredVersion, configResult, config, themeName, enableFrontend, enableAdmin, enableCodegen, enableServerless, frontendObservable, adminObservable, codegenObservable, configChanged, serverlessObservable;
62
64
  return __generator(this, function (_b) {
63
65
  switch (_b.label) {
64
66
  case 0:
67
+ version = require(path_1.default.join(__dirname, "../package.json")).version;
68
+ requiredVersion = require(path_1.default.join(process.cwd(), "package.json")).devDependencies.eddev;
69
+ if ((0, compare_versions_1.default)(version, requiredVersion) < 0) {
70
+ console.log(chalk_1.default.red("\uD83D\uDEA8 Incorrect 'eddev' version installed!\n\uD83D\uDEA8 Your package.json requires ".concat(chalk_1.default.yellow(requiredVersion), ", but you have ").concat(chalk_1.default.yellow(version), ".\n\uD83D\uDEA8 Do you need to run 'yarn'?")));
71
+ process.exit(1);
72
+ }
65
73
  (0, create_schema_file_1.createConfigSchemaFile)(path_1.default.resolve(process.cwd(), ".ed.config.schema.json"));
66
74
  (0, build_favicon_1.buildFavicon)().catch(function () { });
67
75
  return [4 /*yield*/, (0, promptIfRepoNameIncorrect_1.promptIfRepoThemeMismatch)()];
68
76
  case 1:
69
77
  _b.sent();
70
78
  configResult = (0, get_config_1.getEDConfig)();
71
- if (!configResult.success) {
79
+ if (configResult.success === false) {
72
80
  (0, print_zod_errors_1.printZodErrors)(configResult.error);
73
81
  console.log("\nPlease fix the above config errors, and restart the dev command.");
74
82
  return [2 /*return*/];
package/cli/build.prod.js CHANGED
@@ -91,7 +91,14 @@ function prodCommand(opts) {
91
91
  compiler = _a.apply(void 0, [_b.concat([
92
92
  _c.sent()
93
93
  ])]);
94
- compiler.run(function () { });
94
+ compiler.run(function (err, stats) {
95
+ if (stats === null || stats === void 0 ? void 0 : stats.hasErrors()) {
96
+ process.exit(1);
97
+ }
98
+ if (err) {
99
+ process.exit(1);
100
+ }
101
+ });
95
102
  return [2 /*return*/];
96
103
  }
97
104
  });
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ console.log("Dev serverless");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "0.2.0-beta.38",
3
+ "version": "0.2.0-beta.40",
4
4
  "main": "./index.js",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -60,6 +60,7 @@
60
60
  "change-case": "^4.1.2",
61
61
  "chokidar": "^3.5.2",
62
62
  "commander": "^8.1.0",
63
+ "compare-versions": "^4.1.3",
63
64
  "cross-fetch": "^3.1.4",
64
65
  "css-loader": "^6.2.0",
65
66
  "dotenv": "^10.0.0",
@@ -1,6 +1,7 @@
1
+ /// <reference types="react" />
1
2
  export declare function createRPCClient(): {
2
3
  Provider: ({ client, queryClient, children, isPrepass, ssrContext, }: {
3
- queryClient: import("react-query").QueryClient;
4
+ queryClient: QueryClient;
4
5
  client: import("@trpc/react").TRPCClient<import("@trpc/server").AnyRouter<any>>;
5
6
  children: import("react").ReactNode;
6
7
  isPrepass?: boolean | undefined;
@@ -8,13 +9,25 @@ export declare function createRPCClient(): {
8
9
  }) => JSX.Element;
9
10
  createClient: (opts: import("@trpc/react").CreateTRPCClientOptions<import("@trpc/server").AnyRouter<any>>) => import("@trpc/react").TRPCClient<import("@trpc/server").AnyRouter<any>>;
10
11
  useContext: () => import("@trpc/react/dist/declarations/src/internals/context").TRPCContextState<import("@trpc/server").AnyRouter<any>, unknown>;
11
- 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>>>;
12
- 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>;
12
+ 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) => UseQueryResult<{ [TPath_1 in keyof TRouter["_def"]["queries"]]: {
13
+ input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["queries"][TPath_1]>;
14
+ output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["queries"][TPath_1]["call"]>>;
15
+ }; }[TPath_2]["output"], import("@trpc/react").TRPCClientErrorLike<TRouter>>;
16
+ 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) => UseMutationResult<{ [TPath_3 in keyof TRouter["_def"]["mutations"]]: {
17
+ input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["mutations"][TPath_3]>;
18
+ output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["mutations"][TPath_3]["call"]>>;
19
+ }; }[TPath_1_1]["output"], import("@trpc/react").TRPCClientErrorLike<TRouter>, { [TPath_3 in keyof TRouter["_def"]["mutations"]]: {
20
+ input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["mutations"][TPath_3]>;
21
+ output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["mutations"][TPath_3]["call"]>>;
22
+ }; }[TPath_1_1]["input"], unknown>;
13
23
  useSubscription: <TPath_2 extends string, TOutput extends any>(pathAndInput: [TPath_2, (null | undefined)?], opts: {
14
24
  enabled?: boolean | undefined;
15
25
  onError?: ((err: import("@trpc/react").TRPCClientErrorLike<import("@trpc/server").AnyRouter<any>>) => void) | undefined;
16
26
  onNext: (data: TOutput) => void;
17
27
  }) => void;
18
- useDehydratedState: (client: import("@trpc/react").TRPCClient<import("@trpc/server").AnyRouter<any>>, trpcState: import("react-query").DehydratedState | undefined) => import("react-query").DehydratedState | undefined;
19
- 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>>>;
28
+ useDehydratedState: (client: import("@trpc/react").TRPCClient<import("@trpc/server").AnyRouter<any>>, trpcState: any) => any;
29
+ 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) => UseInfiniteQueryResult<{ [TPath_1 in keyof TRouter["_def"]["queries"]]: {
30
+ input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["queries"][TPath_1]>;
31
+ output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["queries"][TPath_1]["call"]>>;
32
+ }; }[TPath_3_1]["output"], import("@trpc/react").TRPCClientErrorLike<TRouter>>;
20
33
  };
@@ -1,3 +0,0 @@
1
- export declare const useRPCQuery: <TPath extends string>(pathAndInput: [TPath, (null | undefined)?], opts?: import("@trpc/react").UseTRPCQueryOptions<TPath, RPCRouter, RPCRouter, import("@trpc/react").TRPCClientErrorLike<RPCRouter>> | undefined) => import("react-query").UseQueryResult<RPCRouter, import("@trpc/react").TRPCClientErrorLike<RPCRouter>>;
2
- export declare const useRPCMutation: <TPath_1 extends string>(path: TPath_1 | [TPath_1], opts?: import("@trpc/react").UseTRPCMutationOptions<RPCRouter, import("@trpc/react").TRPCClientErrorLike<RPCRouter>, RPCRouter> | undefined) => import("react-query").UseMutationResult<RPCRouter, import("@trpc/react").TRPCClientErrorLike<RPCRouter>, RPCRouter, unknown>;
3
- export declare const rpcClient: import("@trpc/react").TRPCClient<RPCRouter>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rpcClient = exports.useRPCMutation = exports.useRPCQuery = void 0;
4
- var react_1 = require("@trpc/react");
5
- // @ts-ignore
6
- var _a = (0, react_1.createReactQueryHooks)({
7
- // @ts-ignore
8
- url: process.serverlessEndpoint + "/api/trpc",
9
- }), useQuery = _a.useQuery, useMutation = _a.useMutation, createClient = _a.createClient;
10
- exports.useRPCQuery = useQuery;
11
- exports.useRPCMutation = useMutation;
12
- exports.rpcClient = createClient({
13
- // @ts-ignore
14
- url: process.serverlessEndpoint + "/api/trpc",
15
- });
@@ -1,3 +0,0 @@
1
- export declare const useRPCQuery: <TPath extends string>(pathAndInput: [TPath, (null | undefined)?], opts?: import("@trpc/react").UseTRPCQueryOptions<TPath, RPCRouter, RPCRouter, import("@trpc/react").TRPCClientErrorLike<RPCRouter>> | undefined) => import("react-query").UseQueryResult<RPCRouter, import("@trpc/react").TRPCClientErrorLike<RPCRouter>>;
2
- export declare const useRPCMutation: <TPath_1 extends string>(path: TPath_1 | [TPath_1], opts?: import("@trpc/react").UseTRPCMutationOptions<RPCRouter, import("@trpc/react").TRPCClientErrorLike<RPCRouter>, RPCRouter> | undefined) => import("react-query").UseMutationResult<RPCRouter, import("@trpc/react").TRPCClientErrorLike<RPCRouter>, RPCRouter, unknown>;
3
- export declare const rpcClient: import("@trpc/react").TRPCClient<RPCRouter>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rpcClient = exports.useRPCMutation = exports.useRPCQuery = void 0;
4
- var react_1 = require("@trpc/react");
5
- // @ts-ignore
6
- var _a = (0, react_1.createReactQueryHooks)({
7
- // @ts-ignore
8
- url: process.serverlessEndpoint + "/api/trpc",
9
- }), useQuery = _a.useQuery, useMutation = _a.useMutation, createClient = _a.createClient;
10
- exports.useRPCQuery = useQuery;
11
- exports.useRPCMutation = useMutation;
12
- exports.rpcClient = createClient({
13
- // @ts-ignore
14
- url: process.serverlessEndpoint + "/api/trpc",
15
- });