create-tina-app 0.1.0 → 0.1.1

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,6 +1,14 @@
1
1
  # create-tina-app
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 127b0ae5d: Use the github URL instead of the local copy
8
+ - 10a36f3a0: Fix issue where startup time was very slow
9
+
3
10
  ## 0.1.0
11
+
4
12
  ### Minor Changes
5
13
 
6
14
  - e792dd0fd: Added basic Create Tina App
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ var __toModule = (module2) => {
22
22
  return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
23
23
  };
24
24
 
25
- // pnp:/home/runner/work/tinacms/tinacms/packages/create-tina-app/src/index.ts
25
+ // pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/src/index.ts
26
26
  __export(exports, {
27
27
  run: () => run
28
28
  });
@@ -30,11 +30,11 @@ var import_commander = __toModule(require("commander"));
30
30
  var import_prompts = __toModule(require("prompts"));
31
31
  var import_path4 = __toModule(require("path"));
32
32
 
33
- // pnp:/home/runner/work/tinacms/tinacms/packages/create-tina-app/package.json
33
+ // pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/package.json
34
34
  var name = "create-tina-app";
35
35
  var version = "0.1.0";
36
36
 
37
- // pnp:/home/runner/work/tinacms/tinacms/packages/create-tina-app/src/util/fileUtil.ts
37
+ // pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/src/util/fileUtil.ts
38
38
  var import_fs = __toModule(require("fs"));
39
39
  var import_path = __toModule(require("path"));
40
40
  var import_chalk = __toModule(require("chalk"));
@@ -94,7 +94,7 @@ function isFolderEmpty(root, name2) {
94
94
  return true;
95
95
  }
96
96
 
97
- // pnp:/home/runner/work/tinacms/tinacms/packages/create-tina-app/src/util/install.ts
97
+ // pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/src/util/install.ts
98
98
  var import_chalk2 = __toModule(require("chalk"));
99
99
  var import_cross_spawn = __toModule(require("cross-spawn"));
100
100
  function install(root, dependencies, { useYarn, isOnline, devDependencies }) {
@@ -152,13 +152,15 @@ function install(root, dependencies, { useYarn, isOnline, devDependencies }) {
152
152
  });
153
153
  }
154
154
 
155
- // pnp:/home/runner/work/tinacms/tinacms/packages/create-tina-app/src/index.ts
156
- var import_chalk4 = __toModule(require("chalk"));
155
+ // pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/src/index.ts
156
+ var import_chalk5 = __toModule(require("chalk"));
157
157
 
158
- // pnp:/home/runner/work/tinacms/tinacms/packages/create-tina-app/src/util/git.ts
158
+ // pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/src/util/git.ts
159
159
  var import_child_process = __toModule(require("child_process"));
160
160
  var import_path2 = __toModule(require("path"));
161
161
  var import_rimraf = __toModule(require("rimraf"));
