@tinacms/cli 2.0.1 → 2.0.2

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.
@@ -59,7 +59,6 @@ declare const forestryFieldWithoutField: z.ZodObject<{
59
59
  };
60
60
  }>>;
61
61
  }, "strip", z.ZodTypeAny, {
62
- type?: "number" | "boolean" | "file" | "text" | "color" | "include" | "list" | "datetime" | "select" | "image_gallery" | "textarea" | "tag_list" | "field_group" | "field_group_list" | "blocks";
63
62
  default?: any;
64
63
  name?: string;
65
64
  config?: {
@@ -76,10 +75,10 @@ declare const forestryFieldWithoutField: z.ZodObject<{
76
75
  };
77
76
  };
78
77
  label?: string;
78
+ type?: "number" | "boolean" | "text" | "color" | "file" | "include" | "list" | "datetime" | "select" | "image_gallery" | "textarea" | "tag_list" | "field_group" | "field_group_list" | "blocks";
79
79
  template?: string;
80
80
  template_types?: string[];
81
81
  }, {
82
- type?: "number" | "boolean" | "file" | "text" | "color" | "include" | "list" | "datetime" | "select" | "image_gallery" | "textarea" | "tag_list" | "field_group" | "field_group_list" | "blocks";
83
82
  default?: any;
84
83
  name?: string;
85
84
  config?: {
@@ -96,6 +95,7 @@ declare const forestryFieldWithoutField: z.ZodObject<{
96
95
  };
97
96
  };
98
97
  label?: string;
98
+ type?: "number" | "boolean" | "text" | "color" | "file" | "include" | "list" | "datetime" | "select" | "image_gallery" | "textarea" | "tag_list" | "field_group" | "field_group_list" | "blocks";
99
99
  template?: string;
100
100
  template_types?: string[];
101
101
  }>;
