@tinacms/scripts 0.0.0-20225819424 → 0.0.0-20230111181923

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.
package/LICENSE ADDED
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
package/bin/tina-build CHANGED
@@ -1,5 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require = require('esm')(module)
4
- const build = require('../dist')
5
- build.init(process.argv)
3
+ require('../dist/index.js').init(process.argv)
@@ -14,11 +14,13 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
- var __require = (x) => {
17
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
18
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
19
+ }) : x)(function(x) {
18
20
  if (typeof require !== "undefined")
19
- return require(x);
21
+ return require.apply(this, arguments);
20
22
  throw new Error('Dynamic require of "' + x + '" is not supported');
21
- };
23
+ });
22
24
  var __commonJS = (cb, mod) => function __require2() {
23
25
  return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
26
  };
package/dist/index.js CHANGED
@@ -1,14 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
3
 
4
- var _chunk2QE2RGUDjs = require('./chunk-2QE2RGUD.js');
4
+ var _chunkNYQD2IPWjs = require('./chunk-NYQD2IPW.js');
5
5
 
6
6
  // src/index.ts
7
7
  var _vite = require('vite');
8
8
  var _esbuild = require('esbuild');
9
- var _esbuildpluginpnp = require('@yarnpkg/esbuild-plugin-pnp');
10
- var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
9
+ var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
11
10
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
11
+ var _chokidar = require('chokidar'); var _chokidar2 = _interopRequireDefault(_chokidar);
12
+ var _child_process = require('child_process');
12
13
  var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
13
14
  var _tailwindcss = require('tailwindcss'); var _tailwindcss2 = _interopRequireDefault(_tailwindcss);
14
15
  var _postcssnested = require('postcss-nested'); var _postcssnested2 = _interopRequireDefault(_postcssnested);
@@ -16,9 +17,7 @@ var _nesting = require('tailwindcss/nesting'); var _nesting2 = _interopRequireDe
16
17
 
17
18
 
18
19
  var _commander = require('commander');
19
- var _pnpapi = require('pnpapi'); var _pnpapi2 = _interopRequireDefault(_pnpapi);
20
- var _chokidar = require('chokidar'); var _chokidar2 = _interopRequireDefault(_chokidar);
21
- var defaultTheme = _chunk2QE2RGUDjs.__require.call(void 0, "tailwindcss/defaultTheme");
20
+ var defaultTheme = _chunkNYQD2IPWjs.__require.call(void 0, "tailwindcss/defaultTheme");
22
21
  var program = new (0, _commander.Command)("Tina Build");
