@tinacms/scripts 0.50.4 → 0.50.7

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,25 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.50.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 3ff1de06a: Upgrade to Tailwind 3
8
+
9
+ ## 0.50.6
10
+
11
+ ### Patch Changes
12
+
13
+ - a05546eb4: Added basic open source telemetry
14
+
15
+ See [this discussion](https://github.com/tinacms/tinacms/discussions/2451) for more information and how to opt out.
16
+
17
+ ## 0.50.5
18
+
19
+ ### Patch Changes
20
+
21
+ - 6a50a1368: Updates the look and feel of the Tina Sidebar
22
+
3
23
  ## 0.50.4
4
24
 
5
25
  ### Patch 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,6 +1,7 @@
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');
@@ -9,11 +10,15 @@ var _esbuildpluginpnp = require('@yarnpkg/esbuild-plugin-pnp');
9
10
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
10
11
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
11
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);
15
+ var _nesting = require('tailwindcss/nesting'); var _nesting2 = _interopRequireDefault(_nesting);
12
16
 
13
17
 
14
18
  var _commander = require('commander');
15
19
  var _pnpapi = require('pnpapi'); var _pnpapi2 = _interopRequireDefault(_pnpapi);
16
20
  var _chokidar = require('chokidar'); var _chokidar2 = _interopRequireDefault(_chokidar);
21
+ var defaultTheme = _chunk2QE2RGUDjs.__require.call(void 0, "tailwindcss/defaultTheme");
17
22
  var program = new (0, _commander.Command)("Tina Build");
