create-tina-app 0.0.0-20211029224716 → 0.1.2
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 +15 -1
- package/dist/index.js +46 -40
- package/examples/tina-tailwind-sidebar-demo/package.json +2 -2
- package/package.json +1 -1
- package/examples/basic/.tina/__generated__/_graphql.json +0 -2304
- package/examples/basic/.tina/__generated__/_lookup.json +0 -56
- package/examples/basic/.tina/__generated__/_schema.json +0 -57
- package/examples/basic/.tina/__generated__/config/schema.json +0 -38
- package/examples/basic/.tina/__generated__/schema.gql +0 -159
- package/examples/basic/.tina/__generated__/types.ts +0 -285
- package/examples/basic/.tina/schema.ts +0 -40
- package/examples/basic/README.md +0 -24
- package/examples/basic/components/Layout.js +0 -28
- package/examples/basic/content/page/home.mdx +0 -2
- package/examples/basic/content/post/HelloWorld.md +0 -7
- package/examples/basic/next.config.js +0 -1
- package/examples/basic/package.json +0 -23
- package/examples/basic/pages/_app.js +0 -33
- package/examples/basic/pages/admin/[[...slug]].js +0 -3
- package/examples/basic/pages/index.js +0 -30
- package/examples/basic/pages/posts/[slug].js +0 -64
- package/examples/basic/pages/posts/index.js +0 -44
- package/examples/basic/public/favicon.ico +0 -0
- package/examples/basic/public/vercel.svg +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
# create-tina-app
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 371fc73dd: remove tailwind site builder from list of starters
|
|
8
|
+
|
|
9
|
+
## 0.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 127b0ae5d: Use the github URL instead of the local copy
|
|
14
|
+
- 10a36f3a0: Fix issue where startup time was very slow
|
|
15
|
+
|
|
16
|
+
## 0.1.0
|
|
17
|
+
|
|
4
18
|
### Minor Changes
|
|
5
19
|
|
|
6
20
|
- 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:/
|
|
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:/
|
|
33
|
+
// pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/package.json
|
|
34
34
|
var name = "create-tina-app";
|
|
35
|
-
var version = "0.
|
|
35
|
+
var version = "0.1.2";
|
|
36
36
|
|
|
37
|
-
// pnp:/
|
|
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:/
|
|
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:/
|
|
156
|
-
var
|
|
155
|
+
// pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/src/index.ts
|
|
156
|
+
var import_chalk5 = __toModule(require("chalk"));
|
|
157
157
|
|
|
158
|
-
// pnp:/
|
|
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:/
|
|
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:/
|
|
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:/
|
|
234
|
-
var
|
|
235
|
-
var
|
|
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
|
-
{
|
|
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",
|
|
@@ -247,11 +263,6 @@ var EXAMPLES = [
|
|
|
247
263
|
value: "tina-docs-starter",
|
|
248
264
|
isInternal: false,
|
|
249
265
|
gitURL: "https://github.com/tinacms/tina-docs-starter"
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
title: "Tailwind Site Builder",
|
|
253
|
-
value: "tina-tailwind-sidebar-demo",
|
|
254
|
-
isInternal: true
|
|
255
266
|
}
|
|
256
267
|
];
|
|
257
268
|
var downloadExample = async (example, root) => {
|
|
@@ -259,18 +270,18 @@ var downloadExample = async (example, root) => {
|
|
|
259
270
|
const repoURL = new URL(example.gitURL);
|
|
260
271
|
const repoInfo = await getRepoInfo(repoURL);
|
|
261
272
|
const repoInfo2 = repoInfo;
|
|
262
|
-
console.log(`Downloading files from repo ${
|
|
273
|
+
console.log(`Downloading files from repo ${import_chalk4.default.cyan(repoInfo.username + "/" + repoInfo.name)}. This might take a moment.`);
|
|
263
274
|
await downloadAndExtractRepo(root, repoInfo2);
|
|
264
275
|
} else {
|
|
265
276
|
const exampleFile = import_path3.default.join(__dirname, "..", "examples", example.value);
|
|
266
|
-
await (0,
|
|
277
|
+
await (0, import_fs_extra2.copy)(`${exampleFile}/`, "./");
|
|
267
278
|
}
|
|
268
279
|
};
|
|
269
280
|
|
|
270
|
-
// pnp:/
|
|
281
|
+
// pnp:/Users/jeffsee/code/tinacms/packages/create-tina-app/src/index.ts
|
|
271
282
|
var program = new import_commander.Command(name);
|
|
272
283
|
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(`${
|
|
284
|
+
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
285
|
projectName = name2;
|
|
275
286
|
});
|
|
276
287
|
var run = async () => {
|
|
@@ -301,7 +312,6 @@ var run = async () => {
|
|
|
301
312
|
projectName = res2.name;
|
|
302
313
|
}
|
|
303
314
|
const dirName = projectName;
|
|
304
|
-
let isInternalExample = false;
|
|
305
315
|
if (!example) {
|
|
306
316
|
const res2 = await (0, import_prompts.default)({
|
|
307
317
|
name: "example",
|
|
@@ -310,7 +320,7 @@ var run = async () => {
|
|
|
310
320
|
choices: EXAMPLES
|
|
311
321
|
});
|
|
312
322
|
if (typeof res2.example !== "string") {
|
|
313
|
-
console.error(
|
|
323
|
+
console.error(import_chalk5.default.red("Input must be a string"));
|
|
314
324
|
(0, import_process.exit)(1);
|
|
315
325
|
}
|
|
316
326
|
example = res2.example;
|
|
@@ -335,29 +345,25 @@ var run = async () => {
|
|
|
335
345
|
console.log("Installing packages. This might take a couple of minutes.");
|
|
336
346
|
console.log();
|
|
337
347
|
await install(root, null, { useYarn, isOnline: true });
|
|
338
|
-
console.log(
|
|
348
|
+
console.log(import_chalk5.default.green("Finished installing all packages"));
|
|
339
349
|
console.log();
|
|
340
350
|
if (tryGitInit(root)) {
|
|
341
351
|
console.log("Initialized a git repository.");
|
|
342
352
|
console.log();
|
|
343
353
|
}
|
|
344
|
-
console.log(`${
|
|
345
|
-
console.log("
|
|
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.");
|
|
354
|
+
console.log(`${import_chalk5.default.green("Success!")} Created ${appName} at ${root}`);
|
|
355
|
+
console.log(import_chalk5.default.bold(" To launch your app, run:"));
|
|
355
356
|
console.log();
|
|
356
|
-
console.log("
|
|
357
|
+
console.log(import_chalk5.default.cyan(" cd"), appName);
|
|
358
|
+
console.log(` ${import_chalk5.default.cyan(`${displayedCommand} ${useYarn ? "" : "run "}dev`)}`);
|
|
357
359
|
console.log();
|
|
358
|
-
console.log(
|
|
359
|
-
console.log(` ${import_chalk4.default.cyan(`${displayedCommand} ${useYarn ? "" : "run "}dev`)}`);
|
|
360
|
+
console.log(import_chalk5.default.bold(" Next steps:"));
|
|
360
361
|
console.log();
|
|
362
|
+
console.log("- Go to http://localhost:3000/admin to enter edit-mode");
|
|
363
|
+
console.log("- Edit some content on http://localhost:3000 (See https://tina.io/using-tina-editor )");
|
|
364
|
+
console.log("- Check out our concept docs, to learn how Tina powers the starters under the hood. (See https://tina.io/docs/schema/)");
|
|
365
|
+
console.log("- Learn how Tina can be extended to create new field components. (See https://tina.io/docs/advanced/extending-tina/) ");
|
|
366
|
+
console.log("- Make your site editable with Tina on production. (See https://tina.io/docs/tina-cloud/ ");
|
|
361
367
|
};
|
|
362
368
|
run();
|
|
363
369
|
// 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.
|
|
26
|
-
"react-tinacms-inline": "^0.53.
|
|
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
|
},
|