@tinacms/app 0.0.11 → 0.0.12

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/dist/index.js CHANGED
@@ -2,8 +2,22 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
6
  var __getProtoOf = Object.getPrototypeOf;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
7
21
  var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
22
  var __export = (target, all) => {
9
23
  __markAsModule(target);
@@ -29,36 +43,310 @@ __export(exports, {
29
43
  var import_plugin_react = __toModule(require("@vitejs/plugin-react"));
30
44
  var import_fs_extra = __toModule(require("fs-extra"));
31
45
  var import_vite = __toModule(require("vite"));
46
+ var import_path2 = __toModule(require("path"));
47
+
48
+ // src/tailwind.ts
49
+ var import_tailwindcss = __toModule(require("tailwindcss"));
50
+ var import_postcss_nested = __toModule(require("postcss-nested/index.js"));
51
+ var import_nesting = __toModule(require("tailwindcss/nesting/index.js"));
52
+ var import_defaultTheme = __toModule(require("tailwindcss/defaultTheme.js"));
53
+ var import_typography = __toModule(require("@tailwindcss/typography"));
54
+ var import_line_clamp = __toModule(require("@tailwindcss/line-clamp"));
55
+ var import_aspect_ratio = __toModule(require("@tailwindcss/aspect-ratio"));
32
56
  var import_path = __toModule(require("path"));
57
+ var viteTina = () => {
58
+ return {
59
+ name: "vite-plugin-tina",
60
+ config: () => {
61
+ const plugins = [];
62
+ const tw = (0, import_tailwindcss.default)({
63
+ important: ".tina-tailwind",
64
+ theme: {
65
+ columns: {
66
+ auto: "auto",
67
+ 1: "1",
68
+ 2: "2",
69
+ 3: "3",
70
+ 4: "4",
71
+ 5: "5",
72
+ 6: "6",
73
+ 7: "7",
74
+ 8: "8",
75
+ 9: "9",
76
+ 10: "10",
77
+ 11: "11",
78
+ 12: "12",
79
+ "3xs": "256px",
80
+ "2xs": "288px",
81
+ xs: "320px",
82
+ sm: "384px",
83
+ md: "448px",
84
+ lg: "512px",
85
+ xl: "576px",
86
+ "2xl": "672px",
87
+ "3xl": "768px",
88
+ "4xl": "896px",
89
+ "5xl": "1024px",
90
+ "6xl": "1152px",
91
+ "7xl": "1280px"
92
+ },
93
+ spacing: {
94
+ px: "1px",
95
+ 0: "0px",
96
+ 0.5: "2px",
97
+ 1: "4px",
98
+ 1.5: "6px",
99
+ 2: "8px",
100
+ 2.5: "10px",
101
+ 3: "12px",
102
+ 3.5: "14px",
103
+ 4: "16px",
104
+ 5: "20px",
105
+ 6: "24px",
106
+ 7: "28px",
107
+ 8: "32px",
108
+ 9: "36px",
109
+ 10: "40px",
110
+ 11: "44px",
111
+ 12: "48px",
112
+ 14: "56px",
113
+ 16: "64px",
114
+ 18: "72px",
115
+ 20: "80px",
116
+ 24: "96px",
117
+ 28: "114px",
118
+ 32: "128px",
119
+ 36: "144px",
120
+ 40: "160px",
121
+ 44: "176px",
122
+ 48: "192px",
123
+ 52: "208px",
124
+ 56: "224px",
125
+ 60: "240px",
126
+ 64: "256px",
127
+ 72: "288px",
128
+ 80: "320px",
129
+ 96: "384px"
130
+ },
131
+ borderRadius: {
132
+ none: "0px",
133
+ sm: "2px",
134
+ DEFAULT: "4px",
135
+ md: "6px",
136
+ lg: "8px",
137
+ xl: "12px",
138
+ "2xl": "16px",
139
+ "3xl": "24px",
140
+ full: "9999px"
141
+ },
142
+ borderWidth: {
143
+ DEFAULT: "1px",
144
+ 0: "0",
145
+ 2: "2px",
146
+ 3: "3px",
147
+ 4: "4px",
148
+ 6: "6px",
149
+ 8: "8px"
150
+ },
151
+ fontSize: {
152
+ xs: ["13px", { lineHeight: "1.33" }],
153
+ sm: ["14px", { lineHeight: "1.43" }],
154
+ base: ["16px", { lineHeight: "1.5" }],
155
+ md: ["16px", { lineHeight: "1.5" }],
156
+ lg: ["18px", { lineHeight: "1.55" }],
157
+ xl: ["20px", { lineHeight: "1.4" }],
158
+ "2xl": ["24px", { lineHeight: "1.33" }],
159
+ "3xl": ["30px", { lineHeight: "1.2" }],
160
+ "4xl": ["36px", { lineHeight: "1.1" }],
161
+ "5xl": ["48px", { lineHeight: "1" }],
162
+ "6xl": ["60px", { lineHeight: "1" }],
163
+ "7xl": ["72px", { lineHeight: "1" }],
164
+ "8xl": ["96px", { lineHeight: "1" }],
165
+ "9xl": ["128px", { lineHeight: "1" }]
166
+ },
167
+ opacity: {
168
+ 0: "0",
169
+ 5: ".05",
170
+ 7: ".07",
171
+ 10: ".1",
172
+ 15: ".15",
173
+ 20: ".2",
174
+ 25: ".25",
175
+ 30: ".3",
176
+ 40: ".4",
177
+ 50: ".5",
178
+ 60: ".6",
179
+ 70: ".7",
180
+ 75: ".75",
181
+ 80: ".8",
182
+ 90: ".9",
183
+ 100: "1"
184
+ },
185
+ zIndex: {
186
+ "-1": "-1",
187
+ base: "9000",
188
+ panel: "9400",
189
+ menu: "9800",
190
+ chrome: "10200",
191
+ overlay: "10600",
192
+ modal: "10800",
193
+ 0: "0",
194
+ 10: "10",
195
+ 20: "20",
196
+ 30: "30",
197
+ 40: "40",
198
+ 25: "25",
199
+ 50: "50",
200
+ 75: "75",
201
+ 100: "100",
202
+ auto: "auto"
203
+ },
204
+ extend: {
205
+ scale: {
206
+ 97: ".97",
207
+ 103: "1.03"
208
+ },
209
+ transitionDuration: {
210
+ 0: "0ms",
211
+ 2e3: "2000ms"
212
+ },
213
+ boxShadow: {
214
+ xs: "0 0 0 1px rgba(0, 0, 0, 0.05)",
215
+ outline: "0 0 0 3px rgba(66, 153, 225, 0.5)"
216
+ },
217
+ colors: {
218
+ blue: {
219
+ 50: "#DCEEFF",
220
+ 100: "#B4DBFF",
221
+ 200: "#85C5FE",
222
+ 300: "#4EABFE",
223
+ 400: "#2296fe",
224
+ 500: "#0084FF",
225
+ 600: "#0574e4",
226
+ 700: "#0D5DBD",
227
+ 800: "#144696",
228
+ 900: "#1D2C6C",
229
+ 1e3: "#241748"
230
+ },
231
+ gray: {
232
+ 50: "#F6F6F9",
233
+ 100: "#EDECF3",
234
+ 150: "#E6E3EF",
235
+ 200: "#E1DDEC",
236
+ 250: "#C9C5D5",
237
+ 300: "#b2adbe",
238
+ 400: "#918c9e",
239
+ 500: "#716c7f",
240
+ 600: "#565165",
241
+ 700: "#433e52",
242
+ 800: "#363145",
243
+ 900: "#252336",
244
+ 1e3: "#1c1b2e"
245
+ },
246
+ orange: {
247
+ 400: "#EB6337",
248
+ 500: "#EC4815",
249
+ 600: "#DC4419"
250
+ }
251
+ },
252
+ fontFamily: {
253
+ sans: ["Inter", ...import_defaultTheme.default.fontFamily.sans]
254
+ },
255
+ lineHeight: {
256
+ 3: "12px",
257
+ 4: "16px",
258
+ 5: "20px",
259
+ 6: "24px",
260
+ 7: "28px",
261
+ 8: "32px",
262
+ 9: "36px",
263
+ 10: "40px"
264
+ },
265
+ maxWidth: {
266
+ form: "900px"
267
+ }
268
+ }
269
+ },
270
+ content: [
271
+ import_path.default.join(__dirname, "../appFiles/src/**/*.{vue,js,ts,jsx,tsx,svelte}")
272
+ ],
273
+ plugins: [
274
+ (0, import_typography.default)({ className: "tina-prose" }),
275
+ import_line_clamp.default,
276
+ import_aspect_ratio.default
277
+ ]
278
+ });
279
+ plugins.push(import_nesting.default);
280
+ plugins.push(import_postcss_nested.default);
281
+ plugins.push(tw);
282
+ return {
283
+ css: {
284
+ postcss: {
285
+ plugins
286
+ }
287
+ }
288
+ };
289
+ }
290
+ };
291
+ };
292
+
293
+ // src/index.ts
294
+ var import_esbuild = __toModule(require("esbuild"));
33
295
  var viteBuild = async ({
34
296
  rootPath,
35
297
  outputFolder,
36
298
  publicFolder,
37
- local
299
+ local,
300
+ apiUrl
38
301
  }) => {
39
- const root = import_path.default.resolve(__dirname, "..", "appFiles");
40
- const pathToConfig = import_path.default.join(rootPath, ".tina", "config");
41
- const outDir = import_path.default.join(rootPath, publicFolder, outputFolder);
302
+ const root = import_path2.default.resolve(__dirname, "..", "appFiles");
303
+ const pathToConfig = import_path2.default.join(rootPath, ".tina", "config");
304
+ const packageJSONFilePath = import_path2.default.join(rootPath, "package.json");
305
+ const outDir = import_path2.default.join(rootPath, publicFolder, outputFolder);
42
306
  await import_fs_extra.default.emptyDir(outDir);
43
307
  await import_fs_extra.default.ensureDir(outDir);
44
- await import_fs_extra.default.writeFile(import_path.default.join(rootPath, publicFolder, outputFolder, ".gitignore"), `index.html
308
+ await import_fs_extra.default.writeFile(import_path2.default.join(rootPath, publicFolder, outputFolder, ".gitignore"), `index.html
45
309
  assets/
46
310
  vite.svg`);
311
+ const packageJSON = JSON.parse(import_fs_extra.default.readFileSync(packageJSONFilePath).toString() || "{}");
312
+ const define = {};
313
+ const deps = (packageJSON == null ? void 0 : packageJSON.dependencies) || [];
314
+ const peerDeps = (packageJSON == null ? void 0 : packageJSON.peerDependencies) || [];
315
+ const devDeps = (packageJSON == null ? void 0 : packageJSON.devDependencies) || [];
316
+ const external = Object.keys(__spreadValues(__spreadValues(__spreadValues({}, deps), peerDeps), devDeps));
317
+ const out = import_path2.default.join(rootPath, ".tina", "__generated__", "out.jsx");
318
+ await (0, import_esbuild.build)({
319
+ bundle: true,
320
+ platform: "browser",
321
+ target: ["es2020"],
322
+ entryPoints: [pathToConfig],
323
+ format: "esm",
324
+ treeShaking: true,
325
+ outfile: out,
326
+ external: [...external, "./node_modules/*"],
327
+ loader: loaders,
328
+ define
329
+ });
47
330
  const base = `/${outputFolder}/`;
48
331
  const config = {
49
332
  root,
50
333
  base,
51
334
  mode: local ? "development" : "production",
52
- plugins: [(0, import_plugin_react.default)()],
335
+ plugins: [(0, import_plugin_react.default)(), viteTina()],
53
336
  define: {
54
- "process.env": {}
337
+ "process.env": {},
338
+ __API_URL__: `"${apiUrl}"`
55
339
  },
56
340
  server: {
57
- strictPort: true
341
+ strictPort: true,
342
+ port: 5173,
343
+ fs: {
344
+ strict: false
345
+ }
58
346
  },
59
347
  resolve: {
60
348
  alias: {
61
- TINA_IMPORT: pathToConfig
349
+ TINA_IMPORT: out
62
350
  }
63
351
  },
64
352
  build: {
@@ -68,7 +356,41 @@ vite.svg`);
68
356
  },
69
357
  logLevel: "silent"
70
358
  };
71
- await (0, import_vite.build)(config);
359
+ if (true) {
360
+ await (0, import_vite.build)(config);
361
+ await import_fs_extra.default.rmSync(out);
362
+ } else {
363
+ const indexDev = await import_fs_extra.default.readFileSync(import_path2.default.join(root, "index.dev.html")).toString();
364
+ await import_fs_extra.default.writeFileSync(import_path2.default.join(outDir, "index.html"), indexDev);
365
+ const server = await createServer(config);
366
+ await server.listen();
367
+ await server.printUrls();
368
+ }
369
+ };
370
+ var loaders = {
371
+ ".aac": "file",
372
+ ".css": "file",
373
+ ".eot": "file",
374
+ ".flac": "file",
375
+ ".gif": "file",
376
+ ".jpeg": "file",
377
+ ".jpg": "file",
378
+ ".json": "json",
379
+ ".mp3": "file",
380
+ ".mp4": "file",
381
+ ".ogg": "file",
382
+ ".otf": "file",
383
+ ".png": "file",
384
+ ".svg": "file",
385
+ ".ttf": "file",
386
+ ".wav": "file",
387
+ ".webm": "file",
388
+ ".webp": "file",
389
+ ".woff": "file",
390
+ ".woff2": "file",
391
+ ".js": "jsx",
392
+ ".jsx": "jsx",
393
+ ".tsx": "tsx"
72
394
  };
73
395
  // Annotate the CommonJS export names for ESM import in node:
74
396
  0 && (module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/app",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -15,8 +15,7 @@
15
15
  "script.mjs",
16
16
  "package.json",
17
17
  "public",
18
- "appFiles/src",
19
- "appFiles/index.html",
18
+ "appFiles",
20
19
  "tsconfig.json",
21
20
  "tsconfig.node.json",
22
21
  "vite.config.ts"
@@ -31,25 +30,40 @@
31
30
  ]
32
31
  },
