@tinacms/cli 0.61.12 → 0.61.13

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.
@@ -52,11 +52,12 @@ export declare class ConfigBuilder {
52
52
  genTypedClient({ usingTs, compiledSchema, noSDK, verbose, local, }: ClientGenOptions & {
53
53
  usingTs: boolean;
54
54
  compiledSchema: any;
55
- }): Promise<void>;
55
+ }): Promise<string>;
56
56
  }
57
- export declare const buildAdmin: ({ schema, local, rootPath, }: {
57
+ export declare const buildAdmin: ({ schema, local, rootPath, apiUrl, }: {
58
58
  schema: any;
59
59
  local: boolean;
60
60
  rootPath: string;
61
+ apiUrl: string;
61
62
  }) => Promise<void>;
62
63
  export {};
@@ -16,7 +16,7 @@ export declare const TINA_HOST = "content.tinajs.io";
16
16
  export declare function genClient({ tinaSchema, usingTs, }: {
17
17
  tinaSchema: TinaCloudSchema<false>;
18
18
  usingTs?: boolean;
19
- }, next: () => void, options: any): Promise<void>;
19
+ }, options: any): Promise<string>;
20
20
  export declare function genTypes({ schema, usingTs }: {
21
21
  schema: GraphQLSchema;
22
22
  usingTs?: boolean;
@@ -12,6 +12,7 @@
12
12
  */
13
13
  import type { Bridge, Database } from '@tinacms/graphql';
14
14
  import { ConfigBuilder } from '../../buildTina';
15
+ import { TinaSchema } from '@tinacms/schema-tools';
15
16
  interface Options {
16
17
  port?: number;
17
18
  command?: string;
@@ -29,5 +30,13 @@ export declare function startServer(ctx: {
29
30
  database: Database;
30
31
  bridge: Bridge;
31
32
  usingTs: boolean;
33
+ schema?: TinaSchema & {
34
+ config?: {
35
+ build?: {
36
+ outputFolder: string;
37
+ publicFolder: string;
38
+ };
39
+ };
40
+ };
32
41
  }, next: any, { port, noWatch, noSDK, noTelemetry, watchFolders, verbose, dev, }: Options): Promise<void>;
33
42
  export {};
package/dist/index.js CHANGED
@@ -293,7 +293,7 @@ var commander = __toModule(require("commander"));
293
293
 
294
294
  // package.json
295
295
  var name = "@tinacms/cli";
296
- var version = "0.61.12";
296
+ var version = "0.61.13";
297
297
 
298
298
  // src/cmds/audit/audit.ts
299
299
  var import_graphql = __toModule(require("@tinacms/graphql"));
@@ -1282,6 +1282,7 @@ types.d.ts
1282
1282
  frags.gql
1283
1283
  queries.gql
1284
1284
  schema.gql
1285
+ out.jsx
1285
1286
  `);
1286
1287
  };
1287
1288
  var cleanup = async ({ tinaTempPath }) => {
@@ -1745,7 +1746,7 @@ var generatedPath = import_path6.default.join(root, ".tina", "__generated__");
1745
1746
  async function genClient({
1746
1747
  tinaSchema,
1747
1748
  usingTs
1748
- }, next, options) {
1749
+ }, options) {
1749
1750
  var _a, _b, _c;
1750
1751
  const branch = (_a = tinaSchema == null ? void 0 : tinaSchema.config) == null ? void 0 : _a.branch;
1751
1752
  const clientId = (_b = tinaSchema == null ? void 0 : tinaSchema.config) == null ? void 0 : _b.clientId;
@@ -1767,7 +1768,7 @@ import { queries } from "./types";
1767
1768
  export const client = createClient({ url: '${apiURL}', token: '${token}', queries });
1768
1769
  export default client;
1769
1770
  `);
1770
- return next();
1771
+ return apiURL;
1771
1772
  }
1772
1773
  async function genTypes({ schema, usingTs }, next, options) {
1773
1774
  const typesPath = process.cwd() + "/.tina/__generated__/types.ts";
@@ -1961,7 +1962,7 @@ var buildCmdBuild = async (ctx, next, options) => {
1961
1962
  const { schema } = await ctx.builder.build(__spreadValues({
1962
1963
  rootPath: ctx.rootPath
1963
1964
  }, options));
1964
- await ctx.builder.genTypedClient({
1965
+ const apiUrl = await ctx.builder.genTypedClient({
1965
1966
  compiledSchema: schema,
1966
1967
  local: options.local,
1967
1968
  noSDK: options.noSDK,
@@ -1971,7 +1972,8 @@ var buildCmdBuild = async (ctx, next, options) => {
1971
1972
  await buildAdmin({
1972
1973
  local: options.local,
1973
1974
  rootPath: ctx.rootPath,
1974
- schema
1975
+ schema,
1976
+ apiUrl
1975
1977
  });
1976
1978
  next();
1977
1979
  };
@@ -2023,8 +2025,7 @@ var ConfigBuilder = class {
2023
2025
  noSDK,
2024
2026
  verbose
2025
2027
  });
2026
- await genClient({ tinaSchema: compiledSchema, usingTs }, () => {
2027
- }, {
2028
+ return genClient({ tinaSchema: compiledSchema, usingTs }, {
2028
2029
  local
2029
2030
  });
2030
2031
  }
@@ -2032,7 +2033,8 @@ var ConfigBuilder = class {
2032
2033
  var buildAdmin = async ({
2033
2034
  schema,
2034
2035
  local,
2035
- rootPath: rootPath2
2036
+ rootPath: rootPath2,
2037
+ apiUrl
2036
2038
  }) => {
2037
2039
  var _a;
2038
2040
  if ((_a = schema == null ? void 0 : schema.config) == null ? void 0 : _a.build) {
@@ -2044,7 +2046,8 @@ var buildAdmin = async ({
2044
2046
  local,
2045
2047
  rootPath: rootPath2,
2046
2048
  outputFolder: (_b = (_a2 = schema == null ? void 0 : schema.config) == null ? void 0 : _a2.build) == null ? void 0 : _b.outputFolder,
2047
- publicFolder: (_d = (_c = schema == null ? void 0 : schema.config) == null ? void 0 : _c.build) == null ? void 0 : _d.publicFolder
2049
+ publicFolder: (_d = (_c = schema == null ? void 0 : schema.config) == null ? void 0 : _c.build) == null ? void 0 : _d.publicFolder,
2050
+ apiUrl
2048
2051
  });
2049
2052
  }
2050
2053
  });
@@ -2097,8 +2100,9 @@ async function startServer(ctx, next, {
2097
2100
  const s = (init_server3(), server_exports);
2098
2101
  state.server = await s.default(database);
2099
2102
  state.server.listen(port, () => {
2103
+ var _a, _b;
2100
2104
  const altairUrl = `http://localhost:${port}/altair/`;
2101
- const cmsUrl = `[your-development-url]/admin`;
2105
+ const cmsUrl = ((_b = (_a = ctx.schema) == null ? void 0 : _a.config) == null ? void 0 : _b.build) ? `[your-development-url]/${ctx.schema.config.build.outputFolder}/index.html` : `[your-development-url]/admin`;
2102
2106
  if (verbose)
2103
2107
  logger.info(`Started Filesystem GraphQL server on port: ${port}`);
2104
2108
  logger.info(`Visit the GraphQL playground at ${import_chalk6.default.underline.blueBright(altairUrl)}
@@ -2146,7 +2150,7 @@ or`);
2146
2150
  dev,
2147
2151
  verbose
2148
2152
  });
2149
- await ctx.builder.genTypedClient({
2153
+ const apiUrl = await ctx.builder.genTypedClient({
2150
2154
  compiledSchema: schema,
2151
2155
  local: true,
2152
2156
  noSDK,
@@ -2157,7 +2161,8 @@ or`);
2157
2161
  await buildAdmin({
2158
2162
  local: true,
2159
2163
  rootPath: ctx.rootPath,
2160
- schema
2164
+ schema,
2165
+ apiUrl
2161
2166
  });
2162
2167
  } catch (error) {
2163
2168
  throw error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
- "version": "0.61.12",
3
+ "version": "0.61.13",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -52,11 +52,11 @@
52
52
  "@graphql-codegen/visitor-plugin-common": "^2.4.0",
53
53
  "@graphql-tools/graphql-file-loader": "^7.2.0",
54
54
  "@graphql-tools/load": "^7.3.2",
55
- "@tinacms/app": "0.0.11",
55
+ "@tinacms/app": "0.0.12",
56
56
  "@tinacms/datalayer": "0.2.3",
57
- "@tinacms/graphql": "0.63.8",
57
+ "@tinacms/graphql": "0.63.9",
58
58
  "@tinacms/metrics": "0.0.3",
59
- "@tinacms/schema-tools": "0.1.2",
59
+ "@tinacms/schema-tools": "0.1.3",
60
60
  "add": "^2.0.6",
61
61
  "ajv": "^6.12.3",
62
62
  "altair-express-middleware": "4.0.6",