162
+ var import_fs_extra = __toModule(require("fs-extra"));
163
+ var import_chalk3 = __toModule(require("chalk"));
162
164
  function isInGitRepository() {
163
165
  try {
164
166
  (0, import_child_process.execSync)("git rev-parse --is-inside-work-tree", { stdio: "ignore" });
@@ -182,6 +184,15 @@ function tryGitInit(root) {
182
184
  if (isInGitRepository() || isInMercurialRepository()) {
183
185
  return false;
184
186
  }
187
+ if (!import_fs_extra.default.existsSync(".gitignore")) {
188
+ console.warn(import_chalk3.default.yellow("There is no .gitignore file in this repository, creating one..."));
189
+ import_fs_extra.default.writeFileSync(".gitignore", `node_modules
190
+ .yarn/*
191
+ .DS_Store
192
+ .cache
193
+ .next/
194
+ `);
195
+ }
185
196
  (0, import_child_process.execSync)("git init", { stdio: "ignore" });
186
197
  didInit = true;
187
198
  (0, import_child_process.execSync)("git checkout -b main", { stdio: "ignore" });
@@ -201,10 +212,10 @@ function tryGitInit(root) {
201
212
  }
202
213
  }
203
214
 
204
- // pnp:/home/runner/work/tinacms/tinacms/packages/create-tina-app/src/index.ts
215
+ // pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/src/index.ts
205
216
  var import_process = __toModule(require("process"));
206
217
 
207
- // pnp:/home/runner/work/tinacms/tinacms/packages/create-tina-app/src/util/examples.ts
218
+ // pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/src/util/examples.ts
208
219
  var import_got = __toModule(require("got"));
209
220
  var import_stream = __toModule(require("stream"));
210
221
  var import_util = __toModule(require("util"));
@@ -230,12 +241,17 @@ function downloadAndExtractRepo(root, { username, name: name2, branch, filePath
230
241
  return pipeline(import_got.default.stream(`https://codeload.github.com/${username}/${name2}/tar.gz/${branch}`), import_tar.default.extract({ cwd: root, strip: filePath ? filePath.split("/").length + 1 : 1 }, [`${name2}-${branch}${filePath ? `/${filePath}` : ""}`]));
231
242
  }
232
243
 
233
- // pnp:/home/runner/work/tinacms/tinacms/packages/create-tina-app/src/examples.ts
234
- var import_chalk3 = __toModule(require("chalk"));
235
- var import_fs_extra = __toModule(require("fs-extra"));
244
+ // pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/src/examples.ts
245
+ var import_chalk4 = __toModule(require("chalk"));
246
+ var import_fs_extra2 = __toModule(require("fs-extra"));
236
247
  var import_path3 = __toModule(require("path"));
237
248
  var EXAMPLES = [
238
- { title: "Basic", value: "basic", isInternal: true },
249
+ {
250
+ title: "Bare bones starter",
251
+ value: "basic",
252
+ isInternal: false,
253
+ gitURL: "https://github.com/tinacms/tina-basic-starter"
254
+ },
239
255
  {
240
256
  title: "Tailwind Starter",
241
257
  value: "tina-cloud-starter",
@@ -259,18 +275,18 @@ var downloadExample = async (example, root) => {
259
275
  const repoURL = new URL(example.gitURL);
260
276
  const repoInfo = await getRepoInfo(repoURL);
261
277
  const repoInfo2 = repoInfo;
262
- console.log(`Downloading files from repo ${import_chalk3.default.cyan(repoInfo.username + "/" + repoInfo.name)}. This might take a moment.`);
278
+ console.log(`Downloading files from repo ${import_chalk4.default.cyan(repoInfo.username + "/" + repoInfo.name)}. This might take a moment.`);
263
279
  await downloadAndExtractRepo(root, repoInfo2);
264
280
  } else {
265
281
  const exampleFile = import_path3.default.join(__dirname, "..", "examples", example.value);
266
- await (0, import_fs_extra.copy)(`${exampleFile}/`, "./");
282
+ await (0, import_fs_extra2.copy)(`${exampleFile}/`, "./");
267
283
  }
268
284
  };
269
285
 
270
- // pnp:/home/runner/work/tinacms/tinacms/packages/create-tina-app/src/index.ts
286
+ // pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/src/index.ts
271
287
  var program = new import_commander.Command(name);
272
288
  var projectName = "";
273
- program.version(version).option("-e, --example <example>", "Choose which example to start from").option("-d, --dir <dir>", "Choose which directory to run this script from").arguments("[project-directory]").usage(`${import_chalk4.default.green("<project-directory>")} [options]`).action((name2) => {
289
+ program.version(version).option("-e, --example <example>", "Choose which example to start from").option("-d, --dir <dir>", "Choose which directory to run this script from").arguments("[project-directory]").usage(`${import_chalk5.default.green("<project-directory>")} [options]`).action((name2) => {
274
290
  projectName = name2;
275
291
  });
276
292
  var run = async () => {
@@ -301,7 +317,6 @@ var run = async () => {
301
317
  projectName = res2.name;
302
318
  }
303
319
  const dirName = projectName;
304
- let isInternalExample = false;
305
320
  if (!example) {
306
321
  const res2 = await (0, import_prompts.default)({
307
322
  name: "example",
@@ -310,7 +325,7 @@ var run = async () => {
310
325
  choices: EXAMPLES
311
326
  });
312
327
  if (typeof res2.example !== "string") {
313
- console.error(import_chalk4.default.red("Input must be a string"));
328
+ console.error(import_chalk5.default.red("Input must be a string"));
314
329
  (0, import_process.exit)(1);
315
330
  }
316
331
  example = res2.example;
@@ -335,29 +350,25 @@ var run = async () => {
335
350
  console.log("Installing packages. This might take a couple of minutes.");
336
351
  console.log();
337
352
  await install(root, null, { useYarn, isOnline: true });
338
- console.log(import_chalk4.default.green("Finished installing all packages"));
353
+ console.log(import_chalk5.default.green("Finished installing all packages"));
339
354
  console.log();
340
355
  if (tryGitInit(root)) {
341
356
  console.log("Initialized a git repository.");
342
357
  console.log();
343
358
  }
344
- console.log(`${import_chalk4.default.green("Success!")} Created ${appName} at ${root}`);
345
- console.log("Inside that directory, you can run several commands:");
346
- console.log();
347
- console.log(import_chalk4.default.cyan(` ${displayedCommand} ${useYarn ? "" : "run "}dev`));
348
- console.log(" Starts the development server.");
349
- console.log();
350
- console.log(import_chalk4.default.cyan(` ${displayedCommand} ${useYarn ? "" : "run "}build`));
351
- console.log(" Builds the app for production.");
352
- console.log();
353
- console.log(import_chalk4.default.cyan(` ${displayedCommand} start`));
354
- console.log(" Runs the built app in production mode.");
359
+ console.log(`${import_chalk5.default.green("Success!")} Created ${appName} at ${root}`);
360
+ console.log(import_chalk5.default.bold(" To launch your app, run:"));
355
361
  console.log();
356
- console.log("We suggest that you begin by typing:");
362
+ console.log(import_chalk5.default.cyan(" cd"), appName);
363
+ console.log(` ${import_chalk5.default.cyan(`${displayedCommand} ${useYarn ? "" : "run "}dev`)}`);
357
364
  console.log();
358
- console.log(import_chalk4.default.cyan(" cd"), appName);
359
- console.log(` ${import_chalk4.default.cyan(`${displayedCommand} ${useYarn ? "" : "run "}dev`)}`);
365
+ console.log(import_chalk5.default.bold(" Next steps:"));
360
366
  console.log();
367
+ console.log("- Go to http://localhost:3000/admin to enter edit-mode");
368
+ console.log("- Edit some content on http://localhost:3000 (See https://tina.io/using-tina-editor )");
369
+ console.log("- Check out our concept docs, to learn how Tina powers the starters under the hood. (See https://tina.io/docs/schema/)");
370
+ console.log("- Learn how Tina can be extended to create new field components. (See https://tina.io/docs/advanced/extending-tina/) ");
371
+ console.log("- Make your site editable with Tina on production. (See https://tina.io/docs/tina-cloud/ ");
361
372
  };
362
373
  run();
363
374
  // Annotate the CommonJS export names for ESM import in node:
@@ -22,8 +22,8 @@
22
22
  "react-dom": "^16.14.0",
23
23
  "react-icons": "^4.2.0",
24
24
  "react-is": "^17.0.2",
25
- "react-tinacms-editor": "^0.52.5",
26
- "react-tinacms-inline": "^0.53.5",
25
+ "react-tinacms-editor": "^0.52.8",
26
+ "react-tinacms-inline": "^0.53.8",
27
27
  "styled-components": "^5.3.0",
28
28
  "tinacms": "latest"
29
29
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tina-app",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",