23
22
  var registerCommands = (commands, noHelp = false) => {
24
23
  commands.forEach((command, i) => {
@@ -59,7 +58,7 @@ var run = async (args) => {
59
58
  process.chdir(args.dir);
60
59
  }
61
60
  const packageDir = process.cwd();
62
- const packageJSON = JSON.parse(await _fs2.default.readFileSync(_path2.default.join(packageDir, "package.json")).toString());
61
+ const packageJSON = JSON.parse(await _fsextra2.default.readFileSync(_path2.default.join(packageDir, "package.json")).toString());
63
62
  if (["@tinacms/scripts", "@tinacms/webpack-helpers"].includes(packageJSON.name)) {
64
63
  console.log(`skipping ${packageJSON.name}`);
65
64
  return;
@@ -79,6 +78,27 @@ var run = async (args) => {
79
78
  throw new Error(e);
80
79
  }
81
80
  };
81
+ var watch = () => {
82
+ _child_process.exec.call(void 0, "pnpm list -r --json", (error, stdout, stderr) => {
83
+ if (error) {
84
+ console.error(`exec error: ${error}`);
85
+ return;
86
+ }
87
+ const json = JSON.parse(stdout);
88
+ const watchPaths = [];
89
+ json.forEach((pkg) => {
90
+ if (pkg.path.includes("/packages/")) {
91
+ watchPaths.push(pkg.path);
92
+ }
93
+ });
94
+ _chokidar2.default.watch(watchPaths.map((p) => _path2.default.join(p, "src", "**/*")), {
95
+ ignored: ["**/spec/**/*", "node_modules"]
96
+ }).on("change", async (path2) => {
97
+ const changedPackagePath = watchPaths.find((p) => path2.startsWith(p));
98
+ await run({ dir: changedPackagePath });
99
+ });
100
+ });
101
+ };
82
102
  async function init(args) {
83
103
  registerCommands([
84
104
  {
@@ -93,19 +113,9 @@ async function init(args) {
93
113
  action: (options) => run(options)
94
114
  },
95
115
  {
96
- command: "build:all",
97
- description: "Build all packages",
98
- options: [
99
- {
100
- name: "--watch",
101
- description: "Watch for file changes and rebuild"
102
- },
103
- {
104
- name: "--lines",
105
- description: "add the lines"
106
- }
107
- ],
108
- action: (options) => all(options)
116
+ command: "watch",
117
+ description: "Watch",
118
+ action: () => watch()
109
119
  }
110
120
  ]);
111
121
  program.usage("command [options]");
@@ -180,7 +190,7 @@ var config = (cwd = "") => {
180
190
  18: "72px",
181
191
  20: "80px",
182
192
  24: "96px",
183
- 28: "11px",
193
+ 28: "114px",
184
194
  32: "128px",
185
195
  36: "144px",
186
196
  40: "160px",
@@ -268,6 +278,22 @@ var config = (cwd = "") => {
268
278
  auto: "auto"
269
279
  },
270
280
  extend: {
281
+ keyframes: {
282
+ slideIn: {
283
+ "0%": {
284
+ opacity: "0",
285
+ transform: "translateY(-1rem)"
286
+ },
287
+ "100%": {
288
+ opacity: "1",
289
+ transform: "translateY(0)"
290
+ }
291
+ }
292
+ },
293
+ animation: {
294
+ "slide-in": "slideIn 150ms ease-out 1 normal forwards",
295
+ "spin-reverse": "spin 1s linear infinite reverse"
296
+ },
271
297
  scale: {
272
298
  97: ".97",
273
299
  103: "1.03"
@@ -330,14 +356,22 @@ var config = (cwd = "") => {
330
356
  },
331
357
  maxWidth: {
332
358
  form: "900px"
359
+ },
360
+ screens: {
361
+ xs: "320px",
362
+ sm: "560px",
363
+ md: "720px",
364
+ lg: "1030px"
333
365
  }
334
366
  }
335
367
  },
336
368
  content: [_path2.default.join(cwd, "src/**/*.{vue,js,ts,jsx,tsx,svelte}")],
337
369
  plugins: [
338
- _chunk2QE2RGUDjs.__require.call(void 0, "@tailwindcss/typography"),
339
- _chunk2QE2RGUDjs.__require.call(void 0, "@tailwindcss/line-clamp"),
340
- _chunk2QE2RGUDjs.__require.call(void 0, "@tailwindcss/aspect-ratio")
370
+ _chunkNYQD2IPWjs.__require.call(void 0, "@tailwindcss/typography")({
371
+ className: "tina-prose"
372
+ }),
373
+ _chunkNYQD2IPWjs.__require.call(void 0, "@tailwindcss/line-clamp"),
374
+ _chunkNYQD2IPWjs.__require.call(void 0, "@tailwindcss/aspect-ratio")
341
375
  ],
342
376
  corePlugins: {
343
377
  preflight: false
@@ -349,36 +383,59 @@ var buildIt = async (entryPoint, packageJSON) => {
349
383
  const target = typeof entryPoint === "string" ? "browser" : entryPoint.target;
350
384
  const deps = packageJSON.dependencies;
351
385
  const peerDeps = packageJSON.peerDependencies;
352
- const external = Object.keys(_chunk2QE2RGUDjs.__spreadValues.call(void 0, _chunk2QE2RGUDjs.__spreadValues.call(void 0, {}, deps), peerDeps));
386
+ const external = Object.keys(_chunkNYQD2IPWjs.__spreadValues.call(void 0, _chunkNYQD2IPWjs.__spreadValues.call(void 0, {}, deps), peerDeps));
353
387
  const globals = {};
388
+ const out = (entry2) => {
389
+ const { dir, name } = _path2.default.parse(entry2);
390
+ const outdir = dir.replace("src", "dist");
391
+ const outfile = name;
392
+ const relativeOutfile = _path2.default.join(outdir.split("/").map(() => "..").join("/"), dir, name);
393
+ return { outdir, outfile, relativeOutfile };
394
+ };
395
+ const outInfo = out(entry);
354
396
  external.forEach((ext) => globals[ext] = "NOOP");
355
397
  if (target === "node") {
356
398
  if (["@tinacms/graphql", "@tinacms/datalayer"].includes(packageJSON.name)) {
357
399
  await _esbuild.build.call(void 0, {
358
- plugins: [_esbuildpluginpnp.pnpPlugin.call(void 0, )],
359
400
  entryPoints: [_path2.default.join(process.cwd(), entry)],
360
401
  bundle: true,
361
402
  platform: "node",
362
403
  target: "node12",
363
- outdir: _path2.default.join(process.cwd(), "dist"),
404
+ outfile: _path2.default.join(process.cwd(), "dist", "index.js"),
364
405
  external: external.filter((item) => !packageJSON.buildConfig.entryPoints[0].bundle.includes(item))
365
406
  });
407
+ } else if (["@tinacms/mdx"].includes(packageJSON.name)) {
408
+ const peerDeps2 = packageJSON.peerDependencies;
409
+ const external2 = Object.keys(_chunkNYQD2IPWjs.__spreadValues.call(void 0, {}, peerDeps2));
410
+ await _esbuild.build.call(void 0, {
411
+ entryPoints: [_path2.default.join(process.cwd(), entry)],
412
+ bundle: true,
413
+ platform: "node",
414
+ target: "node12",
415
+ format: "cjs",
416
+ outfile: _path2.default.join(process.cwd(), "dist", "index.js"),
417
+ external: external2
418
+ });
419
+ const appMDXPath = _path2.default.join(process.cwd(), "..", "app", "appFiles", "src", "fields", "rich-text", "monaco", "mdx.js");
420
+ await _esbuild.build.call(void 0, {
421
+ entryPoints: [_path2.default.join(process.cwd(), entry)],
422
+ bundle: true,
423
+ format: "esm",
424
+ outfile: appMDXPath,
425
+ external: external2
426
+ });
366
427
  } else {
367
428
  await _esbuild.build.call(void 0, {
368
- plugins: [_esbuildpluginpnp.pnpPlugin.call(void 0, )],
369
429
  entryPoints: [_path2.default.join(process.cwd(), entry)],
370
430
  bundle: true,
371
431
  platform: "node",
372
- outdir: _path2.default.join(process.cwd(), "dist"),
432
+ outfile: _path2.default.join(process.cwd(), "dist", `${outInfo.outfile}.js`),
373
433
  external,
374
- target: "node12",
375
- define: {
376
- "process.env.TINA_INTERNAL_MONOREPO": process.env.TINA_INTERNAL_MONOREPO ? '"true"' : "'false'"
377
- }
434
+ target: "node12"
378
435
  });
379
436
  }
380
- const extension2 = _path2.default.extname(entry);
381
- await _fs2.default.writeFileSync(_path2.default.join(process.cwd(), "dist", entry.replace("src/", "").replace(extension2, ".d.ts")), `export * from "../${entry.replace(extension2, "")}"`);
437
+ const extension = _path2.default.extname(entry);
438
+ await _fsextra2.default.writeFileSync(_path2.default.join(process.cwd(), "dist", entry.replace("src/", "").replace(extension, ".d.ts")), `export * from "../${entry.replace(extension, "")}"`);
382
439
  return true;
383
440
  }
384
441
  const defaultBuildConfig = {
@@ -408,15 +465,10 @@ var buildIt = async (entryPoint, packageJSON) => {
408
465
  entry: _path2.default.resolve(process.cwd(), entry),
409
466
  name: packageJSON.name,
410
467
  fileName: (format) => {
411
- const base = _path2.default.basename(entry);
412
- const ext = _path2.default.extname(entry);
413
- const name = base.replace(ext, "");
414
- if (format === "umd") {
415
- return `${name}.js`;
416
- }
417
- return `${name}.${format}.js`;
468
+ return format === "umd" ? `${outInfo.outfile}.js` : `${outInfo.outfile}.es.js`;
418
469
  }
419
470
  },
471
+ outDir: outInfo.outdir,
420
472
  emptyOutDir: false,
421
473
  sourcemap: false,
422
474
  rollupOptions: {
@@ -428,47 +480,11 @@ var buildIt = async (entryPoint, packageJSON) => {
428
480
  }
429
481
  }
430
482
  };
431
- const buildConfig = packageJSON.buildConfig ? _chunk2QE2RGUDjs.__spreadValues.call(void 0, _chunk2QE2RGUDjs.__spreadValues.call(void 0, {}, defaultBuildConfig), packageJSON.buildConfig) : defaultBuildConfig;
432
- await _vite.build.call(void 0, _chunk2QE2RGUDjs.__spreadValues.call(void 0, {}, buildConfig));
433
- const extension = _path2.default.extname(entry);
434
- await _fs2.default.writeFileSync(_path2.default.join(process.cwd(), "dist", entry.replace("src/", "").replace(extension, ".d.ts")), `export * from "../${entry.replace(extension, "")}"`);
483
+ const buildConfig = packageJSON.buildConfig ? _chunkNYQD2IPWjs.__spreadValues.call(void 0, _chunkNYQD2IPWjs.__spreadValues.call(void 0, {}, defaultBuildConfig), packageJSON.buildConfig) : defaultBuildConfig;
484
+ await _vite.build.call(void 0, _chunkNYQD2IPWjs.__spreadValues.call(void 0, {}, buildConfig));
485
+ await _fsextra2.default.outputFileSync(_path2.default.join(outInfo.outdir, `${outInfo.outfile}.d.ts`), `export * from "${outInfo.relativeOutfile}"`);
435
486
  return true;
436
487
  };
437
- var all = async (args) => {
438
- const workspacePackageNames = [];
439
- await sequential(_pnpapi2.default.getDependencyTreeRoots(), async (locator) => {
440
- const pkg = _pnpapi2.default.getPackageInformation(locator);
441
- const packageJSON = JSON.parse(await _fs2.default.readFileSync(_path2.default.join(pkg.packageLocation, "package.json")).toString());
442
- workspacePackageNames.push(packageJSON.name);
443
- });
444
- const workspacePkgs = [];
445
- await sequential(_pnpapi2.default.getDependencyTreeRoots(), async (locator) => {
446
- const pkg = _pnpapi2.default.getPackageInformation(locator);
447
- const packageJSON = JSON.parse(await _fs2.default.readFileSync(_path2.default.join(pkg.packageLocation, "package.json")).toString());
448
- if (!packageJSON.private) {
449
- workspacePkgs.push(_path2.default.join(pkg.packageLocation, "src"));
450
- }
451
- });
452
- if (args.watch) {
453
- process.env.TINA_INTERNAL_MONOREPO = "true";
454
- console.log(`${_chalk2.default.blue(`Watching workspaces...`)}`);
455
- _chokidar2.default.watch(workspacePkgs, {
456
- ignored: "**/spec/**/*"
457
- }).on("change", async (path2) => {
458
- const packageLocator = _pnpapi2.default.findPackageLocator(path2);
459
- const packageInformation = _pnpapi2.default.getPackageInformation(packageLocator);
460
- await run({ dir: packageInformation.packageLocation });
461
- });
462
- } else {
463
- console.log(`${_chalk2.default.blue(`Building workspaces...`)}`);
464
- const packagePathsToBuild = await _fs2.default.readFileSync(_path2.default.resolve("../../../topologicalDeps.txt")).toString().split("\n").filter((stdout) => {
465
- return stdout.includes("packages");
466
- }).map((line) => line.split(" ").pop());
467
- await sequential(packagePathsToBuild, async (packagePath) => {
468
- await run({ dir: packagePath });
469
- });
470
- }
471
- };
472
488
  var sequential = async (items, callback) => {
473
489
  const accum = [];
474
490
  if (!items) {
@@ -491,4 +507,5 @@ var sequential = async (items, callback) => {
491
507
 
492
508
 
493
509
 
494
- exports.init = init; exports.run = run; exports.sequential = sequential;
510
+
511
+ exports.buildIt = buildIt; exports.init = init; exports.run = run; exports.sequential = sequential;
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunk2QE2RGUDjs = require('./chunk-2QE2RGUD.js');
3
+ var _chunkNYQD2IPWjs = require('./chunk-NYQD2IPW.js');
4
4
 
5
5
  // src/jest-runner.ts
6
6
  var _jestplugin = require('@sucrase/jest-plugin'); var _jestplugin2 = _interopRequireDefault(_jestplugin);
7
- var require_jest_runner = _chunk2QE2RGUDjs.__commonJS.call(void 0, {
7
+ var require_jest_runner = _chunkNYQD2IPWjs.__commonJS.call(void 0, {
8
8
  "src/jest-runner.ts"(exports, module) {
9
9
  var config = {
10
10
  verbose: true,
@@ -15,7 +15,7 @@ var require_jest_runner = _chunk2QE2RGUDjs.__commonJS.call(void 0, {
15
15
  transformIgnorePatterns: [],
16
16
  testRegex: "(\\.spec|.test)\\.(ts|tsx|js)$",
17
17
  modulePaths: ["<rootDir>/dir/", "<rootDir>/node_modules/"],
18
- moduleFileExtensions: ["ts", "tsx", "js"],
18
+ moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
19
19
  testPathIgnorePatterns: ["/dist/"],
20
20
  moduleNameMapper: {
21
21
  "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/../../__mocks__/fileMock.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/scripts",
3
- "version": "0.0.0-20225819424",
3
+ "version": "0.0.0-20230111181923",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",
@@ -10,13 +10,7 @@
10
10
  ],
11
11
  "license": "Apache-2.0",
12
12
  "bin": {
13
- "tinacms-scripts": "./bin/tina-build.js"
14
- },
15
- "scripts": {
16
- "build:all": "bin/tina-build build:all",
17
- "watch:all": " bin/tina-build build:all --watch",
18
- "build": "yarn tsup src/jest-runner.ts src/css-transform.ts src/index.ts --format cjs --external pnpapi",
19
- "watch": "yarn tsup src/jest-runner.ts src/css-transform.ts src/index.ts --watch --format cjs --external pnpapi"
13
+ "tinacms-scripts": "./bin/tina-build"
20
14
  },
21
15
  "dependencies": {
22
16
  "@babel/core": "^7.15.0",
@@ -26,13 +20,11 @@
26
20
  "@tailwindcss/line-clamp": "^0.3.1",
27
21
  "@tailwindcss/typography": "^0.5.0",
28
22
  "@types/inquirer": "^6.5.0",
29
- "@yarnpkg/esbuild-plugin-pnp": "^1.0.0-rc.12",
30
23
  "chalk": "^4.1.1",
31
24
  "chokidar": "^3.5.2",
32
25
  "commander": "^7.2.0",
33
26
  "esbuild": "^0.12.9",
34
27
  "esbuild-jest": "^0.5.0",
35
- "esm": "3.2.25",
36
28
  "execa": "^5.1.1",
37
29
  "express": "^4.17.1",
38
30
  "fs-extra": "^9.0.1",
@@ -48,5 +40,10 @@
48
40
  "vite": "^2.4.3",
49
41
  "vite-plugin-dts": "^0.5.3",
50
42
  "yargs": "^17.0.1"
43
+ },
44
+ "scripts": {
45
+ "build:all": "bin/tina-build build:all",
46
+ "watch": "bin/tina-build watch",
47
+ "build": "yarn tsup src/jest-runner.ts src/css-transform.ts src/index.ts --format cjs"
51
48
  }
52
49
  }
package/CHANGELOG.md DELETED
@@ -1,134 +0,0 @@
1
- # Change Log
2
-
3
- ## 0.0.0-20225819424
4
-
5
- ### Patch Changes
6
-
7
- - d9782ce8b: WIP
8
-
9
- ## 0.50.7
10
-
11
- ### Patch Changes
12
-
13
- - 3ff1de06a: Upgrade to Tailwind 3
14
-
15
- ## 0.50.6
16
-
17
- ### Patch Changes
18
-
19
- - a05546eb4: Added basic open source telemetry
20
-
21
- See [this discussion](https://github.com/tinacms/tinacms/discussions/2451) for more information and how to opt out.
22
-
23
- ## 0.50.5
24
-
25
- ### Patch Changes
26
-
27
- - 6a50a1368: Updates the look and feel of the Tina Sidebar
28
-
29
- ## 0.50.4
30
-
31
- ### Patch Changes
32
-
33
- - 138ceb8c4: Clean up dependencies
34
-
35
- ## 0.50.3
36
-
37
- ### Patch Changes
38
-
39
- - 667c33e2a: Add support for rich-text field, update build script to work with unified packages, which are ESM-only
40
-
41
- ## 0.50.2
42
-
43
- ### Patch Changes
44
-
45
- - 9b27192fe: Build packages with new scripting, which includes preliminary support for ES modules.
46
-
47
- ## 0.50.0
48
-
49
- ### Minor Changes
50
-
51
- - 7f3c8c1a: # 🔧 Changes coming to TinaCMS ⚙️
52
-
53
- 👋 You may have noticed we've been hard at-work lately building out a more opinionated approach to TinaCMS. To that end, we've settled around a few key points we'd like to announce. To see the work in progress, check out the [main](https://github.com/tinacms/tinacms/tree/main) branch, which will become the primary branch soon.
54
-
55
- ## Consolidating @tinacms packages in to @tinacms/toolkit
56
-
57
- By nature, Tina relies heavily on React context, and the dependency mismatches from over-modularizing our toolkit has led to many bugs related to missing context. To fix this, we'll be consolidating nearly every package in the @tinacms scope to a single package called `@tinacms/toolkit`
58
-
59
- We'll also be rolling out esm support as it's now much easier to address build improvements
60
-
61
- ## A more focused tinacms package
62
-
63
- The `tinacms` package now comes baked-in with APIs for working with the TinaCMS GraphQL API. Because `@tinacms/toolkit` now encompasses everything you'd need to build your own CMS integration, we're repurposing the `tinacms` package to more accurately reflect the "batteries-included" approach.
64
-
65
- If you haven't been introduced, the GraphQL API is a Git-backed CMS which we'll be leaning into more in the future. With a generous free tier and direct syncing with Github its something we're really excited to push forward. Sign up for free here
66
- Note: tinacms still exports the same APIs, but we'll gradually start moving the backend-agnostic tools to @tinacms/toolkit.
67
-
68
- ## Consolidating the tina-graphql-gateway repo
69
-
70
- The tina-graphql-gateway repo will be absorbed into this one. If you've been working with our GraphQL APIs you'll need to follow our migration guide.
71
-
72
- ## Moving from Lerna to Yarn PNP
73
-
74
- We've had success with Yarn 2 and PNP in other monorepos, if you're a contributor you'll notice some updates to the DX, which should hopefully result in a smoother experience.
75
-
76
- ## FAQ
77
-
78
- ### What about other backends?
79
-
80
- The `@tinacms/toolkit` isn't going anywhere. And if you're using packages like `react-tinacms-strapi` or r`eact-tinacms-github` with success, that won't change much, they'll just be powered by `@tinacms/toolkit` under the hood.
81
-
82
- ### Do I need to do anything?
83
-
84
- We'll be bumping all packages to `0.50.0` to reflect the changes. If you're using @tincams scoped packages those won't receive the upgrade. Unscoped packages like `react-tinacms-editor` will be upgraded, and should be bumped to 0.50.0 as well.
85
- When we move to `1.0.0` we'll be pushing internal APIs to `@tinacms/toolkit`, so that's the long-term location of
86
-
87
- ### Will you continue to patch older versions?
88
-
89
- We'll continue to make security patches, however major bug fixes will likely not see any updates. Keep in mind that `@tinacms/toolkit` will continue to be developed.
90
-
91
- All notable changes to this project will be documented in this file.
92
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
93
-
94
- # [0.39.0](https://github.com/tinacms/tinacms/compare/v0.38.0...v0.39.0) (2021-03-30)
95
-
96
- ### Bug Fixes
97
-
98
- - copyright ([e4323c2](https://github.com/tinacms/tinacms/commit/e4323c25b7e893005bffad1827018b523b7f6939)), closes [#1778](https://github.com/tinacms/tinacms/issues/1778)
99
-
100
- # [0.29.0](https://github.com/tinacms/tinacms/compare/v0.28.0...v0.29.0) (2020-08-25)
101
-
102
- **Note:** Version bump only for package @tinacms/scripts
103
-
104
- # [0.26.0](https://github.com/tinacms/tinacms/compare/v0.25.0...v0.26.0) (2020-08-03)
105
-
106
- **Note:** Version bump only for package @tinacms/scripts
107
-
108
- ## [0.1.13](https://github.com/tinacms/tinacms/compare/@tinacms/scripts@0.1.13-alpha.0...@tinacms/scripts@0.1.13) (2020-03-09)
109
-
110
- **Note:** Version bump only for package @tinacms/scripts
111
-
112
- ## [0.1.13-alpha.0](https://github.com/tinacms/tinacms/compare/@tinacms/scripts@0.1.12...@tinacms/scripts@0.1.13-alpha.0) (2020-03-05)
113
-
114
- **Note:** Version bump only for package @tinacms/scripts
115
-
116
- ## [0.1.12](https://github.com/tinacms/tinacms/compare/@tinacms/scripts@0.1.12-alpha.0...@tinacms/scripts@0.1.12) (2020-02-11)
117
-
118
- **Note:** Version bump only for package @tinacms/scripts
119
-
120
- ## [0.1.12-alpha.0](https://github.com/tinacms/tinacms/compare/@tinacms/scripts@0.1.11...@tinacms/scripts@0.1.12-alpha.0) (2020-02-11)
121
-
122
- **Note:** Version bump only for package @tinacms/scripts
123
-
124
- ## [0.1.11](https://github.com/tinacms/tinacms/compare/@tinacms/scripts@0.1.11-alpha.1...@tinacms/scripts@0.1.11) (2019-11-18)
125
-
126
- **Note:** Version bump only for package @tinacms/scripts
127
-
128
- ## [0.1.11-alpha.1](https://github.com/tinacms/tinacms/compare/@tinacms/scripts@0.1.10...@tinacms/scripts@0.1.11-alpha.1) (2019-11-18)
129
-
130
- **Note:** Version bump only for package @tinacms/scripts
131
-
132
- ## [0.1.11-alpha.0](https://github.com/tinacms/tinacms/compare/@tinacms/scripts@0.1.10...@tinacms/scripts@0.1.11-alpha.0) (2019-11-18)
133
-
134
- **Note:** Version bump only for package @tinacms/scripts