create-tina-app 0.1.7 → 0.1.9

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.
@@ -1,4 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require = require('esm')(module)
4
3
  require('../dist')
package/dist/index.js CHANGED
@@ -50,22 +50,22 @@ var import_path4 = __toModule(require("path"));
50
50
 
51
51
  // package.json
52
52
  var name = "create-tina-app";
53
- var version = "0.1.7";
53
+ var version = "0.1.9";
54
54
 
55
55
  // src/util/fileUtil.ts
56
- var import_fs = __toModule(require("fs"));
56
+ var import_fs_extra = __toModule(require("fs-extra"));
57
57
  var import_path = __toModule(require("path"));
58
58
  var import_chalk = __toModule(require("chalk"));
59
59
  async function isWriteable(directory) {
60
60
  try {
61
- await import_fs.default.promises.access(directory, (import_fs.default.constants || import_fs.default).W_OK);
61
+ await import_fs_extra.default.promises.access(directory, (import_fs_extra.default.constants || import_fs_extra.default).W_OK);
62
62
  return true;
63
63
  } catch (err) {
64
64
  return false;
65
65
  }
66
66
  }
67
- function makeDir(root, options = { recursive: true }) {
68
- return import_fs.default.promises.mkdir(root, options);
67
+ function makeDir(root) {
68
+ return import_fs_extra.default.mkdirp(root);
69
69
  }
70
70
  function isFolderEmpty(root, name2) {
71
71
  const validFiles = [
@@ -88,13 +88,13 @@ function isFolderEmpty(root, name2) {
88
88
  "yarn-debug.log",
89
89
  "yarn-error.log"
90
90
  ];
91
- const conflicts = import_fs.default.readdirSync(root).filter((file) => !validFiles.includes(file)).filter((file) => !/\.iml$/.test(file));
91
+ const conflicts = import_fs_extra.default.readdirSync(root).filter((file) => !validFiles.includes(file)).filter((file) => !/\.iml$/.test(file));
92
92
  if (conflicts.length > 0) {
93
93
  console.log(`The directory ${import_chalk.default.green(name2)} contains files that could conflict:`);
94
94
  console.log();
95
95
  for (const file of conflicts) {
96
96
  try {
97
- const stats = import_fs.default.lstatSync(import_path.default.join(root, file));
97
+ const stats = import_fs_extra.default.lstatSync(import_path.default.join(root, file));
98
98
  if (stats.isDirectory()) {
99
99
  console.log(` ${import_chalk.default.blue(file)}/`);
100
100
  } else {
@@ -177,7 +177,7 @@ var import_chalk5 = __toModule(require("chalk"));
177
177
  var import_child_process = __toModule(require("child_process"));
178
178
  var import_path2 = __toModule(require("path"));
179
179
  var import_rimraf = __toModule(require("rimraf"));
180
- var import_fs_extra = __toModule(require("fs-extra"));
180
+ var import_fs_extra2 = __toModule(require("fs-extra"));
181
181
  var import_chalk3 = __toModule(require("chalk"));
182
182
  function isInGitRepository() {
183
183
  try {
@@ -202,9 +202,9 @@ function tryGitInit(root) {
202
202
  if (isInGitRepository() || isInMercurialRepository()) {
203
203
  return false;
204
204
  }
205
- if (!import_fs_extra.default.existsSync(".gitignore")) {
205
+ if (!import_fs_extra2.default.existsSync(".gitignore")) {
206
206
  console.warn(import_chalk3.default.yellow("There is no .gitignore file in this repository, creating one..."));
207
- import_fs_extra.default.writeFileSync(".gitignore", `node_modules
207
+ import_fs_extra2.default.writeFileSync(".gitignore", `node_modules
208
208
  .yarn/*
209
209
  .DS_Store
210
210
  .cache
@@ -261,7 +261,7 @@ function downloadAndExtractRepo(root, { username, name: name2, branch, filePath
261
261
 
262
262
  // src/examples.ts
263
263
  var import_chalk4 = __toModule(require("chalk"));
264
- var import_fs_extra2 = __toModule(require("fs-extra"));
264
+ var import_fs_extra3 = __toModule(require("fs-extra"));
265
265
  var import_path3 = __toModule(require("path"));
266
266
  var EXAMPLES = [
267
267
  {
@@ -292,7 +292,7 @@ var downloadExample = async (example, root) => {
292
292
  await downloadAndExtractRepo(root, repoInfo2);
293
293
  } else {
294
294
  const exampleFile = import_path3.default.join(__dirname, "..", "examples", example.value);
295
- await (0, import_fs_extra2.copy)(`${exampleFile}/`, "./");
295
+ await (0, import_fs_extra3.copy)(`${exampleFile}/`, "./");
296
296
  }
297
297
  };
298
298
 
@@ -11,7 +11,5 @@ See the License for the specific language governing permissions and
11
11
  limitations under the License.
12
12
  */
13
13
  export declare function isWriteable(directory: string): Promise<boolean>;
14
- export declare function makeDir(root: string, options?: {
15
- recursive: boolean;
16
- }): Promise<string | undefined>;
14
+ export declare function makeDir(root: string): Promise<void>;
17
15
  export declare function isFolderEmpty(root: string, name: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tina-app",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",
@@ -26,7 +26,7 @@
26
26
  "directory": "packages/create-tina-app"
27
27
  },
28
28
  "devDependencies": {
29
- "@tinacms/scripts": "0.51.1",
29
+ "@tinacms/scripts": "0.51.3",
30
30
  "@types/fs-extra": "^9.0.13",
31
31
  "@types/node": "^16.11.7",
32
32
  "@types/prompts": "^2.0.14",
@@ -38,7 +38,6 @@
38
38
  "chalk": "^4.1.2",
39
39
  "commander": "^8.3.0",
40
40
  "cross-spawn": "^7.0.3",
41
- "esm": "3.2.25",
42
41
  "fs-extra": "^10.0.0",
43
42
  "got": "^11.8.5",
44
43
  "prompts": "^2.4.2",