@tinacms/scripts 0.50.1 → 0.50.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.50.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 6a50a1368: Updates the look and feel of the Tina Sidebar
8
+
9
+ ## 0.50.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 138ceb8c4: Clean up dependencies
14
+
15
+ ## 0.50.3
16
+
17
+ ### Patch Changes
18
+
19
+ - 667c33e2a: Add support for rich-text field, update build script to work with unified packages, which are ESM-only
20
+
21
+ ## 0.50.2
22
+
23
+ ### Patch Changes
24
+
25
+ - 9b27192fe: Build packages with new scripting, which includes preliminary support for ES modules.
26
+
3
27
  ## 0.50.0
4
28
 
5
29
  ### Minor Changes
@@ -0,0 +1,3 @@
1
+ // __mocks__/styleMock.js
2
+
3
+ module.exports = ''
@@ -14,11 +14,17 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
- var __commonJS = (cb, mod) => function __require() {
17
+ var __require = (x) => {
18
+ if (typeof require !== "undefined")
19
+ return require(x);
20
+ throw new Error('Dynamic require of "' + x + '" is not supported');
21
+ };
22
+ var __commonJS = (cb, mod) => function __require2() {
18
23
  return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
24
  };
20
25
 
21
26
 
22
27
 
23
28
 
24
- exports.__spreadValues = __spreadValues; exports.__commonJS = __commonJS;
29
+
30
+ exports.__spreadValues = __spreadValues; exports.__require = __require; exports.__commonJS = __commonJS;
package/dist/index.js CHANGED
@@ -1,18 +1,23 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkFTLKP6WHjs = require('./chunk-FTLKP6WH.js');
3
+
4
+ var _chunk2QE2RGUDjs = require('./chunk-2QE2RGUD.js');
4
5
 
5
6
  // src/index.ts
6
7
  var _vite = require('vite');
7
8
  var _esbuild = require('esbuild');
9
+ var _esbuildpluginpnp = require('@yarnpkg/esbuild-plugin-pnp');
8
10
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
9
11
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
10
12
  var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
13
+ var _tailwindcss = require('tailwindcss'); var _tailwindcss2 = _interopRequireDefault(_tailwindcss);
14
+ var _postcssnested = require('postcss-nested'); var _postcssnested2 = _interopRequireDefault(_postcssnested);
11
15
 
12
16
 
13
17
  var _commander = require('commander');
14
18
  var _pnpapi = require('pnpapi'); var _pnpapi2 = _interopRequireDefault(_pnpapi);
15
19
  var _chokidar = require('chokidar'); var _chokidar2 = _interopRequireDefault(_chokidar);
20
+ var defaultTheme = _chunk2QE2RGUDjs.__require.call(void 0, "tailwindcss/defaultTheme");
16
21
  var program = new (0, _commander.Command)("Tina Build");
17
22
  var registerCommands = (commands, noHelp = false) => {
18
23
  commands.forEach((command, i) => {
@@ -118,29 +123,285 @@ e.g: "forestry types:gen --help"
118
123
  }
119
124
  program.parse(args);
120
125
  }
126
+ var config = (cwd = "") => {
127
+ return {
128
+ mode: "jit",
129
+ important: true,
130
+ theme: {
131
+ columns: {
132
+ auto: "auto",
133
+ 1: "1",
134
+ 2: "2",
135
+ 3: "3",
136
+ 4: "4",
137
+ 5: "5",
138
+ 6: "6",
139
+ 7: "7",
140
+ 8: "8",
141
+ 9: "9",
142
+ 10: "10",
143
+ 11: "11",
144
+ 12: "12",
145
+ "3xs": "256px",
146
+ "2xs": "288px",
147
+ xs: "320px",
148
+ sm: "384px",
149
+ md: "448px",
150
+ lg: "512px",
151
+ xl: "576px",
152
+ "2xl": "672px",
153
+ "3xl": "768px",
154
+ "4xl": "896px",
155
+ "5xl": "1024px",
156
+ "6xl": "1152px",
157
+ "7xl": "1280px"
158
+ },
159
+ spacing: {
160
+ px: "1px",
161
+ 0: "0px",
162
+ 0.5: "2px",
163
+ 1: "4px",
164
+ 1.5: "6px",
165
+ 2: "8px",
166
+ 2.5: "10px",
167
+ 3: "12px",
168
+ 3.5: "14px",
169
+ 4: "16px",
170
+ 5: "20px",
171
+ 6: "24px",
172
+ 7: "28px",
173
+ 8: "32px",
174
+ 9: "36px",
175
+ 10: "40px",
176
+ 11: "44px",
177
+ 12: "48px",
178
+ 14: "56px",
179
+ 16: "64px",
180
+ 18: "72px",
181
+ 20: "80px",
182
+ 24: "96px",
183
+ 28: "11px",
184
+ 32: "128px",
185
+ 36: "144px",
186
+ 40: "160px",
187
+ 44: "176px",
188
+ 48: "192px",
189
+ 52: "208px",
190
+ 56: "224px",
191
+ 60: "240px",
192
+ 64: "256px",
193
+ 72: "288px",
194
+ 80: "320px",
195
+ 96: "384px"
196
+ },
197
+ borderRadius: {
198
+ none: "0px",
199
+ sm: "2px",
200
+ DEFAULT: "4px",
201
+ md: "6px",
202
+ lg: "8px",
203
+ xl: "12px",
204
+ "2xl": "16px",
205
+ "3xl": "24px",
206
+ full: "9999px"
207
+ },
208
+ borderWidth: {
209
+ DEFAULT: "1px",
210
+ 0: "0",
211
+ 2: "2px",
212
+ 3: "3px",
213
+ 4: "4px",
214
+ 6: "6px",
215
+ 8: "8px"
216
+ },
217
+ fontSize: {
218
+ xs: ["13px", { lineHeight: "1.33" }],
219
+ sm: ["14px", { lineHeight: "1.43" }],
220
+ base: ["16px", { lineHeight: "1.5" }],
221
+ md: ["16px", { lineHeight: "1.5" }],
222
+ lg: ["18px", { lineHeight: "1.55" }],
223
+ xl: ["20px", { lineHeight: "1.4" }],
224
+ "2xl": ["24px", { lineHeight: "1.33" }],
225
+ "3xl": ["30px", { lineHeight: "1.2" }],
226
+ "4xl": ["36px", { lineHeight: "1.1" }],
227
+ "5xl": ["48px", { lineHeight: "1" }],
228
+ "6xl": ["60px", { lineHeight: "1" }],
229
+ "7xl": ["72px", { lineHeight: "1" }],
230
+ "8xl": ["96px", { lineHeight: "1" }],
231
+ "9xl": ["128px", { lineHeight: "1" }]
232
+ },
233
+ opacity: {
234
+ 0: "0",
235
+ 5: ".05",
236
+ 7: ".07",
237
+ 10: ".1",
238
+ 15: ".15",
239
+ 20: ".2",
240
+ 25: ".25",
241
+ 30: ".3",
242
+ 40: ".4",
243
+ 50: ".5",
244
+ 60: ".6",
245
+ 70: ".7",
246
+ 75: ".75",
247
+ 80: ".8",
248
+ 90: ".9",
249
+ 100: "1"
250
+ },
251
+ zIndex: {
252
+ "-1": -1,
253
+ base: 9e3,
254
+ panel: 9400,
255
+ menu: 9800,
256
+ chrome: 10200,
257
+ overlay: 10600,
258
+ modal: 10800,
259
+ "0": 0,
260
+ "10": 10,
261
+ "20": 20,
262
+ "30": 30,
263
+ "40": 40,
264
+ "25": 25,
265
+ "50": 50,
266
+ "75": 75,
267
+ "100": 100,
268
+ auto: "auto"
269
+ },
270
+ extend: {
271
+ scale: {
272
+ 97: ".97",
273
+ 103: "1.03"
274
+ },
275
+ transitionDuration: {
276
+ 0: "0ms",
277
+ 2e3: "2000ms"
278
+ },
279
+ boxShadow: {
280
+ xs: "0 0 0 1px rgba(0, 0, 0, 0.05)",
281
+ outline: "0 0 0 3px rgba(66, 153, 225, 0.5)"
282
+ },
283
+ colors: {
284
+ blue: {
285
+ 50: "#DCEEFF",
286
+ 100: "#B4DBFF",
287
+ 200: "#85C5FE",
288
+ 300: "#4EABFE",
289
+ 400: "#2296fe",
290
+ 500: "#0084FF",
291
+ 600: "#0574e4",
292
+ 700: "#0D5DBD",
293
+ 800: "#144696",
294
+ 900: "#1D2C6C",
295
+ 1e3: "#241748"
296
+ },
297
+ gray: {
298
+ 50: "#F6F6F9",
299
+ 100: "#EDECF3",
300
+ 200: "#E1DDEC",
301
+ 250: "#C9C5D5",
302
+ 300: "#b2adbe",
303
+ 400: "#918c9e",
304
+ 500: "#716c7f",
305
+ 600: "#565165",
306
+ 700: "#433e52",
307
+ 800: "#363145",
308
+ 900: "#252336",
309
+ 1e3: "#1c1b2e"
310
+ },
311
+ orange: {
312
+ 400: "#EB6337",
313
+ 500: "#EC4815",
314
+ 600: "#DC4419"
315
+ }
316
+ },
317
+ fontFamily: {
318
+ sans: ["Inter", ...defaultTheme.fontFamily.sans]
319
+ },
320
+ lineHeight: {
321
+ 3: "12px",
322
+ 4: "16px",
323
+ 5: "20px",
324
+ 6: "24px",
325
+ 7: "28px",
326
+ 8: "32px",
327
+ 9: "36px",
328
+ 10: "40px"
329
+ },
330
+ maxWidth: {
331
+ form: "900px"
332
+ }
333
+ }
334
+ },
335
+ variants: {
336
+ backgroundColor: ["responsive", "even", "hover", "focus"],
337
+ extend: {
338
+ animation: ["group-hover"],
339
+ padding: ["first", "last"]
340
+ }
341
+ },
342
+ purge: [_path2.default.join(cwd, "src/**/*.{vue,js,ts,jsx,tsx,svelte}")],
343
+ plugins: [
344
+ _chunk2QE2RGUDjs.__require.call(void 0, "@tailwindcss/typography"),
345
+ _chunk2QE2RGUDjs.__require.call(void 0, "@tailwindcss/line-clamp"),
346
+ _chunk2QE2RGUDjs.__require.call(void 0, "@tailwindcss/aspect-ratio")
347
+ ]
348
+ };
349
+ };
121
350
  var buildIt = async (entryPoint, packageJSON) => {
122
351
  const entry = typeof entryPoint === "string" ? entryPoint : entryPoint.name;
123
352
  const target = typeof entryPoint === "string" ? "browser" : entryPoint.target;
124
353
  const deps = packageJSON.dependencies;
125
354
  const peerDeps = packageJSON.peerDependencies;
126
- const external = Object.keys(_chunkFTLKP6WHjs.__spreadValues.call(void 0, _chunkFTLKP6WHjs.__spreadValues.call(void 0, {}, deps), peerDeps));
355
+ const external = Object.keys(_chunk2QE2RGUDjs.__spreadValues.call(void 0, _chunk2QE2RGUDjs.__spreadValues.call(void 0, {}, deps), peerDeps));
127
356
  const globals = {};
128
357
  external.forEach((ext) => globals[ext] = "NOOP");
129
358
  if (target === "node") {
130
- await _esbuild.build.call(void 0, {
131
- entryPoints: [_path2.default.join(process.cwd(), entry)],
132
- bundle: true,
133
- platform: "node",
134
- outdir: _path2.default.join(process.cwd(), "dist"),
135
- external
136
- });
359
+ if (["@tinacms/graphql", "@tinacms/datalayer"].includes(packageJSON.name)) {
360
+ await _esbuild.build.call(void 0, {
361
+ plugins: [_esbuildpluginpnp.pnpPlugin.call(void 0, )],
362
+ entryPoints: [_path2.default.join(process.cwd(), entry)],
363
+ bundle: true,
364
+ platform: "node",
365
+ target: "node12",
366
+ outdir: _path2.default.join(process.cwd(), "dist"),
367
+ external: external.filter((item) => !packageJSON.buildConfig.entryPoints[0].bundle.includes(item))
368
+ });
369
+ } else {
370
+ await _esbuild.build.call(void 0, {
371
+ plugins: [_esbuildpluginpnp.pnpPlugin.call(void 0, )],
372
+ entryPoints: [_path2.default.join(process.cwd(), entry)],
373
+ bundle: true,
374
+ platform: "node",
375
+ outdir: _path2.default.join(process.cwd(), "dist"),
376
+ external
377
+ });
378
+ }
137
379
  const extension2 = _path2.default.extname(entry);
138
380
  await _fs2.default.writeFileSync(_path2.default.join(process.cwd(), "dist", entry.replace("src/", "").replace(extension2, ".d.ts")), `export * from "../${entry.replace(extension2, "")}"`);
139
381
  return true;
140
382
  }
141
383
  const defaultBuildConfig = {
384
+ plugins: [
385
+ {
386
+ name: "vite-plugin-tina",
387
+ config: (_, env) => {
388
+ let plugins = [];
389
+ const tw = _tailwindcss2.default.call(void 0, config(process.cwd()));
390
+ plugins.push(_postcssnested2.default);
391
+ plugins.push(tw);
392
+ return {
393
+ css: {
394
+ postcss: {
395
+ plugins
396
+ }
397
+ }
398
+ };
399
+ }
400
+ }
401
+ ],
142
402
  build: {
143
403
  minify: false,
404
+ assetsInlineLimit: 0,
144
405
  lib: {
145
406
  entry: _path2.default.resolve(process.cwd(), entry),
146
407
  name: packageJSON.name,
@@ -165,8 +426,8 @@ var buildIt = async (entryPoint, packageJSON) => {
165
426
  }
166
427
  }
167
428
  };
168
- const buildConfig = packageJSON.buildConfig ? _chunkFTLKP6WHjs.__spreadValues.call(void 0, _chunkFTLKP6WHjs.__spreadValues.call(void 0, {}, defaultBuildConfig), packageJSON.buildConfig) : defaultBuildConfig;
169
- await _vite.build.call(void 0, _chunkFTLKP6WHjs.__spreadValues.call(void 0, {}, buildConfig));
429
+ const buildConfig = packageJSON.buildConfig ? _chunk2QE2RGUDjs.__spreadValues.call(void 0, _chunk2QE2RGUDjs.__spreadValues.call(void 0, {}, defaultBuildConfig), packageJSON.buildConfig) : defaultBuildConfig;
430
+ await _vite.build.call(void 0, _chunk2QE2RGUDjs.__spreadValues.call(void 0, {}, buildConfig));
170
431
  const extension = _path2.default.extname(entry);
171
432
  await _fs2.default.writeFileSync(_path2.default.join(process.cwd(), "dist", entry.replace("src/", "").replace(extension, ".d.ts")), `export * from "../${entry.replace(extension, "")}"`);
172
433
  return true;
@@ -188,7 +449,9 @@ var all = async (args) => {
188
449
  });
189
450
  if (args.watch) {
190
451
  console.log(`${_chalk2.default.blue(`Watching workspaces...`)}`);
191
- _chokidar2.default.watch(workspacePkgs).on("change", async (path2) => {
452
+ _chokidar2.default.watch(workspacePkgs, {
453
+ ignored: "**/spec/**/*"
454
+ }).on("change", async (path2) => {
192
455
  const packageLocator = _pnpapi2.default.findPackageLocator(path2);
193
456
  const packageInformation = _pnpapi2.default.getPackageInformation(packageLocator);
194
457
  await run({ dir: packageInformation.packageLocation });
@@ -196,7 +459,7 @@ var all = async (args) => {
196
459
  } else {
197
460
  console.log(`${_chalk2.default.blue(`Building workspaces...`)}`);
198
461
  const packagePathsToBuild = await _fs2.default.readFileSync(_path2.default.resolve("../../../topologicalDeps.txt")).toString().split("\n").filter((stdout) => {
199
- return stdout.includes("tinacms/packages");
462
+ return stdout.includes("packages");
200
463
  }).map((line) => line.split(" ").pop());
201
464
  await sequential(packagePathsToBuild, async (packagePath) => {
202
465
  await run({ dir: packagePath });
@@ -1,23 +1,25 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkFTLKP6WHjs = require('./chunk-FTLKP6WH.js');
3
+ var _chunk2QE2RGUDjs = require('./chunk-2QE2RGUD.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 = _chunkFTLKP6WHjs.__commonJS.call(void 0, {
7
+ var require_jest_runner = _chunk2QE2RGUDjs.__commonJS.call(void 0, {
8
8
  "src/jest-runner.ts"(exports, module) {
9
9
  var config = {
10
10
  verbose: true,
11
11
  transform: {
12
- ".(ts|tsx)": "@tinacms/scripts/dist/jest-runner.js"
12
+ ".(ts|tsx)": "@tinacms/scripts/dist/jest-runner.js",
13
+ ".(js)": "@tinacms/scripts/dist/jest-runner.js"
13
14
  },
15
+ transformIgnorePatterns: [],
14
16
  testRegex: "(\\.spec|.test)\\.(ts|tsx|js)$",
15
17
  modulePaths: ["<rootDir>/dir/", "<rootDir>/node_modules/"],
16
18
  moduleFileExtensions: ["ts", "tsx", "js"],
17
19
  testPathIgnorePatterns: ["/dist/"],
18
20
  moduleNameMapper: {
19
21
  "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/../../__mocks__/fileMock.js",
20
- "\\.(css|scss)$": "identity-obj-proxy"
22
+ "\\.(css|less|scss|sass)$": "@tinacms/scripts/__mocks__/styleMock.js"
21
23
  }
22
24
  };
23
25
  module.exports = {
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@tinacms/scripts",
3
- "version": "0.50.1",
3
+ "version": "0.50.5",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
- "dist/*",
6
+ "dist",
7
7
  "bin/*",
8
+ "__mocks__/styleMock.js",
8
9
  ".env"
9
10
  ],
10
11
  "license": "Apache-2.0",
@@ -14,13 +15,17 @@
14
15
  "scripts": {
15
16
  "build:all": "bin/tina-build build:all",
16
17
  "watch:all": "bin/tina-build build:all --watch",
17
- "build": "yarn tsup src/jest-runner.ts src/index.ts --format cjs --external pnpapi",
18
- "watch": "yarn tsup src/jest-runner.ts src/index.ts --watch --format cjs --external pnpapi"
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"
19
20
  },
20
21
  "dependencies": {
21
22
  "@babel/core": "^7.15.0",
22
23
  "@babel/plugin-transform-modules-commonjs": "^7.15.0",
23
24
  "@sucrase/jest-plugin": "^2.1.1",
25
+ "@tailwindcss/aspect-ratio": "^0.3.0",
26
+ "@tailwindcss/forms": "^0.3.4",
27
+ "@tailwindcss/line-clamp": "^0.2.2",
28
+ "@tailwindcss/typography": "^0.4.1",
24
29
  "@types/inquirer": "^6.5.0",
25
30
  "@yarnpkg/esbuild-plugin-pnp": "^1.0.0-rc.12",
26
31
  "chalk": "^4.1.1",
@@ -32,12 +37,13 @@
32
37
  "execa": "^5.1.1",
33
38
  "express": "^4.17.1",
34
39
  "fs-extra": "^9.0.1",
40
+ "identity-obj-proxy": "^3.0.0",
35
41
  "jest": "^27.0.6",
36
42
  "meow": "^10.0.1",
37
43
  "normalize-path": "^3.0.0",
38
- "rollup-plugin-dts": "^3.0.2",
39
- "rollup-plugin-node-polyfills": "^0.2.1",
40
- "ts-jest": "^26.5.3",
44
+ "postcss": "^8.3.11",
45
+ "postcss-nested": "^5.0.6",
46
+ "tailwindcss": "^2.2.19",
41
47
  "tsup": "^4.12.5",
42
48
  "typescript": "^4.2.2",
43
49
  "vite": "^2.4.3",