@tinacms/scripts 0.50.9 → 0.51.0
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 +176 -0
- package/bin/tina-build +0 -0
- package/dist/{chunk-2QE2RGUD.js → chunk-NYQD2IPW.js} +5 -3
- package/dist/index.js +65 -76
- package/dist/jest-runner.js +3 -3
- package/package.json +7 -9
- package/CHANGELOG.md +0 -141
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
|
File without changes
|
|
@@ -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(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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: "
|
|
97
|
-
description: "
|
|
98
|
-
|
|
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]");
|
|
@@ -335,11 +345,11 @@ var config = (cwd = "") => {
|
|
|
335
345
|
},
|
|
336
346
|
content: [_path2.default.join(cwd, "src/**/*.{vue,js,ts,jsx,tsx,svelte}")],
|
|
337
347
|
plugins: [
|
|
338
|
-
|
|
348
|
+
_chunkNYQD2IPWjs.__require.call(void 0, "@tailwindcss/typography")({
|
|
339
349
|
className: "tina-prose"
|
|
340
350
|
}),
|
|
341
|
-
|
|
342
|
-
|
|
351
|
+
_chunkNYQD2IPWjs.__require.call(void 0, "@tailwindcss/line-clamp"),
|
|
352
|
+
_chunkNYQD2IPWjs.__require.call(void 0, "@tailwindcss/aspect-ratio")
|
|
343
353
|
],
|
|
344
354
|
corePlugins: {
|
|
345
355
|
preflight: false
|
|
@@ -351,35 +361,53 @@ var buildIt = async (entryPoint, packageJSON) => {
|
|
|
351
361
|
const target = typeof entryPoint === "string" ? "browser" : entryPoint.target;
|
|
352
362
|
const deps = packageJSON.dependencies;
|
|
353
363
|
const peerDeps = packageJSON.peerDependencies;
|
|
354
|
-
const external = Object.keys(
|
|
364
|
+
const external = Object.keys(_chunkNYQD2IPWjs.__spreadValues.call(void 0, _chunkNYQD2IPWjs.__spreadValues.call(void 0, {}, deps), peerDeps));
|
|
355
365
|
const globals = {};
|
|
356
366
|
external.forEach((ext) => globals[ext] = "NOOP");
|
|
357
367
|
if (target === "node") {
|
|
358
368
|
if (["@tinacms/graphql", "@tinacms/datalayer"].includes(packageJSON.name)) {
|
|
359
369
|
await _esbuild.build.call(void 0, {
|
|
360
|
-
plugins: [_esbuildpluginpnp.pnpPlugin.call(void 0, )],
|
|
361
370
|
entryPoints: [_path2.default.join(process.cwd(), entry)],
|
|
362
371
|
bundle: true,
|
|
363
372
|
platform: "node",
|
|
364
373
|
target: "node12",
|
|
365
|
-
|
|
374
|
+
outfile: _path2.default.join(process.cwd(), "dist", "index.js"),
|
|
366
375
|
external: external.filter((item) => !packageJSON.buildConfig.entryPoints[0].bundle.includes(item))
|
|
367
376
|
});
|
|
377
|
+
} else if (["@tinacms/mdx"].includes(packageJSON.name)) {
|
|
378
|
+
const peerDeps2 = packageJSON.peerDependencies;
|
|
379
|
+
const external2 = Object.keys(_chunkNYQD2IPWjs.__spreadValues.call(void 0, {}, peerDeps2));
|
|
380
|
+
await _esbuild.build.call(void 0, {
|
|
381
|
+
entryPoints: [_path2.default.join(process.cwd(), entry)],
|
|
382
|
+
bundle: true,
|
|
383
|
+
platform: "node",
|
|
384
|
+
target: "node12",
|
|
385
|
+
format: "cjs",
|
|
386
|
+
outfile: _path2.default.join(process.cwd(), "dist", "index.js"),
|
|
387
|
+
external: external2
|
|
388
|
+
});
|
|
368
389
|
} else {
|
|
369
390
|
await _esbuild.build.call(void 0, {
|
|
370
|
-
plugins: [_esbuildpluginpnp.pnpPlugin.call(void 0, )],
|
|
371
391
|
entryPoints: [_path2.default.join(process.cwd(), entry)],
|
|
372
392
|
bundle: true,
|
|
373
393
|
platform: "node",
|
|
374
|
-
|
|
394
|
+
outfile: _path2.default.join(process.cwd(), "dist", "index.js"),
|
|
375
395
|
external,
|
|
376
396
|
target: "node12"
|
|
377
397
|
});
|
|
378
398
|
}
|
|
379
|
-
const
|
|
380
|
-
await
|
|
399
|
+
const extension = _path2.default.extname(entry);
|
|
400
|
+
await _fsextra2.default.writeFileSync(_path2.default.join(process.cwd(), "dist", entry.replace("src/", "").replace(extension, ".d.ts")), `export * from "../${entry.replace(extension, "")}"`);
|
|
381
401
|
return true;
|
|
382
402
|
}
|
|
403
|
+
const out = (entry2) => {
|
|
404
|
+
const { dir, name } = _path2.default.parse(entry2);
|
|
405
|
+
const outdir = dir.replace("src", "dist");
|
|
406
|
+
const outfile = name;
|
|
407
|
+
const relativeOutfile = _path2.default.join(outdir.split("/").map(() => "..").join("/"), dir, name);
|
|
408
|
+
return { outdir, outfile, relativeOutfile };
|
|
409
|
+
};
|
|
410
|
+
const outInfo = out(entry);
|
|
383
411
|
const defaultBuildConfig = {
|
|
384
412
|
plugins: [
|
|
385
413
|
{
|
|
@@ -407,15 +435,10 @@ var buildIt = async (entryPoint, packageJSON) => {
|
|
|
407
435
|
entry: _path2.default.resolve(process.cwd(), entry),
|
|
408
436
|
name: packageJSON.name,
|
|
409
437
|
fileName: (format) => {
|
|
410
|
-
|
|
411
|
-
const ext = _path2.default.extname(entry);
|
|
412
|
-
const name = base.replace(ext, "");
|
|
413
|
-
if (format === "umd") {
|
|
414
|
-
return `${name}.js`;
|
|
415
|
-
}
|
|
416
|
-
return `${name}.${format}.js`;
|
|
438
|
+
return format === "umd" ? `${outInfo.outfile}.js` : `${outInfo.outfile}.es.js`;
|
|
417
439
|
}
|
|
418
440
|
},
|
|
441
|
+
outDir: outInfo.outdir,
|
|
419
442
|
emptyOutDir: false,
|
|
420
443
|
sourcemap: false,
|
|
421
444
|
rollupOptions: {
|
|
@@ -427,46 +450,11 @@ var buildIt = async (entryPoint, packageJSON) => {
|
|
|
427
450
|
}
|
|
428
451
|
}
|
|
429
452
|
};
|
|
430
|
-
const buildConfig = packageJSON.buildConfig ?
|
|
431
|
-
await _vite.build.call(void 0,
|
|
432
|
-
|
|
433
|
-
await _fs2.default.writeFileSync(_path2.default.join(process.cwd(), "dist", entry.replace("src/", "").replace(extension, ".d.ts")), `export * from "../${entry.replace(extension, "")}"`);
|
|
453
|
+
const buildConfig = packageJSON.buildConfig ? _chunkNYQD2IPWjs.__spreadValues.call(void 0, _chunkNYQD2IPWjs.__spreadValues.call(void 0, {}, defaultBuildConfig), packageJSON.buildConfig) : defaultBuildConfig;
|
|
454
|
+
await _vite.build.call(void 0, _chunkNYQD2IPWjs.__spreadValues.call(void 0, {}, buildConfig));
|
|
455
|
+
await _fsextra2.default.outputFileSync(_path2.default.join(outInfo.outdir, `${outInfo.outfile}.d.ts`), `export * from "${outInfo.relativeOutfile}"`);
|
|
434
456
|
return true;
|
|
435
457
|
};
|
|
436
|
-
var all = async (args) => {
|
|
437
|
-
const workspacePackageNames = [];
|
|
438
|
-
await sequential(_pnpapi2.default.getDependencyTreeRoots(), async (locator) => {
|
|
439
|
-
const pkg = _pnpapi2.default.getPackageInformation(locator);
|
|
440
|
-
const packageJSON = JSON.parse(await _fs2.default.readFileSync(_path2.default.join(pkg.packageLocation, "package.json")).toString());
|
|
441
|
-
workspacePackageNames.push(packageJSON.name);
|
|
442
|
-
});
|
|
443
|
-
const workspacePkgs = [];
|
|
444
|
-
await sequential(_pnpapi2.default.getDependencyTreeRoots(), async (locator) => {
|
|
445
|
-
const pkg = _pnpapi2.default.getPackageInformation(locator);
|
|
446
|
-
const packageJSON = JSON.parse(await _fs2.default.readFileSync(_path2.default.join(pkg.packageLocation, "package.json")).toString());
|
|
447
|
-
if (!packageJSON.private) {
|
|
448
|
-
workspacePkgs.push(_path2.default.join(pkg.packageLocation, "src"));
|
|
449
|
-
}
|
|
450
|
-
});
|
|
451
|
-
if (args.watch) {
|
|
452
|
-
console.log(`${_chalk2.default.blue(`Watching workspaces...`)}`);
|
|
453
|
-
_chokidar2.default.watch(workspacePkgs, {
|
|
454
|
-
ignored: "**/spec/**/*"
|
|
455
|
-
}).on("change", async (path2) => {
|
|
456
|
-
const packageLocator = _pnpapi2.default.findPackageLocator(path2);
|
|
457
|
-
const packageInformation = _pnpapi2.default.getPackageInformation(packageLocator);
|
|
458
|
-
await run({ dir: packageInformation.packageLocation });
|
|
459
|
-
});
|
|
460
|
-
} else {
|
|
461
|
-
console.log(`${_chalk2.default.blue(`Building workspaces...`)}`);
|
|
462
|
-
const packagePathsToBuild = await _fs2.default.readFileSync(_path2.default.resolve("../../../topologicalDeps.txt")).toString().split("\n").filter((stdout) => {
|
|
463
|
-
return stdout.includes("packages");
|
|
464
|
-
}).map((line) => line.split(" ").pop());
|
|
465
|
-
await sequential(packagePathsToBuild, async (packagePath) => {
|
|
466
|
-
await run({ dir: packagePath });
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
};
|
|
470
458
|
var sequential = async (items, callback) => {
|
|
471
459
|
const accum = [];
|
|
472
460
|
if (!items) {
|
|
@@ -489,4 +477,5 @@ var sequential = async (items, callback) => {
|
|
|
489
477
|
|
|
490
478
|
|
|
491
479
|
|
|
492
|
-
|
|
480
|
+
|
|
481
|
+
exports.buildIt = buildIt; exports.init = init; exports.run = run; exports.sequential = sequential;
|
package/dist/jest-runner.js
CHANGED
|
@@ -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
|
|
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 =
|
|
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.
|
|
3
|
+
"version": "0.51.0",
|
|
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
|
|
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,7 +20,6 @@
|
|
|
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",
|
|
@@ -48,5 +41,10 @@
|
|
|
48
41
|
"vite": "^2.4.3",
|
|
49
42
|
"vite-plugin-dts": "^0.5.3",
|
|
50
43
|
"yargs": "^17.0.1"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build:all": "bin/tina-build build:all",
|
|
47
|
+
"watch": "bin/tina-build watch",
|
|
48
|
+
"build": "yarn tsup src/jest-runner.ts src/css-transform.ts src/index.ts --format cjs"
|
|
51
49
|
}
|
|
52
50
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
## 0.50.9
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- 2ef5a1f33: fix scale isssue, truncate form label to filename
|
|
8
|
-
|
|
9
|
-
## 0.50.8
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- 1f7d3ca3d: Use custom wrapper class for tailwind type plugin
|
|
14
|
-
- 6c17f0160: fix scale isssue, truncate form label to filename
|
|
15
|
-
|
|
16
|
-
## 0.50.7
|
|
17
|
-
|
|
18
|
-
### Patch Changes
|
|
19
|
-
|
|
20
|
-
- 3ff1de06a: Upgrade to Tailwind 3
|
|
21
|
-
|
|
22
|
-
## 0.50.6
|
|
23
|
-
|
|
24
|
-
### Patch Changes
|
|
25
|
-
|
|
26
|
-
- a05546eb4: Added basic open source telemetry
|
|
27
|
-
|
|
28
|
-
See [this discussion](https://github.com/tinacms/tinacms/discussions/2451) for more information and how to opt out.
|
|
29
|
-
|
|
30
|
-
## 0.50.5
|
|
31
|
-
|
|
32
|
-
### Patch Changes
|
|
33
|
-
|
|
34
|
-
- 6a50a1368: Updates the look and feel of the Tina Sidebar
|
|
35
|
-
|
|
36
|
-
## 0.50.4
|
|
37
|
-
|
|
38
|
-
### Patch Changes
|
|
39
|
-
|
|
40
|
-
- 138ceb8c4: Clean up dependencies
|
|
41
|
-
|
|
42
|
-
## 0.50.3
|
|
43
|
-
|
|
44
|
-
### Patch Changes
|
|
45
|
-
|
|
46
|
-
- 667c33e2a: Add support for rich-text field, update build script to work with unified packages, which are ESM-only
|
|
47
|
-
|
|
48
|
-
## 0.50.2
|
|
49
|
-
|
|
50
|
-
### Patch Changes
|
|
51
|
-
|
|
52
|
-
- 9b27192fe: Build packages with new scripting, which includes preliminary support for ES modules.
|
|
53
|
-
|
|
54
|
-
## 0.50.0
|
|
55
|
-
|
|
56
|
-
### Minor Changes
|
|
57
|
-
|
|
58
|
-
- 7f3c8c1a: # 🔧 Changes coming to TinaCMS ⚙️
|
|
59
|
-
|
|
60
|
-
👋 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.
|
|
61
|
-
|
|
62
|
-
## Consolidating @tinacms packages in to @tinacms/toolkit
|
|
63
|
-
|
|
64
|
-
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`
|
|
65
|
-
|
|
66
|
-
We'll also be rolling out esm support as it's now much easier to address build improvements
|
|
67
|
-
|
|
68
|
-
## A more focused tinacms package
|
|
69
|
-
|
|
70
|
-
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.
|
|
71
|
-
|
|
72
|
-
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
|
|
73
|
-
Note: tinacms still exports the same APIs, but we'll gradually start moving the backend-agnostic tools to @tinacms/toolkit.
|
|
74
|
-
|
|
75
|
-
## Consolidating the tina-graphql-gateway repo
|
|
76
|
-
|
|
77
|
-
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.
|
|
78
|
-
|
|
79
|
-
## Moving from Lerna to Yarn PNP
|
|
80
|
-
|
|
81
|
-
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.
|
|
82
|
-
|
|
83
|
-
## FAQ
|
|
84
|
-
|
|
85
|
-
### What about other backends?
|
|
86
|
-
|
|
87
|
-
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.
|
|
88
|
-
|
|
89
|
-
### Do I need to do anything?
|
|
90
|
-
|
|
91
|
-
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.
|
|
92
|
-
When we move to `1.0.0` we'll be pushing internal APIs to `@tinacms/toolkit`, so that's the long-term location of
|
|
93
|
-
|
|
94
|
-
### Will you continue to patch older versions?
|
|
95
|
-
|
|
96
|
-
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.
|
|
97
|
-
|
|
98
|
-
All notable changes to this project will be documented in this file.
|
|
99
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
100
|
-
|
|
101
|
-
# [0.39.0](https://github.com/tinacms/tinacms/compare/v0.38.0...v0.39.0) (2021-03-30)
|
|
102
|
-
|
|
103
|
-
### Bug Fixes
|
|
104
|
-
|
|
105
|
-
- copyright ([e4323c2](https://github.com/tinacms/tinacms/commit/e4323c25b7e893005bffad1827018b523b7f6939)), closes [#1778](https://github.com/tinacms/tinacms/issues/1778)
|
|
106
|
-
|
|
107
|
-
# [0.29.0](https://github.com/tinacms/tinacms/compare/v0.28.0...v0.29.0) (2020-08-25)
|
|
108
|
-
|
|
109
|
-
**Note:** Version bump only for package @tinacms/scripts
|
|
110
|
-
|
|
111
|
-
# [0.26.0](https://github.com/tinacms/tinacms/compare/v0.25.0...v0.26.0) (2020-08-03)
|
|
112
|
-
|
|
113
|
-
**Note:** Version bump only for package @tinacms/scripts
|
|
114
|
-
|
|
115
|
-
## [0.1.13](https://github.com/tinacms/tinacms/compare/@tinacms/scripts@0.1.13-alpha.0...@tinacms/scripts@0.1.13) (2020-03-09)
|
|
116
|
-
|
|
117
|
-
**Note:** Version bump only for package @tinacms/scripts
|
|
118
|
-
|
|
119
|
-
## [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)
|
|
120
|
-
|
|
121
|
-
**Note:** Version bump only for package @tinacms/scripts
|
|
122
|
-
|
|
123
|
-
## [0.1.12](https://github.com/tinacms/tinacms/compare/@tinacms/scripts@0.1.12-alpha.0...@tinacms/scripts@0.1.12) (2020-02-11)
|
|
124
|
-
|
|
125
|
-
**Note:** Version bump only for package @tinacms/scripts
|
|
126
|
-
|
|
127
|
-
## [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)
|
|
128
|
-
|
|
129
|
-
**Note:** Version bump only for package @tinacms/scripts
|
|
130
|
-
|
|
131
|
-
## [0.1.11](https://github.com/tinacms/tinacms/compare/@tinacms/scripts@0.1.11-alpha.1...@tinacms/scripts@0.1.11) (2019-11-18)
|
|
132
|
-
|
|
133
|
-
**Note:** Version bump only for package @tinacms/scripts
|
|
134
|
-
|
|
135
|
-
## [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)
|
|
136
|
-
|
|
137
|
-
**Note:** Version bump only for package @tinacms/scripts
|
|
138
|
-
|
|
139
|
-
## [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)
|
|
140
|
-
|
|
141
|
-
**Note:** Version bump only for package @tinacms/scripts
|