@@ -149,12 +149,12 @@ export declare const parseSections: ({ val }: {
149
149
  val: unknown;
150
150
  }) => {
151
151
  sections?: {
152
- exclude?: string;
153
- type?: "heading" | "document" | "directory" | "jekyll-pages" | "jekyll-posts";
154
152
  match?: string;
155
153
  templates?: string[];
156
154
  label?: string;
157
155
  path?: string;
156
+ type?: "heading" | "document" | "directory" | "jekyll-pages" | "jekyll-posts";
157
+ exclude?: string;
158
158
  create?: "none" | "all" | "documents";
159
159
  new_doc_ext?: string;
160
160
  read_only?: boolean;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { Cli, Builtins } from "clipanion";
3
3
 
4
4
  // package.json
5
- var version = "2.0.1";
5
+ var version = "2.0.2";
6
6
 
7
7
  // src/next/commands/dev-command/index.ts
8
8
  import path8 from "path";
@@ -28,15 +28,15 @@ function isUnicodeSupported() {
28
28
  }
29
29
 
30
30
  // src/logger/index.ts
31
- import log4js from "log4js";
32
- var logger = log4js.getLogger();
33
- log4js.configure({
34
- appenders: {
35
- out: { type: "stdout", layout: { type: "messagePassThrough" } }
36
- },
37
- categories: { default: { appenders: ["out"], level: "info" } }
38
- });
39
- logger.level = "info";
31
+ var logger = {
32
+ level: "info",
33
+ info: (msg) => process.stdout.write(msg + "\n"),
34
+ warn: (msg) => process.stdout.write(msg + "\n"),
35
+ error: (msg) => process.stderr.write(msg + "\n"),
36
+ debug: (msg) => {
37
+ if (logger.level === "debug") process.stdout.write(msg + "\n");
38
+ }
39
+ };
40
40
  function ansiRegex() {
41
41
  const pattern = [
42
42
  "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
@@ -1115,20 +1115,12 @@ var ConfigManager = class {
1115
1115
  this.generatedFolderPath,
1116
1116
  "config.prebuild.jsx"
1117
1117
  );
1118
- const nativeNodeModulesPlugin = {
1119
- name: "native-node-modules",
1120
- setup(build3) {
1121
- build3.onResolve({ filter: /^node:.*/ }, (args) => {
1122
- return {
1123
- path: args.path,
1124
- external: true
1125
- };
1126
- });
1127
- }
1128
- };
1129
1118
  const outfile = path3.join(tmpdir, "config.build.jsx");
1130
1119
  const outfile2 = path3.join(tmpdir, "config.build.mjs");
1131
1120
  const tempTSConfigFile = path3.join(tmpdir, "tsconfig.json");
1121
+ const esmRequireBanner = {
1122
+ js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`
1123
+ };
1132
1124
  fs2.outputFileSync(tempTSConfigFile, "{}");
1133
1125
  const result2 = await esbuild.build({
1134
1126
  entryPoints: [configFilePath],
@@ -1158,12 +1150,12 @@ var ConfigManager = class {
1158
1150
  platform: "node",
1159
1151
  format: "esm",
1160
1152
  outfile,
1161
- loader: loaders
1153
+ loader: loaders,
1154
+ banner: esmRequireBanner
1162
1155
  });
1163
1156
  await esbuild.build({
1164
1157
  entryPoints: [outfile],
1165
1158
  bundle: true,
1166
- // Suppress warning about comparison with -0 from client module
1167
1159
  logLevel: "silent",
1168
1160
  platform: "node",
1169
1161
  target: ["esnext"],
@@ -5072,7 +5064,7 @@ var generateAllTemplates = async ({
5072
5064
  });
5073
5065
  templateMap.set(tem, { fields, templateObj });
5074
5066
  } catch (e) {
5075
- logger.log(`Error parsing template frontmatter template', tem + '.yml'`);
5067
+ logger.warn(`Error parsing template frontmatter template, ${tem}.yml`);
5076
5068
  console.error(e);
5077
5069
  templateMap.set(tem, { fields: [], templateObj: {} });
5078
5070
  }
@@ -5116,7 +5108,7 @@ var generateCollectionFromForestrySection = (args) => {
5116
5108
  }
5117
5109
  if (section.type === "directory") {
5118
5110
  if (!section?.path || section.path === "/" || section.path === "./" || section.path === ".") {
5119
- logger.log(
5111
+ logger.warn(
5120
5112
  warnText(
5121
5113
  `Warning: Section ${section.label} is using a Root Path. Currently, Tina Does not support Root paths see ${linkText(
5122
5114
  "https://github.com/tinacms/tinacms/issues/3768"
@@ -5253,7 +5245,7 @@ var generateCollectionFromForestrySection = (args) => {
5253
5245
  fields
5254
5246
  };
5255
5247
  } else {
5256
- logger.log(
5248
+ logger.warn(
5257
5249
  warnText(
5258
5250
  `Error: document section has an unsupported file extension: ${extname} in ${section.path}`
5259
5251
  )
@@ -6528,9 +6520,7 @@ ${titleText(" TinaCMS ")} has been initialized!`));
6528
6520
  );
6529
6521
  if (framework.name === "hugo") {
6530
6522
  logger.info(
6531
- focusText("Hugo is required. "),
6532
- "Don't have Hugo installed? Follow this guide to set it up: ",
6533
- linkText("https://gohugo.io/installation/")
6523
+ focusText("Hugo is required. ") + "Don't have Hugo installed? Follow this guide to set it up: " + linkText("https://gohugo.io/installation/")
6534
6524
  );
6535
6525
  }
6536
6526
  logger.info(
@@ -1,5 +1,10 @@
1
- import log4js from 'log4js';
2
- export declare const logger: log4js.Logger;
1
+ export declare const logger: {
2
+ level: string;
3
+ info: (msg: string) => boolean;
4
+ warn: (msg: string) => boolean;
5
+ error: (msg: string) => boolean;
6
+ debug: (msg: string) => void;
7
+ };
3
8
  export declare const note: (message?: string, title?: string) => void;
4
9
  export declare const log: (message?: string) => void;
5
10
  export declare const warn: (message?: string, path?: string) => void;
@@ -1,36 +1,16 @@
1
1
  /**
2
2
 
3
3
  */
4
- export declare const successText: import("chalk").Chalk & {
5
- supportsColor: import("chalk").ColorSupport;
6
- };
7
- export declare const focusText: import("chalk").Chalk & {
8
- supportsColor: import("chalk").ColorSupport;
9
- };
10
- export declare const dangerText: import("chalk").Chalk & {
11
- supportsColor: import("chalk").ColorSupport;
12
- };
13
- export declare const neutralText: import("chalk").Chalk & {
14
- supportsColor: import("chalk").ColorSupport;
15
- };
16
- export declare const linkText: import("chalk").Chalk & {
17
- supportsColor: import("chalk").ColorSupport;
18
- };
19
- export declare const labelText: import("chalk").Chalk & {
20
- supportsColor: import("chalk").ColorSupport;
21
- };
22
- export declare const cmdText: import("chalk").Chalk & {
23
- supportsColor: import("chalk").ColorSupport;
24
- };
4
+ export declare const successText: import("chalk").ChalkInstance;
5
+ export declare const focusText: import("chalk").ChalkInstance;
6
+ export declare const dangerText: import("chalk").ChalkInstance;
7
+ export declare const neutralText: import("chalk").ChalkInstance;
8
+ export declare const linkText: import("chalk").ChalkInstance;
9
+ export declare const labelText: import("chalk").ChalkInstance;
10
+ export declare const cmdText: import("chalk").ChalkInstance;
25
11
  export declare const indentedCmd: (str: any) => string;
26
12
  export declare const indentText: (str: any) => string;
27
- export declare const logText: import("chalk").Chalk & {
28
- supportsColor: import("chalk").ColorSupport;
29
- };
30
- export declare const warnText: import("chalk").Chalk & {
31
- supportsColor: import("chalk").ColorSupport;
32
- };
33
- export declare const titleText: import("chalk").Chalk & {
34
- supportsColor: import("chalk").ColorSupport;
35
- };
13
+ export declare const logText: import("chalk").ChalkInstance;
14
+ export declare const warnText: import("chalk").ChalkInstance;
15
+ export declare const titleText: import("chalk").ChalkInstance;
36
16
  export declare const CONFIRMATION_TEXT: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
3
  "type": "module",
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "files": [
@@ -36,13 +36,12 @@
36
36
  "@types/jest": "26.0.4",
37
37
  "@types/js-yaml": "^4.0.9",
38
38
  "@types/listr": "0.14.2",
39
- "@types/log4js": "^2.3.5",
40
39
  "@types/multer": "^1.4.12",
41
40
  "@types/node": "^22.13.1",
42
41
  "@types/progress": "^2.0.7",
43
42
  "@types/prompts": "^2.4.9",
44
43
  "jest": "^29.7.0",
45
- "@tinacms/scripts": "1.4.1"
44
+ "@tinacms/scripts": "1.4.2"
46
45
  },
47
46
  "dependencies": {
48
47
  "@graphql-codegen/core": "^2.6.8",
@@ -64,7 +63,7 @@
64
63
  "auto-bind": "^4.0.0",
65
64
  "body-parser": "^1.20.3",
66
65
  "busboy": "^1.6.0",
67
- "chalk": "^2.4.2",
66
+ "chalk": "^5.4.1",
68
67
  "chokidar": "^3.6.0",
69
68
  "cli-spinner": "^0.2.10",
70
69
  "clipanion": "^3.2.1",
@@ -75,7 +74,6 @@
75
74
  "fs-extra": "^11.3.0",
76
75
  "graphql": "15.8.0",
77
76
  "js-yaml": "^4.1.0",
78
- "log4js": "^6.9.1",
79
77
  "many-level": "^2.0.0",
80
78
  "memory-level": "^1.0.0",
81
79
  "minimatch": "^5.1.6",
@@ -90,12 +88,12 @@
90
88
  "vite": "^4.5.9",
91
89
  "yup": "^1.6.1",
92
90
  "zod": "^3.24.2",
93
- "@tinacms/app": "2.3.13",
94
- "@tinacms/metrics": "2.0.0",
91
+ "@tinacms/app": "2.3.14",
92
+ "@tinacms/metrics": "2.0.1",
93
+ "tinacms": "3.0.2",
95
94
  "@tinacms/schema-tools": "2.0.0",
96
- "@tinacms/search": "1.1.4",
97
- "@tinacms/graphql": "2.0.0",
98
- "tinacms": "3.0.1"
95
+ "@tinacms/graphql": "2.0.1",
96
+ "@tinacms/search": "1.1.5"
99
97
  },
100
98
  "publishConfig": {
101
99
  "registry": "https://registry.npmjs.org"