flowershow 0.1.2 → 0.1.4
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/README.md +23 -1
- package/package.json +1 -1
- package/src/bin/cli.js +1 -1
- package/src/lib/Installer.js +8 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Flowershow CLI
|
|
2
2
|
|
|
3
|
+
## CLI commands
|
|
4
|
+
|
|
5
|
+
Install Flowershow:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npx flowershow@latest install
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Preview your Flowershow website:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx flowershow@latest preview
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Static build your website:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx flowershow@latest export
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
See all available commands:
|
|
24
|
+
|
|
3
25
|
```bash
|
|
4
|
-
npx flowershow --help
|
|
26
|
+
npx flowershow@latest --help
|
|
5
27
|
```
|
package/package.json
CHANGED
package/src/bin/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ const { version: cli } = require("../../package.json");
|
|
|
10
10
|
// import packageJson from "#package.json" assert { type: "json" };
|
|
11
11
|
const { version: node, platform, argv } = process;
|
|
12
12
|
if (platform === "win32") {
|
|
13
|
-
warn("This may not work as expected. You're trying to run
|
|
13
|
+
warn("This may not work as expected. You're trying to run Flowershow CLI on Windows, which is not thoroughly tested. Please submit an issue if you encounter any problems: https://github.com/flowershow/flowershow/issues");
|
|
14
14
|
}
|
|
15
15
|
const [, , cmd, ...args] = argv;
|
|
16
16
|
sendEvent({
|
package/src/lib/Installer.js
CHANGED
|
@@ -109,13 +109,13 @@ export default class Installer {
|
|
|
109
109
|
info(`No index.md file found in ${contentDir}. Flowershow will create one for you.`);
|
|
110
110
|
const homePageContent = "# Welcome to my Flowershow site!";
|
|
111
111
|
// eslint-disable-next-line no-unused-vars
|
|
112
|
-
fs.writeFile(`${contentPath}/index.md`, homePageContent, { flag: "a" }, (err) => { } // eslint-disable-line no-
|
|
112
|
+
fs.writeFile(`${contentPath}/index.md`, homePageContent, { flag: "a" }, (err) => { } // eslint-disable-line @typescript-eslint/no-empty-function
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
// // if there is no config.js file, create one
|
|
116
116
|
if (!fs.existsSync(`${contentPath}/config.js`)) {
|
|
117
117
|
info(`No config.js file found in ${contentDir}. Flowershow will create one for you.`);
|
|
118
|
-
fs.writeFile(`${contentPath}/config.js`, "{}", { flag: "a" }, (err) => { } // eslint-disable-line no-
|
|
118
|
+
fs.writeFile(`${contentPath}/config.js`, "const config = {};\nexport default config;", { flag: "a" }, (err) => { } // eslint-disable-line @typescript-eslint/no-empty-function
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
// create flowershow template
|
|
@@ -135,12 +135,16 @@ export default class Installer {
|
|
|
135
135
|
log(err);
|
|
136
136
|
exit(1);
|
|
137
137
|
}
|
|
138
|
+
// remove unneeded dev files
|
|
139
|
+
fs.rmSync(`${flowershowDir}/project.json`, { force: true });
|
|
140
|
+
fs.rmSync(`${flowershowDir}/.eslintrc.json`, { force: true });
|
|
141
|
+
fs.rmSync(`${flowershowDir}/jest.config.js`, { force: true });
|
|
138
142
|
// update content and assets symlinks
|
|
139
143
|
const contentSymlinkPath = path.relative(`${flowershowDir}`, contentDir);
|
|
140
|
-
fs.symlinkSync(contentSymlinkPath, `${flowershowDir}/content
|
|
144
|
+
fs.symlinkSync(contentSymlinkPath, `${flowershowDir}/content`, "junction");
|
|
141
145
|
if (assetsFolder !== "none") {
|
|
142
146
|
const assetsSymlinkPath = path.relative(`${flowershowDir}/public`, `${contentDir}/${assetsFolder}`);
|
|
143
|
-
fs.symlinkSync(assetsSymlinkPath, `${flowershowDir}/public/${assetsFolder}
|
|
147
|
+
fs.symlinkSync(assetsSymlinkPath, `${flowershowDir}/public/${assetsFolder}`, "junction");
|
|
144
148
|
}
|
|
145
149
|
// install flowershow dependencies
|
|
146
150
|
logWithSpinner({ symbol: "🌸", msg: `Installing Flowershow dependencies` });
|