flowershow 0.0.10 → 0.0.11
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 +6 -0
- package/package.json +3 -2
- package/src/bin/cli.js +34 -6
- package/src/lib/Installer.js +3 -1
- package/src/lib/utils/index.js +1 -0
- package/src/lib/utils/sendEvent.js +7 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowershow",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "Publish your digital garden",
|
|
5
5
|
"bin": {
|
|
6
6
|
"flowershow": "src/bin/cli.js"
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"degit": "^2.8.4",
|
|
30
30
|
"execa": "^6.1.0",
|
|
31
31
|
"inquirer": "^9.1.1",
|
|
32
|
-
"ora": "^6.1.2"
|
|
32
|
+
"ora": "^6.1.2",
|
|
33
|
+
"universal-analytics": "^0.5.3"
|
|
33
34
|
},
|
|
34
35
|
"type": "module",
|
|
35
36
|
"engines": {
|
package/src/bin/cli.js
CHANGED
|
@@ -1,20 +1,48 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
const require = createRequire(import.meta.url);
|
|
4
|
-
import { warn } from "../lib/utils/index.js";
|
|
4
|
+
import { warn, exit, sendEvent } from "../lib/utils/index.js";
|
|
5
|
+
import { Command } from "commander";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
// TODO check current vs required node version (package.json engines)
|
|
8
|
+
// const requiredNodeVersion = require("../package.json").engines.node;
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
const { version: cli } = require("../../package.json");
|
|
11
|
+
const { version: node, platform, argv } = process;
|
|
12
|
+
|
|
13
|
+
if (platform === "win32") {
|
|
9
14
|
warn(
|
|
10
15
|
"This may not work as expected. You're trying to run Flowreshow CLI on Windows, which is not thoroughly tested. Please submit an issue if you encounter any problems: https://github.com/flowershow/flowershow/issues"
|
|
11
16
|
);
|
|
12
17
|
}
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
const [, , cmd, ...args] = argv;
|
|
20
|
+
sendEvent({
|
|
21
|
+
event: "cli-usage",
|
|
22
|
+
action: cmd,
|
|
23
|
+
meta: {
|
|
24
|
+
args,
|
|
25
|
+
cli,
|
|
26
|
+
node,
|
|
27
|
+
platform,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
16
30
|
|
|
17
|
-
|
|
31
|
+
process.on("uncaughtException", () => {
|
|
32
|
+
sendEvent({
|
|
33
|
+
event: "cli-error",
|
|
34
|
+
action: cmd,
|
|
35
|
+
meta: {
|
|
36
|
+
args,
|
|
37
|
+
cli,
|
|
38
|
+
node,
|
|
39
|
+
platform,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
exit(1);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// CLI commands
|
|
18
46
|
|
|
19
47
|
const program = new Command();
|
|
20
48
|
|
package/src/lib/Installer.js
CHANGED
|
@@ -180,7 +180,9 @@ export default class Installer {
|
|
|
180
180
|
const emitter = degit(templateRepo);
|
|
181
181
|
await emitter.clone(flowershowDir);
|
|
182
182
|
} catch {
|
|
183
|
-
error(
|
|
183
|
+
error(
|
|
184
|
+
`Failed to clone Flowershow template into ${flowershowDir}. This may be a problem with Flowershow. Please let us know about it by submitting an issue: https://github.com/flowershow/flowershow/issues.`
|
|
185
|
+
);
|
|
184
186
|
exit(1);
|
|
185
187
|
}
|
|
186
188
|
|
package/src/lib/utils/index.js
CHANGED