flowershow 0.0.9 → 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 +12 -0
- package/package.json +3 -2
- package/src/bin/cli.js +39 -11
- package/src/lib/Installer.js +3 -1
- package/src/lib/{buildStatic.js → buildExport.js} +1 -1
- package/src/lib/utils/index.js +1 -0
- package/src/lib/utils/sendEvent.js +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# flowershow
|
|
2
2
|
|
|
3
|
+
## 0.0.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Basic anonymous telemetry (OS, Flowershow version and command being run).
|
|
8
|
+
|
|
9
|
+
## 0.0.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Rename `flowershow build-static` to `flowershow export`.
|
|
14
|
+
|
|
3
15
|
## 0.0.9
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
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
|
-
"This may not work as expected. You're trying to run Flowreshow CLI on Windows, which is not
|
|
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
|
|
|
@@ -54,16 +82,16 @@ program
|
|
|
54
82
|
});
|
|
55
83
|
|
|
56
84
|
program
|
|
57
|
-
.command("
|
|
58
|
-
.description("build static Flowershow website")
|
|
85
|
+
.command("export")
|
|
86
|
+
.description("build a static Flowershow website")
|
|
59
87
|
.argument(
|
|
60
88
|
"[project-dir]",
|
|
61
89
|
"Path to the folder where Flowershow template is installed (root folder of .flowershow)",
|
|
62
90
|
"."
|
|
63
91
|
)
|
|
64
92
|
.action(async (projectPath) => {
|
|
65
|
-
const { default:
|
|
66
|
-
|
|
93
|
+
const { default: buildExport } = await import("../lib/buildExport.js");
|
|
94
|
+
buildExport(projectPath);
|
|
67
95
|
});
|
|
68
96
|
|
|
69
97
|
program
|
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
|
|
|
@@ -3,7 +3,7 @@ import { execa } from "execa";
|
|
|
3
3
|
|
|
4
4
|
import { FLOWERSHOW_FOLDER_NAME } from "./const.js";
|
|
5
5
|
|
|
6
|
-
export default async function
|
|
6
|
+
export default async function buildExport(dir) {
|
|
7
7
|
const flowershowDir = path.resolve(dir, FLOWERSHOW_FOLDER_NAME);
|
|
8
8
|
|
|
9
9
|
const subprocess = execa("npm", ["run", "export"], { cwd: flowershowDir });
|
package/src/lib/utils/index.js
CHANGED