@tinacms/scripts 1.2.0 → 1.2.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.
Files changed (2) hide show
  1. package/dist/index.js +22 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -57,6 +57,21 @@ var import_chokidar = __toESM(require("chokidar"));
57
57
  var import_node_child_process = require("child_process");
58
58
  var import_chalk = __toESM(require("chalk"));
59
59
  var commander = __toESM(require("commander"));
60
+ var deepMerge = (target, source) => {
61
+ for (const key in source) {
62
+ if (!source.hasOwnProperty(key) || key === "__proto__" || key === "constructor") continue;
63
+ if (source[key] instanceof Object && !Array.isArray(source[key]) && target.hasOwnProperty(key)) {
64
+ target[key] = deepMerge(target[key], source[key]);
65
+ } else if (Array.isArray(source[key]) && Array.isArray(target[key])) {
66
+ target[key] = [.../* @__PURE__ */ new Set([...target[key], ...source[key]])];
67
+ } else if (Array.isArray(source[key])) {
68
+ target[key] = [...source[key]];
69
+ } else {
70
+ target[key] = source[key];
71
+ }
72
+ }
73
+ return target;
74
+ };
60
75
  var program = new commander.Command("Tina Build");
61
76
  var registerCommands = (commands, noHelp = false) => {
62
77
  commands.forEach((command, i) => {
@@ -312,6 +327,12 @@ var buildIt = async (entryPoint, packageJSON) => {
312
327
  sourcemap: false,
313
328
  // true | 'inline' (note: inline will go straight into your bundle size)
314
329
  rollupOptions: {
330
+ onwarn(warning, warn) {
331
+ if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
332
+ return;
333
+ }
334
+ warn(warning);
335
+ },
315
336
  // /**
316
337
  // * FIXME: rollup-plugin-node-polyfills is only needed for node targets
317
338
  // */
@@ -337,7 +358,7 @@ var buildIt = async (entryPoint, packageJSON) => {
337
358
  }
338
359
  }
339
360
  };
340
- const buildConfig = packageJSON.buildConfig ? __spreadValues(__spreadValues({}, defaultBuildConfig), packageJSON.buildConfig) : defaultBuildConfig;
361
+ const buildConfig = packageJSON.buildConfig ? deepMerge(defaultBuildConfig, packageJSON.buildConfig) : defaultBuildConfig;
341
362
  await (0, import_vite.build)(__spreadValues({}, buildConfig));
342
363
  await import_fs_extra.default.outputFileSync(
343
364
  import_node_path.default.join(outInfo.outdir, `${outInfo.outfile}.d.ts`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/scripts",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",
@@ -20,7 +20,7 @@
20
20
  "esbuild": "^0.15.5",
21
21
  "fs-extra": "^9.0.1",
22
22
  "tsup": "^8.1.2",
23
- "typescript": "^5.5.4",
23
+ "typescript": "^5.6.2",
24
24
  "vite": "^4.3.9"
25
25
  },
26
26
  "scripts": {