33
32
  "devDependencies": {
33
+ "@types/fs-extra": "^9.0.1",
34
34
  "@types/react": "17.0.2",
35
- "@types/react-dom": "17.0.2",
36
- "@types/fs-extra": "^9.0.1"
35
+ "@types/react-dom": "17.0.2"
37
36
  },
38
37
  "dependencies": {
38
+ "@headlessui/react": "^1.6.6",
39
+ "@heroicons/react": "^1.0.6",
40
+ "@tailwindcss/aspect-ratio": "^0.4.0",
41
+ "@tailwindcss/line-clamp": "^0.3.1",
42
+ "@tailwindcss/typography": "^0.5.4",
43
+ "@tinacms/schema-tools": "0.1.3",
39
44
  "@tinacms/scripts": "0.51.1",
40
45
  "@vitejs/plugin-react": "1.3.2",
46
+ "@xstate/react": "^3.0.0",
47
+ "autoprefixer": "^10.4.0",
48
+ "final-form": "^4.20.7",
41
49
  "fs-extra": "^9.0.1",
50
+ "esbuild": "^0.15.5",
51
+ "graphql": "^15.1.0",
52
+ "jest": "^27.0.6",
53
+ "postcss": "^8.4.14",
54
+ "postcss-nested": "^5.0.6",
42
55
  "react": "17.0.2",
43
56
  "react-dom": "17.0.2",
44
- "tinacms": "0.69.6",
57
+ "react-router-dom": "6",
58
+ "tailwindcss": "^3.1.6",
59
+ "tinacms": "0.69.7",
45
60
  "typescript": "^4.6.4",
46
61
  "vite": "^2.4.3",
47
62
  "vite-node": "^0.18.1",
48
- "jest": "^27.0.6"
63
+ "xstate": "^4.32.1"
49
64
  },
50
65
  "scripts": {
51
- "types": "pnpm tsc",
52
- "build": "tinacms-scripts build",
53
- "test": "jest --passWithNoTests"
66
+ "types": "rm dist/index.d.ts && touch dist/index.d.ts && echo \"export declare const viteBuild: (args: any) => any\" > dist/index.d.ts",
67
+ "build": "tinacms-scripts build"
54
68
  }
55
69
  }