@tinacms/cli 1.5.12 → 1.5.14

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -3
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ module.exports = __toCommonJS(src_exports);
31
31
  var import_clipanion7 = require("clipanion");
32
32
 
33
33
  // package.json
34
- var version = "1.5.12";
34
+ var version = "1.5.14";
35
35
 
36
36
  // src/next/commands/dev-command/index.ts
37
37
  var import_clipanion2 = require("clipanion");
@@ -850,6 +850,7 @@ var createConfig = async ({
850
850
  __TOKEN__: `"${configManager.config.token}"`,
851
851
  __TINA_GRAPHQL_VERSION__: `"${configManager.getTinaGraphQLVersion()}"`
852
852
  },
853
+ logLevel: "error",
853
854
  optimizeDeps: {
854
855
  force: true,
855
856
  include: ["react/jsx-runtime", "react/jsx-dev-runtime"]
@@ -919,8 +920,11 @@ var createMediaRouter = (config3) => {
919
920
  };
920
921
  const handlePost = async function(req, res) {
921
922
  const bb = (0, import_busboy.default)({ headers: req.headers });
922
- bb.on("file", (name2, file, info) => {
923
- const saveTo = import_path4.default.join(mediaFolder, info.filename);
923
+ bb.on("file", async (_name, file, _info) => {
924
+ var _a;
925
+ const fullPath = (_a = req.url) == null ? void 0 : _a.slice("/media/upload/".length);
926
+ const saveTo = import_path4.default.join(mediaFolder, ...fullPath.split("/"));
927
+ await import_fs_extra2.default.ensureDir(import_path4.default.dirname(saveTo));
924
928
  file.pipe(import_fs_extra2.default.createWriteStream(saveTo));
925
929
  });
926
930
  bb.on("error", (error) => {
@@ -962,6 +966,12 @@ var MediaModel = class {
962
966
  args.searchPath
963
967
  );
964
968
  const searchPath = parseMediaFolder(args.searchPath);
969
+ if (!await import_fs_extra2.default.pathExists(folderPath)) {
970
+ return {
971
+ files: [],
972
+ directories: []
973
+ };
974
+ }
965
975
  const filesStr = await import_fs_extra2.default.readdir(folderPath);
966
976
  const filesProm = filesStr.map(async (file) => {
967
977
  const filePath = (0, import_path4.join)(folderPath, file);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
- "version": "1.5.12",
3
+ "version": "1.5.14",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -58,9 +58,9 @@
58
58
  "@tailwindcss/aspect-ratio": "^0.4.0",
59
59
  "@tailwindcss/line-clamp": "^0.3.1",
60
60
  "@tailwindcss/typography": "^0.5.9",
61
- "@tinacms/app": "1.2.12",
62
- "@tinacms/datalayer": "1.2.12",
63
- "@tinacms/graphql": "1.4.12",
61
+ "@tinacms/app": "1.2.13",
62
+ "@tinacms/datalayer": "1.2.14",
63
+ "@tinacms/graphql": "1.4.14",
64
64
  "@tinacms/metrics": "1.0.2",
65
65
  "@tinacms/schema-tools": "1.4.4",
66
66
  "@vitejs/plugin-react": "3.1.0",