create-routify 1.1.1 → 1.2.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/README.md +3 -1
- package/package.json +3 -3
- package/src/bin.js +0 -1
- package/src/index.js +16 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Welcome to the new Routiy CLI! This CLI currently supports both version 2 & 3 (b
|
|
|
5
5
|
# Get Started
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm init routify
|
|
8
|
+
npm init routify@latest
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
# CLI Options
|
|
@@ -17,5 +17,7 @@ We have designed the cli to be able to be run in headless mode, as such the foll
|
|
|
17
17
|
```
|
|
18
18
|
npm init routify [directory-name]
|
|
19
19
|
|
|
20
|
+
-h, --help get the help menu
|
|
20
21
|
-v, --version use this to set the version of routify, e.g. 3
|
|
22
|
+
-f, --force this option bypasses directory checks, be careful as might overwrite files!
|
|
21
23
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-routify",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "A powerful cli for super-powering your routify development experience",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"log-symbols": "^5.1.0",
|
|
37
37
|
"minimist": "^1.2.5",
|
|
38
38
|
"prompts": "^2.4.2",
|
|
39
|
-
"update-notifier": "^5.0
|
|
39
|
+
"update-notifier": "^5.1.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/prompts": "^2.0.14",
|
|
43
43
|
"@types/update-notifier": "^5.1.0"
|
|
44
44
|
}
|
|
45
|
-
}
|
|
45
|
+
}
|
package/src/bin.js
CHANGED
package/src/index.js
CHANGED
|
@@ -12,6 +12,12 @@ const versions = {
|
|
|
12
12
|
3: () => import('./versions/three/index.js'),
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
+
const helpText = ` npm init routify [directory-name]
|
|
16
|
+
|
|
17
|
+
-h, --help get the help menu
|
|
18
|
+
-v, --version use this to set the version of routify, e.g. 3
|
|
19
|
+
-f, --force this option bypasses directory checks, be careful as might overwrite files!`;
|
|
20
|
+
|
|
15
21
|
async function getVersion(args) {
|
|
16
22
|
const argsVersion = args.v || args.version;
|
|
17
23
|
if (argsVersion) return argsVersion;
|
|
@@ -40,7 +46,12 @@ export const run = async ({ args }) => {
|
|
|
40
46
|
console.log(` ${k.bold().magenta('Routify')} ${k.magenta().dim('CLI')}`);
|
|
41
47
|
console.log();
|
|
42
48
|
|
|
49
|
+
if (args.h || args.help) {
|
|
50
|
+
return console.log(helpText);
|
|
51
|
+
}
|
|
52
|
+
|
|
43
53
|
const version = await getVersion(args);
|
|
54
|
+
const force = args.f || args.force;
|
|
44
55
|
|
|
45
56
|
if (!Object.keys(versions).includes(version.toString()))
|
|
46
57
|
return console.log(` ${k.red(`Version ${version} not found`)}`);
|
|
@@ -48,7 +59,11 @@ export const run = async ({ args }) => {
|
|
|
48
59
|
const projectName = args._[0] || '.';
|
|
49
60
|
const projectDir = resolve(projectName.toString());
|
|
50
61
|
|
|
51
|
-
if (
|
|
62
|
+
if (
|
|
63
|
+
existsSync(projectDir) &&
|
|
64
|
+
readdirSync(projectDir).length > 0 &&
|
|
65
|
+
!force
|
|
66
|
+
) {
|
|
52
67
|
const { proceed } = await prompts(
|
|
53
68
|
{
|
|
54
69
|
type: 'confirm',
|