create-jwn-js 1.0.8 → 1.0.9

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/index.js CHANGED
@@ -168,8 +168,9 @@ async function init() {
168
168
  }
169
169
 
170
170
  // connect.json
171
- const connect = require(path.join(templateDir, `connect-template.json`))
172
- write('connect.json', JSON.stringify(connect, null, 2))
171
+ const connect = require(path.join(templateDir, `connect-template.json`));
172
+ delete(connect.db);
173
+ write('connect.json', JSON.stringify(connect, null, 2));
173
174
 
174
175
  // package.json
175
176
  const pkg = require(path.join(templateDir, `package.json`))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-jwn-js",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "license": "PRIVATE",
5
5
  "author": "Webigorkiev",
6
6
  "bin": {
@@ -5,7 +5,7 @@ import {Query} from "buildmsql";
5
5
  * @param config
6
6
  */
7
7
  export const createMariadb = (config: Record<string, any>) => {
8
- if(config.db.home) {
8
+ if(config.db?.home) {
9
9
  const home = new Query({debug: process.env.NODE_ENV === "production" ? 0 : 1});
10
10
  const homePool = home.createPool(config.db.home);
11
11
 
@@ -58,8 +58,8 @@ const node = (opt: Options): Plugin => {
58
58
  }
59
59
  },
60
60
  async closeBundle() {
61
- await memcachedClient.close();
62
- await homePool.end();
61
+ memcachedClient && await memcachedClient.close();
62
+ homePool && await homePool.end();
63
63
  process.server.app && await process.server.app.close();
64
64
  }
65
65
  }
@@ -5,7 +5,7 @@ import {Query} from "buildmsql";
5
5
  * @param config
6
6
  */
7
7
  export const createMariadb = (config: Record<string, any>) => {
8
- if(config.db.home) {
8
+ if(config.db?.home) {
9
9
  const home = new Query({debug: process.env.NODE_ENV === "production" ? 0 : 1});
10
10
  const homePool = home.createPool(config.db.home);
11
11