18
23
  var registerCommands = (commands, noHelp = false) => {
19
24
  commands.forEach((command, i) => {
@@ -119,16 +124,236 @@ e.g: "forestry types:gen --help"
119
124
  }
120
125
  program.parse(args);
121
126
  }
127
+ var config = (cwd = "") => {
128
+ return {
129
+ important: ".tina-tailwind",
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
+ 150: "#E6E3EF",
301
+ 200: "#E1DDEC",
302
+ 250: "#C9C5D5",
303
+ 300: "#b2adbe",
304
+ 400: "#918c9e",
305
+ 500: "#716c7f",
306
+ 600: "#565165",
307
+ 700: "#433e52",
308
+ 800: "#363145",
309
+ 900: "#252336",
310
+ 1e3: "#1c1b2e"
311
+ },
312
+ orange: {
313
+ 400: "#EB6337",
314
+ 500: "#EC4815",
315
+ 600: "#DC4419"
316
+ }
317
+ },
318
+ fontFamily: {
319
+ sans: ["Inter", ...defaultTheme.fontFamily.sans]
320
+ },
321
+ lineHeight: {
322
+ 3: "12px",
323
+ 4: "16px",
324
+ 5: "20px",
325
+ 6: "24px",
326
+ 7: "28px",
327
+ 8: "32px",
328
+ 9: "36px",
329
+ 10: "40px"
330
+ },
331
+ maxWidth: {
332
+ form: "900px"
333
+ }
334
+ }
335
+ },
336
+ content: [_path2.default.join(cwd, "src/**/*.{vue,js,ts,jsx,tsx,svelte}")],
337
+ 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")
341
+ ],
342
+ corePlugins: {
343
+ preflight: false
344
+ }
345
+ };
346
+ };
122
347
  var buildIt = async (entryPoint, packageJSON) => {
123
348
  const entry = typeof entryPoint === "string" ? entryPoint : entryPoint.name;
124
349
  const target = typeof entryPoint === "string" ? "browser" : entryPoint.target;
125
350
  const deps = packageJSON.dependencies;
126
351
  const peerDeps = packageJSON.peerDependencies;
127
- const external = Object.keys(_chunkFTLKP6WHjs.__spreadValues.call(void 0, _chunkFTLKP6WHjs.__spreadValues.call(void 0, {}, deps), peerDeps));
352
+ const external = Object.keys(_chunk2QE2RGUDjs.__spreadValues.call(void 0, _chunk2QE2RGUDjs.__spreadValues.call(void 0, {}, deps), peerDeps));
128
353
  const globals = {};
129
354
  external.forEach((ext) => globals[ext] = "NOOP");
130
355
  if (target === "node") {
131
- if (packageJSON.name === "@tinacms/graphql") {
356
+ if (["@tinacms/graphql", "@tinacms/datalayer"].includes(packageJSON.name)) {
132
357
  await _esbuild.build.call(void 0, {
133
358
  plugins: [_esbuildpluginpnp.pnpPlugin.call(void 0, )],
134
359
  entryPoints: [_path2.default.join(process.cwd(), entry)],
@@ -145,7 +370,8 @@ var buildIt = async (entryPoint, packageJSON) => {
145
370
  bundle: true,
146
371
  platform: "node",
147
372
  outdir: _path2.default.join(process.cwd(), "dist"),
148
- external
373
+ external,
374
+ target: "node12"
149
375
  });
150
376
  }
151
377
  const extension2 = _path2.default.extname(entry);
@@ -153,8 +379,28 @@ var buildIt = async (entryPoint, packageJSON) => {
153
379
  return true;
154
380
  }
155
381
  const defaultBuildConfig = {
382
+ plugins: [
383
+ {
384
+ name: "vite-plugin-tina",
385
+ config: (_, env) => {
386
+ let plugins = [];
387
+ const tw = _tailwindcss2.default.call(void 0, config(process.cwd()));
388
+ plugins.push(_nesting2.default);
389
+ plugins.push(_postcssnested2.default);
390
+ plugins.push(tw);
391
+ return {
392
+ css: {
393
+ postcss: {
394
+ plugins
395
+ }
396
+ }
397
+ };
398
+ }
399
+ }
400
+ ],
156
401
  build: {
157
402
  minify: false,
403
+ assetsInlineLimit: 0,
158
404
  lib: {
159
405
  entry: _path2.default.resolve(process.cwd(), entry),
160
406
  name: packageJSON.name,
@@ -179,8 +425,8 @@ var buildIt = async (entryPoint, packageJSON) => {
179
425
  }
180
426
  }
181
427
  };
182
- const buildConfig = packageJSON.buildConfig ? _chunkFTLKP6WHjs.__spreadValues.call(void 0, _chunkFTLKP6WHjs.__spreadValues.call(void 0, {}, defaultBuildConfig), packageJSON.buildConfig) : defaultBuildConfig;
183
- await _vite.build.call(void 0, _chunkFTLKP6WHjs.__spreadValues.call(void 0, {}, buildConfig));
428
+ const buildConfig = packageJSON.buildConfig ? _chunk2QE2RGUDjs.__spreadValues.call(void 0, _chunk2QE2RGUDjs.__spreadValues.call(void 0, {}, defaultBuildConfig), packageJSON.buildConfig) : defaultBuildConfig;
429
+ await _vite.build.call(void 0, _chunk2QE2RGUDjs.__spreadValues.call(void 0, {}, buildConfig));
184
430
  const extension = _path2.default.extname(entry);
185
431
  await _fs2.default.writeFileSync(_path2.default.join(process.cwd(), "dist", entry.replace("src/", "").replace(extension, ".d.ts")), `export * from "../${entry.replace(extension, "")}"`);
186
432
  return true;
@@ -212,7 +458,7 @@ var all = async (args) => {
212
458
  } else {
213
459
  console.log(`${_chalk2.default.blue(`Building workspaces...`)}`);
214
460
  const packagePathsToBuild = await _fs2.default.readFileSync(_path2.default.resolve("../../../topologicalDeps.txt")).toString().split("\n").filter((stdout) => {
215
- return stdout.includes("tinacms/packages");
461
+ return stdout.includes("packages");
216
462
  }).map((line) => line.split(" ").pop());
217
463
  await sequential(packagePathsToBuild, async (packagePath) => {
218
464
  await run({ dir: packagePath });
@@ -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 _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,
@@ -19,7 +19,7 @@ var require_jest_runner = _chunkFTLKP6WHjs.__commonJS.call(void 0, {
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",
22
- "\\.(css|scss)$": "identity-obj-proxy"
22
+ "\\.(css|less|scss|sass)$": "@tinacms/scripts/__mocks__/styleMock.js"
23
23
  }
24
24
  };
25
25
  module.exports = {
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@tinacms/scripts",
3
- "version": "0.50.4",
3
+ "version": "0.50.7",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",
7
7
  "bin/*",
8
+ "__mocks__/styleMock.js",
8
9
  ".env"
9
10
  ],
10
11
  "license": "Apache-2.0",
@@ -14,13 +15,16 @@
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.4.0",
26
+ "@tailwindcss/line-clamp": "^0.3.1",
27
+ "@tailwindcss/typography": "^0.5.0",
24
28
  "@types/inquirer": "^6.5.0",
25
29
  "@yarnpkg/esbuild-plugin-pnp": "^1.0.0-rc.12",
26
30
  "chalk": "^4.1.1",
@@ -32,9 +36,13 @@
32
36
  "execa": "^5.1.1",
33
37
  "express": "^4.17.1",
34
38
  "fs-extra": "^9.0.1",
39
+ "identity-obj-proxy": "^3.0.0",
35
40
  "jest": "^27.0.6",
36
41
  "meow": "^10.0.1",
37
42
  "normalize-path": "^3.0.0",
43
+ "postcss": "^8.4.5",
44
+ "postcss-nested": "^5.0.6",
45
+ "tailwindcss": "^3.0.13",
38
46
  "tsup": "^4.12.5",
39
47
  "typescript": "^4.2.2",
40
48
  "vite": "^2.4.3",