flowershow 0.1.3 → 0.1.5

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # flowershow
2
2
 
3
+ ## 0.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Replace config.js with config.mjs
8
+
9
+ ## 0.1.4
10
+
11
+ ### Patch Changes
12
+
13
+ - Fix: incorrect `config.js` file created by the CLI
14
+
15
+ ## 0.1.3
16
+
17
+ ### Patch Changes
18
+
19
+ - Remove unneeded dev files from cloned template.
20
+
3
21
  ## 0.1.0
4
22
 
5
23
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowershow",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Publish your digital garden",
5
5
  "bin": {
6
6
  "flowershow": "src/bin/cli.js"
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 Flowreshow CLI on Windows, which is not thoroughly tested. Please submit an issue if you encounter any problems: https://github.com/flowershow/flowershow/issues");
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({
@@ -109,13 +109,21 @@ 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-unused-vars
112
+ fs.writeFile(`${contentPath}/index.md`, homePageContent, { flag: "a" }, (err) => { } // eslint-disable-line @typescript-eslint/no-empty-function
113
113
  );
114
114
  }
115
- // // if there is no config.js file, create one
116
- if (!fs.existsSync(`${contentPath}/config.js`)) {
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-unused-vars
115
+ // if there is a config.js file from older flowershow, change it's extension.
116
+ if (fs.existsSync(`${contentPath}/config.js`)) {
117
+ fs.rename(`${contentPath}/config.js`, `${contentPath}/config.mjs`, (err) => {
118
+ if (err)
119
+ info(`Failed to rename ${contentPath}/config.js file`);
120
+ info(`Renamed config.js file in ${contentDir} to config.mjs`);
121
+ });
122
+ }
123
+ // // if there is no config.mjs file, create one
124
+ if (!fs.existsSync(`${contentPath}/config.mjs`)) {
125
+ info(`No config.mjs file found in ${contentDir}. Flowershow will create one for you.`);
126
+ fs.writeFile(`${contentPath}/config.mjs`, "const config = {};\nexport default config;", { flag: "a" }, (err) => { } // eslint-disable-line @typescript-eslint/no-empty-function
119
127
  );
120
128
  }
121
129
  // create flowershow template
@@ -141,10 +149,10 @@ export default class Installer {
141
149
  fs.rmSync(`${flowershowDir}/jest.config.js`, { force: true });
142
150
  // update content and assets symlinks
143
151
  const contentSymlinkPath = path.relative(`${flowershowDir}`, contentDir);
144
- fs.symlinkSync(contentSymlinkPath, `${flowershowDir}/content`);
152
+ fs.symlinkSync(contentSymlinkPath, `${flowershowDir}/content`, "junction");
145
153
  if (assetsFolder !== "none") {
146
154
  const assetsSymlinkPath = path.relative(`${flowershowDir}/public`, `${contentDir}/${assetsFolder}`);
147
- fs.symlinkSync(assetsSymlinkPath, `${flowershowDir}/public/${assetsFolder}`);
155
+ fs.symlinkSync(assetsSymlinkPath, `${flowershowDir}/public/${assetsFolder}`, "junction");
148
156
  }
149
157
  // install flowershow dependencies
150
158
  logWithSpinner({ symbol: "🌸", msg: `Installing Flowershow dependencies` });